mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-07-27 01:40:11 +00:00
eliminate old palette system entirely
This commit is contained in:
+20
-73
@@ -233,61 +233,6 @@ struct UI_Theme
|
||||
U64 patterns_count;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Palettes
|
||||
|
||||
typedef enum UI_ColorCode
|
||||
{
|
||||
UI_ColorCode_Null,
|
||||
UI_ColorCode_Background,
|
||||
UI_ColorCode_BackgroundAlt,
|
||||
UI_ColorCode_BackgroundGood,
|
||||
UI_ColorCode_BackgroundBad,
|
||||
UI_ColorCode_BackgroundPop,
|
||||
UI_ColorCode_Border,
|
||||
UI_ColorCode_Text,
|
||||
UI_ColorCode_TextWeak,
|
||||
UI_ColorCode_Hover,
|
||||
UI_ColorCode_Focus,
|
||||
UI_ColorCode_Cursor,
|
||||
UI_ColorCode_Selection,
|
||||
UI_ColorCode_COUNT
|
||||
}
|
||||
UI_ColorCode;
|
||||
|
||||
typedef struct UI_Palette UI_Palette;
|
||||
struct UI_Palette
|
||||
{
|
||||
union
|
||||
{
|
||||
Vec4F32 colors[UI_ColorCode_COUNT];
|
||||
struct
|
||||
{
|
||||
Vec4F32 null;
|
||||
Vec4F32 background;
|
||||
Vec4F32 background_alt;
|
||||
Vec4F32 background_good;
|
||||
Vec4F32 background_bad;
|
||||
Vec4F32 background_pop;
|
||||
Vec4F32 border;
|
||||
Vec4F32 text;
|
||||
Vec4F32 text_weak;
|
||||
Vec4F32 hover;
|
||||
Vec4F32 focus;
|
||||
Vec4F32 cursor;
|
||||
Vec4F32 selection;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
typedef struct UI_WidgetPaletteInfo UI_WidgetPaletteInfo;
|
||||
struct UI_WidgetPaletteInfo
|
||||
{
|
||||
UI_Palette *tooltip_palette;
|
||||
UI_Palette *ctx_menu_palette;
|
||||
UI_Palette *scrollbar_palette;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Animation Info
|
||||
|
||||
@@ -449,7 +394,8 @@ struct UI_Box
|
||||
DR_Bucket *draw_bucket;
|
||||
UI_BoxCustomDrawFunctionType *custom_draw;
|
||||
void *custom_draw_user_data;
|
||||
UI_Palette *palette;
|
||||
Vec4F32 background_color;
|
||||
Vec4F32 text_color;
|
||||
FNT_Tag font;
|
||||
F32 font_size;
|
||||
F32 tab_size;
|
||||
@@ -744,7 +690,6 @@ struct UI_State
|
||||
//- rjf: build parameters
|
||||
UI_IconInfo icon_info;
|
||||
UI_Theme *theme;
|
||||
UI_WidgetPaletteInfo widget_palette_info;
|
||||
UI_AnimationInfo animation_info;
|
||||
OS_Handle window;
|
||||
UI_EventList *events;
|
||||
@@ -827,11 +772,6 @@ internal UI_Size ui_size(UI_SizeKind kind, F32 value, F32 strictness);
|
||||
#define ui_pct(value, strictness) ui_size(UI_SizeKind_ParentPct, value, strictness)
|
||||
#define ui_children_sum(strictness) ui_size(UI_SizeKind_ChildrenSum, 0.f, strictness)
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Color Scheme Type Functions
|
||||
|
||||
read_only global UI_Palette ui_g_nil_palette = {0};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Scroll Point Type Functions
|
||||
|
||||
@@ -915,7 +855,7 @@ internal UI_Box * ui_box_from_key(UI_Key key);
|
||||
////////////////////////////////
|
||||
//~ rjf: Top-Level Building API
|
||||
|
||||
internal void ui_begin_build(OS_Handle window, UI_EventList *events, UI_IconInfo *icon_info, UI_Theme *theme, UI_WidgetPaletteInfo *widget_palette_info, UI_AnimationInfo *animation_info, F32 real_dt, F32 animation_dt);
|
||||
internal void ui_begin_build(OS_Handle window, UI_EventList *events, UI_IconInfo *icon_info, UI_Theme *theme, UI_AnimationInfo *animation_info, F32 real_dt, F32 animation_dt);
|
||||
internal void ui_end_build(void);
|
||||
internal void ui_calc_sizes_standalone__in_place_rec(UI_Box *root, Axis2 axis);
|
||||
internal void ui_calc_sizes_upwards_dependent__in_place_rec(UI_Box *root, Axis2 axis);
|
||||
@@ -954,10 +894,6 @@ internal B32 ui_is_key_auto_focus_hot(UI_Key key);
|
||||
internal void ui_set_auto_focus_active_key(UI_Key key);
|
||||
internal void ui_set_auto_focus_hot_key(UI_Key key);
|
||||
|
||||
//- rjf: palette forming
|
||||
internal UI_Palette * ui_build_palette_(UI_Palette *base, UI_Palette *overrides);
|
||||
#define ui_build_palette(base, ...) ui_build_palette_((base), &(UI_Palette){.text = v4f32(0, 0, 0, 0), __VA_ARGS__})
|
||||
|
||||
//- rjf: current style tags key
|
||||
internal UI_Key ui_top_tags_key(void);
|
||||
|
||||
@@ -1014,13 +950,15 @@ internal UI_Size ui_top_pref_width(void);
|
||||
internal UI_Size ui_top_pref_height(void);
|
||||
internal UI_PermissionFlags ui_top_permission_flags(void);
|
||||
internal UI_BoxFlags ui_top_flags(void);
|
||||
internal UI_BoxFlags ui_top_omit_flags(void);
|
||||
internal UI_FocusKind ui_top_focus_hot(void);
|
||||
internal UI_FocusKind ui_top_focus_active(void);
|
||||
internal U32 ui_top_fastpath_codepoint(void);
|
||||
internal UI_Key ui_top_group_key(void);
|
||||
internal F32 ui_top_transparency(void);
|
||||
internal UI_Palette* ui_top_palette(void);
|
||||
internal String8 ui_top_tag(void);
|
||||
internal Vec4F32 ui_top_background_color(void);
|
||||
internal Vec4F32 ui_top_text_color(void);
|
||||
internal F32 ui_top_squish(void);
|
||||
internal OS_Cursor ui_top_hover_cursor(void);
|
||||
internal FNT_Tag ui_top_font(void);
|
||||
@@ -1044,13 +982,15 @@ internal UI_Size ui_bottom_pref_width(void);
|
||||
internal UI_Size ui_bottom_pref_height(void);
|
||||
internal UI_PermissionFlags ui_bottom_permission_flags(void);
|
||||
internal UI_BoxFlags ui_bottom_flags(void);
|
||||
internal UI_BoxFlags ui_bottom_omit_flags(void);
|
||||
internal UI_FocusKind ui_bottom_focus_hot(void);
|
||||
internal UI_FocusKind ui_bottom_focus_active(void);
|
||||
internal U32 ui_bottom_fastpath_codepoint(void);
|
||||
internal UI_Key ui_bottom_group_key(void);
|
||||
internal F32 ui_bottom_transparency(void);
|
||||
internal UI_Palette* ui_bottom_palette(void);
|
||||
internal String8 ui_bottom_tag(void);
|
||||
internal Vec4F32 ui_bottom_background_color(void);
|
||||
internal Vec4F32 ui_bottom_text_color(void);
|
||||
internal F32 ui_bottom_squish(void);
|
||||
internal OS_Cursor ui_bottom_hover_cursor(void);
|
||||
internal FNT_Tag ui_bottom_font(void);
|
||||
@@ -1074,13 +1014,15 @@ internal UI_Size ui_push_pref_width(UI_Size v);
|
||||
internal UI_Size ui_push_pref_height(UI_Size v);
|
||||
internal UI_PermissionFlags ui_push_permission_flags(UI_PermissionFlags v);
|
||||
internal UI_BoxFlags ui_push_flags(UI_BoxFlags v);
|
||||
internal UI_BoxFlags ui_push_omit_flags(UI_BoxFlags v);
|
||||
internal UI_FocusKind ui_push_focus_hot(UI_FocusKind v);
|
||||
internal UI_FocusKind ui_push_focus_active(UI_FocusKind v);
|
||||
internal U32 ui_push_fastpath_codepoint(U32 v);
|
||||
internal UI_Key ui_push_group_key(UI_Key v);
|
||||
internal F32 ui_push_transparency(F32 v);
|
||||
internal UI_Palette* ui_push_palette(UI_Palette* v);
|
||||
internal String8 ui_push_tag(String8 v);
|
||||
internal Vec4F32 ui_push_background_color(Vec4F32 v);
|
||||
internal Vec4F32 ui_push_text_color(Vec4F32 v);
|
||||
internal F32 ui_push_squish(F32 v);
|
||||
internal OS_Cursor ui_push_hover_cursor(OS_Cursor v);
|
||||
internal FNT_Tag ui_push_font(FNT_Tag v);
|
||||
@@ -1104,13 +1046,15 @@ internal UI_Size ui_pop_pref_width(void);
|
||||
internal UI_Size ui_pop_pref_height(void);
|
||||
internal UI_PermissionFlags ui_pop_permission_flags(void);
|
||||
internal UI_BoxFlags ui_pop_flags(void);
|
||||
internal UI_BoxFlags ui_pop_omit_flags(void);
|
||||
internal UI_FocusKind ui_pop_focus_hot(void);
|
||||
internal UI_FocusKind ui_pop_focus_active(void);
|
||||
internal U32 ui_pop_fastpath_codepoint(void);
|
||||
internal UI_Key ui_pop_group_key(void);
|
||||
internal F32 ui_pop_transparency(void);
|
||||
internal UI_Palette* ui_pop_palette(void);
|
||||
internal String8 ui_pop_tag(void);
|
||||
internal Vec4F32 ui_pop_background_color(void);
|
||||
internal Vec4F32 ui_pop_text_color(void);
|
||||
internal F32 ui_pop_squish(void);
|
||||
internal OS_Cursor ui_pop_hover_cursor(void);
|
||||
internal FNT_Tag ui_pop_font(void);
|
||||
@@ -1134,13 +1078,15 @@ internal UI_Size ui_set_next_pref_width(UI_Size v);
|
||||
internal UI_Size ui_set_next_pref_height(UI_Size v);
|
||||
internal UI_PermissionFlags ui_set_next_permission_flags(UI_PermissionFlags v);
|
||||
internal UI_BoxFlags ui_set_next_flags(UI_BoxFlags v);
|
||||
internal UI_BoxFlags ui_set_next_omit_flags(UI_BoxFlags v);
|
||||
internal UI_FocusKind ui_set_next_focus_hot(UI_FocusKind v);
|
||||
internal UI_FocusKind ui_set_next_focus_active(UI_FocusKind v);
|
||||
internal U32 ui_set_next_fastpath_codepoint(U32 v);
|
||||
internal UI_Key ui_set_next_group_key(UI_Key v);
|
||||
internal F32 ui_set_next_transparency(F32 v);
|
||||
internal UI_Palette* ui_set_next_palette(UI_Palette* v);
|
||||
internal String8 ui_set_next_tag(String8 v);
|
||||
internal Vec4F32 ui_set_next_background_color(Vec4F32 v);
|
||||
internal Vec4F32 ui_set_next_text_color(Vec4F32 v);
|
||||
internal F32 ui_set_next_squish(F32 v);
|
||||
internal OS_Cursor ui_set_next_hover_cursor(OS_Cursor v);
|
||||
internal FNT_Tag ui_set_next_font(FNT_Tag v);
|
||||
@@ -1186,8 +1132,9 @@ internal void ui_push_tagf(char *fmt, ...);
|
||||
#define UI_FastpathCodepoint(v) DeferLoop(ui_push_fastpath_codepoint(v), ui_pop_fastpath_codepoint())
|
||||
#define UI_GroupKey(v) DeferLoop(ui_push_group_key(v), ui_pop_group_key())
|
||||
#define UI_Transparency(v) DeferLoop(ui_push_transparency(v), ui_pop_transparency())
|
||||
#define UI_Palette(v) DeferLoop(ui_push_palette(v), ui_pop_palette())
|
||||
#define UI_Tag(v) DeferLoop(ui_push_tag(v), ui_pop_tag())
|
||||
#define UI_BackgroundColor(v) DeferLoop(ui_push_background_color(v), ui_pop_background_color())
|
||||
#define UI_TextColor(v) DeferLoop(ui_push_text_color(v), ui_pop_text_color())
|
||||
#define UI_Squish(v) DeferLoop(ui_push_squish(v), ui_pop_squish())
|
||||
#define UI_HoverCursor(v) DeferLoop(ui_push_hover_cursor(v), ui_pop_hover_cursor())
|
||||
#define UI_Font(v) DeferLoop(ui_push_font(v), ui_pop_font())
|
||||
|
||||
Reference in New Issue
Block a user