mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-07-29 02:30:03 +00:00
color scheme -> palette; fix eval/watch views after cleanup; make more progress on new palette system
This commit is contained in:
@@ -17,11 +17,12 @@
|
||||
#define UI_FocusActive(v) DeferLoop(ui_push_focus_active(v), ui_pop_focus_active())
|
||||
#define UI_FastpathCodepoint(v) DeferLoop(ui_push_fastpath_codepoint(v), ui_pop_fastpath_codepoint())
|
||||
#define UI_Transparency(v) DeferLoop(ui_push_transparency(v), ui_pop_transparency())
|
||||
#define UI_Scheme(v) DeferLoop(ui_push_scheme(v), ui_pop_scheme())
|
||||
#define UI_Palette(v) DeferLoop(ui_push_palette(v), ui_pop_palette())
|
||||
#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())
|
||||
#define UI_FontSize(v) DeferLoop(ui_push_font_size(v), ui_pop_font_size())
|
||||
#define UI_RunFlags(v) DeferLoop(ui_push_run_flags(v), ui_pop_run_flags())
|
||||
#define UI_TabSize(v) DeferLoop(ui_push_tab_size(v), ui_pop_tab_size())
|
||||
#define UI_CornerRadius00(v) DeferLoop(ui_push_corner_radius_00(v), ui_pop_corner_radius_00())
|
||||
#define UI_CornerRadius01(v) DeferLoop(ui_push_corner_radius_01(v), ui_pop_corner_radius_01())
|
||||
@@ -44,11 +45,12 @@ internal UI_FocusKind ui_top_focus_hot(void) { UI_StackTopImpl(ui_state, FocusHo
|
||||
internal UI_FocusKind ui_top_focus_active(void) { UI_StackTopImpl(ui_state, FocusActive, focus_active) }
|
||||
internal U32 ui_top_fastpath_codepoint(void) { UI_StackTopImpl(ui_state, FastpathCodepoint, fastpath_codepoint) }
|
||||
internal F32 ui_top_transparency(void) { UI_StackTopImpl(ui_state, Transparency, transparency) }
|
||||
internal UI_ColorScheme* ui_top_scheme(void) { UI_StackTopImpl(ui_state, Scheme, scheme) }
|
||||
internal UI_Palette* ui_top_palette(void) { UI_StackTopImpl(ui_state, Palette, palette) }
|
||||
internal F32 ui_top_squish(void) { UI_StackTopImpl(ui_state, Squish, squish) }
|
||||
internal OS_Cursor ui_top_hover_cursor(void) { UI_StackTopImpl(ui_state, HoverCursor, hover_cursor) }
|
||||
internal F_Tag ui_top_font(void) { UI_StackTopImpl(ui_state, Font, font) }
|
||||
internal F32 ui_top_font_size(void) { UI_StackTopImpl(ui_state, FontSize, font_size) }
|
||||
internal F_RunFlags ui_top_run_flags(void) { UI_StackTopImpl(ui_state, RunFlags, run_flags) }
|
||||
internal F32 ui_top_tab_size(void) { UI_StackTopImpl(ui_state, TabSize, tab_size) }
|
||||
internal F32 ui_top_corner_radius_00(void) { UI_StackTopImpl(ui_state, CornerRadius00, corner_radius_00) }
|
||||
internal F32 ui_top_corner_radius_01(void) { UI_StackTopImpl(ui_state, CornerRadius01, corner_radius_01) }
|
||||
@@ -70,11 +72,12 @@ internal UI_FocusKind ui_bottom_focus_hot(void) { UI_StackBottomImpl(ui_state, F
|
||||
internal UI_FocusKind ui_bottom_focus_active(void) { UI_StackBottomImpl(ui_state, FocusActive, focus_active) }
|
||||
internal U32 ui_bottom_fastpath_codepoint(void) { UI_StackBottomImpl(ui_state, FastpathCodepoint, fastpath_codepoint) }
|
||||
internal F32 ui_bottom_transparency(void) { UI_StackBottomImpl(ui_state, Transparency, transparency) }
|
||||
internal UI_ColorScheme* ui_bottom_scheme(void) { UI_StackBottomImpl(ui_state, Scheme, scheme) }
|
||||
internal UI_Palette* ui_bottom_palette(void) { UI_StackBottomImpl(ui_state, Palette, palette) }
|
||||
internal F32 ui_bottom_squish(void) { UI_StackBottomImpl(ui_state, Squish, squish) }
|
||||
internal OS_Cursor ui_bottom_hover_cursor(void) { UI_StackBottomImpl(ui_state, HoverCursor, hover_cursor) }
|
||||
internal F_Tag ui_bottom_font(void) { UI_StackBottomImpl(ui_state, Font, font) }
|
||||
internal F32 ui_bottom_font_size(void) { UI_StackBottomImpl(ui_state, FontSize, font_size) }
|
||||
internal F_RunFlags ui_bottom_run_flags(void) { UI_StackBottomImpl(ui_state, RunFlags, run_flags) }
|
||||
internal F32 ui_bottom_tab_size(void) { UI_StackBottomImpl(ui_state, TabSize, tab_size) }
|
||||
internal F32 ui_bottom_corner_radius_00(void) { UI_StackBottomImpl(ui_state, CornerRadius00, corner_radius_00) }
|
||||
internal F32 ui_bottom_corner_radius_01(void) { UI_StackBottomImpl(ui_state, CornerRadius01, corner_radius_01) }
|
||||
@@ -96,11 +99,12 @@ internal UI_FocusKind ui_push_focus_hot(UI_FocusKind v) { UI_StackPushImpl(ui_st
|
||||
internal UI_FocusKind ui_push_focus_active(UI_FocusKind v) { UI_StackPushImpl(ui_state, FocusActive, focus_active, UI_FocusKind, v) }
|
||||
internal U32 ui_push_fastpath_codepoint(U32 v) { UI_StackPushImpl(ui_state, FastpathCodepoint, fastpath_codepoint, U32, v) }
|
||||
internal F32 ui_push_transparency(F32 v) { UI_StackPushImpl(ui_state, Transparency, transparency, F32, v) }
|
||||
internal UI_ColorScheme* ui_push_scheme(UI_ColorScheme* v) { UI_StackPushImpl(ui_state, Scheme, scheme, UI_ColorScheme*, v) }
|
||||
internal UI_Palette* ui_push_palette(UI_Palette* v) { UI_StackPushImpl(ui_state, Palette, palette, UI_Palette* , v) }
|
||||
internal F32 ui_push_squish(F32 v) { UI_StackPushImpl(ui_state, Squish, squish, F32, v) }
|
||||
internal OS_Cursor ui_push_hover_cursor(OS_Cursor v) { UI_StackPushImpl(ui_state, HoverCursor, hover_cursor, OS_Cursor, v) }
|
||||
internal F_Tag ui_push_font(F_Tag v) { UI_StackPushImpl(ui_state, Font, font, F_Tag, v) }
|
||||
internal F32 ui_push_font_size(F32 v) { UI_StackPushImpl(ui_state, FontSize, font_size, F32, v) }
|
||||
internal F_RunFlags ui_push_run_flags(F_RunFlags v) { UI_StackPushImpl(ui_state, RunFlags, run_flags, F_RunFlags, v) }
|
||||
internal F32 ui_push_tab_size(F32 v) { UI_StackPushImpl(ui_state, TabSize, tab_size, F32, v) }
|
||||
internal F32 ui_push_corner_radius_00(F32 v) { UI_StackPushImpl(ui_state, CornerRadius00, corner_radius_00, F32, v) }
|
||||
internal F32 ui_push_corner_radius_01(F32 v) { UI_StackPushImpl(ui_state, CornerRadius01, corner_radius_01, F32, v) }
|
||||
@@ -122,11 +126,12 @@ internal UI_FocusKind ui_pop_focus_hot(void) { UI_StackPopImpl(ui_state, FocusHo
|
||||
internal UI_FocusKind ui_pop_focus_active(void) { UI_StackPopImpl(ui_state, FocusActive, focus_active) }
|
||||
internal U32 ui_pop_fastpath_codepoint(void) { UI_StackPopImpl(ui_state, FastpathCodepoint, fastpath_codepoint) }
|
||||
internal F32 ui_pop_transparency(void) { UI_StackPopImpl(ui_state, Transparency, transparency) }
|
||||
internal UI_ColorScheme* ui_pop_scheme(void) { UI_StackPopImpl(ui_state, Scheme, scheme) }
|
||||
internal UI_Palette* ui_pop_palette(void) { UI_StackPopImpl(ui_state, Palette, palette) }
|
||||
internal F32 ui_pop_squish(void) { UI_StackPopImpl(ui_state, Squish, squish) }
|
||||
internal OS_Cursor ui_pop_hover_cursor(void) { UI_StackPopImpl(ui_state, HoverCursor, hover_cursor) }
|
||||
internal F_Tag ui_pop_font(void) { UI_StackPopImpl(ui_state, Font, font) }
|
||||
internal F32 ui_pop_font_size(void) { UI_StackPopImpl(ui_state, FontSize, font_size) }
|
||||
internal F_RunFlags ui_pop_run_flags(void) { UI_StackPopImpl(ui_state, RunFlags, run_flags) }
|
||||
internal F32 ui_pop_tab_size(void) { UI_StackPopImpl(ui_state, TabSize, tab_size) }
|
||||
internal F32 ui_pop_corner_radius_00(void) { UI_StackPopImpl(ui_state, CornerRadius00, corner_radius_00) }
|
||||
internal F32 ui_pop_corner_radius_01(void) { UI_StackPopImpl(ui_state, CornerRadius01, corner_radius_01) }
|
||||
@@ -148,11 +153,12 @@ internal UI_FocusKind ui_set_next_focus_hot(UI_FocusKind v) { UI_StackSetNextImp
|
||||
internal UI_FocusKind ui_set_next_focus_active(UI_FocusKind v) { UI_StackSetNextImpl(ui_state, FocusActive, focus_active, UI_FocusKind, v) }
|
||||
internal U32 ui_set_next_fastpath_codepoint(U32 v) { UI_StackSetNextImpl(ui_state, FastpathCodepoint, fastpath_codepoint, U32, v) }
|
||||
internal F32 ui_set_next_transparency(F32 v) { UI_StackSetNextImpl(ui_state, Transparency, transparency, F32, v) }
|
||||
internal UI_ColorScheme* ui_set_next_scheme(UI_ColorScheme* v) { UI_StackSetNextImpl(ui_state, Scheme, scheme, UI_ColorScheme*, v) }
|
||||
internal UI_Palette* ui_set_next_palette(UI_Palette* v) { UI_StackSetNextImpl(ui_state, Palette, palette, UI_Palette* , v) }
|
||||
internal F32 ui_set_next_squish(F32 v) { UI_StackSetNextImpl(ui_state, Squish, squish, F32, v) }
|
||||
internal OS_Cursor ui_set_next_hover_cursor(OS_Cursor v) { UI_StackSetNextImpl(ui_state, HoverCursor, hover_cursor, OS_Cursor, v) }
|
||||
internal F_Tag ui_set_next_font(F_Tag v) { UI_StackSetNextImpl(ui_state, Font, font, F_Tag, v) }
|
||||
internal F32 ui_set_next_font_size(F32 v) { UI_StackSetNextImpl(ui_state, FontSize, font_size, F32, v) }
|
||||
internal F_RunFlags ui_set_next_run_flags(F_RunFlags v) { UI_StackSetNextImpl(ui_state, RunFlags, run_flags, F_RunFlags, v) }
|
||||
internal F32 ui_set_next_tab_size(F32 v) { UI_StackSetNextImpl(ui_state, TabSize, tab_size, F32, v) }
|
||||
internal F32 ui_set_next_corner_radius_00(F32 v) { UI_StackSetNextImpl(ui_state, CornerRadius00, corner_radius_00, F32, v) }
|
||||
internal F32 ui_set_next_corner_radius_01(F32 v) { UI_StackSetNextImpl(ui_state, CornerRadius01, corner_radius_01, F32, v) }
|
||||
|
||||
+22
-11
@@ -19,11 +19,12 @@ typedef struct UI_FocusHotNode UI_FocusHotNode; struct UI_FocusHotNode{UI_FocusH
|
||||
typedef struct UI_FocusActiveNode UI_FocusActiveNode; struct UI_FocusActiveNode{UI_FocusActiveNode *next; UI_FocusKind v;};
|
||||
typedef struct UI_FastpathCodepointNode UI_FastpathCodepointNode; struct UI_FastpathCodepointNode{UI_FastpathCodepointNode *next; U32 v;};
|
||||
typedef struct UI_TransparencyNode UI_TransparencyNode; struct UI_TransparencyNode{UI_TransparencyNode *next; F32 v;};
|
||||
typedef struct UI_SchemeNode UI_SchemeNode; struct UI_SchemeNode{UI_SchemeNode *next; UI_ColorScheme* v;};
|
||||
typedef struct UI_PaletteNode UI_PaletteNode; struct UI_PaletteNode{UI_PaletteNode *next; UI_Palette* v;};
|
||||
typedef struct UI_SquishNode UI_SquishNode; struct UI_SquishNode{UI_SquishNode *next; F32 v;};
|
||||
typedef struct UI_HoverCursorNode UI_HoverCursorNode; struct UI_HoverCursorNode{UI_HoverCursorNode *next; OS_Cursor v;};
|
||||
typedef struct UI_FontNode UI_FontNode; struct UI_FontNode{UI_FontNode *next; F_Tag v;};
|
||||
typedef struct UI_FontSizeNode UI_FontSizeNode; struct UI_FontSizeNode{UI_FontSizeNode *next; F32 v;};
|
||||
typedef struct UI_RunFlagsNode UI_RunFlagsNode; struct UI_RunFlagsNode{UI_RunFlagsNode *next; F_RunFlags v;};
|
||||
typedef struct UI_TabSizeNode UI_TabSizeNode; struct UI_TabSizeNode{UI_TabSizeNode *next; F32 v;};
|
||||
typedef struct UI_CornerRadius00Node UI_CornerRadius00Node; struct UI_CornerRadius00Node{UI_CornerRadius00Node *next; F32 v;};
|
||||
typedef struct UI_CornerRadius01Node UI_CornerRadius01Node; struct UI_CornerRadius01Node{UI_CornerRadius01Node *next; F32 v;};
|
||||
@@ -48,11 +49,12 @@ UI_FocusHotNode focus_hot_nil_stack_top;\
|
||||
UI_FocusActiveNode focus_active_nil_stack_top;\
|
||||
UI_FastpathCodepointNode fastpath_codepoint_nil_stack_top;\
|
||||
UI_TransparencyNode transparency_nil_stack_top;\
|
||||
UI_SchemeNode scheme_nil_stack_top;\
|
||||
UI_PaletteNode palette_nil_stack_top;\
|
||||
UI_SquishNode squish_nil_stack_top;\
|
||||
UI_HoverCursorNode hover_cursor_nil_stack_top;\
|
||||
UI_FontNode font_nil_stack_top;\
|
||||
UI_FontSizeNode font_size_nil_stack_top;\
|
||||
UI_RunFlagsNode run_flags_nil_stack_top;\
|
||||
UI_TabSizeNode tab_size_nil_stack_top;\
|
||||
UI_CornerRadius00Node corner_radius_00_nil_stack_top;\
|
||||
UI_CornerRadius01Node corner_radius_01_nil_stack_top;\
|
||||
@@ -76,11 +78,12 @@ state->focus_hot_nil_stack_top.v = UI_FocusKind_Null;\
|
||||
state->focus_active_nil_stack_top.v = UI_FocusKind_Null;\
|
||||
state->fastpath_codepoint_nil_stack_top.v = 0;\
|
||||
state->transparency_nil_stack_top.v = 0;\
|
||||
state->scheme_nil_stack_top.v = &ui_g_nil_color_scheme;\
|
||||
state->palette_nil_stack_top.v = &ui_g_nil_palette;\
|
||||
state->squish_nil_stack_top.v = 0;\
|
||||
state->hover_cursor_nil_stack_top.v = OS_Cursor_Pointer;\
|
||||
state->font_nil_stack_top.v = f_tag_zero();\
|
||||
state->font_size_nil_stack_top.v = 24.f;\
|
||||
state->run_flags_nil_stack_top.v = 0;\
|
||||
state->tab_size_nil_stack_top.v = 24.f*4.f;\
|
||||
state->corner_radius_00_nil_stack_top.v = 0;\
|
||||
state->corner_radius_01_nil_stack_top.v = 0;\
|
||||
@@ -106,11 +109,12 @@ struct { UI_FocusHotNode *top; UI_FocusKind bottom_val; UI_FocusHotNode *free; B
|
||||
struct { UI_FocusActiveNode *top; UI_FocusKind bottom_val; UI_FocusActiveNode *free; B32 auto_pop; } focus_active_stack;\
|
||||
struct { UI_FastpathCodepointNode *top; U32 bottom_val; UI_FastpathCodepointNode *free; B32 auto_pop; } fastpath_codepoint_stack;\
|
||||
struct { UI_TransparencyNode *top; F32 bottom_val; UI_TransparencyNode *free; B32 auto_pop; } transparency_stack;\
|
||||
struct { UI_SchemeNode *top; UI_ColorScheme* bottom_val; UI_SchemeNode *free; B32 auto_pop; } scheme_stack;\
|
||||
struct { UI_PaletteNode *top; UI_Palette* bottom_val; UI_PaletteNode *free; B32 auto_pop; } palette_stack;\
|
||||
struct { UI_SquishNode *top; F32 bottom_val; UI_SquishNode *free; B32 auto_pop; } squish_stack;\
|
||||
struct { UI_HoverCursorNode *top; OS_Cursor bottom_val; UI_HoverCursorNode *free; B32 auto_pop; } hover_cursor_stack;\
|
||||
struct { UI_FontNode *top; F_Tag bottom_val; UI_FontNode *free; B32 auto_pop; } font_stack;\
|
||||
struct { UI_FontSizeNode *top; F32 bottom_val; UI_FontSizeNode *free; B32 auto_pop; } font_size_stack;\
|
||||
struct { UI_RunFlagsNode *top; F_RunFlags bottom_val; UI_RunFlagsNode *free; B32 auto_pop; } run_flags_stack;\
|
||||
struct { UI_TabSizeNode *top; F32 bottom_val; UI_TabSizeNode *free; B32 auto_pop; } tab_size_stack;\
|
||||
struct { UI_CornerRadius00Node *top; F32 bottom_val; UI_CornerRadius00Node *free; B32 auto_pop; } corner_radius_00_stack;\
|
||||
struct { UI_CornerRadius01Node *top; F32 bottom_val; UI_CornerRadius01Node *free; B32 auto_pop; } corner_radius_01_stack;\
|
||||
@@ -134,11 +138,12 @@ state->focus_hot_stack.top = &state->focus_hot_nil_stack_top; state->focus_hot_s
|
||||
state->focus_active_stack.top = &state->focus_active_nil_stack_top; state->focus_active_stack.bottom_val = UI_FocusKind_Null; state->focus_active_stack.free = 0; state->focus_active_stack.auto_pop = 0;\
|
||||
state->fastpath_codepoint_stack.top = &state->fastpath_codepoint_nil_stack_top; state->fastpath_codepoint_stack.bottom_val = 0; state->fastpath_codepoint_stack.free = 0; state->fastpath_codepoint_stack.auto_pop = 0;\
|
||||
state->transparency_stack.top = &state->transparency_nil_stack_top; state->transparency_stack.bottom_val = 0; state->transparency_stack.free = 0; state->transparency_stack.auto_pop = 0;\
|
||||
state->scheme_stack.top = &state->scheme_nil_stack_top; state->scheme_stack.bottom_val = &ui_g_nil_color_scheme; state->scheme_stack.free = 0; state->scheme_stack.auto_pop = 0;\
|
||||
state->palette_stack.top = &state->palette_nil_stack_top; state->palette_stack.bottom_val = &ui_g_nil_palette; state->palette_stack.free = 0; state->palette_stack.auto_pop = 0;\
|
||||
state->squish_stack.top = &state->squish_nil_stack_top; state->squish_stack.bottom_val = 0; state->squish_stack.free = 0; state->squish_stack.auto_pop = 0;\
|
||||
state->hover_cursor_stack.top = &state->hover_cursor_nil_stack_top; state->hover_cursor_stack.bottom_val = OS_Cursor_Pointer; state->hover_cursor_stack.free = 0; state->hover_cursor_stack.auto_pop = 0;\
|
||||
state->font_stack.top = &state->font_nil_stack_top; state->font_stack.bottom_val = f_tag_zero(); state->font_stack.free = 0; state->font_stack.auto_pop = 0;\
|
||||
state->font_size_stack.top = &state->font_size_nil_stack_top; state->font_size_stack.bottom_val = 24.f; state->font_size_stack.free = 0; state->font_size_stack.auto_pop = 0;\
|
||||
state->run_flags_stack.top = &state->run_flags_nil_stack_top; state->run_flags_stack.bottom_val = 0; state->run_flags_stack.free = 0; state->run_flags_stack.auto_pop = 0;\
|
||||
state->tab_size_stack.top = &state->tab_size_nil_stack_top; state->tab_size_stack.bottom_val = 24.f*4.f; state->tab_size_stack.free = 0; state->tab_size_stack.auto_pop = 0;\
|
||||
state->corner_radius_00_stack.top = &state->corner_radius_00_nil_stack_top; state->corner_radius_00_stack.bottom_val = 0; state->corner_radius_00_stack.free = 0; state->corner_radius_00_stack.auto_pop = 0;\
|
||||
state->corner_radius_01_stack.top = &state->corner_radius_01_nil_stack_top; state->corner_radius_01_stack.bottom_val = 0; state->corner_radius_01_stack.free = 0; state->corner_radius_01_stack.auto_pop = 0;\
|
||||
@@ -162,11 +167,12 @@ if(state->focus_hot_stack.auto_pop) { ui_pop_focus_hot(); state->focus_hot_stack
|
||||
if(state->focus_active_stack.auto_pop) { ui_pop_focus_active(); state->focus_active_stack.auto_pop = 0; }\
|
||||
if(state->fastpath_codepoint_stack.auto_pop) { ui_pop_fastpath_codepoint(); state->fastpath_codepoint_stack.auto_pop = 0; }\
|
||||
if(state->transparency_stack.auto_pop) { ui_pop_transparency(); state->transparency_stack.auto_pop = 0; }\
|
||||
if(state->scheme_stack.auto_pop) { ui_pop_scheme(); state->scheme_stack.auto_pop = 0; }\
|
||||
if(state->palette_stack.auto_pop) { ui_pop_palette(); state->palette_stack.auto_pop = 0; }\
|
||||
if(state->squish_stack.auto_pop) { ui_pop_squish(); state->squish_stack.auto_pop = 0; }\
|
||||
if(state->hover_cursor_stack.auto_pop) { ui_pop_hover_cursor(); state->hover_cursor_stack.auto_pop = 0; }\
|
||||
if(state->font_stack.auto_pop) { ui_pop_font(); state->font_stack.auto_pop = 0; }\
|
||||
if(state->font_size_stack.auto_pop) { ui_pop_font_size(); state->font_size_stack.auto_pop = 0; }\
|
||||
if(state->run_flags_stack.auto_pop) { ui_pop_run_flags(); state->run_flags_stack.auto_pop = 0; }\
|
||||
if(state->tab_size_stack.auto_pop) { ui_pop_tab_size(); state->tab_size_stack.auto_pop = 0; }\
|
||||
if(state->corner_radius_00_stack.auto_pop) { ui_pop_corner_radius_00(); state->corner_radius_00_stack.auto_pop = 0; }\
|
||||
if(state->corner_radius_01_stack.auto_pop) { ui_pop_corner_radius_01(); state->corner_radius_01_stack.auto_pop = 0; }\
|
||||
@@ -189,11 +195,12 @@ internal UI_FocusKind ui_top_focus_hot(void);
|
||||
internal UI_FocusKind ui_top_focus_active(void);
|
||||
internal U32 ui_top_fastpath_codepoint(void);
|
||||
internal F32 ui_top_transparency(void);
|
||||
internal UI_ColorScheme* ui_top_scheme(void);
|
||||
internal UI_Palette* ui_top_palette(void);
|
||||
internal F32 ui_top_squish(void);
|
||||
internal OS_Cursor ui_top_hover_cursor(void);
|
||||
internal F_Tag ui_top_font(void);
|
||||
internal F32 ui_top_font_size(void);
|
||||
internal F_RunFlags ui_top_run_flags(void);
|
||||
internal F32 ui_top_tab_size(void);
|
||||
internal F32 ui_top_corner_radius_00(void);
|
||||
internal F32 ui_top_corner_radius_01(void);
|
||||
@@ -215,11 +222,12 @@ internal UI_FocusKind ui_bottom_focus_hot(void);
|
||||
internal UI_FocusKind ui_bottom_focus_active(void);
|
||||
internal U32 ui_bottom_fastpath_codepoint(void);
|
||||
internal F32 ui_bottom_transparency(void);
|
||||
internal UI_ColorScheme* ui_bottom_scheme(void);
|
||||
internal UI_Palette* ui_bottom_palette(void);
|
||||
internal F32 ui_bottom_squish(void);
|
||||
internal OS_Cursor ui_bottom_hover_cursor(void);
|
||||
internal F_Tag ui_bottom_font(void);
|
||||
internal F32 ui_bottom_font_size(void);
|
||||
internal F_RunFlags ui_bottom_run_flags(void);
|
||||
internal F32 ui_bottom_tab_size(void);
|
||||
internal F32 ui_bottom_corner_radius_00(void);
|
||||
internal F32 ui_bottom_corner_radius_01(void);
|
||||
@@ -241,11 +249,12 @@ 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 F32 ui_push_transparency(F32 v);
|
||||
internal UI_ColorScheme* ui_push_scheme(UI_ColorScheme* v);
|
||||
internal UI_Palette* ui_push_palette(UI_Palette* v);
|
||||
internal F32 ui_push_squish(F32 v);
|
||||
internal OS_Cursor ui_push_hover_cursor(OS_Cursor v);
|
||||
internal F_Tag ui_push_font(F_Tag v);
|
||||
internal F32 ui_push_font_size(F32 v);
|
||||
internal F_RunFlags ui_push_run_flags(F_RunFlags v);
|
||||
internal F32 ui_push_tab_size(F32 v);
|
||||
internal F32 ui_push_corner_radius_00(F32 v);
|
||||
internal F32 ui_push_corner_radius_01(F32 v);
|
||||
@@ -267,11 +276,12 @@ internal UI_FocusKind ui_pop_focus_hot(void);
|
||||
internal UI_FocusKind ui_pop_focus_active(void);
|
||||
internal U32 ui_pop_fastpath_codepoint(void);
|
||||
internal F32 ui_pop_transparency(void);
|
||||
internal UI_ColorScheme* ui_pop_scheme(void);
|
||||
internal UI_Palette* ui_pop_palette(void);
|
||||
internal F32 ui_pop_squish(void);
|
||||
internal OS_Cursor ui_pop_hover_cursor(void);
|
||||
internal F_Tag ui_pop_font(void);
|
||||
internal F32 ui_pop_font_size(void);
|
||||
internal F_RunFlags ui_pop_run_flags(void);
|
||||
internal F32 ui_pop_tab_size(void);
|
||||
internal F32 ui_pop_corner_radius_00(void);
|
||||
internal F32 ui_pop_corner_radius_01(void);
|
||||
@@ -293,11 +303,12 @@ 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 F32 ui_set_next_transparency(F32 v);
|
||||
internal UI_ColorScheme* ui_set_next_scheme(UI_ColorScheme* v);
|
||||
internal UI_Palette* ui_set_next_palette(UI_Palette* v);
|
||||
internal F32 ui_set_next_squish(F32 v);
|
||||
internal OS_Cursor ui_set_next_hover_cursor(OS_Cursor v);
|
||||
internal F_Tag ui_set_next_font(F_Tag v);
|
||||
internal F32 ui_set_next_font_size(F32 v);
|
||||
internal F_RunFlags ui_set_next_run_flags(F_RunFlags v);
|
||||
internal F32 ui_set_next_tab_size(F32 v);
|
||||
internal F32 ui_set_next_corner_radius_00(F32 v);
|
||||
internal F32 ui_set_next_corner_radius_01(F32 v);
|
||||
|
||||
+2
-1
@@ -30,7 +30,7 @@ UI_StackTable:
|
||||
|
||||
//- rjf: colors
|
||||
{ Transparency transparency F32 0 }
|
||||
{ Scheme scheme `UI_ColorScheme*` `&ui_g_nil_color_scheme` }
|
||||
{ Palette palette `UI_Palette* ` `&ui_g_nil_palette` }
|
||||
|
||||
//- rjf: squish
|
||||
{ Squish squish F32 0 }
|
||||
@@ -41,6 +41,7 @@ UI_StackTable:
|
||||
//- rjf: font
|
||||
{ Font font F_Tag `f_tag_zero()` }
|
||||
{ FontSize font_size F32 24.f }
|
||||
{ RunFlags run_flags F_RunFlags 0 }
|
||||
{ TabSize tab_size F32 `24.f*4.f` }
|
||||
|
||||
//- rjf: corner radii
|
||||
|
||||
@@ -130,9 +130,9 @@ internal UI_BOX_CUSTOM_DRAW(ui_line_edit_draw)
|
||||
F_Tag font = box->font;
|
||||
F32 font_size = box->font_size;
|
||||
F32 tab_size = box->tab_size;
|
||||
Vec4F32 cursor_color = box->scheme->colors[UI_ColorCode_Cursor];
|
||||
Vec4F32 cursor_color = box->palette->colors[UI_ColorCode_Cursor];
|
||||
cursor_color.w *= box->parent->parent->focus_active_t;
|
||||
Vec4F32 select_color = box->scheme->colors[UI_ColorCode_Selection];
|
||||
Vec4F32 select_color = box->palette->colors[UI_ColorCode_Selection];
|
||||
select_color.w *= (box->parent->parent->focus_active_t*0.2f + 0.8f);
|
||||
Vec2F32 text_position = ui_box_text_position(box);
|
||||
String8 edited_string = draw_data->edited_string;
|
||||
@@ -478,7 +478,7 @@ ui_do_color_tooltip_hsv(Vec3F32 hsv)
|
||||
{
|
||||
UI_PrefWidth(ui_em(22.f, 1.f)) UI_PrefHeight(ui_em(6.f, 1.f)) UI_Row UI_Padding(ui_pct(1, 0))
|
||||
{
|
||||
UI_Scheme(ui_fork_top_color_scheme(.background = v4f32(rgb.x, rgb.y, rgb.z, 1.f)))
|
||||
UI_Palette(ui_build_palette(ui_top_palette(), .background = v4f32(rgb.x, rgb.y, rgb.z, 1.f)))
|
||||
UI_CornerRadius(4.f)
|
||||
UI_PrefWidth(ui_em(6.f, 1.f)) UI_PrefHeight(ui_em(6.f, 1.f))
|
||||
ui_build_box_from_string(UI_BoxFlag_DrawBorder|UI_BoxFlag_DrawBackground, str8_lit(""));
|
||||
@@ -517,7 +517,7 @@ ui_do_color_tooltip_hsva(Vec4F32 hsva)
|
||||
{
|
||||
UI_PrefWidth(ui_em(22.f, 1.f)) UI_PrefHeight(ui_em(6.f, 1.f)) UI_Row UI_Padding(ui_pct(1, 0))
|
||||
{
|
||||
UI_Scheme(ui_fork_top_color_scheme(.background = rgba))
|
||||
UI_Palette(ui_build_palette(ui_top_palette(), .background = rgba))
|
||||
UI_CornerRadius(4.f)
|
||||
UI_PrefWidth(ui_em(6.f, 1.f)) UI_PrefHeight(ui_em(6.f, 1.f))
|
||||
ui_build_box_from_string(UI_BoxFlag_DrawBorder|UI_BoxFlag_DrawBackground, str8_lit(""));
|
||||
@@ -1064,7 +1064,6 @@ ui_table_vector_end(void)
|
||||
internal UI_Box *
|
||||
ui_table_cell_begin(void)
|
||||
{
|
||||
UI_Box *vector = ui_top_parent();
|
||||
U64 column_idx = ui_ts_cell_idx;
|
||||
F32 width_pct = column_idx < ui_ts_col_pct_count ? ui_ts_col_pcts_stable[column_idx] : 1.f;
|
||||
return ui_table_cell_sized_begin(ui_pct(width_pct, 0));
|
||||
|
||||
+19
-30
@@ -1442,7 +1442,7 @@ ui_end_build(void)
|
||||
Min(text_pos.x+drawn_text_dim.x, rect.x1),
|
||||
rect.y1),
|
||||
ui_state->mouse);
|
||||
if(text_is_truncated && mouse_is_hovering)
|
||||
if(text_is_truncated && mouse_is_hovering && !(b->flags & UI_BoxFlag_DisableTruncatedHover))
|
||||
{
|
||||
if(!str8_match(box_display_string, ui_state->string_hover_string, 0))
|
||||
{
|
||||
@@ -1890,7 +1890,7 @@ ui_begin_ctx_menu(UI_Key key)
|
||||
ui_state->ctx_menu_root->flags |= UI_BoxFlag_Clip;
|
||||
ui_state->ctx_menu_root->flags |= UI_BoxFlag_Clickable;
|
||||
ui_state->ctx_menu_root->corner_radii[Corner_00] = ui_state->ctx_menu_root->corner_radii[Corner_01] = ui_state->ctx_menu_root->corner_radii[Corner_10] = ui_state->ctx_menu_root->corner_radii[Corner_11] = ui_top_font_size()*0.25f;
|
||||
ui_state->ctx_menu_root->scheme = ui_top_scheme();
|
||||
ui_state->ctx_menu_root->palette = ui_top_palette();
|
||||
ui_state->ctx_menu_root->blur_size = ui_top_blur_size();
|
||||
}
|
||||
ui_push_pref_width(ui_bottom_pref_width());
|
||||
@@ -2036,21 +2036,16 @@ ui_set_auto_focus_hot_key(UI_Key key)
|
||||
}
|
||||
}
|
||||
|
||||
//- rjf: color scheme forming
|
||||
//- rjf: palette forming
|
||||
|
||||
internal UI_ColorScheme *
|
||||
ui_push_color_scheme_(UI_ColorScheme *params)
|
||||
internal UI_Palette *
|
||||
ui_build_palette_(UI_Palette *base, UI_Palette *overrides)
|
||||
{
|
||||
UI_ColorScheme *scheme = push_array(ui_build_arena(), UI_ColorScheme, 1);
|
||||
MemoryCopyStruct(scheme, params);
|
||||
return scheme;
|
||||
}
|
||||
|
||||
internal UI_ColorScheme *
|
||||
ui_fork_color_scheme_(UI_ColorScheme *scheme, UI_ColorScheme *overrides)
|
||||
{
|
||||
UI_ColorScheme *fork = push_array(ui_build_arena(), UI_ColorScheme, 1);
|
||||
MemoryCopyStruct(fork, scheme);
|
||||
UI_Palette *palette = push_array(ui_build_arena(), UI_Palette, 1);
|
||||
if(base != 0)
|
||||
{
|
||||
MemoryCopyStruct(palette, base);
|
||||
}
|
||||
for(EachEnumVal(UI_ColorCode, code))
|
||||
{
|
||||
if(overrides->colors[code].x != 0 ||
|
||||
@@ -2058,17 +2053,10 @@ ui_fork_color_scheme_(UI_ColorScheme *scheme, UI_ColorScheme *overrides)
|
||||
overrides->colors[code].z != 0 ||
|
||||
overrides->colors[code].w != 0)
|
||||
{
|
||||
fork->colors[code] = overrides->colors[code];
|
||||
palette->colors[code] = overrides->colors[code];
|
||||
}
|
||||
}
|
||||
return fork;
|
||||
}
|
||||
|
||||
internal UI_ColorScheme *
|
||||
ui_fork_top_color_scheme_(UI_ColorScheme *params)
|
||||
{
|
||||
UI_ColorScheme *scheme = ui_fork_color_scheme_(ui_top_scheme(), params);
|
||||
return scheme;
|
||||
return palette;
|
||||
}
|
||||
|
||||
//- rjf: box node construction
|
||||
@@ -2215,7 +2203,7 @@ ui_build_box_from_key(UI_BoxFlags flags, UI_Key key)
|
||||
|
||||
box->text_align = ui_state->text_alignment_stack.top->v;
|
||||
box->child_layout_axis = ui_state->child_layout_axis_stack.top->v;
|
||||
box->scheme = ui_state->scheme_stack.top->v;
|
||||
box->palette = ui_state->palette_stack.top->v;
|
||||
box->font = ui_state->font_stack.top->v;
|
||||
box->font_size = ui_state->font_size_stack.top->v;
|
||||
box->tab_size = ui_state->tab_size_stack.top->v;
|
||||
@@ -2302,10 +2290,11 @@ ui_box_equip_display_string(UI_Box *box, String8 string)
|
||||
ProfBeginFunction();
|
||||
box->string = push_str8_copy(ui_build_arena(), string);
|
||||
box->flags |= UI_BoxFlag_HasDisplayString;
|
||||
UI_ColorCode text_color_code = (box->flags & UI_BoxFlag_DrawTextWeak ? UI_ColorCode_TextWeak : UI_ColorCode_Text);
|
||||
if(box->flags & UI_BoxFlag_DrawText && (box->fastpath_codepoint == 0 || !(box->flags & UI_BoxFlag_DrawTextFastpathCodepoint)))
|
||||
{
|
||||
String8 display_string = ui_box_display_string(box);
|
||||
D_FancyStringNode fancy_string_n = {0, {box->font, display_string, box->scheme->colors[UI_ColorCode_Text], box->font_size, 0, 0}};
|
||||
D_FancyStringNode fancy_string_n = {0, {box->font, display_string, box->palette->colors[text_color_code], box->font_size, 0, 0}};
|
||||
D_FancyStringList fancy_strings = {&fancy_string_n, &fancy_string_n, 1};
|
||||
box->display_string_runs = d_fancy_run_list_from_fancy_string_list(ui_build_arena(), box->tab_size, &fancy_strings);
|
||||
}
|
||||
@@ -2318,15 +2307,15 @@ ui_box_equip_display_string(UI_Box *box, String8 string)
|
||||
U64 fpcp_pos = str8_find_needle(display_string, 0, fpcp, StringMatchFlag_CaseInsensitive);
|
||||
if(fpcp_pos < display_string.size)
|
||||
{
|
||||
D_FancyStringNode pst_fancy_string_n = {0, {box->font, str8_skip(display_string, fpcp_pos+fpcp.size), box->scheme->colors[UI_ColorCode_Text], box->font_size, 0, 0}};
|
||||
D_FancyStringNode cdp_fancy_string_n = {&pst_fancy_string_n, {box->font, str8_substr(display_string, r1u64(fpcp_pos, fpcp_pos+fpcp.size)), box->scheme->colors[UI_ColorCode_Text], box->font_size, 4.f, 0}};
|
||||
D_FancyStringNode pre_fancy_string_n = {&cdp_fancy_string_n, {box->font, str8_prefix(display_string, fpcp_pos), box->scheme->colors[UI_ColorCode_Text], box->font_size, 0, 0}};
|
||||
D_FancyStringNode pst_fancy_string_n = {0, {box->font, str8_skip(display_string, fpcp_pos+fpcp.size), box->palette->colors[text_color_code], box->font_size, 0, 0}};
|
||||
D_FancyStringNode cdp_fancy_string_n = {&pst_fancy_string_n, {box->font, str8_substr(display_string, r1u64(fpcp_pos, fpcp_pos+fpcp.size)), box->palette->colors[text_color_code], box->font_size, 4.f, 0}};
|
||||
D_FancyStringNode pre_fancy_string_n = {&cdp_fancy_string_n, {box->font, str8_prefix(display_string, fpcp_pos), box->palette->colors[text_color_code], box->font_size, 0, 0}};
|
||||
D_FancyStringList fancy_strings = {&pre_fancy_string_n, &pst_fancy_string_n, 3};
|
||||
box->display_string_runs = d_fancy_run_list_from_fancy_string_list(ui_build_arena(), box->tab_size, &fancy_strings);
|
||||
}
|
||||
else
|
||||
{
|
||||
D_FancyStringNode fancy_string_n = {0, {box->font, display_string, box->scheme->colors[UI_ColorCode_Text], box->font_size, 0, 0}};
|
||||
D_FancyStringNode fancy_string_n = {0, {box->font, display_string, box->palette->colors[UI_ColorCode_Text], box->font_size, 0, 0}};
|
||||
D_FancyStringList fancy_strings = {&fancy_string_n, &fancy_string_n, 1};
|
||||
box->display_string_runs = d_fancy_run_list_from_fancy_string_list(ui_build_arena(), box->tab_size, &fancy_strings);
|
||||
}
|
||||
|
||||
+54
-51
@@ -212,8 +212,8 @@ typedef enum UI_ColorCode
|
||||
}
|
||||
UI_ColorCode;
|
||||
|
||||
typedef struct UI_ColorScheme UI_ColorScheme;
|
||||
struct UI_ColorScheme
|
||||
typedef struct UI_Palette UI_Palette;
|
||||
struct UI_Palette
|
||||
{
|
||||
union
|
||||
{
|
||||
@@ -289,44 +289,45 @@ typedef U64 UI_BoxFlags;
|
||||
# define UI_BoxFlag_DefaultFocusNavY (UI_BoxFlags)(1ull<<14)
|
||||
# define UI_BoxFlag_DefaultFocusEdit (UI_BoxFlags)(1ull<<15)
|
||||
# define UI_BoxFlag_FocusNavSkip (UI_BoxFlags)(1ull<<16)
|
||||
# define UI_BoxFlag_Disabled (UI_BoxFlags)(1ull<<17)
|
||||
# define UI_BoxFlag_DisableTruncatedHover (UI_BoxFlags)(1ull<<17)
|
||||
# define UI_BoxFlag_Disabled (UI_BoxFlags)(1ull<<18)
|
||||
|
||||
//- rjf: layout
|
||||
# define UI_BoxFlag_FloatingX (UI_BoxFlags)(1ull<<18)
|
||||
# define UI_BoxFlag_FloatingY (UI_BoxFlags)(1ull<<19)
|
||||
# define UI_BoxFlag_FixedWidth (UI_BoxFlags)(1ull<<20)
|
||||
# define UI_BoxFlag_FixedHeight (UI_BoxFlags)(1ull<<21)
|
||||
# define UI_BoxFlag_AllowOverflowX (UI_BoxFlags)(1ull<<22)
|
||||
# define UI_BoxFlag_AllowOverflowY (UI_BoxFlags)(1ull<<23)
|
||||
# define UI_BoxFlag_SkipViewOffX (UI_BoxFlags)(1ull<<24)
|
||||
# define UI_BoxFlag_SkipViewOffY (UI_BoxFlags)(1ull<<25)
|
||||
# define UI_BoxFlag_FloatingX (UI_BoxFlags)(1ull<<19)
|
||||
# define UI_BoxFlag_FloatingY (UI_BoxFlags)(1ull<<20)
|
||||
# define UI_BoxFlag_FixedWidth (UI_BoxFlags)(1ull<<21)
|
||||
# define UI_BoxFlag_FixedHeight (UI_BoxFlags)(1ull<<22)
|
||||
# define UI_BoxFlag_AllowOverflowX (UI_BoxFlags)(1ull<<23)
|
||||
# define UI_BoxFlag_AllowOverflowY (UI_BoxFlags)(1ull<<24)
|
||||
# define UI_BoxFlag_SkipViewOffX (UI_BoxFlags)(1ull<<25)
|
||||
# define UI_BoxFlag_SkipViewOffY (UI_BoxFlags)(1ull<<26)
|
||||
|
||||
//- rjf: appearance / animation
|
||||
# define UI_BoxFlag_DrawDropShadow (UI_BoxFlags)(1ull<<26)
|
||||
# define UI_BoxFlag_DrawBackgroundBlur (UI_BoxFlags)(1ull<<27)
|
||||
# define UI_BoxFlag_DrawBackground (UI_BoxFlags)(1ull<<28)
|
||||
# define UI_BoxFlag_DrawBorder (UI_BoxFlags)(1ull<<29)
|
||||
# define UI_BoxFlag_DrawSideTop (UI_BoxFlags)(1ull<<30)
|
||||
# define UI_BoxFlag_DrawSideBottom (UI_BoxFlags)(1ull<<31)
|
||||
# define UI_BoxFlag_DrawSideLeft (UI_BoxFlags)(1ull<<32)
|
||||
# define UI_BoxFlag_DrawSideRight (UI_BoxFlags)(1ull<<33)
|
||||
# define UI_BoxFlag_DrawText (UI_BoxFlags)(1ull<<34)
|
||||
# define UI_BoxFlag_DrawTextFastpathCodepoint (UI_BoxFlags)(1ull<<35)
|
||||
# define UI_BoxFlag_DrawTextWeak (UI_BoxFlags)(1ull<<36)
|
||||
# define UI_BoxFlag_DrawHotEffects (UI_BoxFlags)(1ull<<37)
|
||||
# define UI_BoxFlag_DrawActiveEffects (UI_BoxFlags)(1ull<<38)
|
||||
# define UI_BoxFlag_DrawOverlay (UI_BoxFlags)(1ull<<39)
|
||||
# define UI_BoxFlag_DrawBucket (UI_BoxFlags)(1ull<<40)
|
||||
# define UI_BoxFlag_Clip (UI_BoxFlags)(1ull<<41)
|
||||
# define UI_BoxFlag_AnimatePosX (UI_BoxFlags)(1ull<<42)
|
||||
# define UI_BoxFlag_AnimatePosY (UI_BoxFlags)(1ull<<43)
|
||||
# define UI_BoxFlag_DisableTextTrunc (UI_BoxFlags)(1ull<<44)
|
||||
# define UI_BoxFlag_DisableIDString (UI_BoxFlags)(1ull<<45)
|
||||
# define UI_BoxFlag_DisableFocusViz (UI_BoxFlags)(1ull<<46)
|
||||
# define UI_BoxFlag_RequireFocusBackground (UI_BoxFlags)(1ull<<47)
|
||||
# define UI_BoxFlag_HasDisplayString (UI_BoxFlags)(1ull<<48)
|
||||
# define UI_BoxFlag_HasFuzzyMatchRanges (UI_BoxFlags)(1ull<<49)
|
||||
# define UI_BoxFlag_RoundChildrenByParent (UI_BoxFlags)(1ull<<50)
|
||||
# define UI_BoxFlag_DrawDropShadow (UI_BoxFlags)(1ull<<27)
|
||||
# define UI_BoxFlag_DrawBackgroundBlur (UI_BoxFlags)(1ull<<28)
|
||||
# define UI_BoxFlag_DrawBackground (UI_BoxFlags)(1ull<<29)
|
||||
# define UI_BoxFlag_DrawBorder (UI_BoxFlags)(1ull<<30)
|
||||
# define UI_BoxFlag_DrawSideTop (UI_BoxFlags)(1ull<<31)
|
||||
# define UI_BoxFlag_DrawSideBottom (UI_BoxFlags)(1ull<<32)
|
||||
# define UI_BoxFlag_DrawSideLeft (UI_BoxFlags)(1ull<<33)
|
||||
# define UI_BoxFlag_DrawSideRight (UI_BoxFlags)(1ull<<34)
|
||||
# define UI_BoxFlag_DrawText (UI_BoxFlags)(1ull<<35)
|
||||
# define UI_BoxFlag_DrawTextFastpathCodepoint (UI_BoxFlags)(1ull<<36)
|
||||
# define UI_BoxFlag_DrawTextWeak (UI_BoxFlags)(1ull<<37)
|
||||
# define UI_BoxFlag_DrawHotEffects (UI_BoxFlags)(1ull<<38)
|
||||
# define UI_BoxFlag_DrawActiveEffects (UI_BoxFlags)(1ull<<39)
|
||||
# define UI_BoxFlag_DrawOverlay (UI_BoxFlags)(1ull<<40)
|
||||
# define UI_BoxFlag_DrawBucket (UI_BoxFlags)(1ull<<41)
|
||||
# define UI_BoxFlag_Clip (UI_BoxFlags)(1ull<<42)
|
||||
# define UI_BoxFlag_AnimatePosX (UI_BoxFlags)(1ull<<43)
|
||||
# define UI_BoxFlag_AnimatePosY (UI_BoxFlags)(1ull<<44)
|
||||
# define UI_BoxFlag_DisableTextTrunc (UI_BoxFlags)(1ull<<45)
|
||||
# define UI_BoxFlag_DisableIDString (UI_BoxFlags)(1ull<<46)
|
||||
# define UI_BoxFlag_DisableFocusViz (UI_BoxFlags)(1ull<<47)
|
||||
# define UI_BoxFlag_RequireFocusBackground (UI_BoxFlags)(1ull<<48)
|
||||
# define UI_BoxFlag_HasDisplayString (UI_BoxFlags)(1ull<<49)
|
||||
# define UI_BoxFlag_HasFuzzyMatchRanges (UI_BoxFlags)(1ull<<50)
|
||||
# define UI_BoxFlag_RoundChildrenByParent (UI_BoxFlags)(1ull<<51)
|
||||
|
||||
//- rjf: bundles
|
||||
# define UI_BoxFlag_Clickable (UI_BoxFlag_MouseClickable|UI_BoxFlag_KeyboardClickable)
|
||||
@@ -368,7 +369,7 @@ struct UI_Box
|
||||
D_Bucket *draw_bucket;
|
||||
UI_BoxCustomDrawFunctionType *custom_draw;
|
||||
void *custom_draw_user_data;
|
||||
UI_ColorScheme *scheme;
|
||||
UI_Palette *palette;
|
||||
F_Tag font;
|
||||
F32 font_size;
|
||||
F32 tab_size;
|
||||
@@ -642,7 +643,7 @@ internal UI_Size ui_size(UI_SizeKind kind, F32 value, F32 strictness);
|
||||
////////////////////////////////
|
||||
//~ rjf: Color Scheme Type Functions
|
||||
|
||||
read_only global UI_ColorScheme ui_g_nil_color_scheme = {0};
|
||||
read_only global UI_Palette ui_g_nil_palette = {0};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Scroll Point Type Functions
|
||||
@@ -760,13 +761,9 @@ 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: color scheme forming
|
||||
internal UI_ColorScheme * ui_push_color_scheme_(UI_ColorScheme *params);
|
||||
internal UI_ColorScheme * ui_fork_color_scheme_(UI_ColorScheme *scheme, UI_ColorScheme *overrides);
|
||||
internal UI_ColorScheme * ui_fork_top_color_scheme_(UI_ColorScheme *params);
|
||||
#define ui_push_color_scheme(...) ui_push_color_scheme_(&(UI_ColorScheme){__VA_ARGS__})
|
||||
#define ui_fork_color_scheme(scheme, ...) ui_fork_color_scheme_((scheme), &(UI_ColorScheme){__VA_ARGS__})
|
||||
#define ui_fork_top_color_scheme(...) ui_fork_top_color_scheme_(&(UI_ColorScheme){__VA_ARGS__})
|
||||
//- 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(1, 1, 1, 1), __VA_ARGS__})
|
||||
|
||||
//- rjf: box node construction
|
||||
internal UI_Box * ui_build_box_from_key(UI_BoxFlags flags, UI_Key key);
|
||||
@@ -809,11 +806,12 @@ internal UI_FocusKind ui_top_focus_hot(void);
|
||||
internal UI_FocusKind ui_top_focus_active(void);
|
||||
internal U32 ui_top_fastpath_codepoint(void);
|
||||
internal F32 ui_top_transparency(void);
|
||||
internal UI_ColorScheme* ui_top_scheme(void);
|
||||
internal UI_Palette* ui_top_palette(void);
|
||||
internal F32 ui_top_squish(void);
|
||||
internal OS_Cursor ui_top_hover_cursor(void);
|
||||
internal F_Tag ui_top_font(void);
|
||||
internal F32 ui_top_font_size(void);
|
||||
internal F_RunFlags ui_top_run_flags(void);
|
||||
internal F32 ui_top_tab_size(void);
|
||||
internal F32 ui_top_corner_radius_00(void);
|
||||
internal F32 ui_top_corner_radius_01(void);
|
||||
@@ -835,11 +833,12 @@ internal UI_FocusKind ui_bottom_focus_hot(void);
|
||||
internal UI_FocusKind ui_bottom_focus_active(void);
|
||||
internal U32 ui_bottom_fastpath_codepoint(void);
|
||||
internal F32 ui_bottom_transparency(void);
|
||||
internal UI_ColorScheme* ui_bottom_scheme(void);
|
||||
internal UI_Palette* ui_bottom_palette(void);
|
||||
internal F32 ui_bottom_squish(void);
|
||||
internal OS_Cursor ui_bottom_hover_cursor(void);
|
||||
internal F_Tag ui_bottom_font(void);
|
||||
internal F32 ui_bottom_font_size(void);
|
||||
internal F_RunFlags ui_bottom_run_flags(void);
|
||||
internal F32 ui_bottom_tab_size(void);
|
||||
internal F32 ui_bottom_corner_radius_00(void);
|
||||
internal F32 ui_bottom_corner_radius_01(void);
|
||||
@@ -861,11 +860,12 @@ 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 F32 ui_push_transparency(F32 v);
|
||||
internal UI_ColorScheme* ui_push_scheme(UI_ColorScheme* v);
|
||||
internal UI_Palette* ui_push_palette(UI_Palette* v);
|
||||
internal F32 ui_push_squish(F32 v);
|
||||
internal OS_Cursor ui_push_hover_cursor(OS_Cursor v);
|
||||
internal F_Tag ui_push_font(F_Tag v);
|
||||
internal F32 ui_push_font_size(F32 v);
|
||||
internal F_RunFlags ui_push_run_flags(F_RunFlags v);
|
||||
internal F32 ui_push_tab_size(F32 v);
|
||||
internal F32 ui_push_corner_radius_00(F32 v);
|
||||
internal F32 ui_push_corner_radius_01(F32 v);
|
||||
@@ -887,11 +887,12 @@ internal UI_FocusKind ui_pop_focus_hot(void);
|
||||
internal UI_FocusKind ui_pop_focus_active(void);
|
||||
internal U32 ui_pop_fastpath_codepoint(void);
|
||||
internal F32 ui_pop_transparency(void);
|
||||
internal UI_ColorScheme* ui_pop_scheme(void);
|
||||
internal UI_Palette* ui_pop_palette(void);
|
||||
internal F32 ui_pop_squish(void);
|
||||
internal OS_Cursor ui_pop_hover_cursor(void);
|
||||
internal F_Tag ui_pop_font(void);
|
||||
internal F32 ui_pop_font_size(void);
|
||||
internal F_RunFlags ui_pop_run_flags(void);
|
||||
internal F32 ui_pop_tab_size(void);
|
||||
internal F32 ui_pop_corner_radius_00(void);
|
||||
internal F32 ui_pop_corner_radius_01(void);
|
||||
@@ -913,11 +914,12 @@ 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 F32 ui_set_next_transparency(F32 v);
|
||||
internal UI_ColorScheme* ui_set_next_scheme(UI_ColorScheme* v);
|
||||
internal UI_Palette* ui_set_next_palette(UI_Palette* v);
|
||||
internal F32 ui_set_next_squish(F32 v);
|
||||
internal OS_Cursor ui_set_next_hover_cursor(OS_Cursor v);
|
||||
internal F_Tag ui_set_next_font(F_Tag v);
|
||||
internal F32 ui_set_next_font_size(F32 v);
|
||||
internal F_RunFlags ui_set_next_run_flags(F_RunFlags v);
|
||||
internal F32 ui_set_next_tab_size(F32 v);
|
||||
internal F32 ui_set_next_corner_radius_00(F32 v);
|
||||
internal F32 ui_set_next_corner_radius_01(F32 v);
|
||||
@@ -953,11 +955,12 @@ internal void ui_pop_corner_radius(void);
|
||||
#define UI_FocusActive(v) DeferLoop(ui_push_focus_active(v), ui_pop_focus_active())
|
||||
#define UI_FastpathCodepoint(v) DeferLoop(ui_push_fastpath_codepoint(v), ui_pop_fastpath_codepoint())
|
||||
#define UI_Transparency(v) DeferLoop(ui_push_transparency(v), ui_pop_transparency())
|
||||
#define UI_Scheme(v) DeferLoop(ui_push_scheme(v), ui_pop_scheme())
|
||||
#define UI_Palette(v) DeferLoop(ui_push_palette(v), ui_pop_palette())
|
||||
#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())
|
||||
#define UI_FontSize(v) DeferLoop(ui_push_font_size(v), ui_pop_font_size())
|
||||
#define UI_RunFlags(v) DeferLoop(ui_push_run_flags(v), ui_pop_run_flags())
|
||||
#define UI_TabSize(v) DeferLoop(ui_push_tab_size(v), ui_pop_tab_size())
|
||||
#define UI_CornerRadius00(v) DeferLoop(ui_push_corner_radius_00(v), ui_pop_corner_radius_00())
|
||||
#define UI_CornerRadius01(v) DeferLoop(ui_push_corner_radius_01(v), ui_pop_corner_radius_01())
|
||||
|
||||
Reference in New Issue
Block a user