mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-07-23 07:57:50 +00:00
ui: group key, for menu-bar-style interactions, where you have several distinct boxes, but want one interaction to continuously flow between them
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
#define UI_FocusHot(v) DeferLoop(ui_push_focus_hot(v), ui_pop_focus_hot())
|
||||
#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_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_Squish(v) DeferLoop(ui_push_squish(v), ui_pop_squish())
|
||||
@@ -44,6 +45,7 @@ internal UI_BoxFlags ui_top_flags(void) { UI_StackTopImpl(ui_state, Flags, flags
|
||||
internal UI_FocusKind ui_top_focus_hot(void) { UI_StackTopImpl(ui_state, FocusHot, focus_hot) }
|
||||
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 UI_Key ui_top_group_key(void) { UI_StackTopImpl(ui_state, GroupKey, group_key) }
|
||||
internal F32 ui_top_transparency(void) { UI_StackTopImpl(ui_state, Transparency, transparency) }
|
||||
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) }
|
||||
@@ -71,6 +73,7 @@ internal UI_BoxFlags ui_bottom_flags(void) { UI_StackBottomImpl(ui_state, Flags,
|
||||
internal UI_FocusKind ui_bottom_focus_hot(void) { UI_StackBottomImpl(ui_state, FocusHot, focus_hot) }
|
||||
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 UI_Key ui_bottom_group_key(void) { UI_StackBottomImpl(ui_state, GroupKey, group_key) }
|
||||
internal F32 ui_bottom_transparency(void) { UI_StackBottomImpl(ui_state, Transparency, transparency) }
|
||||
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) }
|
||||
@@ -98,6 +101,7 @@ internal UI_BoxFlags ui_push_flags(UI_BoxFlags v) { UI_StackPushImpl(ui_state, F
|
||||
internal UI_FocusKind ui_push_focus_hot(UI_FocusKind v) { UI_StackPushImpl(ui_state, FocusHot, focus_hot, UI_FocusKind, v) }
|
||||
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 UI_Key ui_push_group_key(UI_Key v) { UI_StackPushImpl(ui_state, GroupKey, group_key, UI_Key, v) }
|
||||
internal F32 ui_push_transparency(F32 v) { UI_StackPushImpl(ui_state, Transparency, transparency, F32, 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) }
|
||||
@@ -125,6 +129,7 @@ internal UI_BoxFlags ui_pop_flags(void) { UI_StackPopImpl(ui_state, Flags, flags
|
||||
internal UI_FocusKind ui_pop_focus_hot(void) { UI_StackPopImpl(ui_state, FocusHot, focus_hot) }
|
||||
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 UI_Key ui_pop_group_key(void) { UI_StackPopImpl(ui_state, GroupKey, group_key) }
|
||||
internal F32 ui_pop_transparency(void) { UI_StackPopImpl(ui_state, Transparency, transparency) }
|
||||
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) }
|
||||
@@ -152,6 +157,7 @@ internal UI_BoxFlags ui_set_next_flags(UI_BoxFlags v) { UI_StackSetNextImpl(ui_s
|
||||
internal UI_FocusKind ui_set_next_focus_hot(UI_FocusKind v) { UI_StackSetNextImpl(ui_state, FocusHot, focus_hot, UI_FocusKind, v) }
|
||||
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 UI_Key ui_set_next_group_key(UI_Key v) { UI_StackSetNextImpl(ui_state, GroupKey, group_key, UI_Key, v) }
|
||||
internal F32 ui_set_next_transparency(F32 v) { UI_StackSetNextImpl(ui_state, Transparency, transparency, F32, 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) }
|
||||
|
||||
@@ -18,6 +18,7 @@ typedef struct UI_FlagsNode UI_FlagsNode; struct UI_FlagsNode{UI_FlagsNode *next
|
||||
typedef struct UI_FocusHotNode UI_FocusHotNode; struct UI_FocusHotNode{UI_FocusHotNode *next; UI_FocusKind v;};
|
||||
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_GroupKeyNode UI_GroupKeyNode; struct UI_GroupKeyNode{UI_GroupKeyNode *next; UI_Key v;};
|
||||
typedef struct UI_TransparencyNode UI_TransparencyNode; struct UI_TransparencyNode{UI_TransparencyNode *next; F32 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;};
|
||||
@@ -48,6 +49,7 @@ UI_FlagsNode flags_nil_stack_top;\
|
||||
UI_FocusHotNode focus_hot_nil_stack_top;\
|
||||
UI_FocusActiveNode focus_active_nil_stack_top;\
|
||||
UI_FastpathCodepointNode fastpath_codepoint_nil_stack_top;\
|
||||
UI_GroupKeyNode group_key_nil_stack_top;\
|
||||
UI_TransparencyNode transparency_nil_stack_top;\
|
||||
UI_PaletteNode palette_nil_stack_top;\
|
||||
UI_SquishNode squish_nil_stack_top;\
|
||||
@@ -77,6 +79,7 @@ state->flags_nil_stack_top.v = 0;\
|
||||
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->group_key_nil_stack_top.v = ui_key_zero();\
|
||||
state->transparency_nil_stack_top.v = 0;\
|
||||
state->palette_nil_stack_top.v = &ui_g_nil_palette;\
|
||||
state->squish_nil_stack_top.v = 0;\
|
||||
@@ -108,6 +111,7 @@ struct { UI_FlagsNode *top; UI_BoxFlags bottom_val; UI_FlagsNode *free; B32 auto
|
||||
struct { UI_FocusHotNode *top; UI_FocusKind bottom_val; UI_FocusHotNode *free; B32 auto_pop; } focus_hot_stack;\
|
||||
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_GroupKeyNode *top; UI_Key bottom_val; UI_GroupKeyNode *free; B32 auto_pop; } group_key_stack;\
|
||||
struct { UI_TransparencyNode *top; F32 bottom_val; UI_TransparencyNode *free; B32 auto_pop; } transparency_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;\
|
||||
@@ -137,6 +141,7 @@ state->flags_stack.top = &state->flags_nil_stack_top; state->flags_stack.bottom_
|
||||
state->focus_hot_stack.top = &state->focus_hot_nil_stack_top; state->focus_hot_stack.bottom_val = UI_FocusKind_Null; state->focus_hot_stack.free = 0; state->focus_hot_stack.auto_pop = 0;\
|
||||
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->group_key_stack.top = &state->group_key_nil_stack_top; state->group_key_stack.bottom_val = ui_key_zero(); state->group_key_stack.free = 0; state->group_key_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->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;\
|
||||
@@ -166,6 +171,7 @@ if(state->flags_stack.auto_pop) { ui_pop_flags(); state->flags_stack.auto_pop =
|
||||
if(state->focus_hot_stack.auto_pop) { ui_pop_focus_hot(); state->focus_hot_stack.auto_pop = 0; }\
|
||||
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->group_key_stack.auto_pop) { ui_pop_group_key(); state->group_key_stack.auto_pop = 0; }\
|
||||
if(state->transparency_stack.auto_pop) { ui_pop_transparency(); state->transparency_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; }\
|
||||
@@ -194,6 +200,7 @@ internal UI_BoxFlags ui_top_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 F32 ui_top_squish(void);
|
||||
@@ -221,6 +228,7 @@ internal UI_BoxFlags ui_bottom_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 F32 ui_bottom_squish(void);
|
||||
@@ -248,6 +256,7 @@ internal UI_BoxFlags ui_push_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 F32 ui_push_squish(F32 v);
|
||||
@@ -275,6 +284,7 @@ internal UI_BoxFlags ui_pop_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 F32 ui_pop_squish(void);
|
||||
@@ -302,6 +312,7 @@ internal UI_BoxFlags ui_set_next_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 F32 ui_set_next_squish(F32 v);
|
||||
|
||||
Reference in New Issue
Block a user