From 9899efe93c2705b8cacbe7a1261ed7bc7d7f12fc Mon Sep 17 00:00:00 2001 From: Ryan Fleury Date: Mon, 16 Sep 2024 14:44:28 -0700 Subject: [PATCH] merge view rules & view specs entirely; simplify graphical view rules down to single hook --- src/ctrl/ctrl_core.c | 2 +- .../eval_visualization.mdesk | 2 +- .../eval_visualization_core.c | 5 +- .../eval_visualization_core.h | 3 +- .../generated/eval_visualization.meta.c | 10 +- src/os/gfx/linux/os_gfx_linux.c | 20 +- src/os/gfx/os_gfx.c | 116 ++--- src/os/gfx/os_gfx.h | 20 +- src/os/gfx/stub/os_gfx_stub.c | 6 +- src/os/gfx/win32/os_gfx_win32.c | 24 +- src/raddbg/generated/raddbg.meta.c | 318 +++++-------- src/raddbg/generated/raddbg.meta.h | 120 ++--- src/raddbg/raddbg.mdesk | 203 ++------ src/raddbg/raddbg_core.c | 444 +++++++----------- src/raddbg/raddbg_core.h | 165 +------ src/raddbg/raddbg_views.c | 335 +++++++------ src/raddbg/raddbg_widgets.c | 12 +- src/ui/ui_core.c | 20 +- src/ui/ui_core.h | 8 +- 19 files changed, 680 insertions(+), 1153 deletions(-) diff --git a/src/ctrl/ctrl_core.c b/src/ctrl/ctrl_core.c index 11ebd7e6..6e5a82de 100644 --- a/src/ctrl/ctrl_core.c +++ b/src/ctrl/ctrl_core.c @@ -495,7 +495,7 @@ ctrl_msg_list_from_serialized_string(Arena *arena, String8 string) read_off += str8_deserial_read_struct(string, read_off, &mei->hit_count); read_off += str8_deserial_read_struct(string, read_off, &mei->label.size); mei->label.str = push_array_no_zero(arena, U8, mei->label.size); - read_off += str8_deserial_read(string, read_off, mei->label.str, mei->location.size, 1); + read_off += str8_deserial_read(string, read_off, mei->label.str, mei->label.size, 1); read_off += str8_deserial_read_struct(string, read_off, &mei->location.size); mei->location.str = push_array_no_zero(arena, U8, mei->location.size); read_off += str8_deserial_read(string, read_off, mei->location.str, mei->location.size, 1); diff --git a/src/eval_visualization/eval_visualization.mdesk b/src/eval_visualization/eval_visualization.mdesk index e1b5abd0..fcfe586c 100644 --- a/src/eval_visualization/eval_visualization.mdesk +++ b/src/eval_visualization/eval_visualization.mdesk @@ -113,5 +113,5 @@ EV_ViewRuleTable: @data(EV_ViewRuleInfo) @c_file ev_builtin_view_rule_info_table: { @expand(EV_ViewRuleTable a) - ```{str8_lit_comp("$(a.string)"), (EV_ViewRuleInfoFlag_Inherited*$(a.ih == "x"))|(EV_ViewRuleInfoFlag_Expandable*$(a.ex == "x"))|(EV_ViewRuleInfoFlag_ExprResolution*$(a.xp == "x"))|(EV_ViewRuleInfoFlag_VizBlockProd*$(a.vb == "x")), $(a.xp == "x" -> "EV_VIEW_RULE_EXPR_RESOLUTION_FUNCTION_NAME("..a.name_lower..")") $(a.xp != "x" -> 0), $(a.vb == "x" -> "EV_VIEW_RULE_BLOCK_PROD_FUNCTION_NAME("..a.name_lower..")") $(a.vb != "x" -> 0), }```; + ```{str8_lit_comp("$(a.string)"), (EV_ViewRuleInfoFlag_Inherited*$(a.ih == "x"))|(EV_ViewRuleInfoFlag_Expandable*$(a.ex == "x")), $(a.xp == "x" -> "EV_VIEW_RULE_EXPR_RESOLUTION_FUNCTION_NAME("..a.name_lower..")") $(a.xp != "x" -> 0), $(a.vb == "x" -> "EV_VIEW_RULE_BLOCK_PROD_FUNCTION_NAME("..a.name_lower..")") $(a.vb != "x" -> 0), }```; } diff --git a/src/eval_visualization/eval_visualization_core.c b/src/eval_visualization/eval_visualization_core.c index 0f924ff8..6051513a 100644 --- a/src/eval_visualization/eval_visualization_core.c +++ b/src/eval_visualization/eval_visualization_core.c @@ -417,7 +417,7 @@ ev_expr_from_expr_view_rules(Arena *arena, E_Expr *expr, EV_ViewRuleList *view_r for(EV_ViewRuleNode *n = view_rules->first; n != 0; n = n->next) { EV_ViewRuleInfo *info = ev_view_rule_info_from_string(n->v.root->string); - if(info->flags & EV_ViewRuleInfoFlag_ExprResolution) + if(info->expr_resolution != 0) { expr = info->expr_resolution(arena, expr, n->v.root); } @@ -501,7 +501,7 @@ ev_append_expr_blocks__rec(Arena *arena, EV_View *view, EV_Key parent_key, EV_Ke for(EV_ViewRuleNode *n = view_rules->first; n != 0; n = n->next) { EV_ViewRuleInfo *tln_info = ev_view_rule_info_from_string(n->v.root->string); - if(tln_info->flags & EV_ViewRuleInfoFlag_VizBlockProd) + if(tln_info->block_prod != 0) { block_prod_view_rule_info = tln_info; block_prod_view_rule_params = n->v.root; @@ -863,6 +863,7 @@ ev_row_list_push_new(Arena *arena, EV_View *view, EV_WindowedRowList *rows, EV_B } // rjf: fill + row->block_kind = block->kind; row->depth = block->depth; row->parent_key = block->parent_key; row->key = key; diff --git a/src/eval_visualization/eval_visualization_core.h b/src/eval_visualization/eval_visualization_core.h index b5c297d8..63189c18 100644 --- a/src/eval_visualization/eval_visualization_core.h +++ b/src/eval_visualization/eval_visualization_core.h @@ -192,8 +192,6 @@ enum { EV_ViewRuleInfoFlag_Inherited = (1<<0), EV_ViewRuleInfoFlag_Expandable = (1<<1), - EV_ViewRuleInfoFlag_ExprResolution = (1<<2), - EV_ViewRuleInfoFlag_VizBlockProd = (1<<3), }; typedef struct EV_ViewRuleInfo EV_ViewRuleInfo; @@ -246,6 +244,7 @@ struct EV_Row EV_Row *next; // rjf: block hierarchy info + EV_BlockKind block_kind; S32 depth; EV_Key parent_key; EV_Key key; diff --git a/src/eval_visualization/generated/eval_visualization.meta.c b/src/eval_visualization/generated/eval_visualization.meta.c index ba18e766..9f43e2ce 100644 --- a/src/eval_visualization/generated/eval_visualization.meta.c +++ b/src/eval_visualization/generated/eval_visualization.meta.c @@ -6,11 +6,11 @@ C_LINKAGE_BEGIN EV_ViewRuleInfo ev_builtin_view_rule_info_table[5] = { -{str8_lit_comp("default"), (EV_ViewRuleInfoFlag_Inherited*0)|(EV_ViewRuleInfoFlag_Expandable*0)|(EV_ViewRuleInfoFlag_ExprResolution*0)|(EV_ViewRuleInfoFlag_VizBlockProd*1), 0, EV_VIEW_RULE_BLOCK_PROD_FUNCTION_NAME(default) , }, -{str8_lit_comp("array"), (EV_ViewRuleInfoFlag_Inherited*0)|(EV_ViewRuleInfoFlag_Expandable*0)|(EV_ViewRuleInfoFlag_ExprResolution*1)|(EV_ViewRuleInfoFlag_VizBlockProd*0), EV_VIEW_RULE_EXPR_RESOLUTION_FUNCTION_NAME(array) , 0, }, -{str8_lit_comp("slice"), (EV_ViewRuleInfoFlag_Inherited*0)|(EV_ViewRuleInfoFlag_Expandable*0)|(EV_ViewRuleInfoFlag_ExprResolution*1)|(EV_ViewRuleInfoFlag_VizBlockProd*0), EV_VIEW_RULE_EXPR_RESOLUTION_FUNCTION_NAME(slice) , 0, }, -{str8_lit_comp("bswap"), (EV_ViewRuleInfoFlag_Inherited*1)|(EV_ViewRuleInfoFlag_Expandable*0)|(EV_ViewRuleInfoFlag_ExprResolution*1)|(EV_ViewRuleInfoFlag_VizBlockProd*0), EV_VIEW_RULE_EXPR_RESOLUTION_FUNCTION_NAME(bswap) , 0, }, -{str8_lit_comp("cast"), (EV_ViewRuleInfoFlag_Inherited*0)|(EV_ViewRuleInfoFlag_Expandable*0)|(EV_ViewRuleInfoFlag_ExprResolution*1)|(EV_ViewRuleInfoFlag_VizBlockProd*0), EV_VIEW_RULE_EXPR_RESOLUTION_FUNCTION_NAME(cast) , 0, }, +{str8_lit_comp("default"), (EV_ViewRuleInfoFlag_Inherited*0)|(EV_ViewRuleInfoFlag_Expandable*0), 0, EV_VIEW_RULE_BLOCK_PROD_FUNCTION_NAME(default) , }, +{str8_lit_comp("array"), (EV_ViewRuleInfoFlag_Inherited*0)|(EV_ViewRuleInfoFlag_Expandable*0), EV_VIEW_RULE_EXPR_RESOLUTION_FUNCTION_NAME(array) , 0, }, +{str8_lit_comp("slice"), (EV_ViewRuleInfoFlag_Inherited*0)|(EV_ViewRuleInfoFlag_Expandable*0), EV_VIEW_RULE_EXPR_RESOLUTION_FUNCTION_NAME(slice) , 0, }, +{str8_lit_comp("bswap"), (EV_ViewRuleInfoFlag_Inherited*1)|(EV_ViewRuleInfoFlag_Expandable*0), EV_VIEW_RULE_EXPR_RESOLUTION_FUNCTION_NAME(bswap) , 0, }, +{str8_lit_comp("cast"), (EV_ViewRuleInfoFlag_Inherited*0)|(EV_ViewRuleInfoFlag_Expandable*0), EV_VIEW_RULE_EXPR_RESOLUTION_FUNCTION_NAME(cast) , 0, }, }; C_LINKAGE_END diff --git a/src/os/gfx/linux/os_gfx_linux.c b/src/os/gfx/linux/os_gfx_linux.c index a29e93f8..b3c0339c 100644 --- a/src/os/gfx/linux/os_gfx_linux.c +++ b/src/os/gfx/linux/os_gfx_linux.c @@ -303,10 +303,10 @@ os_get_events(Arena *arena, B32 wait) case KeyRelease: { // rjf: determine flags - OS_EventFlags flags = 0; - if(evt.xkey.state & ShiftMask) { flags |= OS_EventFlag_Shift; } - if(evt.xkey.state & ControlMask) { flags |= OS_EventFlag_Ctrl; } - if(evt.xkey.state & Mod1Mask) { flags |= OS_EventFlag_Alt; } + OS_Modifiers flags = 0; + if(evt.xkey.state & ShiftMask) { flags |= OS_Modifier_Shift; } + if(evt.xkey.state & ControlMask) { flags |= OS_Modifier_Ctrl; } + if(evt.xkey.state & Mod1Mask) { flags |= OS_Modifier_Alt; } // rjf: map keycode -> keysym U32 keysym = XLookupKeysym(&evt.xkey, 0); @@ -374,10 +374,10 @@ os_get_events(Arena *arena, B32 wait) case ButtonRelease: { // rjf: determine flags - OS_EventFlags flags = 0; - if(evt.xbutton.state & ShiftMask) { flags |= OS_EventFlag_Shift; } - if(evt.xbutton.state & ControlMask) { flags |= OS_EventFlag_Ctrl; } - if(evt.xbutton.state & Mod1Mask) { flags |= OS_EventFlag_Alt; } + OS_Modifiers flags = 0; + if(evt.xbutton.state & ShiftMask) { flags |= OS_Modifier_Shift; } + if(evt.xbutton.state & ControlMask) { flags |= OS_Modifier_Ctrl; } + if(evt.xbutton.state & Mod1Mask) { flags |= OS_Modifier_Alt; } // rjf: map button -> OS_Key OS_Key key = OS_Key_Null; @@ -442,8 +442,8 @@ os_get_events(Arena *arena, B32 wait) return evts; } -internal OS_EventFlags -os_get_event_flags(void) +internal OS_Modifiers +os_get_modifiers(void) { return 0; } diff --git a/src/os/gfx/os_gfx.c b/src/os/gfx/os_gfx.c index d006ab02..30d09d74 100644 --- a/src/os/gfx/os_gfx.c +++ b/src/os/gfx/os_gfx.c @@ -32,60 +32,60 @@ os_string_from_event_kind(OS_EventKind kind) } internal String8List -os_string_list_from_event_flags(Arena *arena, OS_EventFlags flags) +os_string_list_from_modifiers(Arena *arena, OS_Modifiers modifiers) { String8List result = {0}; - String8 flag_strs[] = + String8 modifier_strs[] = { str8_lit("Ctrl"), str8_lit("Shift"), str8_lit("Alt"), }; - str8_list_from_flags(arena, &result, flags, flag_strs, ArrayCount(flag_strs)); + str8_list_from_flags(arena, &result, modifiers, modifier_strs, ArrayCount(modifier_strs)); return result; } internal U32 -os_codepoint_from_event_flags_and_key(OS_EventFlags flags, OS_Key key) +os_codepoint_from_modifiers_and_key(OS_Modifiers modifiers, OS_Key key) { U32 result = 0; // rjf: special-case map - local_persist read_only struct {U32 character; OS_Key key; OS_EventFlags flags;} map[] = + local_persist read_only struct {U32 character; OS_Key key; OS_Modifiers modifiers;} map[] = { - {'!', OS_Key_1, OS_EventFlag_Shift}, - {'@', OS_Key_2, OS_EventFlag_Shift}, - {'#', OS_Key_3, OS_EventFlag_Shift}, - {'$', OS_Key_4, OS_EventFlag_Shift}, - {'%', OS_Key_5, OS_EventFlag_Shift}, - {'^', OS_Key_6, OS_EventFlag_Shift}, - {'&', OS_Key_7, OS_EventFlag_Shift}, - {'*', OS_Key_8, OS_EventFlag_Shift}, - {'(', OS_Key_9, OS_EventFlag_Shift}, - {')', OS_Key_0, OS_EventFlag_Shift}, - {'_', OS_Key_Minus, OS_EventFlag_Shift}, - {'_', OS_Key_Minus, OS_EventFlag_Shift}, + {'!', OS_Key_1, OS_Modifier_Shift}, + {'@', OS_Key_2, OS_Modifier_Shift}, + {'#', OS_Key_3, OS_Modifier_Shift}, + {'$', OS_Key_4, OS_Modifier_Shift}, + {'%', OS_Key_5, OS_Modifier_Shift}, + {'^', OS_Key_6, OS_Modifier_Shift}, + {'&', OS_Key_7, OS_Modifier_Shift}, + {'*', OS_Key_8, OS_Modifier_Shift}, + {'(', OS_Key_9, OS_Modifier_Shift}, + {')', OS_Key_0, OS_Modifier_Shift}, + {'_', OS_Key_Minus, OS_Modifier_Shift}, + {'_', OS_Key_Minus, OS_Modifier_Shift}, {'-', OS_Key_Minus, 0}, {'=', OS_Key_Equal, 0}, - {'+', OS_Key_Equal, OS_EventFlag_Shift}, + {'+', OS_Key_Equal, OS_Modifier_Shift}, {'`', OS_Key_Tick, 0}, - {'~', OS_Key_Tick, OS_EventFlag_Shift}, + {'~', OS_Key_Tick, OS_Modifier_Shift}, {'[', OS_Key_LeftBracket, 0}, {']', OS_Key_RightBracket, 0}, - {'{', OS_Key_LeftBracket, OS_EventFlag_Shift}, - {'}', OS_Key_RightBracket, OS_EventFlag_Shift}, + {'{', OS_Key_LeftBracket, OS_Modifier_Shift}, + {'}', OS_Key_RightBracket, OS_Modifier_Shift}, {'\\', OS_Key_BackSlash, 0}, - {'|', OS_Key_BackSlash, OS_EventFlag_Shift}, + {'|', OS_Key_BackSlash, OS_Modifier_Shift}, {';', OS_Key_Semicolon, 0}, - {':', OS_Key_Semicolon, OS_EventFlag_Shift}, + {':', OS_Key_Semicolon, OS_Modifier_Shift}, {'\'', OS_Key_Quote, 0}, - {'"', OS_Key_Quote, OS_EventFlag_Shift}, + {'"', OS_Key_Quote, OS_Modifier_Shift}, {'.', OS_Key_Period, 0}, {',', OS_Key_Comma, 0}, - {'<', OS_Key_Period, OS_EventFlag_Shift}, - {'>', OS_Key_Comma, OS_EventFlag_Shift}, + {'<', OS_Key_Period, OS_Modifier_Shift}, + {'>', OS_Key_Comma, OS_Modifier_Shift}, {'/', OS_Key_Slash, 0}, - {'?', OS_Key_Slash, OS_EventFlag_Shift}, + {'?', OS_Key_Slash, OS_Modifier_Shift}, {'a', OS_Key_A, 0}, {'b', OS_Key_B, 0}, {'c', OS_Key_C, 0}, @@ -112,32 +112,32 @@ os_codepoint_from_event_flags_and_key(OS_EventFlags flags, OS_Key key) {'x', OS_Key_X, 0}, {'y', OS_Key_Y, 0}, {'z', OS_Key_Z, 0}, - {'A', OS_Key_A, OS_EventFlag_Shift}, - {'B', OS_Key_B, OS_EventFlag_Shift}, - {'C', OS_Key_C, OS_EventFlag_Shift}, - {'D', OS_Key_D, OS_EventFlag_Shift}, - {'E', OS_Key_E, OS_EventFlag_Shift}, - {'F', OS_Key_F, OS_EventFlag_Shift}, - {'G', OS_Key_G, OS_EventFlag_Shift}, - {'H', OS_Key_H, OS_EventFlag_Shift}, - {'I', OS_Key_I, OS_EventFlag_Shift}, - {'J', OS_Key_J, OS_EventFlag_Shift}, - {'K', OS_Key_K, OS_EventFlag_Shift}, - {'L', OS_Key_L, OS_EventFlag_Shift}, - {'M', OS_Key_M, OS_EventFlag_Shift}, - {'N', OS_Key_N, OS_EventFlag_Shift}, - {'O', OS_Key_O, OS_EventFlag_Shift}, - {'P', OS_Key_P, OS_EventFlag_Shift}, - {'Q', OS_Key_Q, OS_EventFlag_Shift}, - {'R', OS_Key_R, OS_EventFlag_Shift}, - {'S', OS_Key_S, OS_EventFlag_Shift}, - {'T', OS_Key_T, OS_EventFlag_Shift}, - {'U', OS_Key_U, OS_EventFlag_Shift}, - {'V', OS_Key_V, OS_EventFlag_Shift}, - {'W', OS_Key_W, OS_EventFlag_Shift}, - {'X', OS_Key_X, OS_EventFlag_Shift}, - {'Y', OS_Key_Y, OS_EventFlag_Shift}, - {'Z', OS_Key_Z, OS_EventFlag_Shift}, + {'A', OS_Key_A, OS_Modifier_Shift}, + {'B', OS_Key_B, OS_Modifier_Shift}, + {'C', OS_Key_C, OS_Modifier_Shift}, + {'D', OS_Key_D, OS_Modifier_Shift}, + {'E', OS_Key_E, OS_Modifier_Shift}, + {'F', OS_Key_F, OS_Modifier_Shift}, + {'G', OS_Key_G, OS_Modifier_Shift}, + {'H', OS_Key_H, OS_Modifier_Shift}, + {'I', OS_Key_I, OS_Modifier_Shift}, + {'J', OS_Key_J, OS_Modifier_Shift}, + {'K', OS_Key_K, OS_Modifier_Shift}, + {'L', OS_Key_L, OS_Modifier_Shift}, + {'M', OS_Key_M, OS_Modifier_Shift}, + {'N', OS_Key_N, OS_Modifier_Shift}, + {'O', OS_Key_O, OS_Modifier_Shift}, + {'P', OS_Key_P, OS_Modifier_Shift}, + {'Q', OS_Key_Q, OS_Modifier_Shift}, + {'R', OS_Key_R, OS_Modifier_Shift}, + {'S', OS_Key_S, OS_Modifier_Shift}, + {'T', OS_Key_T, OS_Modifier_Shift}, + {'U', OS_Key_U, OS_Modifier_Shift}, + {'V', OS_Key_V, OS_Modifier_Shift}, + {'W', OS_Key_W, OS_Modifier_Shift}, + {'X', OS_Key_X, OS_Modifier_Shift}, + {'Y', OS_Key_Y, OS_Modifier_Shift}, + {'Z', OS_Key_Z, OS_Modifier_Shift}, }; // rjf: check numeric @@ -149,7 +149,7 @@ os_codepoint_from_event_flags_and_key(OS_EventFlags flags, OS_Key key) // rjf: check special-case map for(U64 idx = 0; idx < ArrayCount(map); idx += 1) { - if(map[idx].key == key && map[idx].flags == flags) + if(map[idx].key == key && map[idx].modifiers == modifiers) { result = map[idx].character; break; @@ -167,13 +167,13 @@ os_eat_event(OS_EventList *events, OS_Event *event) } internal B32 -os_key_press(OS_EventList *events, OS_Handle window, OS_EventFlags flags, OS_Key key) +os_key_press(OS_EventList *events, OS_Handle window, OS_Modifiers modifiers, OS_Key key) { B32 result = 0; for(OS_Event *event = events->first; event != 0; event = event->next) { if((os_handle_match(event->window, window) || os_handle_match(window, os_handle_zero())) && - event->kind == OS_EventKind_Press && event->key == key && event->flags == flags) + event->kind == OS_EventKind_Press && event->key == key && event->modifiers == modifiers) { result = 1; os_eat_event(events, event); @@ -184,13 +184,13 @@ os_key_press(OS_EventList *events, OS_Handle window, OS_EventFlags flags, OS_Key } internal B32 -os_key_release(OS_EventList *events, OS_Handle window, OS_EventFlags flags, OS_Key key) +os_key_release(OS_EventList *events, OS_Handle window, OS_Modifiers modifiers, OS_Key key) { B32 result = 0; for(OS_Event *event = events->first; event != 0; event = event->next) { if((os_handle_match(event->window, window) || os_handle_match(window, os_handle_zero())) && - event->kind == OS_EventKind_Release && event->key == key && event->flags == flags) + event->kind == OS_EventKind_Release && event->key == key && event->modifiers == modifiers) { result = 1; os_eat_event(events, event); diff --git a/src/os/gfx/os_gfx.h b/src/os/gfx/os_gfx.h index 725bef19..838d0735 100644 --- a/src/os/gfx/os_gfx.h +++ b/src/os/gfx/os_gfx.h @@ -66,12 +66,12 @@ typedef enum OS_EventKind } OS_EventKind; -typedef U32 OS_EventFlags; +typedef U32 OS_Modifiers; enum { - OS_EventFlag_Ctrl = (1<<0), - OS_EventFlag_Shift = (1<<1), - OS_EventFlag_Alt = (1<<2), + OS_Modifier_Ctrl = (1<<0), + OS_Modifier_Shift = (1<<1), + OS_Modifier_Alt = (1<<2), }; typedef struct OS_Event OS_Event; @@ -82,7 +82,7 @@ struct OS_Event U64 timestamp_us; OS_Handle window; OS_EventKind kind; - OS_EventFlags flags; + OS_Modifiers modifiers; OS_Key key; B32 is_repeat; B32 right_sided; @@ -110,11 +110,11 @@ internal B32 frame(void); //~ rjf: Event Functions (Helpers, Implemented Once) internal String8 os_string_from_event_kind(OS_EventKind kind); -internal String8List os_string_list_from_event_flags(Arena *arena, OS_EventFlags flags); -internal U32 os_codepoint_from_event_flags_and_key(OS_EventFlags flags, OS_Key key); +internal String8List os_string_list_from_modifiers(Arena *arena, OS_Modifiers flags); +internal U32 os_codepoint_from_modifiers_and_key(OS_Modifiers flags, OS_Key key); internal void os_eat_event(OS_EventList *events, OS_Event *event); -internal B32 os_key_press(OS_EventList *events, OS_Handle window, OS_EventFlags flags, OS_Key key); -internal B32 os_key_release(OS_EventList *events, OS_Handle window, OS_EventFlags flags, OS_Key key); +internal B32 os_key_press(OS_EventList *events, OS_Handle window, OS_Modifiers modifiers, OS_Key key); +internal B32 os_key_release(OS_EventList *events, OS_Handle window, OS_Modifiers modifiers, OS_Key key); internal B32 os_text(OS_EventList *events, OS_Handle window, U32 character); internal OS_EventList os_event_list_copy(Arena *arena, OS_EventList *src); internal void os_event_list_concat_in_place(OS_EventList *dst, OS_EventList *to_push); @@ -173,7 +173,7 @@ internal Vec2F32 os_dim_from_monitor(OS_Handle monitor); internal void os_send_wakeup_event(void); internal OS_EventList os_get_events(Arena *arena, B32 wait); -internal OS_EventFlags os_get_event_flags(void); +internal OS_Modifiers os_get_modifiers(void); internal Vec2F32 os_mouse_from_window(OS_Handle window); //////////////////////////////// diff --git a/src/os/gfx/stub/os_gfx_stub.c b/src/os/gfx/stub/os_gfx_stub.c index 8495d008..e9fb9066 100644 --- a/src/os/gfx/stub/os_gfx_stub.c +++ b/src/os/gfx/stub/os_gfx_stub.c @@ -190,10 +190,10 @@ os_get_events(Arena *arena, B32 wait) return evts; } -internal OS_EventFlags -os_get_event_flags(void) +internal OS_Modifiers +os_get_modifiers(void) { - OS_EventFlags f = 0; + OS_Modifiers f = 0; return f; } diff --git a/src/os/gfx/win32/os_gfx_win32.c b/src/os/gfx/win32/os_gfx_win32.c index c6b33b1e..907fdab0 100644 --- a/src/os/gfx/win32/os_gfx_win32.c +++ b/src/os/gfx/win32/os_gfx_win32.c @@ -101,7 +101,7 @@ os_w32_push_event(OS_EventKind kind, OS_W32_Window *window) { OS_Event *result = os_event_list_push_new(os_w32_event_arena, &os_w32_event_list, kind); result->window = os_w32_handle_from_window(window); - result->flags = os_get_event_flags(); + result->modifiers = os_get_modifiers(); return result; } @@ -475,9 +475,9 @@ os_w32_wnd_proc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) event->repeat_count = lParam & bitmask16; event->is_repeat = is_repeat; event->right_sided = right_sided; - if(event->key == OS_Key_Alt && event->flags & OS_EventFlag_Alt) { event->flags &= ~OS_EventFlag_Alt; } - if(event->key == OS_Key_Ctrl && event->flags & OS_EventFlag_Ctrl) { event->flags &= ~OS_EventFlag_Ctrl; } - if(event->key == OS_Key_Shift && event->flags & OS_EventFlag_Shift) { event->flags &= ~OS_EventFlag_Shift; } + if(event->key == OS_Key_Alt && event->modifiers & OS_Modifier_Alt) { event->modifiers &= ~OS_Modifier_Alt; } + if(event->key == OS_Key_Ctrl && event->modifiers & OS_Modifier_Ctrl) { event->modifiers &= ~OS_Modifier_Ctrl; } + if(event->key == OS_Key_Shift && event->modifiers & OS_Modifier_Shift) { event->modifiers &= ~OS_Modifier_Shift; } }break; case WM_SYSCHAR: @@ -493,7 +493,7 @@ os_w32_wnd_proc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) OS_Event *event = os_w32_push_event(OS_EventKind_Text, window); if(lParam & bit29) { - event->flags |= OS_EventFlag_Alt; + event->modifiers |= OS_Modifier_Alt; } event->character = character; } @@ -1393,23 +1393,23 @@ os_get_events(Arena *arena, B32 wait) return os_w32_event_list; } -internal OS_EventFlags -os_get_event_flags(void) +internal OS_Modifiers +os_get_modifiers(void) { - OS_EventFlags flags = 0; + OS_Modifiers modifiers = 0; if(GetKeyState(VK_CONTROL) & 0x8000) { - flags |= OS_EventFlag_Ctrl; + modifiers |= OS_Modifier_Ctrl; } if(GetKeyState(VK_SHIFT) & 0x8000) { - flags |= OS_EventFlag_Shift; + modifiers |= OS_Modifier_Shift; } if(GetKeyState(VK_MENU) & 0x8000) { - flags |= OS_EventFlag_Alt; + modifiers |= OS_Modifier_Alt; } - return(flags); + return modifiers; } internal Vec2F32 diff --git a/src/raddbg/generated/raddbg.meta.c b/src/raddbg/generated/raddbg.meta.c index 9d9287a8..2f86dc3a 100644 --- a/src/raddbg/generated/raddbg.meta.c +++ b/src/raddbg/generated/raddbg.meta.c @@ -465,54 +465,54 @@ RD_CmdKindInfo rd_cmd_kind_info_table[217] = RD_StringBindingPair rd_default_binding_table[110] = { -{str8_lit_comp("kill_all"), {OS_Key_F5, 0 |OS_EventFlag_Shift }}, -{str8_lit_comp("step_into_inst"), {OS_Key_F11, 0 |OS_EventFlag_Alt}}, -{str8_lit_comp("step_over_inst"), {OS_Key_F10, 0 |OS_EventFlag_Alt}}, -{str8_lit_comp("step_out"), {OS_Key_F11, 0 |OS_EventFlag_Shift }}, -{str8_lit_comp("halt"), {OS_Key_X, 0 |OS_EventFlag_Ctrl |OS_EventFlag_Shift }}, +{str8_lit_comp("kill_all"), {OS_Key_F5, 0 |OS_Modifier_Shift }}, +{str8_lit_comp("step_into_inst"), {OS_Key_F11, 0 |OS_Modifier_Alt}}, +{str8_lit_comp("step_over_inst"), {OS_Key_F10, 0 |OS_Modifier_Alt}}, +{str8_lit_comp("step_out"), {OS_Key_F11, 0 |OS_Modifier_Shift }}, +{str8_lit_comp("halt"), {OS_Key_X, 0 |OS_Modifier_Ctrl |OS_Modifier_Shift }}, {str8_lit_comp("halt"), {OS_Key_Pause, 0 }}, -{str8_lit_comp("soft_halt_refresh"), {OS_Key_R, 0 |OS_EventFlag_Alt}}, +{str8_lit_comp("soft_halt_refresh"), {OS_Key_R, 0 |OS_Modifier_Alt}}, {str8_lit_comp("run"), {OS_Key_F5, 0 }}, -{str8_lit_comp("restart"), {OS_Key_F5, 0 |OS_EventFlag_Ctrl |OS_EventFlag_Shift }}, +{str8_lit_comp("restart"), {OS_Key_F5, 0 |OS_Modifier_Ctrl |OS_Modifier_Shift }}, {str8_lit_comp("step_into"), {OS_Key_F11, 0 }}, {str8_lit_comp("step_over"), {OS_Key_F10, 0 }}, -{str8_lit_comp("run_to_cursor"), {OS_Key_F10, 0 |OS_EventFlag_Ctrl }}, -{str8_lit_comp("set_next_statement"), {OS_Key_F10, 0 |OS_EventFlag_Ctrl |OS_EventFlag_Shift }}, -{str8_lit_comp("inc_ui_font_scale"), {OS_Key_Equal, 0 |OS_EventFlag_Alt}}, -{str8_lit_comp("dec_ui_font_scale"), {OS_Key_Minus, 0 |OS_EventFlag_Alt}}, -{str8_lit_comp("inc_code_font_scale"), {OS_Key_Equal, 0 |OS_EventFlag_Shift |OS_EventFlag_Alt}}, -{str8_lit_comp("dec_code_font_scale"), {OS_Key_Minus, 0 |OS_EventFlag_Shift |OS_EventFlag_Alt}}, -{str8_lit_comp("window"), {OS_Key_N, 0 |OS_EventFlag_Ctrl |OS_EventFlag_Shift }}, -{str8_lit_comp("toggle_fullscreen"), {OS_Key_Return, 0 |OS_EventFlag_Ctrl }}, -{str8_lit_comp("new_panel_right"), {OS_Key_P, 0 |OS_EventFlag_Ctrl }}, -{str8_lit_comp("new_panel_down"), {OS_Key_Minus, 0 |OS_EventFlag_Ctrl }}, -{str8_lit_comp("rotate_panel_columns"), {OS_Key_2, 0 |OS_EventFlag_Ctrl }}, -{str8_lit_comp("next_panel"), {OS_Key_Comma, 0 |OS_EventFlag_Ctrl }}, -{str8_lit_comp("prev_panel"), {OS_Key_Comma, 0 |OS_EventFlag_Ctrl |OS_EventFlag_Shift }}, -{str8_lit_comp("focus_panel_right"), {OS_Key_Right, 0 |OS_EventFlag_Ctrl |OS_EventFlag_Alt}}, -{str8_lit_comp("focus_panel_left"), {OS_Key_Left, 0 |OS_EventFlag_Ctrl |OS_EventFlag_Alt}}, -{str8_lit_comp("focus_panel_up"), {OS_Key_Up, 0 |OS_EventFlag_Ctrl |OS_EventFlag_Alt}}, -{str8_lit_comp("focus_panel_down"), {OS_Key_Down, 0 |OS_EventFlag_Ctrl |OS_EventFlag_Alt}}, -{str8_lit_comp("undo"), {OS_Key_Z, 0 |OS_EventFlag_Ctrl }}, -{str8_lit_comp("redo"), {OS_Key_Y, 0 |OS_EventFlag_Ctrl }}, -{str8_lit_comp("go_back"), {OS_Key_Left, 0 |OS_EventFlag_Alt}}, -{str8_lit_comp("go_forward"), {OS_Key_Right, 0 |OS_EventFlag_Alt}}, -{str8_lit_comp("close_panel"), {OS_Key_P, 0 |OS_EventFlag_Ctrl |OS_EventFlag_Shift }}, -{str8_lit_comp("next_tab"), {OS_Key_PageDown, 0 |OS_EventFlag_Ctrl }}, -{str8_lit_comp("prev_tab"), {OS_Key_PageUp, 0 |OS_EventFlag_Ctrl }}, -{str8_lit_comp("next_tab"), {OS_Key_Tab, 0 |OS_EventFlag_Ctrl }}, -{str8_lit_comp("prev_tab"), {OS_Key_Tab, 0 |OS_EventFlag_Ctrl |OS_EventFlag_Shift }}, -{str8_lit_comp("move_tab_right"), {OS_Key_PageDown, 0 |OS_EventFlag_Ctrl |OS_EventFlag_Shift }}, -{str8_lit_comp("move_tab_left"), {OS_Key_PageUp, 0 |OS_EventFlag_Ctrl |OS_EventFlag_Shift }}, -{str8_lit_comp("close_tab"), {OS_Key_W, 0 |OS_EventFlag_Ctrl }}, -{str8_lit_comp("tab_bar_top"), {OS_Key_Up, 0 |OS_EventFlag_Ctrl |OS_EventFlag_Shift |OS_EventFlag_Alt}}, -{str8_lit_comp("tab_bar_bottom"), {OS_Key_Down, 0 |OS_EventFlag_Ctrl |OS_EventFlag_Shift |OS_EventFlag_Alt}}, -{str8_lit_comp("open"), {OS_Key_O, 0 |OS_EventFlag_Ctrl }}, -{str8_lit_comp("reload_active"), {OS_Key_R, 0 |OS_EventFlag_Ctrl |OS_EventFlag_Shift }}, -{str8_lit_comp("switch"), {OS_Key_I, 0 |OS_EventFlag_Ctrl }}, -{str8_lit_comp("switch_to_partner_file"), {OS_Key_O, 0 |OS_EventFlag_Alt}}, -{str8_lit_comp("open_user"), {OS_Key_O, 0 |OS_EventFlag_Ctrl |OS_EventFlag_Shift |OS_EventFlag_Alt}}, -{str8_lit_comp("open_project"), {OS_Key_O, 0 |OS_EventFlag_Ctrl |OS_EventFlag_Alt}}, +{str8_lit_comp("run_to_cursor"), {OS_Key_F10, 0 |OS_Modifier_Ctrl }}, +{str8_lit_comp("set_next_statement"), {OS_Key_F10, 0 |OS_Modifier_Ctrl |OS_Modifier_Shift }}, +{str8_lit_comp("inc_ui_font_scale"), {OS_Key_Equal, 0 |OS_Modifier_Alt}}, +{str8_lit_comp("dec_ui_font_scale"), {OS_Key_Minus, 0 |OS_Modifier_Alt}}, +{str8_lit_comp("inc_code_font_scale"), {OS_Key_Equal, 0 |OS_Modifier_Shift |OS_Modifier_Alt}}, +{str8_lit_comp("dec_code_font_scale"), {OS_Key_Minus, 0 |OS_Modifier_Shift |OS_Modifier_Alt}}, +{str8_lit_comp("window"), {OS_Key_N, 0 |OS_Modifier_Ctrl |OS_Modifier_Shift }}, +{str8_lit_comp("toggle_fullscreen"), {OS_Key_Return, 0 |OS_Modifier_Ctrl }}, +{str8_lit_comp("new_panel_right"), {OS_Key_P, 0 |OS_Modifier_Ctrl }}, +{str8_lit_comp("new_panel_down"), {OS_Key_Minus, 0 |OS_Modifier_Ctrl }}, +{str8_lit_comp("rotate_panel_columns"), {OS_Key_2, 0 |OS_Modifier_Ctrl }}, +{str8_lit_comp("next_panel"), {OS_Key_Comma, 0 |OS_Modifier_Ctrl }}, +{str8_lit_comp("prev_panel"), {OS_Key_Comma, 0 |OS_Modifier_Ctrl |OS_Modifier_Shift }}, +{str8_lit_comp("focus_panel_right"), {OS_Key_Right, 0 |OS_Modifier_Ctrl |OS_Modifier_Alt}}, +{str8_lit_comp("focus_panel_left"), {OS_Key_Left, 0 |OS_Modifier_Ctrl |OS_Modifier_Alt}}, +{str8_lit_comp("focus_panel_up"), {OS_Key_Up, 0 |OS_Modifier_Ctrl |OS_Modifier_Alt}}, +{str8_lit_comp("focus_panel_down"), {OS_Key_Down, 0 |OS_Modifier_Ctrl |OS_Modifier_Alt}}, +{str8_lit_comp("undo"), {OS_Key_Z, 0 |OS_Modifier_Ctrl }}, +{str8_lit_comp("redo"), {OS_Key_Y, 0 |OS_Modifier_Ctrl }}, +{str8_lit_comp("go_back"), {OS_Key_Left, 0 |OS_Modifier_Alt}}, +{str8_lit_comp("go_forward"), {OS_Key_Right, 0 |OS_Modifier_Alt}}, +{str8_lit_comp("close_panel"), {OS_Key_P, 0 |OS_Modifier_Ctrl |OS_Modifier_Shift }}, +{str8_lit_comp("next_tab"), {OS_Key_PageDown, 0 |OS_Modifier_Ctrl }}, +{str8_lit_comp("prev_tab"), {OS_Key_PageUp, 0 |OS_Modifier_Ctrl }}, +{str8_lit_comp("next_tab"), {OS_Key_Tab, 0 |OS_Modifier_Ctrl }}, +{str8_lit_comp("prev_tab"), {OS_Key_Tab, 0 |OS_Modifier_Ctrl |OS_Modifier_Shift }}, +{str8_lit_comp("move_tab_right"), {OS_Key_PageDown, 0 |OS_Modifier_Ctrl |OS_Modifier_Shift }}, +{str8_lit_comp("move_tab_left"), {OS_Key_PageUp, 0 |OS_Modifier_Ctrl |OS_Modifier_Shift }}, +{str8_lit_comp("close_tab"), {OS_Key_W, 0 |OS_Modifier_Ctrl }}, +{str8_lit_comp("tab_bar_top"), {OS_Key_Up, 0 |OS_Modifier_Ctrl |OS_Modifier_Shift |OS_Modifier_Alt}}, +{str8_lit_comp("tab_bar_bottom"), {OS_Key_Down, 0 |OS_Modifier_Ctrl |OS_Modifier_Shift |OS_Modifier_Alt}}, +{str8_lit_comp("open"), {OS_Key_O, 0 |OS_Modifier_Ctrl }}, +{str8_lit_comp("reload_active"), {OS_Key_R, 0 |OS_Modifier_Ctrl |OS_Modifier_Shift }}, +{str8_lit_comp("switch"), {OS_Key_I, 0 |OS_Modifier_Ctrl }}, +{str8_lit_comp("switch_to_partner_file"), {OS_Key_O, 0 |OS_Modifier_Alt}}, +{str8_lit_comp("open_user"), {OS_Key_O, 0 |OS_Modifier_Ctrl |OS_Modifier_Shift |OS_Modifier_Alt}}, +{str8_lit_comp("open_project"), {OS_Key_O, 0 |OS_Modifier_Ctrl |OS_Modifier_Alt}}, {str8_lit_comp("edit"), {OS_Key_F2, 0 }}, {str8_lit_comp("accept"), {OS_Key_Return, 0 }}, {str8_lit_comp("cancel"), {OS_Key_Esc, 0 }}, @@ -520,61 +520,61 @@ RD_StringBindingPair rd_default_binding_table[110] = {str8_lit_comp("move_right"), {OS_Key_Right, 0 }}, {str8_lit_comp("move_up"), {OS_Key_Up, 0 }}, {str8_lit_comp("move_down"), {OS_Key_Down, 0 }}, -{str8_lit_comp("move_left_select"), {OS_Key_Left, 0 |OS_EventFlag_Shift }}, -{str8_lit_comp("move_right_select"), {OS_Key_Right, 0 |OS_EventFlag_Shift }}, -{str8_lit_comp("move_up_select"), {OS_Key_Up, 0 |OS_EventFlag_Shift }}, -{str8_lit_comp("move_down_select"), {OS_Key_Down, 0 |OS_EventFlag_Shift }}, -{str8_lit_comp("move_left_chunk"), {OS_Key_Left, 0 |OS_EventFlag_Ctrl }}, -{str8_lit_comp("move_right_chunk"), {OS_Key_Right, 0 |OS_EventFlag_Ctrl }}, -{str8_lit_comp("move_up_chunk"), {OS_Key_Up, 0 |OS_EventFlag_Ctrl }}, -{str8_lit_comp("move_down_chunk"), {OS_Key_Down, 0 |OS_EventFlag_Ctrl }}, +{str8_lit_comp("move_left_select"), {OS_Key_Left, 0 |OS_Modifier_Shift }}, +{str8_lit_comp("move_right_select"), {OS_Key_Right, 0 |OS_Modifier_Shift }}, +{str8_lit_comp("move_up_select"), {OS_Key_Up, 0 |OS_Modifier_Shift }}, +{str8_lit_comp("move_down_select"), {OS_Key_Down, 0 |OS_Modifier_Shift }}, +{str8_lit_comp("move_left_chunk"), {OS_Key_Left, 0 |OS_Modifier_Ctrl }}, +{str8_lit_comp("move_right_chunk"), {OS_Key_Right, 0 |OS_Modifier_Ctrl }}, +{str8_lit_comp("move_up_chunk"), {OS_Key_Up, 0 |OS_Modifier_Ctrl }}, +{str8_lit_comp("move_down_chunk"), {OS_Key_Down, 0 |OS_Modifier_Ctrl }}, {str8_lit_comp("move_up_page"), {OS_Key_PageUp, 0 }}, {str8_lit_comp("move_down_page"), {OS_Key_PageDown, 0 }}, -{str8_lit_comp("move_up_whole"), {OS_Key_Home, 0 |OS_EventFlag_Ctrl }}, -{str8_lit_comp("move_down_whole"), {OS_Key_End, 0 |OS_EventFlag_Ctrl }}, -{str8_lit_comp("move_left_chunk_select"), {OS_Key_Left, 0 |OS_EventFlag_Ctrl |OS_EventFlag_Shift }}, -{str8_lit_comp("move_right_chunk_select"), {OS_Key_Right, 0 |OS_EventFlag_Ctrl |OS_EventFlag_Shift }}, -{str8_lit_comp("move_up_chunk_select"), {OS_Key_Up, 0 |OS_EventFlag_Ctrl |OS_EventFlag_Shift }}, -{str8_lit_comp("move_down_chunk_select"), {OS_Key_Down, 0 |OS_EventFlag_Ctrl |OS_EventFlag_Shift }}, -{str8_lit_comp("move_up_page_select"), {OS_Key_PageUp, 0 |OS_EventFlag_Shift }}, -{str8_lit_comp("move_down_page_select"), {OS_Key_PageDown, 0 |OS_EventFlag_Shift }}, -{str8_lit_comp("move_up_whole_select"), {OS_Key_Home, 0 |OS_EventFlag_Ctrl |OS_EventFlag_Shift }}, -{str8_lit_comp("move_down_whole_select"), {OS_Key_End, 0 |OS_EventFlag_Ctrl |OS_EventFlag_Shift }}, -{str8_lit_comp("move_up_reorder"), {OS_Key_Up, 0 |OS_EventFlag_Alt}}, -{str8_lit_comp("move_down_reorder"), {OS_Key_Down, 0 |OS_EventFlag_Alt}}, +{str8_lit_comp("move_up_whole"), {OS_Key_Home, 0 |OS_Modifier_Ctrl }}, +{str8_lit_comp("move_down_whole"), {OS_Key_End, 0 |OS_Modifier_Ctrl }}, +{str8_lit_comp("move_left_chunk_select"), {OS_Key_Left, 0 |OS_Modifier_Ctrl |OS_Modifier_Shift }}, +{str8_lit_comp("move_right_chunk_select"), {OS_Key_Right, 0 |OS_Modifier_Ctrl |OS_Modifier_Shift }}, +{str8_lit_comp("move_up_chunk_select"), {OS_Key_Up, 0 |OS_Modifier_Ctrl |OS_Modifier_Shift }}, +{str8_lit_comp("move_down_chunk_select"), {OS_Key_Down, 0 |OS_Modifier_Ctrl |OS_Modifier_Shift }}, +{str8_lit_comp("move_up_page_select"), {OS_Key_PageUp, 0 |OS_Modifier_Shift }}, +{str8_lit_comp("move_down_page_select"), {OS_Key_PageDown, 0 |OS_Modifier_Shift }}, +{str8_lit_comp("move_up_whole_select"), {OS_Key_Home, 0 |OS_Modifier_Ctrl |OS_Modifier_Shift }}, +{str8_lit_comp("move_down_whole_select"), {OS_Key_End, 0 |OS_Modifier_Ctrl |OS_Modifier_Shift }}, +{str8_lit_comp("move_up_reorder"), {OS_Key_Up, 0 |OS_Modifier_Alt}}, +{str8_lit_comp("move_down_reorder"), {OS_Key_Down, 0 |OS_Modifier_Alt}}, {str8_lit_comp("move_home"), {OS_Key_Home, 0 }}, {str8_lit_comp("move_end"), {OS_Key_End, 0 }}, -{str8_lit_comp("move_home_select"), {OS_Key_Home, 0 |OS_EventFlag_Shift }}, -{str8_lit_comp("move_end_select"), {OS_Key_End, 0 |OS_EventFlag_Shift }}, -{str8_lit_comp("select_all"), {OS_Key_A, 0 |OS_EventFlag_Ctrl }}, +{str8_lit_comp("move_home_select"), {OS_Key_Home, 0 |OS_Modifier_Shift }}, +{str8_lit_comp("move_end_select"), {OS_Key_End, 0 |OS_Modifier_Shift }}, +{str8_lit_comp("select_all"), {OS_Key_A, 0 |OS_Modifier_Ctrl }}, {str8_lit_comp("delete_single"), {OS_Key_Delete, 0 }}, -{str8_lit_comp("delete_chunk"), {OS_Key_Delete, 0 |OS_EventFlag_Ctrl }}, +{str8_lit_comp("delete_chunk"), {OS_Key_Delete, 0 |OS_Modifier_Ctrl }}, {str8_lit_comp("backspace_single"), {OS_Key_Backspace, 0 }}, -{str8_lit_comp("backspace_chunk"), {OS_Key_Backspace, 0 |OS_EventFlag_Ctrl }}, -{str8_lit_comp("copy"), {OS_Key_C, 0 |OS_EventFlag_Ctrl }}, -{str8_lit_comp("copy"), {OS_Key_Insert, 0 |OS_EventFlag_Ctrl }}, -{str8_lit_comp("cut"), {OS_Key_X, 0 |OS_EventFlag_Ctrl }}, -{str8_lit_comp("paste"), {OS_Key_V, 0 |OS_EventFlag_Ctrl }}, -{str8_lit_comp("paste"), {OS_Key_Insert, 0 |OS_EventFlag_Shift }}, +{str8_lit_comp("backspace_chunk"), {OS_Key_Backspace, 0 |OS_Modifier_Ctrl }}, +{str8_lit_comp("copy"), {OS_Key_C, 0 |OS_Modifier_Ctrl }}, +{str8_lit_comp("copy"), {OS_Key_Insert, 0 |OS_Modifier_Ctrl }}, +{str8_lit_comp("cut"), {OS_Key_X, 0 |OS_Modifier_Ctrl }}, +{str8_lit_comp("paste"), {OS_Key_V, 0 |OS_Modifier_Ctrl }}, +{str8_lit_comp("paste"), {OS_Key_Insert, 0 |OS_Modifier_Shift }}, {str8_lit_comp("insert_text"), {OS_Key_Null, 0 }}, -{str8_lit_comp("goto_line"), {OS_Key_G, 0 |OS_EventFlag_Ctrl }}, -{str8_lit_comp("goto_address"), {OS_Key_G, 0 |OS_EventFlag_Alt}}, -{str8_lit_comp("find_text_forward"), {OS_Key_F, 0 |OS_EventFlag_Ctrl }}, -{str8_lit_comp("find_text_backward"), {OS_Key_R, 0 |OS_EventFlag_Ctrl }}, +{str8_lit_comp("goto_line"), {OS_Key_G, 0 |OS_Modifier_Ctrl }}, +{str8_lit_comp("goto_address"), {OS_Key_G, 0 |OS_Modifier_Alt}}, +{str8_lit_comp("find_text_forward"), {OS_Key_F, 0 |OS_Modifier_Ctrl }}, +{str8_lit_comp("find_text_backward"), {OS_Key_R, 0 |OS_Modifier_Ctrl }}, {str8_lit_comp("find_next"), {OS_Key_F3, 0 }}, -{str8_lit_comp("find_prev"), {OS_Key_F3, 0 |OS_EventFlag_Ctrl }}, +{str8_lit_comp("find_prev"), {OS_Key_F3, 0 |OS_Modifier_Ctrl }}, {str8_lit_comp("find_selected_thread"), {OS_Key_F4, 0 }}, -{str8_lit_comp("goto_name"), {OS_Key_J, 0 |OS_EventFlag_Ctrl }}, +{str8_lit_comp("goto_name"), {OS_Key_J, 0 |OS_Modifier_Ctrl }}, {str8_lit_comp("goto_name_at_cursor"), {OS_Key_F12, 0 }}, -{str8_lit_comp("toggle_watch_expr_at_cursor"), {OS_Key_W, 0 |OS_EventFlag_Alt}}, -{str8_lit_comp("toggle_watch_expr_at_mouse"), {OS_Key_D, 0 |OS_EventFlag_Ctrl }}, -{str8_lit_comp("toggle_watch_pin"), {OS_Key_F9, 0 |OS_EventFlag_Ctrl }}, +{str8_lit_comp("toggle_watch_expr_at_cursor"), {OS_Key_W, 0 |OS_Modifier_Alt}}, +{str8_lit_comp("toggle_watch_expr_at_mouse"), {OS_Key_D, 0 |OS_Modifier_Ctrl }}, +{str8_lit_comp("toggle_watch_pin"), {OS_Key_F9, 0 |OS_Modifier_Ctrl }}, {str8_lit_comp("toggle_breakpoint"), {OS_Key_F9, 0 }}, -{str8_lit_comp("add_target"), {OS_Key_T, 0 |OS_EventFlag_Ctrl }}, -{str8_lit_comp("attach"), {OS_Key_F6, 0 |OS_EventFlag_Shift }}, -{str8_lit_comp("filter"), {OS_Key_Slash, 0 |OS_EventFlag_Ctrl }}, +{str8_lit_comp("add_target"), {OS_Key_T, 0 |OS_Modifier_Ctrl }}, +{str8_lit_comp("attach"), {OS_Key_F6, 0 |OS_Modifier_Shift }}, +{str8_lit_comp("filter"), {OS_Key_Slash, 0 |OS_Modifier_Ctrl }}, {str8_lit_comp("run_command"), {OS_Key_F1, 0 }}, -{str8_lit_comp("log_marker"), {OS_Key_M, 0 |OS_EventFlag_Ctrl |OS_EventFlag_Shift |OS_EventFlag_Alt}}, +{str8_lit_comp("log_marker"), {OS_Key_M, 0 |OS_Modifier_Ctrl |OS_Modifier_Shift |OS_Modifier_Alt}}, }; String8 rd_binding_version_remap_old_name_table[7] = @@ -672,80 +672,42 @@ str8_lit_comp("5"), str8_lit_comp("c"), }; -String8 rd_view_kind_name_lower_table[34] = +RD_ViewRuleInfo rd_view_rule_kind_info_table[34] = { -str8_lit_comp("null"), -str8_lit_comp("empty"), -str8_lit_comp("getting_started"), -str8_lit_comp("commands"), -str8_lit_comp("file_system"), -str8_lit_comp("system_processes"), -str8_lit_comp("entity_lister"), -str8_lit_comp("symbol_lister"), -str8_lit_comp("target"), -str8_lit_comp("targets"), -str8_lit_comp("file_path_map"), -str8_lit_comp("auto_view_rules"), -str8_lit_comp("breakpoints"), -str8_lit_comp("watch_pins"), -str8_lit_comp("scheduler"), -str8_lit_comp("call_stack"), -str8_lit_comp("modules"), -str8_lit_comp("watch"), -str8_lit_comp("locals"), -str8_lit_comp("registers"), -str8_lit_comp("globals"), -str8_lit_comp("thread_locals"), -str8_lit_comp("types"), -str8_lit_comp("procedures"), -str8_lit_comp("pending_file"), -str8_lit_comp("text"), -str8_lit_comp("disasm"), -str8_lit_comp("output"), -str8_lit_comp("memory"), -str8_lit_comp("bitmap"), -str8_lit_comp("color_rgba"), -str8_lit_comp("geo3d"), -str8_lit_comp("exception_filters"), -str8_lit_comp("settings"), -}; - -RD_ViewSpecInfo rd_gfx_view_kind_spec_info_table[34] = -{ -{(0|0*RD_ViewSpecFlag_ParameterizedByEntity|0*RD_ViewSpecFlag_ProjectSpecific|0*RD_ViewSpecFlag_CanSerialize|0*RD_ViewSpecFlag_CanFilter|0*RD_ViewSpecFlag_FilterIsCode|0*RD_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("null"), str8_lit_comp(""), RD_IconKind_Null, RD_VIEW_UI_FUNCTION_NAME(null)}, -{(0|0*RD_ViewSpecFlag_ParameterizedByEntity|0*RD_ViewSpecFlag_ProjectSpecific|0*RD_ViewSpecFlag_CanSerialize|0*RD_ViewSpecFlag_CanFilter|0*RD_ViewSpecFlag_FilterIsCode|0*RD_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("empty"), str8_lit_comp(""), RD_IconKind_Null, RD_VIEW_UI_FUNCTION_NAME(empty)}, -{(0|0*RD_ViewSpecFlag_ParameterizedByEntity|0*RD_ViewSpecFlag_ProjectSpecific|1*RD_ViewSpecFlag_CanSerialize|0*RD_ViewSpecFlag_CanFilter|0*RD_ViewSpecFlag_FilterIsCode|0*RD_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("getting_started"), str8_lit_comp("Getting Started"), RD_IconKind_QuestionMark, RD_VIEW_UI_FUNCTION_NAME(getting_started)}, -{(0|0*RD_ViewSpecFlag_ParameterizedByEntity|0*RD_ViewSpecFlag_ProjectSpecific|0*RD_ViewSpecFlag_CanSerialize|0*RD_ViewSpecFlag_CanFilter|0*RD_ViewSpecFlag_FilterIsCode|0*RD_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("commands"), str8_lit_comp("Commands"), RD_IconKind_List, RD_VIEW_UI_FUNCTION_NAME(commands)}, -{(0|0*RD_ViewSpecFlag_ParameterizedByEntity|0*RD_ViewSpecFlag_ProjectSpecific|0*RD_ViewSpecFlag_CanSerialize|0*RD_ViewSpecFlag_CanFilter|0*RD_ViewSpecFlag_FilterIsCode|0*RD_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("file_system"), str8_lit_comp("File System"), RD_IconKind_FileOutline, RD_VIEW_UI_FUNCTION_NAME(file_system)}, -{(0|0*RD_ViewSpecFlag_ParameterizedByEntity|0*RD_ViewSpecFlag_ProjectSpecific|0*RD_ViewSpecFlag_CanSerialize|0*RD_ViewSpecFlag_CanFilter|0*RD_ViewSpecFlag_FilterIsCode|0*RD_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("system_processes"), str8_lit_comp("System Processes"), RD_IconKind_Null, RD_VIEW_UI_FUNCTION_NAME(system_processes)}, -{(0|0*RD_ViewSpecFlag_ParameterizedByEntity|0*RD_ViewSpecFlag_ProjectSpecific|0*RD_ViewSpecFlag_CanSerialize|0*RD_ViewSpecFlag_CanFilter|0*RD_ViewSpecFlag_FilterIsCode|0*RD_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("entity_lister"), str8_lit_comp("Entity List"), RD_IconKind_Null, RD_VIEW_UI_FUNCTION_NAME(entity_lister)}, -{(0|0*RD_ViewSpecFlag_ParameterizedByEntity|0*RD_ViewSpecFlag_ProjectSpecific|0*RD_ViewSpecFlag_CanSerialize|0*RD_ViewSpecFlag_CanFilter|0*RD_ViewSpecFlag_FilterIsCode|0*RD_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("symbol_lister"), str8_lit_comp("Symbols"), RD_IconKind_Null, RD_VIEW_UI_FUNCTION_NAME(symbol_lister)}, -{(0|1*RD_ViewSpecFlag_ParameterizedByEntity|0*RD_ViewSpecFlag_ProjectSpecific|0*RD_ViewSpecFlag_CanSerialize|0*RD_ViewSpecFlag_CanFilter|0*RD_ViewSpecFlag_FilterIsCode|0*RD_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("target"), str8_lit_comp("Target"), RD_IconKind_Target, RD_VIEW_UI_FUNCTION_NAME(target)}, -{(0|0*RD_ViewSpecFlag_ParameterizedByEntity|0*RD_ViewSpecFlag_ProjectSpecific|1*RD_ViewSpecFlag_CanSerialize|1*RD_ViewSpecFlag_CanFilter|0*RD_ViewSpecFlag_FilterIsCode|1*RD_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("targets"), str8_lit_comp("Targets"), RD_IconKind_Target, RD_VIEW_UI_FUNCTION_NAME(targets)}, -{(0|0*RD_ViewSpecFlag_ParameterizedByEntity|0*RD_ViewSpecFlag_ProjectSpecific|1*RD_ViewSpecFlag_CanSerialize|0*RD_ViewSpecFlag_CanFilter|0*RD_ViewSpecFlag_FilterIsCode|0*RD_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("file_path_map"), str8_lit_comp("File Path Map"), RD_IconKind_FileOutline, RD_VIEW_UI_FUNCTION_NAME(file_path_map)}, -{(0|0*RD_ViewSpecFlag_ParameterizedByEntity|0*RD_ViewSpecFlag_ProjectSpecific|1*RD_ViewSpecFlag_CanSerialize|0*RD_ViewSpecFlag_CanFilter|0*RD_ViewSpecFlag_FilterIsCode|0*RD_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("auto_view_rules"), str8_lit_comp("Auto View Rules"), RD_IconKind_Binoculars, RD_VIEW_UI_FUNCTION_NAME(auto_view_rules)}, -{(0|0*RD_ViewSpecFlag_ParameterizedByEntity|0*RD_ViewSpecFlag_ProjectSpecific|1*RD_ViewSpecFlag_CanSerialize|1*RD_ViewSpecFlag_CanFilter|0*RD_ViewSpecFlag_FilterIsCode|1*RD_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("breakpoints"), str8_lit_comp("Breakpoints"), RD_IconKind_CircleFilled, RD_VIEW_UI_FUNCTION_NAME(breakpoints)}, -{(0|0*RD_ViewSpecFlag_ParameterizedByEntity|0*RD_ViewSpecFlag_ProjectSpecific|1*RD_ViewSpecFlag_CanSerialize|1*RD_ViewSpecFlag_CanFilter|1*RD_ViewSpecFlag_FilterIsCode|1*RD_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("watch_pins"), str8_lit_comp("Watch Pins"), RD_IconKind_Pin, RD_VIEW_UI_FUNCTION_NAME(watch_pins)}, -{(0|0*RD_ViewSpecFlag_ParameterizedByEntity|0*RD_ViewSpecFlag_ProjectSpecific|1*RD_ViewSpecFlag_CanSerialize|1*RD_ViewSpecFlag_CanFilter|1*RD_ViewSpecFlag_FilterIsCode|1*RD_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("scheduler"), str8_lit_comp("Scheduler"), RD_IconKind_Scheduler, RD_VIEW_UI_FUNCTION_NAME(scheduler)}, -{(0|0*RD_ViewSpecFlag_ParameterizedByEntity|0*RD_ViewSpecFlag_ProjectSpecific|1*RD_ViewSpecFlag_CanSerialize|0*RD_ViewSpecFlag_CanFilter|0*RD_ViewSpecFlag_FilterIsCode|0*RD_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("call_stack"), str8_lit_comp("Call Stack"), RD_IconKind_Thread, RD_VIEW_UI_FUNCTION_NAME(call_stack)}, -{(0|0*RD_ViewSpecFlag_ParameterizedByEntity|0*RD_ViewSpecFlag_ProjectSpecific|1*RD_ViewSpecFlag_CanSerialize|1*RD_ViewSpecFlag_CanFilter|0*RD_ViewSpecFlag_FilterIsCode|1*RD_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("modules"), str8_lit_comp("Modules"), RD_IconKind_Module, RD_VIEW_UI_FUNCTION_NAME(modules)}, -{(0|0*RD_ViewSpecFlag_ParameterizedByEntity|0*RD_ViewSpecFlag_ProjectSpecific|1*RD_ViewSpecFlag_CanSerialize|1*RD_ViewSpecFlag_CanFilter|1*RD_ViewSpecFlag_FilterIsCode|1*RD_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("watch"), str8_lit_comp("Watch"), RD_IconKind_Binoculars, RD_VIEW_UI_FUNCTION_NAME(watch)}, -{(0|0*RD_ViewSpecFlag_ParameterizedByEntity|0*RD_ViewSpecFlag_ProjectSpecific|1*RD_ViewSpecFlag_CanSerialize|1*RD_ViewSpecFlag_CanFilter|1*RD_ViewSpecFlag_FilterIsCode|1*RD_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("locals"), str8_lit_comp("Locals"), RD_IconKind_Binoculars, RD_VIEW_UI_FUNCTION_NAME(locals)}, -{(0|0*RD_ViewSpecFlag_ParameterizedByEntity|0*RD_ViewSpecFlag_ProjectSpecific|1*RD_ViewSpecFlag_CanSerialize|1*RD_ViewSpecFlag_CanFilter|1*RD_ViewSpecFlag_FilterIsCode|1*RD_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("registers"), str8_lit_comp("Registers"), RD_IconKind_Binoculars, RD_VIEW_UI_FUNCTION_NAME(registers)}, -{(0|0*RD_ViewSpecFlag_ParameterizedByEntity|0*RD_ViewSpecFlag_ProjectSpecific|1*RD_ViewSpecFlag_CanSerialize|1*RD_ViewSpecFlag_CanFilter|1*RD_ViewSpecFlag_FilterIsCode|1*RD_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("globals"), str8_lit_comp("Globals"), RD_IconKind_Binoculars, RD_VIEW_UI_FUNCTION_NAME(globals)}, -{(0|0*RD_ViewSpecFlag_ParameterizedByEntity|0*RD_ViewSpecFlag_ProjectSpecific|1*RD_ViewSpecFlag_CanSerialize|1*RD_ViewSpecFlag_CanFilter|1*RD_ViewSpecFlag_FilterIsCode|1*RD_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("thread_locals"), str8_lit_comp("Thread Locals"), RD_IconKind_Binoculars, RD_VIEW_UI_FUNCTION_NAME(thread_locals)}, -{(0|0*RD_ViewSpecFlag_ParameterizedByEntity|0*RD_ViewSpecFlag_ProjectSpecific|1*RD_ViewSpecFlag_CanSerialize|1*RD_ViewSpecFlag_CanFilter|1*RD_ViewSpecFlag_FilterIsCode|1*RD_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("types"), str8_lit_comp("Types"), RD_IconKind_Binoculars, RD_VIEW_UI_FUNCTION_NAME(types)}, -{(0|0*RD_ViewSpecFlag_ParameterizedByEntity|0*RD_ViewSpecFlag_ProjectSpecific|1*RD_ViewSpecFlag_CanSerialize|1*RD_ViewSpecFlag_CanFilter|1*RD_ViewSpecFlag_FilterIsCode|1*RD_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("procedures"), str8_lit_comp("Procedures"), RD_IconKind_Binoculars, RD_VIEW_UI_FUNCTION_NAME(procedures)}, -{(0|0*RD_ViewSpecFlag_ParameterizedByEntity|0*RD_ViewSpecFlag_ProjectSpecific|0*RD_ViewSpecFlag_CanSerialize|0*RD_ViewSpecFlag_CanFilter|0*RD_ViewSpecFlag_FilterIsCode|0*RD_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("pending_file"), str8_lit_comp("Pending File"), RD_IconKind_FileOutline, RD_VIEW_UI_FUNCTION_NAME(pending_file)}, -{(0|0*RD_ViewSpecFlag_ParameterizedByEntity|1*RD_ViewSpecFlag_ProjectSpecific|1*RD_ViewSpecFlag_CanSerialize|0*RD_ViewSpecFlag_CanFilter|1*RD_ViewSpecFlag_FilterIsCode|0*RD_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("text"), str8_lit_comp("Text"), RD_IconKind_FileOutline, RD_VIEW_UI_FUNCTION_NAME(text)}, -{(0|0*RD_ViewSpecFlag_ParameterizedByEntity|0*RD_ViewSpecFlag_ProjectSpecific|1*RD_ViewSpecFlag_CanSerialize|0*RD_ViewSpecFlag_CanFilter|1*RD_ViewSpecFlag_FilterIsCode|0*RD_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("disasm"), str8_lit_comp("Disassembly"), RD_IconKind_Glasses, RD_VIEW_UI_FUNCTION_NAME(disasm)}, -{(0|0*RD_ViewSpecFlag_ParameterizedByEntity|0*RD_ViewSpecFlag_ProjectSpecific|1*RD_ViewSpecFlag_CanSerialize|0*RD_ViewSpecFlag_CanFilter|0*RD_ViewSpecFlag_FilterIsCode|0*RD_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("output"), str8_lit_comp("Output"), RD_IconKind_List, RD_VIEW_UI_FUNCTION_NAME(output)}, -{(0|0*RD_ViewSpecFlag_ParameterizedByEntity|0*RD_ViewSpecFlag_ProjectSpecific|1*RD_ViewSpecFlag_CanSerialize|0*RD_ViewSpecFlag_CanFilter|1*RD_ViewSpecFlag_FilterIsCode|0*RD_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("memory"), str8_lit_comp("Memory"), RD_IconKind_Grid, RD_VIEW_UI_FUNCTION_NAME(memory)}, -{(0|0*RD_ViewSpecFlag_ParameterizedByEntity|0*RD_ViewSpecFlag_ProjectSpecific|1*RD_ViewSpecFlag_CanSerialize|0*RD_ViewSpecFlag_CanFilter|1*RD_ViewSpecFlag_FilterIsCode|0*RD_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("bitmap"), str8_lit_comp("Bitmap"), RD_IconKind_Binoculars, RD_VIEW_UI_FUNCTION_NAME(bitmap)}, -{(0|0*RD_ViewSpecFlag_ParameterizedByEntity|0*RD_ViewSpecFlag_ProjectSpecific|1*RD_ViewSpecFlag_CanSerialize|0*RD_ViewSpecFlag_CanFilter|1*RD_ViewSpecFlag_FilterIsCode|0*RD_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("color_rgba"), str8_lit_comp("Color (RGBA)"), RD_IconKind_Palette, RD_VIEW_UI_FUNCTION_NAME(color_rgba)}, -{(0|0*RD_ViewSpecFlag_ParameterizedByEntity|0*RD_ViewSpecFlag_ProjectSpecific|1*RD_ViewSpecFlag_CanSerialize|0*RD_ViewSpecFlag_CanFilter|1*RD_ViewSpecFlag_FilterIsCode|0*RD_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("geo3d"), str8_lit_comp("Geometry (3D)"), RD_IconKind_Binoculars, RD_VIEW_UI_FUNCTION_NAME(geo3d)}, -{(0|0*RD_ViewSpecFlag_ParameterizedByEntity|0*RD_ViewSpecFlag_ProjectSpecific|1*RD_ViewSpecFlag_CanSerialize|1*RD_ViewSpecFlag_CanFilter|0*RD_ViewSpecFlag_FilterIsCode|1*RD_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("exception_filters"), str8_lit_comp("Exception Filters"), RD_IconKind_Gear, RD_VIEW_UI_FUNCTION_NAME(exception_filters)}, -{(0|0*RD_ViewSpecFlag_ParameterizedByEntity|0*RD_ViewSpecFlag_ProjectSpecific|1*RD_ViewSpecFlag_CanSerialize|1*RD_ViewSpecFlag_CanFilter|0*RD_ViewSpecFlag_FilterIsCode|1*RD_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("settings"), str8_lit_comp("Settings"), RD_IconKind_Gear, RD_VIEW_UI_FUNCTION_NAME(settings)}, +{{0}, {0}, {0}, {0}, RD_IconKind_Null, 0, 0, RD_VIEW_RULE_UI_FUNCTION_NAME(null)}, +{str8_lit_comp("empty"), str8_lit_comp(""), str8_lit_comp(""), str8_lit_comp(""), RD_IconKind_Null, (RD_ViewRuleInfoFlag_ShowInDocs*0|RD_ViewRuleInfoFlag_CanFilter*0|RD_ViewRuleInfoFlag_FilterIsCode*0|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*0|RD_ViewRuleInfoFlag_CanUseInWatchTable*0|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*0), 0, RD_VIEW_RULE_UI_FUNCTION_NAME(empty)}, +{str8_lit_comp("getting_started"), str8_lit_comp(""), str8_lit_comp("Getting Started"), str8_lit_comp(""), RD_IconKind_QuestionMark, (RD_ViewRuleInfoFlag_ShowInDocs*0|RD_ViewRuleInfoFlag_CanFilter*0|RD_ViewRuleInfoFlag_FilterIsCode*0|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*0|RD_ViewRuleInfoFlag_CanUseInWatchTable*0|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*0), 0, RD_VIEW_RULE_UI_FUNCTION_NAME(getting_started)}, +{str8_lit_comp("exception_filters"), str8_lit_comp("An interface which controls whether or not the debugger will halt attached processes upon encountering specific exception codes for the first time."), str8_lit_comp("Exception Filters"), str8_lit_comp(""), RD_IconKind_Gear, (RD_ViewRuleInfoFlag_ShowInDocs*1|RD_ViewRuleInfoFlag_CanFilter*0|RD_ViewRuleInfoFlag_FilterIsCode*0|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*0|RD_ViewRuleInfoFlag_CanUseInWatchTable*0|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*0), 0, RD_VIEW_RULE_UI_FUNCTION_NAME(exception_filters)}, +{str8_lit_comp("settings"), str8_lit_comp("An interface to modify general settings for the debugger's appearance and behavior."), str8_lit_comp("Settings"), str8_lit_comp(""), RD_IconKind_Gear, (RD_ViewRuleInfoFlag_ShowInDocs*1|RD_ViewRuleInfoFlag_CanFilter*0|RD_ViewRuleInfoFlag_FilterIsCode*0|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*0|RD_ViewRuleInfoFlag_CanUseInWatchTable*0|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*0), 0, RD_VIEW_RULE_UI_FUNCTION_NAME(settings)}, +{str8_lit_comp("pending_file"), str8_lit_comp(""), str8_lit_comp("Pending File"), str8_lit_comp(""), RD_IconKind_FileOutline, (RD_ViewRuleInfoFlag_ShowInDocs*0|RD_ViewRuleInfoFlag_CanFilter*0|RD_ViewRuleInfoFlag_FilterIsCode*0|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*0|RD_ViewRuleInfoFlag_CanUseInWatchTable*0|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*0), 0, RD_VIEW_RULE_UI_FUNCTION_NAME(pending_file)}, +{str8_lit_comp("commands"), str8_lit_comp(""), str8_lit_comp("Commands"), str8_lit_comp(""), RD_IconKind_List, (RD_ViewRuleInfoFlag_ShowInDocs*0|RD_ViewRuleInfoFlag_CanFilter*0|RD_ViewRuleInfoFlag_FilterIsCode*0|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*0|RD_ViewRuleInfoFlag_CanUseInWatchTable*0|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*0), 0, RD_VIEW_RULE_UI_FUNCTION_NAME(commands)}, +{str8_lit_comp("file_system"), str8_lit_comp(""), str8_lit_comp("File System"), str8_lit_comp(""), RD_IconKind_FileOutline, (RD_ViewRuleInfoFlag_ShowInDocs*0|RD_ViewRuleInfoFlag_CanFilter*0|RD_ViewRuleInfoFlag_FilterIsCode*0|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*0|RD_ViewRuleInfoFlag_CanUseInWatchTable*0|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*0), 0, RD_VIEW_RULE_UI_FUNCTION_NAME(file_system)}, +{str8_lit_comp("system_processes"), str8_lit_comp(""), str8_lit_comp("System Processes"), str8_lit_comp(""), RD_IconKind_Null, (RD_ViewRuleInfoFlag_ShowInDocs*0|RD_ViewRuleInfoFlag_CanFilter*0|RD_ViewRuleInfoFlag_FilterIsCode*0|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*0|RD_ViewRuleInfoFlag_CanUseInWatchTable*0|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*0), 0, RD_VIEW_RULE_UI_FUNCTION_NAME(system_processes)}, +{str8_lit_comp("entity_lister"), str8_lit_comp(""), str8_lit_comp("Entity List"), str8_lit_comp(""), RD_IconKind_Null, (RD_ViewRuleInfoFlag_ShowInDocs*0|RD_ViewRuleInfoFlag_CanFilter*0|RD_ViewRuleInfoFlag_FilterIsCode*0|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*0|RD_ViewRuleInfoFlag_CanUseInWatchTable*0|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*0), 0, RD_VIEW_RULE_UI_FUNCTION_NAME(entity_lister)}, +{str8_lit_comp("symbol_lister"), str8_lit_comp(""), str8_lit_comp("Symbols"), str8_lit_comp(""), RD_IconKind_Null, (RD_ViewRuleInfoFlag_ShowInDocs*0|RD_ViewRuleInfoFlag_CanFilter*0|RD_ViewRuleInfoFlag_FilterIsCode*0|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*0|RD_ViewRuleInfoFlag_CanUseInWatchTable*0|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*0), 0, RD_VIEW_RULE_UI_FUNCTION_NAME(symbol_lister)}, +{str8_lit_comp("watch"), str8_lit_comp("The familiar 'watch window' debugger interface. Allows the inputting of a number of expressions. Each expression in the table is evaluated within the context of the selected thread's selected call stack frame. If applicable (depending on visualization rules and the expression's type), these expressions may be hierarchically expanded, which displays children as more rows in the table. The values of these expressions may also be edited, and if possible, can be used to write to registers or memory in attached processes. Also contains a new *view rule* column, not found in other major debuggers, which allows per-row specification of various visualization rules. These view rules may be used to visualize and inspect the evaluation of expressions in a variety of ways. To learn more, read the 'View Rules' section."), str8_lit_comp("Watch"), str8_lit_comp(""), RD_IconKind_Binoculars, (RD_ViewRuleInfoFlag_ShowInDocs*1|RD_ViewRuleInfoFlag_CanFilter*1|RD_ViewRuleInfoFlag_FilterIsCode*1|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*1|RD_ViewRuleInfoFlag_CanUseInWatchTable*0|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*0), 0, RD_VIEW_RULE_UI_FUNCTION_NAME(watch)}, +{str8_lit_comp("locals"), str8_lit_comp("Nearly identical to `Watch`, but automatically filled with local variables found within the selected call stack frame of the selected thread, according to the associated debug info. View rules and evaluation values can be edited, like in `Watch`, but unlike `Watch`, expressions cannot be edited or added to the table."), str8_lit_comp("Locals"), str8_lit_comp(""), RD_IconKind_Binoculars, (RD_ViewRuleInfoFlag_ShowInDocs*1|RD_ViewRuleInfoFlag_CanFilter*1|RD_ViewRuleInfoFlag_FilterIsCode*1|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*1|RD_ViewRuleInfoFlag_CanUseInWatchTable*0|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*0), 0, RD_VIEW_RULE_UI_FUNCTION_NAME(locals)}, +{str8_lit_comp("registers"), str8_lit_comp("Nearly identical to `Watch`, but automatically filled with all register names according to the selected thread's architecture. View rules and evaluation values can be edited, like in `Watch`, but unlike `Watch`, expressions cannot be edited or added to the table."), str8_lit_comp("Registers"), str8_lit_comp(""), RD_IconKind_Binoculars, (RD_ViewRuleInfoFlag_ShowInDocs*1|RD_ViewRuleInfoFlag_CanFilter*1|RD_ViewRuleInfoFlag_FilterIsCode*1|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*1|RD_ViewRuleInfoFlag_CanUseInWatchTable*0|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*0), 0, RD_VIEW_RULE_UI_FUNCTION_NAME(registers)}, +{str8_lit_comp("globals"), str8_lit_comp("Nearly identical to `Watch`, but automatically filled with all global variables within the selected thread's module. View rules and evaluation values can be edited, like in `Watch`, but unlike `Watch`, expressions cannot be edited or added to the table."), str8_lit_comp("Globals"), str8_lit_comp(""), RD_IconKind_Binoculars, (RD_ViewRuleInfoFlag_ShowInDocs*1|RD_ViewRuleInfoFlag_CanFilter*1|RD_ViewRuleInfoFlag_FilterIsCode*1|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*1|RD_ViewRuleInfoFlag_CanUseInWatchTable*0|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*0), 0, RD_VIEW_RULE_UI_FUNCTION_NAME(globals)}, +{str8_lit_comp("thread_locals"), str8_lit_comp("Nearly identical to `Watch`, but automatically filled with all thread local variables within the selected thread's module. View rules and evaluation values can be edited, like in `Watch`, but unlike `Watch`, expressions cannot be edited or added to the table."), str8_lit_comp("Thread Locals"), str8_lit_comp(""), RD_IconKind_Binoculars, (RD_ViewRuleInfoFlag_ShowInDocs*1|RD_ViewRuleInfoFlag_CanFilter*1|RD_ViewRuleInfoFlag_FilterIsCode*1|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*1|RD_ViewRuleInfoFlag_CanUseInWatchTable*0|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*0), 0, RD_VIEW_RULE_UI_FUNCTION_NAME(thread_locals)}, +{str8_lit_comp("types"), str8_lit_comp("Nearly identical to `Watch`, but automatically filled with all types within the selected thread's module. View rules can be edited, like in `Watch`, but unlike `Watch`, expressions cannot be edited or added to the table."), str8_lit_comp("Types"), str8_lit_comp(""), RD_IconKind_Binoculars, (RD_ViewRuleInfoFlag_ShowInDocs*1|RD_ViewRuleInfoFlag_CanFilter*1|RD_ViewRuleInfoFlag_FilterIsCode*1|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*1|RD_ViewRuleInfoFlag_CanUseInWatchTable*0|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*0), 0, RD_VIEW_RULE_UI_FUNCTION_NAME(types)}, +{str8_lit_comp("procedures"), str8_lit_comp("Nearly identical to `Watch`, but automatically filled with all procedures within the selected thread's module. View rules can be edited, like in `Watch`, but unlike `Watch`, expressions cannot be edited or added to the table."), str8_lit_comp("Procedures"), str8_lit_comp(""), RD_IconKind_Binoculars, (RD_ViewRuleInfoFlag_ShowInDocs*1|RD_ViewRuleInfoFlag_CanFilter*1|RD_ViewRuleInfoFlag_FilterIsCode*1|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*1|RD_ViewRuleInfoFlag_CanUseInWatchTable*0|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*0), 0, RD_VIEW_RULE_UI_FUNCTION_NAME(procedures)}, +{str8_lit_comp("targets"), str8_lit_comp("Displays a list of all targets, as well as controls for enabling, disabling, launching, editing, or deleting each target. For more information on targets, read the `Targets` section."), str8_lit_comp("Targets"), str8_lit_comp(""), RD_IconKind_Target, (RD_ViewRuleInfoFlag_ShowInDocs*1|RD_ViewRuleInfoFlag_CanFilter*1|RD_ViewRuleInfoFlag_FilterIsCode*1|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*1|RD_ViewRuleInfoFlag_CanUseInWatchTable*0|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*0), 0, RD_VIEW_RULE_UI_FUNCTION_NAME(targets)}, +{str8_lit_comp("file_path_map"), str8_lit_comp("Displays a table of *path maps*. Each path map is a pair of file or folder paths, one being a 'source' path, and one being a 'destination' path. These pairs are used by the debugger when automatically searching for specific files - for instance, when attempting to snap to a source code location specified by debug info. If debug info refers to a path on the machine on which a target executable was originally built, but that path is not valid on the debugger machine, but some alternative path exists, then path maps may be used to redirect the debugger from the debug info's specified paths to the associated appropriate debugger machine file paths."), str8_lit_comp("File Path Map"), str8_lit_comp(""), RD_IconKind_FileOutline, (RD_ViewRuleInfoFlag_ShowInDocs*1|RD_ViewRuleInfoFlag_CanFilter*1|RD_ViewRuleInfoFlag_FilterIsCode*1|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*1|RD_ViewRuleInfoFlag_CanUseInWatchTable*0|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*0), 0, RD_VIEW_RULE_UI_FUNCTION_NAME(file_path_map)}, +{str8_lit_comp("auto_view_rules"), str8_lit_comp("Displays a table of *auto view rules*. Each *auto view rule* is a pair, with one element being a type, and the other being a view rule, which should be automatically applied to expressions of that type, when possible."), str8_lit_comp("Auto View Rules"), str8_lit_comp(""), RD_IconKind_Binoculars, (RD_ViewRuleInfoFlag_ShowInDocs*1|RD_ViewRuleInfoFlag_CanFilter*1|RD_ViewRuleInfoFlag_FilterIsCode*1|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*1|RD_ViewRuleInfoFlag_CanUseInWatchTable*0|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*0), 0, RD_VIEW_RULE_UI_FUNCTION_NAME(auto_view_rules)}, +{str8_lit_comp("breakpoints"), str8_lit_comp("Displays a table of all breakpoints, containing information about each breakpoint's name, location, and hit count. Also contains per-breakpoint controls for enabling, deleting, or editing each breakpoint. For more information on breakpoints and their features, read the 'Breakpoints' section."), str8_lit_comp("Breakpoints"), str8_lit_comp(""), RD_IconKind_CircleFilled, (RD_ViewRuleInfoFlag_ShowInDocs*1|RD_ViewRuleInfoFlag_CanFilter*1|RD_ViewRuleInfoFlag_FilterIsCode*1|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*1|RD_ViewRuleInfoFlag_CanUseInWatchTable*0|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*0), 0, RD_VIEW_RULE_UI_FUNCTION_NAME(breakpoints)}, +{str8_lit_comp("watch_pins"), str8_lit_comp("Displays a table of all watch pins (watched expressions, like those found in `Watch`, but instead of being within a table, being pinned to some source code location, like breakpoints). This table contains each pin's name, location, and controls for editing or deleting each pin."), str8_lit_comp("Watch Pins"), str8_lit_comp(""), RD_IconKind_Pin, (RD_ViewRuleInfoFlag_ShowInDocs*1|RD_ViewRuleInfoFlag_CanFilter*1|RD_ViewRuleInfoFlag_FilterIsCode*1|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*1|RD_ViewRuleInfoFlag_CanUseInWatchTable*0|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*0), 0, RD_VIEW_RULE_UI_FUNCTION_NAME(watch_pins)}, +{str8_lit_comp("scheduler"), str8_lit_comp("Displays all processes and threads to which the debugger is currently attached, and contains controls for selecting and freezing threads."), str8_lit_comp("Scheduler"), str8_lit_comp(""), RD_IconKind_Scheduler, (RD_ViewRuleInfoFlag_ShowInDocs*1|RD_ViewRuleInfoFlag_CanFilter*1|RD_ViewRuleInfoFlag_FilterIsCode*1|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*1|RD_ViewRuleInfoFlag_CanUseInWatchTable*0|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*0), 0, RD_VIEW_RULE_UI_FUNCTION_NAME(scheduler)}, +{str8_lit_comp("call_stack"), str8_lit_comp("Displays the call stack of the currently selected thread. Each frame in the call stack contains the associated module, function name, and return address. Allows selection of a particular call stack frame other than the top."), str8_lit_comp("Call Stack"), str8_lit_comp(""), RD_IconKind_Thread, (RD_ViewRuleInfoFlag_ShowInDocs*1|RD_ViewRuleInfoFlag_CanFilter*1|RD_ViewRuleInfoFlag_FilterIsCode*1|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*1|RD_ViewRuleInfoFlag_CanUseInWatchTable*0|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*0), 0, RD_VIEW_RULE_UI_FUNCTION_NAME(call_stack)}, +{str8_lit_comp("modules"), str8_lit_comp("Displays a table of all modules currently loaded by any process to which the debugger is attached. This table displays each module's name, virtual address range in the containing process' address space, and which debug info file is being used by the debugger for the associated module."), str8_lit_comp("Modules"), str8_lit_comp(""), RD_IconKind_Module, (RD_ViewRuleInfoFlag_ShowInDocs*1|RD_ViewRuleInfoFlag_CanFilter*1|RD_ViewRuleInfoFlag_FilterIsCode*1|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*1|RD_ViewRuleInfoFlag_CanUseInWatchTable*0|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*0), 0, RD_VIEW_RULE_UI_FUNCTION_NAME(modules)}, +{str8_lit_comp("text"), str8_lit_comp(""), str8_lit_comp("Text"), str8_lit_comp("x:{'lang':lang, 'size':expr}"), RD_IconKind_FileOutline, (RD_ViewRuleInfoFlag_ShowInDocs*0|RD_ViewRuleInfoFlag_CanFilter*0|RD_ViewRuleInfoFlag_FilterIsCode*0|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*0|RD_ViewRuleInfoFlag_CanUseInWatchTable*1|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*1), EV_VIEW_RULE_BLOCK_PROD_FUNCTION_NAME(text) , RD_VIEW_RULE_UI_FUNCTION_NAME(text)}, +{str8_lit_comp("disasm"), str8_lit_comp("Displays disassembled instructions in a textual form from the selected thread's containing process virtual address space."), str8_lit_comp("Disassembly"), str8_lit_comp("x:{'arch':arch, 'size':expr}"), RD_IconKind_Glasses, (RD_ViewRuleInfoFlag_ShowInDocs*1|RD_ViewRuleInfoFlag_CanFilter*0|RD_ViewRuleInfoFlag_FilterIsCode*0|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*0|RD_ViewRuleInfoFlag_CanUseInWatchTable*1|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*1), EV_VIEW_RULE_BLOCK_PROD_FUNCTION_NAME(disasm) , RD_VIEW_RULE_UI_FUNCTION_NAME(disasm)}, +{str8_lit_comp("output"), str8_lit_comp("Displays debug strings, output from attached processes."), str8_lit_comp("Output"), str8_lit_comp(""), RD_IconKind_List, (RD_ViewRuleInfoFlag_ShowInDocs*1|RD_ViewRuleInfoFlag_CanFilter*0|RD_ViewRuleInfoFlag_FilterIsCode*0|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*0|RD_ViewRuleInfoFlag_CanUseInWatchTable*0|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*0), 0, RD_VIEW_RULE_UI_FUNCTION_NAME(output)}, +{str8_lit_comp("memory"), str8_lit_comp("A hex-editor-like grid interface for viewing memory."), str8_lit_comp("Memory"), str8_lit_comp("x:{'size':expr}"), RD_IconKind_Grid, (RD_ViewRuleInfoFlag_ShowInDocs*1|RD_ViewRuleInfoFlag_CanFilter*0|RD_ViewRuleInfoFlag_FilterIsCode*0|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*0|RD_ViewRuleInfoFlag_CanUseInWatchTable*1|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*1), EV_VIEW_RULE_BLOCK_PROD_FUNCTION_NAME(memory) , RD_VIEW_RULE_UI_FUNCTION_NAME(memory)}, +{str8_lit_comp("bitmap"), str8_lit_comp("Visualizes memory as a bitmap."), str8_lit_comp("Bitmap"), str8_lit_comp("x:{'w':expr, 'h':expr, 'fmt':tex2dformat}"), RD_IconKind_Binoculars, (RD_ViewRuleInfoFlag_ShowInDocs*1|RD_ViewRuleInfoFlag_CanFilter*0|RD_ViewRuleInfoFlag_FilterIsCode*0|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*0|RD_ViewRuleInfoFlag_CanUseInWatchTable*1|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*1), EV_VIEW_RULE_BLOCK_PROD_FUNCTION_NAME(bitmap) , RD_VIEW_RULE_UI_FUNCTION_NAME(bitmap)}, +{str8_lit_comp("checkbox"), str8_lit_comp("Visualizes memory as an RGBA color."), str8_lit_comp("Checkbox"), str8_lit_comp(""), RD_IconKind_CheckFilled, (RD_ViewRuleInfoFlag_ShowInDocs*1|RD_ViewRuleInfoFlag_CanFilter*0|RD_ViewRuleInfoFlag_FilterIsCode*0|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*0|RD_ViewRuleInfoFlag_CanUseInWatchTable*1|RD_ViewRuleInfoFlag_CanFillValueCell*1|RD_ViewRuleInfoFlag_CanExpand*0), 0, RD_VIEW_RULE_UI_FUNCTION_NAME(checkbox)}, +{str8_lit_comp("color_rgba"), str8_lit_comp("Visualizes memory as an RGBA color."), str8_lit_comp("Color (RGBA)"), str8_lit_comp(""), RD_IconKind_Palette, (RD_ViewRuleInfoFlag_ShowInDocs*1|RD_ViewRuleInfoFlag_CanFilter*0|RD_ViewRuleInfoFlag_FilterIsCode*0|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*0|RD_ViewRuleInfoFlag_CanUseInWatchTable*1|RD_ViewRuleInfoFlag_CanFillValueCell*1|RD_ViewRuleInfoFlag_CanExpand*1), EV_VIEW_RULE_BLOCK_PROD_FUNCTION_NAME(color_rgba) , RD_VIEW_RULE_UI_FUNCTION_NAME(color_rgba)}, +{str8_lit_comp("geo3d"), str8_lit_comp("Visualizes memory as 3D geometry."), str8_lit_comp("Geometry (3D)"), str8_lit_comp("x:{'count':expr, 'vtx':expr, 'vtx_size':expr}"), RD_IconKind_Binoculars, (RD_ViewRuleInfoFlag_ShowInDocs*1|RD_ViewRuleInfoFlag_CanFilter*0|RD_ViewRuleInfoFlag_FilterIsCode*0|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*0|RD_ViewRuleInfoFlag_CanUseInWatchTable*1|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*1), EV_VIEW_RULE_BLOCK_PROD_FUNCTION_NAME(geo3d) , RD_VIEW_RULE_UI_FUNCTION_NAME(geo3d)}, }; RD_IconKind rd_entity_kind_icon_kind_table[30] = @@ -782,42 +744,6 @@ RD_IconKind_Null, RD_IconKind_Null, }; -RD_ViewRuleSpecInfo rd_gfx_view_rule_spec_info_table[32] = -{ -{ str8_lit_comp("Empty"), (RD_ViewRuleSpecInfoFlag_VizRowProd*0)|(RD_ViewRuleSpecInfoFlag_LineStringize*0)|(RD_ViewRuleSpecInfoFlag_RowUI*0)|(RD_ViewRuleSpecInfoFlag_ViewUI*0), 0, 0 }, -{ str8_lit_comp("GettingStarted"), (RD_ViewRuleSpecInfoFlag_VizRowProd*0)|(RD_ViewRuleSpecInfoFlag_LineStringize*0)|(RD_ViewRuleSpecInfoFlag_RowUI*0)|(RD_ViewRuleSpecInfoFlag_ViewUI*0), 0, 0 }, -{ str8_lit_comp("ExceptionFilters"), (RD_ViewRuleSpecInfoFlag_VizRowProd*0)|(RD_ViewRuleSpecInfoFlag_LineStringize*0)|(RD_ViewRuleSpecInfoFlag_RowUI*0)|(RD_ViewRuleSpecInfoFlag_ViewUI*0), 0, 0 }, -{ str8_lit_comp("Settings"), (RD_ViewRuleSpecInfoFlag_VizRowProd*0)|(RD_ViewRuleSpecInfoFlag_LineStringize*0)|(RD_ViewRuleSpecInfoFlag_RowUI*0)|(RD_ViewRuleSpecInfoFlag_ViewUI*0), 0, 0 }, -{ str8_lit_comp("PendingFile"), (RD_ViewRuleSpecInfoFlag_VizRowProd*0)|(RD_ViewRuleSpecInfoFlag_LineStringize*0)|(RD_ViewRuleSpecInfoFlag_RowUI*0)|(RD_ViewRuleSpecInfoFlag_ViewUI*0), 0, 0 }, -{ str8_lit_comp("Commands"), (RD_ViewRuleSpecInfoFlag_VizRowProd*0)|(RD_ViewRuleSpecInfoFlag_LineStringize*0)|(RD_ViewRuleSpecInfoFlag_RowUI*0)|(RD_ViewRuleSpecInfoFlag_ViewUI*0), 0, 0 }, -{ str8_lit_comp("FileSystem"), (RD_ViewRuleSpecInfoFlag_VizRowProd*0)|(RD_ViewRuleSpecInfoFlag_LineStringize*0)|(RD_ViewRuleSpecInfoFlag_RowUI*0)|(RD_ViewRuleSpecInfoFlag_ViewUI*0), 0, 0 }, -{ str8_lit_comp("SystemProcesses"), (RD_ViewRuleSpecInfoFlag_VizRowProd*0)|(RD_ViewRuleSpecInfoFlag_LineStringize*0)|(RD_ViewRuleSpecInfoFlag_RowUI*0)|(RD_ViewRuleSpecInfoFlag_ViewUI*0), 0, 0 }, -{ str8_lit_comp("EntityLister"), (RD_ViewRuleSpecInfoFlag_VizRowProd*0)|(RD_ViewRuleSpecInfoFlag_LineStringize*0)|(RD_ViewRuleSpecInfoFlag_RowUI*0)|(RD_ViewRuleSpecInfoFlag_ViewUI*0), 0, 0 }, -{ str8_lit_comp("SymbolLister"), (RD_ViewRuleSpecInfoFlag_VizRowProd*0)|(RD_ViewRuleSpecInfoFlag_LineStringize*0)|(RD_ViewRuleSpecInfoFlag_RowUI*0)|(RD_ViewRuleSpecInfoFlag_ViewUI*0), 0, 0 }, -{ str8_lit_comp("Watch"), (RD_ViewRuleSpecInfoFlag_VizRowProd*0)|(RD_ViewRuleSpecInfoFlag_LineStringize*0)|(RD_ViewRuleSpecInfoFlag_RowUI*0)|(RD_ViewRuleSpecInfoFlag_ViewUI*0), 0, 0 }, -{ str8_lit_comp("Locals"), (RD_ViewRuleSpecInfoFlag_VizRowProd*0)|(RD_ViewRuleSpecInfoFlag_LineStringize*0)|(RD_ViewRuleSpecInfoFlag_RowUI*0)|(RD_ViewRuleSpecInfoFlag_ViewUI*0), 0, 0 }, -{ str8_lit_comp("Registers"), (RD_ViewRuleSpecInfoFlag_VizRowProd*0)|(RD_ViewRuleSpecInfoFlag_LineStringize*0)|(RD_ViewRuleSpecInfoFlag_RowUI*0)|(RD_ViewRuleSpecInfoFlag_ViewUI*0), 0, 0 }, -{ str8_lit_comp("Globals"), (RD_ViewRuleSpecInfoFlag_VizRowProd*0)|(RD_ViewRuleSpecInfoFlag_LineStringize*0)|(RD_ViewRuleSpecInfoFlag_RowUI*0)|(RD_ViewRuleSpecInfoFlag_ViewUI*0), 0, 0 }, -{ str8_lit_comp("ThreadLocals"), (RD_ViewRuleSpecInfoFlag_VizRowProd*0)|(RD_ViewRuleSpecInfoFlag_LineStringize*0)|(RD_ViewRuleSpecInfoFlag_RowUI*0)|(RD_ViewRuleSpecInfoFlag_ViewUI*0), 0, 0 }, -{ str8_lit_comp("Types"), (RD_ViewRuleSpecInfoFlag_VizRowProd*0)|(RD_ViewRuleSpecInfoFlag_LineStringize*0)|(RD_ViewRuleSpecInfoFlag_RowUI*0)|(RD_ViewRuleSpecInfoFlag_ViewUI*0), 0, 0 }, -{ str8_lit_comp("Procedures"), (RD_ViewRuleSpecInfoFlag_VizRowProd*0)|(RD_ViewRuleSpecInfoFlag_LineStringize*0)|(RD_ViewRuleSpecInfoFlag_RowUI*0)|(RD_ViewRuleSpecInfoFlag_ViewUI*0), 0, 0 }, -{ str8_lit_comp("Targets"), (RD_ViewRuleSpecInfoFlag_VizRowProd*0)|(RD_ViewRuleSpecInfoFlag_LineStringize*0)|(RD_ViewRuleSpecInfoFlag_RowUI*0)|(RD_ViewRuleSpecInfoFlag_ViewUI*0), 0, 0 }, -{ str8_lit_comp("FilePathMap"), (RD_ViewRuleSpecInfoFlag_VizRowProd*0)|(RD_ViewRuleSpecInfoFlag_LineStringize*0)|(RD_ViewRuleSpecInfoFlag_RowUI*0)|(RD_ViewRuleSpecInfoFlag_ViewUI*0), 0, 0 }, -{ str8_lit_comp("AutoViewRules"), (RD_ViewRuleSpecInfoFlag_VizRowProd*0)|(RD_ViewRuleSpecInfoFlag_LineStringize*0)|(RD_ViewRuleSpecInfoFlag_RowUI*0)|(RD_ViewRuleSpecInfoFlag_ViewUI*0), 0, 0 }, -{ str8_lit_comp("Breakpoints"), (RD_ViewRuleSpecInfoFlag_VizRowProd*0)|(RD_ViewRuleSpecInfoFlag_LineStringize*0)|(RD_ViewRuleSpecInfoFlag_RowUI*0)|(RD_ViewRuleSpecInfoFlag_ViewUI*0), 0, 0 }, -{ str8_lit_comp("WatchPins"), (RD_ViewRuleSpecInfoFlag_VizRowProd*0)|(RD_ViewRuleSpecInfoFlag_LineStringize*0)|(RD_ViewRuleSpecInfoFlag_RowUI*0)|(RD_ViewRuleSpecInfoFlag_ViewUI*0), 0, 0 }, -{ str8_lit_comp("Scheduler"), (RD_ViewRuleSpecInfoFlag_VizRowProd*0)|(RD_ViewRuleSpecInfoFlag_LineStringize*0)|(RD_ViewRuleSpecInfoFlag_RowUI*0)|(RD_ViewRuleSpecInfoFlag_ViewUI*0), 0, 0 }, -{ str8_lit_comp("CallStack"), (RD_ViewRuleSpecInfoFlag_VizRowProd*0)|(RD_ViewRuleSpecInfoFlag_LineStringize*0)|(RD_ViewRuleSpecInfoFlag_RowUI*0)|(RD_ViewRuleSpecInfoFlag_ViewUI*0), 0, 0 }, -{ str8_lit_comp("Modules"), (RD_ViewRuleSpecInfoFlag_VizRowProd*0)|(RD_ViewRuleSpecInfoFlag_LineStringize*0)|(RD_ViewRuleSpecInfoFlag_RowUI*0)|(RD_ViewRuleSpecInfoFlag_ViewUI*0), 0, 0 }, -{ str8_lit_comp("Text"), (RD_ViewRuleSpecInfoFlag_VizRowProd*0)|(RD_ViewRuleSpecInfoFlag_LineStringize*0)|(RD_ViewRuleSpecInfoFlag_RowUI*0)|(RD_ViewRuleSpecInfoFlag_ViewUI*0), 0, 0 }, -{ str8_lit_comp("Disasm"), (RD_ViewRuleSpecInfoFlag_VizRowProd*0)|(RD_ViewRuleSpecInfoFlag_LineStringize*0)|(RD_ViewRuleSpecInfoFlag_RowUI*0)|(RD_ViewRuleSpecInfoFlag_ViewUI*0), 0, 0 }, -{ str8_lit_comp("Output"), (RD_ViewRuleSpecInfoFlag_VizRowProd*0)|(RD_ViewRuleSpecInfoFlag_LineStringize*0)|(RD_ViewRuleSpecInfoFlag_RowUI*0)|(RD_ViewRuleSpecInfoFlag_ViewUI*0), 0, 0 }, -{ str8_lit_comp("Memory"), (RD_ViewRuleSpecInfoFlag_VizRowProd*0)|(RD_ViewRuleSpecInfoFlag_LineStringize*0)|(RD_ViewRuleSpecInfoFlag_RowUI*0)|(RD_ViewRuleSpecInfoFlag_ViewUI*0), 0, 0 }, -{ str8_lit_comp("Bitmap"), (RD_ViewRuleSpecInfoFlag_VizRowProd*0)|(RD_ViewRuleSpecInfoFlag_LineStringize*0)|(RD_ViewRuleSpecInfoFlag_RowUI*0)|(RD_ViewRuleSpecInfoFlag_ViewUI*0), 0, 0 }, -{ str8_lit_comp("ColorRGBA"), (RD_ViewRuleSpecInfoFlag_VizRowProd*0)|(RD_ViewRuleSpecInfoFlag_LineStringize*0)|(RD_ViewRuleSpecInfoFlag_RowUI*0)|(RD_ViewRuleSpecInfoFlag_ViewUI*0), 0, 0 }, -{ str8_lit_comp("Geo3D"), (RD_ViewRuleSpecInfoFlag_VizRowProd*0)|(RD_ViewRuleSpecInfoFlag_LineStringize*0)|(RD_ViewRuleSpecInfoFlag_RowUI*0)|(RD_ViewRuleSpecInfoFlag_ViewUI*0), 0, 0 }, -}; - String8 rd_theme_preset_display_string_table[9] = { str8_lit_comp("Default (Dark)"), diff --git a/src/raddbg/generated/raddbg.meta.h b/src/raddbg/generated/raddbg.meta.h index ea9af6aa..70005de9 100644 --- a/src/raddbg/generated/raddbg.meta.h +++ b/src/raddbg/generated/raddbg.meta.h @@ -416,50 +416,12 @@ RD_ViewRuleKind_Disasm, RD_ViewRuleKind_Output, RD_ViewRuleKind_Memory, RD_ViewRuleKind_Bitmap, +RD_ViewRuleKind_Checkbox, RD_ViewRuleKind_ColorRGBA, RD_ViewRuleKind_Geo3D, RD_ViewRuleKind_COUNT, } RD_ViewRuleKind; -typedef enum RD_ViewKind -{ -RD_ViewKind_Null, -RD_ViewKind_Empty, -RD_ViewKind_GettingStarted, -RD_ViewKind_Commands, -RD_ViewKind_FileSystem, -RD_ViewKind_SystemProcesses, -RD_ViewKind_EntityLister, -RD_ViewKind_SymbolLister, -RD_ViewKind_Target, -RD_ViewKind_Targets, -RD_ViewKind_FilePathMap, -RD_ViewKind_AutoViewRules, -RD_ViewKind_Breakpoints, -RD_ViewKind_WatchPins, -RD_ViewKind_Scheduler, -RD_ViewKind_CallStack, -RD_ViewKind_Modules, -RD_ViewKind_Watch, -RD_ViewKind_Locals, -RD_ViewKind_Registers, -RD_ViewKind_Globals, -RD_ViewKind_ThreadLocals, -RD_ViewKind_Types, -RD_ViewKind_Procedures, -RD_ViewKind_PendingFile, -RD_ViewKind_Text, -RD_ViewKind_Disasm, -RD_ViewKind_Output, -RD_ViewKind_Memory, -RD_ViewKind_Bitmap, -RD_ViewKind_ColorRGBA, -RD_ViewKind_Geo3D, -RD_ViewKind_ExceptionFilters, -RD_ViewKind_Settings, -RD_ViewKind_COUNT, -} RD_ViewKind; - typedef enum RD_ThemeColor { RD_ThemeColor_Null, @@ -644,6 +606,7 @@ String8 display_name; String8 params_schema; RD_IconKind icon_kind; RD_ViewRuleInfoFlags flags; +EV_ViewRuleBlockProdHookFunctionType *block_prod; RD_ViewRuleUIFunctionType *ui; }; @@ -680,41 +643,47 @@ RD_ViewRuleUIFunctionType *ui; .params_tree = rd_regs()->params_tree,\ .os_event = rd_regs()->os_event,\ -RD_VIEW_UI_FUNCTION_DEF(null); -RD_VIEW_UI_FUNCTION_DEF(empty); -RD_VIEW_UI_FUNCTION_DEF(getting_started); -RD_VIEW_UI_FUNCTION_DEF(commands); -RD_VIEW_UI_FUNCTION_DEF(file_system); -RD_VIEW_UI_FUNCTION_DEF(system_processes); -RD_VIEW_UI_FUNCTION_DEF(entity_lister); -RD_VIEW_UI_FUNCTION_DEF(symbol_lister); -RD_VIEW_UI_FUNCTION_DEF(target); -RD_VIEW_UI_FUNCTION_DEF(targets); -RD_VIEW_UI_FUNCTION_DEF(file_path_map); -RD_VIEW_UI_FUNCTION_DEF(auto_view_rules); -RD_VIEW_UI_FUNCTION_DEF(breakpoints); -RD_VIEW_UI_FUNCTION_DEF(watch_pins); -RD_VIEW_UI_FUNCTION_DEF(scheduler); -RD_VIEW_UI_FUNCTION_DEF(call_stack); -RD_VIEW_UI_FUNCTION_DEF(modules); -RD_VIEW_UI_FUNCTION_DEF(watch); -RD_VIEW_UI_FUNCTION_DEF(locals); -RD_VIEW_UI_FUNCTION_DEF(registers); -RD_VIEW_UI_FUNCTION_DEF(globals); -RD_VIEW_UI_FUNCTION_DEF(thread_locals); -RD_VIEW_UI_FUNCTION_DEF(types); -RD_VIEW_UI_FUNCTION_DEF(procedures); -RD_VIEW_UI_FUNCTION_DEF(pending_file); -RD_VIEW_UI_FUNCTION_DEF(text); -RD_VIEW_UI_FUNCTION_DEF(disasm); -RD_VIEW_UI_FUNCTION_DEF(output); -RD_VIEW_UI_FUNCTION_DEF(memory); -RD_VIEW_UI_FUNCTION_DEF(bitmap); -RD_VIEW_UI_FUNCTION_DEF(color_rgba); -RD_VIEW_UI_FUNCTION_DEF(geo3d); -RD_VIEW_UI_FUNCTION_DEF(exception_filters); -RD_VIEW_UI_FUNCTION_DEF(settings); - +RD_VIEW_RULE_UI_FUNCTION_DEF(null); +EV_VIEW_RULE_BLOCK_PROD_FUNCTION_DEF(text); +EV_VIEW_RULE_BLOCK_PROD_FUNCTION_DEF(disasm); +EV_VIEW_RULE_BLOCK_PROD_FUNCTION_DEF(memory); +EV_VIEW_RULE_BLOCK_PROD_FUNCTION_DEF(bitmap); +EV_VIEW_RULE_BLOCK_PROD_FUNCTION_DEF(checkbox); +EV_VIEW_RULE_BLOCK_PROD_FUNCTION_DEF(color_rgba); +EV_VIEW_RULE_BLOCK_PROD_FUNCTION_DEF(geo3d); +RD_VIEW_RULE_UI_FUNCTION_DEF(empty); +RD_VIEW_RULE_UI_FUNCTION_DEF(getting_started); +RD_VIEW_RULE_UI_FUNCTION_DEF(exception_filters); +RD_VIEW_RULE_UI_FUNCTION_DEF(settings); +RD_VIEW_RULE_UI_FUNCTION_DEF(pending_file); +RD_VIEW_RULE_UI_FUNCTION_DEF(commands); +RD_VIEW_RULE_UI_FUNCTION_DEF(file_system); +RD_VIEW_RULE_UI_FUNCTION_DEF(system_processes); +RD_VIEW_RULE_UI_FUNCTION_DEF(entity_lister); +RD_VIEW_RULE_UI_FUNCTION_DEF(symbol_lister); +RD_VIEW_RULE_UI_FUNCTION_DEF(watch); +RD_VIEW_RULE_UI_FUNCTION_DEF(locals); +RD_VIEW_RULE_UI_FUNCTION_DEF(registers); +RD_VIEW_RULE_UI_FUNCTION_DEF(globals); +RD_VIEW_RULE_UI_FUNCTION_DEF(thread_locals); +RD_VIEW_RULE_UI_FUNCTION_DEF(types); +RD_VIEW_RULE_UI_FUNCTION_DEF(procedures); +RD_VIEW_RULE_UI_FUNCTION_DEF(targets); +RD_VIEW_RULE_UI_FUNCTION_DEF(file_path_map); +RD_VIEW_RULE_UI_FUNCTION_DEF(auto_view_rules); +RD_VIEW_RULE_UI_FUNCTION_DEF(breakpoints); +RD_VIEW_RULE_UI_FUNCTION_DEF(watch_pins); +RD_VIEW_RULE_UI_FUNCTION_DEF(scheduler); +RD_VIEW_RULE_UI_FUNCTION_DEF(call_stack); +RD_VIEW_RULE_UI_FUNCTION_DEF(modules); +RD_VIEW_RULE_UI_FUNCTION_DEF(text); +RD_VIEW_RULE_UI_FUNCTION_DEF(disasm); +RD_VIEW_RULE_UI_FUNCTION_DEF(output); +RD_VIEW_RULE_UI_FUNCTION_DEF(memory); +RD_VIEW_RULE_UI_FUNCTION_DEF(bitmap); +RD_VIEW_RULE_UI_FUNCTION_DEF(checkbox); +RD_VIEW_RULE_UI_FUNCTION_DEF(color_rgba); +RD_VIEW_RULE_UI_FUNCTION_DEF(geo3d); C_LINKAGE_BEGIN extern String8 rd_cfg_src_string_table[4]; extern RD_CmdKind rd_cfg_src_load_cmd_kind_table[4]; @@ -730,8 +699,7 @@ extern RD_StringBindingPair rd_default_binding_table[110]; extern String8 rd_binding_version_remap_old_name_table[7]; extern String8 rd_binding_version_remap_new_name_table[7]; extern String8 rd_icon_kind_text_table[69]; -extern String8 rd_view_kind_name_lower_table[34]; -extern RD_ViewSpecInfo rd_gfx_view_kind_spec_info_table[34]; +extern RD_ViewRuleInfo rd_view_rule_kind_info_table[34]; extern RD_IconKind rd_entity_kind_icon_kind_table[30]; extern String8 rd_theme_preset_display_string_table[9]; extern String8 rd_theme_preset_code_string_table[9]; diff --git a/src/raddbg/raddbg.mdesk b/src/raddbg/raddbg.mdesk index 815b95fe..f49bd4a7 100644 --- a/src/raddbg/raddbg.mdesk +++ b/src/raddbg/raddbg.mdesk @@ -703,7 +703,7 @@ RD_DefaultBindingTable: @data(RD_StringBindingPair) rd_default_binding_table: { - @expand(RD_DefaultBindingTable a) ```{str8_lit_comp("$(a.name)"), {OS_Key_$(a.key), 0 $(a.ctrl != 0 -> `|OS_EventFlag_Ctrl`) $(a.shift != 0 -> `|OS_EventFlag_Shift`) $(a.alt != 0 -> `|OS_EventFlag_Alt`)}}```; + @expand(RD_DefaultBindingTable a) ```{str8_lit_comp("$(a.name)"), {OS_Key_$(a.key), 0 $(a.ctrl != 0 -> `|OS_Modifier_Ctrl`) $(a.shift != 0 -> `|OS_Modifier_Shift`) $(a.alt != 0 -> `|OS_Modifier_Alt`)}}```; } //////////////////////////////// @@ -820,58 +820,59 @@ RD_IconTable: } //////////////////////////////// -//~ rjf: Built-In View Rules +//~ rjf: View Rules -@table(name name_lower display_name params_schema icon can_filter filter_is_code typing_automatically_filters show_in_docs description) +@table(name name_lower display_name params_schema icon can_filter filter_is_code typing_automatically_filters can_use_in_watch_table can_fill_value_cell can_expand show_in_docs description) RD_ViewRuleTable: { //- rjf: basics - { Empty empty "" "" Null 0 0 0 0 "" } - { GettingStarted getting_started "Getting Started" "" QuestionMark 0 0 0 0 "" } + { Empty empty "" "" Null 0 0 0 0 0 0 0 "" } + { GettingStarted getting_started "Getting Started" "" QuestionMark 0 0 0 0 0 0 0 "" } //- rjf: meta (settings) - { ExceptionFilters exception_filters "Exception Filters" "" Gear 0 0 0 1 "An interface which controls whether or not the debugger will halt attached processes upon encountering specific exception codes for the first time." } - { Settings settings "Settings" "" Gear 0 0 0 1 "An interface to modify general settings for the debugger's appearance and behavior." } + { ExceptionFilters exception_filters "Exception Filters" "" Gear 0 0 0 0 0 0 1 "An interface which controls whether or not the debugger will halt attached processes upon encountering specific exception codes for the first time." } + { Settings settings "Settings" "" Gear 0 0 0 0 0 0 1 "An interface to modify general settings for the debugger's appearance and behavior." } //- rjf: temporary view for loading files - must analyze file before picking viewer - { PendingFile pending_file "Pending File" "" FileOutline 0 0 0 0 "" } + { PendingFile pending_file "Pending File" "" FileOutline 0 0 0 0 0 0 0 "" } //- rjf: query listers - { Commands commands "Commands" "" List 0 0 0 0 "" } - { FileSystem file_system "File System" "" FileOutline 0 0 0 0 "" } - { SystemProcesses system_processes "System Processes" "" Null 0 0 0 0 "" } - { EntityLister entity_lister "Entity List" "" Null 0 0 0 0 "" } - { SymbolLister symbol_lister "Symbols" "" Null 0 0 0 0 "" } + { Commands commands "Commands" "" List 0 0 0 0 0 0 0 "" } + { FileSystem file_system "File System" "" FileOutline 0 0 0 0 0 0 0 "" } + { SystemProcesses system_processes "System Processes" "" Null 0 0 0 0 0 0 0 "" } + { EntityLister entity_lister "Entity List" "" Null 0 0 0 0 0 0 0 "" } + { SymbolLister symbol_lister "Symbols" "" Null 0 0 0 0 0 0 0 "" } //- rjf: watch or watch-style tables - { Watch watch "Watch" "" Binoculars 1 1 1 1 "The familiar 'watch window' debugger interface. Allows the inputting of a number of expressions. Each expression in the table is evaluated within the context of the selected thread's selected call stack frame. If applicable (depending on visualization rules and the expression's type), these expressions may be hierarchically expanded, which displays children as more rows in the table. The values of these expressions may also be edited, and if possible, can be used to write to registers or memory in attached processes. Also contains a new *view rule* column, not found in other major debuggers, which allows per-row specification of various visualization rules. These view rules may be used to visualize and inspect the evaluation of expressions in a variety of ways. To learn more, read the 'View Rules' section." } - { Locals locals "Locals" "" Binoculars 1 1 1 1 "Nearly identical to `Watch`, but automatically filled with local variables found within the selected call stack frame of the selected thread, according to the associated debug info. View rules and evaluation values can be edited, like in `Watch`, but unlike `Watch`, expressions cannot be edited or added to the table." } - { Registers registers "Registers" "" Binoculars 1 1 1 1 "Nearly identical to `Watch`, but automatically filled with all register names according to the selected thread's architecture. View rules and evaluation values can be edited, like in `Watch`, but unlike `Watch`, expressions cannot be edited or added to the table." } - { Globals globals "Globals" "" Binoculars 1 1 1 1 "Nearly identical to `Watch`, but automatically filled with all global variables within the selected thread's module. View rules and evaluation values can be edited, like in `Watch`, but unlike `Watch`, expressions cannot be edited or added to the table." } - { ThreadLocals thread_locals "Thread Locals" "" Binoculars 1 1 1 1 "Nearly identical to `Watch`, but automatically filled with all thread local variables within the selected thread's module. View rules and evaluation values can be edited, like in `Watch`, but unlike `Watch`, expressions cannot be edited or added to the table." } - { Types types "Types" "" Binoculars 1 1 1 1 "Nearly identical to `Watch`, but automatically filled with all types within the selected thread's module. View rules can be edited, like in `Watch`, but unlike `Watch`, expressions cannot be edited or added to the table." } - { Procedures procedures "Procedures" "" Binoculars 1 1 1 1 "Nearly identical to `Watch`, but automatically filled with all procedures within the selected thread's module. View rules can be edited, like in `Watch`, but unlike `Watch`, expressions cannot be edited or added to the table." } + { Watch watch "Watch" "" Binoculars 1 1 1 0 0 0 1 "The familiar 'watch window' debugger interface. Allows the inputting of a number of expressions. Each expression in the table is evaluated within the context of the selected thread's selected call stack frame. If applicable (depending on visualization rules and the expression's type), these expressions may be hierarchically expanded, which displays children as more rows in the table. The values of these expressions may also be edited, and if possible, can be used to write to registers or memory in attached processes. Also contains a new *view rule* column, not found in other major debuggers, which allows per-row specification of various visualization rules. These view rules may be used to visualize and inspect the evaluation of expressions in a variety of ways. To learn more, read the 'View Rules' section." } + { Locals locals "Locals" "" Binoculars 1 1 1 0 0 0 1 "Nearly identical to `Watch`, but automatically filled with local variables found within the selected call stack frame of the selected thread, according to the associated debug info. View rules and evaluation values can be edited, like in `Watch`, but unlike `Watch`, expressions cannot be edited or added to the table." } + { Registers registers "Registers" "" Binoculars 1 1 1 0 0 0 1 "Nearly identical to `Watch`, but automatically filled with all register names according to the selected thread's architecture. View rules and evaluation values can be edited, like in `Watch`, but unlike `Watch`, expressions cannot be edited or added to the table." } + { Globals globals "Globals" "" Binoculars 1 1 1 0 0 0 1 "Nearly identical to `Watch`, but automatically filled with all global variables within the selected thread's module. View rules and evaluation values can be edited, like in `Watch`, but unlike `Watch`, expressions cannot be edited or added to the table." } + { ThreadLocals thread_locals "Thread Locals" "" Binoculars 1 1 1 0 0 0 1 "Nearly identical to `Watch`, but automatically filled with all thread local variables within the selected thread's module. View rules and evaluation values can be edited, like in `Watch`, but unlike `Watch`, expressions cannot be edited or added to the table." } + { Types types "Types" "" Binoculars 1 1 1 0 0 0 1 "Nearly identical to `Watch`, but automatically filled with all types within the selected thread's module. View rules can be edited, like in `Watch`, but unlike `Watch`, expressions cannot be edited or added to the table." } + { Procedures procedures "Procedures" "" Binoculars 1 1 1 0 0 0 1 "Nearly identical to `Watch`, but automatically filled with all procedures within the selected thread's module. View rules can be edited, like in `Watch`, but unlike `Watch`, expressions cannot be edited or added to the table." } //- rjf: configuration watch tables - { Targets targets "Targets" "" Target 1 1 1 1 "Displays a list of all targets, as well as controls for enabling, disabling, launching, editing, or deleting each target. For more information on targets, read the `Targets` section." } - { FilePathMap file_path_map "File Path Map" "" FileOutline 1 1 1 1 "Displays a table of *path maps*. Each path map is a pair of file or folder paths, one being a 'source' path, and one being a 'destination' path. These pairs are used by the debugger when automatically searching for specific files - for instance, when attempting to snap to a source code location specified by debug info. If debug info refers to a path on the machine on which a target executable was originally built, but that path is not valid on the debugger machine, but some alternative path exists, then path maps may be used to redirect the debugger from the debug info's specified paths to the associated appropriate debugger machine file paths." } - { AutoViewRules auto_view_rules "Auto View Rules" "" Binoculars 1 1 1 1 "Displays a table of *auto view rules*. Each *auto view rule* is a pair, with one element being a type, and the other being a view rule, which should be automatically applied to expressions of that type, when possible." } - { Breakpoints breakpoints "Breakpoints" "" CircleFilled 1 1 1 1 "Displays a table of all breakpoints, containing information about each breakpoint's name, location, and hit count. Also contains per-breakpoint controls for enabling, deleting, or editing each breakpoint. For more information on breakpoints and their features, read the 'Breakpoints' section." } - { WatchPins watch_pins "Watch Pins" "" Pin 1 1 1 1 "Displays a table of all watch pins (watched expressions, like those found in `Watch`, but instead of being within a table, being pinned to some source code location, like breakpoints). This table contains each pin's name, location, and controls for editing or deleting each pin." } + { Targets targets "Targets" "" Target 1 1 1 0 0 0 1 "Displays a list of all targets, as well as controls for enabling, disabling, launching, editing, or deleting each target. For more information on targets, read the `Targets` section." } + { FilePathMap file_path_map "File Path Map" "" FileOutline 1 1 1 0 0 0 1 "Displays a table of *path maps*. Each path map is a pair of file or folder paths, one being a 'source' path, and one being a 'destination' path. These pairs are used by the debugger when automatically searching for specific files - for instance, when attempting to snap to a source code location specified by debug info. If debug info refers to a path on the machine on which a target executable was originally built, but that path is not valid on the debugger machine, but some alternative path exists, then path maps may be used to redirect the debugger from the debug info's specified paths to the associated appropriate debugger machine file paths." } + { AutoViewRules auto_view_rules "Auto View Rules" "" Binoculars 1 1 1 0 0 0 1 "Displays a table of *auto view rules*. Each *auto view rule* is a pair, with one element being a type, and the other being a view rule, which should be automatically applied to expressions of that type, when possible." } + { Breakpoints breakpoints "Breakpoints" "" CircleFilled 1 1 1 0 0 0 1 "Displays a table of all breakpoints, containing information about each breakpoint's name, location, and hit count. Also contains per-breakpoint controls for enabling, deleting, or editing each breakpoint. For more information on breakpoints and their features, read the 'Breakpoints' section." } + { WatchPins watch_pins "Watch Pins" "" Pin 1 1 1 0 0 0 1 "Displays a table of all watch pins (watched expressions, like those found in `Watch`, but instead of being within a table, being pinned to some source code location, like breakpoints). This table contains each pin's name, location, and controls for editing or deleting each pin." } //- rjf: debug entity info watch tables - { Scheduler scheduler "Scheduler" "" Scheduler 1 1 1 1 "Displays all processes and threads to which the debugger is currently attached, and contains controls for selecting and freezing threads." } - { CallStack call_stack "Call Stack" "" Thread 1 1 1 1 "Displays the call stack of the currently selected thread. Each frame in the call stack contains the associated module, function name, and return address. Allows selection of a particular call stack frame other than the top." } - { Modules modules "Modules" "" Module 1 1 1 1 "Displays a table of all modules currently loaded by any process to which the debugger is attached. This table displays each module's name, virtual address range in the containing process' address space, and which debug info file is being used by the debugger for the associated module." } + { Scheduler scheduler "Scheduler" "" Scheduler 1 1 1 0 0 0 1 "Displays all processes and threads to which the debugger is currently attached, and contains controls for selecting and freezing threads." } + { CallStack call_stack "Call Stack" "" Thread 1 1 1 0 0 0 1 "Displays the call stack of the currently selected thread. Each frame in the call stack contains the associated module, function name, and return address. Allows selection of a particular call stack frame other than the top." } + { Modules modules "Modules" "" Module 1 1 1 0 0 0 1 "Displays a table of all modules currently loaded by any process to which the debugger is attached. This table displays each module's name, virtual address range in the containing process' address space, and which debug info file is being used by the debugger for the associated module." } //- rjf: visualizers - { Text text "Text" "x:{'lang':lang, 'size':expr}" FileOutline 0 0 0 0 "" } - { Disasm disasm "Disassembly" "x:{'arch':arch, 'size':expr}" Glasses 0 0 0 1 "Displays disassembled instructions in a textual form from the selected thread's containing process virtual address space." } - { Output output "Output" "" List 0 0 0 1 "Displays debug strings, output from attached processes." } - { Memory memory "Memory" "x:{'size':expr}" Grid 0 0 0 1 "A hex-editor-like grid interface for viewing memory." } - { Bitmap bitmap "Bitmap" "x:{'w':expr, 'h':expr, 'fmt':tex2dformat}" Binoculars 0 0 0 1 "Visualizes memory as a bitmap." } - { ColorRGBA color_rgba "Color (RGBA)" "" Palette 0 0 0 1 "Visualizes memory as an RGBA color." } - { Geo3D geo3d "Geometry (3D)" "x:{'count':expr, 'vtx':expr, 'vtx_size':expr}" Binoculars 0 0 0 1 "Visualizes memory as 3D geometry." } + { Text text "Text" "x:{'lang':lang, 'size':expr}" FileOutline 0 0 0 1 0 1 0 "" } + { Disasm disasm "Disassembly" "x:{'arch':arch, 'size':expr}" Glasses 0 0 0 1 0 1 1 "Displays disassembled instructions in a textual form from the selected thread's containing process virtual address space." } + { Output output "Output" "" List 0 0 0 0 0 0 1 "Displays debug strings, output from attached processes." } + { Memory memory "Memory" "x:{'size':expr}" Grid 0 0 0 1 0 1 1 "A hex-editor-like grid interface for viewing memory." } + { Bitmap bitmap "Bitmap" "x:{'w':expr, 'h':expr, 'fmt':tex2dformat}" Binoculars 0 0 0 1 0 1 1 "Visualizes memory as a bitmap." } + { Checkbox checkbox "Checkbox" "" CheckFilled 0 0 0 1 1 0 1 "Visualizes memory as an RGBA color." } + { ColorRGBA color_rgba "Color (RGBA)" "" Palette 0 0 0 1 1 1 1 "Visualizes memory as an RGBA color." } + { Geo3D geo3d "Geometry (3D)" "x:{'count':expr, 'vtx':expr, 'vtx_size':expr}" Binoculars 0 0 0 1 0 1 1 "Visualizes memory as 3D geometry." } } @enum RD_ViewRuleKind: @@ -889,98 +890,21 @@ RD_ViewRuleTable: `String8 params_schema`; `RD_IconKind icon_kind`; `RD_ViewRuleInfoFlags flags`; + `EV_ViewRuleBlockProdHookFunctionType *block_prod`; `RD_ViewRuleUIFunctionType *ui`; -}; +} -/* @gen { - @expand(RD_ViewRuleTable a) `RD_VIEW_RULE_UI_FUNCTION_DEF($(a.name_lower));` + `RD_VIEW_RULE_UI_FUNCTION_DEF(null);`, + @expand(RD_ViewRuleTable a) `$(a.can_use_in_watch_table != 0 -> "EV_VIEW_RULE_BLOCK_PROD_FUNCTION_DEF(" .. a.name_lower .. ");")`, + @expand(RD_ViewRuleTable a) `RD_VIEW_RULE_UI_FUNCTION_DEF($(a.name_lower));`, } @data(RD_ViewRuleInfo) rd_view_rule_kind_info_table: { - `{0}`, - @expand(RD_ViewRuleTable a) `{str8_lit_comp("$(a.name_lower)"), str8_lit_comp("$(a.description)"), str8_lit_comp("$(a.display_name)"), str8_lit_comp("$(a.params_schema)"), RD_IconKind_$(a.icon), (RD_ViewRuleInfoFlag_ShowInDocs*$(a.show_in_docs)|RD_ViewRuleInfoFlag_CanFilter*$(a.can_filter)|RD_ViewRuleInfoFlag_FilterIsCode*$(a.filter_is_code)|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*$(a.typing_automatically_filters)), RD_VIEW_RULE_UI_FUNCTION_NAME($(a.name_lower))}`, -} -*/ - -//////////////////////////////// -//~ rjf: Gfx Layer View Kinds - -@table(name name_lower display_string icon parameterized_by_entity project_specific can_serialize can_filter filter_is_code typing_automatically_filters inc_in_docs docs_desc) -RD_ViewTable: -{ - //- rjf: basics - { Null "null" "" Null 0 0 0 0 0 0 0 "" } - { Empty "empty" "" Null 0 0 0 0 0 0 0 "" } - { GettingStarted "getting_started" "Getting Started" QuestionMark 0 0 1 0 0 0 0 "" } - - //- rjf: listers - { Commands "commands" "Commands" List 0 0 0 0 0 0 0 "" } - { FileSystem "file_system" "File System" FileOutline 0 0 0 0 0 0 0 "" } - { SystemProcesses "system_processes" "System Processes" Null 0 0 0 0 0 0 0 "" } - { EntityLister "entity_lister" "Entity List" Null 0 0 0 0 0 0 0 "" } - { SymbolLister "symbol_lister" "Symbols" Null 0 0 0 0 0 0 0 "" } - - //- rjf: entity editors - { Target "target" "Target" Target 1 0 0 0 0 0 0 "" } - { Targets "targets" "Targets" Target 0 0 1 1 0 1 1 "Displays a list of all targets, as well as controls for enabling, disabling, launching, editing, or deleting each target. For more information on targets, read the `Targets` section." } - { FilePathMap "file_path_map" "File Path Map" FileOutline 0 0 1 0 0 0 1 "Displays a table of *path maps*. Each path map is a pair of file or folder paths, one being a 'source' path, and one being a 'destination' path. These pairs are used by the debugger when automatically searching for specific files - for instance, when attempting to snap to a source code location specified by debug info. If debug info refers to a path on the machine on which a target executable was originally built, but that path is not valid on the debugger machine, but some alternative path exists, then path maps may be used to redirect the debugger from the debug info's specified paths to the associated appropriate debugger machine file paths." } - { AutoViewRules "auto_view_rules" "Auto View Rules" Binoculars 0 0 1 0 0 0 1 "Displays a table of *auto view rules*. Each *auto view rule* is a pair, with one element being a type, and the other being a view rule, which should be automatically applied to expressions of that type, when possible." } - { Breakpoints "breakpoints" "Breakpoints" CircleFilled 0 0 1 1 0 1 1 "Displays a table of all breakpoints, containing information about each breakpoint's name, location, and hit count. Also contains per-breakpoint controls for enabling, deleting, or editing each breakpoint. For more information on breakpoints and their features, read the 'Breakpoints' section." } - { WatchPins "watch_pins" "Watch Pins" Pin 0 0 1 1 1 1 1 "Displays a table of all watch pins (watched expressions, like those found in `Watch`, but instead of being within a table, being pinned to some source code location, like breakpoints). This table contains each pin's name, location, and controls for editing or deleting each pin." } - - //- rjf: debug entity viewers - { Scheduler "scheduler" "Scheduler" Scheduler 0 0 1 1 1 1 1 "Displays all processes and threads to which the debugger is currently attached, and contains controls for selecting and freezing threads." } - { CallStack "call_stack" "Call Stack" Thread 0 0 1 0 0 0 1 "Displays the call stack of the currently selected thread. Each frame in the call stack contains the associated module, function name, and return address. Allows selection of a particular call stack frame other than the top." } - { Modules "modules" "Modules" Module 0 0 1 1 0 1 1 "Displays a table of all modules currently loaded by any process to which the debugger is attached. This table displays each module's name, virtual address range in the containing process' address space, and which debug info file is being used by the debugger for the associated module." } - - //- rjf: watch-style views - { Watch "watch" "Watch" Binoculars 0 0 1 1 1 1 1 "The familiar 'watch window' debugger interface. Allows the inputting of a number of expressions. Each expression in the table is evaluated within the context of the selected thread's selected call stack frame. If applicable (depending on visualization rules and the expression's type), these expressions may be hierarchically expanded, which displays children as more rows in the table. The values of these expressions may also be edited, and if possible, can be used to write to registers or memory in attached processes. Also contains a new *view rule* column, not found in other major debuggers, which allows per-row specification of various visualization rules. These view rules may be used to visualize and inspect the evaluation of expressions in a variety of ways. To learn more, read the 'View Rules' section." } - { Locals "locals" "Locals" Binoculars 0 0 1 1 1 1 1 "Nearly identical to `Watch`, but automatically filled with local variables found within the selected call stack frame of the selected thread, according to the associated debug info. View rules and evaluation values can be edited, like in `Watch`, but unlike `Watch`, expressions cannot be edited or added to the table." } - { Registers "registers" "Registers" Binoculars 0 0 1 1 1 1 1 "Nearly identical to `Watch`, but automatically filled with all register names according to the selected thread's architecture. View rules and evaluation values can be edited, like in `Watch`, but unlike `Watch`, expressions cannot be edited or added to the table." } - { Globals "globals" "Globals" Binoculars 0 0 1 1 1 1 1 "Nearly identical to `Watch`, but automatically filled with all global variables within the selected thread's module. View rules and evaluation values can be edited, like in `Watch`, but unlike `Watch`, expressions cannot be edited or added to the table." } - { ThreadLocals "thread_locals" "Thread Locals" Binoculars 0 0 1 1 1 1 1 "Nearly identical to `Watch`, but automatically filled with all thread local variables within the selected thread's module. View rules and evaluation values can be edited, like in `Watch`, but unlike `Watch`, expressions cannot be edited or added to the table." } - { Types "types" "Types" Binoculars 0 0 1 1 1 1 1 "Nearly identical to `Watch`, but automatically filled with all types within the selected thread's module. View rules can be edited, like in `Watch`, but unlike `Watch`, expressions cannot be edited or added to the table." } - { Procedures "procedures" "Procedures" Binoculars 0 0 1 1 1 1 1 "Nearly identical to `Watch`, but automatically filled with all procedures within the selected thread's module. View rules can be edited, like in `Watch`, but unlike `Watch`, expressions cannot be edited or added to the table." } - - //- rjf: temporary view for loading files - must analyze file before picking viewer - { PendingFile "pending_file" "Pending File" FileOutline 0 0 0 0 0 0 0 "" } - - //- rjf: visualizers - { Text "text" "Text" FileOutline 0 1 1 0 1 0 0 "" } - { Disasm "disasm" "Disassembly" Glasses 0 0 1 0 1 0 1 "Displays disassembled instructions in a textual form from the selected thread's containing process virtual address space." } - { Output "output" "Output" List 0 0 1 0 0 0 1 "Displays debug strings, output from attached processes." } - { Memory "memory" "Memory" Grid 0 0 1 0 1 0 1 "A hex-editor-like grid interface for viewing memory." } - { Bitmap "bitmap" "Bitmap" Binoculars 0 0 1 0 1 0 1 "Visualizes memory as a bitmap." } - { ColorRGBA "color_rgba" "Color (RGBA)" Palette 0 0 1 0 1 0 1 "Visualizes memory as an RGBA color." } - { Geo3D "geo3d" "Geometry (3D)" Binoculars 0 0 1 0 1 0 1 "Visualizes memory as 3D geometry." } - - //- rjf: meta (settings) - { ExceptionFilters "exception_filters" "Exception Filters" Gear 0 0 1 1 0 1 1 "An interface which controls whether or not the debugger will halt attached processes upon encountering specific exception codes for the first time." } - { Settings "settings" "Settings" Gear 0 0 1 1 0 1 1 "An interface to modify general settings for the debugger's appearance and behavior." } -} - -@enum RD_ViewKind: -{ - @expand(RD_ViewTable a) `$(a.name)`, - COUNT, -} - -@gen -{ - @expand(RD_ViewTable a) `RD_VIEW_UI_FUNCTION_DEF($(a.name_lower));`; -} - -@data(String8) rd_view_kind_name_lower_table: -{ - @expand(RD_ViewTable a) `str8_lit_comp("$(a.name_lower)")` -} - -@data(RD_ViewSpecInfo) rd_gfx_view_kind_spec_info_table: -{ - @expand(RD_ViewTable a) ```{(0|$(a.parameterized_by_entity)*RD_ViewSpecFlag_ParameterizedByEntity|$(a.project_specific)*RD_ViewSpecFlag_ProjectSpecific|$(a.can_serialize)*RD_ViewSpecFlag_CanSerialize|$(a.can_filter)*RD_ViewSpecFlag_CanFilter|$(a.filter_is_code)*RD_ViewSpecFlag_FilterIsCode|$(a.typing_automatically_filters)*RD_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("$(a.name_lower)"), str8_lit_comp("$(a.display_string)"), RD_IconKind_$(a.icon), RD_VIEW_UI_FUNCTION_NAME($(a.name_lower))}```; + `{{0}, {0}, {0}, {0}, RD_IconKind_Null, 0, 0, RD_VIEW_RULE_UI_FUNCTION_NAME(null)}`, + @expand(RD_ViewRuleTable a) `{str8_lit_comp("$(a.name_lower)"), str8_lit_comp("$(a.description)"), str8_lit_comp("$(a.display_name)"), str8_lit_comp("$(a.params_schema)"), RD_IconKind_$(a.icon), (RD_ViewRuleInfoFlag_ShowInDocs*$(a.show_in_docs)|RD_ViewRuleInfoFlag_CanFilter*$(a.can_filter)|RD_ViewRuleInfoFlag_FilterIsCode*$(a.filter_is_code)|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*$(a.typing_automatically_filters)|RD_ViewRuleInfoFlag_CanUseInWatchTable*$(a.can_use_in_watch_table)|RD_ViewRuleInfoFlag_CanFillValueCell*$(a.can_fill_value_cell)|RD_ViewRuleInfoFlag_CanExpand*$(a.can_expand)), $(a.can_expand != 0 -> "EV_VIEW_RULE_BLOCK_PROD_FUNCTION_NAME(" .. a.name_lower .. ")") $(a.can_expand == 0 -> 0), RD_VIEW_RULE_UI_FUNCTION_NAME($(a.name_lower))}`, } //////////////////////////////// @@ -991,47 +915,6 @@ RD_ViewTable: @expand(RD_EntityKindTable a) `RD_IconKind_$(a.icon_kind)`, } -//////////////////////////////// -//~ rjf: Built-In Graphical View Rule Extensions -// -// NOTE(rjf): see @view_rule_info - -@table(string vr ls ru vu) -RD_ViewRuleTable: -{ - {"array" - - - - } - {"list" x - - - } - {"dec" - x - - } - {"bin" - x - - } - {"oct" - x - - } - {"hex" - x - - } - {"only" x x - - } - {"omit" x x - - } - {"no_addr" - x - - } - {"checkbox" - - x - } - {"color_rgba" - - x x } - {"text" - - - x } - {"disasm" - - - x } - {"memory" - - - x } - {"bitmap" - - - x } - {"geo3d" - - - x } -} - -@gen -{ - ``; - @expand(RD_ViewRuleTable a) - `$(a.ls == "x" -> "RD_VIEW_RULE_LINE_STRINGIZE_FUNCTION_DEF(" .. a.name_lower .. ");")`; - @expand(RD_ViewRuleTable a) - `$(a.ru == "x" -> "RD_VIEW_RULE_ROW_UI_FUNCTION_DEF(" .. a.name_lower .. ");")`; -} - -@data(RD_ViewRuleSpecInfo) @c_file rd_gfx_view_rule_spec_info_table: -{ - @expand(RD_ViewRuleTable a) - ```{ str8_lit_comp("$(a.string)"), (RD_ViewRuleSpecInfoFlag_VizRowProd*$(a.vr == "x"))|(RD_ViewRuleSpecInfoFlag_LineStringize*$(a.ls == "x"))|(RD_ViewRuleSpecInfoFlag_RowUI*$(a.ru == "x"))|(RD_ViewRuleSpecInfoFlag_ViewUI*$(a.vu == "x")), $(a.ls == "x" -> "RD_VIEW_RULE_LINE_STRINGIZE_FUNCTION_NAME("..a.name_lower..")") $(a.ls != "x" -> 0), $(a.ru == "x" -> "RD_VIEW_RULE_ROW_UI_FUNCTION_NAME("..a.name_lower..")") $(a.ru != "x" -> 0) }```; -} - //////////////////////////////// //~ rjf: Theme Tables diff --git a/src/raddbg/raddbg_core.c b/src/raddbg/raddbg_core.c index 5f247a6c..fa656469 100644 --- a/src/raddbg/raddbg_core.c +++ b/src/raddbg/raddbg_core.c @@ -657,18 +657,38 @@ rd_view_from_handle(RD_Handle handle) //////////////////////////////// //~ rjf: View Spec Type Functions -internal RD_ViewKind -rd_view_kind_from_string(String8 string) +internal RD_ViewRuleKind +rd_view_rule_kind_from_string(String8 string) { - RD_ViewKind result = RD_ViewKind_Null; - for(U64 idx = 0; idx < ArrayCount(rd_gfx_view_kind_spec_info_table); idx += 1) + RD_ViewRuleKind kind = RD_ViewRuleKind_Null; + for(EachEnumVal(RD_ViewRuleKind, k)) { - if(str8_match(string, rd_gfx_view_kind_spec_info_table[idx].name, StringMatchFlag_CaseInsensitive)) + if(str8_match(string, rd_view_rule_kind_info_table[k].string, 0)) { - result = (RD_ViewKind)idx; + kind = k; break; } } + return kind; +} + +internal RD_ViewRuleInfo * +rd_view_rule_info_from_kind(RD_ViewRuleKind kind) +{ + return &rd_view_rule_kind_info_table[kind]; +} + +internal RD_ViewRuleInfo * +rd_view_rule_info_from_string(String8 string) +{ + RD_ViewRuleInfo *result = &rd_nil_view_rule_info; + { + RD_ViewRuleKind kind = rd_view_rule_kind_from_string(string); + if(kind != RD_ViewRuleKind_Null) + { + result = &rd_view_rule_kind_info_table[kind]; + } + } return result; } @@ -896,7 +916,7 @@ rd_selected_tab_from_panel(RD_Panel *panel) internal RD_IconKind rd_icon_kind_from_view(RD_View *view) { - RD_IconKind result = view->spec->info.icon_kind; + RD_IconKind result = view->spec->icon_kind; return result; } @@ -923,7 +943,7 @@ rd_title_fstrs_from_view(Arena *arena, RD_View *view, Vec4F32 primary_color, Vec DR_FancyString fstr1 = { rd_font_from_slot(RD_FontSlot_Main), - view->spec->info.display_string, + view->spec->display_name, primary_color, size, }; @@ -986,13 +1006,13 @@ rd_prefer_dasm_from_window(RD_Window *window) { RD_Panel *panel = window->focused_panel; RD_View *view = rd_selected_tab_from_panel(panel); - RD_ViewKind view_kind = rd_view_kind_from_string(view->spec->info.name); + RD_ViewRuleKind view_kind = rd_view_rule_kind_from_string(view->spec->string); B32 result = 0; - if(view_kind == RD_ViewKind_Disasm) + if(view_kind == RD_ViewRuleKind_Disasm) { result = 1; } - else if(view_kind == RD_ViewKind_Text) + else if(view_kind == RD_ViewRuleKind_Text) { result = 0; } @@ -1003,12 +1023,12 @@ rd_prefer_dasm_from_window(RD_Window *window) for(RD_Panel *p = window->root_panel; !rd_panel_is_nil(p); p = rd_panel_rec_depth_first_pre(p).next) { RD_View *p_view = rd_selected_tab_from_panel(p); - RD_ViewKind p_view_kind = rd_view_kind_from_string(p_view->spec->info.name); - if(p_view_kind == RD_ViewKind_Text) + RD_ViewRuleKind p_view_kind = rd_view_rule_kind_from_string(p_view->spec->string); + if(p_view_kind == RD_ViewRuleKind_Text) { has_src = 1; } - if(p_view_kind == RD_ViewKind_Disasm) + if(p_view_kind == RD_ViewRuleKind_Disasm) { has_dasm = 1; } @@ -2113,30 +2133,6 @@ rd_tex2dformat_from_eval_params(E_Eval eval, MD_Node *params) return result; } -//- rjf: eval -> entity - -#if 0 // TODO(rjf): @msgs -internal RD_Entity * -rd_entity_from_eval_string(String8 string) -{ - RD_Entity *entity = &d_nil_entity; - { - Temp scratch = scratch_begin(0, 0); - E_Eval eval = e_eval_from_string(scratch.arena, string); - entity = rd_entity_from_eval_space(eval.space); - scratch_end(scratch); - } - return entity; -} - -internal String8 -rd_eval_string_from_entity(Arena *arena, RD_Entity *entity) -{ - String8 eval_string = push_str8f(arena, "macro:`$%I64u`", entity->id); - return eval_string; -} -#endif - //- rjf: eval <-> file path internal String8 @@ -2165,115 +2161,6 @@ rd_eval_string_from_file_path(Arena *arena, String8 string) return result; } -//////////////////////////////// -//~ rjf: View Rule Kind Functions - -internal RD_ViewRuleInfo * -rd_view_rule_info_from_string(String8 string) -{ - RD_ViewRuleInfo *info = &rd_nil_view_rule_info; - { - // TODO(rjf) - } - return info; -} - -//////////////////////////////// -//~ rjf: View Spec State Functions - -internal void -rd_register_view_specs(RD_ViewSpecInfoArray specs) -{ - for(U64 idx = 0; idx < specs.count; idx += 1) - { - RD_ViewSpecInfo *src_info = &specs.v[idx]; - U64 hash = d_hash_from_string(src_info->name); - U64 slot_idx = hash%rd_state->view_spec_table_size; - RD_ViewSpec *spec = push_array(rd_state->arena, RD_ViewSpec, 1); - SLLStackPush_N(rd_state->view_spec_table[slot_idx], spec, hash_next); - MemoryCopyStruct(&spec->info, src_info); - spec->info.name = push_str8_copy(rd_state->arena, spec->info.name); - spec->info.display_string = push_str8_copy(rd_state->arena, spec->info.display_string); - } -} - -internal RD_ViewSpec * -rd_view_spec_from_string(String8 string) -{ - RD_ViewSpec *spec = &rd_nil_view_spec; - U64 hash = d_hash_from_string(string); - U64 slot_idx = hash%rd_state->view_spec_table_size; - for(RD_ViewSpec *s = rd_state->view_spec_table[slot_idx]; - s != 0; - s = s->hash_next) - { - if(str8_match(s->info.name, string, 0)) - { - spec = s; - break; - } - } - return spec; -} - -internal RD_ViewSpec * -rd_view_spec_from_kind(RD_ViewKind kind) -{ - RD_ViewSpec *spec = rd_view_spec_from_string(rd_gfx_view_kind_spec_info_table[kind].name); - return spec; -} - -//////////////////////////////// -//~ rjf: View Rule Spec State Functions - -internal void -rd_register_view_rule_specs(RD_ViewRuleSpecInfoArray specs) -{ - for(U64 idx = 0; idx < specs.count; idx += 1) - { - // rjf: extract info from array slot - RD_ViewRuleSpecInfo *info = &specs.v[idx]; - - // rjf: skip empties - if(info->string.size == 0) - { - continue; - } - - // rjf: determine hash/slot - U64 hash = d_hash_from_string(info->string); - U64 slot_idx = hash%rd_state->view_rule_spec_table_size; - - // rjf: allocate node & push - RD_ViewRuleSpec *spec = push_array(rd_state->arena, RD_ViewRuleSpec, 1); - SLLStackPush_N(rd_state->view_rule_spec_table[slot_idx], spec, hash_next); - - // rjf: fill node - RD_ViewRuleSpecInfo *info_copy = &spec->info; - MemoryCopyStruct(info_copy, info); - info_copy->string = push_str8_copy(rd_state->arena, info->string); - } -} - -internal RD_ViewRuleSpec * -rd_view_rule_spec_from_string(String8 string) -{ - RD_ViewRuleSpec *spec = &rd_nil_view_rule_spec; - { - U64 hash = d_hash_from_string(string); - U64 slot_idx = hash%rd_state->view_rule_spec_table_size; - for(RD_ViewRuleSpec *s = rd_state->view_rule_spec_table[slot_idx]; s != 0; s = s->hash_next) - { - if(str8_match(string, s->info.string, 0)) - { - spec = s; - break; - } - } - } - return spec; -} - //////////////////////////////// //~ rjf: View State Functions @@ -2302,7 +2189,7 @@ rd_view_alloc(void) // rjf: initialize view->arena = arena_alloc(); - view->spec = &rd_nil_view_spec; + view->spec = &rd_nil_view_rule_info; view->project_path_arena = arena_alloc(); view->project_path = str8_zero(); for(U64 idx = 0; idx < ArrayCount(view->params_arenas); idx += 1) @@ -2349,7 +2236,7 @@ rd_view_release(RD_View *view) //- rjf: equipment internal void -rd_view_equip_spec(RD_View *view, RD_ViewSpec *spec, String8 query, MD_Node *params) +rd_view_equip_spec(RD_View *view, RD_ViewRuleInfo *spec, String8 query, MD_Node *params) { // rjf: fill params tree for(U64 idx = 0; idx < ArrayCount(view->params_arenas); idx += 1) @@ -2382,15 +2269,8 @@ rd_view_equip_spec(RD_View *view, RD_ViewSpec *spec, String8 query, MD_Node *par } MemoryZeroStruct(&view->scroll_pos); view->spec = spec; - if(spec->info.flags & RD_ViewSpecFlag_ProjectSpecific) - { - arena_clear(view->project_path_arena); - view->project_path = push_str8_copy(view->project_path_arena, rd_cfg_path_from_src(RD_CfgSrc_Project)); - } - else - { - MemoryZeroStruct(&view->project_path); - } + arena_clear(view->project_path_arena); + view->project_path = push_str8_copy(view->project_path_arena, rd_cfg_path_from_src(RD_CfgSrc_Project)); view->is_filtering = 0; view->is_filtering_t = 0; } @@ -2996,9 +2876,8 @@ rd_window_frame(RD_Window *ws) UI_Box *view_preview_container = ui_build_box_from_stringf(UI_BoxFlag_DrawBorder|UI_BoxFlag_DrawBackground|UI_BoxFlag_Clip, "###view_preview_container"); UI_Parent(view_preview_container) UI_Focus(UI_FocusKind_Off) UI_WidthFill { - RD_ViewSpec *view_spec = view->spec; - RD_ViewUIFunctionType *build_view_ui_function = view_spec->info.ui_hook; - build_view_ui_function(view, view->params_roots[view->params_read_gen%ArrayCount(view->params_roots)], str8(view->query_buffer, view->query_string_size), view_preview_container->rect); + RD_ViewRuleUIFunctionType *view_ui = view->spec->ui; + view_ui(view, str8(view->query_buffer, view->query_string_size), view->params_roots[view->params_read_gen%ArrayCount(view->params_roots)], view_preview_container->rect); } } } @@ -3781,7 +3660,7 @@ rd_window_frame(RD_Window *ws) } // rjf: filter controls - if(view->spec->info.flags & RD_ViewSpecFlag_CanFilter) + if(view->spec->flags & RD_ViewRuleInfoFlag_CanFilter) { if(ui_clicked(rd_cmd_spec_button(rd_cmd_kind_info_table[RD_CmdKind_Filter].display_name))) { @@ -3806,8 +3685,7 @@ rd_window_frame(RD_Window *ws) UI_TextPadding(ui_top_font_size()*1.5f) RD_Font(RD_FontSlot_Code) { Temp scratch = scratch_begin(0, 0); - D_ViewRuleSpec *core_vr_spec = d_view_rule_spec_from_string(view->spec->info.name); - String8 schema_string = core_vr_spec->info.schema; + String8 schema_string = view->spec->params_schema; MD_TokenizeResult schema_tokenize = md_tokenize_from_text(scratch.arena, schema_string); MD_ParseResult schema_parse = md_parse_from_text_tokens(scratch.arena, str8_zero(), schema_string, schema_tokenize.tokens); MD_Node *schema_root = schema_parse.root->first; @@ -4597,7 +4475,7 @@ rd_window_frame(RD_Window *ws) { ui_set_next_fastpath_codepoint(items[idx].codepoint); B32 alt_fastpath_key = 0; - if(ui_key_press(OS_EventFlag_Alt, items[idx].key)) + if(ui_key_press(OS_Modifier_Alt, items[idx].key)) { alt_fastpath_key = 1; } @@ -5154,13 +5032,13 @@ rd_window_frame(RD_Window *ws) switch(missing_slot) { default:{}break; - case RD_RegSlot_Entity:{query_view_name = rd_view_kind_name_lower_table[RD_ViewKind_EntityLister];}break; - case RD_RegSlot_EntityList:{query_view_name = rd_view_kind_name_lower_table[RD_ViewKind_EntityLister];}break; - case RD_RegSlot_FilePath:{query_view_name = rd_view_kind_name_lower_table[RD_ViewKind_FileSystem];}break; - case RD_RegSlot_PID:{query_view_name = rd_view_kind_name_lower_table[RD_ViewKind_SystemProcesses];}break; + case RD_RegSlot_Entity: {query_view_name = rd_view_rule_kind_info_table[RD_ViewRuleKind_EntityLister].string;}break; + case RD_RegSlot_EntityList:{query_view_name = rd_view_rule_kind_info_table[RD_ViewRuleKind_EntityLister].string;}break; + case RD_RegSlot_FilePath: {query_view_name = rd_view_rule_kind_info_table[RD_ViewRuleKind_FileSystem].string;}break; + case RD_RegSlot_PID: {query_view_name = rd_view_rule_kind_info_table[RD_ViewRuleKind_SystemProcesses].string;}break; } } - RD_ViewSpec *view_spec = rd_view_spec_from_string(query_view_name); + RD_ViewRuleInfo *view_spec = rd_view_rule_info_from_string(query_view_name); if(ws->query_view_stack_top->spec != view_spec || rd_view_is_nil(ws->query_view_stack_top)) { @@ -5264,7 +5142,7 @@ rd_window_frame(RD_Window *ws) window_rect.y0 + query_container_margin, window_center.x + query_container_width/2 - (1-ws->query_view_t)*query_container_width/4, window_rect.y1 - query_container_margin); - if(ws->query_view_stack_top->spec == &rd_nil_view_spec) + if(ws->query_view_stack_top->spec == &rd_nil_view_rule_info) { query_container_rect.y1 = query_container_rect.y0 + query_line_edit_height; } @@ -5353,9 +5231,8 @@ rd_window_frame(RD_Window *ws) //- rjf: build query view UI_Parent(query_container_box) UI_WidthFill UI_Focus(UI_FocusKind_Null) { - RD_ViewSpec *view_spec = view->spec; - RD_ViewUIFunctionType *build_view_ui_function = view_spec->info.ui_hook; - build_view_ui_function(view, view->params_roots[view->params_read_gen%ArrayCount(view->params_roots)], str8(view->query_buffer, view->query_string_size), query_container_content_rect); + RD_ViewRuleUIFunctionType *view_ui = view->spec->ui; + view_ui(view, str8(view->query_buffer, view->query_string_size), view->params_roots[view->params_read_gen%ArrayCount(view->params_roots)], query_container_content_rect); } //- rjf: query submission @@ -6314,11 +6191,11 @@ rd_window_frame(RD_Window *ws) ui_label(str8_lit("Filter")); } ui_spacer(ui_em(0.5f, 1.f)); - RD_Font(view->spec->info.flags & RD_ViewSpecFlag_FilterIsCode ? RD_FontSlot_Code : RD_FontSlot_Main) + RD_Font(view->spec->flags & RD_ViewRuleInfoFlag_FilterIsCode ? RD_FontSlot_Code : RD_FontSlot_Main) UI_Focus(view->is_filtering ? UI_FocusKind_On : UI_FocusKind_Off) UI_TextPadding(ui_top_font_size()*0.5f) { - UI_Signal sig = rd_line_edit(RD_LineEditFlag_CodeContents*!!(view->spec->info.flags & RD_ViewSpecFlag_FilterIsCode), + UI_Signal sig = rd_line_edit(RD_LineEditFlag_CodeContents*!!(view->spec->flags & RD_ViewRuleInfoFlag_FilterIsCode), 0, 0, &view->query_cursor, @@ -6404,15 +6281,15 @@ rd_window_frame(RD_Window *ws) //- rjf: build empty view UI_Parent(view_container_box) if(rd_view_is_nil(rd_selected_tab_from_panel(panel))) { - RD_VIEW_UI_FUNCTION_NAME(empty)(&rd_nil_view, &md_nil_node, str8_zero(), content_rect); + RD_VIEW_RULE_UI_FUNCTION_NAME(empty)(&rd_nil_view, str8_zero(), &md_nil_node, content_rect); } //- rjf: build tab view UI_Parent(view_container_box) if(!rd_view_is_nil(rd_selected_tab_from_panel(panel))) { RD_View *view = rd_selected_tab_from_panel(panel); - RD_ViewUIFunctionType *build_view_ui_function = view->spec->info.ui_hook; - build_view_ui_function(view, view->params_roots[view->params_read_gen%ArrayCount(view->params_roots)], str8(view->query_buffer, view->query_string_size), content_rect); + RD_ViewRuleUIFunctionType *view_ui = view->spec->ui; + view_ui(view, str8(view->query_buffer, view->query_string_size), view->params_roots[view->params_read_gen%ArrayCount(view->params_roots)], content_rect); } //- rjf: pop interaction registers; commit if this is the selected view @@ -6440,7 +6317,7 @@ rd_window_frame(RD_Window *ws) UI_Focus(UI_FocusKind_On) { RD_View *view = rd_selected_tab_from_panel(panel); - if(ui_is_focus_active() && view->spec->info.flags & RD_ViewSpecFlag_TypingAutomaticallyFilters && !view->is_filtering) + if(ui_is_focus_active() && view->spec->flags & RD_ViewRuleInfoFlag_TypingAutomaticallyFilters && !view->is_filtering) { for(UI_Event *evt = 0; ui_next_event(&evt);) { @@ -6458,7 +6335,7 @@ rd_window_frame(RD_Window *ws) } } } - if(view->spec->info.flags & RD_ViewSpecFlag_CanFilter && (view->query_string_size != 0 || view->is_filtering) && ui_is_focus_active() && ui_slot_press(UI_EventActionSlot_Cancel)) + if(view->spec->flags & RD_ViewRuleInfoFlag_CanFilter && (view->query_string_size != 0 || view->is_filtering) && ui_is_focus_active() && ui_slot_press(UI_EventActionSlot_Cancel)) { rd_cmd(RD_CmdKind_ClearFilter, .view = rd_handle_from_view(view)); } @@ -6960,7 +6837,7 @@ rd_window_frame(RD_Window *ws) // for(UI_Event *evt = 0; ui_next_event(&evt);) { - if(evt->kind == UI_EventKind_Scroll && evt->modifiers & OS_EventFlag_Ctrl) + if(evt->kind == UI_EventKind_Scroll && evt->modifiers & OS_Modifier_Ctrl) { ui_eat_event(evt); if(evt->delta_2f32.y < 0) @@ -8262,7 +8139,7 @@ rd_bind_name(String8 name, RD_Binding binding) RD_KeyMapNode *existing_node = 0; for(RD_KeyMapNode *n = rd_state->key_map_table[slot].first; n != 0; n = n->hash_next) { - if(str8_match(n->name, name, 0) && n->binding.key == binding.key && n->binding.flags == binding.flags) + if(str8_match(n->name, name, 0) && n->binding.key == binding.key && n->binding.modifiers == binding.modifiers) { existing_node = n; break; @@ -8295,7 +8172,7 @@ rd_unbind_name(String8 name, RD_Binding binding) for(RD_KeyMapNode *n = rd_state->key_map_table[slot].first, *next = 0; n != 0; n = next) { next = n->hash_next; - if(str8_match(n->name, name, 0) && n->binding.key == binding.key && n->binding.flags == binding.flags) + if(str8_match(n->name, name, 0) && n->binding.key == binding.key && n->binding.modifiers == binding.modifiers) { DLLRemove_NP(rd_state->key_map_table[slot].first, rd_state->key_map_table[slot].last, n, hash_next, hash_prev); n->hash_next = rd_state->free_key_map_node; @@ -8313,7 +8190,7 @@ rd_cmd_name_list_from_binding(Arena *arena, RD_Binding binding) { for(RD_KeyMapNode *n = rd_state->key_map_table[idx].first; n != 0; n = n->hash_next) { - if(n->binding.key == binding.key && n->binding.flags == binding.flags) + if(n->binding.key == binding.key && n->binding.modifiers == binding.modifiers) { str8_list_push(arena, &result, n->name); } @@ -8706,10 +8583,9 @@ rd_cfg_strings_from_gfx(Arena *arena, String8 root_path, RD_CfgSrc source) // rjf: views for(RD_View *view = p->first_tab_view; !rd_view_is_nil(view); view = view->order_next) { - String8 view_string = view->spec->info.name; + String8 view_string = view->spec->string; - // rjf: serialize views which can be serialized - if(view->spec->info.flags & RD_ViewSpecFlag_CanSerialize) + // rjf: serialize views { str8_list_pushf(arena, &strs, "%.*s", indentation*2, indent_str.str); @@ -8857,9 +8733,9 @@ rd_cfg_strings_from_gfx(Arena *arena, String8 root_path, RD_CfgSrc source) for(U64 idx = 0; idx < string_binding_pair_count; idx += 1) { RD_StringBindingPair *pair = string_binding_pairs + idx; - String8List event_flags_strings = os_string_list_from_event_flags(scratch.arena, pair->binding.flags); + String8List modifiers_strings = os_string_list_from_modifiers(scratch.arena, pair->binding.modifiers); StringJoin join = {str8_lit(""), str8_lit(" "), str8_lit("")}; - String8 event_flags_string = str8_list_join(scratch.arena, &event_flags_strings, &join); + String8 event_flags_string = str8_list_join(scratch.arena, &modifiers_strings, &join); String8 key_string = push_str8_copy(scratch.arena, os_g_key_cfg_string_table[pair->binding.key]); for(U64 i = 0; i < event_flags_string.size; i += 1) { @@ -9325,16 +9201,7 @@ rd_regs_fill_slot_from_string(RD_RegSlot slot, String8 string) //////////////////////////////// //~ rjf: Commands -// TODO(rjf): @msgs temporary glue -#if 0 -internal D_CmdSpec * -rd_cmd_spec_from_kind(RD_CmdKind kind) -{ - String8 string = df_cmd_kind_spec_info_table[kind].string; - D_CmdSpec *result = d_cmd_spec_from_string(string); - return result; -} -#endif +//- rjf: name -> info internal RD_CmdKind rd_cmd_kind_from_string(String8 string) @@ -9351,8 +9218,6 @@ rd_cmd_kind_from_string(String8 string) return result; } -//- rjf: name -> info - internal RD_CmdKindInfo * rd_cmd_kind_info_from_string(String8 string) { @@ -9441,10 +9306,12 @@ rd_init(CmdLine *cmdln) rd_state->entities_root = rd_entity_alloc(&d_nil_entity, RD_EntityKind_Root); rd_state->key_map_arena = arena_alloc(); rd_state->popup_arena = arena_alloc(); +#if 0 // TODO(rjf): @msgs rd_state->view_spec_table_size = 256; rd_state->view_spec_table = push_array(arena, RD_ViewSpec *, rd_state->view_spec_table_size); rd_state->view_rule_spec_table_size = 1024; rd_state->view_rule_spec_table = push_array(arena, RD_ViewRuleSpec *, d_state->view_rule_spec_table_size); +#endif rd_state->code_ctx_menu_key = ui_key_from_string(ui_key_zero(), str8_lit("_code_ctx_menu_")); rd_state->entity_ctx_menu_key = ui_key_from_string(ui_key_zero(), str8_lit("_entity_ctx_menu_")); rd_state->tab_ctx_menu_key = ui_key_from_string(ui_key_zero(), str8_lit("_tab_ctx_menu_")); @@ -9465,16 +9332,20 @@ rd_init(CmdLine *cmdln) } // rjf: register gfx layer views +#if 0 // TODO(rjf): @msgs { RD_ViewSpecInfoArray array = {rd_gfx_view_kind_spec_info_table, ArrayCount(rd_gfx_view_kind_spec_info_table)}; rd_register_view_specs(array); } +#endif // rjf: register gfx layer view rules +#if 0 // TODO(rjf): @msgs { RD_ViewRuleSpecInfoArray array = {rd_gfx_view_rule_spec_info_table, ArrayCount(rd_gfx_view_rule_spec_info_table)}; rd_register_view_rule_specs(array); } +#endif // rjf: set up user / project paths { @@ -9718,11 +9589,11 @@ rd_frame(void) RD_Binding binding = zero_struct; { binding.key = event->key; - binding.flags = event->flags; + binding.modifiers = event->modifiers; } rd_unbind_name(rd_state->bind_change_cmd_name, rd_state->bind_change_binding); rd_bind_name(rd_state->bind_change_cmd_name, binding); - U32 codepoint = os_codepoint_from_event_flags_and_key(event->flags, event->key); + U32 codepoint = os_codepoint_from_modifiers_and_key(event->modifiers, event->key); os_text(&events, os_handle_zero(), codepoint); os_eat_event(&events, event); rd_cmd(rd_cfg_src_write_cmd_kind_table[RD_CfgSrc_User]); @@ -9760,7 +9631,7 @@ rd_frame(void) //- rjf: try menu bar operations { - if(!take && event->kind == OS_EventKind_Press && event->key == OS_Key_Alt && event->flags == 0 && event->is_repeat == 0) + if(!take && event->kind == OS_EventKind_Press && event->key == OS_Key_Alt && event->modifiers == 0 && event->is_repeat == 0) { take = 1; rd_request_frame(); @@ -9768,19 +9639,19 @@ rd_frame(void) window->menu_bar_key_held = 1; window->menu_bar_focus_press_started = 1; } - if(!take && event->kind == OS_EventKind_Release && event->key == OS_Key_Alt && event->flags == 0 && event->is_repeat == 0) + if(!take && event->kind == OS_EventKind_Release && event->key == OS_Key_Alt && event->modifiers == 0 && event->is_repeat == 0) { take = 1; rd_request_frame(); window->menu_bar_key_held = 0; } - if(window->menu_bar_focused && event->kind == OS_EventKind_Press && event->key == OS_Key_Alt && event->flags == 0 && event->is_repeat == 0) + if(window->menu_bar_focused && event->kind == OS_EventKind_Press && event->key == OS_Key_Alt && event->modifiers == 0 && event->is_repeat == 0) { take = 1; rd_request_frame(); window->menu_bar_focused = 0; } - else if(window->menu_bar_focus_press_started && !window->menu_bar_focused && event->kind == OS_EventKind_Release && event->flags == 0 && event->key == OS_Key_Alt && event->is_repeat == 0) + else if(window->menu_bar_focus_press_started && !window->menu_bar_focused && event->kind == OS_EventKind_Release && event->modifiers == 0 && event->key == OS_Key_Alt && event->is_repeat == 0) { take = 1; rd_request_frame(); @@ -9798,14 +9669,14 @@ rd_frame(void) //- rjf: try hotkey presses if(!take && event->kind == OS_EventKind_Press) { - RD_Binding binding = {event->key, event->flags}; + RD_Binding binding = {event->key, event->modifiers}; String8List spec_candidates = rd_cmd_name_list_from_binding(scratch.arena, binding); if(spec_candidates.first != 0) { rd_cmd(RD_CmdKind_RunCommand, .string = spec_candidates.first->string); - U32 hit_char = os_codepoint_from_event_flags_and_key(event->flags, event->key); + U32 hit_char = os_codepoint_from_modifiers_and_key(event->modifiers, event->key); take = 1; - if(event->flags & OS_EventFlag_Alt) + if(event->modifiers & OS_Modifier_Alt) { window->menu_bar_focus_press_started = 0; } @@ -9825,7 +9696,7 @@ rd_frame(void) rd_cmd(RD_CmdKind_InsertText, .string = insertion8); rd_request_frame(); take = 1; - if(event->flags & OS_EventFlag_Alt) + if(event->modifiers & OS_Modifier_Alt) { window->menu_bar_focus_press_started = 0; } @@ -9949,7 +9820,25 @@ rd_frame(void) for(RD_EntityNode *n = list.first; n != 0; n = n->next) { RD_Entity *entity = n->entity; - // TODO(rjf): @msgs + RD_Entity *loc = rd_entity_child_from_kind(entity, RD_EntityKind_Location); + RD_Entity *cnd = rd_entity_child_from_kind(entity, RD_EntityKind_Condition); + String8 label_string = push_str8_copy(scratch.arena, entity->string); + String8 loc_string = {0}; + if(loc->flags & RD_EntityFlag_HasTextPoint) + { + loc_string = push_str8f(scratch.arena, "%S:%I64u:%I64u", loc->string, loc->text_point.line, loc->text_point.column); + } + else if(loc->flags & RD_EntityFlag_HasVAddr) + { + loc_string = push_str8f(scratch.arena, "0x%I64x", loc->vaddr); + } + String8 cnd_string = push_str8_copy(scratch.arena, cnd->string); + CTRL_MetaEvalInfo *mei = &rd_state->meta_eval_infos.v[meta_eval_info_idx]; + mei->enabled = !entity->disabled; + mei->hit_count = entity->u64; + mei->label = label_string; + mei->location = loc_string; + mei->condition = cnd_string; meta_eval_info_idx += 1; } switch(evallable_entity_kinds[idx]) @@ -10094,6 +9983,18 @@ rd_frame(void) EV_ViewRuleInfoTable *view_rule_info_table = push_array(scratch.arena, EV_ViewRuleInfoTable, 1); { ev_view_rule_info_table_push_builtins(scratch.arena, view_rule_info_table); + for(EachEnumVal(RD_ViewRuleKind, k)) + { + RD_ViewRuleInfo *src_info = &rd_view_rule_kind_info_table[k]; + if(src_info->flags & RD_ViewRuleInfoFlag_CanUseInWatchTable) + { + EV_ViewRuleInfo dst_info = {0}; + dst_info.string = src_info->string; + dst_info.flags = src_info->flags & RD_ViewRuleInfoFlag_CanExpand ? EV_ViewRuleInfoFlag_Expandable : 0; + dst_info.block_prod = src_info->block_prod; + ev_view_rule_info_table_push(scratch.arena, view_rule_info_table, &dst_info); + } + } } ev_select_view_rule_info_table(view_rule_info_table); @@ -10176,8 +10077,8 @@ rd_frame(void) } // rjf: try to open tabs for "view driver" commands - RD_ViewSpec *view_spec = rd_view_spec_from_string(cmd->name); - if(view_spec != &rd_nil_view_spec) + RD_ViewRuleInfo *view_rule_info = rd_view_rule_info_from_string(cmd->name); + if(view_rule_info != &rd_nil_view_rule_info) { rd_cmd(RD_CmdKind_OpenTab, .string = cmd->name); } @@ -10933,8 +10834,8 @@ rd_frame(void) RD_View *selected_view = &rd_nil_view; for(MD_EachNode(op, n->first)) { - RD_ViewSpec *view_spec = rd_view_spec_from_string(op->string); - if(view_spec == &rd_nil_view_spec || has_panel_children != 0) + RD_ViewRuleInfo *view_rule_info = rd_view_rule_info_from_string(op->string); + if(view_rule_info == &rd_nil_view_rule_info || has_panel_children != 0) { continue; } @@ -10942,8 +10843,7 @@ rd_frame(void) // rjf: allocate view & apply view-specific parameterizations RD_View *view = &rd_nil_view; B32 view_is_selected = 0; - RD_ViewSpecFlags view_spec_flags = view_spec->info.flags; - if(view_spec_flags & RD_ViewSpecFlag_CanSerialize) + RD_ViewRuleInfoFlags view_rule_info_flags = view_rule_info->flags; { // rjf: allocate view view = rd_view_alloc(); @@ -10979,7 +10879,7 @@ rd_frame(void) } // rjf: set up view - rd_view_equip_spec(view, view_spec, view_query, op); + rd_view_equip_spec(view, view_rule_info, view_query, op); if(project_path.size != 0) { arena_clear(view->project_path_arena); @@ -11112,10 +11012,10 @@ rd_frame(void) } if(cmd_name.size != 0 && key != OS_Key_Null) { - OS_EventFlags flags = 0; - if(!md_node_is_nil(ctrl_node)) { flags |= OS_EventFlag_Ctrl; } - if(!md_node_is_nil(shift_node)) { flags |= OS_EventFlag_Shift; } - if(!md_node_is_nil(alt_node)) { flags |= OS_EventFlag_Alt; } + OS_Modifiers flags = 0; + if(!md_node_is_nil(ctrl_node)) { flags |= OS_Modifier_Ctrl; } + if(!md_node_is_nil(shift_node)) { flags |= OS_Modifier_Shift; } + if(!md_node_is_nil(alt_node)) { flags |= OS_Modifier_Alt; } RD_Binding binding = {key, flags}; rd_bind_name(cmd_name, binding); } @@ -12020,8 +11920,6 @@ rd_frame(void) { RD_Panel *panel = rd_panel_from_handle(rd_regs()->panel); RD_View *view = rd_selected_tab_from_panel(panel); - RD_ViewKind view_kind = rd_view_kind_from_string(view->spec->info.name); - if(view_kind == RD_ViewKind_Text) { String8 file_path = rd_file_path_from_eval_string(scratch.arena, str8(view->query_buffer, view->query_string_size)); String8 file_full_path = path_normalized_from_string(scratch.arena, file_path); @@ -12108,29 +12006,29 @@ rd_frame(void) for(RD_View *view = panel->first_tab_view, *next = 0; !rd_view_is_nil(view); view = next) { next = view->order_next; - RD_ViewKind view_kind = rd_view_kind_from_string(view->spec->info.name); + RD_ViewRuleKind view_rule_kind = rd_view_rule_kind_from_string(view->spec->string); B32 needs_delete = 1; - switch(view_kind) + switch(view_rule_kind) { default:{}break; - case RD_ViewKind_Watch: {if(rd_view_is_nil(watch)) { needs_delete = 0; watch = view;} }break; - case RD_ViewKind_Locals: {if(rd_view_is_nil(locals)) { needs_delete = 0; locals = view;} }break; - case RD_ViewKind_Registers: {if(rd_view_is_nil(regs)) { needs_delete = 0; regs = view;} }break; - case RD_ViewKind_Globals: {if(rd_view_is_nil(globals)) { needs_delete = 0; globals = view;} }break; - case RD_ViewKind_ThreadLocals: {if(rd_view_is_nil(tlocals)) { needs_delete = 0; tlocals = view;} }break; - case RD_ViewKind_Types: {if(rd_view_is_nil(types)) { needs_delete = 0; types = view;} }break; - case RD_ViewKind_Procedures: {if(rd_view_is_nil(procs)) { needs_delete = 0; procs = view;} }break; - case RD_ViewKind_CallStack: {if(rd_view_is_nil(callstack)) { needs_delete = 0; callstack = view;} }break; - case RD_ViewKind_Breakpoints: {if(rd_view_is_nil(breakpoints)) { needs_delete = 0; breakpoints = view;} }break; - case RD_ViewKind_WatchPins: {if(rd_view_is_nil(watch_pins)) { needs_delete = 0; watch_pins = view;} }break; - case RD_ViewKind_Output: {if(rd_view_is_nil(output)) { needs_delete = 0; output = view;} }break; - case RD_ViewKind_Targets: {if(rd_view_is_nil(targets)) { needs_delete = 0; targets = view;} }break; - case RD_ViewKind_Scheduler: {if(rd_view_is_nil(scheduler)) { needs_delete = 0; scheduler = view;} }break; - case RD_ViewKind_Modules: {if(rd_view_is_nil(modules)) { needs_delete = 0; modules = view;} }break; - case RD_ViewKind_Disasm: {if(rd_view_is_nil(disasm)) { needs_delete = 0; disasm = view;} }break; - case RD_ViewKind_Memory: {if(rd_view_is_nil(memory)) { needs_delete = 0; memory = view;} }break; - case RD_ViewKind_GettingStarted:{if(rd_view_is_nil(getting_started)) { needs_delete = 0; getting_started = view;} }break; - case RD_ViewKind_Text: + case RD_ViewRuleKind_Watch: {if(rd_view_is_nil(watch)) { needs_delete = 0; watch = view;} }break; + case RD_ViewRuleKind_Locals: {if(rd_view_is_nil(locals)) { needs_delete = 0; locals = view;} }break; + case RD_ViewRuleKind_Registers: {if(rd_view_is_nil(regs)) { needs_delete = 0; regs = view;} }break; + case RD_ViewRuleKind_Globals: {if(rd_view_is_nil(globals)) { needs_delete = 0; globals = view;} }break; + case RD_ViewRuleKind_ThreadLocals: {if(rd_view_is_nil(tlocals)) { needs_delete = 0; tlocals = view;} }break; + case RD_ViewRuleKind_Types: {if(rd_view_is_nil(types)) { needs_delete = 0; types = view;} }break; + case RD_ViewRuleKind_Procedures: {if(rd_view_is_nil(procs)) { needs_delete = 0; procs = view;} }break; + case RD_ViewRuleKind_CallStack: {if(rd_view_is_nil(callstack)) { needs_delete = 0; callstack = view;} }break; + case RD_ViewRuleKind_Breakpoints: {if(rd_view_is_nil(breakpoints)) { needs_delete = 0; breakpoints = view;} }break; + case RD_ViewRuleKind_WatchPins: {if(rd_view_is_nil(watch_pins)) { needs_delete = 0; watch_pins = view;} }break; + case RD_ViewRuleKind_Output: {if(rd_view_is_nil(output)) { needs_delete = 0; output = view;} }break; + case RD_ViewRuleKind_Targets: {if(rd_view_is_nil(targets)) { needs_delete = 0; targets = view;} }break; + case RD_ViewRuleKind_Scheduler: {if(rd_view_is_nil(scheduler)) { needs_delete = 0; scheduler = view;} }break; + case RD_ViewRuleKind_Modules: {if(rd_view_is_nil(modules)) { needs_delete = 0; modules = view;} }break; + case RD_ViewRuleKind_Disasm: {if(rd_view_is_nil(disasm)) { needs_delete = 0; disasm = view;} }break; + case RD_ViewRuleKind_Memory: {if(rd_view_is_nil(memory)) { needs_delete = 0; memory = view;} }break; + case RD_ViewRuleKind_GettingStarted:{if(rd_view_is_nil(getting_started)) { needs_delete = 0; getting_started = view;} }break; + case RD_ViewRuleKind_Text: { needs_delete = 0; rd_handle_list_push(scratch.arena, &code_views, rd_handle_from_view(view)); @@ -12162,87 +12060,87 @@ rd_frame(void) if(rd_view_is_nil(watch)) { watch = rd_view_alloc(); - rd_view_equip_spec(watch, rd_view_spec_from_kind(RD_ViewKind_Watch), str8_zero(), &md_nil_node); + rd_view_equip_spec(watch, rd_view_rule_info_from_kind(RD_ViewRuleKind_Watch), str8_zero(), &md_nil_node); } if(layout == Layout_Default && rd_view_is_nil(locals)) { locals = rd_view_alloc(); - rd_view_equip_spec(locals, rd_view_spec_from_kind(RD_ViewKind_Locals), str8_zero(), &md_nil_node); + rd_view_equip_spec(locals, rd_view_rule_info_from_kind(RD_ViewRuleKind_Locals), str8_zero(), &md_nil_node); } if(layout == Layout_Default && rd_view_is_nil(regs)) { regs = rd_view_alloc(); - rd_view_equip_spec(regs, rd_view_spec_from_kind(RD_ViewKind_Registers), str8_zero(), &md_nil_node); + rd_view_equip_spec(regs, rd_view_rule_info_from_kind(RD_ViewRuleKind_Registers), str8_zero(), &md_nil_node); } if(layout == Layout_Default && rd_view_is_nil(globals)) { globals = rd_view_alloc(); - rd_view_equip_spec(globals, rd_view_spec_from_kind(RD_ViewKind_Globals), str8_zero(), &md_nil_node); + rd_view_equip_spec(globals, rd_view_rule_info_from_kind(RD_ViewRuleKind_Globals), str8_zero(), &md_nil_node); } if(layout == Layout_Default && rd_view_is_nil(tlocals)) { tlocals = rd_view_alloc(); - rd_view_equip_spec(tlocals, rd_view_spec_from_kind(RD_ViewKind_ThreadLocals), str8_zero(), &md_nil_node); + rd_view_equip_spec(tlocals, rd_view_rule_info_from_kind(RD_ViewRuleKind_ThreadLocals), str8_zero(), &md_nil_node); } if(rd_view_is_nil(types)) { types = rd_view_alloc(); - rd_view_equip_spec(types, rd_view_spec_from_kind(RD_ViewKind_Types), str8_zero(), &md_nil_node); + rd_view_equip_spec(types, rd_view_rule_info_from_kind(RD_ViewRuleKind_Types), str8_zero(), &md_nil_node); } if(layout == Layout_Default && rd_view_is_nil(procs)) { procs = rd_view_alloc(); - rd_view_equip_spec(procs, rd_view_spec_from_kind(RD_ViewKind_Procedures), str8_zero(), &md_nil_node); + rd_view_equip_spec(procs, rd_view_rule_info_from_kind(RD_ViewRuleKind_Procedures), str8_zero(), &md_nil_node); } if(rd_view_is_nil(callstack)) { callstack = rd_view_alloc(); - rd_view_equip_spec(callstack, rd_view_spec_from_kind(RD_ViewKind_CallStack), str8_zero(), &md_nil_node); + rd_view_equip_spec(callstack, rd_view_rule_info_from_kind(RD_ViewRuleKind_CallStack), str8_zero(), &md_nil_node); } if(rd_view_is_nil(breakpoints)) { breakpoints = rd_view_alloc(); - rd_view_equip_spec(breakpoints, rd_view_spec_from_kind(RD_ViewKind_Breakpoints), str8_zero(), &md_nil_node); + rd_view_equip_spec(breakpoints, rd_view_rule_info_from_kind(RD_ViewRuleKind_Breakpoints), str8_zero(), &md_nil_node); } if(layout == Layout_Default && rd_view_is_nil(watch_pins)) { watch_pins = rd_view_alloc(); - rd_view_equip_spec(watch_pins, rd_view_spec_from_kind(RD_ViewKind_WatchPins), str8_zero(), &md_nil_node); + rd_view_equip_spec(watch_pins, rd_view_rule_info_from_kind(RD_ViewRuleKind_WatchPins), str8_zero(), &md_nil_node); } if(rd_view_is_nil(output)) { output = rd_view_alloc(); - rd_view_equip_spec(output, rd_view_spec_from_kind(RD_ViewKind_Output), str8_zero(), &md_nil_node); + rd_view_equip_spec(output, rd_view_rule_info_from_kind(RD_ViewRuleKind_Output), str8_zero(), &md_nil_node); } if(rd_view_is_nil(targets)) { targets = rd_view_alloc(); - rd_view_equip_spec(targets, rd_view_spec_from_kind(RD_ViewKind_Targets), str8_zero(), &md_nil_node); + rd_view_equip_spec(targets, rd_view_rule_info_from_kind(RD_ViewRuleKind_Targets), str8_zero(), &md_nil_node); } if(rd_view_is_nil(scheduler)) { scheduler = rd_view_alloc(); - rd_view_equip_spec(scheduler, rd_view_spec_from_kind(RD_ViewKind_Scheduler), str8_zero(), &md_nil_node); + rd_view_equip_spec(scheduler, rd_view_rule_info_from_kind(RD_ViewRuleKind_Scheduler), str8_zero(), &md_nil_node); } if(rd_view_is_nil(modules)) { modules = rd_view_alloc(); - rd_view_equip_spec(modules, rd_view_spec_from_kind(RD_ViewKind_Modules), str8_zero(), &md_nil_node); + rd_view_equip_spec(modules, rd_view_rule_info_from_kind(RD_ViewRuleKind_Modules), str8_zero(), &md_nil_node); } if(rd_view_is_nil(disasm)) { disasm = rd_view_alloc(); - rd_view_equip_spec(disasm, rd_view_spec_from_kind(RD_ViewKind_Disasm), str8_zero(), &md_nil_node); + rd_view_equip_spec(disasm, rd_view_rule_info_from_kind(RD_ViewRuleKind_Disasm), str8_zero(), &md_nil_node); } if(layout == Layout_Default && rd_view_is_nil(memory)) { memory = rd_view_alloc(); - rd_view_equip_spec(memory, rd_view_spec_from_kind(RD_ViewKind_Memory), str8_zero(), &md_nil_node); + rd_view_equip_spec(memory, rd_view_rule_info_from_kind(RD_ViewRuleKind_Memory), str8_zero(), &md_nil_node); } if(code_views.count == 0 && rd_view_is_nil(getting_started)) { getting_started = rd_view_alloc(); - rd_view_equip_spec(getting_started, rd_view_spec_from_kind(RD_ViewKind_GettingStarted), str8_zero(), &md_nil_node); + rd_view_equip_spec(getting_started, rd_view_rule_info_from_kind(RD_ViewRuleKind_GettingStarted), str8_zero(), &md_nil_node); } //- rjf: apply layout @@ -12830,8 +12728,8 @@ rd_frame(void) { if(rd_view_is_project_filtered(view)) { continue; } String8 view_file_path = rd_file_path_from_eval_string(scratch.arena, str8(view->query_buffer, view->query_string_size)); - RD_ViewKind view_kind = rd_view_kind_from_string(view->spec->info.name); - if((view_kind == RD_ViewKind_Text || view_kind == RD_ViewKind_PendingFile) && + RD_ViewRuleKind view_kind = rd_view_rule_kind_from_string(view->spec->string); + if((view_kind == RD_ViewRuleKind_Text || view_kind == RD_ViewRuleKind_PendingFile) && path_match_normalized(view_file_path, file_path)) { panel_w_this_src_code = panel; @@ -12855,8 +12753,8 @@ rd_frame(void) for(RD_View *view = panel->first_tab_view; !rd_view_is_nil(view); view = view->order_next) { if(rd_view_is_project_filtered(view)) { continue; } - RD_ViewKind view_kind = rd_view_kind_from_string(view->spec->info.name); - if(view_kind == RD_ViewKind_Text) + RD_ViewRuleKind view_kind = rd_view_rule_kind_from_string(view->spec->string); + if(view_kind == RD_ViewRuleKind_Text) { panel_w_any_src_code = panel; break; @@ -12876,8 +12774,8 @@ rd_frame(void) for(RD_View *view = panel->first_tab_view; !rd_view_is_nil(view); view = view->order_next) { if(rd_view_is_project_filtered(view)) { continue; } - RD_ViewKind view_kind = rd_view_kind_from_string(view->spec->info.name); - if(view_kind == RD_ViewKind_Disasm && view->query_string_size == 0) + RD_ViewRuleKind view_kind = rd_view_rule_kind_from_string(view->spec->string); + if(view_kind == RD_ViewRuleKind_Disasm && view->query_string_size == 0) { panel_w_disasm = panel; view_w_disasm = view; @@ -12962,7 +12860,7 @@ rd_frame(void) { RD_View *view = rd_view_alloc(); String8 file_path_query = rd_eval_string_from_file_path(scratch.arena, file_path); - rd_view_equip_spec(view, rd_view_spec_from_kind(RD_ViewKind_Text), file_path_query, &md_nil_node); + rd_view_equip_spec(view, rd_view_rule_info_from_kind(RD_ViewRuleKind_Text), file_path_query, &md_nil_node); rd_panel_insert_tab_view(dst_panel, dst_panel->last_tab_view, view); dst_view = view; } @@ -13007,7 +12905,7 @@ rd_frame(void) if(!rd_panel_is_nil(dst_panel) && rd_view_is_nil(view_w_disasm)) { RD_View *view = rd_view_alloc(); - rd_view_equip_spec(view, rd_view_spec_from_kind(RD_ViewKind_Disasm), str8_zero(), &md_nil_node); + rd_view_equip_spec(view, rd_view_rule_info_from_kind(RD_ViewRuleKind_Disasm), str8_zero(), &md_nil_node); rd_panel_insert_tab_view(dst_panel, dst_panel->last_tab_view, view); dst_view = view; } @@ -13044,7 +12942,7 @@ rd_frame(void) break; } } - if(view_is_tab && view->spec->info.flags & RD_ViewSpecFlag_CanFilter) + if(view_is_tab && view->spec->flags & RD_ViewRuleInfoFlag_CanFilter) { view->is_filtering ^= 1; view->query_cursor = txt_pt(1, 1+(S64)view->query_string_size); @@ -13505,7 +13403,7 @@ rd_frame(void) } ui_event.kind = kind; ui_event.key = os_event->key; - ui_event.modifiers = os_event->flags; + ui_event.modifiers = os_event->modifiers; ui_event.string = os_event->character ? str8_from_32(ui_build_arena(), str32(&os_event->character, 1)) : str8_zero(); ui_event.paths = str8_list_copy(ui_build_arena(), &os_event->strings); ui_event.pos = os_event->pos; diff --git a/src/raddbg/raddbg_core.h b/src/raddbg/raddbg_core.h index 2c905b08..34e5830c 100644 --- a/src/raddbg/raddbg_core.h +++ b/src/raddbg/raddbg_core.h @@ -92,7 +92,7 @@ typedef struct RD_Binding RD_Binding; struct RD_Binding { OS_Key key; - OS_EventFlags flags; + OS_Modifiers modifiers; }; typedef struct RD_BindingNode RD_BindingNode; @@ -151,11 +151,6 @@ struct RD_SettingVal typedef struct RD_View RD_View; -#define RD_VIEW_UI_FUNCTION_SIG(name) void name(RD_View *view, MD_Node *params, String8 string, Rng2F32 rect) -#define RD_VIEW_UI_FUNCTION_NAME(name) rd_view_ui_##name -#define RD_VIEW_UI_FUNCTION_DEF(name) internal RD_VIEW_UI_FUNCTION_SIG(RD_VIEW_UI_FUNCTION_NAME(name)) -typedef RD_VIEW_UI_FUNCTION_SIG(RD_ViewUIFunctionType); - //////////////////////////////// //~ rjf: View Rule Info Types @@ -166,6 +161,9 @@ enum RD_ViewRuleInfoFlag_CanFilter = (1<<1), RD_ViewRuleInfoFlag_FilterIsCode = (1<<2), RD_ViewRuleInfoFlag_TypingAutomaticallyFilters = (1<<3), + RD_ViewRuleInfoFlag_CanUseInWatchTable = (1<<4), + RD_ViewRuleInfoFlag_CanFillValueCell = (1<<5), + RD_ViewRuleInfoFlag_CanExpand = (1<<6), }; #define RD_VIEW_RULE_UI_FUNCTION_SIG(name) void name(RD_View *view, String8 string, MD_Node *params, Rng2F32 rect) @@ -173,46 +171,6 @@ enum #define RD_VIEW_RULE_UI_FUNCTION_DEF(name) internal RD_VIEW_RULE_UI_FUNCTION_SIG(RD_VIEW_RULE_UI_FUNCTION_NAME(name)) typedef RD_VIEW_RULE_UI_FUNCTION_SIG(RD_ViewRuleUIFunctionType); -//////////////////////////////// -//~ rjf: View Specification Types - -#if 1 // TODO(rjf): @msgs -typedef U32 RD_ViewSpecFlags; -enum -{ - RD_ViewSpecFlag_ParameterizedByEntity = (1<<0), - RD_ViewSpecFlag_ProjectSpecific = (1<<1), - RD_ViewSpecFlag_CanSerialize = (1<<2), - RD_ViewSpecFlag_CanFilter = (1<<3), - RD_ViewSpecFlag_FilterIsCode = (1<<4), - RD_ViewSpecFlag_TypingAutomaticallyFilters = (1<<5), -}; - -typedef struct RD_ViewSpecInfo RD_ViewSpecInfo; -struct RD_ViewSpecInfo -{ - RD_ViewSpecFlags flags; - String8 name; - String8 display_string; - U32 icon_kind; - RD_ViewUIFunctionType *ui_hook; -}; - -typedef struct RD_ViewSpec RD_ViewSpec; -struct RD_ViewSpec -{ - RD_ViewSpec *hash_next; - RD_ViewSpecInfo info; -}; - -typedef struct RD_ViewSpecInfoArray RD_ViewSpecInfoArray; -struct RD_ViewSpecInfoArray -{ - RD_ViewSpecInfo *v; - U64 count; -}; -#endif - //////////////////////////////// //~ rjf: View Types @@ -259,7 +217,7 @@ struct RD_View RD_View *last_transient; // rjf: view specification info - RD_ViewSpec *spec; + struct RD_ViewRuleInfo *spec; // rjf: allocation info U64 generation; @@ -367,53 +325,6 @@ struct RD_DragDropPayload TxtPt text_point; }; -//////////////////////////////// -//~ rjf: View Rule Spec Types - -typedef U32 RD_ViewRuleSpecInfoFlags; // NOTE(rjf): see @view_rule_info -enum -{ - RD_ViewRuleSpecInfoFlag_VizRowProd = (1<<0), - RD_ViewRuleSpecInfoFlag_LineStringize = (1<<1), - RD_ViewRuleSpecInfoFlag_RowUI = (1<<2), - RD_ViewRuleSpecInfoFlag_ViewUI = (1<<3), -}; - -#define RD_VIEW_RULE_LINE_STRINGIZE_FUNCTION_SIG(name) void name(void) -#define RD_VIEW_RULE_LINE_STRINGIZE_FUNCTION_NAME(name) rd_view_rule_line_stringize__##name -#define RD_VIEW_RULE_LINE_STRINGIZE_FUNCTION_DEF(name) internal RD_VIEW_RULE_LINE_STRINGIZE_FUNCTION_SIG(RD_VIEW_RULE_LINE_STRINGIZE_FUNCTION_NAME(name)) - -#define RD_VIEW_RULE_ROW_UI_FUNCTION_SIG(name) void name(EV_Key key, MD_Node *params, String8 string) -#define RD_VIEW_RULE_ROW_UI_FUNCTION_NAME(name) rd_view_rule_row_ui__##name -#define RD_VIEW_RULE_ROW_UI_FUNCTION_DEF(name) RD_VIEW_RULE_ROW_UI_FUNCTION_SIG(RD_VIEW_RULE_ROW_UI_FUNCTION_NAME(name)) - -typedef RD_VIEW_RULE_VIZ_ROW_PROD_FUNCTION_SIG(RD_ViewRuleVizRowProdHookFunctionType); -typedef RD_VIEW_RULE_LINE_STRINGIZE_FUNCTION_SIG(RD_ViewRuleLineStringizeHookFunctionType); -typedef RD_VIEW_RULE_ROW_UI_FUNCTION_SIG(RD_ViewRuleRowUIFunctionType); - -typedef struct RD_ViewRuleSpecInfo RD_ViewRuleSpecInfo; -struct RD_ViewRuleSpecInfo -{ - String8 string; - RD_ViewRuleSpecInfoFlags flags; - RD_ViewRuleLineStringizeHookFunctionType *line_stringize; - RD_ViewRuleRowUIFunctionType *row_ui; -}; - -typedef struct RD_ViewRuleSpecInfoArray RD_ViewRuleSpecInfoArray; -struct RD_ViewRuleSpecInfoArray -{ - RD_ViewRuleSpecInfo *v; - U64 count; -}; - -typedef struct RD_ViewRuleSpec RD_ViewRuleSpec; -struct RD_ViewRuleSpec -{ - RD_ViewRuleSpec *hash_next; - RD_ViewRuleSpecInfo info; -}; - //////////////////////////////// //~ rjf: Command Kind Types @@ -974,14 +885,6 @@ struct RD_State UI_Key entity_ctx_menu_key; UI_Key tab_ctx_menu_key; - // rjf: view specs - U64 view_spec_table_size; - RD_ViewSpec **view_spec_table; - - // rjf: view rule specs - U64 view_rule_spec_table_size; - RD_ViewRuleSpec **view_rule_spec_table; - // rjf: windows RD_Window *first_window; RD_Window *last_window; @@ -1042,24 +945,7 @@ read_only global RD_Entity d_nil_entity = read_only global RD_CmdKindInfo rd_nil_cmd_kind_info = {0}; -read_only global RD_ViewRuleInfo rd_nil_view_rule_info = {0}; - -read_only global RD_ViewSpec rd_nil_view_spec = -{ - &rd_nil_view_spec, - { - 0, - {0}, - {0}, - RD_IconKind_Null, - RD_VIEW_UI_FUNCTION_NAME(null), - }, -}; - -read_only global RD_ViewRuleSpec rd_nil_view_rule_spec = -{ - &rd_nil_view_rule_spec, -}; +read_only global RD_ViewRuleInfo rd_nil_view_rule_info = {{0}, {0}, {0}, {0}, RD_IconKind_Null, 0, 0, RD_VIEW_RULE_UI_FUNCTION_NAME(null)}; read_only global RD_View rd_nil_view = { @@ -1069,7 +955,7 @@ read_only global RD_View rd_nil_view = &rd_nil_view, &rd_nil_view, &rd_nil_view, - &rd_nil_view_spec, + &rd_nil_view_rule_info, }; read_only global RD_Panel rd_nil_panel = @@ -1176,7 +1062,9 @@ internal RD_View *rd_view_from_handle(RD_Handle handle); //////////////////////////////// //~ rjf: View Spec Type Functions -internal RD_ViewKind rd_view_kind_from_string(String8 string); +internal RD_ViewRuleKind rd_view_rule_kind_from_string(String8 string); +internal RD_ViewRuleInfo *rd_view_rule_info_from_kind(RD_ViewRuleKind kind); +internal RD_ViewRuleInfo *rd_view_rule_info_from_string(String8 string); //////////////////////////////// //~ rjf: Panel Type Functions @@ -1313,34 +1201,10 @@ internal Arch rd_arch_from_eval_params(E_Eval eval, MD_Node *params); internal Vec2S32 rd_dim2s32_from_eval_params(E_Eval eval, MD_Node *params); internal R_Tex2DFormat rd_tex2dformat_from_eval_params(E_Eval eval, MD_Node *params); -//- rjf: eval <-> entity -#if 0 // TODO(rjf): @msgs -internal RD_Entity *rd_entity_from_eval_string(String8 string); -internal String8 rd_eval_string_from_entity(Arena *arena, RD_Entity *entity); -#endif - //- rjf: eval <-> file path internal String8 rd_file_path_from_eval_string(Arena *arena, String8 string); internal String8 rd_eval_string_from_file_path(Arena *arena, String8 string); -//////////////////////////////// -//~ rjf: View Rule Kind Functions - -internal RD_ViewRuleInfo *rd_view_rule_info_from_string(String8 string); - -//////////////////////////////// -//~ rjf: View Spec State Functions - -internal void rd_register_view_specs(RD_ViewSpecInfoArray specs); -internal RD_ViewSpec *rd_view_spec_from_string(String8 string); -internal RD_ViewSpec *rd_view_spec_from_kind(RD_ViewKind kind); - -//////////////////////////////// -//~ rjf: View Rule Spec State Functions - -internal void rd_register_view_rule_specs(RD_ViewRuleSpecInfoArray specs); -internal RD_ViewRuleSpec *rd_view_rule_spec_from_string(String8 string); - //////////////////////////////// //~ rjf: View State Functions @@ -1349,7 +1213,7 @@ internal RD_View *rd_view_alloc(void); internal void rd_view_release(RD_View *view); //- rjf: equipment -internal void rd_view_equip_spec(RD_View *view, RD_ViewSpec *spec, String8 query, MD_Node *params); +internal void rd_view_equip_spec(RD_View *view, RD_ViewRuleInfo *spec, String8 query, MD_Node *params); internal void rd_view_equip_query(RD_View *view, String8 query); internal void rd_view_equip_loading_info(RD_View *view, B32 is_loading, U64 progress_v, U64 progress_target); @@ -1488,13 +1352,8 @@ internal void rd_regs_fill_slot_from_string(RD_RegSlot slot, String8 string); //////////////////////////////// //~ rjf: Commands -// TODO(rjf): @msgs temporary glue -#if 0 -internal D_CmdSpec *rd_cmd_spec_from_kind(RD_CmdKind kind); -#endif -internal RD_CmdKind rd_cmd_kind_from_string(String8 string); - //- rjf: name -> info +internal RD_CmdKind rd_cmd_kind_from_string(String8 string); internal RD_CmdKindInfo *rd_cmd_kind_info_from_string(String8 string); //- rjf: pushing diff --git a/src/raddbg/raddbg_views.c b/src/raddbg/raddbg_views.c index c1c68f56..03143f8e 100644 --- a/src/raddbg/raddbg_views.c +++ b/src/raddbg/raddbg_views.c @@ -566,7 +566,7 @@ rd_code_view_build(Arena *arena, RD_View *view, RD_CodeViewState *cv, RD_CodeVie } //- rjf: ctrl+pressed? -> go to name - if(ui_pressed(sig.base) && sig.base.event_flags & OS_EventFlag_Ctrl) + if(ui_pressed(sig.base) && sig.base.event_flags & OS_Modifier_Ctrl) { ui_kill_action(); rd_cmd(RD_CmdKind_GoToName, .string = txt_string_from_info_data_txt_rng(text_info, text_data, sig.mouse_expr_rng)); @@ -716,7 +716,7 @@ rd_code_view_build(Arena *arena, RD_View *view, RD_CodeViewState *cv, RD_CodeVie { for(UI_Event *evt = 0; ui_next_event(&evt);) { - if(evt->kind == UI_EventKind_Scroll && evt->modifiers & OS_EventFlag_Ctrl) + if(evt->kind == UI_EventKind_Scroll && evt->modifiers & OS_Modifier_Ctrl) { ui_eat_event(evt); if(evt->delta_2f32.y < 0) @@ -1567,22 +1567,22 @@ rd_watch_view_build(RD_View *view, RD_WatchViewState *ewv, B32 modifiable, U32 d B32 is_expanded = ev_expansion_from_key(eval_view, row->key); ev_key_set_expansion(eval_view, row->parent_key, row->key, !is_expanded); } - RD_ViewRuleSpec *block_ui_rule_spec = &rd_nil_view_rule_spec; - MD_Node *block_ui_rule_root = &md_nil_node; + RD_ViewRuleInfo *view_rule_info = &rd_nil_view_rule_info; + MD_Node *view_rule_params_root = &md_nil_node; for(EV_ViewRuleNode *n = row->view_rules->first; n != 0; n = n->next) { - RD_ViewRuleSpec *spec = rd_view_rule_spec_from_string(n->v.root->string); - if(spec->info.flags & RD_ViewRuleSpecInfoFlag_ViewUI) + RD_ViewRuleInfo *info = rd_view_rule_info_from_string(n->v.root->string); + if(info->ui != 0) { - block_ui_rule_spec = spec; - block_ui_rule_root = n->v.root; + view_rule_info = info; + view_rule_params_root = n->v.root; } } - if(block_ui_rule_spec != &rd_nil_view_rule_spec) + if(view_rule_info != &rd_nil_view_rule_info) { rd_cmd(RD_CmdKind_OpenTab, .string = e_string_from_expr(scratch.arena, row->expr), - .params_tree = block_ui_rule_root); + .params_tree = view_rule_params_root); } } } @@ -2170,22 +2170,15 @@ rd_watch_view_build(RD_View *view, RD_WatchViewState *ewv, B32 modifiable, U32 d B32 row_is_expandable = ev_row_is_expandable(row); B32 row_is_editable = ev_row_is_editable(row); B32 next_row_expanded = row_expanded; - RD_ViewRuleSpec *value_ui_rule_spec = &rd_nil_view_rule_spec; - MD_Node *value_ui_rule_root = &md_nil_node; - RD_ViewRuleSpec *block_ui_rule_spec = &rd_nil_view_rule_spec; - MD_Node *block_ui_rule_root = &md_nil_node; + RD_ViewRuleInfo *ui_view_rule_info = &rd_nil_view_rule_info; + MD_Node *ui_view_rule_params_root = &md_nil_node; for(EV_ViewRuleNode *n = row->view_rules->first; n != 0; n = n->next) { - RD_ViewRuleSpec *spec = rd_view_rule_spec_from_string(n->v.root->string); - if(spec->info.flags & RD_ViewRuleSpecInfoFlag_RowUI) + RD_ViewRuleInfo *info = rd_view_rule_info_from_string(n->v.root->string); + if(info->ui != 0) { - value_ui_rule_spec = spec; - value_ui_rule_root = n->v.root; - } - if(spec->info.flags & RD_ViewRuleSpecInfoFlag_ViewUI) - { - block_ui_rule_spec = spec; - block_ui_rule_root = n->v.root; + ui_view_rule_info = info; + ui_view_rule_params_root = n->v.root; } } @@ -2245,8 +2238,8 @@ rd_watch_view_build(RD_View *view, RD_WatchViewState *ewv, B32 modifiable, U32 d UI_Box *row_box = ui_build_box_from_stringf(row_flags| UI_BoxFlag_DrawSideBottom| UI_BoxFlag_Clickable| - ((block_ui_rule_spec == &rd_nil_view_rule_spec) * UI_BoxFlag_DisableFocusOverlay)| - ((block_ui_rule_spec != &rd_nil_view_rule_spec) * UI_BoxFlag_Clip), + ((ui_view_rule_info == &rd_nil_view_rule_info) * UI_BoxFlag_DisableFocusOverlay)| + ((ui_view_rule_info != &rd_nil_view_rule_info) * UI_BoxFlag_Clip), "row_%I64x", row_hash); ui_ts_vector_idx += 1; ui_ts_cell_idx = 0; @@ -2254,25 +2247,24 @@ rd_watch_view_build(RD_View *view, RD_WatchViewState *ewv, B32 modifiable, U32 d //////////////////////// //- rjf: row with expand ui rule -> build large singular row for "escape hatch" ui // - if(block_ui_rule_spec != &rd_nil_view_rule_spec) + if(row->block_kind == EV_BlockKind_Canvas) UI_Parent(row_box) UI_FocusHot(row_selected ? UI_FocusKind_On : UI_FocusKind_Off) { //- rjf: build canvas row contents - if(block_ui_rule_spec->info.flags & RD_ViewRuleSpecInfoFlag_ViewUI) + if(ui_view_rule_info->ui != 0) { //- rjf: unpack RD_WatchViewPoint pt = {0, row->parent_key, row->key}; - RD_ViewSpec *canvas_view_spec = rd_view_spec_from_string(block_ui_rule_spec->info.string); RD_TransientViewNode *canvas_view_node = rd_transient_view_node_from_ev_key(view, row->key); RD_View *canvas_view = canvas_view_node->view; String8 canvas_view_expr = e_string_from_expr(scratch.arena, row->expr); B32 need_new_spec = (!str8_match(str8(canvas_view->query_buffer, canvas_view->query_string_size), canvas_view_expr, 0) || - !md_tree_match(canvas_view_node->initial_params, block_ui_rule_root, 0)); + !md_tree_match(canvas_view_node->initial_params, ui_view_rule_params_root, 0)); if(need_new_spec) { arena_clear(canvas_view_node->initial_params_arena); - canvas_view_node->initial_params = md_tree_copy(canvas_view_node->initial_params_arena, block_ui_rule_root); - rd_view_equip_spec(canvas_view, canvas_view_spec, canvas_view_expr, block_ui_rule_root); + canvas_view_node->initial_params = md_tree_copy(canvas_view_node->initial_params_arena, ui_view_rule_params_root); + rd_view_equip_spec(canvas_view, ui_view_rule_info, canvas_view_expr, ui_view_rule_params_root); } Vec2F32 canvas_dim = v2f32(scroll_list_params.dim_px.x - ui_top_font_size()*1.5f, (row->skipped_size_in_rows+row->size_in_rows+row->chopped_size_in_rows)*scroll_list_params.row_height_px); @@ -2311,7 +2303,7 @@ rd_watch_view_build(RD_View *view, RD_WatchViewState *ewv, B32 modifiable, U32 d { rd_cmd(RD_CmdKind_OpenTab, .string = e_string_from_expr(scratch.arena, row->expr), - .params_tree = block_ui_rule_root); + .params_tree = ui_view_rule_params_root); } } @@ -2335,7 +2327,7 @@ rd_watch_view_build(RD_View *view, RD_WatchViewState *ewv, B32 modifiable, U32 d //- rjf: build UI_PermissionFlags(UI_PermissionFlag_Clicks|UI_PermissionFlag_ScrollX) { - canvas_view_spec->info.ui_hook(canvas_view, canvas_view->params_roots[canvas_view->params_read_gen%ArrayCount(canvas_view->params_roots)], str8(canvas_view->query_buffer, canvas_view->query_string_size), canvas_rect); + ui_view_rule_info->ui(canvas_view, str8(canvas_view->query_buffer, canvas_view->query_string_size), canvas_view->params_roots[canvas_view->params_read_gen%ArrayCount(canvas_view->params_roots)], canvas_rect); } //- rjf: pop interaction registers @@ -2347,7 +2339,7 @@ rd_watch_view_build(RD_View *view, RD_WatchViewState *ewv, B32 modifiable, U32 d //////////////////////// //- rjf: build non-canvas row contents // - if(block_ui_rule_spec == &rd_nil_view_rule_spec) UI_Parent(row_box) UI_HeightFill + if(row->block_kind != EV_BlockKind_Canvas) UI_Parent(row_box) UI_HeightFill { ////////////////////// //- rjf: draw start of cache lines in expansions @@ -2404,7 +2396,7 @@ rd_watch_view_build(RD_View *view, RD_WatchViewState *ewv, B32 modifiable, U32 d String8 cell_error_string = {0}; String8 cell_error_tooltip_string = {0}; RD_AutoCompListerFlags cell_autocomp_flags = 0; - RD_ViewRuleRowUIFunctionType *cell_ui_hook = 0; + RD_ViewRuleUIFunctionType *cell_ui_hook = 0; MD_Node *cell_ui_params = &md_nil_node; Vec4F32 cell_base_color = ui_top_palette()->text; RD_IconKind cell_icon = RD_IconKind_Null; @@ -2469,10 +2461,10 @@ rd_watch_view_build(RD_View *view, RD_WatchViewState *ewv, B32 modifiable, U32 d cell_error_tooltip_string = str8_lit("Could not read memory successfully."); } cell_autocomp_flags = RD_AutoCompListerFlag_Locals; - if(value_ui_rule_spec != &rd_nil_view_rule_spec && value_ui_rule_spec != 0) + if(ui_view_rule_info->flags & RD_ViewRuleInfoFlag_CanFillValueCell) { - cell_ui_hook = value_ui_rule_spec->info.row_ui; - cell_ui_params = value_ui_rule_root; + cell_ui_hook = ui_view_rule_info->ui; + cell_ui_params = ui_view_rule_params_root; } cell_can_edit = ev_type_key_is_editable(cell_eval.type_key); }break; @@ -2507,10 +2499,10 @@ rd_watch_view_build(RD_View *view, RD_WatchViewState *ewv, B32 modifiable, U32 d for(EV_ViewRuleNode *n = view_rules->first; n != 0; n = n->next) { EV_ViewRule *vr = &n->v; - RD_ViewRuleSpec *spec = rd_view_rule_spec_from_string(vr->root->string); - if(spec != &rd_nil_view_rule_spec && spec->info.flags & RD_ViewRuleSpecInfoFlag_RowUI) + RD_ViewRuleInfo *info = rd_view_rule_info_from_string(vr->root->string); + if(info->flags & RD_ViewRuleInfoFlag_CanFillValueCell && info->ui != 0) { - cell_ui_hook = spec->info.row_ui; + cell_ui_hook = info->ui; cell_ui_params = vr->root; } } @@ -2558,7 +2550,8 @@ rd_watch_view_build(RD_View *view, RD_WatchViewState *ewv, B32 modifiable, U32 d UI_Parent(box) { String8 row_expr = e_string_from_expr(scratch.arena, row->expr); - cell_ui_hook(row->key, cell_ui_params, row_expr); + // TODO(rjf): @msgs + // cell_ui_hook(row->key, cell_ui_params, row_expr); } sig = ui_signal_from_box(box); } @@ -2848,12 +2841,12 @@ rd_watch_view_build(RD_View *view, RD_WatchViewState *ewv, B32 modifiable, U32 d //////////////////////////////// //~ rjf: null @view_hook_impl -RD_VIEW_UI_FUNCTION_DEF(null) {} +RD_VIEW_RULE_UI_FUNCTION_DEF(null) {} //////////////////////////////// //~ rjf: empty @view_hook_impl -RD_VIEW_UI_FUNCTION_DEF(empty) +RD_VIEW_RULE_UI_FUNCTION_DEF(empty) { ui_set_next_flags(UI_BoxFlag_DefaultFocusNav); UI_Focus(UI_FocusKind_On) UI_WidthFill UI_HeightFill UI_NamedColumn(str8_lit("empty_view")) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) @@ -2878,7 +2871,7 @@ RD_VIEW_UI_FUNCTION_DEF(empty) //////////////////////////////// //~ rjf: getting_started @view_hook_impl -RD_VIEW_UI_FUNCTION_DEF(getting_started) +RD_VIEW_RULE_UI_FUNCTION_DEF(getting_started) { ProfBeginFunction(); Temp scratch = scratch_begin(0, 0); @@ -3143,7 +3136,7 @@ rd_cmd_lister_item_array_sort_by_strength__in_place(RD_CmdListerItemArray array) quick_sort(array.v, array.count, sizeof(RD_CmdListerItem), rd_qsort_compare_cmd_lister__strength); } -RD_VIEW_UI_FUNCTION_DEF(commands) +RD_VIEW_RULE_UI_FUNCTION_DEF(commands) { ProfBeginFunction(); Temp scratch = scratch_begin(0, 0); @@ -3466,7 +3459,7 @@ rd_qsort_compare_file_info__size(RD_FileInfo *a, RD_FileInfo *b) 0); } -RD_VIEW_UI_FUNCTION_DEF(file_system) +RD_VIEW_RULE_UI_FUNCTION_DEF(file_system) { ProfBeginFunction(); Temp scratch = scratch_begin(0, 0); @@ -4046,7 +4039,7 @@ rd_process_info_array_sort_by_strength__in_place(RD_ProcessInfoArray array) quick_sort(array.v, array.count, sizeof(RD_ProcessInfo), rd_qsort_compare_process_info); } -RD_VIEW_UI_FUNCTION_DEF(system_processes) +RD_VIEW_RULE_UI_FUNCTION_DEF(system_processes) { ProfBeginFunction(); Temp scratch = scratch_begin(0, 0); @@ -4295,7 +4288,7 @@ rd_entity_lister_item_array_sort_by_strength__in_place(RD_EntityListerItemArray quick_sort(array.v, array.count, sizeof(RD_EntityListerItem), rd_qsort_compare_entity_lister__strength); } -RD_VIEW_UI_FUNCTION_DEF(entity_lister) +RD_VIEW_RULE_UI_FUNCTION_DEF(entity_lister) { ProfBeginFunction(); Temp scratch = scratch_begin(0, 0); @@ -4421,7 +4414,7 @@ RD_VIEW_UI_FUNCTION_DEF(entity_lister) //////////////////////////////// //~ rjf: symbol_lister @view_hook_impl -RD_VIEW_UI_FUNCTION_DEF(symbol_lister) +RD_VIEW_RULE_UI_FUNCTION_DEF(symbol_lister) { ProfBeginFunction(); Temp scratch = scratch_begin(0, 0); @@ -4627,7 +4620,7 @@ struct RD_TargetViewState F32 value_pct; }; -RD_VIEW_UI_FUNCTION_DEF(target) +RD_VIEW_RULE_UI_FUNCTION_DEF(target) { ProfBeginFunction(); Temp scratch = scratch_begin(0, 0); @@ -4933,7 +4926,7 @@ RD_VIEW_UI_FUNCTION_DEF(target) //////////////////////////////// //~ rjf: targets @view_hook_impl -RD_VIEW_UI_FUNCTION_DEF(targets) +RD_VIEW_RULE_UI_FUNCTION_DEF(targets) { ProfBeginFunction(); Temp scratch = scratch_begin(0, 0); @@ -5099,7 +5092,7 @@ struct RD_FilePathMapViewState F32 dst_column_pct; }; -RD_VIEW_UI_FUNCTION_DEF(file_path_map) +RD_VIEW_RULE_UI_FUNCTION_DEF(file_path_map) { ProfBeginFunction(); Temp scratch = scratch_begin(0, 0); @@ -5416,12 +5409,12 @@ RD_VIEW_UI_FUNCTION_DEF(file_path_map) //////////////////////////////// //~ rjf: auto_view_rules @view_hook_impl -RD_VIEW_UI_FUNCTION_DEF(auto_view_rules){} +RD_VIEW_RULE_UI_FUNCTION_DEF(auto_view_rules){} //////////////////////////////// //~ rjf: breakpoints @view_hook_impl -RD_VIEW_UI_FUNCTION_DEF(breakpoints) +RD_VIEW_RULE_UI_FUNCTION_DEF(breakpoints) { ProfBeginFunction(); RD_WatchViewState *wv = rd_view_user_state(view, RD_WatchViewState); @@ -5441,7 +5434,7 @@ RD_VIEW_UI_FUNCTION_DEF(breakpoints) //////////////////////////////// //~ rjf: watch_pins @view_hook_impl -RD_VIEW_UI_FUNCTION_DEF(watch_pins) +RD_VIEW_RULE_UI_FUNCTION_DEF(watch_pins) { ProfBeginFunction(); RD_WatchViewState *wv = rd_view_user_state(view, RD_WatchViewState); @@ -5458,7 +5451,7 @@ RD_VIEW_UI_FUNCTION_DEF(watch_pins) //////////////////////////////// //~ rjf: scheduler @view_hook_impl -RD_VIEW_UI_FUNCTION_DEF(scheduler) +RD_VIEW_RULE_UI_FUNCTION_DEF(scheduler) { ProfBeginFunction(); Temp scratch = scratch_begin(0, 0); @@ -5680,7 +5673,7 @@ RD_VIEW_UI_FUNCTION_DEF(scheduler) //////////////////////////////// //~ rjf: call_stack @view_hook_impl -RD_VIEW_UI_FUNCTION_DEF(call_stack) +RD_VIEW_RULE_UI_FUNCTION_DEF(call_stack) { ProfBeginFunction(); RD_WatchViewState *wv = rd_view_user_state(view, RD_WatchViewState); @@ -5718,7 +5711,7 @@ struct RD_ModulesViewState }; #endif -RD_VIEW_UI_FUNCTION_DEF(modules) +RD_VIEW_RULE_UI_FUNCTION_DEF(modules) { #if 0 // TODO(rjf): @msgs RD_ModulesViewState *mv = rd_view_user_state(view, RD_ModulesViewState); @@ -6034,7 +6027,7 @@ RD_VIEW_UI_FUNCTION_DEF(modules) //////////////////////////////// //~ rjf: watch @view_hook_impl -RD_VIEW_UI_FUNCTION_DEF(watch) +RD_VIEW_RULE_UI_FUNCTION_DEF(watch) { ProfBeginFunction(); RD_WatchViewState *wv = rd_view_user_state(view, RD_WatchViewState); @@ -6053,7 +6046,7 @@ RD_VIEW_UI_FUNCTION_DEF(watch) //////////////////////////////// //~ rjf: locals @view_hook_impl -RD_VIEW_UI_FUNCTION_DEF(locals) +RD_VIEW_RULE_UI_FUNCTION_DEF(locals) { ProfBeginFunction(); RD_WatchViewState *wv = rd_view_user_state(view, RD_WatchViewState); @@ -6072,7 +6065,7 @@ RD_VIEW_UI_FUNCTION_DEF(locals) //////////////////////////////// //~ rjf: registers @view_hook_impl -RD_VIEW_UI_FUNCTION_DEF(registers) +RD_VIEW_RULE_UI_FUNCTION_DEF(registers) { ProfBeginFunction(); RD_WatchViewState *wv = rd_view_user_state(view, RD_WatchViewState); @@ -6091,7 +6084,7 @@ RD_VIEW_UI_FUNCTION_DEF(registers) //////////////////////////////// //~ rjf: globals @view_hook_impl -RD_VIEW_UI_FUNCTION_DEF(globals) +RD_VIEW_RULE_UI_FUNCTION_DEF(globals) { ProfBeginFunction(); RD_WatchViewState *wv = rd_view_user_state(view, RD_WatchViewState); @@ -6110,7 +6103,7 @@ RD_VIEW_UI_FUNCTION_DEF(globals) //////////////////////////////// //~ rjf: thread_locals @view_hook_impl -RD_VIEW_UI_FUNCTION_DEF(thread_locals) +RD_VIEW_RULE_UI_FUNCTION_DEF(thread_locals) { ProfBeginFunction(); RD_WatchViewState *wv = rd_view_user_state(view, RD_WatchViewState); @@ -6129,7 +6122,7 @@ RD_VIEW_UI_FUNCTION_DEF(thread_locals) //////////////////////////////// //~ rjf: types @view_hook_impl -RD_VIEW_UI_FUNCTION_DEF(types) +RD_VIEW_RULE_UI_FUNCTION_DEF(types) { ProfBeginFunction(); RD_WatchViewState *wv = rd_view_user_state(view, RD_WatchViewState); @@ -6148,7 +6141,7 @@ RD_VIEW_UI_FUNCTION_DEF(types) //////////////////////////////// //~ rjf: procedures @view_hook_impl -RD_VIEW_UI_FUNCTION_DEF(procedures) +RD_VIEW_RULE_UI_FUNCTION_DEF(procedures) { ProfBeginFunction(); RD_WatchViewState *wv = rd_view_user_state(view, RD_WatchViewState); @@ -6173,7 +6166,7 @@ struct RD_PendingFileViewState RD_CmdList deferred_cmds; }; -RD_VIEW_UI_FUNCTION_DEF(pending_file) +RD_VIEW_RULE_UI_FUNCTION_DEF(pending_file) { Temp scratch = scratch_begin(0, 0); RD_PendingFileViewState *pves = rd_view_user_state(view, RD_PendingFileViewState); @@ -6218,7 +6211,7 @@ RD_VIEW_UI_FUNCTION_DEF(pending_file) Rng1U64 file_range = r1u64(0, 1024); U128 file_hash = fs_hash_from_path_range(file_path, file_range, 0); B32 file_is_ready = 0; - RD_ViewKind viewer_kind = RD_ViewKind_Text; + RD_ViewRuleKind viewer_kind = RD_ViewRuleKind_Text; { HS_Scope *hs_scope = hs_scope_open(); String8 data = hs_data_from_hash(hs_scope, file_hash); @@ -6245,11 +6238,11 @@ RD_VIEW_UI_FUNCTION_DEF(pending_file) file_is_ready = 1; if(num_utf8_bytes > num_unknown_bytes*4) { - viewer_kind = RD_ViewKind_Text; + viewer_kind = RD_ViewRuleKind_Text; } else { - viewer_kind = RD_ViewKind_Memory; + viewer_kind = RD_ViewRuleKind_Memory; } } hs_scope_close(hs_scope); @@ -6275,19 +6268,19 @@ RD_VIEW_UI_FUNCTION_DEF(pending_file) } //- rjf: if entity is ready, replace this view with the correct one, if any viewer is specified - if(file_is_ready && viewer_kind != RD_ViewKind_Null) + if(file_is_ready && viewer_kind != RD_ViewRuleKind_Null) { - RD_ViewSpec *view_spec = rd_view_spec_from_string(params_copy->string); - if(view_spec == &rd_nil_view_spec) + RD_ViewRuleInfo *view_rule_info = rd_view_rule_info_from_string(params_copy->string); + if(view_rule_info == &rd_nil_view_rule_info) { - view_spec = rd_view_spec_from_kind(viewer_kind); + view_rule_info = rd_view_rule_info_from_kind(viewer_kind); } String8 query = rd_eval_string_from_file_path(scratch.arena, file_path); - rd_view_equip_spec(view, view_spec, query, params_copy); + rd_view_equip_spec(view, view_rule_info, query, params_copy); } //- rjf: if entity is ready, but we have no viewer for it, then just close this tab - if(file_is_ready && viewer_kind == RD_ViewKind_Null) + if(file_is_ready && viewer_kind == RD_ViewRuleKind_Null) { rd_cmd(RD_CmdKind_CloseTab); } @@ -6309,7 +6302,7 @@ EV_VIEW_RULE_BLOCK_PROD_FUNCTION_DEF(text) ev_block_end(out, vb); } -RD_VIEW_UI_FUNCTION_DEF(text) +RD_VIEW_RULE_UI_FUNCTION_DEF(text) { RD_CodeViewState *cv = rd_view_user_state(view, RD_CodeViewState); rd_code_view_init(cv, view); @@ -6551,7 +6544,7 @@ EV_VIEW_RULE_BLOCK_PROD_FUNCTION_DEF(disasm) ev_block_end(out, vb); } -RD_VIEW_UI_FUNCTION_DEF(disasm) +RD_VIEW_RULE_UI_FUNCTION_DEF(disasm) { RD_DisasmViewState *dv = rd_view_user_state(view, RD_DisasmViewState); if(dv->initialized == 0) @@ -6757,7 +6750,7 @@ RD_VIEW_UI_FUNCTION_DEF(disasm) //////////////////////////////// //~ rjf: output @view_hook_impl -RD_VIEW_UI_FUNCTION_DEF(output) +RD_VIEW_RULE_UI_FUNCTION_DEF(output) { RD_CodeViewState *cv = rd_view_user_state(view, RD_CodeViewState); rd_code_view_init(cv, view); @@ -6840,7 +6833,7 @@ EV_VIEW_RULE_BLOCK_PROD_FUNCTION_DEF(memory) ev_block_end(out, vb); } -RD_VIEW_UI_FUNCTION_DEF(memory) +RD_VIEW_RULE_UI_FUNCTION_DEF(memory) { ProfBeginFunction(); Temp scratch = scratch_begin(0, 0); @@ -6851,11 +6844,12 @@ RD_VIEW_UI_FUNCTION_DEF(memory) //- rjf: unpack parameterization info // E_Eval eval = e_eval_from_string(scratch.arena, string); + Rng1U64 space_range = rd_range_from_eval_params(eval, params); if(eval.space.kind == 0) { eval.space = rd_eval_space_from_ctrl_entity(ctrl_entity_from_handle(d_state->ctrl_entity_store, rd_regs()->process)); + space_range = rd_whole_range_from_eval_space(eval.space); } - Rng1U64 space_range = rd_whole_range_from_eval_space(eval.space); U64 cursor = rd_value_from_params_key(params, str8_lit("cursor_vaddr")).u64; U64 mark = rd_value_from_params_key(params, str8_lit("mark_vaddr")).u64; U64 bytes_per_cell = rd_value_from_params_key(params, str8_lit("bytes_per_cell")).u64; @@ -7374,7 +7368,7 @@ RD_VIEW_UI_FUNCTION_DEF(memory) { for(UI_Event *evt = 0; ui_next_event(&evt);) { - if(evt->kind == UI_EventKind_Scroll && evt->modifiers & OS_EventFlag_Ctrl) + if(evt->kind == UI_EventKind_Scroll && evt->modifiers & OS_Modifier_Ctrl) { ui_eat_event(evt); if(evt->delta_2f32.y < 0) @@ -7735,7 +7729,7 @@ EV_VIEW_RULE_BLOCK_PROD_FUNCTION_DEF(bitmap) ev_block_end(out, vb); } -RD_VIEW_UI_FUNCTION_DEF(bitmap) +RD_VIEW_RULE_UI_FUNCTION_DEF(bitmap) { Temp scratch = scratch_begin(0, 0); HS_Scope *hs_scope = hs_scope_open(); @@ -7938,7 +7932,7 @@ RD_VIEW_UI_FUNCTION_DEF(bitmap) //////////////////////////////// //~ rjf: "checkbox" -RD_VIEW_RULE_ROW_UI_FUNCTION_DEF(checkbox) +RD_VIEW_RULE_UI_FUNCTION_DEF(checkbox) { Temp scratch = scratch_begin(0, 0); E_Eval eval = e_eval_from_string(scratch.arena, string); @@ -7986,66 +7980,7 @@ EV_VIEW_RULE_BLOCK_PROD_FUNCTION_DEF(color_rgba) ev_block_end(out, vb); } -RD_VIEW_RULE_ROW_UI_FUNCTION_DEF(color_rgba) -{ - Temp scratch = scratch_begin(0, 0); - E_Eval eval = e_eval_from_string(scratch.arena, string); - Vec4F32 rgba = rd_rgba_from_eval_params(eval, params); - Vec4F32 hsva = hsva_from_rgba(rgba); - - //- rjf: build text box - UI_Box *text_box = &ui_nil_box; - UI_WidthFill RD_Font(RD_FontSlot_Code) - { - text_box = ui_build_box_from_key(UI_BoxFlag_DrawText, ui_key_zero()); - DR_FancyStringList fancy_strings = {0}; - { - DR_FancyString open_paren = {ui_top_font(), str8_lit("("), ui_top_palette()->text, ui_top_font_size(), 0, 0}; - DR_FancyString comma = {ui_top_font(), str8_lit(", "), ui_top_palette()->text, ui_top_font_size(), 0, 0}; - DR_FancyString r_fstr = {ui_top_font(), push_str8f(scratch.arena, "%.2f", rgba.x), v4f32(1.f, 0.25f, 0.25f, 1.f), ui_top_font_size(), 4.f, 0}; - DR_FancyString g_fstr = {ui_top_font(), push_str8f(scratch.arena, "%.2f", rgba.y), v4f32(0.25f, 1.f, 0.25f, 1.f), ui_top_font_size(), 4.f, 0}; - DR_FancyString b_fstr = {ui_top_font(), push_str8f(scratch.arena, "%.2f", rgba.z), v4f32(0.25f, 0.25f, 1.f, 1.f), ui_top_font_size(), 4.f, 0}; - DR_FancyString a_fstr = {ui_top_font(), push_str8f(scratch.arena, "%.2f", rgba.w), v4f32(1.f, 1.f, 1.f, 1.f), ui_top_font_size(), 4.f, 0}; - DR_FancyString clse_paren = {ui_top_font(), str8_lit(")"), ui_top_palette()->text, ui_top_font_size(), 0, 0}; - dr_fancy_string_list_push(scratch.arena, &fancy_strings, &open_paren); - dr_fancy_string_list_push(scratch.arena, &fancy_strings, &r_fstr); - dr_fancy_string_list_push(scratch.arena, &fancy_strings, &comma); - dr_fancy_string_list_push(scratch.arena, &fancy_strings, &g_fstr); - dr_fancy_string_list_push(scratch.arena, &fancy_strings, &comma); - dr_fancy_string_list_push(scratch.arena, &fancy_strings, &b_fstr); - dr_fancy_string_list_push(scratch.arena, &fancy_strings, &comma); - dr_fancy_string_list_push(scratch.arena, &fancy_strings, &a_fstr); - dr_fancy_string_list_push(scratch.arena, &fancy_strings, &clse_paren); - } - ui_box_equip_display_fancy_strings(text_box, &fancy_strings); - } - - //- rjf: build color box - UI_Box *color_box = &ui_nil_box; - UI_PrefWidth(ui_em(1.875f, 1.f)) UI_ChildLayoutAxis(Axis2_Y) - { - color_box = ui_build_box_from_stringf(UI_BoxFlag_Clickable, "color_box"); - UI_Parent(color_box) UI_PrefHeight(ui_em(1.875f, 1.f)) UI_Padding(ui_pct(1, 0)) - { - UI_Palette(ui_build_palette(ui_top_palette(), .background = rgba)) UI_CornerRadius(ui_top_font_size()*0.5f) - ui_build_box_from_key(UI_BoxFlag_DrawBackground|UI_BoxFlag_DrawBorder, ui_key_zero()); - } - } - - //- rjf: space - ui_spacer(ui_em(0.375f, 1.f)); - - //- rjf: hover color box -> show components - UI_Signal sig = ui_signal_from_box(color_box); - if(ui_hovering(sig)) - { - ui_do_color_tooltip_hsva(hsva); - } - - scratch_end(scratch); -} - -RD_VIEW_UI_FUNCTION_DEF(color_rgba) +RD_VIEW_RULE_UI_FUNCTION_DEF(color_rgba) { Temp scratch = scratch_begin(0, 0); Vec2F32 dim = dim_2f32(rect); @@ -8053,38 +7988,96 @@ RD_VIEW_UI_FUNCTION_DEF(color_rgba) E_Eval eval = e_eval_from_string(scratch.arena, string); Vec4F32 rgba = rd_rgba_from_eval_params(eval, params); Vec4F32 hsva = hsva_from_rgba(rgba); - UI_WidthFill UI_HeightFill UI_Column UI_Padding(ui_px(padding, 1.f)) UI_Row UI_Padding(ui_pct(1.f, 0.f)) UI_HeightFill + + //- rjf: too small -> just show components + if(dim.y <= ui_top_font_size()*8.f) { - UI_PrefWidth(ui_px(dim.y - padding*2, 1.f)) + //- rjf: build text box + UI_Box *text_box = &ui_nil_box; + UI_WidthFill RD_Font(RD_FontSlot_Code) { - UI_Signal sv_sig = ui_sat_val_pickerf(hsva.x, &hsva.y, &hsva.z, "sat_val_picker"); + text_box = ui_build_box_from_key(UI_BoxFlag_DrawText, ui_key_zero()); + DR_FancyStringList fancy_strings = {0}; + { + DR_FancyString open_paren = {ui_top_font(), str8_lit("("), ui_top_palette()->text, ui_top_font_size(), 0, 0}; + DR_FancyString comma = {ui_top_font(), str8_lit(", "), ui_top_palette()->text, ui_top_font_size(), 0, 0}; + DR_FancyString r_fstr = {ui_top_font(), push_str8f(scratch.arena, "%.2f", rgba.x), v4f32(1.f, 0.25f, 0.25f, 1.f), ui_top_font_size(), 4.f, 0}; + DR_FancyString g_fstr = {ui_top_font(), push_str8f(scratch.arena, "%.2f", rgba.y), v4f32(0.25f, 1.f, 0.25f, 1.f), ui_top_font_size(), 4.f, 0}; + DR_FancyString b_fstr = {ui_top_font(), push_str8f(scratch.arena, "%.2f", rgba.z), v4f32(0.25f, 0.25f, 1.f, 1.f), ui_top_font_size(), 4.f, 0}; + DR_FancyString a_fstr = {ui_top_font(), push_str8f(scratch.arena, "%.2f", rgba.w), v4f32(1.f, 1.f, 1.f, 1.f), ui_top_font_size(), 4.f, 0}; + DR_FancyString clse_paren = {ui_top_font(), str8_lit(")"), ui_top_palette()->text, ui_top_font_size(), 0, 0}; + dr_fancy_string_list_push(scratch.arena, &fancy_strings, &open_paren); + dr_fancy_string_list_push(scratch.arena, &fancy_strings, &r_fstr); + dr_fancy_string_list_push(scratch.arena, &fancy_strings, &comma); + dr_fancy_string_list_push(scratch.arena, &fancy_strings, &g_fstr); + dr_fancy_string_list_push(scratch.arena, &fancy_strings, &comma); + dr_fancy_string_list_push(scratch.arena, &fancy_strings, &b_fstr); + dr_fancy_string_list_push(scratch.arena, &fancy_strings, &comma); + dr_fancy_string_list_push(scratch.arena, &fancy_strings, &a_fstr); + dr_fancy_string_list_push(scratch.arena, &fancy_strings, &clse_paren); + } + ui_box_equip_display_fancy_strings(text_box, &fancy_strings); } - UI_PrefWidth(ui_em(3.f, 1.f)) + + //- rjf: build color box + UI_Box *color_box = &ui_nil_box; + UI_PrefWidth(ui_em(1.875f, 1.f)) UI_ChildLayoutAxis(Axis2_Y) { - UI_Signal h_sig = ui_hue_pickerf(&hsva.x, hsva.y, hsva.z, "hue_picker"); + color_box = ui_build_box_from_stringf(UI_BoxFlag_Clickable, "color_box"); + UI_Parent(color_box) UI_PrefHeight(ui_em(1.875f, 1.f)) UI_Padding(ui_pct(1, 0)) + { + UI_Palette(ui_build_palette(ui_top_palette(), .background = rgba)) UI_CornerRadius(ui_top_font_size()*0.5f) + ui_build_box_from_key(UI_BoxFlag_DrawBackground|UI_BoxFlag_DrawBorder, ui_key_zero()); + } } - UI_PrefWidth(ui_children_sum(1)) UI_Column UI_PrefWidth(ui_text_dim(10, 1)) UI_PrefHeight(ui_em(2.f, 0.f)) RD_Font(RD_FontSlot_Code) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) + + //- rjf: space + ui_spacer(ui_em(0.375f, 1.f)); + + //- rjf: hover color box -> show components + UI_Signal sig = ui_signal_from_box(color_box); + if(ui_hovering(sig)) { - ui_labelf("Hex"); - ui_labelf("R"); - ui_labelf("G"); - ui_labelf("B"); - ui_labelf("H"); - ui_labelf("S"); - ui_labelf("V"); - ui_labelf("A"); + ui_do_color_tooltip_hsva(hsva); } - UI_PrefWidth(ui_children_sum(1)) UI_Column UI_PrefWidth(ui_text_dim(10, 1)) UI_PrefHeight(ui_em(2.f, 0.f)) RD_Font(RD_FontSlot_Code) + } + + //- rjf: large enough -> full color picker + else + { + UI_WidthFill UI_HeightFill UI_Column UI_Padding(ui_px(padding, 1.f)) UI_Row UI_Padding(ui_pct(1.f, 0.f)) UI_HeightFill { - String8 hex_string = hex_string_from_rgba_4f32(scratch.arena, rgba); - ui_label(hex_string); - ui_labelf("%.2f", rgba.x); - ui_labelf("%.2f", rgba.y); - ui_labelf("%.2f", rgba.z); - ui_labelf("%.2f", hsva.x); - ui_labelf("%.2f", hsva.y); - ui_labelf("%.2f", hsva.z); - ui_labelf("%.2f", rgba.w); + UI_PrefWidth(ui_px(dim.y - padding*2, 1.f)) + { + UI_Signal sv_sig = ui_sat_val_pickerf(hsva.x, &hsva.y, &hsva.z, "sat_val_picker"); + } + UI_PrefWidth(ui_em(3.f, 1.f)) + { + UI_Signal h_sig = ui_hue_pickerf(&hsva.x, hsva.y, hsva.z, "hue_picker"); + } + UI_PrefWidth(ui_children_sum(1)) UI_Column UI_PrefWidth(ui_text_dim(10, 1)) UI_PrefHeight(ui_em(2.f, 0.f)) RD_Font(RD_FontSlot_Code) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) + { + ui_labelf("Hex"); + ui_labelf("R"); + ui_labelf("G"); + ui_labelf("B"); + ui_labelf("H"); + ui_labelf("S"); + ui_labelf("V"); + ui_labelf("A"); + } + UI_PrefWidth(ui_children_sum(1)) UI_Column UI_PrefWidth(ui_text_dim(10, 1)) UI_PrefHeight(ui_em(2.f, 0.f)) RD_Font(RD_FontSlot_Code) + { + String8 hex_string = hex_string_from_rgba_4f32(scratch.arena, rgba); + ui_label(hex_string); + ui_labelf("%.2f", rgba.x); + ui_labelf("%.2f", rgba.y); + ui_labelf("%.2f", rgba.z); + ui_labelf("%.2f", hsva.x); + ui_labelf("%.2f", hsva.y); + ui_labelf("%.2f", hsva.z); + ui_labelf("%.2f", rgba.w); + } } } scratch_end(scratch); @@ -8151,7 +8144,7 @@ EV_VIEW_RULE_BLOCK_PROD_FUNCTION_DEF(geo3d) ev_block_end(out, vb); } -RD_VIEW_UI_FUNCTION_DEF(geo3d) +RD_VIEW_RULE_UI_FUNCTION_DEF(geo3d) { Temp scratch = scratch_begin(0, 0); GEO_Scope *geo_scope = geo_scope_open(); @@ -8267,7 +8260,7 @@ RD_VIEW_UI_FUNCTION_DEF(geo3d) //////////////////////////////// //~ rjf: exception_filters @view_hook_impl -RD_VIEW_UI_FUNCTION_DEF(exception_filters) +RD_VIEW_RULE_UI_FUNCTION_DEF(exception_filters) { ProfBeginFunction(); Temp scratch = scratch_begin(0, 0); @@ -8474,7 +8467,7 @@ rd_qsort_compare_settings_item(RD_SettingsItem *a, RD_SettingsItem *b) return result; } -RD_VIEW_UI_FUNCTION_DEF(settings) +RD_VIEW_RULE_UI_FUNCTION_DEF(settings) { ProfBeginFunction(); Temp scratch = scratch_begin(0, 0); diff --git a/src/raddbg/raddbg_widgets.c b/src/raddbg/raddbg_widgets.c index 7bad8bf2..12595855 100644 --- a/src/raddbg/raddbg_widgets.c +++ b/src/raddbg/raddbg_widgets.c @@ -104,7 +104,7 @@ rd_cmd_binding_buttons(String8 name) B32 rebinding_active_for_this_binding = (rd_state->bind_change_active && str8_match(rd_state->bind_change_cmd_name, name, 0) && rd_state->bind_change_binding.key == binding.key && - rd_state->bind_change_binding.flags == binding.flags); + rd_state->bind_change_binding.modifiers == binding.modifiers); //- rjf: grab all conflicts String8List specs_with_binding = rd_cmd_name_list_from_binding(scratch.arena, binding); @@ -123,7 +123,7 @@ rd_cmd_binding_buttons(String8 name) { if(binding.key != OS_Key_Null) { - String8List mods = os_string_list_from_event_flags(scratch.arena, binding.flags); + String8List mods = os_string_list_from_modifiers(scratch.arena, binding.modifiers); String8 key = os_g_key_display_string_table[binding.key]; str8_list_push(scratch.arena, &mods, key); StringJoin join = {0}; @@ -167,7 +167,7 @@ rd_cmd_binding_buttons(String8 name) UI_BoxFlag_DrawHotEffects| UI_BoxFlag_DrawBorder| UI_BoxFlag_DrawBackground, - "%S###bind_btn_%S_%x_%x", keybinding_str, name, binding.key, binding.flags); + "%S###bind_btn_%S_%x_%x", keybinding_str, name, binding.key, binding.modifiers); //- rjf: interaction UI_Signal sig = ui_signal_from_box(box); @@ -175,7 +175,7 @@ rd_cmd_binding_buttons(String8 name) // rjf: click => toggle activity if(!rd_state->bind_change_active && ui_clicked(sig)) { - if((binding.key == OS_Key_Esc || binding.key == OS_Key_Delete) && binding.flags == 0) + if((binding.key == OS_Key_Esc || binding.key == OS_Key_Delete) && binding.modifiers == 0) { log_user_error(str8_lit("Cannot rebind; this command uses a reserved keybinding.")); } @@ -235,7 +235,7 @@ rd_cmd_binding_buttons(String8 name) B32 adding_new_binding = (rd_state->bind_change_active && str8_match(rd_state->bind_change_cmd_name, name, 0) && rd_state->bind_change_binding.key == OS_Key_Null && - rd_state->bind_change_binding.flags == 0); + rd_state->bind_change_binding.modifiers == 0); if(adding_new_binding) { palette = ui_build_palette(ui_top_palette()); @@ -960,7 +960,7 @@ rd_code_slice(RD_CodeSliceParams *params, TxtPt *cursor, TxtPt *mark, S64 *prefe CTRL_Event stop_event = d_ctrl_last_stop_event(); CTRL_Entity *stopper_thread = ctrl_entity_from_handle(d_state->ctrl_entity_store, stop_event.entity); B32 is_focused = ui_is_focus_active(); - B32 ctrlified = (os_get_event_flags() & OS_EventFlag_Ctrl); + B32 ctrlified = (os_get_modifiers() & OS_Modifier_Ctrl); Vec4F32 code_line_bgs[] = { rd_rgba_from_theme_color(RD_ThemeColor_LineInfoBackground0), diff --git a/src/ui/ui_core.c b/src/ui/ui_core.c index f9e44839..94997a8a 100644 --- a/src/ui/ui_core.c +++ b/src/ui/ui_core.c @@ -554,11 +554,11 @@ ui_next_event(UI_Event **ev) { good = 0; } - if(!(perms & UI_PermissionFlag_ScrollX) && (n->v.kind == UI_EventKind_Scroll) && (n->v.delta_2f32.x != 0 || n->v.modifiers & OS_EventFlag_Shift)) + if(!(perms & UI_PermissionFlag_ScrollX) && (n->v.kind == UI_EventKind_Scroll) && (n->v.delta_2f32.x != 0 || n->v.modifiers & OS_Modifier_Shift)) { good = 0; } - if(!(perms & UI_PermissionFlag_ScrollY) && (n->v.kind == UI_EventKind_Scroll) && n->v.delta_2f32.y != 0 && !(n->v.modifiers & OS_EventFlag_Shift)) + if(!(perms & UI_PermissionFlag_ScrollY) && (n->v.kind == UI_EventKind_Scroll) && n->v.delta_2f32.y != 0 && !(n->v.modifiers & OS_Modifier_Shift)) { good = 0; } @@ -599,7 +599,7 @@ ui_eat_event(UI_Event *ev) //- rjf: event consumption helpers internal B32 -ui_key_press(OS_EventFlags mods, OS_Key key) +ui_key_press(OS_Modifiers mods, OS_Key key) { B32 result = 0; for(UI_Event *evt = 0; ui_next_event(&evt);) @@ -615,7 +615,7 @@ ui_key_press(OS_EventFlags mods, OS_Key key) } internal B32 -ui_key_release(OS_EventFlags mods, OS_Key key) +ui_key_release(OS_Modifiers mods, OS_Key key) { B32 result = 0; for(UI_Event *evt = 0; ui_next_event(&evt);) @@ -875,7 +875,7 @@ ui_begin_build(OS_Handle window, UI_EventList *events, UI_IconInfo *icon_info, U { nav_next = 1; } - if(ui_key_press(OS_EventFlag_Shift, OS_Key_Tab)) + if(ui_key_press(OS_Modifier_Shift, OS_Key_Tab)) { nav_prev = 1; } @@ -2541,7 +2541,7 @@ ui_signal_from_box(UI_Box *box) ProfBeginFunction(); B32 is_focus_hot = box->flags & UI_BoxFlag_FocusHot && !(box->flags & UI_BoxFlag_FocusHotDisabled); UI_Signal sig = {box}; - sig.event_flags |= os_get_event_flags(); + sig.event_flags |= os_get_modifiers(); ////////////////////////////// //- rjf: calculate possibly-clipped box rectangle @@ -2712,11 +2712,11 @@ ui_signal_from_box(UI_Box *box) //- rjf: scrolling if(box->flags & UI_BoxFlag_Scroll && evt->kind == UI_EventKind_Scroll && - evt->modifiers != OS_EventFlag_Ctrl && + evt->modifiers != OS_Modifier_Ctrl && evt_mouse_in_bounds) { Vec2F32 delta = evt->delta_2f32; - if(evt->modifiers & OS_EventFlag_Shift) + if(evt->modifiers & OS_Modifier_Shift) { Swap(F32, delta.x, delta.y); } @@ -2733,11 +2733,11 @@ ui_signal_from_box(UI_Box *box) //- rjf: view scrolling if(box->flags & UI_BoxFlag_ViewScroll && box->first_touched_build_index != box->last_touched_build_index && evt->kind == UI_EventKind_Scroll && - evt->modifiers != OS_EventFlag_Ctrl && + evt->modifiers != OS_Modifier_Ctrl && evt_mouse_in_bounds) { Vec2F32 delta = evt->delta_2f32; - if(evt->modifiers & OS_EventFlag_Shift) + if(evt->modifiers & OS_Modifier_Shift) { Swap(F32, delta.x, delta.y); } diff --git a/src/ui/ui_core.h b/src/ui/ui_core.h index e5ad02fe..76432d51 100644 --- a/src/ui/ui_core.h +++ b/src/ui/ui_core.h @@ -140,7 +140,7 @@ struct UI_Event UI_EventFlags flags; UI_EventDeltaUnit delta_unit; OS_Key key; - OS_EventFlags modifiers; + OS_Modifiers modifiers; String8 string; String8List paths; Vec2F32 pos; @@ -547,7 +547,7 @@ typedef struct UI_Signal UI_Signal; struct UI_Signal { UI_Box *box; - OS_EventFlags event_flags; + OS_Modifiers event_flags; Vec2S16 scroll; UI_SignalFlags f; }; @@ -795,8 +795,8 @@ internal B32 ui_next_event(UI_Event **ev); internal void ui_eat_event(UI_Event *ev); //- rjf: event consumption helpers -internal B32 ui_key_press(OS_EventFlags mods, OS_Key key); -internal B32 ui_key_release(OS_EventFlags mods, OS_Key key); +internal B32 ui_key_press(OS_Modifiers mods, OS_Key key); +internal B32 ui_key_release(OS_Modifiers mods, OS_Key key); internal B32 ui_text(U32 character); internal B32 ui_slot_press(UI_EventActionSlot slot);