git normalize all files

This commit is contained in:
Ryan Fleury
2024-07-26 11:13:47 -07:00
parent c13833f74f
commit b18e437337
162 changed files with 54806 additions and 54806 deletions
+159 -159
View File
@@ -1,159 +1,159 @@
// Copyright (c) 2024 Epic Games Tools
// Licensed under the MIT license (https://opensource.org/license/mit/)
//- rjf: stack table
@table(name, name_lower, type, default)
UI_StackTable:
{
//- rjf: parents
{ Parent parent `UI_Box *` `&ui_g_nil_box` }
//- rjf: layout params
{ ChildLayoutAxis child_layout_axis Axis2 `Axis2_X` }
//- rjf: size/position
{ FixedX fixed_x F32 0 }
{ FixedY fixed_y F32 0 }
{ FixedWidth fixed_width F32 0 }
{ FixedHeight fixed_height F32 0 }
{ PrefWidth pref_width UI_Size `ui_px(250.f, 1.f)` }
{ PrefHeight pref_height UI_Size `ui_px(30.f, 1.f)` }
//- rjf: flags
{ Flags flags UI_BoxFlags 0 }
//- rjf: interaction
{ FocusHot focus_hot UI_FocusKind UI_FocusKind_Null }
{ FocusActive focus_active UI_FocusKind UI_FocusKind_Null }
{ FastpathCodepoint fastpath_codepoint U32 0 }
{ GroupKey group_key UI_Key `ui_key_zero()` }
//- rjf: colors
{ Transparency transparency F32 0 }
{ Palette palette `UI_Palette* ` `&ui_g_nil_palette` }
//- rjf: squish
{ Squish squish F32 0 }
//- rjf: hover cursor
{ HoverCursor hover_cursor OS_Cursor OS_Cursor_Pointer }
//- rjf: font
{ Font font F_Tag `f_tag_zero()` }
{ FontSize font_size F32 24.f }
{ TextRasterFlags text_raster_flags F_RasterFlags F_RasterFlag_Hinted }
{ TabSize tab_size F32 `24.f*4.f` }
//- rjf: corner radii
{ CornerRadius00 corner_radius_00 F32 0 }
{ CornerRadius01 corner_radius_01 F32 0 }
{ CornerRadius10 corner_radius_10 F32 0 }
{ CornerRadius11 corner_radius_11 F32 0 }
//- rjf: blur size
{ BlurSize blur_size F32 0 }
//- rjf: text parameters
{ TextPadding text_padding F32 0 }
{ TextAlignment text_alignment UI_TextAlign UI_TextAlign_Left }
}
//- rjf: declaring stack node types
@gen
{
@expand(UI_StackTable a) `typedef struct UI_$(a.name)Node UI_$(a.name)Node; struct UI_$(a.name)Node{UI_$(a.name)Node *next; $(a.type) v;};`
}
//- rjf: declaring all default stack tops
@gen
{
`#define UI_DeclStackNils \\`;
`struct\\`;
`{\\`;
@expand(UI_StackTable a) `UI_$(a.name)Node $(a.name_lower)_nil_stack_top;\\`;
`}`;
}
//- rjf: initializing all default stack tops
@gen
{
`#define UI_InitStackNils(state) \\`;
@expand(UI_StackTable a) `state->$(a.name_lower)_nil_stack_top.v = $(a.default);\\`;
``;
}
//- rjf: declaring all stack nodes & free lists
@gen
{
`#define UI_DeclStacks \\`;
`struct\\`;
`{\\`;
@expand(UI_StackTable a) `struct { UI_$(a.name)Node *top; $(a.type) bottom_val; UI_$(a.name)Node *free; B32 auto_pop; } $(a.name_lower)_stack;\\`;
`}`;
}
//- rjf: initing all stack nodes
@gen
{
`#define UI_InitStacks(state) \\`;
@expand(UI_StackTable a) `state->$(a.name_lower)_stack.top = &state->$(a.name_lower)_nil_stack_top; state->$(a.name_lower)_stack.bottom_val = $(a.default); state->$(a.name_lower)_stack.free = 0; state->$(a.name_lower)_stack.auto_pop = 0;\\`;
``;
}
//- rjf: auto-popping all stacks
@gen
{
`#define UI_AutoPopStacks(state) \\`
@expand(UI_StackTable a)
`if(state->$(a.name_lower)_stack.auto_pop) { ui_pop_$(a.name_lower)(); state->$(a.name_lower)_stack.auto_pop = 0; }\\`;
``;
}
//- rjf: decls for the stack function operation headers
@gen
{
@expand(UI_StackTable a)
`internal $(a.type) $(=>35) ui_top_$(a.name_lower)(void);`
@expand(UI_StackTable a)
`internal $(a.type) $(=>35) ui_bottom_$(a.name_lower)(void);`
@expand(UI_StackTable a)
`internal $(a.type) $(=>35) ui_push_$(a.name_lower)($(a.type) v);`
@expand(UI_StackTable a)
`internal $(a.type) $(=>35) ui_pop_$(a.name_lower)(void);`
@expand(UI_StackTable a)
`internal $(a.type) $(=>35) ui_set_next_$(a.name_lower)($(a.type) v);`
}
//- rjf: defer-loop helpers
@gen @c_file
{
`#if 0`;
@expand(UI_StackTable a)
`#define UI_$(a.name)(v) DeferLoop(ui_push_$(a.name_lower)(v), ui_pop_$(a.name_lower)())`
`#endif`;
}
//- rjf: decls for the stack operation implementations
@gen @c_file
{
@expand(UI_StackTable a)
`internal $(a.type) ui_top_$(a.name_lower)(void) { UI_StackTopImpl(ui_state, $(a.name), $(a.name_lower)) }`;
@expand(UI_StackTable a)
`internal $(a.type) ui_bottom_$(a.name_lower)(void) { UI_StackBottomImpl(ui_state, $(a.name), $(a.name_lower)) }`;
@expand(UI_StackTable a)
`internal $(a.type) ui_push_$(a.name_lower)($(a.type) v) { UI_StackPushImpl(ui_state, $(a.name), $(a.name_lower), $(a.type), v) }`;
@expand(UI_StackTable a)
`internal $(a.type) ui_pop_$(a.name_lower)(void) { UI_StackPopImpl(ui_state, $(a.name), $(a.name_lower)) }`;
@expand(UI_StackTable a)
`internal $(a.type) ui_set_next_$(a.name_lower)($(a.type) v) { UI_StackSetNextImpl(ui_state, $(a.name), $(a.name_lower), $(a.type), v) }`;
}
// Copyright (c) 2024 Epic Games Tools
// Licensed under the MIT license (https://opensource.org/license/mit/)
//- rjf: stack table
@table(name, name_lower, type, default)
UI_StackTable:
{
//- rjf: parents
{ Parent parent `UI_Box *` `&ui_g_nil_box` }
//- rjf: layout params
{ ChildLayoutAxis child_layout_axis Axis2 `Axis2_X` }
//- rjf: size/position
{ FixedX fixed_x F32 0 }
{ FixedY fixed_y F32 0 }
{ FixedWidth fixed_width F32 0 }
{ FixedHeight fixed_height F32 0 }
{ PrefWidth pref_width UI_Size `ui_px(250.f, 1.f)` }
{ PrefHeight pref_height UI_Size `ui_px(30.f, 1.f)` }
//- rjf: flags
{ Flags flags UI_BoxFlags 0 }
//- rjf: interaction
{ FocusHot focus_hot UI_FocusKind UI_FocusKind_Null }
{ FocusActive focus_active UI_FocusKind UI_FocusKind_Null }
{ FastpathCodepoint fastpath_codepoint U32 0 }
{ GroupKey group_key UI_Key `ui_key_zero()` }
//- rjf: colors
{ Transparency transparency F32 0 }
{ Palette palette `UI_Palette* ` `&ui_g_nil_palette` }
//- rjf: squish
{ Squish squish F32 0 }
//- rjf: hover cursor
{ HoverCursor hover_cursor OS_Cursor OS_Cursor_Pointer }
//- rjf: font
{ Font font F_Tag `f_tag_zero()` }
{ FontSize font_size F32 24.f }
{ TextRasterFlags text_raster_flags F_RasterFlags F_RasterFlag_Hinted }
{ TabSize tab_size F32 `24.f*4.f` }
//- rjf: corner radii
{ CornerRadius00 corner_radius_00 F32 0 }
{ CornerRadius01 corner_radius_01 F32 0 }
{ CornerRadius10 corner_radius_10 F32 0 }
{ CornerRadius11 corner_radius_11 F32 0 }
//- rjf: blur size
{ BlurSize blur_size F32 0 }
//- rjf: text parameters
{ TextPadding text_padding F32 0 }
{ TextAlignment text_alignment UI_TextAlign UI_TextAlign_Left }
}
//- rjf: declaring stack node types
@gen
{
@expand(UI_StackTable a) `typedef struct UI_$(a.name)Node UI_$(a.name)Node; struct UI_$(a.name)Node{UI_$(a.name)Node *next; $(a.type) v;};`
}
//- rjf: declaring all default stack tops
@gen
{
`#define UI_DeclStackNils \\`;
`struct\\`;
`{\\`;
@expand(UI_StackTable a) `UI_$(a.name)Node $(a.name_lower)_nil_stack_top;\\`;
`}`;
}
//- rjf: initializing all default stack tops
@gen
{
`#define UI_InitStackNils(state) \\`;
@expand(UI_StackTable a) `state->$(a.name_lower)_nil_stack_top.v = $(a.default);\\`;
``;
}
//- rjf: declaring all stack nodes & free lists
@gen
{
`#define UI_DeclStacks \\`;
`struct\\`;
`{\\`;
@expand(UI_StackTable a) `struct { UI_$(a.name)Node *top; $(a.type) bottom_val; UI_$(a.name)Node *free; B32 auto_pop; } $(a.name_lower)_stack;\\`;
`}`;
}
//- rjf: initing all stack nodes
@gen
{
`#define UI_InitStacks(state) \\`;
@expand(UI_StackTable a) `state->$(a.name_lower)_stack.top = &state->$(a.name_lower)_nil_stack_top; state->$(a.name_lower)_stack.bottom_val = $(a.default); state->$(a.name_lower)_stack.free = 0; state->$(a.name_lower)_stack.auto_pop = 0;\\`;
``;
}
//- rjf: auto-popping all stacks
@gen
{
`#define UI_AutoPopStacks(state) \\`
@expand(UI_StackTable a)
`if(state->$(a.name_lower)_stack.auto_pop) { ui_pop_$(a.name_lower)(); state->$(a.name_lower)_stack.auto_pop = 0; }\\`;
``;
}
//- rjf: decls for the stack function operation headers
@gen
{
@expand(UI_StackTable a)
`internal $(a.type) $(=>35) ui_top_$(a.name_lower)(void);`
@expand(UI_StackTable a)
`internal $(a.type) $(=>35) ui_bottom_$(a.name_lower)(void);`
@expand(UI_StackTable a)
`internal $(a.type) $(=>35) ui_push_$(a.name_lower)($(a.type) v);`
@expand(UI_StackTable a)
`internal $(a.type) $(=>35) ui_pop_$(a.name_lower)(void);`
@expand(UI_StackTable a)
`internal $(a.type) $(=>35) ui_set_next_$(a.name_lower)($(a.type) v);`
}
//- rjf: defer-loop helpers
@gen @c_file
{
`#if 0`;
@expand(UI_StackTable a)
`#define UI_$(a.name)(v) DeferLoop(ui_push_$(a.name_lower)(v), ui_pop_$(a.name_lower)())`
`#endif`;
}
//- rjf: decls for the stack operation implementations
@gen @c_file
{
@expand(UI_StackTable a)
`internal $(a.type) ui_top_$(a.name_lower)(void) { UI_StackTopImpl(ui_state, $(a.name), $(a.name_lower)) }`;
@expand(UI_StackTable a)
`internal $(a.type) ui_bottom_$(a.name_lower)(void) { UI_StackBottomImpl(ui_state, $(a.name), $(a.name_lower)) }`;
@expand(UI_StackTable a)
`internal $(a.type) ui_push_$(a.name_lower)($(a.type) v) { UI_StackPushImpl(ui_state, $(a.name), $(a.name_lower), $(a.type), v) }`;
@expand(UI_StackTable a)
`internal $(a.type) ui_pop_$(a.name_lower)(void) { UI_StackPopImpl(ui_state, $(a.name), $(a.name_lower)) }`;
@expand(UI_StackTable a)
`internal $(a.type) ui_set_next_$(a.name_lower)($(a.type) v) { UI_StackSetNextImpl(ui_state, $(a.name), $(a.name_lower), $(a.type), v) }`;
}
+1522 -1522
View File
File diff suppressed because it is too large Load Diff
+183 -183
View File
@@ -1,183 +1,183 @@
// Copyright (c) 2024 Epic Games Tools
// Licensed under the MIT license (https://opensource.org/license/mit/)
#ifndef UI_BASIC_WIDGETS_H
#define UI_BASIC_WIDGETS_H
////////////////////////////////
//~ rjf: Scroll List Types
typedef U32 UI_ScrollListFlags;
enum
{
UI_ScrollListFlag_Nav = (1<<0),
UI_ScrollListFlag_Snap = (1<<1),
UI_ScrollListFlag_All = 0xffffffff,
};
typedef struct UI_ScrollListRowBlock UI_ScrollListRowBlock;
struct UI_ScrollListRowBlock
{
U64 row_count;
U64 item_count;
};
typedef struct UI_ScrollListRowBlockChunkNode UI_ScrollListRowBlockChunkNode;
struct UI_ScrollListRowBlockChunkNode
{
UI_ScrollListRowBlockChunkNode *next;
UI_ScrollListRowBlock *v;
U64 count;
U64 cap;
};
typedef struct UI_ScrollListRowBlockChunkList UI_ScrollListRowBlockChunkList;
struct UI_ScrollListRowBlockChunkList
{
UI_ScrollListRowBlockChunkNode *first;
UI_ScrollListRowBlockChunkNode *last;
U64 chunk_count;
U64 total_count;
};
typedef struct UI_ScrollListRowBlockArray UI_ScrollListRowBlockArray;
struct UI_ScrollListRowBlockArray
{
UI_ScrollListRowBlock *v;
U64 count;
};
typedef struct UI_ScrollListParams UI_ScrollListParams;
struct UI_ScrollListParams
{
UI_ScrollListFlags flags;
Vec2F32 dim_px;
F32 row_height_px;
UI_ScrollListRowBlockArray row_blocks;
Rng2S64 cursor_range;
Rng1S64 item_range;
B32 cursor_min_is_empty_selection[Axis2_COUNT];
};
typedef struct UI_ScrollListSignal UI_ScrollListSignal;
struct UI_ScrollListSignal
{
B32 cursor_moved;
};
////////////////////////////////
//~ rjf: Basic Widgets
internal void ui_divider(UI_Size size);
internal UI_Signal ui_label(String8 string);
internal UI_Signal ui_labelf(char *fmt, ...);
internal void ui_label_multiline(F32 max, String8 string);
internal void ui_label_multilinef(F32 max, char *fmt, ...);
internal UI_Signal ui_button(String8 string);
internal UI_Signal ui_buttonf(char *fmt, ...);
internal UI_Signal ui_hover_label(String8 string);
internal UI_Signal ui_hover_labelf(char *fmt, ...);
internal UI_Signal ui_line_edit(TxtPt *cursor, TxtPt *mark, U8 *edit_buffer, U64 edit_buffer_size, U64 *edit_string_size_out, String8 pre_edit_value, String8 string);
internal UI_Signal ui_line_editf(TxtPt *cursor, TxtPt *mark, U8 *edit_buffer, U64 edit_buffer_size, U64 *edit_string_size_out, String8 pre_edit_value, char *fmt, ...);
////////////////////////////////
//~ rjf: Images
internal UI_Signal ui_image(R_Handle texture, R_Tex2DSampleKind sample_kind, Rng2F32 region, Vec4F32 tint, F32 blur, String8 string);
internal UI_Signal ui_imagef(R_Handle texture, R_Tex2DSampleKind sample_kind, Rng2F32 region, Vec4F32 tint, F32 blur, char *fmt, ...);
////////////////////////////////
//~ rjf: Special Buttons
internal UI_Signal ui_expander(B32 is_expanded, String8 string);
internal UI_Signal ui_expanderf(B32 is_expanded, char *fmt, ...);
internal UI_Signal ui_sort_header(B32 sorting, B32 ascending, String8 string);
internal UI_Signal ui_sort_headerf(B32 sorting, B32 ascending, char *fmt, ...);
////////////////////////////////
//~ rjf: Color Pickers
//- rjf: tooltips
internal void ui_do_color_tooltip_hsv(Vec3F32 hsv);
internal void ui_do_color_tooltip_hsva(Vec4F32 hsva);
//- rjf: saturation/value picker
internal UI_Signal ui_sat_val_picker(F32 hue, F32 *out_sat, F32 *out_val, String8 string);
internal UI_Signal ui_sat_val_pickerf(F32 hue, F32 *out_sat, F32 *out_val, char *fmt, ...);
//- rjf: hue picker
internal UI_Signal ui_hue_picker(F32 *out_hue, F32 sat, F32 val, String8 string);
internal UI_Signal ui_hue_pickerf(F32 *out_hue, F32 sat, F32 val, char *fmt, ...);
//- rjf: alpha picker
internal UI_Signal ui_alpha_picker(F32 *out_alpha, String8 string);
internal UI_Signal ui_alpha_pickerf(F32 *out_alpha, char *fmt, ...);
////////////////////////////////
//~ rjf: Simple Layout Widgets
internal UI_Box *ui_row_begin(void);
internal UI_Signal ui_row_end(void);
internal UI_Box *ui_column_begin(void);
internal UI_Signal ui_column_end(void);
internal UI_Box *ui_named_row_begin(String8 string);
internal UI_Signal ui_named_row_end(void);
internal UI_Box *ui_named_column_begin(String8 string);
internal UI_Signal ui_named_column_end(void);
////////////////////////////////
//~ rjf: Floating Panes
internal UI_Box *ui_pane_begin(Rng2F32 rect, String8 string);
internal UI_Box *ui_pane_beginf(Rng2F32 rect, char *fmt, ...);
internal UI_Signal ui_pane_end(void);
////////////////////////////////
//~ rjf: Tables
internal void ui_table_begin(U64 column_pct_count, F32 **column_pcts, String8 string);
internal void ui_table_beginf(U64 column_pct_count, F32 **column_pcts, char *fmt, ...);
internal void ui_table_end(void);
internal UI_Box * ui_named_table_vector_begin(String8 string);
internal UI_Box * ui_named_table_vector_beginf(char *fmt, ...);
internal UI_Box * ui_table_vector_begin(void);
internal UI_Signal ui_table_vector_end(void);
internal UI_Box * ui_table_cell_begin(void);
internal UI_Signal ui_table_cell_end(void);
internal UI_Box * ui_table_cell_sized_begin(UI_Size size);
////////////////////////////////
//~ rjf: Scroll Regions
internal void ui_scroll_list_row_block_chunk_list_push(Arena *arena, UI_ScrollListRowBlockChunkList *list, U64 cap, UI_ScrollListRowBlock *block);
internal UI_ScrollListRowBlockArray ui_scroll_list_row_block_array_from_chunk_list(Arena *arena, UI_ScrollListRowBlockChunkList *list);
internal U64 ui_scroll_list_row_from_item(UI_ScrollListRowBlockArray *blocks, U64 item);
internal U64 ui_scroll_list_item_from_row(UI_ScrollListRowBlockArray *blocks, U64 row);
internal UI_ScrollPt ui_scroll_bar(Axis2 axis, UI_Size off_axis_size, UI_ScrollPt pt, Rng1S64 idx_range, S64 view_num_indices);
internal void ui_scroll_list_begin(UI_ScrollListParams *params, UI_ScrollPt *scroll_pt_out, Vec2S64 *cursor_out, Vec2S64 *mark_out, Rng1S64 *visible_row_range_out, UI_ScrollListSignal *signal_out);
internal void ui_scroll_list_end(void);
////////////////////////////////
//~ rjf: Macro Loop Wrappers
#define UI_Row DeferLoop(ui_row_begin(), ui_row_end())
#define UI_Column DeferLoop(ui_column_begin(), ui_column_end())
#define UI_NamedRow(s) DeferLoop(ui_named_row_begin(s), ui_named_row_end())
#define UI_NamedColumn(s) DeferLoop(ui_named_column_begin(s), ui_named_column_end())
#define UI_Pane(r, s) DeferLoop(ui_pane_begin(r, s), ui_pane_end())
#define UI_PaneF(r, ...) DeferLoop(ui_pane_beginf(r, __VA_ARGS__), ui_pane_end())
#define UI_Padding(size) DeferLoop(ui_spacer(size), ui_spacer(size))
#define UI_Center UI_Padding(ui_pct(1, 0))
#define UI_Table(col_pct_count, col_pcts, s) DeferLoop(ui_table_begin(col_pct_count, col_pcts, s), ui_table_end())
#define UI_TableF(col_pct_count, col_pcts, ...) DeferLoop(ui_table_beginf(col_pct_count, col_pcts, __VA_ARGS__), ui_table_end())
#define UI_NamedTableVector(s) DeferLoop(ui_named_table_vector_begin(s), ui_table_vector_end())
#define UI_NamedTableVectorF(...) DeferLoop(ui_named_table_vector_beginf(__VA_ARGS__), ui_table_vector_end())
#define UI_TableVector DeferLoop(ui_table_vector_begin(), ui_table_vector_end())
#define UI_TableCell DeferLoop(ui_table_cell_begin(), ui_table_cell_end())
#define UI_TableCellSized(size) DeferLoop(ui_table_cell_sized_begin(size), ui_table_cell_end())
#define UI_ScrollList(params, scroll_pt_out, cursor_out, mark_out, visible_row_range_out, signal_out) DeferLoop(ui_scroll_list_begin((params), (scroll_pt_out), (cursor_out), (mark_out), (visible_row_range_out), (signal_out)), ui_scroll_list_end())
#endif // UI_BASIC_WIDGETS_H
// Copyright (c) 2024 Epic Games Tools
// Licensed under the MIT license (https://opensource.org/license/mit/)
#ifndef UI_BASIC_WIDGETS_H
#define UI_BASIC_WIDGETS_H
////////////////////////////////
//~ rjf: Scroll List Types
typedef U32 UI_ScrollListFlags;
enum
{
UI_ScrollListFlag_Nav = (1<<0),
UI_ScrollListFlag_Snap = (1<<1),
UI_ScrollListFlag_All = 0xffffffff,
};
typedef struct UI_ScrollListRowBlock UI_ScrollListRowBlock;
struct UI_ScrollListRowBlock
{
U64 row_count;
U64 item_count;
};
typedef struct UI_ScrollListRowBlockChunkNode UI_ScrollListRowBlockChunkNode;
struct UI_ScrollListRowBlockChunkNode
{
UI_ScrollListRowBlockChunkNode *next;
UI_ScrollListRowBlock *v;
U64 count;
U64 cap;
};
typedef struct UI_ScrollListRowBlockChunkList UI_ScrollListRowBlockChunkList;
struct UI_ScrollListRowBlockChunkList
{
UI_ScrollListRowBlockChunkNode *first;
UI_ScrollListRowBlockChunkNode *last;
U64 chunk_count;
U64 total_count;
};
typedef struct UI_ScrollListRowBlockArray UI_ScrollListRowBlockArray;
struct UI_ScrollListRowBlockArray
{
UI_ScrollListRowBlock *v;
U64 count;
};
typedef struct UI_ScrollListParams UI_ScrollListParams;
struct UI_ScrollListParams
{
UI_ScrollListFlags flags;
Vec2F32 dim_px;
F32 row_height_px;
UI_ScrollListRowBlockArray row_blocks;
Rng2S64 cursor_range;
Rng1S64 item_range;
B32 cursor_min_is_empty_selection[Axis2_COUNT];
};
typedef struct UI_ScrollListSignal UI_ScrollListSignal;
struct UI_ScrollListSignal
{
B32 cursor_moved;
};
////////////////////////////////
//~ rjf: Basic Widgets
internal void ui_divider(UI_Size size);
internal UI_Signal ui_label(String8 string);
internal UI_Signal ui_labelf(char *fmt, ...);
internal void ui_label_multiline(F32 max, String8 string);
internal void ui_label_multilinef(F32 max, char *fmt, ...);
internal UI_Signal ui_button(String8 string);
internal UI_Signal ui_buttonf(char *fmt, ...);
internal UI_Signal ui_hover_label(String8 string);
internal UI_Signal ui_hover_labelf(char *fmt, ...);
internal UI_Signal ui_line_edit(TxtPt *cursor, TxtPt *mark, U8 *edit_buffer, U64 edit_buffer_size, U64 *edit_string_size_out, String8 pre_edit_value, String8 string);
internal UI_Signal ui_line_editf(TxtPt *cursor, TxtPt *mark, U8 *edit_buffer, U64 edit_buffer_size, U64 *edit_string_size_out, String8 pre_edit_value, char *fmt, ...);
////////////////////////////////
//~ rjf: Images
internal UI_Signal ui_image(R_Handle texture, R_Tex2DSampleKind sample_kind, Rng2F32 region, Vec4F32 tint, F32 blur, String8 string);
internal UI_Signal ui_imagef(R_Handle texture, R_Tex2DSampleKind sample_kind, Rng2F32 region, Vec4F32 tint, F32 blur, char *fmt, ...);
////////////////////////////////
//~ rjf: Special Buttons
internal UI_Signal ui_expander(B32 is_expanded, String8 string);
internal UI_Signal ui_expanderf(B32 is_expanded, char *fmt, ...);
internal UI_Signal ui_sort_header(B32 sorting, B32 ascending, String8 string);
internal UI_Signal ui_sort_headerf(B32 sorting, B32 ascending, char *fmt, ...);
////////////////////////////////
//~ rjf: Color Pickers
//- rjf: tooltips
internal void ui_do_color_tooltip_hsv(Vec3F32 hsv);
internal void ui_do_color_tooltip_hsva(Vec4F32 hsva);
//- rjf: saturation/value picker
internal UI_Signal ui_sat_val_picker(F32 hue, F32 *out_sat, F32 *out_val, String8 string);
internal UI_Signal ui_sat_val_pickerf(F32 hue, F32 *out_sat, F32 *out_val, char *fmt, ...);
//- rjf: hue picker
internal UI_Signal ui_hue_picker(F32 *out_hue, F32 sat, F32 val, String8 string);
internal UI_Signal ui_hue_pickerf(F32 *out_hue, F32 sat, F32 val, char *fmt, ...);
//- rjf: alpha picker
internal UI_Signal ui_alpha_picker(F32 *out_alpha, String8 string);
internal UI_Signal ui_alpha_pickerf(F32 *out_alpha, char *fmt, ...);
////////////////////////////////
//~ rjf: Simple Layout Widgets
internal UI_Box *ui_row_begin(void);
internal UI_Signal ui_row_end(void);
internal UI_Box *ui_column_begin(void);
internal UI_Signal ui_column_end(void);
internal UI_Box *ui_named_row_begin(String8 string);
internal UI_Signal ui_named_row_end(void);
internal UI_Box *ui_named_column_begin(String8 string);
internal UI_Signal ui_named_column_end(void);
////////////////////////////////
//~ rjf: Floating Panes
internal UI_Box *ui_pane_begin(Rng2F32 rect, String8 string);
internal UI_Box *ui_pane_beginf(Rng2F32 rect, char *fmt, ...);
internal UI_Signal ui_pane_end(void);
////////////////////////////////
//~ rjf: Tables
internal void ui_table_begin(U64 column_pct_count, F32 **column_pcts, String8 string);
internal void ui_table_beginf(U64 column_pct_count, F32 **column_pcts, char *fmt, ...);
internal void ui_table_end(void);
internal UI_Box * ui_named_table_vector_begin(String8 string);
internal UI_Box * ui_named_table_vector_beginf(char *fmt, ...);
internal UI_Box * ui_table_vector_begin(void);
internal UI_Signal ui_table_vector_end(void);
internal UI_Box * ui_table_cell_begin(void);
internal UI_Signal ui_table_cell_end(void);
internal UI_Box * ui_table_cell_sized_begin(UI_Size size);
////////////////////////////////
//~ rjf: Scroll Regions
internal void ui_scroll_list_row_block_chunk_list_push(Arena *arena, UI_ScrollListRowBlockChunkList *list, U64 cap, UI_ScrollListRowBlock *block);
internal UI_ScrollListRowBlockArray ui_scroll_list_row_block_array_from_chunk_list(Arena *arena, UI_ScrollListRowBlockChunkList *list);
internal U64 ui_scroll_list_row_from_item(UI_ScrollListRowBlockArray *blocks, U64 item);
internal U64 ui_scroll_list_item_from_row(UI_ScrollListRowBlockArray *blocks, U64 row);
internal UI_ScrollPt ui_scroll_bar(Axis2 axis, UI_Size off_axis_size, UI_ScrollPt pt, Rng1S64 idx_range, S64 view_num_indices);
internal void ui_scroll_list_begin(UI_ScrollListParams *params, UI_ScrollPt *scroll_pt_out, Vec2S64 *cursor_out, Vec2S64 *mark_out, Rng1S64 *visible_row_range_out, UI_ScrollListSignal *signal_out);
internal void ui_scroll_list_end(void);
////////////////////////////////
//~ rjf: Macro Loop Wrappers
#define UI_Row DeferLoop(ui_row_begin(), ui_row_end())
#define UI_Column DeferLoop(ui_column_begin(), ui_column_end())
#define UI_NamedRow(s) DeferLoop(ui_named_row_begin(s), ui_named_row_end())
#define UI_NamedColumn(s) DeferLoop(ui_named_column_begin(s), ui_named_column_end())
#define UI_Pane(r, s) DeferLoop(ui_pane_begin(r, s), ui_pane_end())
#define UI_PaneF(r, ...) DeferLoop(ui_pane_beginf(r, __VA_ARGS__), ui_pane_end())
#define UI_Padding(size) DeferLoop(ui_spacer(size), ui_spacer(size))
#define UI_Center UI_Padding(ui_pct(1, 0))
#define UI_Table(col_pct_count, col_pcts, s) DeferLoop(ui_table_begin(col_pct_count, col_pcts, s), ui_table_end())
#define UI_TableF(col_pct_count, col_pcts, ...) DeferLoop(ui_table_beginf(col_pct_count, col_pcts, __VA_ARGS__), ui_table_end())
#define UI_NamedTableVector(s) DeferLoop(ui_named_table_vector_begin(s), ui_table_vector_end())
#define UI_NamedTableVectorF(...) DeferLoop(ui_named_table_vector_beginf(__VA_ARGS__), ui_table_vector_end())
#define UI_TableVector DeferLoop(ui_table_vector_begin(), ui_table_vector_end())
#define UI_TableCell DeferLoop(ui_table_cell_begin(), ui_table_cell_end())
#define UI_TableCellSized(size) DeferLoop(ui_table_cell_sized_begin(size), ui_table_cell_end())
#define UI_ScrollList(params, scroll_pt_out, cursor_out, mark_out, visible_row_range_out, signal_out) DeferLoop(ui_scroll_list_begin((params), (scroll_pt_out), (cursor_out), (mark_out), (visible_row_range_out), (signal_out)), ui_scroll_list_end())
#endif // UI_BASIC_WIDGETS_H
+1035 -1035
View File
File diff suppressed because it is too large Load Diff
+8 -8
View File
@@ -1,8 +1,8 @@
// Copyright (c) 2024 Epic Games Tools
// Licensed under the MIT license (https://opensource.org/license/mit/)
#undef RADDBG_LAYER_COLOR
#define RADDBG_LAYER_COLOR 0.70f, 0.30f, 0.15f
#include "ui_core.c"
#include "ui_basic_widgets.c"
// Copyright (c) 2024 Epic Games Tools
// Licensed under the MIT license (https://opensource.org/license/mit/)
#undef RADDBG_LAYER_COLOR
#define RADDBG_LAYER_COLOR 0.70f, 0.30f, 0.15f
#include "ui_core.c"
#include "ui_basic_widgets.c"
+10 -10
View File
@@ -1,10 +1,10 @@
// Copyright (c) 2024 Epic Games Tools
// Licensed under the MIT license (https://opensource.org/license/mit/)
#ifndef UI_INC_H
#define UI_INC_H
#include "ui_core.h"
#include "ui_basic_widgets.h"
#endif // UI_INC_H
// Copyright (c) 2024 Epic Games Tools
// Licensed under the MIT license (https://opensource.org/license/mit/)
#ifndef UI_INC_H
#define UI_INC_H
#include "ui_core.h"
#include "ui_basic_widgets.h"
#endif // UI_INC_H