diff --git a/src/dbg_engine/dbg_engine.mdesk b/src/dbg_engine/dbg_engine.mdesk index 362f8e27..c0bf0f28 100644 --- a/src/dbg_engine/dbg_engine.mdesk +++ b/src/dbg_engine/dbg_engine.mdesk @@ -59,6 +59,11 @@ D_EntityKindTable: {WorkingDirectory working_directory working_directories 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 1 0 "Execution Path" Null "Working Directory" } {EntryPoint entry_point entry_points 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 1 0 "Symbol Name" Null "Entry Point" } + //- rjf: view containers (windows, panels, views) + {Window window windows 1 0 0 0 0 0 1 1 1 1 1 0 0 0 0 0 0 1 1 "Label" Window "Window" } + {Panel panel panels 1 0 0 0 0 0 1 1 1 1 1 0 0 0 0 0 0 1 1 "Label" XSplit "Panel" } + {View view views 1 0 0 0 0 0 1 1 1 1 1 0 0 0 0 0 0 1 1 "Label" Null "View" } + //- rjf: recent projects {RecentProject recent_project recent_projects 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 1 0 1 "Path" Briefcase "Recent Project" } diff --git a/src/dbg_engine/dbg_engine_core.h b/src/dbg_engine/dbg_engine_core.h index 5b24f006..601e6639 100644 --- a/src/dbg_engine/dbg_engine_core.h +++ b/src/dbg_engine/dbg_engine_core.h @@ -333,7 +333,6 @@ struct D_Entity B32 disabled; U64 u64; Vec4F32 color_hsva; - F32 life_left; D_CfgSrc cfg_src; U64 timestamp; @@ -1539,6 +1538,7 @@ internal D_InteractRegs *d_interact_regs(void); internal D_InteractRegs *d_base_interact_regs(void); internal D_InteractRegs *d_push_interact_regs(void); internal D_InteractRegs *d_pop_interact_regs(void); +#define D_InteractRegsScope DeferLoop(d_push_interact_regs(), d_pop_interact_regs()) //- rjf: undo/redo history internal D_StateDeltaHistory *d_state_delta_history(void); @@ -1585,13 +1585,13 @@ internal E_String2NumMap *d_query_cached_member_map_from_dbgi_key_voff(DI_Key *d internal void d_push_cmd(D_CmdSpec *spec, D_CmdParams *params); internal void d_error(String8 string); internal void d_errorf(char *fmt, ...); -#define d_cmd(kind, ...) d_push_cmd(d_cmd_spec_from_kind(kind),\ -&(D_CmdParams)\ -{\ +#define d_cmd(kind, ...) d_push_cmd(d_cmd_spec_from_kind(kind), \ +&(D_CmdParams) \ +{ \ .window = d_interact_regs()->window, \ -.panel = d_interact_regs()->panel, \ -.view = d_interact_regs()->view, \ -__VA_ARGS__\ +.panel = d_interact_regs()->panel, \ +.view = d_interact_regs()->view, \ +__VA_ARGS__ \ }) //////////////////////////////// diff --git a/src/dbg_engine/generated/dbg_engine.meta.c b/src/dbg_engine/generated/dbg_engine.meta.c index b760ae22..a3068fc6 100644 --- a/src/dbg_engine/generated/dbg_engine.meta.c +++ b/src/dbg_engine/generated/dbg_engine.meta.c @@ -32,7 +32,7 @@ Rng1U64 d_cmd_param_slot_range_table[24] = {OffsetOf(D_CmdParams, inline_depth), OffsetOf(D_CmdParams, inline_depth) + sizeof(U64)}, }; -String8 d_entity_kind_display_string_table[28] = +String8 d_entity_kind_display_string_table[31] = { str8_lit_comp("Nil"), str8_lit_comp("Root"), @@ -51,6 +51,9 @@ str8_lit_comp("Executable"), str8_lit_comp("Arguments"), str8_lit_comp("Working Directory"), str8_lit_comp("Entry Point"), +str8_lit_comp("Window"), +str8_lit_comp("Panel"), +str8_lit_comp("View"), str8_lit_comp("Recent Project"), str8_lit_comp("Source"), str8_lit_comp("Destination"), @@ -64,7 +67,7 @@ str8_lit_comp("Conversion Failure"), str8_lit_comp("EndedProcess"), }; -String8 d_entity_kind_name_lower_table[28] = +String8 d_entity_kind_name_lower_table[31] = { str8_lit_comp("nil"), str8_lit_comp("root"), @@ -83,6 +86,9 @@ str8_lit_comp("executable"), str8_lit_comp("arguments"), str8_lit_comp("working_directory"), str8_lit_comp("entry_point"), +str8_lit_comp("window"), +str8_lit_comp("panel"), +str8_lit_comp("view"), str8_lit_comp("recent_project"), str8_lit_comp("source"), str8_lit_comp("dest"), @@ -96,7 +102,7 @@ str8_lit_comp("conversion_fail"), str8_lit_comp("ended_process"), }; -String8 d_entity_kind_name_lower_plural_table[28] = +String8 d_entity_kind_name_lower_plural_table[31] = { str8_lit_comp("nils"), str8_lit_comp("roots"), @@ -115,6 +121,9 @@ str8_lit_comp("executables"), str8_lit_comp("argumentses"), str8_lit_comp("working_directories"), str8_lit_comp("entry_points"), +str8_lit_comp("windows"), +str8_lit_comp("panels"), +str8_lit_comp("views"), str8_lit_comp("recent_projects"), str8_lit_comp("sources"), str8_lit_comp("dests"), @@ -128,7 +137,7 @@ str8_lit_comp("conversion_fails"), str8_lit_comp("ended_processes"), }; -String8 d_entity_kind_name_label_table[28] = +String8 d_entity_kind_name_label_table[31] = { str8_lit_comp("Label"), str8_lit_comp("Label"), @@ -147,6 +156,9 @@ str8_lit_comp("Executable"), str8_lit_comp("Arguments"), str8_lit_comp("Execution Path"), str8_lit_comp("Symbol Name"), +str8_lit_comp("Label"), +str8_lit_comp("Label"), +str8_lit_comp("Label"), str8_lit_comp("Path"), str8_lit_comp("Path"), str8_lit_comp("Path"), @@ -160,7 +172,7 @@ str8_lit_comp("Label"), str8_lit_comp("Label"), }; -D_EntityKindFlags d_entity_kind_flags_table[28] = +D_EntityKindFlags d_entity_kind_flags_table[31] = { (0*D_EntityKindFlag_CanDelete) | (0*D_EntityKindFlag_CanFreeze) | (0*D_EntityKindFlag_CanEdit) | (0*D_EntityKindFlag_CanRename) | (0*D_EntityKindFlag_CanEnable) | (0*D_EntityKindFlag_CanCondition) | (0*D_EntityKindFlag_CanDuplicate) | (0*D_EntityKindFlag_LeafMutUserConfig | 0*D_EntityKindFlag_LeafMutProjectConfig | 0*D_EntityKindFlag_LeafMutSoftHalt | 0*D_EntityKindFlag_LeafMutDebugInfoMap | 0*D_EntityKindFlag_TreeMutUserConfig | 0*D_EntityKindFlag_TreeMutProjectConfig | 0*D_EntityKindFlag_TreeMutSoftHalt | 0*D_EntityKindFlag_TreeMutDebugInfoMap | 0*D_EntityKindFlag_NameIsCode | 0*D_EntityKindFlag_NameIsPath | 0*D_EntityKindFlag_UserDefinedLifetime) | 0*D_EntityKindFlag_IsSerializedToConfig, (0*D_EntityKindFlag_CanDelete) | (0*D_EntityKindFlag_CanFreeze) | (0*D_EntityKindFlag_CanEdit) | (0*D_EntityKindFlag_CanRename) | (0*D_EntityKindFlag_CanEnable) | (0*D_EntityKindFlag_CanCondition) | (0*D_EntityKindFlag_CanDuplicate) | (0*D_EntityKindFlag_LeafMutUserConfig | 0*D_EntityKindFlag_LeafMutProjectConfig | 0*D_EntityKindFlag_LeafMutSoftHalt | 0*D_EntityKindFlag_LeafMutDebugInfoMap | 0*D_EntityKindFlag_TreeMutUserConfig | 0*D_EntityKindFlag_TreeMutProjectConfig | 0*D_EntityKindFlag_TreeMutSoftHalt | 0*D_EntityKindFlag_TreeMutDebugInfoMap | 0*D_EntityKindFlag_NameIsCode | 0*D_EntityKindFlag_NameIsPath | 0*D_EntityKindFlag_UserDefinedLifetime) | 0*D_EntityKindFlag_IsSerializedToConfig, @@ -179,6 +191,9 @@ D_EntityKindFlags d_entity_kind_flags_table[28] = (0*D_EntityKindFlag_CanDelete) | (0*D_EntityKindFlag_CanFreeze) | (0*D_EntityKindFlag_CanEdit) | (0*D_EntityKindFlag_CanRename) | (0*D_EntityKindFlag_CanEnable) | (0*D_EntityKindFlag_CanCondition) | (0*D_EntityKindFlag_CanDuplicate) | (0*D_EntityKindFlag_LeafMutUserConfig | 1*D_EntityKindFlag_LeafMutProjectConfig | 0*D_EntityKindFlag_LeafMutSoftHalt | 0*D_EntityKindFlag_LeafMutDebugInfoMap | 0*D_EntityKindFlag_TreeMutUserConfig | 0*D_EntityKindFlag_TreeMutProjectConfig | 0*D_EntityKindFlag_TreeMutSoftHalt | 0*D_EntityKindFlag_TreeMutDebugInfoMap | 0*D_EntityKindFlag_NameIsCode | 0*D_EntityKindFlag_NameIsPath | 1*D_EntityKindFlag_UserDefinedLifetime) | 0*D_EntityKindFlag_IsSerializedToConfig, (0*D_EntityKindFlag_CanDelete) | (0*D_EntityKindFlag_CanFreeze) | (0*D_EntityKindFlag_CanEdit) | (0*D_EntityKindFlag_CanRename) | (0*D_EntityKindFlag_CanEnable) | (0*D_EntityKindFlag_CanCondition) | (0*D_EntityKindFlag_CanDuplicate) | (0*D_EntityKindFlag_LeafMutUserConfig | 1*D_EntityKindFlag_LeafMutProjectConfig | 0*D_EntityKindFlag_LeafMutSoftHalt | 0*D_EntityKindFlag_LeafMutDebugInfoMap | 0*D_EntityKindFlag_TreeMutUserConfig | 0*D_EntityKindFlag_TreeMutProjectConfig | 0*D_EntityKindFlag_TreeMutSoftHalt | 0*D_EntityKindFlag_TreeMutDebugInfoMap | 0*D_EntityKindFlag_NameIsCode | 1*D_EntityKindFlag_NameIsPath | 1*D_EntityKindFlag_UserDefinedLifetime) | 0*D_EntityKindFlag_IsSerializedToConfig, (0*D_EntityKindFlag_CanDelete) | (0*D_EntityKindFlag_CanFreeze) | (0*D_EntityKindFlag_CanEdit) | (0*D_EntityKindFlag_CanRename) | (0*D_EntityKindFlag_CanEnable) | (0*D_EntityKindFlag_CanCondition) | (0*D_EntityKindFlag_CanDuplicate) | (0*D_EntityKindFlag_LeafMutUserConfig | 1*D_EntityKindFlag_LeafMutProjectConfig | 1*D_EntityKindFlag_LeafMutSoftHalt | 0*D_EntityKindFlag_LeafMutDebugInfoMap | 0*D_EntityKindFlag_TreeMutUserConfig | 0*D_EntityKindFlag_TreeMutProjectConfig | 0*D_EntityKindFlag_TreeMutSoftHalt | 0*D_EntityKindFlag_TreeMutDebugInfoMap | 0*D_EntityKindFlag_NameIsCode | 0*D_EntityKindFlag_NameIsPath | 1*D_EntityKindFlag_UserDefinedLifetime) | 0*D_EntityKindFlag_IsSerializedToConfig, +(1*D_EntityKindFlag_CanDelete) | (0*D_EntityKindFlag_CanFreeze) | (0*D_EntityKindFlag_CanEdit) | (0*D_EntityKindFlag_CanRename) | (0*D_EntityKindFlag_CanEnable) | (0*D_EntityKindFlag_CanCondition) | (1*D_EntityKindFlag_CanDuplicate) | (1*D_EntityKindFlag_LeafMutUserConfig | 1*D_EntityKindFlag_LeafMutProjectConfig | 0*D_EntityKindFlag_LeafMutSoftHalt | 0*D_EntityKindFlag_LeafMutDebugInfoMap | 1*D_EntityKindFlag_TreeMutUserConfig | 1*D_EntityKindFlag_TreeMutProjectConfig | 0*D_EntityKindFlag_TreeMutSoftHalt | 0*D_EntityKindFlag_TreeMutDebugInfoMap | 0*D_EntityKindFlag_NameIsCode | 0*D_EntityKindFlag_NameIsPath | 1*D_EntityKindFlag_UserDefinedLifetime) | 1*D_EntityKindFlag_IsSerializedToConfig, +(1*D_EntityKindFlag_CanDelete) | (0*D_EntityKindFlag_CanFreeze) | (0*D_EntityKindFlag_CanEdit) | (0*D_EntityKindFlag_CanRename) | (0*D_EntityKindFlag_CanEnable) | (0*D_EntityKindFlag_CanCondition) | (1*D_EntityKindFlag_CanDuplicate) | (1*D_EntityKindFlag_LeafMutUserConfig | 1*D_EntityKindFlag_LeafMutProjectConfig | 0*D_EntityKindFlag_LeafMutSoftHalt | 0*D_EntityKindFlag_LeafMutDebugInfoMap | 1*D_EntityKindFlag_TreeMutUserConfig | 1*D_EntityKindFlag_TreeMutProjectConfig | 0*D_EntityKindFlag_TreeMutSoftHalt | 0*D_EntityKindFlag_TreeMutDebugInfoMap | 0*D_EntityKindFlag_NameIsCode | 0*D_EntityKindFlag_NameIsPath | 1*D_EntityKindFlag_UserDefinedLifetime) | 1*D_EntityKindFlag_IsSerializedToConfig, +(1*D_EntityKindFlag_CanDelete) | (0*D_EntityKindFlag_CanFreeze) | (0*D_EntityKindFlag_CanEdit) | (0*D_EntityKindFlag_CanRename) | (0*D_EntityKindFlag_CanEnable) | (0*D_EntityKindFlag_CanCondition) | (1*D_EntityKindFlag_CanDuplicate) | (1*D_EntityKindFlag_LeafMutUserConfig | 1*D_EntityKindFlag_LeafMutProjectConfig | 0*D_EntityKindFlag_LeafMutSoftHalt | 0*D_EntityKindFlag_LeafMutDebugInfoMap | 1*D_EntityKindFlag_TreeMutUserConfig | 1*D_EntityKindFlag_TreeMutProjectConfig | 0*D_EntityKindFlag_TreeMutSoftHalt | 0*D_EntityKindFlag_TreeMutDebugInfoMap | 0*D_EntityKindFlag_NameIsCode | 0*D_EntityKindFlag_NameIsPath | 1*D_EntityKindFlag_UserDefinedLifetime) | 1*D_EntityKindFlag_IsSerializedToConfig, (0*D_EntityKindFlag_CanDelete) | (0*D_EntityKindFlag_CanFreeze) | (0*D_EntityKindFlag_CanEdit) | (0*D_EntityKindFlag_CanRename) | (0*D_EntityKindFlag_CanEnable) | (0*D_EntityKindFlag_CanCondition) | (0*D_EntityKindFlag_CanDuplicate) | (1*D_EntityKindFlag_LeafMutUserConfig | 0*D_EntityKindFlag_LeafMutProjectConfig | 0*D_EntityKindFlag_LeafMutSoftHalt | 0*D_EntityKindFlag_LeafMutDebugInfoMap | 1*D_EntityKindFlag_TreeMutUserConfig | 0*D_EntityKindFlag_TreeMutProjectConfig | 0*D_EntityKindFlag_TreeMutSoftHalt | 0*D_EntityKindFlag_TreeMutDebugInfoMap | 0*D_EntityKindFlag_NameIsCode | 1*D_EntityKindFlag_NameIsPath | 0*D_EntityKindFlag_UserDefinedLifetime) | 1*D_EntityKindFlag_IsSerializedToConfig, (0*D_EntityKindFlag_CanDelete) | (0*D_EntityKindFlag_CanFreeze) | (0*D_EntityKindFlag_CanEdit) | (0*D_EntityKindFlag_CanRename) | (0*D_EntityKindFlag_CanEnable) | (0*D_EntityKindFlag_CanCondition) | (0*D_EntityKindFlag_CanDuplicate) | (0*D_EntityKindFlag_LeafMutUserConfig | 0*D_EntityKindFlag_LeafMutProjectConfig | 0*D_EntityKindFlag_LeafMutSoftHalt | 0*D_EntityKindFlag_LeafMutDebugInfoMap | 0*D_EntityKindFlag_TreeMutUserConfig | 0*D_EntityKindFlag_TreeMutProjectConfig | 0*D_EntityKindFlag_TreeMutSoftHalt | 0*D_EntityKindFlag_TreeMutDebugInfoMap | 0*D_EntityKindFlag_NameIsCode | 0*D_EntityKindFlag_NameIsPath | 0*D_EntityKindFlag_UserDefinedLifetime) | 0*D_EntityKindFlag_IsSerializedToConfig, (0*D_EntityKindFlag_CanDelete) | (0*D_EntityKindFlag_CanFreeze) | (0*D_EntityKindFlag_CanEdit) | (0*D_EntityKindFlag_CanRename) | (0*D_EntityKindFlag_CanEnable) | (0*D_EntityKindFlag_CanCondition) | (0*D_EntityKindFlag_CanDuplicate) | (0*D_EntityKindFlag_LeafMutUserConfig | 0*D_EntityKindFlag_LeafMutProjectConfig | 0*D_EntityKindFlag_LeafMutSoftHalt | 0*D_EntityKindFlag_LeafMutDebugInfoMap | 0*D_EntityKindFlag_TreeMutUserConfig | 0*D_EntityKindFlag_TreeMutProjectConfig | 0*D_EntityKindFlag_TreeMutSoftHalt | 0*D_EntityKindFlag_TreeMutDebugInfoMap | 0*D_EntityKindFlag_NameIsCode | 0*D_EntityKindFlag_NameIsPath | 0*D_EntityKindFlag_UserDefinedLifetime) | 0*D_EntityKindFlag_IsSerializedToConfig, diff --git a/src/dbg_engine/generated/dbg_engine.meta.h b/src/dbg_engine/generated/dbg_engine.meta.h index eb12a40d..25a37882 100644 --- a/src/dbg_engine/generated/dbg_engine.meta.h +++ b/src/dbg_engine/generated/dbg_engine.meta.h @@ -34,6 +34,9 @@ D_EntityKind_Executable, D_EntityKind_Arguments, D_EntityKind_WorkingDirectory, D_EntityKind_EntryPoint, +D_EntityKind_Window, +D_EntityKind_Panel, +D_EntityKind_View, D_EntityKind_RecentProject, D_EntityKind_Source, D_EntityKind_Dest, @@ -397,11 +400,11 @@ struct {B32 *value_ptr; String8 name;} DEV_toggle_table[] = }; C_LINKAGE_BEGIN extern Rng1U64 d_cmd_param_slot_range_table[24]; -extern String8 d_entity_kind_display_string_table[28]; -extern String8 d_entity_kind_name_lower_table[28]; -extern String8 d_entity_kind_name_lower_plural_table[28]; -extern String8 d_entity_kind_name_label_table[28]; -extern D_EntityKindFlags d_entity_kind_flags_table[28]; +extern String8 d_entity_kind_display_string_table[31]; +extern String8 d_entity_kind_name_lower_table[31]; +extern String8 d_entity_kind_name_lower_plural_table[31]; +extern String8 d_entity_kind_name_label_table[31]; +extern D_EntityKindFlags d_entity_kind_flags_table[31]; extern String8 d_cfg_src_string_table[4]; extern D_CmdKind d_cfg_src_load_cmd_kind_table[4]; extern D_CmdKind d_cfg_src_write_cmd_kind_table[4]; diff --git a/src/dbg_frontend/dbg_frontend_core.c b/src/dbg_frontend/dbg_frontend_core.c index 8af73079..08d0b7b7 100644 --- a/src/dbg_frontend/dbg_frontend_core.c +++ b/src/dbg_frontend/dbg_frontend_core.c @@ -166,14 +166,6 @@ df_ui_key_from_panel(DF_Panel *panel) return panel_key; } -//- rjf: panel tree mutation notification - -internal void -df_panel_notify_mutation(DF_Window *window, DF_Panel *panel) -{ - d_cmd(d_cfg_src_write_cmd_kind_table[window->cfg_src]); -} - //- rjf: tree construction internal void @@ -819,7 +811,7 @@ df_view_release(DF_View *view) //- rjf: equipment internal void -df_view_equip_spec(DF_Window *window, DF_View *view, DF_ViewSpec *spec, String8 query, MD_Node *params) +df_view_equip_spec(DF_View *view, DF_ViewSpec *spec, String8 query, MD_Node *params) { // rjf: fill params tree for(U64 idx = 0; idx < ArrayCount(view->params_arenas); idx += 1) @@ -864,7 +856,7 @@ df_view_equip_spec(DF_Window *window, DF_View *view, DF_ViewSpec *spec, String8 } view->is_filtering = 0; view->is_filtering_t = 0; - view_setup(window, view, view->params_roots[view->params_read_gen%ArrayCount(view->params_roots)], str8(view->query_buffer, view->query_string_size)); + view_setup(view, view->params_roots[view->params_read_gen%ArrayCount(view->params_roots)], str8(view->query_buffer, view->query_string_size)); } internal void @@ -1125,9 +1117,6 @@ df_window_open(Vec2F32 size, OS_Handle preferred_monitor, D_CfgSrc cfg_src) window->r = r_window_equip(window->os); window->ui = ui_state_alloc(); window->view_state_hist = d_state_delta_history_alloc(); - window->code_ctx_menu_key = ui_key_from_string(ui_key_zero(), str8_lit("_code_ctx_menu_")); - window->entity_ctx_menu_key = ui_key_from_string(ui_key_zero(), str8_lit("_entity_ctx_menu_")); - window->tab_ctx_menu_key = ui_key_from_string(ui_key_zero(), str8_lit("_tab_ctx_menu_")); window->code_ctx_menu_arena = arena_alloc(); window->hover_eval_arena = arena_alloc(); window->autocomp_lister_params_arena = arena_alloc(); @@ -1145,8 +1134,14 @@ df_window_open(Vec2F32 size, OS_Handle preferred_monitor, D_CfgSrc cfg_src) window->setting_vals[code] = df_g_setting_code_default_val_table[code]; } } - if(df_state->first_window == 0) + OS_Handle zero_monitor = {0}; + if(!os_handle_match(zero_monitor, preferred_monitor)) { + os_window_set_monitor(window->os, preferred_monitor); + } + if(df_state->first_window == 0) D_InteractRegsScope + { + d_interact_regs()->window = df_handle_from_window(window); DF_FontSlot english_font_slots[] = {DF_FontSlot_Main, DF_FontSlot_Code}; DF_FontSlot icon_font_slot = DF_FontSlot_Icons; for(U64 idx = 0; idx < ArrayCount(english_font_slots); idx += 1) @@ -1156,12 +1151,12 @@ df_window_open(Vec2F32 size, OS_Handle preferred_monitor, D_CfgSrc cfg_src) String8 sample_text = str8_lit("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890~!@#$%^&*()-_+=[{]}\\|;:'\",<.>/?"); fnt_push_run_from_string(scratch.arena, df_font_from_slot(slot), - df_font_size_from_slot(window, DF_FontSlot_Code), + df_font_size_from_slot(DF_FontSlot_Code), 0, 0, 0, sample_text); fnt_push_run_from_string(scratch.arena, df_font_from_slot(slot), - df_font_size_from_slot(window, DF_FontSlot_Main), + df_font_size_from_slot(DF_FontSlot_Main), 0, 0, 0, sample_text); scratch_end(scratch); @@ -1171,27 +1166,22 @@ df_window_open(Vec2F32 size, OS_Handle preferred_monitor, D_CfgSrc cfg_src) Temp scratch = scratch_begin(0, 0); fnt_push_run_from_string(scratch.arena, df_font_from_slot(icon_font_slot), - df_font_size_from_slot(window, icon_font_slot), + df_font_size_from_slot(icon_font_slot), 0, 0, FNT_RasterFlag_Smooth, df_g_icon_kind_text_table[icon_kind]); fnt_push_run_from_string(scratch.arena, df_font_from_slot(icon_font_slot), - df_font_size_from_slot(window, DF_FontSlot_Main), + df_font_size_from_slot(DF_FontSlot_Main), 0, 0, FNT_RasterFlag_Smooth, df_g_icon_kind_text_table[icon_kind]); fnt_push_run_from_string(scratch.arena, df_font_from_slot(icon_font_slot), - df_font_size_from_slot(window, DF_FontSlot_Code), + df_font_size_from_slot(DF_FontSlot_Code), 0, 0, FNT_RasterFlag_Smooth, df_g_icon_kind_text_table[icon_kind]); scratch_end(scratch); } } - OS_Handle zero_monitor = {0}; - if(!os_handle_match(zero_monitor, preferred_monitor)) - { - os_window_set_monitor(window->os, preferred_monitor); - } os_window_equip_repaint(window->os, df_state->repaint_hook, window); DLLPushBack(df_state->first_window, df_state->last_window, window); return window; @@ -1501,7 +1491,6 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) d_cmd_list_push(arena, cmds, &p, d_cmd_spec_from_kind(D_CmdKind_ClosePanel)); } } - df_panel_notify_mutation(ws, panel); }break; case D_CmdKind_ResetToDefaultPanels: case D_CmdKind_ResetToCompactPanels: @@ -1606,87 +1595,87 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) if(df_view_is_nil(watch)) { watch = df_view_alloc(); - df_view_equip_spec(ws, watch, df_view_spec_from_kind(DF_ViewKind_Watch), str8_zero(), &md_nil_node); + df_view_equip_spec(watch, df_view_spec_from_kind(DF_ViewKind_Watch), str8_zero(), &md_nil_node); } if(layout == Layout_Default && df_view_is_nil(locals)) { locals = df_view_alloc(); - df_view_equip_spec(ws, locals, df_view_spec_from_kind(DF_ViewKind_Locals), str8_zero(), &md_nil_node); + df_view_equip_spec(locals, df_view_spec_from_kind(DF_ViewKind_Locals), str8_zero(), &md_nil_node); } if(layout == Layout_Default && df_view_is_nil(regs)) { regs = df_view_alloc(); - df_view_equip_spec(ws, regs, df_view_spec_from_kind(DF_ViewKind_Registers), str8_zero(), &md_nil_node); + df_view_equip_spec(regs, df_view_spec_from_kind(DF_ViewKind_Registers), str8_zero(), &md_nil_node); } if(layout == Layout_Default && df_view_is_nil(globals)) { globals = df_view_alloc(); - df_view_equip_spec(ws, globals, df_view_spec_from_kind(DF_ViewKind_Globals), str8_zero(), &md_nil_node); + df_view_equip_spec(globals, df_view_spec_from_kind(DF_ViewKind_Globals), str8_zero(), &md_nil_node); } if(layout == Layout_Default && df_view_is_nil(tlocals)) { tlocals = df_view_alloc(); - df_view_equip_spec(ws, tlocals, df_view_spec_from_kind(DF_ViewKind_ThreadLocals), str8_zero(), &md_nil_node); + df_view_equip_spec(tlocals, df_view_spec_from_kind(DF_ViewKind_ThreadLocals), str8_zero(), &md_nil_node); } if(df_view_is_nil(types)) { types = df_view_alloc(); - df_view_equip_spec(ws, types, df_view_spec_from_kind(DF_ViewKind_Types), str8_zero(), &md_nil_node); + df_view_equip_spec(types, df_view_spec_from_kind(DF_ViewKind_Types), str8_zero(), &md_nil_node); } if(layout == Layout_Default && df_view_is_nil(procs)) { procs = df_view_alloc(); - df_view_equip_spec(ws, procs, df_view_spec_from_kind(DF_ViewKind_Procedures), str8_zero(), &md_nil_node); + df_view_equip_spec(procs, df_view_spec_from_kind(DF_ViewKind_Procedures), str8_zero(), &md_nil_node); } if(df_view_is_nil(callstack)) { callstack = df_view_alloc(); - df_view_equip_spec(ws, callstack, df_view_spec_from_kind(DF_ViewKind_CallStack), str8_zero(), &md_nil_node); + df_view_equip_spec(callstack, df_view_spec_from_kind(DF_ViewKind_CallStack), str8_zero(), &md_nil_node); } if(df_view_is_nil(breakpoints)) { breakpoints = df_view_alloc(); - df_view_equip_spec(ws, breakpoints, df_view_spec_from_kind(DF_ViewKind_Breakpoints), str8_zero(), &md_nil_node); + df_view_equip_spec(breakpoints, df_view_spec_from_kind(DF_ViewKind_Breakpoints), str8_zero(), &md_nil_node); } if(layout == Layout_Default && df_view_is_nil(watch_pins)) { watch_pins = df_view_alloc(); - df_view_equip_spec(ws, watch_pins, df_view_spec_from_kind(DF_ViewKind_WatchPins), str8_zero(), &md_nil_node); + df_view_equip_spec(watch_pins, df_view_spec_from_kind(DF_ViewKind_WatchPins), str8_zero(), &md_nil_node); } if(df_view_is_nil(output)) { output = df_view_alloc(); - df_view_equip_spec(ws, output, df_view_spec_from_kind(DF_ViewKind_Output), str8_zero(), &md_nil_node); + df_view_equip_spec(output, df_view_spec_from_kind(DF_ViewKind_Output), str8_zero(), &md_nil_node); } if(df_view_is_nil(targets)) { targets = df_view_alloc(); - df_view_equip_spec(ws, targets, df_view_spec_from_kind(DF_ViewKind_Targets), str8_zero(), &md_nil_node); + df_view_equip_spec(targets, df_view_spec_from_kind(DF_ViewKind_Targets), str8_zero(), &md_nil_node); } if(df_view_is_nil(scheduler)) { scheduler = df_view_alloc(); - df_view_equip_spec(ws, scheduler, df_view_spec_from_kind(DF_ViewKind_Scheduler), str8_zero(), &md_nil_node); + df_view_equip_spec(scheduler, df_view_spec_from_kind(DF_ViewKind_Scheduler), str8_zero(), &md_nil_node); } if(df_view_is_nil(modules)) { modules = df_view_alloc(); - df_view_equip_spec(ws, modules, df_view_spec_from_kind(DF_ViewKind_Modules), str8_zero(), &md_nil_node); + df_view_equip_spec(modules, df_view_spec_from_kind(DF_ViewKind_Modules), str8_zero(), &md_nil_node); } if(df_view_is_nil(disasm)) { disasm = df_view_alloc(); - df_view_equip_spec(ws, disasm, df_view_spec_from_kind(DF_ViewKind_Disasm), str8_zero(), &md_nil_node); + df_view_equip_spec(disasm, df_view_spec_from_kind(DF_ViewKind_Disasm), str8_zero(), &md_nil_node); } if(layout == Layout_Default && df_view_is_nil(memory)) { memory = df_view_alloc(); - df_view_equip_spec(ws, memory, df_view_spec_from_kind(DF_ViewKind_Memory), str8_zero(), &md_nil_node); + df_view_equip_spec(memory, df_view_spec_from_kind(DF_ViewKind_Memory), str8_zero(), &md_nil_node); } if(code_views.count == 0 && df_view_is_nil(getting_started)) { getting_started = df_view_alloc(); - df_view_equip_spec(ws, getting_started, df_view_spec_from_kind(DF_ViewKind_GettingStarted), str8_zero(), &md_nil_node); + df_view_equip_spec(getting_started, df_view_spec_from_kind(DF_ViewKind_GettingStarted), str8_zero(), &md_nil_node); } //- rjf: apply layout @@ -1892,7 +1881,6 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) parent->first = new_first; parent->last = old_first; } - df_panel_notify_mutation(ws, panel); }break; //- rjf: focused panel cycling @@ -1989,7 +1977,6 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) DF_Panel *parent = panel->parent; if(!df_panel_is_nil(parent)) { - df_panel_notify_mutation(ws, panel); Axis2 split_axis = parent->split_axis; // NOTE(rjf): If we're removing all but the last child of this parent, @@ -2149,9 +2136,8 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) { query = params.string; } - df_view_equip_spec(ws, view, spec, query, params.params_tree); + df_view_equip_spec(view, spec, query, params.params_tree); df_panel_insert_tab_view(panel, panel->last_tab_view, view); - df_panel_notify_mutation(ws, panel); } }break; case D_CmdKind_CloseTab: @@ -2162,7 +2148,6 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) { df_panel_remove_tab_view(panel, view); df_view_release(view); - df_panel_notify_mutation(ws, panel); } }break; case D_CmdKind_MoveTab: @@ -2192,20 +2177,17 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) D_CmdParams p = df_cmd_params_from_panel(ws, src_panel); d_cmd_list_push(arena, cmds, &p, d_cmd_spec_from_kind(D_CmdKind_ClosePanel)); } - df_panel_notify_mutation(ws, dst_panel); } }break; case D_CmdKind_TabBarTop: { DF_Panel *panel = df_panel_from_handle(params.panel); panel->tab_side = Side_Min; - df_panel_notify_mutation(ws, panel); }break; case D_CmdKind_TabBarBottom: { DF_Panel *panel = df_panel_from_handle(params.panel); panel->tab_side = Side_Max; - df_panel_notify_mutation(ws, panel); }break; //- rjf: files @@ -3199,7 +3181,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) { DF_View *view = df_view_alloc(); String8 file_path_query = d_eval_string_from_file_path(scratch.arena, file_path); - df_view_equip_spec(ws, view, df_view_spec_from_kind(DF_ViewKind_Text), file_path_query, &md_nil_node); + df_view_equip_spec(view, df_view_spec_from_kind(DF_ViewKind_Text), file_path_query, &md_nil_node); df_panel_insert_tab_view(dst_panel, dst_panel->last_tab_view, view); dst_view = view; } @@ -3246,7 +3228,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) if(!df_panel_is_nil(dst_panel) && df_view_is_nil(view_w_disasm)) { DF_View *view = df_view_alloc(); - df_view_equip_spec(ws, view, df_view_spec_from_kind(DF_ViewKind_Disasm), str8_zero(), &md_nil_node); + df_view_equip_spec(view, df_view_spec_from_kind(DF_ViewKind_Disasm), str8_zero(), &md_nil_node); df_panel_insert_tab_view(dst_panel, dst_panel->last_tab_view, view); dst_view = view; } @@ -3439,7 +3421,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) d_interact_regs()->panel = df_handle_from_panel(panel); d_interact_regs()->view = df_handle_from_view(view); DF_ViewCmdFunctionType *do_view_cmds_function = view->spec->info.cmd_hook; - do_view_cmds_function(ws, panel, view, view->params_roots[view->params_read_gen%ArrayCount(view->params_roots)], str8(view->query_buffer, view->query_string_size), cmds); + do_view_cmds_function(view, view->params_roots[view->params_read_gen%ArrayCount(view->params_roots)], str8(view->query_buffer, view->query_string_size), cmds); D_InteractRegs *view_regs = d_pop_interact_regs(); if(panel == ws->focused_panel) { @@ -3508,7 +3490,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) ws->cfg_palettes[DF_PaletteCode_DropSiteOverlay].text = current->colors[DF_ThemeColor_DropSiteOverlay]; ws->cfg_palettes[DF_PaletteCode_DropSiteOverlay].text_weak = current->colors[DF_ThemeColor_DropSiteOverlay]; ws->cfg_palettes[DF_PaletteCode_DropSiteOverlay].border = current->colors[DF_ThemeColor_DropSiteOverlay]; - if(df_setting_val_from_code(0, DF_SettingCode_OpaqueBackgrounds).s32) + if(df_setting_val_from_code(DF_SettingCode_OpaqueBackgrounds).s32) { for(EachEnumVal(DF_PaletteCode, code)) { @@ -3535,7 +3517,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) { // rjf: gather font info FNT_Tag main_font = df_font_from_slot(DF_FontSlot_Main); - F32 main_font_size = df_font_size_from_slot(ws, DF_FontSlot_Main); + F32 main_font_size = df_font_size_from_slot(DF_FontSlot_Main); FNT_Tag icon_font = df_font_from_slot(DF_FontSlot_Icons); // rjf: build icon info @@ -3557,20 +3539,20 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) // rjf: build widget palette info UI_WidgetPaletteInfo widget_palette_info = {0}; { - widget_palette_info.tooltip_palette = df_palette_from_code(ws, DF_PaletteCode_Floating); - widget_palette_info.ctx_menu_palette = df_palette_from_code(ws, DF_PaletteCode_Floating); - widget_palette_info.scrollbar_palette = df_palette_from_code(ws, DF_PaletteCode_ScrollBarButton); + widget_palette_info.tooltip_palette = df_palette_from_code(DF_PaletteCode_Floating); + widget_palette_info.ctx_menu_palette = df_palette_from_code(DF_PaletteCode_Floating); + widget_palette_info.scrollbar_palette = df_palette_from_code(DF_PaletteCode_ScrollBarButton); } // rjf: build animation info UI_AnimationInfo animation_info = {0}; { - if(df_setting_val_from_code(ws, DF_SettingCode_HoverAnimations).s32) {animation_info.flags |= UI_AnimationInfoFlag_HotAnimations;} - if(df_setting_val_from_code(ws, DF_SettingCode_PressAnimations).s32) {animation_info.flags |= UI_AnimationInfoFlag_ActiveAnimations;} - if(df_setting_val_from_code(ws, DF_SettingCode_FocusAnimations).s32) {animation_info.flags |= UI_AnimationInfoFlag_FocusAnimations;} - if(df_setting_val_from_code(ws, DF_SettingCode_TooltipAnimations).s32) {animation_info.flags |= UI_AnimationInfoFlag_TooltipAnimations;} - if(df_setting_val_from_code(ws, DF_SettingCode_MenuAnimations).s32) {animation_info.flags |= UI_AnimationInfoFlag_ContextMenuAnimations;} - if(df_setting_val_from_code(ws, DF_SettingCode_ScrollingAnimations).s32) {animation_info.flags |= UI_AnimationInfoFlag_ScrollingAnimations;} + if(df_setting_val_from_code(DF_SettingCode_HoverAnimations).s32) {animation_info.flags |= UI_AnimationInfoFlag_HotAnimations;} + if(df_setting_val_from_code(DF_SettingCode_PressAnimations).s32) {animation_info.flags |= UI_AnimationInfoFlag_ActiveAnimations;} + if(df_setting_val_from_code(DF_SettingCode_FocusAnimations).s32) {animation_info.flags |= UI_AnimationInfoFlag_FocusAnimations;} + if(df_setting_val_from_code(DF_SettingCode_TooltipAnimations).s32) {animation_info.flags |= UI_AnimationInfoFlag_TooltipAnimations;} + if(df_setting_val_from_code(DF_SettingCode_MenuAnimations).s32) {animation_info.flags |= UI_AnimationInfoFlag_ContextMenuAnimations;} + if(df_setting_val_from_code(DF_SettingCode_ScrollingAnimations).s32) {animation_info.flags |= UI_AnimationInfoFlag_ScrollingAnimations;} } // rjf: begin & push initial stack values @@ -3580,11 +3562,11 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) ui_push_text_padding(main_font_size*0.3f); ui_push_pref_width(ui_em(20.f, 1)); ui_push_pref_height(ui_em(2.75f, 1.f)); - ui_push_palette(df_palette_from_code(ws, DF_PaletteCode_Base)); + ui_push_palette(df_palette_from_code(DF_PaletteCode_Base)); ui_push_blur_size(10.f); FNT_RasterFlags text_raster_flags = 0; - if(df_setting_val_from_code(ws, DF_SettingCode_SmoothUIText).s32) {text_raster_flags |= FNT_RasterFlag_Smooth;} - if(df_setting_val_from_code(ws, DF_SettingCode_HintUIText).s32) {text_raster_flags |= FNT_RasterFlag_Hinted;} + if(df_setting_val_from_code(DF_SettingCode_SmoothUIText).s32) {text_raster_flags |= FNT_RasterFlag_Smooth;} + if(df_setting_val_from_code(DF_SettingCode_HintUIText).s32) {text_raster_flags |= FNT_RasterFlag_Hinted;} ui_push_text_raster_flags(text_raster_flags); } @@ -3630,7 +3612,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) UI_Size main_width = ui_top_pref_width(); UI_Size main_height = ui_top_pref_height(); UI_TextAlign main_text_align = ui_top_text_alignment(); - DF_Palette(ws, DF_PaletteCode_Tab) + DF_Palette(DF_PaletteCode_Tab) UI_Tooltip UI_PrefWidth(main_width) UI_PrefHeight(main_height) @@ -3646,8 +3628,8 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) { DF_IconKind icon_kind = df_icon_kind_from_view(view); DR_FancyStringList fstrs = df_title_fstrs_from_view(scratch.arena, view, ui_top_palette()->text, ui_top_palette()->text_weak, ui_top_font_size()); - DF_Font(ws, DF_FontSlot_Icons) - UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Icons)) + DF_Font(DF_FontSlot_Icons) + UI_FontSize(df_font_size_from_slot(DF_FontSlot_Icons)) UI_PrefWidth(ui_em(2.5f, 1.f)) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_label(df_g_icon_kind_text_table[icon_kind]); @@ -3665,7 +3647,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) { DF_ViewSpec *view_spec = view->spec; DF_ViewUIFunctionType *build_view_ui_function = view_spec->info.ui_hook; - build_view_ui_function(ws, &df_nil_panel, view, view->params_roots[view->params_read_gen%ArrayCount(view->params_roots)], str8(view->query_buffer, view->query_string_size), view_preview_container->rect); + 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); } } } @@ -3679,8 +3661,8 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) { String8 display_name = d_display_string_from_entity(scratch.arena, entity); DF_IconKind icon_kind = df_entity_kind_icon_kind_table[entity->kind]; - DF_Font(ws, DF_FontSlot_Icons) - UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Icons)) + DF_Font(DF_FontSlot_Icons) + UI_FontSize(df_font_size_from_slot(DF_FontSlot_Icons)) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_label(df_g_icon_kind_text_table[icon_kind]); ui_label(display_name); @@ -3693,7 +3675,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) //////////////////////////// //- rjf: developer menu // - if(ws->dev_menu_is_open) DF_Font(ws, DF_FontSlot_Code) + if(ws->dev_menu_is_open) DF_Font(DF_FontSlot_Code) { ui_set_next_flags(UI_BoxFlag_ViewScrollY|UI_BoxFlag_AllowOverflowY|UI_BoxFlag_ViewClamp); UI_PaneF(r2f32p(30, 30, 30+ui_top_font_size()*100, ui_top_font_size()*150), "###dev_ctx_menu") @@ -3701,7 +3683,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) //- rjf: toggles for(U64 idx = 0; idx < ArrayCount(DEV_toggle_table); idx += 1) { - if(ui_clicked(df_icon_button(ws, *DEV_toggle_table[idx].value_ptr ? DF_IconKind_CheckFilled : DF_IconKind_CheckHollow, 0, DEV_toggle_table[idx].name))) + if(ui_clicked(df_icon_button(*DEV_toggle_table[idx].value_ptr ? DF_IconKind_CheckFilled : DF_IconKind_CheckHollow, 0, DEV_toggle_table[idx].name))) { *DEV_toggle_table[idx].value_ptr ^= 1; } @@ -3809,12 +3791,12 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) //////////////////////////// //- rjf: universal ctx menus // - DF_Palette(ws, DF_PaletteCode_Floating) + DF_Palette(DF_PaletteCode_Floating) { Temp scratch = scratch_begin(&arena, 1); //- rjf: auto-close entity ctx menu - if(ui_ctx_menu_is_open(ws->entity_ctx_menu_key)) + if(ui_ctx_menu_is_open(df_state->entity_ctx_menu_key)) { D_Entity *entity = d_entity_from_handle(ws->entity_ctx_menu_entity); if(d_entity_is_nil(entity)) @@ -3824,15 +3806,15 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) } //- rjf: code ctx menu - UI_CtxMenu(ws->code_ctx_menu_key) + UI_CtxMenu(df_state->code_ctx_menu_key) UI_PrefWidth(ui_em(40.f, 1.f)) - DF_Palette(ws, DF_PaletteCode_ImplicitButton) + DF_Palette(DF_PaletteCode_ImplicitButton) { TXT_Scope *txt_scope = txt_scope_open(); HS_Scope *hs_scope = hs_scope_open(); TxtRng range = ws->code_ctx_menu_range; D_LineList lines = ws->code_ctx_menu_lines; - if(!txt_pt_match(range.min, range.max) && ui_clicked(df_cmd_spec_button(ws, d_cmd_spec_from_kind(D_CmdKind_Copy)))) + if(!txt_pt_match(range.min, range.max) && ui_clicked(df_cmd_spec_button(d_cmd_spec_from_kind(D_CmdKind_Copy)))) { U128 hash = {0}; TXT_TextInfo info = txt_text_info_from_key_lang(txt_scope, ws->code_ctx_menu_text_key, ws->code_ctx_menu_lang_kind, &hash); @@ -3841,7 +3823,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) os_set_clipboard_text(copy_data); ui_ctx_menu_close(); } - if(range.min.line == range.max.line && ui_clicked(df_icon_buttonf(ws, DF_IconKind_RightArrow, 0, "Set Next Statement"))) + if(range.min.line == range.max.line && ui_clicked(df_icon_buttonf(DF_IconKind_RightArrow, 0, "Set Next Statement"))) { D_Entity *thread = d_entity_from_handle(d_interact_regs()->thread); U64 new_rip_vaddr = ws->code_ctx_menu_vaddr; @@ -3861,7 +3843,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) d_cmd(D_CmdKind_SetThreadIP, .entity = d_handle_from_entity(thread), .vaddr = new_rip_vaddr); ui_ctx_menu_close(); } - if(range.min.line == range.max.line && ui_clicked(df_icon_buttonf(ws, DF_IconKind_Play, 0, "Run To Line"))) + if(range.min.line == range.max.line && ui_clicked(df_icon_buttonf(DF_IconKind_Play, 0, "Run To Line"))) { if(ws->code_ctx_menu_file_path.size != 0) { @@ -3873,7 +3855,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) } ui_ctx_menu_close(); } - if(range.min.line == range.max.line && ui_clicked(df_icon_buttonf(ws, DF_IconKind_Null, 0, "Go To Name"))) + if(range.min.line == range.max.line && ui_clicked(df_icon_buttonf(DF_IconKind_Null, 0, "Go To Name"))) { U128 hash = {0}; TXT_TextInfo info = txt_text_info_from_key_lang(txt_scope, ws->code_ctx_menu_text_key, ws->code_ctx_menu_lang_kind, &hash); @@ -3891,7 +3873,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) d_cmd(D_CmdKind_GoToName, .string = expr); ui_ctx_menu_close(); } - if(range.min.line == range.max.line && ui_clicked(df_icon_buttonf(ws, DF_IconKind_CircleFilled, 0, "Toggle Breakpoint"))) + if(range.min.line == range.max.line && ui_clicked(df_icon_buttonf(DF_IconKind_CircleFilled, 0, "Toggle Breakpoint"))) { d_cmd(D_CmdKind_ToggleBreakpoint, .file_path = ws->code_ctx_menu_file_path, @@ -3899,7 +3881,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) .vaddr = ws->code_ctx_menu_vaddr); ui_ctx_menu_close(); } - if(range.min.line == range.max.line && ui_clicked(df_icon_buttonf(ws, DF_IconKind_Binoculars, 0, "Toggle Watch Expression"))) + if(range.min.line == range.max.line && ui_clicked(df_icon_buttonf(DF_IconKind_Binoculars, 0, "Toggle Watch Expression"))) { U128 hash = {0}; TXT_TextInfo info = txt_text_info_from_key_lang(txt_scope, ws->code_ctx_menu_text_key, ws->code_ctx_menu_lang_kind, &hash); @@ -3917,7 +3899,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) d_cmd(D_CmdKind_ToggleWatchExpression, .string = expr); ui_ctx_menu_close(); } - if(ws->code_ctx_menu_file_path.size == 0 && range.min.line == range.max.line && ui_clicked(df_icon_buttonf(ws, DF_IconKind_FileOutline, 0, "Go To Source"))) + if(ws->code_ctx_menu_file_path.size == 0 && range.min.line == range.max.line && ui_clicked(df_icon_buttonf(DF_IconKind_FileOutline, 0, "Go To Source"))) { if(lines.first != 0) { @@ -3927,7 +3909,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) } ui_ctx_menu_close(); } - if(ws->code_ctx_menu_file_path.size != 0 && range.min.line == range.max.line && ui_clicked(df_icon_buttonf(ws, DF_IconKind_FileOutline, 0, "Go To Disassembly"))) + if(ws->code_ctx_menu_file_path.size != 0 && range.min.line == range.max.line && ui_clicked(df_icon_buttonf(DF_IconKind_FileOutline, 0, "Go To Disassembly"))) { D_Entity *thread = d_entity_from_handle(d_interact_regs()->thread); U64 vaddr = 0; @@ -3949,9 +3931,9 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) } //- rjf: entity menu - UI_CtxMenu(ws->entity_ctx_menu_key) + UI_CtxMenu(df_state->entity_ctx_menu_key) UI_PrefWidth(ui_em(40.f, 1.f)) - DF_Palette(ws, DF_PaletteCode_ImplicitButton) + DF_Palette(DF_PaletteCode_ImplicitButton) { D_Entity *entity = d_entity_from_handle(ws->entity_ctx_menu_entity); DF_IconKind entity_icon = df_entity_kind_icon_kind_table[entity->kind]; @@ -3962,8 +3944,8 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) UI_Row { ui_spacer(ui_em(1.f, 1.f)); - DF_Font(ws, DF_FontSlot_Icons) - UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Icons)) + DF_Font(DF_FontSlot_Icons) + UI_FontSize(df_font_size_from_slot(DF_FontSlot_Icons)) UI_PrefWidth(ui_em(2.f, 1.f)) UI_PrefHeight(ui_pct(1, 0)) UI_TextAlignment(UI_TextAlign_Center) @@ -3980,17 +3962,17 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) } UI_Palette(palette) UI_PrefWidth(ui_text_dim(10, 1)) - DF_Font(ws, (kind_flags & D_EntityKindFlag_NameIsCode) ? DF_FontSlot_Code : DF_FontSlot_Main) + DF_Font((kind_flags & D_EntityKindFlag_NameIsCode) ? DF_FontSlot_Code : DF_FontSlot_Main) ui_label(display_name); } } - DF_Palette(ws, DF_PaletteCode_Floating) ui_divider(ui_em(1.f, 1.f)); + DF_Palette(DF_PaletteCode_Floating) ui_divider(ui_em(1.f, 1.f)); // rjf: name editor if(kind_flags & D_EntityKindFlag_CanRename) UI_TextPadding(ui_top_font_size()*1.5f) { - UI_Signal sig = df_line_editf(ws, DF_LineEditFlag_Border, 0, 0, &ws->entity_ctx_menu_input_cursor, &ws->entity_ctx_menu_input_mark, ws->entity_ctx_menu_input_buffer, sizeof(ws->entity_ctx_menu_input_buffer), &ws->entity_ctx_menu_input_size, 0, entity->name, "%S###entity_name_edit_%p", d_entity_kind_name_label_table[entity->kind], entity); + UI_Signal sig = df_line_editf(DF_LineEditFlag_Border, 0, 0, &ws->entity_ctx_menu_input_cursor, &ws->entity_ctx_menu_input_mark, ws->entity_ctx_menu_input_buffer, sizeof(ws->entity_ctx_menu_input_buffer), &ws->entity_ctx_menu_input_size, 0, entity->name, "%S###entity_name_edit_%p", d_entity_kind_name_label_table[entity->kind], entity); if(ui_committed(sig)) { d_cmd(D_CmdKind_NameEntity, @@ -4001,11 +3983,11 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) // rjf: condition editor if(kind_flags & D_EntityKindFlag_CanCondition) - DF_Font(ws, DF_FontSlot_Code) + DF_Font(DF_FontSlot_Code) UI_TextPadding(ui_top_font_size()*1.5f) { D_Entity *condition = d_entity_child_from_kind(entity, D_EntityKind_Condition); - UI_Signal sig = df_line_editf(ws, DF_LineEditFlag_Border|DF_LineEditFlag_CodeContents, 0, 0, &ws->entity_ctx_menu_input_cursor, &ws->entity_ctx_menu_input_mark, ws->entity_ctx_menu_input_buffer, sizeof(ws->entity_ctx_menu_input_buffer), &ws->entity_ctx_menu_input_size, 0, condition->name, "Condition###entity_cond_edit_%p", entity); + UI_Signal sig = df_line_editf(DF_LineEditFlag_Border|DF_LineEditFlag_CodeContents, 0, 0, &ws->entity_ctx_menu_input_cursor, &ws->entity_ctx_menu_input_mark, ws->entity_ctx_menu_input_buffer, sizeof(ws->entity_ctx_menu_input_buffer), &ws->entity_ctx_menu_input_size, 0, condition->name, "Condition###entity_cond_edit_%p", entity); if(ui_committed(sig)) { String8 new_string = str8(ws->entity_ctx_menu_input_buffer, ws->entity_ctx_menu_input_size); @@ -4028,7 +4010,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) if(entity->kind == D_EntityKind_Target) UI_TextPadding(ui_top_font_size()*1.5f) { D_Entity *exe = d_entity_child_from_kind(entity, D_EntityKind_Executable); - UI_Signal sig = df_line_editf(ws, DF_LineEditFlag_Border, 0, 0, &ws->entity_ctx_menu_input_cursor, &ws->entity_ctx_menu_input_mark, ws->entity_ctx_menu_input_buffer, sizeof(ws->entity_ctx_menu_input_buffer), &ws->entity_ctx_menu_input_size, 0, exe->name, "Executable###entity_exe_edit_%p", entity); + UI_Signal sig = df_line_editf(DF_LineEditFlag_Border, 0, 0, &ws->entity_ctx_menu_input_cursor, &ws->entity_ctx_menu_input_mark, ws->entity_ctx_menu_input_buffer, sizeof(ws->entity_ctx_menu_input_buffer), &ws->entity_ctx_menu_input_size, 0, exe->name, "Executable###entity_exe_edit_%p", entity); if(ui_committed(sig)) { String8 new_string = str8(ws->entity_ctx_menu_input_buffer, ws->entity_ctx_menu_input_size); @@ -4051,7 +4033,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) if(entity->kind == D_EntityKind_Target) UI_TextPadding(ui_top_font_size()*1.5f) { D_Entity *args = d_entity_child_from_kind(entity, D_EntityKind_Arguments); - UI_Signal sig = df_line_editf(ws, DF_LineEditFlag_Border, 0, 0, &ws->entity_ctx_menu_input_cursor, &ws->entity_ctx_menu_input_mark, ws->entity_ctx_menu_input_buffer, sizeof(ws->entity_ctx_menu_input_buffer), &ws->entity_ctx_menu_input_size, 0, args->name, "Arguments###entity_args_edit_%p", entity); + UI_Signal sig = df_line_editf(DF_LineEditFlag_Border, 0, 0, &ws->entity_ctx_menu_input_cursor, &ws->entity_ctx_menu_input_mark, ws->entity_ctx_menu_input_buffer, sizeof(ws->entity_ctx_menu_input_buffer), &ws->entity_ctx_menu_input_size, 0, args->name, "Arguments###entity_args_edit_%p", entity); if(ui_committed(sig)) { String8 new_string = str8(ws->entity_ctx_menu_input_buffer, ws->entity_ctx_menu_input_size); @@ -4071,34 +4053,34 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) } // rjf: copy name - if(ui_clicked(df_icon_buttonf(ws, DF_IconKind_Clipboard, 0, "Copy Name"))) + if(ui_clicked(df_icon_buttonf(DF_IconKind_Clipboard, 0, "Copy Name"))) { os_set_clipboard_text(display_name); ui_ctx_menu_close(); } // rjf: is command line only? -> make permanent - if(entity->cfg_src == D_CfgSrc_CommandLine && ui_clicked(df_icon_buttonf(ws, DF_IconKind_Save, 0, "Save To Project"))) + if(entity->cfg_src == D_CfgSrc_CommandLine && ui_clicked(df_icon_buttonf(DF_IconKind_Save, 0, "Save To Project"))) { d_entity_equip_cfg_src(entity, D_CfgSrc_Project); } // rjf: duplicate - if(kind_flags & D_EntityKindFlag_CanDuplicate && ui_clicked(df_icon_buttonf(ws, DF_IconKind_XSplit, 0, "Duplicate"))) + if(kind_flags & D_EntityKindFlag_CanDuplicate && ui_clicked(df_icon_buttonf(DF_IconKind_XSplit, 0, "Duplicate"))) { d_cmd(D_CmdKind_DuplicateEntity, .entity = d_handle_from_entity(entity)); ui_ctx_menu_close(); } // rjf: edit - if(kind_flags & D_EntityKindFlag_CanEdit && ui_clicked(df_icon_buttonf(ws, DF_IconKind_Pencil, 0, "Edit"))) + if(kind_flags & D_EntityKindFlag_CanEdit && ui_clicked(df_icon_buttonf(DF_IconKind_Pencil, 0, "Edit"))) { d_cmd(D_CmdKind_EditEntity, .entity = d_handle_from_entity(entity)); ui_ctx_menu_close(); } // rjf: deletion - if(kind_flags & D_EntityKindFlag_CanDelete && ui_clicked(df_icon_buttonf(ws, DF_IconKind_Trash, 0, "Delete"))) + if(kind_flags & D_EntityKindFlag_CanDelete && ui_clicked(df_icon_buttonf(DF_IconKind_Trash, 0, "Delete"))) { d_cmd(D_CmdKind_RemoveEntity, .entity = d_handle_from_entity(entity)); ui_ctx_menu_close(); @@ -4108,11 +4090,11 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) if(kind_flags & D_EntityKindFlag_CanEnable) { B32 is_enabled = !entity->disabled; - if(!is_enabled && ui_clicked(df_icon_buttonf(ws, DF_IconKind_CheckHollow, 0, "Enable###enabler"))) + if(!is_enabled && ui_clicked(df_icon_buttonf(DF_IconKind_CheckHollow, 0, "Enable###enabler"))) { d_cmd(D_CmdKind_EnableEntity, .entity = d_handle_from_entity(entity)); } - if(is_enabled && ui_clicked(df_icon_buttonf(ws, DF_IconKind_CheckFilled, 0, "Disable###enabler"))) + if(is_enabled && ui_clicked(df_icon_buttonf(DF_IconKind_CheckFilled, 0, "Disable###enabler"))) { d_cmd(D_CmdKind_DisableEntity, .entity = d_handle_from_entity(entity)); } @@ -4122,12 +4104,12 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) if(kind_flags & D_EntityKindFlag_CanFreeze) { B32 is_frozen = d_entity_is_frozen(entity); - ui_set_next_palette(df_palette_from_code(ws, is_frozen ? DF_PaletteCode_NegativePopButton : DF_PaletteCode_PositivePopButton)); - if(is_frozen && ui_clicked(df_icon_buttonf(ws, DF_IconKind_Locked, 0, "Thaw###freeze_thaw"))) + ui_set_next_palette(df_palette_from_code(is_frozen ? DF_PaletteCode_NegativePopButton : DF_PaletteCode_PositivePopButton)); + if(is_frozen && ui_clicked(df_icon_buttonf(DF_IconKind_Locked, 0, "Thaw###freeze_thaw"))) { d_cmd(D_CmdKind_ThawEntity, .entity = d_handle_from_entity(entity)); } - if(!is_frozen && ui_clicked(df_icon_buttonf(ws, DF_IconKind_Unlocked, 0, "Freeze###freeze_thaw"))) + if(!is_frozen && ui_clicked(df_icon_buttonf(DF_IconKind_Unlocked, 0, "Freeze###freeze_thaw"))) { d_cmd(D_CmdKind_FreezeEntity, .entity = d_handle_from_entity(entity)); } @@ -4136,7 +4118,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) // rjf: go-to-location { D_Entity *loc = d_entity_child_from_kind(entity, D_EntityKind_Location); - if(!d_entity_is_nil(loc) && ui_clicked(df_icon_buttonf(ws, DF_IconKind_FileOutline, 0, "Go To Location"))) + if(!d_entity_is_nil(loc) && ui_clicked(df_icon_buttonf(DF_IconKind_FileOutline, 0, "Go To Location"))) { d_cmd(D_CmdKind_FindCodeLocation, .file_path = loc->name, @@ -4161,16 +4143,16 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) B32 is_selected = d_handle_match(d_base_interact_regs()->thread, d_handle_from_entity(entity)); if(is_selected) { - df_icon_buttonf(ws, DF_IconKind_Thread, 0, "[Selected]###select_entity"); + df_icon_buttonf(DF_IconKind_Thread, 0, "[Selected]###select_entity"); } - else if(ui_clicked(df_icon_buttonf(ws, DF_IconKind_Thread, 0, "Select###select_entity"))) + else if(ui_clicked(df_icon_buttonf(DF_IconKind_Thread, 0, "Select###select_entity"))) { d_cmd(D_CmdKind_SelectThread, .entity = d_handle_from_entity(entity)); ui_ctx_menu_close(); } } - if(ui_clicked(df_icon_buttonf(ws, DF_IconKind_Clipboard, 0, "Copy ID"))) + if(ui_clicked(df_icon_buttonf(DF_IconKind_Clipboard, 0, "Copy ID"))) { U32 ctrl_id = entity->ctrl_id; String8 string = push_str8f(scratch.arena, "%i", (int)ctrl_id); @@ -4180,7 +4162,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) if(entity->kind == D_EntityKind_Thread) { - if(ui_clicked(df_icon_buttonf(ws, DF_IconKind_Clipboard, 0, "Copy Instruction Pointer Address"))) + if(ui_clicked(df_icon_buttonf(DF_IconKind_Clipboard, 0, "Copy Instruction Pointer Address"))) { U64 rip = d_query_cached_rip_from_thread(entity); String8 string = push_str8f(scratch.arena, "0x%I64x", rip); @@ -4191,7 +4173,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) if(entity->kind == D_EntityKind_Thread) { - if(ui_clicked(df_icon_buttonf(ws, DF_IconKind_Clipboard, 0, "Copy Call Stack"))) + if(ui_clicked(df_icon_buttonf(DF_IconKind_Clipboard, 0, "Copy Call Stack"))) { DI_Scope *di_scope = di_scope_open(); D_Entity *process = d_entity_ancestor_from_kind(entity, D_EntityKind_Process); @@ -4240,7 +4222,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) if(entity->kind == D_EntityKind_Thread) { - if(ui_clicked(df_icon_buttonf(ws, DF_IconKind_FileOutline, 0, "Find"))) + if(ui_clicked(df_icon_buttonf(DF_IconKind_FileOutline, 0, "Find"))) { d_cmd(D_CmdKind_FindThread, .entity = d_handle_from_entity(entity)); ui_ctx_menu_close(); @@ -4250,7 +4232,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) case D_EntityKind_Module: { - UI_Signal copy_full_path_sig = df_icon_buttonf(ws, DF_IconKind_Clipboard, 0, "Copy Full Path"); + UI_Signal copy_full_path_sig = df_icon_buttonf(DF_IconKind_Clipboard, 0, "Copy Full Path"); if(ui_clicked(copy_full_path_sig)) { String8 string = entity->name; @@ -4262,14 +4244,14 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) String8 string = entity->name; ui_label(string); } - if(ui_clicked(df_icon_buttonf(ws, DF_IconKind_Clipboard, 0, "Copy Base Address"))) + if(ui_clicked(df_icon_buttonf(DF_IconKind_Clipboard, 0, "Copy Base Address"))) { Rng1U64 vaddr_rng = entity->vaddr_rng; String8 string = push_str8f(scratch.arena, "0x%I64x", vaddr_rng.min); os_set_clipboard_text(string); ui_ctx_menu_close(); } - if(ui_clicked(df_icon_buttonf(ws, DF_IconKind_Clipboard, 0, "Copy Address Range Size"))) + if(ui_clicked(df_icon_buttonf(DF_IconKind_Clipboard, 0, "Copy Address Range Size"))) { Rng1U64 vaddr_rng = entity->vaddr_rng; String8 string = push_str8f(scratch.arena, "0x%I64x", dim_1u64(vaddr_rng)); @@ -4280,12 +4262,12 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) case D_EntityKind_Target: { - if(ui_clicked(df_icon_buttonf(ws, DF_IconKind_Play, 0, "Launch And Run"))) + if(ui_clicked(df_icon_buttonf(DF_IconKind_Play, 0, "Launch And Run"))) { d_cmd(D_CmdKind_LaunchAndRun, .entity = d_handle_from_entity(entity)); ui_ctx_menu_close(); } - if(ui_clicked(df_icon_buttonf(ws, DF_IconKind_PlayStepForward, 0, "Launch And Initialize"))) + if(ui_clicked(df_icon_buttonf(DF_IconKind_PlayStepForward, 0, "Launch And Initialize"))) { d_cmd(D_CmdKind_LaunchAndInit, .entity = d_handle_from_entity(entity)); ui_ctx_menu_close(); @@ -4293,7 +4275,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) }break; } - DF_Palette(ws, DF_PaletteCode_Floating) ui_divider(ui_em(1.f, 1.f)); + DF_Palette(DF_PaletteCode_Floating) ui_divider(ui_em(1.f, 1.f)); // rjf: color editor { @@ -4354,9 +4336,9 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) } UI_Row UI_Padding(ui_pct(1, 0)) UI_PrefWidth(ui_em(16.f, 1.f)) UI_CornerRadius(8.f) UI_TextAlignment(UI_TextAlign_Center) - DF_Palette(ws, DF_PaletteCode_Floating) + DF_Palette(DF_PaletteCode_Floating) { - if(ui_clicked(df_icon_buttonf(ws, DF_IconKind_Trash, 0, "Remove Color###color_toggle"))) + if(ui_clicked(df_icon_buttonf(DF_IconKind_Trash, 0, "Remove Color###color_toggle"))) { D_StateDeltaHistoryBatch(d_state_delta_history()) { @@ -4368,7 +4350,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) ui_spacer(ui_em(1.5f, 1.f)); } - if(!entity_has_color && ui_clicked(df_icon_buttonf(ws, DF_IconKind_Palette, 0, "Apply Color###color_toggle"))) + if(!entity_has_color && ui_clicked(df_icon_buttonf(DF_IconKind_Palette, 0, "Apply Color###color_toggle"))) { D_StateDeltaHistoryBatch(d_state_delta_history()) { @@ -4379,7 +4361,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) } //- rjf: auto-close tab ctx menu - if(ui_ctx_menu_is_open(ws->tab_ctx_menu_key)) + if(ui_ctx_menu_is_open(df_state->tab_ctx_menu_key)) { DF_View *tab = df_view_from_handle(ws->tab_ctx_menu_view); if(df_view_is_nil(tab)) @@ -4389,8 +4371,8 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) } //- rjf: tab menu - UI_CtxMenu(ws->tab_ctx_menu_key) UI_PrefWidth(ui_em(40.f, 1.f)) UI_CornerRadius(0) - DF_Palette(ws, DF_PaletteCode_ImplicitButton) + UI_CtxMenu(df_state->tab_ctx_menu_key) UI_PrefWidth(ui_em(40.f, 1.f)) UI_CornerRadius(0) + DF_Palette(DF_PaletteCode_ImplicitButton) { DF_Panel *panel = df_panel_from_handle(ws->tab_ctx_menu_panel); DF_View *view = df_view_from_handle(ws->tab_ctx_menu_view); @@ -4402,8 +4384,8 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) UI_Row { ui_spacer(ui_em(1.f, 1.f)); - DF_Font(ws, DF_FontSlot_Icons) - UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Icons)) + DF_Font(DF_FontSlot_Icons) + UI_FontSize(df_font_size_from_slot(DF_FontSlot_Icons)) UI_PrefWidth(ui_em(2.f, 1.f)) UI_PrefHeight(ui_pct(1, 0)) UI_TextAlignment(UI_TextAlign_Center) @@ -4416,10 +4398,10 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) } } - DF_Palette(ws, DF_PaletteCode_Floating) ui_divider(ui_em(1.f, 1.f)); + DF_Palette(DF_PaletteCode_Floating) ui_divider(ui_em(1.f, 1.f)); // rjf: copy name - if(ui_clicked(df_icon_buttonf(ws, DF_IconKind_Clipboard, 0, "Copy Name"))) + if(ui_clicked(df_icon_buttonf(DF_IconKind_Clipboard, 0, "Copy Name"))) { os_set_clipboard_text(dr_string_from_fancy_string_list(scratch.arena, &fstrs)); ui_ctx_menu_close(); @@ -4428,7 +4410,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) // rjf: copy full path if(file_path.size != 0) { - UI_Signal copy_full_path_sig = df_icon_buttonf(ws, DF_IconKind_Clipboard, 0, "Copy Full Path"); + UI_Signal copy_full_path_sig = df_icon_buttonf(DF_IconKind_Clipboard, 0, "Copy Full Path"); String8 full_path = path_normalized_from_string(scratch.arena, file_path); if(ui_clicked(copy_full_path_sig)) { @@ -4444,7 +4426,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) // rjf: show in explorer if(file_path.size != 0) { - UI_Signal sig = df_icon_buttonf(ws, DF_IconKind_FolderClosedFilled, 0, "Show In Explorer"); + UI_Signal sig = df_icon_buttonf(DF_IconKind_FolderClosedFilled, 0, "Show In Explorer"); if(ui_clicked(sig)) { String8 full_path = path_normalized_from_string(scratch.arena, file_path); @@ -4456,12 +4438,12 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) // rjf: filter controls if(view->spec->info.flags & DF_ViewSpecFlag_CanFilter) { - if(ui_clicked(df_cmd_spec_button(ws, d_cmd_spec_from_kind(D_CmdKind_Filter)))) + if(ui_clicked(df_cmd_spec_button(d_cmd_spec_from_kind(D_CmdKind_Filter)))) { d_cmd(D_CmdKind_Filter, .view = df_handle_from_view(view)); ui_ctx_menu_close(); } - if(ui_clicked(df_cmd_spec_button(ws, d_cmd_spec_from_kind(D_CmdKind_ClearFilter)))) + if(ui_clicked(df_cmd_spec_button(d_cmd_spec_from_kind(D_CmdKind_ClearFilter)))) { d_cmd(D_CmdKind_ClearFilter, .view = df_handle_from_view(view)); ui_ctx_menu_close(); @@ -4469,14 +4451,14 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) } // rjf: close tab - if(ui_clicked(df_icon_buttonf(ws, DF_IconKind_X, 0, "Close Tab"))) + if(ui_clicked(df_icon_buttonf(DF_IconKind_X, 0, "Close Tab"))) { d_cmd(D_CmdKind_CloseTab, .panel = df_handle_from_panel(panel), .view = df_handle_from_view(view)); ui_ctx_menu_close(); } // rjf: param tree editing - UI_TextPadding(ui_top_font_size()*1.5f) DF_Font(ws, DF_FontSlot_Code) + UI_TextPadding(ui_top_font_size()*1.5f) DF_Font(DF_FontSlot_Code) { Temp scratch = scratch_begin(&arena, 1); D_ViewRuleSpec *core_vr_spec = d_view_rule_spec_from_string(view->spec->info.name); @@ -4488,7 +4470,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) { if(!md_node_is_nil(schema_root->first)) { - DF_Palette(ws, DF_PaletteCode_Floating) ui_divider(ui_em(1.f, 1.f)); + DF_Palette(DF_PaletteCode_Floating) ui_divider(ui_em(1.f, 1.f)); } for(MD_EachNode(key, schema_root->first)) { @@ -4498,7 +4480,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) MD_Node *param_tree = md_child_from_string(params, key->string, 0); String8 pre_edit_value = md_string_from_children(scratch.arena, param_tree); UI_PrefWidth(ui_em(10.f, 1.f)) ui_label(key->string); - UI_Signal sig = df_line_editf(ws, DF_LineEditFlag_Border|DF_LineEditFlag_CodeContents, 0, 0, &ws->tab_ctx_menu_input_cursor, &ws->tab_ctx_menu_input_mark, ws->tab_ctx_menu_input_buffer, sizeof(ws->tab_ctx_menu_input_buffer), &ws->tab_ctx_menu_input_size, 0, pre_edit_value, "%S##view_param", key->string); + UI_Signal sig = df_line_editf(DF_LineEditFlag_Border|DF_LineEditFlag_CodeContents, 0, 0, &ws->tab_ctx_menu_input_cursor, &ws->tab_ctx_menu_input_mark, ws->tab_ctx_menu_input_buffer, sizeof(ws->tab_ctx_menu_input_buffer), &ws->tab_ctx_menu_input_size, 0, pre_edit_value, "%S##view_param", key->string); if(ui_committed(sig)) { String8 new_string = str8(ws->tab_ctx_menu_input_buffer, ws->tab_ctx_menu_input_size); @@ -4523,7 +4505,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) { Vec2F32 window_dim = dim_2f32(window_rect); UI_Box *bg_box = &ui_g_nil_box; - UI_Palette *palette = ui_build_palette(df_palette_from_code(ws, DF_PaletteCode_Floating)); + UI_Palette *palette = ui_build_palette(df_palette_from_code(DF_PaletteCode_Floating)); palette->background.w *= df_state->confirm_t; UI_Rect(window_rect) UI_ChildLayoutAxis(Axis2_X) @@ -4545,14 +4527,14 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) ui_ctx_menu_close(); UI_WidthFill UI_PrefHeight(ui_children_sum(1.f)) UI_Column UI_Padding(ui_pct(1, 0)) { - UI_TextRasterFlags(df_raster_flags_from_slot(ws, DF_FontSlot_Main)) UI_FontSize(ui_top_font_size()*2.f) UI_PrefHeight(ui_em(3.f, 1.f)) ui_label(df_state->confirm_title); + UI_TextRasterFlags(df_raster_flags_from_slot(DF_FontSlot_Main)) UI_FontSize(ui_top_font_size()*2.f) UI_PrefHeight(ui_em(3.f, 1.f)) ui_label(df_state->confirm_title); UI_PrefHeight(ui_em(3.f, 1.f)) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_label(df_state->confirm_msg); ui_spacer(ui_em(1.5f, 1.f)); UI_Row UI_Padding(ui_pct(1.f, 0.f)) UI_WidthFill UI_PrefHeight(ui_em(5.f, 1.f)) { UI_CornerRadius00(ui_top_font_size()*0.25f) UI_CornerRadius01(ui_top_font_size()*0.25f) - DF_Palette(ws, DF_PaletteCode_NeutralPopButton) + DF_Palette(DF_PaletteCode_NeutralPopButton) if(ui_clicked(ui_buttonf("OK")) || (ui_key_match(bg_box->default_nav_focus_hot_key, ui_key_zero()) && ui_slot_press(UI_EventActionSlot_Accept))) { d_cmd(D_CmdKind_ConfirmAccept); @@ -4778,7 +4760,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) { // rjf: animate target # of rows { - F32 rate = df_setting_val_from_code(ws, DF_SettingCode_MenuAnimations).s32 ? (1 - pow_f32(2, (-60.f * d_dt()))) : 1.f; + F32 rate = df_setting_val_from_code(DF_SettingCode_MenuAnimations).s32 ? (1 - pow_f32(2, (-60.f * d_dt()))) : 1.f; F32 target = Min((F32)item_array.count, 16.f); if(abs_f32(target - ws->autocomp_num_visible_rows_t) > 0.01f) { @@ -4793,7 +4775,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) // rjf: animate open { - F32 rate = df_setting_val_from_code(ws, DF_SettingCode_MenuAnimations).s32 ? 1 - pow_f32(2, (-60.f * d_dt())) : 1.f; + F32 rate = df_setting_val_from_code(DF_SettingCode_MenuAnimations).s32 ? 1 - pow_f32(2, (-60.f * d_dt())) : 1.f; F32 diff = 1.f-ws->autocomp_open_t; ws->autocomp_open_t += diff*rate; if(abs_f32(diff) < 0.05f) @@ -4822,7 +4804,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) UI_Focus(UI_FocusKind_On) UI_Squish(0.25f-0.25f*ws->autocomp_open_t) UI_Transparency(1.f-ws->autocomp_open_t) - DF_Palette(ws, DF_PaletteCode_Floating) + DF_Palette(DF_PaletteCode_Floating) { autocomp_box = ui_build_box_from_stringf(UI_BoxFlag_DefaultFocusNavY| UI_BoxFlag_Clickable| @@ -4843,10 +4825,10 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) UI_Parent(autocomp_box) UI_WidthFill UI_PrefHeight(ui_px(row_height_px, 1.f)) - DF_Font(ws, DF_FontSlot_Code) + DF_Font(DF_FontSlot_Code) UI_HoverCursor(OS_Cursor_HandPoint) UI_Focus(UI_FocusKind_Null) - DF_Palette(ws, DF_PaletteCode_ImplicitButton) + DF_Palette(DF_PaletteCode_ImplicitButton) UI_Padding(ui_em(1.f, 1.f)) { for(U64 idx = 0; idx < item_array.count; idx += 1) @@ -4860,7 +4842,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) UI_Box *box = ui_label(item->string).box; ui_box_equip_fuzzy_match_ranges(box, &item->matches); } - DF_Font(ws, DF_FontSlot_Main) + DF_Font(DF_FontSlot_Main) UI_PrefWidth(ui_text_dim(10, 1)) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_label(item->kind_string); @@ -4903,7 +4885,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) os_window_push_custom_edges(ws->os, window_edge_px); os_window_push_custom_title_bar(ws->os, dim_2f32(top_bar_rect).y); ui_set_next_flags(UI_BoxFlag_DefaultFocusNav|UI_BoxFlag_DisableFocusOverlay); - DF_Palette(ws, DF_PaletteCode_MenuBar) + DF_Palette(DF_PaletteCode_MenuBar) UI_Focus((ws->menu_bar_focused && window_is_focused && !ui_any_ctx_menu_is_open() && !ws->hover_eval_focused) ? UI_FocusKind_On : UI_FocusKind_Null) UI_Pane(top_bar_rect, str8_lit("###top_bar")) UI_WidthFill UI_Row @@ -4936,10 +4918,10 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) { // rjf: file menu UI_Key file_menu_key = ui_key_from_string(ui_key_zero(), str8_lit("_file_menu_key_")); - DF_Palette(ws, DF_PaletteCode_Floating) + DF_Palette(DF_PaletteCode_Floating) UI_CtxMenu(file_menu_key) UI_PrefWidth(ui_em(50.f, 1.f)) - DF_Palette(ws, DF_PaletteCode_ImplicitButton) + DF_Palette(DF_PaletteCode_ImplicitButton) { D_CmdKind cmds[] = { @@ -4958,15 +4940,15 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) 'x', }; Assert(ArrayCount(codepoints) == ArrayCount(cmds)); - df_cmd_list_menu_buttons(ws, ArrayCount(cmds), cmds, codepoints); + df_cmd_list_menu_buttons(ArrayCount(cmds), cmds, codepoints); } // rjf: window menu UI_Key window_menu_key = ui_key_from_string(ui_key_zero(), str8_lit("_window_menu_key_")); - DF_Palette(ws, DF_PaletteCode_Floating) + DF_Palette(DF_PaletteCode_Floating) UI_CtxMenu(window_menu_key) UI_PrefWidth(ui_em(50.f, 1.f)) - DF_Palette(ws, DF_PaletteCode_ImplicitButton) + DF_Palette(DF_PaletteCode_ImplicitButton) { D_CmdKind cmds[] = { @@ -4981,15 +4963,15 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) 'f', }; Assert(ArrayCount(codepoints) == ArrayCount(cmds)); - df_cmd_list_menu_buttons(ws, ArrayCount(cmds), cmds, codepoints); + df_cmd_list_menu_buttons(ArrayCount(cmds), cmds, codepoints); } // rjf: panel menu UI_Key panel_menu_key = ui_key_from_string(ui_key_zero(), str8_lit("_panel_menu_key_")); - DF_Palette(ws, DF_PaletteCode_Floating) + DF_Palette(DF_PaletteCode_Floating) UI_CtxMenu(panel_menu_key) UI_PrefWidth(ui_em(50.f, 1.f)) - DF_Palette(ws, DF_PaletteCode_ImplicitButton) + DF_Palette(DF_PaletteCode_ImplicitButton) { D_CmdKind cmds[] = { @@ -5024,15 +5006,15 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) 0, }; Assert(ArrayCount(codepoints) == ArrayCount(cmds)); - df_cmd_list_menu_buttons(ws, ArrayCount(cmds), cmds, codepoints); + df_cmd_list_menu_buttons(ArrayCount(cmds), cmds, codepoints); } // rjf: view menu UI_Key view_menu_key = ui_key_from_string(ui_key_zero(), str8_lit("_view_menu_key_")); - DF_Palette(ws, DF_PaletteCode_Floating) + DF_Palette(DF_PaletteCode_Floating) UI_CtxMenu(view_menu_key) UI_PrefWidth(ui_em(50.f, 1.f)) - DF_Palette(ws, DF_PaletteCode_ImplicitButton) + DF_Palette(DF_PaletteCode_ImplicitButton) { D_CmdKind cmds[] = { @@ -5081,15 +5063,15 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) 0, }; Assert(ArrayCount(codepoints) == ArrayCount(cmds)); - df_cmd_list_menu_buttons(ws, ArrayCount(cmds), cmds, codepoints); + df_cmd_list_menu_buttons(ArrayCount(cmds), cmds, codepoints); } // rjf: targets menu UI_Key targets_menu_key = ui_key_from_string(ui_key_zero(), str8_lit("_targets_menu_key_")); - DF_Palette(ws, DF_PaletteCode_Floating) + DF_Palette(DF_PaletteCode_Floating) UI_CtxMenu(targets_menu_key) UI_PrefWidth(ui_em(50.f, 1.f)) - DF_Palette(ws, DF_PaletteCode_ImplicitButton) + DF_Palette(DF_PaletteCode_ImplicitButton) { Temp scratch = scratch_begin(&arena, 1); D_CmdKind cmds[] = @@ -5105,8 +5087,8 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) 'r', }; Assert(ArrayCount(codepoints) == ArrayCount(cmds)); - df_cmd_list_menu_buttons(ws, ArrayCount(cmds), cmds, codepoints); - DF_Palette(ws, DF_PaletteCode_Floating) ui_divider(ui_em(1.f, 1.f)); + df_cmd_list_menu_buttons(ArrayCount(cmds), cmds, codepoints); + DF_Palette(DF_PaletteCode_Floating) ui_divider(ui_em(1.f, 1.f)); D_EntityList targets_list = d_query_cached_entity_list_with_kind(D_EntityKind_Target); for(D_EntityNode *n = targets_list.first; n != 0; n = n->next) { @@ -5118,7 +5100,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) } String8 target_name = d_display_string_from_entity(scratch.arena, target); UI_Signal sig = {0}; - UI_Palette(palette) sig = df_icon_buttonf(ws, DF_IconKind_Target, 0, "%S##%p", target_name, target); + UI_Palette(palette) sig = df_icon_buttonf(DF_IconKind_Target, 0, "%S##%p", target_name, target); if(ui_clicked(sig)) { d_cmd(D_CmdKind_EditTarget, .entity = d_handle_from_entity(target)); @@ -5131,10 +5113,10 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) // rjf: ctrl menu UI_Key ctrl_menu_key = ui_key_from_string(ui_key_zero(), str8_lit("_ctrl_menu_key_")); - DF_Palette(ws, DF_PaletteCode_Floating) + DF_Palette(DF_PaletteCode_Floating) UI_CtxMenu(ctrl_menu_key) UI_PrefWidth(ui_em(50.f, 1.f)) - DF_Palette(ws, DF_PaletteCode_ImplicitButton) + DF_Palette(DF_PaletteCode_ImplicitButton) { D_CmdKind cmds[] = { @@ -5161,15 +5143,15 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) 'a', }; Assert(ArrayCount(codepoints) == ArrayCount(cmds)); - df_cmd_list_menu_buttons(ws, ArrayCount(cmds), cmds, codepoints); + df_cmd_list_menu_buttons(ArrayCount(cmds), cmds, codepoints); } // rjf: help menu UI_Key help_menu_key = ui_key_from_string(ui_key_zero(), str8_lit("_help_menu_key_")); - DF_Palette(ws, DF_PaletteCode_Floating) + DF_Palette(DF_PaletteCode_Floating) UI_CtxMenu(help_menu_key) UI_PrefWidth(ui_em(50.f, 1.f)) - DF_Palette(ws, DF_PaletteCode_ImplicitButton) + DF_Palette(DF_PaletteCode_ImplicitButton) { UI_Row UI_TextAlignment(UI_TextAlign_Center) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_label(str8_lit(BUILD_TITLE_STRING_LITERAL)); @@ -5191,7 +5173,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) D_CmdSpec *spec = d_cmd_spec_from_kind(D_CmdKind_RunCommand); UI_Flags(UI_BoxFlag_DrawBorder) UI_TextAlignment(UI_TextAlign_Center) - df_cmd_binding_buttons(ws, spec); + df_cmd_binding_buttons(spec); } ui_spacer(ui_em(0.25f, 1.f)); UI_Row UI_TextAlignment(UI_TextAlign_Center) ui_label(str8_lit("Submit issues to the GitHub at:")); @@ -5310,7 +5292,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) // rjf: conversion task visualization UI_PrefWidth(ui_text_dim(10, 1)) UI_HeightFill - DF_Palette(ws, DF_PaletteCode_NeutralPopButton) + DF_Palette(DF_PaletteCode_NeutralPopButton) { Temp scratch = scratch_begin(&arena, 1); D_EntityList tasks = d_query_cached_entity_list_with_kind(D_EntityKind_ConversionTask); @@ -5340,7 +5322,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) //- rjf: center column UI_PrefWidth(ui_children_sum(1.f)) UI_Row UI_PrefWidth(ui_em(2.25f, 1)) - DF_Font(ws, DF_FontSlot_Icons) + DF_Font(DF_FontSlot_Icons) UI_FontSize(ui_top_font_size()*0.85f) { Temp scratch = scratch_begin(&arena, 1); @@ -5364,15 +5346,15 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) if(ui_hovering(sig) && !can_play) { UI_Tooltip - DF_Font(ws, DF_FontSlot_Main) - UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Main)) + DF_Font(DF_FontSlot_Main) + UI_FontSize(df_font_size_from_slot(DF_FontSlot_Main)) ui_labelf("Disabled: %s", have_targets ? "Targets are currently running" : "No active targets exist"); } if(ui_hovering(sig) && can_play) { UI_Tooltip - DF_Font(ws, DF_FontSlot_Main) - UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Main)) + DF_Font(DF_FontSlot_Main) + UI_FontSize(df_font_size_from_slot(DF_FontSlot_Main)) { if(can_stop) { @@ -5404,8 +5386,8 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) if(ui_hovering(sig)) { UI_Tooltip - DF_Font(ws, DF_FontSlot_Main) - UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Main)) + DF_Font(DF_FontSlot_Main) + UI_FontSize(df_font_size_from_slot(DF_FontSlot_Main)) { ui_labelf("Restart all running targets:"); { @@ -5438,15 +5420,15 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) if(ui_hovering(sig) && !can_pause) { UI_Tooltip - DF_Font(ws, DF_FontSlot_Main) - UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Main)) + DF_Font(DF_FontSlot_Main) + UI_FontSize(df_font_size_from_slot(DF_FontSlot_Main)) ui_labelf("Disabled: Already halted"); } if(ui_hovering(sig) && can_pause) { UI_Tooltip - DF_Font(ws, DF_FontSlot_Main) - UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Main)) + DF_Font(DF_FontSlot_Main) + UI_FontSize(df_font_size_from_slot(DF_FontSlot_Main)) ui_labelf("Halt all target processes"); } if(ui_clicked(sig)) @@ -5467,15 +5449,15 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) if(ui_hovering(sig) && !can_stop) { UI_Tooltip - DF_Font(ws, DF_FontSlot_Main) - UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Main)) + DF_Font(DF_FontSlot_Main) + UI_FontSize(df_font_size_from_slot(DF_FontSlot_Main)) ui_labelf("Disabled: No processes are running"); } if(ui_hovering(sig) && can_stop) { UI_Tooltip - DF_Font(ws, DF_FontSlot_Main) - UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Main)) + DF_Font(DF_FontSlot_Main) + UI_FontSize(df_font_size_from_slot(DF_FontSlot_Main)) ui_labelf("Kill all target processes"); } if(ui_clicked(sig)) @@ -5492,22 +5474,22 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) if(ui_hovering(sig) && !can_step && can_pause) { UI_Tooltip - DF_Font(ws, DF_FontSlot_Main) - UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Main)) + DF_Font(DF_FontSlot_Main) + UI_FontSize(df_font_size_from_slot(DF_FontSlot_Main)) ui_labelf("Disabled: Running"); } if(ui_hovering(sig) && !can_step && !can_stop) { UI_Tooltip - DF_Font(ws, DF_FontSlot_Main) - UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Main)) + DF_Font(DF_FontSlot_Main) + UI_FontSize(df_font_size_from_slot(DF_FontSlot_Main)) ui_labelf("Disabled: No processes are running"); } if(ui_hovering(sig) && can_step) { UI_Tooltip - DF_Font(ws, DF_FontSlot_Main) - UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Main)) + DF_Font(DF_FontSlot_Main) + UI_FontSize(df_font_size_from_slot(DF_FontSlot_Main)) ui_labelf("Step Over"); } if(ui_clicked(sig)) @@ -5524,22 +5506,22 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) if(ui_hovering(sig) && !can_step && can_pause) { UI_Tooltip - DF_Font(ws, DF_FontSlot_Main) - UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Main)) + DF_Font(DF_FontSlot_Main) + UI_FontSize(df_font_size_from_slot(DF_FontSlot_Main)) ui_labelf("Disabled: Running"); } if(ui_hovering(sig) && !can_step && !can_stop) { UI_Tooltip - DF_Font(ws, DF_FontSlot_Main) - UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Main)) + DF_Font(DF_FontSlot_Main) + UI_FontSize(df_font_size_from_slot(DF_FontSlot_Main)) ui_labelf("Disabled: No processes are running"); } if(ui_hovering(sig) && can_step) { UI_Tooltip - DF_Font(ws, DF_FontSlot_Main) - UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Main)) + DF_Font(DF_FontSlot_Main) + UI_FontSize(df_font_size_from_slot(DF_FontSlot_Main)) ui_labelf("Step Into"); } if(ui_clicked(sig)) @@ -5556,22 +5538,22 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) if(ui_hovering(sig) && !can_step && can_pause) { UI_Tooltip - DF_Font(ws, DF_FontSlot_Main) - UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Main)) + DF_Font(DF_FontSlot_Main) + UI_FontSize(df_font_size_from_slot(DF_FontSlot_Main)) ui_labelf("Disabled: Running"); } if(ui_hovering(sig) && !can_step && !can_stop) { UI_Tooltip - DF_Font(ws, DF_FontSlot_Main) - UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Main)) + DF_Font(DF_FontSlot_Main) + UI_FontSize(df_font_size_from_slot(DF_FontSlot_Main)) ui_labelf("Disabled: No processes are running"); } if(ui_hovering(sig) && can_step) { UI_Tooltip - DF_Font(ws, DF_FontSlot_Main) - UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Main)) + DF_Font(DF_FontSlot_Main) + UI_FontSize(df_font_size_from_slot(DF_FontSlot_Main)) ui_labelf("Step Out"); } if(ui_clicked(sig)) @@ -5591,7 +5573,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) ui_spacer(ui_pct(1, 0)); // rjf: loaded user viz - if(do_user_prof) DF_Palette(ws, DF_PaletteCode_NeutralPopButton) + if(do_user_prof) DF_Palette(DF_PaletteCode_NeutralPopButton) { ui_set_next_pref_width(ui_children_sum(1)); ui_set_next_child_layout_axis(Axis2_X); @@ -5607,8 +5589,8 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) { String8 user_path = d_cfg_path_from_src(D_CfgSrc_User); user_path = str8_chop_last_dot(user_path); - DF_Font(ws, DF_FontSlot_Icons) - UI_TextRasterFlags(df_raster_flags_from_slot(ws, DF_FontSlot_Icons)) + DF_Font(DF_FontSlot_Icons) + UI_TextRasterFlags(df_raster_flags_from_slot(DF_FontSlot_Icons)) ui_label(df_g_icon_kind_text_table[DF_IconKind_Person]); ui_label(str8_skip_last_slash(user_path)); } @@ -5625,7 +5607,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) } // rjf: loaded project viz - if(do_user_prof) DF_Palette(ws, DF_PaletteCode_NeutralPopButton) + if(do_user_prof) DF_Palette(DF_PaletteCode_NeutralPopButton) { ui_set_next_pref_width(ui_children_sum(1)); ui_set_next_child_layout_axis(Axis2_X); @@ -5641,7 +5623,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) { String8 prof_path = d_cfg_path_from_src(D_CfgSrc_Project); prof_path = str8_chop_last_dot(prof_path); - DF_Font(ws, DF_FontSlot_Icons) + DF_Font(DF_FontSlot_Icons) ui_label(df_g_icon_kind_text_table[DF_IconKind_Briefcase]); ui_label(str8_skip_last_slash(prof_path)); } @@ -5666,13 +5648,13 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) F32 button_dim = floor_f32(bar_dim.y); UI_PrefWidth(ui_px(button_dim, 1.f)) { - min_sig = df_icon_buttonf(ws, DF_IconKind_Minus, 0, "##minimize"); - max_sig = df_icon_buttonf(ws, DF_IconKind_Window, 0, "##maximize"); + min_sig = df_icon_buttonf(DF_IconKind_Minus, 0, "##minimize"); + max_sig = df_icon_buttonf(DF_IconKind_Window, 0, "##maximize"); } UI_PrefWidth(ui_px(button_dim, 1.f)) - DF_Palette(ws, DF_PaletteCode_NegativePopButton) + DF_Palette(DF_PaletteCode_NegativePopButton) { - cls_sig = df_icon_buttonf(ws, DF_IconKind_X, 0, "##close"); + cls_sig = df_icon_buttonf(DF_IconKind_X, 0, "##close"); } if(ui_clicked(min_sig)) { @@ -5701,9 +5683,9 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) { B32 is_running = d_ctrl_targets_running() && d_ctrl_last_run_frame_idx() < d_frame_index(); CTRL_Event stop_event = d_ctrl_last_stop_event(); - UI_Palette *positive_scheme = df_palette_from_code(ws, DF_PaletteCode_PositivePopButton); - UI_Palette *running_scheme = df_palette_from_code(ws, DF_PaletteCode_NeutralPopButton); - UI_Palette *negative_scheme = df_palette_from_code(ws, DF_PaletteCode_NegativePopButton); + UI_Palette *positive_scheme = df_palette_from_code(DF_PaletteCode_PositivePopButton); + UI_Palette *running_scheme = df_palette_from_code(DF_PaletteCode_NeutralPopButton); + UI_Palette *negative_scheme = df_palette_from_code(DF_PaletteCode_NegativePopButton); UI_Palette *palette = running_scheme; if(!is_running) { @@ -5772,8 +5754,8 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) if(icon != DF_IconKind_Null) { UI_PrefWidth(ui_em(2.25f, 1.f)) - DF_Font(ws, DF_FontSlot_Icons) - UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Icons)) + DF_Font(DF_FontSlot_Icons) + UI_FontSize(df_font_size_from_slot(DF_FontSlot_Icons)) ui_label(df_g_icon_kind_text_table[icon]); } UI_PrefWidth(ui_text_dim(10, 1)) ui_label(explanation); @@ -5790,7 +5772,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) UI_Flags(UI_BoxFlag_DrawBackground) UI_TextAlignment(UI_TextAlign_Center) UI_CornerRadius(4) - DF_Palette(ws, DF_PaletteCode_NeutralPopButton) + DF_Palette(DF_PaletteCode_NeutralPopButton) ui_labelf("Currently rebinding \"%S\" hotkey", df_state->bind_change_cmd_spec->info.display_name); } @@ -5808,8 +5790,8 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) UI_PrefWidth(ui_text_dim(10, 1)) UI_TextAlignment(UI_TextAlign_Center) { - DF_Font(ws, DF_FontSlot_Icons) - UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Icons)) + DF_Font(DF_FontSlot_Icons) + UI_FontSize(df_font_size_from_slot(DF_FontSlot_Icons)) ui_label(df_g_icon_kind_text_table[DF_IconKind_WarningBig]); df_label(error_string); } @@ -5858,7 +5840,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) // rjf: construct & push new view DF_View *view = df_view_alloc(); - df_view_equip_spec(ws, view, view_spec, default_query, &md_nil_node); + df_view_equip_spec(view, view_spec, default_query, &md_nil_node); if(cmd_spec->info.query.flags & D_CmdQueryFlag_SelectOldInput) { view->query_mark = txt_pt(1, 1); @@ -5875,7 +5857,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) //- rjf: animate query info // { - F32 rate = df_setting_val_from_code(ws, DF_SettingCode_MenuAnimations).s32 ? 1 - pow_f32(2, (-60.f * d_dt())) : 1.f; + F32 rate = df_setting_val_from_code(DF_SettingCode_MenuAnimations).s32 ? 1 - pow_f32(2, (-60.f * d_dt())) : 1.f; // rjf: animate query view selection transition { @@ -5913,7 +5895,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) // if(!df_view_is_nil(ws->query_view_stack_top)) UI_Focus((window_is_focused && !ui_any_ctx_menu_is_open() && !ws->menu_bar_focused && ws->query_view_selected) ? UI_FocusKind_On : UI_FocusKind_Off) - DF_Palette(ws, DF_PaletteCode_Floating) + DF_Palette(DF_PaletteCode_Floating) { DF_View *view = ws->query_view_stack_top; D_CmdSpec *cmd_spec = ws->query_cmd_spec; @@ -5974,14 +5956,14 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) DF_IconKind icon_kind = df_cmd_kind_icon_kind_table[cmd_kind]; if(icon_kind != DF_IconKind_Null) { - DF_Font(ws, DF_FontSlot_Icons) ui_label(df_g_icon_kind_text_table[icon_kind]); + DF_Font(DF_FontSlot_Icons) ui_label(df_g_icon_kind_text_table[icon_kind]); } ui_labelf("%S", ws->query_cmd_spec->info.display_name); } - DF_Font(ws, (query->flags & D_CmdQueryFlag_CodeInput) ? DF_FontSlot_Code : DF_FontSlot_Main) + DF_Font((query->flags & D_CmdQueryFlag_CodeInput) ? DF_FontSlot_Code : DF_FontSlot_Main) UI_TextPadding(ui_top_font_size()*0.5f) { - UI_Signal sig = df_line_edit(ws, DF_LineEditFlag_Border| + UI_Signal sig = df_line_edit(DF_LineEditFlag_Border| (DF_LineEditFlag_CodeContents * !!(query->flags & D_CmdQueryFlag_CodeInput)), 0, 0, @@ -5998,16 +5980,16 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) ws->query_view_selected = 1; } } - UI_PrefWidth(ui_em(5.f, 1.f)) UI_Focus(UI_FocusKind_Off) DF_Palette(ws, DF_PaletteCode_PositivePopButton) + UI_PrefWidth(ui_em(5.f, 1.f)) UI_Focus(UI_FocusKind_Off) DF_Palette(DF_PaletteCode_PositivePopButton) { - if(ui_clicked(df_icon_buttonf(ws, DF_IconKind_RightArrow, 0, "##complete_query"))) + if(ui_clicked(df_icon_buttonf(DF_IconKind_RightArrow, 0, "##complete_query"))) { query_completed = 1; } } - UI_PrefWidth(ui_em(3.f, 1.f)) UI_Focus(UI_FocusKind_Off) DF_Palette(ws, DF_PaletteCode_PlainButton) + UI_PrefWidth(ui_em(3.f, 1.f)) UI_Focus(UI_FocusKind_Off) DF_Palette(DF_PaletteCode_PlainButton) { - if(ui_clicked(df_icon_buttonf(ws, DF_IconKind_X, 0, "##cancel_query"))) + if(ui_clicked(df_icon_buttonf(DF_IconKind_X, 0, "##cancel_query"))) { query_cancelled = 1; } @@ -6020,7 +6002,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) { DF_ViewSpec *view_spec = view->spec; DF_ViewUIFunctionType *build_view_ui_function = view_spec->info.ui_hook; - build_view_ui_function(ws, &df_nil_panel, view, view->params_roots[view->params_read_gen%ArrayCount(view->params_roots)], str8(view->query_buffer, view->query_string_size), query_container_content_rect); + 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); } //- rjf: query submission @@ -6109,9 +6091,9 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) // rjf: build hover eval if(build_hover_eval && ws->hover_eval_string.size != 0 && hover_eval_is_open) - DF_Font(ws, DF_FontSlot_Code) - UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Main)) - DF_Palette(ws, DF_PaletteCode_Floating) + DF_Font(DF_FontSlot_Code) + UI_FontSize(df_font_size_from_slot(DF_FontSlot_Main)) + DF_Palette(DF_PaletteCode_Floating) { Temp scratch = scratch_begin(&arena, 1); DI_Scope *scope = di_scope_open(); @@ -6143,7 +6125,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) { // rjf: animate height { - F32 fish_rate = df_setting_val_from_code(ws, DF_SettingCode_MenuAnimations).s32 ? 1 - pow_f32(2, (-60.f * d_dt())) : 1.f; + F32 fish_rate = df_setting_val_from_code(DF_SettingCode_MenuAnimations).s32 ? 1 - pow_f32(2, (-60.f * d_dt())) : 1.f; F32 hover_eval_container_height_target = row_height * Min(30, viz_blocks.total_visual_row_count); ws->hover_eval_num_visible_rows_t += (hover_eval_container_height_target - ws->hover_eval_num_visible_rows_t) * fish_rate; if(abs_f32(hover_eval_container_height_target - ws->hover_eval_num_visible_rows_t) > 0.5f) @@ -6158,7 +6140,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) // rjf: animate open { - F32 fish_rate = df_setting_val_from_code(ws, DF_SettingCode_MenuAnimations).s32 ? 1 - pow_f32(2, (-60.f * d_dt())) : 1.f; + F32 fish_rate = df_setting_val_from_code(DF_SettingCode_MenuAnimations).s32 ? 1 - pow_f32(2, (-60.f * d_dt())) : 1.f; F32 diff = 1.f - ws->hover_eval_open_t; ws->hover_eval_open_t += diff*fish_rate; if(abs_f32(diff) < 0.01f) @@ -6288,10 +6270,10 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) { UI_PrefWidth(ui_em(1.5f, 1)) UI_Flags(UI_BoxFlag_DrawTextWeak) - DF_Font(ws, DF_FontSlot_Icons) + DF_Font(DF_FontSlot_Icons) ui_label(df_g_icon_kind_text_table[DF_IconKind_Dot]); } - UI_WidthFill UI_TextRasterFlags(df_raster_flags_from_slot(ws, DF_FontSlot_Code)) + UI_WidthFill UI_TextRasterFlags(df_raster_flags_from_slot(DF_FontSlot_Code)) { UI_PrefWidth(ui_px(expr_column_width_px, 1.f)) df_code_label(1.f, 1, df_rgba_from_theme_color(DF_ThemeColor_CodeDefault), row_expr_string); ui_spacer(ui_em(1.5f, 1.f)); @@ -6302,7 +6284,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) Vec4F32 rgba = df_rgba_from_theme_color(DF_ThemeColor_HighlightOverlay); ui_set_next_palette(ui_build_palette(ui_top_palette(), .background = rgba)); } - UI_Signal sig = df_line_editf(ws, DF_LineEditFlag_CodeContents| + UI_Signal sig = df_line_editf(DF_LineEditFlag_CodeContents| DF_LineEditFlag_DisplayStringIsCode| DF_LineEditFlag_PreferDisplayString| DF_LineEditFlag_Border, @@ -6340,8 +6322,8 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) UI_CornerRadius10(0) UI_CornerRadius11(0) { - UI_Signal watch_sig = df_icon_buttonf(ws, DF_IconKind_List, 0, "###watch_hover_eval"); - if(ui_hovering(watch_sig)) UI_Tooltip DF_Font(ws, DF_FontSlot_Main) UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Main)) + UI_Signal watch_sig = df_icon_buttonf(DF_IconKind_List, 0, "###watch_hover_eval"); + if(ui_hovering(watch_sig)) UI_Tooltip DF_Font(DF_FontSlot_Main) UI_FontSize(df_font_size_from_slot(DF_FontSlot_Main)) { ui_labelf("Add the hovered expression to an opened watch view."); } @@ -6355,8 +6337,8 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) UI_CornerRadius10(corner_radius) UI_CornerRadius11(corner_radius) { - UI_Signal pin_sig = df_icon_buttonf(ws, DF_IconKind_Pin, 0, "###pin_hover_eval"); - if(ui_hovering(pin_sig)) UI_Tooltip DF_Font(ws, DF_FontSlot_Main) UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Main)) + UI_Signal pin_sig = df_icon_buttonf(DF_IconKind_Pin, 0, "###pin_hover_eval"); + if(ui_hovering(pin_sig)) UI_Tooltip DF_Font(DF_FontSlot_Main) UI_FontSize(df_font_size_from_slot(DF_FontSlot_Main)) UI_CornerRadius00(0) UI_CornerRadius01(0) UI_CornerRadius10(0) @@ -6499,7 +6481,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) future_split_rect.p1.v[axis] += drop_site_major_dim_px; future_split_rect.p0.v[axis2_flip(axis)] = panel_rect.p0.v[axis2_flip(axis)]; future_split_rect.p1.v[axis2_flip(axis)] = panel_rect.p1.v[axis2_flip(axis)]; - UI_Rect(future_split_rect) DF_Palette(ws, DF_PaletteCode_DropSiteOverlay) + UI_Rect(future_split_rect) DF_Palette(DF_PaletteCode_DropSiteOverlay) { ui_build_box_from_key(UI_BoxFlag_DrawBackground, ui_key_zero()); } @@ -6583,7 +6565,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) future_split_rect.p1.v[split_axis] += drop_site_major_dim_px; future_split_rect.p0.v[axis2_flip(split_axis)] = child_rect.p0.v[axis2_flip(split_axis)]; future_split_rect.p1.v[axis2_flip(split_axis)] = child_rect.p1.v[axis2_flip(split_axis)]; - UI_Rect(future_split_rect) DF_Palette(ws, DF_PaletteCode_DropSiteOverlay) + UI_Rect(future_split_rect) DF_Palette(DF_PaletteCode_DropSiteOverlay) { ui_build_box_from_key(UI_BoxFlag_DrawBackground, ui_key_zero()); } @@ -6678,10 +6660,6 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) max_child->pct_of_parent = max_pct__after; is_changing_panel_boundaries = 1; } - if(ui_released(sig) || ui_double_clicked(sig)) - { - df_panel_notify_mutation(ws, min_child); - } } } } @@ -6690,7 +6668,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) //- rjf: animate panels // { - F32 rate = df_setting_val_from_code(ws, DF_SettingCode_MenuAnimations).s32 ? 1 - pow_f32(2, (-50.f * d_dt())) : 1.f; + F32 rate = df_setting_val_from_code(DF_SettingCode_MenuAnimations).s32 ? 1 - pow_f32(2, (-50.f * d_dt())) : 1.f; Vec2F32 content_rect_dim = dim_2f32(content_rect); for(DF_Panel *panel = ws->root_panel; !df_panel_is_nil(panel); panel = df_panel_rec_df_pre(panel).next) { @@ -6873,10 +6851,10 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) UI_Box *row_or_column = ui_build_box_from_key(0, ui_key_zero()); UI_Parent(row_or_column) UI_Padding(ui_px(padding, 1.f)) { if(split_side == Side_Min) { ui_set_next_flags(UI_BoxFlag_DrawBackground); } - DF_Palette(ws, DF_PaletteCode_DropSiteOverlay) ui_build_box_from_key(UI_BoxFlag_DrawBorder, ui_key_zero()); + DF_Palette(DF_PaletteCode_DropSiteOverlay) ui_build_box_from_key(UI_BoxFlag_DrawBorder, ui_key_zero()); ui_spacer(ui_px(padding, 1.f)); if(split_side == Side_Max) { ui_set_next_flags(UI_BoxFlag_DrawBackground); } - DF_Palette(ws, DF_PaletteCode_DropSiteOverlay) ui_build_box_from_key(UI_BoxFlag_DrawBorder, ui_key_zero()); + DF_Palette(DF_PaletteCode_DropSiteOverlay) ui_build_box_from_key(UI_BoxFlag_DrawBorder, ui_key_zero()); } } } @@ -6886,7 +6864,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) { ui_set_next_child_layout_axis(split_axis); UI_Box *row_or_column = ui_build_box_from_key(0, ui_key_zero()); - UI_Parent(row_or_column) UI_Padding(ui_px(padding, 1.f)) DF_Palette(ws, DF_PaletteCode_DropSiteOverlay) + UI_Parent(row_or_column) UI_Padding(ui_px(padding, 1.f)) DF_Palette(DF_PaletteCode_DropSiteOverlay) { ui_build_box_from_key(UI_BoxFlag_DrawBorder|UI_BoxFlag_DrawBackground, ui_key_zero()); } @@ -6927,7 +6905,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) Vec2F32 panel_center = center_2f32(panel_rect); future_split_rect.v[side_flip(split_side)].v[split_axis] = panel_center.v[split_axis]; } - UI_Rect(future_split_rect) DF_Palette(ws, DF_PaletteCode_DropSiteOverlay) + UI_Rect(future_split_rect) DF_Palette(DF_PaletteCode_DropSiteOverlay) { ui_build_box_from_key(UI_BoxFlag_DrawBackground, ui_key_zero()); } @@ -6974,7 +6952,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) { UI_PrefWidth(ui_em(3.f, 1.f)) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) - DF_Font(ws, DF_FontSlot_Icons) + DF_Font(DF_FontSlot_Icons) UI_TextAlignment(UI_TextAlign_Center) ui_label(df_g_icon_kind_text_table[DF_IconKind_Find]); UI_PrefWidth(ui_text_dim(10, 1)) @@ -6982,12 +6960,11 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) ui_label(str8_lit("Filter")); } ui_spacer(ui_em(0.5f, 1.f)); - DF_Font(ws, view->spec->info.flags & DF_ViewSpecFlag_FilterIsCode ? DF_FontSlot_Code : DF_FontSlot_Main) + DF_Font(view->spec->info.flags & DF_ViewSpecFlag_FilterIsCode ? DF_FontSlot_Code : DF_FontSlot_Main) UI_Focus(view->is_filtering ? UI_FocusKind_On : UI_FocusKind_Off) UI_TextPadding(ui_top_font_size()*0.5f) { - UI_Signal sig = df_line_edit(ws, - DF_LineEditFlag_CodeContents*!!(view->spec->info.flags & DF_ViewSpecFlag_FilterIsCode), + UI_Signal sig = df_line_edit(DF_LineEditFlag_CodeContents*!!(view->spec->info.flags & DF_ViewSpecFlag_FilterIsCode), 0, 0, &view->query_cursor, @@ -7073,7 +7050,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) //- rjf: build empty view UI_Parent(view_container_box) if(df_view_is_nil(df_selected_tab_from_panel(panel))) { - DF_VIEW_UI_FUNCTION_NAME(empty)(ws, panel, &df_nil_view, &md_nil_node, str8_zero(), content_rect); + DF_VIEW_UI_FUNCTION_NAME(empty)(&df_nil_view, &md_nil_node, str8_zero(), content_rect); } //- rjf: build tab view @@ -7081,7 +7058,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) { DF_View *view = df_selected_tab_from_panel(panel); DF_ViewUIFunctionType *build_view_ui_function = view->spec->info.ui_hook; - build_view_ui_function(ws, panel, view, view->params_roots[view->params_read_gen%ArrayCount(view->params_roots)], str8(view->query_buffer, view->query_string_size), content_rect); + 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); } //- rjf: pop interaction registers; commit if this is the selected view @@ -7200,7 +7177,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) ui_spacer(ui_em(0.2f, 1.f)); UI_CornerRadius00(corner_radius) UI_CornerRadius10(corner_radius) - DF_Palette(ws, DF_PaletteCode_DropSiteOverlay) + DF_Palette(DF_PaletteCode_DropSiteOverlay) { ui_build_box_from_key(UI_BoxFlag_DrawBackground|UI_BoxFlag_DrawBorder, ui_key_zero()); } @@ -7224,7 +7201,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) UI_Box *tab_column_box = ui_build_box_from_stringf(!is_changing_panel_boundaries*UI_BoxFlag_AnimatePosX, "tab_column_%p", view); // rjf: build tab container box - UI_Parent(tab_column_box) UI_PrefHeight(ui_px(tab_bar_vheight, 1)) DF_Palette(ws, view_is_selected ? DF_PaletteCode_Tab : DF_PaletteCode_TabInactive) + UI_Parent(tab_column_box) UI_PrefHeight(ui_px(tab_bar_vheight, 1)) DF_Palette(view_is_selected ? DF_PaletteCode_Tab : DF_PaletteCode_TabInactive) { if(panel->tab_side == Side_Max) { @@ -7251,7 +7228,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) if(icon_kind != DF_IconKind_Null) { UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) - DF_Font(ws, DF_FontSlot_Icons) + DF_Font(DF_FontSlot_Icons) UI_TextAlignment(UI_TextAlign_Center) UI_PrefWidth(ui_em(1.75f, 1.f)) ui_label(df_g_icon_kind_text_table[icon_kind]); @@ -7263,8 +7240,8 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) } } UI_PrefWidth(ui_em(2.35f, 1.f)) UI_TextAlignment(UI_TextAlign_Center) - DF_Font(ws, DF_FontSlot_Icons) - UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Icons)*0.75f) + DF_Font(DF_FontSlot_Icons) + UI_FontSize(df_font_size_from_slot(DF_FontSlot_Icons)*0.75f) UI_Flags(UI_BoxFlag_DrawTextWeak) UI_CornerRadius00(0) UI_CornerRadius01(0) @@ -7300,7 +7277,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) } else if(ui_right_clicked(sig)) { - ui_ctx_menu_open(ws->tab_ctx_menu_key, sig.box->key, v2f32(0, sig.box->rect.y1 - sig.box->rect.y0)); + ui_ctx_menu_open(df_state->tab_ctx_menu_key, sig.box->key, v2f32(0, sig.box->rect.y1 - sig.box->rect.y0)); ws->tab_ctx_menu_panel = df_handle_from_panel(panel); ws->tab_ctx_menu_view = df_handle_from_view(view); } @@ -7308,10 +7285,6 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) { d_cmd(D_CmdKind_CloseTab, .panel = df_handle_from_panel(panel), .view = df_handle_from_view(view)); } - if(ui_released(sig)) - { - df_panel_notify_mutation(ws, panel); - } } } @@ -7344,11 +7317,11 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) UI_CornerRadius10(panel->tab_side == Side_Min ? corner_radius : 0) UI_CornerRadius01(panel->tab_side == Side_Max ? corner_radius : 0) UI_CornerRadius11(panel->tab_side == Side_Max ? corner_radius : 0) - DF_Font(ws, DF_FontSlot_Icons) + DF_Font(DF_FontSlot_Icons) UI_FontSize(ui_top_font_size()) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_HoverCursor(OS_Cursor_HandPoint) - DF_Palette(ws, DF_PaletteCode_ImplicitButton) + DF_Palette(DF_PaletteCode_ImplicitButton) { UI_Box *add_new_box = ui_build_box_from_stringf(UI_BoxFlag_DrawBackground| UI_BoxFlag_DrawText| @@ -7418,7 +7391,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) DF_Panel *drag_panel = df_panel_from_handle(df_drag_drop_payload.panel); if(!df_view_is_nil(view) && active_drop_site != 0) { - DF_Palette(ws, DF_PaletteCode_DropSiteOverlay) UI_Rect(tab_bar_rect) + DF_Palette(DF_PaletteCode_DropSiteOverlay) UI_Rect(tab_bar_rect) ui_build_box_from_key(UI_BoxFlag_DrawBackground, ui_key_zero()); } @@ -7472,7 +7445,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) { // rjf: vis { - DF_Palette(ws, DF_PaletteCode_DropSiteOverlay) UI_Rect(content_rect) + DF_Palette(DF_PaletteCode_DropSiteOverlay) UI_Rect(content_rect) ui_build_box_from_key(UI_BoxFlag_DrawBackground, ui_key_zero()); } @@ -7493,7 +7466,6 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) .panel = df_handle_from_panel(src_panel), .dest_panel = df_handle_from_panel(panel), .view = df_handle_from_view(view)); - df_panel_notify_mutation(ws, panel); } // rjf: entity drop @@ -7585,8 +7557,8 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) } view->loading_t += (view->loading_t_target - view->loading_t) * rate; view->is_filtering_t += ((F32)!!view->is_filtering - view->is_filtering_t) * fast_rate; - view->scroll_pos.x.off -= view->scroll_pos.x.off * (df_setting_val_from_code(ws, DF_SettingCode_ScrollingAnimations).s32 ? fast_rate : 1.f); - view->scroll_pos.y.off -= view->scroll_pos.y.off * (df_setting_val_from_code(ws, DF_SettingCode_ScrollingAnimations).s32 ? fast_rate : 1.f); + view->scroll_pos.x.off -= view->scroll_pos.x.off * (df_setting_val_from_code(DF_SettingCode_ScrollingAnimations).s32 ? fast_rate : 1.f); + view->scroll_pos.y.off -= view->scroll_pos.y.off * (df_setting_val_from_code(DF_SettingCode_ScrollingAnimations).s32 ? fast_rate : 1.f); if(abs_f32(view->scroll_pos.x.off) < 0.01f) { view->scroll_pos.x.off = 0; @@ -7800,7 +7772,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, D_CmdList *cmds) } // rjf: blur background - if(box->flags & UI_BoxFlag_DrawBackgroundBlur && df_setting_val_from_code(ws, DF_SettingCode_BackgroundBlur).s32) + if(box->flags & UI_BoxFlag_DrawBackgroundBlur && df_setting_val_from_code(DF_SettingCode_BackgroundBlur).s32) { R_PassParams_Blur *params = dr_blur(box->rect, box->blur_size*(1-box->transparency), 0); MemoryCopyArray(params->corner_radii, box->corner_radii); @@ -8537,26 +8509,27 @@ df_value_string_from_eval(Arena *arena, D_EvalVizStringFlags flags, U32 default_ //~ rjf: Hover Eval internal void -df_set_hover_eval(DF_Window *ws, Vec2F32 pos, String8 file_path, TxtPt pt, U64 vaddr, String8 string) +df_set_hover_eval(Vec2F32 pos, String8 file_path, TxtPt pt, U64 vaddr, String8 string) { - if(ws->hover_eval_last_frame_idx+1 < d_frame_index() && + DF_Window *window = df_window_from_handle(d_interact_regs()->window); + if(window->hover_eval_last_frame_idx+1 < d_frame_index() && ui_key_match(ui_active_key(UI_MouseButtonKind_Left), ui_key_zero()) && ui_key_match(ui_active_key(UI_MouseButtonKind_Middle), ui_key_zero()) && ui_key_match(ui_active_key(UI_MouseButtonKind_Right), ui_key_zero())) { - B32 is_new_string = !str8_match(ws->hover_eval_string, string, 0); + B32 is_new_string = !str8_match(window->hover_eval_string, string, 0); if(is_new_string) { - ws->hover_eval_first_frame_idx = ws->hover_eval_last_frame_idx = d_frame_index(); - arena_clear(ws->hover_eval_arena); - ws->hover_eval_string = push_str8_copy(ws->hover_eval_arena, string); - ws->hover_eval_file_path = push_str8_copy(ws->hover_eval_arena, file_path); - ws->hover_eval_file_pt = pt; - ws->hover_eval_vaddr = vaddr; - ws->hover_eval_focused = 0; + window->hover_eval_first_frame_idx = window->hover_eval_last_frame_idx = d_frame_index(); + arena_clear(window->hover_eval_arena); + window->hover_eval_string = push_str8_copy(window->hover_eval_arena, string); + window->hover_eval_file_path = push_str8_copy(window->hover_eval_arena, file_path); + window->hover_eval_file_pt = pt; + window->hover_eval_vaddr = vaddr; + window->hover_eval_focused = 0; } - ws->hover_eval_spawn_pos = pos; - ws->hover_eval_last_frame_idx = d_frame_index(); + window->hover_eval_spawn_pos = pos; + window->hover_eval_last_frame_idx = d_frame_index(); } } @@ -8778,38 +8751,39 @@ df_view_rule_autocomp_lister_params_from_input_cursor(Arena *arena, String8 stri } internal void -df_set_autocomp_lister_query(DF_Window *ws, UI_Key root_key, DF_AutoCompListerParams *params, String8 input, U64 cursor_off) +df_set_autocomp_lister_query(UI_Key root_key, DF_AutoCompListerParams *params, String8 input, U64 cursor_off) { + DF_Window *window = df_window_from_handle(d_interact_regs()->window); String8 query = df_autocomp_query_word_from_input_string_off(input, cursor_off); - String8 current_query = str8(ws->autocomp_lister_query_buffer, ws->autocomp_lister_query_size); - if(cursor_off != ws->autocomp_cursor_off) + String8 current_query = str8(window->autocomp_lister_query_buffer, window->autocomp_lister_query_size); + if(cursor_off != window->autocomp_cursor_off) { - ws->autocomp_query_dirty = 1; - ws->autocomp_cursor_off = cursor_off; + window->autocomp_query_dirty = 1; + window->autocomp_cursor_off = cursor_off; } if(!str8_match(query, current_query, 0)) { - ws->autocomp_force_closed = 0; + window->autocomp_force_closed = 0; } - if(!ui_key_match(ws->autocomp_root_key, root_key)) + if(!ui_key_match(window->autocomp_root_key, root_key)) { - ws->autocomp_force_closed = 0; - ws->autocomp_num_visible_rows_t = 0; - ws->autocomp_open_t = 0; + window->autocomp_force_closed = 0; + window->autocomp_num_visible_rows_t = 0; + window->autocomp_open_t = 0; } - if(ws->autocomp_last_frame_idx+1 < d_frame_index()) + if(window->autocomp_last_frame_idx+1 < d_frame_index()) { - ws->autocomp_force_closed = 0; - ws->autocomp_num_visible_rows_t = 0; - ws->autocomp_open_t = 0; + window->autocomp_force_closed = 0; + window->autocomp_num_visible_rows_t = 0; + window->autocomp_open_t = 0; } - ws->autocomp_root_key = root_key; - arena_clear(ws->autocomp_lister_params_arena); - MemoryCopyStruct(&ws->autocomp_lister_params, params); - ws->autocomp_lister_params.strings = str8_list_copy(ws->autocomp_lister_params_arena, &ws->autocomp_lister_params.strings); - ws->autocomp_lister_query_size = Min(query.size, sizeof(ws->autocomp_lister_query_buffer)); - MemoryCopy(ws->autocomp_lister_query_buffer, query.str, ws->autocomp_lister_query_size); - ws->autocomp_last_frame_idx = d_frame_index(); + window->autocomp_root_key = root_key; + arena_clear(window->autocomp_lister_params_arena); + MemoryCopyStruct(&window->autocomp_lister_params, params); + window->autocomp_lister_params.strings = str8_list_copy(window->autocomp_lister_params_arena, &window->autocomp_lister_params.strings); + window->autocomp_lister_query_size = Min(query.size, sizeof(window->autocomp_lister_query_buffer)); + MemoryCopy(window->autocomp_lister_query_buffer, query.str, window->autocomp_lister_query_size); + window->autocomp_last_frame_idx = d_frame_index(); } //////////////////////////////// @@ -8994,9 +8968,10 @@ df_theme_color_from_txt_token_kind(TXT_TokenKind kind) //- rjf: code -> palette internal UI_Palette * -df_palette_from_code(DF_Window *ws, DF_PaletteCode code) +df_palette_from_code(DF_PaletteCode code) { - UI_Palette *result = &ws->cfg_palettes[code]; + DF_Window *window = df_window_from_handle(d_interact_regs()->window); + UI_Palette *result = &window->cfg_palettes[code]; return result; } @@ -9010,9 +8985,10 @@ df_font_from_slot(DF_FontSlot slot) } internal F32 -df_font_size_from_slot(DF_Window *ws, DF_FontSlot slot) +df_font_size_from_slot(DF_FontSlot slot) { F32 result = 0; + DF_Window *ws = df_window_from_handle(d_interact_regs()->window); F32 dpi = os_dpi_from_window(ws->os); if(dpi != ws->last_dpi) { @@ -9048,15 +9024,15 @@ df_font_size_from_slot(DF_Window *ws, DF_FontSlot slot) } internal FNT_RasterFlags -df_raster_flags_from_slot(DF_Window *ws, DF_FontSlot slot) +df_raster_flags_from_slot(DF_FontSlot slot) { FNT_RasterFlags flags = FNT_RasterFlag_Smooth|FNT_RasterFlag_Hinted; switch(slot) { default:{}break; case DF_FontSlot_Icons:{flags = FNT_RasterFlag_Smooth;}break; - case DF_FontSlot_Main: {flags = (!!df_setting_val_from_code(ws, DF_SettingCode_SmoothUIText).s32*FNT_RasterFlag_Smooth)|(!!df_setting_val_from_code(ws, DF_SettingCode_HintUIText).s32*FNT_RasterFlag_Hinted);}break; - case DF_FontSlot_Code: {flags = (!!df_setting_val_from_code(ws, DF_SettingCode_SmoothCodeText).s32*FNT_RasterFlag_Smooth)|(!!df_setting_val_from_code(ws, DF_SettingCode_HintCodeText).s32*FNT_RasterFlag_Hinted);}break; + case DF_FontSlot_Main: {flags = (!!df_setting_val_from_code(DF_SettingCode_SmoothUIText).s32*FNT_RasterFlag_Smooth)|(!!df_setting_val_from_code(DF_SettingCode_HintUIText).s32*FNT_RasterFlag_Hinted);}break; + case DF_FontSlot_Code: {flags = (!!df_setting_val_from_code(DF_SettingCode_SmoothCodeText).s32*FNT_RasterFlag_Smooth)|(!!df_setting_val_from_code(DF_SettingCode_HintCodeText).s32*FNT_RasterFlag_Hinted);}break; } return flags; } @@ -9064,12 +9040,13 @@ df_raster_flags_from_slot(DF_Window *ws, DF_FontSlot slot) //- rjf: settings internal DF_SettingVal -df_setting_val_from_code(DF_Window *optional_window, DF_SettingCode code) +df_setting_val_from_code(DF_SettingCode code) { + DF_Window *window = df_window_from_handle(d_interact_regs()->window); DF_SettingVal result = {0}; - if(optional_window != 0) + if(window != 0) { - result = optional_window->setting_vals[code]; + result = window->setting_vals[code]; } if(result.set == 0) { @@ -9677,7 +9654,7 @@ df_loading_overlay(Rng2F32 rect, F32 loading_t, U64 progress_v, U64 progress_v_t //~ rjf: UI Widgets: Fancy Buttons internal void -df_cmd_binding_buttons(DF_Window *ws, D_CmdSpec *spec) +df_cmd_binding_buttons(D_CmdSpec *spec) { Temp scratch = scratch_begin(0, 0); DF_BindingList bindings = df_bindings_from_spec(scratch.arena, spec); @@ -9799,7 +9776,7 @@ df_cmd_binding_buttons(DF_Window *ws, D_CmdSpec *spec) .text = df_rgba_from_theme_color(DF_ThemeColor_Text))) { ui_set_next_group_key(ui_key_zero()); - UI_Signal sig = df_icon_button(ws, DF_IconKind_X, 0, str8_lit("###delete_binding")); + UI_Signal sig = df_icon_button(DF_IconKind_X, 0, str8_lit("###delete_binding")); if(ui_clicked(sig)) { df_unbind_spec(spec, binding); @@ -9812,7 +9789,7 @@ df_cmd_binding_buttons(DF_Window *ws, D_CmdSpec *spec) } //- rjf: build "add new binding" button - DF_Font(ws, DF_FontSlot_Icons) + DF_Font(DF_FontSlot_Icons) { UI_Palette *palette = ui_top_palette(); B32 adding_new_binding = (df_state->bind_change_active && @@ -9867,7 +9844,7 @@ df_menu_bar_button(String8 string) } internal UI_Signal -df_cmd_spec_button(DF_Window *ws, D_CmdSpec *spec) +df_cmd_spec_button(D_CmdSpec *spec) { ui_set_next_hover_cursor(OS_Cursor_HandPoint); ui_set_next_child_layout_axis(Axis2_X); @@ -9883,7 +9860,7 @@ df_cmd_spec_button(DF_Window *ws, D_CmdSpec *spec) DF_IconKind canonical_icon = df_cmd_kind_icon_kind_table[kind]; if(canonical_icon != DF_IconKind_Null) { - DF_Font(ws, DF_FontSlot_Icons) + DF_Font(DF_FontSlot_Icons) UI_PrefWidth(ui_em(2.f, 1.f)) UI_TextAlignment(UI_TextAlign_Center) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) @@ -9904,7 +9881,7 @@ df_cmd_spec_button(DF_Window *ws, D_CmdSpec *spec) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_FastpathCodepoint(0) { - df_cmd_binding_buttons(ws, spec); + df_cmd_binding_buttons(spec); } } } @@ -9913,26 +9890,27 @@ df_cmd_spec_button(DF_Window *ws, D_CmdSpec *spec) } internal void -df_cmd_list_menu_buttons(DF_Window *ws, U64 count, D_CmdKind *cmds, U32 *fastpath_codepoints) +df_cmd_list_menu_buttons(U64 count, D_CmdKind *cmds, U32 *fastpath_codepoints) { Temp scratch = scratch_begin(0, 0); for(U64 idx = 0; idx < count; idx += 1) { D_CmdSpec *spec = d_cmd_spec_from_kind(cmds[idx]); ui_set_next_fastpath_codepoint(fastpath_codepoints[idx]); - UI_Signal sig = df_cmd_spec_button(ws, spec); + UI_Signal sig = df_cmd_spec_button(spec); if(ui_clicked(sig)) { d_cmd(D_CmdKind_RunCommand, .cmd_spec = spec); ui_ctx_menu_close(); - ws->menu_bar_focused = 0; + DF_Window *window = df_window_from_handle(d_interact_regs()->window); + window->menu_bar_focused = 0; } } scratch_end(scratch); } internal UI_Signal -df_icon_button(DF_Window *ws, DF_IconKind kind, FuzzyMatchRangeList *matches, String8 string) +df_icon_button(DF_IconKind kind, FuzzyMatchRangeList *matches, String8 string) { String8 display_string = ui_display_part_from_key_string(string); ui_set_next_hover_cursor(OS_Cursor_HandPoint); @@ -9954,7 +9932,7 @@ df_icon_button(DF_Window *ws, DF_IconKind kind, FuzzyMatchRangeList *matches, St ui_spacer(ui_em(1.f, 1.f)); } UI_TextAlignment(UI_TextAlign_Center) - DF_Font(ws, DF_FontSlot_Icons) + DF_Font(DF_FontSlot_Icons) UI_PrefWidth(ui_em(2.f, 1.f)) UI_PrefHeight(ui_pct(1, 0)) UI_FlagsAdd(UI_BoxFlag_DisableTextTrunc|UI_BoxFlag_DrawTextWeak) @@ -9984,23 +9962,23 @@ df_icon_button(DF_Window *ws, DF_IconKind kind, FuzzyMatchRangeList *matches, St } internal UI_Signal -df_icon_buttonf(DF_Window *ws, DF_IconKind kind, FuzzyMatchRangeList *matches, char *fmt, ...) +df_icon_buttonf(DF_IconKind kind, FuzzyMatchRangeList *matches, char *fmt, ...) { Temp scratch = scratch_begin(0, 0); va_list args; va_start(args, fmt); String8 string = push_str8fv(scratch.arena, fmt, args); va_end(args); - UI_Signal sig = df_icon_button(ws, kind, matches, string); + UI_Signal sig = df_icon_button(kind, matches, string); scratch_end(scratch); return sig; } internal void -df_entity_tooltips(DF_Window *ws, D_Entity *entity) +df_entity_tooltips(D_Entity *entity) { Temp scratch = scratch_begin(0, 0); - DF_Palette(ws, DF_PaletteCode_Floating) switch(entity->kind) + DF_Palette(DF_PaletteCode_Floating) switch(entity->kind) { default:{}break; case D_EntityKind_File: @@ -10046,7 +10024,7 @@ df_entity_tooltips(DF_Window *ws, D_Entity *entity) UI_PrefWidth(ui_children_sum(1)) UI_Row UI_Palette(palette) { UI_PrefWidth(ui_em(1.5f, 1.f)) - DF_Font(ws, DF_FontSlot_Icons) + DF_Font(DF_FontSlot_Icons) ui_label(df_g_icon_kind_text_table[icon_kind]); UI_PrefWidth(ui_text_dim(10, 1)) ui_label(explanation); } @@ -10084,18 +10062,18 @@ df_entity_tooltips(DF_Window *ws, D_Entity *entity) { String8 name = {0}; name.str = rdi_string_from_idx(rdi, fin->inline_site->name_string_idx, &name.size); - DF_Font(ws, DF_FontSlot_Code) UI_PrefWidth(ui_em(18.f, 1.f)) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_labelf("0x%I64x", rip_vaddr); - DF_Font(ws, DF_FontSlot_Code) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_PrefWidth(ui_text_dim(10, 1)) ui_label(str8_lit("[inlined]")); + DF_Font(DF_FontSlot_Code) UI_PrefWidth(ui_em(18.f, 1.f)) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_labelf("0x%I64x", rip_vaddr); + DF_Font(DF_FontSlot_Code) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_PrefWidth(ui_text_dim(10, 1)) ui_label(str8_lit("[inlined]")); if(name.size != 0) { - DF_Font(ws, DF_FontSlot_Code) UI_PrefWidth(ui_text_dim(10, 1)) + DF_Font(DF_FontSlot_Code) UI_PrefWidth(ui_text_dim(10, 1)) { df_code_label(1.f, 0, df_rgba_from_theme_color(DF_ThemeColor_CodeSymbol), name); } } else { - DF_Font(ws, DF_FontSlot_Code) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_PrefWidth(ui_text_dim(10, 1)) ui_labelf("[??? in %S]", module_name); + DF_Font(DF_FontSlot_Code) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_PrefWidth(ui_text_dim(10, 1)) ui_labelf("[??? in %S]", module_name); } } @@ -10104,17 +10082,17 @@ df_entity_tooltips(DF_Window *ws, D_Entity *entity) { String8 name = {0}; name.str = rdi_name_from_procedure(rdi, procedure, &name.size); - DF_Font(ws, DF_FontSlot_Code) UI_PrefWidth(ui_em(18.f, 1.f)) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_labelf("0x%I64x", rip_vaddr); + DF_Font(DF_FontSlot_Code) UI_PrefWidth(ui_em(18.f, 1.f)) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_labelf("0x%I64x", rip_vaddr); if(name.size != 0) { - DF_Font(ws, DF_FontSlot_Code) UI_PrefWidth(ui_text_dim(10, 1)) + DF_Font(DF_FontSlot_Code) UI_PrefWidth(ui_text_dim(10, 1)) { df_code_label(1.f, 0, df_rgba_from_theme_color(DF_ThemeColor_CodeSymbol), name); } } else { - DF_Font(ws, DF_FontSlot_Code) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_PrefWidth(ui_text_dim(10, 1)) ui_labelf("[??? in %S]", module_name); + DF_Font(DF_FontSlot_Code) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_PrefWidth(ui_text_dim(10, 1)) ui_labelf("[??? in %S]", module_name); } } } @@ -10137,18 +10115,18 @@ df_entity_tooltips(DF_Window *ws, D_Entity *entity) stop_condition = str8_lit("true"); } UI_PrefWidth(ui_em(12.f, 1.f)) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_labelf("Stop Condition: "); - UI_PrefWidth(ui_text_dim(10, 1)) DF_Font(ws, DF_FontSlot_Code) df_code_label(1.f, 1, df_rgba_from_theme_color(DF_ThemeColor_CodeDefault), stop_condition); + UI_PrefWidth(ui_text_dim(10, 1)) DF_Font(DF_FontSlot_Code) df_code_label(1.f, 1, df_rgba_from_theme_color(DF_ThemeColor_CodeDefault), stop_condition); } UI_PrefWidth(ui_children_sum(1)) UI_Row { U64 hit_count = entity->u64; String8 hit_count_text = str8_from_u64(scratch.arena, hit_count, 10, 0, 0); UI_PrefWidth(ui_em(12.f, 1.f)) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_labelf("Hit Count: "); - UI_PrefWidth(ui_text_dim(10, 1)) DF_Font(ws, DF_FontSlot_Code) df_code_label(1.f, 1, df_rgba_from_theme_color(DF_ThemeColor_CodeDefault), hit_count_text); + UI_PrefWidth(ui_text_dim(10, 1)) DF_Font(DF_FontSlot_Code) df_code_label(1.f, 1, df_rgba_from_theme_color(DF_ThemeColor_CodeDefault), hit_count_text); } }break; case D_EntityKind_WatchPin: - DF_Font(ws, DF_FontSlot_Code) + DF_Font(DF_FontSlot_Code) UI_Tooltip UI_PrefWidth(ui_text_dim(10, 1)) { if(entity->flags & D_EntityFlag_HasColor) @@ -10163,7 +10141,7 @@ df_entity_tooltips(DF_Window *ws, D_Entity *entity) } internal UI_Signal -df_entity_desc_button(DF_Window *ws, D_Entity *entity, FuzzyMatchRangeList *name_matches, String8 fuzzy_query, B32 is_implicit) +df_entity_desc_button(D_Entity *entity, FuzzyMatchRangeList *name_matches, String8 fuzzy_query, B32 is_implicit) { ProfBeginFunction(); Temp scratch = scratch_begin(0, 0); @@ -10175,7 +10153,7 @@ df_entity_desc_button(DF_Window *ws, D_Entity *entity, FuzzyMatchRangeList *name D_Entity *selected_thread = d_entity_from_handle(d_base_interact_regs()->thread); if(selected_thread == entity) { - palette = df_palette_from_code(ws, DF_PaletteCode_NeutralPopButton); + palette = df_palette_from_code(DF_PaletteCode_NeutralPopButton); } if(stopped_thread == entity && (stop_event.cause == CTRL_EventCause_UserBreakpoint || @@ -10183,16 +10161,16 @@ df_entity_desc_button(DF_Window *ws, D_Entity *entity, FuzzyMatchRangeList *name stop_event.cause == CTRL_EventCause_InterruptedByTrap || stop_event.cause == CTRL_EventCause_InterruptedByHalt)) { - palette = df_palette_from_code(ws, DF_PaletteCode_NegativePopButton); + palette = df_palette_from_code(DF_PaletteCode_NegativePopButton); } } if(entity->cfg_src == D_CfgSrc_CommandLine) { - palette = df_palette_from_code(ws, DF_PaletteCode_NeutralPopButton); + palette = df_palette_from_code(DF_PaletteCode_NeutralPopButton); } else if(entity->kind == D_EntityKind_Target && !entity->disabled) { - palette = df_palette_from_code(ws, DF_PaletteCode_NeutralPopButton); + palette = df_palette_from_code(DF_PaletteCode_NeutralPopButton); } ui_set_next_palette(palette); ui_set_next_hover_cursor(OS_Cursor_HandPoint); @@ -10217,8 +10195,8 @@ df_entity_desc_button(DF_Window *ws, D_Entity *entity, FuzzyMatchRangeList *name entity_color_weak.w *= 0.5f; } UI_TextAlignment(UI_TextAlign_Center) - DF_Font(ws, DF_FontSlot_Icons) - UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Icons)) + DF_Font(DF_FontSlot_Icons) + UI_FontSize(df_font_size_from_slot(DF_FontSlot_Icons)) UI_PrefWidth(ui_em(1.875f, 1.f)) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_label(df_g_icon_kind_text_table[icon]); @@ -10228,8 +10206,8 @@ df_entity_desc_button(DF_Window *ws, D_Entity *entity, FuzzyMatchRangeList *name UI_PrefWidth(ui_em(1.875f, 1.f)) { UI_Box *info_box = &ui_g_nil_box; - DF_Font(ws, DF_FontSlot_Icons) - UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Icons)) + DF_Font(DF_FontSlot_Icons) + UI_FontSize(df_font_size_from_slot(DF_FontSlot_Icons)) { info_box = ui_build_box_from_stringf(UI_BoxFlag_DrawText|UI_BoxFlag_DrawTextWeak|UI_BoxFlag_Clickable, "%S###%p_temp_info", df_g_icon_kind_text_table[DF_IconKind_Info], entity); } @@ -10242,7 +10220,7 @@ df_entity_desc_button(DF_Window *ws, D_Entity *entity, FuzzyMatchRangeList *name } String8 label = d_display_string_from_entity(scratch.arena, entity); UI_Palette(ui_build_palette(ui_top_palette(), .text = entity_color)) - DF_Font(ws, kind_flags&D_EntityKindFlag_NameIsCode ? DF_FontSlot_Code : DF_FontSlot_Main) + DF_Font(kind_flags&D_EntityKindFlag_NameIsCode ? DF_FontSlot_Code : DF_FontSlot_Main) UI_Flags((entity->kind == D_EntityKind_Thread || entity->kind == D_EntityKind_Breakpoint || entity->kind == D_EntityKind_WatchPin) @@ -10266,7 +10244,7 @@ df_entity_desc_button(DF_Window *ws, D_Entity *entity, FuzzyMatchRangeList *name } if(entity->kind == D_EntityKind_Thread) UI_FontSize(ui_top_font_size()*0.75f) - DF_Font(ws, DF_FontSlot_Code) + DF_Font(DF_FontSlot_Code) UI_Palette(ui_build_palette(ui_top_palette(), .text = df_rgba_from_theme_color(DF_ThemeColor_CodeSymbol))) UI_Flags(UI_BoxFlag_DisableTruncatedHover) { @@ -10314,7 +10292,7 @@ df_entity_desc_button(DF_Window *ws, D_Entity *entity, FuzzyMatchRangeList *name { if(ui_hovering(sig) && !df_drag_is_active()) { - df_entity_tooltips(ws, entity); + df_entity_tooltips(entity); } // rjf: click => fastpath for this entity @@ -10327,8 +10305,9 @@ df_entity_desc_button(DF_Window *ws, D_Entity *entity, FuzzyMatchRangeList *name else if(ui_right_clicked(sig)) { D_Handle handle = d_handle_from_entity(entity); - ui_ctx_menu_open(ws->entity_ctx_menu_key, sig.box->key, v2f32(0, sig.box->rect.y1 - sig.box->rect.y0)); - ws->entity_ctx_menu_entity = handle; + DF_Window *window = df_window_from_handle(d_interact_regs()->window); + ui_ctx_menu_open(df_state->entity_ctx_menu_key, sig.box->key, v2f32(0, sig.box->rect.y1 - sig.box->rect.y0)); + window->entity_ctx_menu_entity = handle; } // rjf: drag+drop @@ -10346,7 +10325,7 @@ df_entity_desc_button(DF_Window *ws, D_Entity *entity, FuzzyMatchRangeList *name } internal void -df_src_loc_button(DF_Window *ws, String8 file_path, TxtPt point) +df_src_loc_button(String8 file_path, TxtPt point) { Temp scratch = scratch_begin(0, 0); String8 filename = str8_skip_last_slash(file_path); @@ -10367,8 +10346,8 @@ df_src_loc_button(DF_Window *ws, String8 file_path, TxtPt point) DF_IconKind icon = DF_IconKind_FileOutline; UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_TextAlignment(UI_TextAlign_Center) - DF_Font(ws, DF_FontSlot_Icons) - UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Icons)) + DF_Font(DF_FontSlot_Icons) + UI_FontSize(df_font_size_from_slot(DF_FontSlot_Icons)) ui_label(df_g_icon_kind_text_table[icon]); ui_labelf("%S:%I64d:%I64d", filename, point.line, point.column); } @@ -10525,7 +10504,7 @@ internal UI_BOX_CUSTOM_DRAW(df_bp_box_draw_extensions) } internal DF_CodeSliceSignal -df_code_slice(DF_Window *ws, DF_CodeSliceParams *params, TxtPt *cursor, TxtPt *mark, S64 *preferred_column, String8 string) +df_code_slice(DF_CodeSliceParams *params, TxtPt *cursor, TxtPt *mark, S64 *preferred_column, String8 string) { DF_CodeSliceSignal result = {0}; ProfBeginFunction(); @@ -10545,8 +10524,8 @@ df_code_slice(DF_Window *ws, DF_CodeSliceParams *params, TxtPt *cursor, TxtPt *m df_rgba_from_theme_color(DF_ThemeColor_LineInfoBackground2), df_rgba_from_theme_color(DF_ThemeColor_LineInfoBackground3), }; - UI_Palette *margin_palette = df_palette_from_code(ws, DF_PaletteCode_Floating); - UI_Palette *margin_contents_palette = ui_build_palette(df_palette_from_code(ws, DF_PaletteCode_Floating)); + UI_Palette *margin_palette = df_palette_from_code(DF_PaletteCode_Floating); + UI_Palette *margin_contents_palette = ui_build_palette(df_palette_from_code(DF_PaletteCode_Floating)); margin_contents_palette->background = v4f32(0, 0, 0, 0); F32 line_num_padding_px = ui_top_font_size()*1.f; @@ -10689,8 +10668,8 @@ df_code_slice(DF_Window *ws, DF_CodeSliceParams *params, TxtPt *cursor, TxtPt *m u->alive_t = thread->alive_t; u->is_selected = (thread == selected_thread); u->is_frozen = d_entity_is_frozen(thread); - u->do_lines = df_setting_val_from_code(ws, DF_SettingCode_ThreadLines).s32; - u->do_glow = df_setting_val_from_code(ws, DF_SettingCode_ThreadGlow).s32; + u->do_lines = df_setting_val_from_code(DF_SettingCode_ThreadLines).s32; + u->do_glow = df_setting_val_from_code(DF_SettingCode_ThreadGlow).s32; ui_box_equip_custom_draw(thread_box, df_thread_box_draw_extensions, u); // rjf: fill out progress t (progress into range of current line's @@ -10722,15 +10701,16 @@ df_code_slice(DF_Window *ws, DF_CodeSliceParams *params, TxtPt *cursor, TxtPt *m // rjf: hover tooltips if(ui_hovering(thread_sig) && !df_drag_is_active()) { - df_entity_tooltips(ws, thread); + df_entity_tooltips(thread); } // rjf: ip right-click menu if(ui_right_clicked(thread_sig)) { D_Handle handle = d_handle_from_entity(thread); - ui_ctx_menu_open(ws->entity_ctx_menu_key, thread_box->key, v2f32(0, thread_box->rect.y1-thread_box->rect.y0)); - ws->entity_ctx_menu_entity = handle; + ui_ctx_menu_open(df_state->entity_ctx_menu_key, thread_box->key, v2f32(0, thread_box->rect.y1-thread_box->rect.y0)); + DF_Window *window = df_window_from_handle(d_interact_regs()->window); + window->entity_ctx_menu_entity = handle; } // rjf: drag start @@ -10877,15 +10857,16 @@ df_code_slice(DF_Window *ws, DF_CodeSliceParams *params, TxtPt *cursor, TxtPt *m // rjf: hover tooltips if(ui_hovering(thread_sig) && !df_drag_is_active()) { - df_entity_tooltips(ws, thread); + df_entity_tooltips(thread); } // rjf: ip right-click menu if(ui_right_clicked(thread_sig)) { D_Handle handle = d_handle_from_entity(thread); - ui_ctx_menu_open(ws->entity_ctx_menu_key, thread_box->key, v2f32(0, thread_box->rect.y1-thread_box->rect.y0)); - ws->entity_ctx_menu_entity = handle; + ui_ctx_menu_open(df_state->entity_ctx_menu_key, thread_box->key, v2f32(0, thread_box->rect.y1-thread_box->rect.y0)); + DF_Window *window = df_window_from_handle(d_interact_regs()->window); + window->entity_ctx_menu_entity = handle; } // rjf: double click => select @@ -10922,10 +10903,10 @@ df_code_slice(DF_Window *ws, DF_CodeSliceParams *params, TxtPt *cursor, TxtPt *m // rjf: prep custom rendering data DF_BreakpointBoxDrawExtData *bp_draw = push_array(ui_build_arena(), DF_BreakpointBoxDrawExtData, 1); { - bp_draw->color = bp_color; - bp_draw->alive_t = bp->alive_t; - bp_draw->do_lines = df_setting_val_from_code(ws, DF_SettingCode_BreakpointLines).s32; - bp_draw->do_glow = df_setting_val_from_code(ws, DF_SettingCode_BreakpointGlow).s32; + bp_draw->color = bp_color; + bp_draw->alive_t = bp->alive_t; + bp_draw->do_lines = df_setting_val_from_code(DF_SettingCode_BreakpointLines).s32; + bp_draw->do_glow = df_setting_val_from_code(DF_SettingCode_BreakpointGlow).s32; if(d_interact_regs()->file_path.size != 0) { D_LineList *lines = ¶ms->line_infos[line_idx]; @@ -10963,7 +10944,7 @@ df_code_slice(DF_Window *ws, DF_CodeSliceParams *params, TxtPt *cursor, TxtPt *m // rjf: bp hovering if(ui_hovering(bp_sig) && !df_drag_is_active()) { - df_entity_tooltips(ws, bp); + df_entity_tooltips(bp); } // rjf: click => remove breakpoint @@ -10984,8 +10965,9 @@ df_code_slice(DF_Window *ws, DF_CodeSliceParams *params, TxtPt *cursor, TxtPt *m if(ui_right_clicked(bp_sig)) { D_Handle handle = d_handle_from_entity(bp); - ui_ctx_menu_open(ws->entity_ctx_menu_key, bp_box->key, v2f32(0, bp_box->rect.y1-bp_box->rect.y0)); - ws->entity_ctx_menu_entity = handle; + ui_ctx_menu_open(df_state->entity_ctx_menu_key, bp_box->key, v2f32(0, bp_box->rect.y1-bp_box->rect.y0)); + DF_Window *window = df_window_from_handle(d_interact_regs()->window); + window->entity_ctx_menu_entity = handle; } } @@ -11020,7 +11002,7 @@ df_code_slice(DF_Window *ws, DF_CodeSliceParams *params, TxtPt *cursor, TxtPt *m // rjf: watch hovering if(ui_hovering(pin_sig) && !df_drag_is_active()) { - df_entity_tooltips(ws, pin); + df_entity_tooltips(pin); } // rjf: click => remove pin @@ -11041,8 +11023,9 @@ df_code_slice(DF_Window *ws, DF_CodeSliceParams *params, TxtPt *cursor, TxtPt *m if(ui_right_clicked(pin_sig)) { D_Handle handle = d_handle_from_entity(pin); - ui_ctx_menu_open(ws->entity_ctx_menu_key, pin_box->key, v2f32(0, pin_box->rect.y1-pin_box->rect.y0)); - ws->entity_ctx_menu_entity = handle; + ui_ctx_menu_open(df_state->entity_ctx_menu_key, pin_box->key, v2f32(0, pin_box->rect.y1-pin_box->rect.y0)); + DF_Window *window = df_window_from_handle(d_interact_regs()->window); + window->entity_ctx_menu_entity = handle; } } } @@ -11074,7 +11057,7 @@ df_code_slice(DF_Window *ws, DF_CodeSliceParams *params, TxtPt *cursor, TxtPt *m ui_set_next_flags(UI_BoxFlag_DrawSideLeft|UI_BoxFlag_DrawSideRight); UI_Column UI_PrefHeight(ui_px(params->line_height_px, 1.f)) - DF_Font(ws, DF_FontSlot_Code) + DF_Font(DF_FontSlot_Code) UI_FontSize(params->font_size) UI_CornerRadius(0) { @@ -11121,7 +11104,7 @@ df_code_slice(DF_Window *ws, DF_CodeSliceParams *params, TxtPt *cursor, TxtPt *m //- rjf: build background for line numbers & margins // { - UI_Parent(top_container_box) DF_Palette(ws, DF_PaletteCode_Floating) + UI_Parent(top_container_box) DF_Palette(DF_PaletteCode_Floating) { ui_set_next_pref_width(ui_px(params->priority_margin_width_px + params->catchall_margin_width_px + params->line_num_width_px, 1)); ui_set_next_pref_height(ui_px(params->line_height_px*(dim_1s64(params->line_num_range)+1), 1.f)); @@ -11200,7 +11183,7 @@ df_code_slice(DF_Window *ws, DF_CodeSliceParams *params, TxtPt *cursor, TxtPt *m UI_Box *box = ui_build_box_from_stringf(UI_BoxFlag_DrawBorder, "###exception_info"); UI_Parent(box) UI_PrefWidth(ui_text_dim(10, 1)) { - DF_Font(ws, DF_FontSlot_Icons) ui_label(df_g_icon_kind_text_table[DF_IconKind_WarningBig]); + DF_Font(DF_FontSlot_Icons) ui_label(df_g_icon_kind_text_table[DF_IconKind_WarningBig]); ui_label(explanation); } } @@ -11222,7 +11205,7 @@ df_code_slice(DF_Window *ws, DF_CodeSliceParams *params, TxtPt *cursor, TxtPt *m { D_EntityList pins = params->line_pins[line_idx]; if(pins.count != 0) UI_Parent(line_extras_boxes[line_idx]) - DF_Font(ws, DF_FontSlot_Code) + DF_Font(DF_FontSlot_Code) UI_FontSize(params->font_size) UI_PrefHeight(ui_px(params->line_height_px, 1.f)) { @@ -11252,7 +11235,7 @@ df_code_slice(DF_Window *ws, DF_CodeSliceParams *params, TxtPt *cursor, TxtPt *m pin_color = d_rgba_from_entity(pin); } UI_PrefWidth(ui_em(1.5f, 1.f)) - DF_Font(ws, DF_FontSlot_Icons) + DF_Font(DF_FontSlot_Icons) UI_Palette(ui_build_palette(ui_top_palette(), .text = pin_color)) UI_TextAlignment(UI_TextAlign_Center) UI_Flags(UI_BoxFlag_DisableTextTrunc) @@ -11266,8 +11249,9 @@ df_code_slice(DF_Window *ws, DF_CodeSliceParams *params, TxtPt *cursor, TxtPt *m } if(ui_right_clicked(sig)) { - ui_ctx_menu_open(ws->entity_ctx_menu_key, sig.box->key, v2f32(0, sig.box->rect.y1-sig.box->rect.y0)); - ws->entity_ctx_menu_entity = d_handle_from_entity(pin); + ui_ctx_menu_open(df_state->entity_ctx_menu_key, sig.box->key, v2f32(0, sig.box->rect.y1-sig.box->rect.y0)); + DF_Window *window = df_window_from_handle(d_interact_regs()->window); + window->entity_ctx_menu_entity = d_handle_from_entity(pin); } } df_code_label(0.8f, 1, df_rgba_from_theme_color(DF_ThemeColor_CodeDefault), pin_expr); @@ -11276,7 +11260,7 @@ df_code_slice(DF_Window *ws, DF_CodeSliceParams *params, TxtPt *cursor, TxtPt *m UI_Signal pin_sig = ui_signal_from_box(pin_box); if(ui_key_match(pin_box_key, ui_hot_key())) { - df_set_hover_eval(ws, v2f32(pin_box->rect.x0, pin_box->rect.y1-2.f), str8_zero(), txt_pt(1, 1), 0, pin_expr); + df_set_hover_eval(v2f32(pin_box->rect.x0, pin_box->rect.y1-2.f), str8_zero(), txt_pt(1, 1), 0, pin_expr); } } } @@ -11406,19 +11390,20 @@ df_code_slice(DF_Window *ws, DF_CodeSliceParams *params, TxtPt *cursor, TxtPt *m { *cursor = *mark = mouse_pt; } - ui_ctx_menu_open(ws->code_ctx_menu_key, ui_key_zero(), sub_2f32(ui_mouse(), v2f32(2, 2))); - arena_clear(ws->code_ctx_menu_arena); - ws->code_ctx_menu_file_path = push_str8_copy(ws->code_ctx_menu_arena, d_interact_regs()->file_path); - ws->code_ctx_menu_text_key = d_interact_regs()->text_key; - ws->code_ctx_menu_lang_kind = d_interact_regs()->lang_kind; - ws->code_ctx_menu_range = txt_rng(*cursor, *mark); + ui_ctx_menu_open(df_state->code_ctx_menu_key, ui_key_zero(), sub_2f32(ui_mouse(), v2f32(2, 2))); + DF_Window *window = df_window_from_handle(d_interact_regs()->window); + arena_clear(window->code_ctx_menu_arena); + window->code_ctx_menu_file_path = push_str8_copy(window->code_ctx_menu_arena, d_interact_regs()->file_path); + window->code_ctx_menu_text_key = d_interact_regs()->text_key; + window->code_ctx_menu_lang_kind = d_interact_regs()->lang_kind; + window->code_ctx_menu_range = txt_rng(*cursor, *mark); if(params->line_num_range.min <= cursor->line && cursor->line < params->line_num_range.max) { - ws->code_ctx_menu_vaddr = params->line_vaddrs[cursor->line - params->line_num_range.min]; + window->code_ctx_menu_vaddr = params->line_vaddrs[cursor->line - params->line_num_range.min]; } if(params->line_num_range.min <= cursor->line && cursor->line < params->line_num_range.max) { - ws->code_ctx_menu_lines = d_line_list_copy(ws->code_ctx_menu_arena, ¶ms->line_infos[cursor->line - params->line_num_range.min]); + window->code_ctx_menu_lines = d_line_list_copy(window->code_ctx_menu_arena, ¶ms->line_infos[cursor->line - params->line_num_range.min]); } } @@ -11559,7 +11544,7 @@ df_code_slice(DF_Window *ws, DF_CodeSliceParams *params, TxtPt *cursor, TxtPt *m U64 line_idx = mouse_pt.line-params->line_num_range.min; line_vaddr = params->line_vaddrs[line_idx]; } - df_set_hover_eval(ws, mouse_expr_baseline_pos, d_interact_regs()->file_path, mouse_pt, line_vaddr, mouse_expr); + df_set_hover_eval(mouse_expr_baseline_pos, d_interact_regs()->file_path, mouse_pt, line_vaddr, mouse_expr); } } @@ -11644,7 +11629,7 @@ df_code_slice(DF_Window *ws, DF_CodeSliceParams *params, TxtPt *cursor, TxtPt *m UI_WidthFill UI_Column UI_PrefHeight(ui_px(params->line_height_px, 1.f)) - DF_Font(ws, DF_FontSlot_Code) + DF_Font(DF_FontSlot_Code) UI_FontSize(params->font_size) UI_CornerRadius(0) { @@ -11959,13 +11944,13 @@ df_code_slice(DF_Window *ws, DF_CodeSliceParams *params, TxtPt *cursor, TxtPt *m } internal DF_CodeSliceSignal -df_code_slicef(DF_Window *ws, DF_CodeSliceParams *params, TxtPt *cursor, TxtPt *mark, S64 *preferred_column, char *fmt, ...) +df_code_slicef(DF_CodeSliceParams *params, TxtPt *cursor, TxtPt *mark, S64 *preferred_column, char *fmt, ...) { Temp scratch = scratch_begin(0, 0); va_list args; va_start(args, fmt); String8 string = push_str8fv(scratch.arena, fmt, args); - DF_CodeSliceSignal sig = df_code_slice(ws, params, cursor, mark, preferred_column, string); + DF_CodeSliceSignal sig = df_code_slice(params, cursor, mark, preferred_column, string); va_end(args); scratch_end(scratch); return sig; @@ -12442,7 +12427,7 @@ df_code_label(F32 alpha, B32 indirection_size_change, Vec4F32 base_color, String //~ rjf: UI Widgets: Line Edit internal UI_Signal -df_line_edit(DF_Window *ws, DF_LineEditFlags flags, S32 depth, FuzzyMatchRangeList *matches, TxtPt *cursor, TxtPt *mark, U8 *edit_buffer, U64 edit_buffer_size, U64 *edit_string_size_out, B32 *expanded_out, String8 pre_edit_value, String8 string) +df_line_edit(DF_LineEditFlags flags, S32 depth, FuzzyMatchRangeList *matches, TxtPt *cursor, TxtPt *mark, U8 *edit_buffer, U64 edit_buffer_size, U64 *edit_string_size_out, B32 *expanded_out, String8 pre_edit_value, String8 string) { //- rjf: unpack visual metrics F32 expander_size_px = ui_top_font_size()*1.5f; @@ -12497,7 +12482,7 @@ df_line_edit(DF_Window *ws, DF_LineEditFlags flags, S32 depth, FuzzyMatchRangeLi { UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_Flags(UI_BoxFlag_DrawSideLeft) - DF_Font(ws, DF_FontSlot_Icons) + DF_Font(DF_FontSlot_Icons) UI_TextAlignment(UI_TextAlign_Center) ui_label(df_g_icon_kind_text_table[DF_IconKind_Dot]); } @@ -12850,14 +12835,14 @@ df_line_edit(DF_Window *ws, DF_LineEditFlags flags, S32 depth, FuzzyMatchRangeLi } internal UI_Signal -df_line_editf(DF_Window *ws, DF_LineEditFlags flags, S32 depth, FuzzyMatchRangeList *matches, TxtPt *cursor, TxtPt *mark, U8 *edit_buffer, U64 edit_buffer_size, U64 *edit_string_size_out, B32 *expanded_out, String8 pre_edit_value, char *fmt, ...) +df_line_editf(DF_LineEditFlags flags, S32 depth, FuzzyMatchRangeList *matches, TxtPt *cursor, TxtPt *mark, U8 *edit_buffer, U64 edit_buffer_size, U64 *edit_string_size_out, B32 *expanded_out, String8 pre_edit_value, char *fmt, ...) { Temp scratch = scratch_begin(0, 0); va_list args; va_start(args, fmt); String8 string = push_str8fv(scratch.arena, fmt, args); va_end(args); - UI_Signal sig = df_line_edit(ws, flags, depth, matches, cursor, mark, edit_buffer, edit_buffer_size, edit_string_size_out, expanded_out, pre_edit_value, string); + UI_Signal sig = df_line_edit(flags, depth, matches, cursor, mark, edit_buffer, edit_buffer_size, edit_string_size_out, expanded_out, pre_edit_value, string); scratch_end(scratch); return sig; } @@ -12898,6 +12883,9 @@ df_init(OS_WindowRepaintFunctionType *window_repaint_entry_point, D_StateDeltaHi df_state->view_rule_spec_table = push_array(arena, DF_ViewRuleSpec *, d_state->view_rule_spec_table_size); df_state->view_rule_block_slots_count = 1024; df_state->view_rule_block_slots = push_array(arena, DF_ViewRuleBlockSlot, df_state->view_rule_block_slots_count); + df_state->code_ctx_menu_key = ui_key_from_string(ui_key_zero(), str8_lit("_code_ctx_menu_")); + df_state->entity_ctx_menu_key = ui_key_from_string(ui_key_zero(), str8_lit("_entity_ctx_menu_")); + df_state->tab_ctx_menu_key = ui_key_from_string(ui_key_zero(), str8_lit("_tab_ctx_menu_")); df_state->string_search_arena = arena_alloc(); df_state->repaint_hook = window_repaint_entry_point; df_state->cfg_main_font_path_arena = arena_alloc(); @@ -13016,7 +13004,7 @@ df_begin_frame(Arena *arena, D_CmdList *cmds) //- rjf: animate confirmation { - F32 rate = df_setting_val_from_code(0, DF_SettingCode_MenuAnimations).s32 ? 1 - pow_f32(2, (-10.f * d_dt())) : 1.f; + F32 rate = df_setting_val_from_code(DF_SettingCode_MenuAnimations).s32 ? 1 - pow_f32(2, (-10.f * d_dt())) : 1.f; B32 confirm_open = df_state->confirm_active; df_state->confirm_t += rate * ((F32)!!confirm_open-df_state->confirm_t); if(abs_f32(df_state->confirm_t - (F32)!!confirm_open) > 0.005f) @@ -13504,7 +13492,7 @@ df_begin_frame(Arena *arena, D_CmdList *cmds) } // rjf: set up view - df_view_equip_spec(ws, view, view_spec, view_query, op); + df_view_equip_spec(view, view_spec, view_query, op); if(project_path.size != 0) { arena_clear(view->project_path_arena); diff --git a/src/dbg_frontend/dbg_frontend_core.h b/src/dbg_frontend/dbg_frontend_core.h index 39123809..0707f97a 100644 --- a/src/dbg_frontend/dbg_frontend_core.h +++ b/src/dbg_frontend/dbg_frontend_core.h @@ -83,17 +83,17 @@ typedef struct DF_View DF_View; typedef struct DF_Panel DF_Panel; typedef struct DF_Window DF_Window; -#define DF_VIEW_SETUP_FUNCTION_SIG(name) void name(DF_Window *ws, struct DF_View *view, MD_Node *params, String8 string) +#define DF_VIEW_SETUP_FUNCTION_SIG(name) void name(DF_View *view, MD_Node *params, String8 string) #define DF_VIEW_SETUP_FUNCTION_NAME(name) df_view_setup_##name #define DF_VIEW_SETUP_FUNCTION_DEF(name) internal DF_VIEW_SETUP_FUNCTION_SIG(DF_VIEW_SETUP_FUNCTION_NAME(name)) typedef DF_VIEW_SETUP_FUNCTION_SIG(DF_ViewSetupFunctionType); -#define DF_VIEW_CMD_FUNCTION_SIG(name) void name(struct DF_Window *ws, struct DF_Panel *panel, struct DF_View *view, MD_Node *params, String8 string, struct D_CmdList *cmds) +#define DF_VIEW_CMD_FUNCTION_SIG(name) void name(DF_View *view, MD_Node *params, String8 string, D_CmdList *cmds) #define DF_VIEW_CMD_FUNCTION_NAME(name) df_view_cmds_##name #define DF_VIEW_CMD_FUNCTION_DEF(name) internal DF_VIEW_CMD_FUNCTION_SIG(DF_VIEW_CMD_FUNCTION_NAME(name)) typedef DF_VIEW_CMD_FUNCTION_SIG(DF_ViewCmdFunctionType); -#define DF_VIEW_UI_FUNCTION_SIG(name) void name(struct DF_Window *ws, struct DF_Panel *panel, struct DF_View *view, MD_Node *params, String8 string, Rng2F32 rect) +#define DF_VIEW_UI_FUNCTION_SIG(name) void name(DF_View *view, MD_Node *params, String8 string, Rng2F32 rect) #define DF_VIEW_UI_FUNCTION_NAME(name) df_view_ui_##name #define DF_VIEW_UI_FUNCTION_DEF(name) internal DF_VIEW_UI_FUNCTION_SIG(DF_VIEW_UI_FUNCTION_NAME(name)) typedef DF_VIEW_UI_FUNCTION_SIG(DF_ViewUIFunctionType); @@ -349,7 +349,7 @@ enum #define DF_VIEW_RULE_LINE_STRINGIZE_FUNCTION_NAME(name) df_view_rule_line_stringize__##name #define DF_VIEW_RULE_LINE_STRINGIZE_FUNCTION_DEF(name) internal DF_VIEW_RULE_LINE_STRINGIZE_FUNCTION_SIG(DF_VIEW_RULE_LINE_STRINGIZE_FUNCTION_NAME(name)) -#define DF_VIEW_RULE_ROW_UI_FUNCTION_SIG(name) void name(struct DF_Window *ws, D_ExpandKey key, MD_Node *params, String8 string) +#define DF_VIEW_RULE_ROW_UI_FUNCTION_SIG(name) void name(D_ExpandKey key, MD_Node *params, String8 string) #define DF_VIEW_RULE_ROW_UI_FUNCTION_NAME(name) df_view_rule_row_ui__##name #define DF_VIEW_RULE_ROW_UI_FUNCTION_DEF(name) DF_VIEW_RULE_ROW_UI_FUNCTION_SIG(DF_VIEW_RULE_ROW_UI_FUNCTION_NAME(name)) @@ -594,7 +594,6 @@ struct DF_Window // rjf: code context menu state Arena *code_ctx_menu_arena; - UI_Key code_ctx_menu_key; String8 code_ctx_menu_file_path; U128 code_ctx_menu_text_key; TXT_LangKind code_ctx_menu_lang_kind; @@ -603,7 +602,6 @@ struct DF_Window D_LineList code_ctx_menu_lines; // rjf: entity context menu state - UI_Key entity_ctx_menu_key; D_Handle entity_ctx_menu_entity; U8 entity_ctx_menu_input_buffer[1024]; U64 entity_ctx_menu_input_size; @@ -611,7 +609,6 @@ struct DF_Window TxtPt entity_ctx_menu_input_mark; // rjf: tab context menu state - UI_Key tab_ctx_menu_key; D_Handle tab_ctx_menu_panel; D_Handle tab_ctx_menu_view; U8 tab_ctx_menu_input_buffer[1024]; @@ -749,6 +746,11 @@ struct DF_State D_CmdSpec *bind_change_cmd_spec; DF_Binding bind_change_binding; + // rjf: top-level context menu keys + UI_Key code_ctx_menu_key; + UI_Key entity_ctx_menu_key; + UI_Key tab_ctx_menu_key; + // rjf: confirmation popup state UI_Key confirm_key; B32 confirm_active; @@ -892,9 +894,6 @@ internal D_Handle df_handle_from_panel(DF_Panel *panel); internal DF_Panel *df_panel_from_handle(D_Handle handle); internal UI_Key df_ui_key_from_panel(DF_Panel *panel); -//- rjf: panel tree mutation notification -internal void df_panel_notify_mutation(DF_Window *window, DF_Panel *panel); - //- rjf: tree construction internal void df_panel_insert(DF_Panel *parent, DF_Panel *prev_child, DF_Panel *new_child); internal void df_panel_remove(DF_Panel *parent, DF_Panel *child); @@ -967,7 +966,7 @@ internal DF_View *df_view_alloc(void); internal void df_view_release(DF_View *view); //- rjf: equipment -internal void df_view_equip_spec(DF_Window *window, DF_View *view, DF_ViewSpec *spec, String8 query, MD_Node *params); +internal void df_view_equip_spec(DF_View *view, DF_ViewSpec *spec, String8 query, MD_Node *params); internal void df_view_equip_query(DF_View *view, String8 query); internal void df_view_equip_loading_info(DF_View *view, B32 is_loading, U64 progress_v, U64 progress_target); @@ -1020,7 +1019,7 @@ internal String8 df_value_string_from_eval(Arena *arena, D_EvalVizStringFlags fl //////////////////////////////// //~ rjf: Hover Eval -internal void df_set_hover_eval(DF_Window *ws, Vec2F32 pos, String8 file_path, TxtPt pt, U64 vaddr, String8 string); +internal void df_set_hover_eval(Vec2F32 pos, String8 file_path, TxtPt pt, U64 vaddr, String8 string); //////////////////////////////// //~ rjf: Auto-Complete Lister @@ -1032,7 +1031,7 @@ internal void df_autocomp_lister_item_array_sort__in_place(DF_AutoCompListerItem internal String8 df_autocomp_query_word_from_input_string_off(String8 input, U64 cursor_off); internal DF_AutoCompListerParams df_view_rule_autocomp_lister_params_from_input_cursor(Arena *arena, String8 string, U64 cursor_off); -internal void df_set_autocomp_lister_query(DF_Window *ws, UI_Key root_key, DF_AutoCompListerParams *params, String8 input, U64 cursor_off); +internal void df_set_autocomp_lister_query(UI_Key root_key, DF_AutoCompListerParams *params, String8 input, U64 cursor_off); //////////////////////////////// //~ rjf: Search Strings @@ -1057,15 +1056,15 @@ internal Vec4F32 df_rgba_from_theme_color(DF_ThemeColor color); internal DF_ThemeColor df_theme_color_from_txt_token_kind(TXT_TokenKind kind); //- rjf: code -> palette -internal UI_Palette *df_palette_from_code(DF_Window *ws, DF_PaletteCode code); +internal UI_Palette *df_palette_from_code(DF_PaletteCode code); //- rjf: fonts/sizes internal FNT_Tag df_font_from_slot(DF_FontSlot slot); -internal F32 df_font_size_from_slot(DF_Window *ws, DF_FontSlot slot); -internal FNT_RasterFlags df_raster_flags_from_slot(DF_Window *ws, DF_FontSlot slot); +internal F32 df_font_size_from_slot(DF_FontSlot slot); +internal FNT_RasterFlags df_raster_flags_from_slot(DF_FontSlot slot); //- rjf: settings -internal DF_SettingVal df_setting_val_from_code(DF_Window *optional_window, DF_SettingCode code); +internal DF_SettingVal df_setting_val_from_code(DF_SettingCode code); //- rjf: config serialization internal int df_qsort_compare__cfg_string_bindings(DF_StringBindingPair *a, DF_StringBindingPair *b); @@ -1080,8 +1079,8 @@ internal String8 df_stop_explanation_string_icon_from_ctrl_event(Arena *arena, C //////////////////////////////// //~ rjf: UI Building Helpers -#define DF_Palette(ws, code) UI_Palette(df_palette_from_code((ws), (code))) -#define DF_Font(ws, slot) UI_Font(df_font_from_slot(slot)) UI_TextRasterFlags(df_raster_flags_from_slot((ws), (slot))) +#define DF_Palette(code) UI_Palette(df_palette_from_code(code)) +#define DF_Font(slot) UI_Font(df_font_from_slot(slot)) UI_TextRasterFlags(df_raster_flags_from_slot((slot))) //////////////////////////////// //~ rjf: UI Widgets: Loading Overlay @@ -1091,23 +1090,23 @@ internal void df_loading_overlay(Rng2F32 rect, F32 loading_t, U64 progress_v, U6 //////////////////////////////// //~ rjf: UI Widgets: Fancy Buttons -internal void df_cmd_binding_buttons(DF_Window *ws, D_CmdSpec *spec); +internal void df_cmd_binding_buttons(D_CmdSpec *spec); internal UI_Signal df_menu_bar_button(String8 string); -internal UI_Signal df_cmd_spec_button(DF_Window *ws, D_CmdSpec *spec); -internal void df_cmd_list_menu_buttons(DF_Window *ws, U64 count, D_CmdKind *cmds, U32 *fastpath_codepoints); -internal UI_Signal df_icon_button(DF_Window *ws, DF_IconKind kind, FuzzyMatchRangeList *matches, String8 string); -internal UI_Signal df_icon_buttonf(DF_Window *ws, DF_IconKind kind, FuzzyMatchRangeList *matches, char *fmt, ...); -internal void df_entity_tooltips(DF_Window *ws, D_Entity *entity); -internal UI_Signal df_entity_desc_button(DF_Window *ws, D_Entity *entity, FuzzyMatchRangeList *name_matches, String8 fuzzy_query, B32 is_implicit); -internal void df_src_loc_button(DF_Window *ws, String8 file_path, TxtPt point); +internal UI_Signal df_cmd_spec_button(D_CmdSpec *spec); +internal void df_cmd_list_menu_buttons(U64 count, D_CmdKind *cmds, U32 *fastpath_codepoints); +internal UI_Signal df_icon_button(DF_IconKind kind, FuzzyMatchRangeList *matches, String8 string); +internal UI_Signal df_icon_buttonf(DF_IconKind kind, FuzzyMatchRangeList *matches, char *fmt, ...); +internal void df_entity_tooltips(D_Entity *entity); +internal UI_Signal df_entity_desc_button(D_Entity *entity, FuzzyMatchRangeList *name_matches, String8 fuzzy_query, B32 is_implicit); +internal void df_src_loc_button(String8 file_path, TxtPt point); //////////////////////////////// //~ rjf: UI Widgets: Text View internal UI_BOX_CUSTOM_DRAW(df_thread_box_draw_extensions); internal UI_BOX_CUSTOM_DRAW(df_bp_box_draw_extensions); -internal DF_CodeSliceSignal df_code_slice(DF_Window *ws, DF_CodeSliceParams *params, TxtPt *cursor, TxtPt *mark, S64 *preferred_column, String8 string); -internal DF_CodeSliceSignal df_code_slicef(DF_Window *ws, DF_CodeSliceParams *params, TxtPt *cursor, TxtPt *mark, S64 *preferred_column, char *fmt, ...); +internal DF_CodeSliceSignal df_code_slice(DF_CodeSliceParams *params, TxtPt *cursor, TxtPt *mark, S64 *preferred_column, String8 string); +internal DF_CodeSliceSignal df_code_slicef(DF_CodeSliceParams *params, TxtPt *cursor, TxtPt *mark, S64 *preferred_column, char *fmt, ...); internal B32 df_do_txt_controls(TXT_TextInfo *info, String8 data, U64 line_count_per_page, TxtPt *cursor, TxtPt *mark, S64 *preferred_column); @@ -1123,8 +1122,8 @@ internal UI_Box *df_code_label(F32 alpha, B32 indirection_size_change, Vec4F32 b //////////////////////////////// //~ rjf: UI Widgets: Line Edit -internal UI_Signal df_line_edit(DF_Window *ws, DF_LineEditFlags flags, S32 depth, FuzzyMatchRangeList *matches, TxtPt *cursor, TxtPt *mark, U8 *edit_buffer, U64 edit_buffer_size, U64 *edit_string_size_out, B32 *expanded_out, String8 pre_edit_value, String8 string); -internal UI_Signal df_line_editf(DF_Window *ws, DF_LineEditFlags flags, S32 depth, FuzzyMatchRangeList *matches, TxtPt *cursor, TxtPt *mark, U8 *edit_buffer, U64 edit_buffer_size, U64 *edit_string_size_out, B32 *expanded_out, String8 pre_edit_value, char *fmt, ...); +internal UI_Signal df_line_edit(DF_LineEditFlags flags, S32 depth, FuzzyMatchRangeList *matches, TxtPt *cursor, TxtPt *mark, U8 *edit_buffer, U64 edit_buffer_size, U64 *edit_string_size_out, B32 *expanded_out, String8 pre_edit_value, String8 string); +internal UI_Signal df_line_editf(DF_LineEditFlags flags, S32 depth, FuzzyMatchRangeList *matches, TxtPt *cursor, TxtPt *mark, U8 *edit_buffer, U64 edit_buffer_size, U64 *edit_string_size_out, B32 *expanded_out, String8 pre_edit_value, char *fmt, ...); //////////////////////////////// //~ rjf: Continuous Frame Requests diff --git a/src/dbg_frontend/dbg_frontend_view_rules.c b/src/dbg_frontend/dbg_frontend_view_rules.c index 1ce28783..82c17e97 100644 --- a/src/dbg_frontend/dbg_frontend_view_rules.c +++ b/src/dbg_frontend/dbg_frontend_view_rules.c @@ -338,7 +338,7 @@ DF_VIEW_RULE_ROW_UI_FUNCTION_DEF(checkbox) Temp scratch = scratch_begin(0, 0); E_Eval eval = e_eval_from_string(scratch.arena, string); E_Eval value_eval = e_value_eval_from_eval(eval); - if(ui_clicked(df_icon_buttonf(ws, value_eval.value.u64 == 0 ? DF_IconKind_CheckHollow : DF_IconKind_CheckFilled, 0, "###check"))) + if(ui_clicked(df_icon_buttonf(value_eval.value.u64 == 0 ? DF_IconKind_CheckHollow : DF_IconKind_CheckFilled, 0, "###check"))) { d_commit_eval_value_string(eval, value_eval.value.u64 == 0 ? str8_lit("1") : str8_lit("0")); } @@ -368,7 +368,7 @@ DF_VIEW_RULE_ROW_UI_FUNCTION_DEF(color_rgba) //- rjf: build text box UI_Box *text_box = &ui_g_nil_box; - UI_WidthFill DF_Font(ws, DF_FontSlot_Code) + UI_WidthFill DF_Font(DF_FontSlot_Code) { text_box = ui_build_box_from_key(UI_BoxFlag_DrawText, ui_key_zero()); DR_FancyStringList fancy_strings = {0}; diff --git a/src/dbg_frontend/dbg_frontend_views.c b/src/dbg_frontend/dbg_frontend_views.c index abd33241..1d25a2b7 100644 --- a/src/dbg_frontend/dbg_frontend_views.c +++ b/src/dbg_frontend/dbg_frontend_views.c @@ -19,15 +19,15 @@ df_code_view_init(DF_CodeViewState *cv, DF_View *view) } internal void -df_code_view_cmds(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewState *cv, D_CmdList *cmds, String8 text_data, TXT_TextInfo *text_info, DASM_LineArray *dasm_lines, Rng1U64 dasm_vaddr_range, DI_Key dasm_dbgi_key) +df_code_view_cmds(DF_View *view, DF_CodeViewState *cv, D_CmdList *cmds, String8 text_data, TXT_TextInfo *text_info, DASM_LineArray *dasm_lines, Rng1U64 dasm_vaddr_range, DI_Key dasm_dbgi_key) { for(D_CmdNode *n = cmds->first; n != 0; n = n->next) { D_Cmd *cmd = &n->cmd; // rjf: mismatched window/panel => skip - if(df_window_from_handle(cmd->params.window) != ws || - df_panel_from_handle(cmd->params.panel) != panel) + if(!d_handle_match(d_interact_regs()->window, cmd->params.window) || + !d_handle_match(d_interact_regs()->panel, cmd->params.panel)) { continue; } @@ -68,7 +68,7 @@ df_code_view_cmds(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewStat } internal DF_CodeViewBuildResult -df_code_view_build(Arena *arena, DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewState *cv, DF_CodeViewBuildFlags flags, Rng2F32 rect, String8 text_data, TXT_TextInfo *text_info, DASM_LineArray *dasm_lines, Rng1U64 dasm_vaddr_range, DI_Key dasm_dbgi_key) +df_code_view_build(Arena *arena, DF_View *view, DF_CodeViewState *cv, DF_CodeViewBuildFlags flags, Rng2F32 rect, String8 text_data, TXT_TextInfo *text_info, DASM_LineArray *dasm_lines, Rng1U64 dasm_vaddr_range, DI_Key dasm_dbgi_key) { ProfBeginFunction(); Temp scratch = scratch_begin(&arena, 1); @@ -79,8 +79,8 @@ df_code_view_build(Arena *arena, DF_Window *ws, DF_Panel *panel, DF_View *view, //- rjf: extract invariants // FNT_Tag code_font = df_font_from_slot(DF_FontSlot_Code); - F32 code_font_size = df_font_size_from_slot(ws, DF_FontSlot_Code); - F32 code_tab_size = fnt_column_size_from_tag_size(code_font, code_font_size)*df_setting_val_from_code(ws, DF_SettingCode_TabWidth).s32; + F32 code_font_size = df_font_size_from_slot(DF_FontSlot_Code); + F32 code_tab_size = fnt_column_size_from_tag_size(code_font, code_font_size)*df_setting_val_from_code(DF_SettingCode_TabWidth).s32; FNT_Metrics code_font_metrics = fnt_metrics_from_tag_size(code_font, code_font_size); F32 code_line_height = ceil_f32(fnt_line_height_from_metrics(&code_font_metrics) * 1.5f); F32 big_glyph_advance = fnt_dim_from_tag_size_string(code_font, code_font_size, 0, 0, str8_lit("H")).x; @@ -144,11 +144,12 @@ df_code_view_build(Arena *arena, DF_Window *ws, DF_Panel *panel, DF_View *view, Side search_query_side = Side_Invalid; B32 search_query_is_active = 0; { - D_CmdKind query_cmd_kind = d_cmd_kind_from_string(ws->query_cmd_spec->info.string); + DF_Window *window = df_window_from_handle(d_interact_regs()->window); + D_CmdKind query_cmd_kind = d_cmd_kind_from_string(window->query_cmd_spec->info.string); if(query_cmd_kind == D_CmdKind_FindTextForward || query_cmd_kind == D_CmdKind_FindTextBackward) { - search_query = str8(ws->query_view_stack_top->query_buffer, ws->query_view_stack_top->query_string_size); + search_query = str8(window->query_view_stack_top->query_buffer, window->query_view_stack_top->query_string_size); search_query_is_active = 1; search_query_side = (query_cmd_kind == D_CmdKind_FindTextForward) ? Side_Max : Side_Min; } @@ -545,13 +546,13 @@ df_code_view_build(Arena *arena, DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeSliceSignal sig = {0}; UI_Focus(UI_FocusKind_On) { - sig = df_code_slicef(ws, &code_slice_params, &d_interact_regs()->cursor, &d_interact_regs()->mark, &cv->preferred_column, "txt_view_%p", view); + sig = df_code_slicef(&code_slice_params, &d_interact_regs()->cursor, &d_interact_regs()->mark, &cv->preferred_column, "txt_view_%p", view); } //- rjf: press code slice? -> focus panel if(ui_pressed(sig.base)) { - d_cmd(D_CmdKind_FocusPanel, .panel = df_handle_from_panel(panel)); + d_cmd(D_CmdKind_FocusPanel); } //- rjf: dragging & outside region? -> contain cursor @@ -723,11 +724,11 @@ df_code_view_build(Arena *arena, DF_Window *ws, DF_Panel *panel, DF_View *view, ui_eat_event(evt); if(evt->delta_2f32.y < 0) { - d_cmd(D_CmdKind_IncCodeFontScale, .window = df_handle_from_window(ws)); + d_cmd(D_CmdKind_IncCodeFontScale); } else if(evt->delta_2f32.y > 0) { - d_cmd(D_CmdKind_DecCodeFontScale, .window = df_handle_from_window(ws)); + d_cmd(D_CmdKind_DecCodeFontScale); } } } @@ -935,7 +936,7 @@ df_watch_view_init(DF_WatchViewState *ewv, DF_View *view, DF_WatchViewFillKind f } internal void -df_watch_view_cmds(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewState *ewv, D_CmdList *cmds) +df_watch_view_cmds(DF_View *view, DF_WatchViewState *ewv, D_CmdList *cmds) { for(D_CmdNode *n = cmds->first; n != 0; n = n->next) { @@ -972,7 +973,7 @@ df_watch_view_cmds(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewSt } internal void -df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewState *ewv, B32 modifiable, U32 default_radix, Rng2F32 rect) +df_watch_view_build(DF_View *view, DF_WatchViewState *ewv, B32 modifiable, U32 default_radix, Rng2F32 rect) { ProfBeginFunction(); DI_Scope *di_scope = di_scope_open(); @@ -2165,30 +2166,30 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS F32 max_width = ui_top_font_size()*35; ui_label_multiline(max_width, str8_lit("View rules are used to tweak the way evaluated expressions are visualized. Multiple rules can be specified on each row. They are specified in a key:(value) form. Some examples follow:")); ui_spacer(ui_em(1.5f, 1)); - DF_Font(ws, DF_FontSlot_Code) ui_labelf("array:(N)"); + DF_Font(DF_FontSlot_Code) ui_labelf("array:(N)"); UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_label_multiline(max_width, str8_lit("Specifies that a pointer points to N elements, rather than only 1.")); ui_spacer(ui_em(1.5f, 1)); - DF_Font(ws, DF_FontSlot_Code) ui_labelf("omit:(member_1 ... member_n)"); + DF_Font(DF_FontSlot_Code) ui_labelf("omit:(member_1 ... member_n)"); UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_label_multiline(max_width, str8_lit("Omits a list of member names from appearing in struct, union, or class evaluations.")); ui_spacer(ui_em(1.5f, 1)); - DF_Font(ws, DF_FontSlot_Code) ui_labelf("only:(member_1 ... member_n)"); + DF_Font(DF_FontSlot_Code) ui_labelf("only:(member_1 ... member_n)"); UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_label_multiline(max_width, str8_lit("Specifies that only the specified members should appear in struct, union, or class evaluations.")); - DF_Font(ws, DF_FontSlot_Code) ui_labelf("list:(next_link_member_name)"); + DF_Font(DF_FontSlot_Code) ui_labelf("list:(next_link_member_name)"); UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_label_multiline(max_width, str8_lit("Specifies that some struct, union, or class forms the top of a linked list, with next_link_member_name being the member which points at the next element in the list.")); ui_spacer(ui_em(1.5f, 1)); - DF_Font(ws, DF_FontSlot_Code) ui_labelf("dec"); + DF_Font(DF_FontSlot_Code) ui_labelf("dec"); UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_label_multiline(max_width, str8_lit("Specifies that all integral evaluations should appear in base-10 form.")); ui_spacer(ui_em(1.5f, 1)); - DF_Font(ws, DF_FontSlot_Code) ui_labelf("hex"); + DF_Font(DF_FontSlot_Code) ui_labelf("hex"); UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_label_multiline(max_width, str8_lit("Specifies that all integral evaluations should appear in base-16 form.")); ui_spacer(ui_em(1.5f, 1)); - DF_Font(ws, DF_FontSlot_Code) ui_labelf("oct"); + DF_Font(DF_FontSlot_Code) ui_labelf("oct"); UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_label_multiline(max_width, str8_lit("Specifies that all integral evaluations should appear in base-8 form.")); ui_spacer(ui_em(1.5f, 1)); - DF_Font(ws, DF_FontSlot_Code) ui_labelf("bin"); + DF_Font(DF_FontSlot_Code) ui_labelf("bin"); UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_label_multiline(max_width, str8_lit("Specifies that all integral evaluations should appear in base-2 form.")); ui_spacer(ui_em(1.5f, 1)); - DF_Font(ws, DF_FontSlot_Code) ui_labelf("no_addr"); + DF_Font(DF_FontSlot_Code) ui_labelf("no_addr"); UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_label_multiline(max_width, str8_lit("Displays only what pointers point to, if possible, without the pointer's address value.")); ui_spacer(ui_em(1.5f, 1)); } @@ -2307,7 +2308,7 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS { arena_clear(canvas_view_node->initial_params_arena); canvas_view_node->initial_params = md_tree_copy(canvas_view_node->initial_params_arena, row->expand_ui_rule_params); - df_view_equip_spec(ws, canvas_view, canvas_view_spec, canvas_view_expr, row->expand_ui_rule_params); + df_view_equip_spec(canvas_view, canvas_view_spec, canvas_view_expr, row->expand_ui_rule_params); } 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); @@ -2333,7 +2334,7 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS ui_set_next_pref_height(ui_em(3, 1)); UI_Flags(UI_BoxFlag_DrawDropShadow) UI_CornerRadius(ui_top_font_size()*0.5f) { - UI_Signal sig = df_icon_buttonf(ws, DF_IconKind_Window, 0, "###pop_out"); + UI_Signal sig = df_icon_buttonf(DF_IconKind_Window, 0, "###pop_out"); if(ui_hovering(sig)) UI_Tooltip { ui_labelf("Pop out"); @@ -2372,7 +2373,7 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS //- rjf: build UI_PermissionFlags(UI_PermissionFlag_Clicks|UI_PermissionFlag_ScrollX) { - canvas_view_spec->info.ui_hook(ws, &df_nil_panel, 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); + 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); } //- rjf: pop interaction registers @@ -2570,11 +2571,11 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS UI_Palette(palette) UI_TableCell UI_FocusHot(cell_selected ? UI_FocusKind_On : UI_FocusKind_Off) UI_FocusActive((cell_selected && ewv->text_editing) ? UI_FocusKind_On : UI_FocusKind_Off) - DF_Font(ws, col->is_non_code ? DF_FontSlot_Main : DF_FontSlot_Code) + DF_Font(col->is_non_code ? DF_FontSlot_Main : DF_FontSlot_Code) UI_FlagsAdd(cell_flags | (row->depth > 0 ? UI_BoxFlag_DrawTextWeak : 0)) { // rjf: cell has errors? -> build error box - if(cell_error_string.size != 0) DF_Font(ws, DF_FontSlot_Main) + if(cell_error_string.size != 0) DF_Font(DF_FontSlot_Main) { UI_Box *box = ui_build_box_from_stringf(UI_BoxFlag_Clip|UI_BoxFlag_Clickable, "###%I64x_row_%I64x", x, row_hash); sig = ui_signal_from_box(box); @@ -2591,7 +2592,7 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS UI_Parent(box) { String8 row_expr = e_string_from_expr(scratch.arena, row->expr); - cell_ui_hook(ws, row->key, cell_ui_params, row_expr); + cell_ui_hook(row->key, cell_ui_params, row_expr); } sig = ui_signal_from_box(box); } @@ -2600,7 +2601,7 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS else if(cell_icon != DF_IconKind_Null) { UI_Box *box = ui_build_box_from_stringf(UI_BoxFlag_Clickable, "###cell_%I64x", row_hash); - UI_Parent(box) DF_Font(ws, DF_FontSlot_Icons) UI_WidthFill UI_TextAlignment(UI_TextAlign_Center) + UI_Parent(box) DF_Font(DF_FontSlot_Icons) UI_WidthFill UI_TextAlignment(UI_TextAlign_Center) { ui_label(df_g_icon_kind_text_table[cell_icon]); } @@ -2610,8 +2611,7 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS // rjf: build cell line edit else { - sig = df_line_editf(ws, - (DF_LineEditFlag_CodeContents*(!col->is_non_code)| + sig = df_line_editf((DF_LineEditFlag_CodeContents*(!col->is_non_code)| DF_LineEditFlag_NoBackground| DF_LineEditFlag_DisableEdit*(!cell_can_edit)| DF_LineEditFlag_Expander*!!(x == 0 && row_is_expandable && col->kind == DF_WatchViewColumnKind_Expr)| @@ -2636,7 +2636,7 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS params.flags = cell_autocomp_flags; } } - df_set_autocomp_lister_query(ws, sig.box->key, ¶ms, input, cell_edit_state->cursor.column-1); + df_set_autocomp_lister_query(sig.box->key, ¶ms, input, cell_edit_state->cursor.column-1); } } } @@ -2695,7 +2695,7 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS UI_PrefWidth(ui_children_sum(1)) UI_Row UI_PrefWidth(ui_text_dim(1, 1)) { ui_labelf("Inherited from "); - DF_Font(ws, DF_FontSlot_Code) df_code_label(1.f, 0, df_rgba_from_theme_color(DF_ThemeColor_CodeDefault), cell_inheritance_string); + DF_Font(DF_FontSlot_Code) df_code_label(1.f, 0, df_rgba_from_theme_color(DF_ThemeColor_CodeDefault), cell_inheritance_string); } } @@ -2707,7 +2707,7 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS } //- rjf: [DEV] hovering -> tooltips - if(DEV_eval_compiler_tooltips && x == 0 && ui_hovering(sig)) UI_Tooltip DF_Font(ws, DF_FontSlot_Code) + if(DEV_eval_compiler_tooltips && x == 0 && ui_hovering(sig)) UI_Tooltip DF_Font(DF_FontSlot_Code) { local_persist char *spaces = " "; String8 string = d_expr_string_from_viz_row(scratch.arena, row); @@ -2903,9 +2903,9 @@ DF_VIEW_UI_FUNCTION_DEF(empty) UI_TextAlignment(UI_TextAlign_Center) UI_PrefWidth(ui_em(15.f, 1.f)) UI_CornerRadius(ui_top_font_size()/2.f) - DF_Palette(ws, DF_PaletteCode_NegativePopButton) + DF_Palette(DF_PaletteCode_NegativePopButton) { - if(ui_clicked(df_icon_buttonf(ws, DF_IconKind_X, 0, "Close Panel"))) + if(ui_clicked(df_icon_buttonf(DF_IconKind_X, 0, "Close Panel"))) { d_cmd(D_CmdKind_ClosePanel); } @@ -2975,8 +2975,8 @@ DF_VIEW_UI_FUNCTION_DEF(getting_started) UI_TextAlignment(UI_TextAlign_Center) UI_PrefWidth(ui_em(22.f, 1.f)) UI_CornerRadius(ui_top_font_size()/2.f) - DF_Palette(ws, DF_PaletteCode_NeutralPopButton) - if(ui_clicked(df_icon_buttonf(ws, DF_IconKind_Add, 0, "Add Target"))) + DF_Palette(DF_PaletteCode_NeutralPopButton) + if(ui_clicked(df_icon_buttonf(DF_IconKind_Add, 0, "Add Target"))) { d_cmd(D_CmdKind_RunCommand, .cmd_spec = d_cmd_spec_from_kind(D_CmdKind_AddTarget)); } @@ -2994,14 +2994,14 @@ DF_VIEW_UI_FUNCTION_DEF(getting_started) UI_TextAlignment(UI_TextAlign_Center) UI_PrefWidth(ui_em(22.f, 1.f)) UI_CornerRadius(ui_top_font_size()/2.f) - DF_Palette(ws, DF_PaletteCode_PositivePopButton) + DF_Palette(DF_PaletteCode_PositivePopButton) { - if(ui_clicked(df_icon_buttonf(ws, DF_IconKind_Play, 0, "Launch %S", target_name))) + if(ui_clicked(df_icon_buttonf(DF_IconKind_Play, 0, "Launch %S", target_name))) { d_cmd(D_CmdKind_LaunchAndRun, .entity = d_handle_from_entity(target)); } ui_spacer(ui_em(1.5f, 1)); - if(ui_clicked(df_icon_buttonf(ws, DF_IconKind_Play, 0, "Step Into %S", target_name))) + if(ui_clicked(df_icon_buttonf(DF_IconKind_Play, 0, "Step Into %S", target_name))) { d_cmd(D_CmdKind_LaunchAndInit, .entity = d_handle_from_entity(target)); } @@ -3035,7 +3035,7 @@ DF_VIEW_UI_FUNCTION_DEF(getting_started) { ui_labelf("use"); D_CmdSpec *spec = d_cmd_spec_from_kind(D_CmdKind_RunCommand); - UI_Flags(UI_BoxFlag_DrawBorder) UI_TextAlignment(UI_TextAlign_Center) df_cmd_binding_buttons(ws, spec); + UI_Flags(UI_BoxFlag_DrawBorder) UI_TextAlignment(UI_TextAlign_Center) df_cmd_binding_buttons(spec); ui_labelf("to open command menu"); } } @@ -3270,8 +3270,8 @@ DF_VIEW_UI_FUNCTION_DEF(commands) UI_PrefWidth(ui_em(3.f, 1.f)) UI_HeightFill UI_Column - DF_Font(ws, DF_FontSlot_Icons) - UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Icons)) + DF_Font(DF_FontSlot_Icons) + UI_FontSize(df_font_size_from_slot(DF_FontSlot_Icons)) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_HeightFill UI_TextAlignment(UI_TextAlign_Center) @@ -3311,7 +3311,7 @@ DF_VIEW_UI_FUNCTION_DEF(commands) ui_set_next_flags(UI_BoxFlag_Clickable); UI_NamedRow(str8_lit("binding_row")) UI_Padding(ui_em(1.f, 1.f)) { - df_cmd_binding_buttons(ws, item->cmd_spec); + df_cmd_binding_buttons(item->cmd_spec); } } } @@ -3461,8 +3461,9 @@ DF_VIEW_UI_FUNCTION_DEF(file_system) DF_PathQuery path_query = df_path_query_from_string(query_normalized_with_opt_slash); F32 row_height_px = floor_f32(ui_top_font_size()*2.5f); F32 scroll_bar_dim = floor_f32(ui_top_font_size()*1.5f); - B32 file_selection = !!(ws->query_cmd_spec->info.query.flags & D_CmdQueryFlag_AllowFiles); - B32 dir_selection = !!(ws->query_cmd_spec->info.query.flags & D_CmdQueryFlag_AllowFolders); + DF_Window *window = df_window_from_handle(d_interact_regs()->window); + B32 file_selection = !!(window->query_cmd_spec->info.query.flags & D_CmdQueryFlag_AllowFiles); + B32 dir_selection = !!(window->query_cmd_spec->info.query.flags & D_CmdQueryFlag_AllowFolders); //- rjf: get extra state for this view DF_FileSystemViewState *fs = df_view_user_state(view, DF_FileSystemViewState); @@ -3744,8 +3745,8 @@ DF_VIEW_UI_FUNCTION_DEF(file_system) UI_Parent(sig.box) { // rjf: icons - DF_Font(ws, DF_FontSlot_Icons) - UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Icons)) + DF_Font(DF_FontSlot_Icons) + UI_FontSize(df_font_size_from_slot(DF_FontSlot_Icons)) UI_PrefWidth(ui_em(3.f, 1.f)) UI_TextAlignment(UI_TextAlign_Center) { @@ -3792,8 +3793,8 @@ DF_VIEW_UI_FUNCTION_DEF(file_system) UI_PrefWidth(ui_pct(fs->col_pcts[0], 1)) UI_Row { // rjf: icon to signify directory - DF_Font(ws, DF_FontSlot_Icons) - UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Icons)) + DF_Font(DF_FontSlot_Icons) + UI_FontSize(df_font_size_from_slot(DF_FontSlot_Icons)) UI_PrefWidth(ui_em(3.f, 1.f)) UI_TextAlignment(UI_TextAlign_Center) { @@ -4126,8 +4127,8 @@ DF_VIEW_UI_FUNCTION_DEF(system_processes) UI_Parent(sig.box) { // rjf: icon - DF_Font(ws, DF_FontSlot_Icons) - UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Icons)) + DF_Font(DF_FontSlot_Icons) + UI_FontSize(df_font_size_from_slot(DF_FontSlot_Icons)) UI_PrefWidth(ui_em(3.f, 1.f)) UI_TextAlignment(UI_TextAlign_Center) { @@ -4285,7 +4286,8 @@ DF_VIEW_UI_FUNCTION_DEF(entity_lister) { ProfBeginFunction(); Temp scratch = scratch_begin(0, 0); - D_CmdSpec *spec = ws->query_cmd_spec; + DF_Window *window = df_window_from_handle(d_interact_regs()->window); + D_CmdSpec *spec = window->query_cmd_spec; D_EntityKind entity_kind = spec->info.query.entity_kind; D_EntityFlags entity_flags_omit = D_EntityFlag_IsFolder; F32 row_height_px = floor_f32(ui_top_font_size()*2.5f); @@ -4372,8 +4374,8 @@ DF_VIEW_UI_FUNCTION_DEF(entity_lister) if(icon_kind != DF_IconKind_Null) { UI_TextAlignment(UI_TextAlign_Center) - DF_Font(ws, DF_FontSlot_Icons) - UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Icons)) + DF_Font(DF_FontSlot_Icons) + UI_FontSize(df_font_size_from_slot(DF_FontSlot_Icons)) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_PrefWidth(ui_text_dim(10, 1)) ui_label(df_g_icon_kind_text_table[icon_kind]); @@ -4496,7 +4498,7 @@ DF_VIEW_UI_FUNCTION_DEF(symbol_lister) &visible_row_range, &scroll_list_sig) UI_Focus(UI_FocusKind_Null) - UI_TextRasterFlags(df_raster_flags_from_slot(ws, DF_FontSlot_Code)) + UI_TextRasterFlags(df_raster_flags_from_slot(DF_FontSlot_Code)) { //- rjf: build rows for(U64 idx = visible_row_range.min; @@ -4542,7 +4544,7 @@ DF_VIEW_UI_FUNCTION_DEF(symbol_lister) UI_BoxFlag_DrawHotEffects| UI_BoxFlag_DrawActiveEffects, "###procedure_%I64x", item->idx); - UI_Parent(box) UI_PrefWidth(ui_text_dim(10, 1)) DF_Font(ws, DF_FontSlot_Code) + UI_Parent(box) UI_PrefWidth(ui_text_dim(10, 1)) DF_Font(DF_FontSlot_Code) { UI_Box *box = df_code_label(1.f, 0, df_rgba_from_theme_color(DF_ThemeColor_CodeSymbol), name); ui_box_equip_fuzzy_match_ranges(box, &item->match_ranges); @@ -4561,8 +4563,8 @@ DF_VIEW_UI_FUNCTION_DEF(symbol_lister) } if(ui_hovering(sig)) UI_Tooltip { - DF_Font(ws, DF_FontSlot_Code) df_code_label(1.f, 0, df_rgba_from_theme_color(DF_ThemeColor_CodeSymbol), name); - DF_Font(ws, DF_FontSlot_Main) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) + DF_Font(DF_FontSlot_Code) df_code_label(1.f, 0, df_rgba_from_theme_color(DF_ThemeColor_CodeSymbol), name); + DF_Font(DF_FontSlot_Main) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_labelf("Procedure #%I64u", item->idx); U64 binary_voff = d_voff_from_dbgi_key_symbol_name(&dbgi_key, name); D_LineList lines = d_lines_from_dbgi_key_voff(scratch.arena, &dbgi_key, binary_voff); @@ -4570,12 +4572,12 @@ DF_VIEW_UI_FUNCTION_DEF(symbol_lister) { String8 file_path = lines.first->v.file_path; S64 line_num = lines.first->v.pt.line; - DF_Font(ws, DF_FontSlot_Main) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) + DF_Font(DF_FontSlot_Main) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_labelf("%S:%I64d", file_path, line_num); } else { - DF_Font(ws, DF_FontSlot_Main) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) + DF_Font(DF_FontSlot_Main) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_label(str8_lit("(No source code location found)")); } } @@ -4630,8 +4632,8 @@ DF_VIEW_CMD_FUNCTION_DEF(target) D_Cmd *cmd = &n->cmd; // rjf: mismatched window/panel => skip - if(df_window_from_handle(cmd->params.window) != ws || - df_panel_from_handle(cmd->params.panel) != panel) + if(!d_handle_match(d_interact_regs()->window, cmd->params.window) || + !d_handle_match(d_interact_regs()->panel, cmd->params.panel)) { continue; } @@ -4785,7 +4787,7 @@ DF_VIEW_UI_FUNCTION_DEF(target) { ui_label_multiline(ui_top_font_size()*30.f, str8_lit("By default, the debugger attempts to find a target's entry point with a set of default names, such as:")); ui_spacer(ui_em(1.5f, 1.f)); - DF_Font(ws, DF_FontSlot_Code) UI_Palette(ui_build_palette(ui_top_palette(), .text = df_rgba_from_theme_color(DF_ThemeColor_CodeSymbol))) + DF_Font(DF_FontSlot_Code) UI_Palette(ui_build_palette(ui_top_palette(), .text = df_rgba_from_theme_color(DF_ThemeColor_CodeSymbol))) { ui_label(str8_lit("WinMain")); ui_label(str8_lit("wWinMain")); @@ -4808,7 +4810,7 @@ DF_VIEW_UI_FUNCTION_DEF(target) UI_TableCell { // rjf: value editor - UI_WidthFill DF_Font(ws, kv_info[idx].use_code_font ? DF_FontSlot_Code : DF_FontSlot_Main) + UI_WidthFill DF_Font(kv_info[idx].use_code_font ? DF_FontSlot_Code : DF_FontSlot_Main) { // rjf: * => focus B32 value_selected = row_selected && (next_cursor.x == 0 || !has_browse); @@ -4828,7 +4830,7 @@ DF_VIEW_UI_FUNCTION_DEF(target) UI_FocusHot(value_selected ? UI_FocusKind_On : UI_FocusKind_Off) UI_FocusActive((value_selected && tv->input_editing) ? UI_FocusKind_On : UI_FocusKind_Off) { - sig = df_line_editf(ws, DF_LineEditFlag_NoBackground, 0, 0, &tv->input_cursor, &tv->input_mark, tv->input_buffer, sizeof(tv->input_buffer), &tv->input_size, 0, kv_info[idx].current_text, "###kv_editor_%i", (S32)idx); + sig = df_line_editf(DF_LineEditFlag_NoBackground, 0, 0, &tv->input_cursor, &tv->input_mark, tv->input_buffer, sizeof(tv->input_buffer), &tv->input_size, 0, kv_info[idx].current_text, "###kv_editor_%i", (S32)idx); edit_commit = edit_commit || ui_committed(sig); } @@ -4997,7 +4999,7 @@ DF_VIEW_UI_FUNCTION_DEF(targets) { UI_Signal add_sig = {0}; UI_FocusHot(cursor.y == 1 ? UI_FocusKind_On : UI_FocusKind_Off) - add_sig = df_icon_buttonf(ws, DF_IconKind_Add, 0, "Add New Target"); + add_sig = df_icon_buttonf(DF_IconKind_Add, 0, "Add New Target"); if(ui_clicked(add_sig)) { d_cmd(D_CmdKind_RunCommand, .cmd_spec = d_cmd_spec_from_kind(D_CmdKind_AddTarget)); @@ -5017,7 +5019,7 @@ DF_VIEW_UI_FUNCTION_DEF(targets) UI_PrefWidth(ui_em(2.25f, 1)) UI_FocusHot((row_selected && cursor.x == 0) ? UI_FocusKind_On : UI_FocusKind_Off) { - UI_Signal sig = df_icon_buttonf(ws, !target->disabled ? DF_IconKind_CheckFilled : DF_IconKind_CheckHollow, 0, "###ebl_%p", target); + UI_Signal sig = df_icon_buttonf(!target->disabled ? DF_IconKind_CheckFilled : DF_IconKind_CheckHollow, 0, "###ebl_%p", target); if(ui_clicked(sig)) { d_cmd(!target->disabled ? D_CmdKind_DisableTarget : D_CmdKind_EnableTarget, .entity = d_handle_from_entity(target)); @@ -5027,7 +5029,7 @@ DF_VIEW_UI_FUNCTION_DEF(targets) // rjf: target name UI_WidthFill UI_FocusHot((row_selected && cursor.x == 1) ? UI_FocusKind_On : UI_FocusKind_Off) { - df_entity_desc_button(ws, target, &targets.v[row_idx-1].matches, string, 0); + df_entity_desc_button(target, &targets.v[row_idx-1].matches, string, 0); } // rjf: controls @@ -5051,7 +5053,7 @@ DF_VIEW_UI_FUNCTION_DEF(targets) UI_Signal sig = {0}; UI_FocusHot((row_selected && cursor.x == 2+ctrl_idx) ? UI_FocusKind_On : UI_FocusKind_Off) { - sig = df_icon_buttonf(ws, ctrls[ctrl_idx].icon, 0, "###%p_ctrl_%i", target, (int)ctrl_idx); + sig = df_icon_buttonf(ctrls[ctrl_idx].icon, 0, "###%p_ctrl_%i", target, (int)ctrl_idx); } if(ui_hovering(sig)) UI_Tooltip { @@ -5117,8 +5119,8 @@ DF_VIEW_CMD_FUNCTION_DEF(file_path_map) D_Cmd *cmd = &n->cmd; // rjf: mismatched window/panel => skip - if(df_window_from_handle(cmd->params.window) != ws || - df_panel_from_handle(cmd->params.panel) != panel) + if(!d_handle_match(d_interact_regs()->window, cmd->params.window) || + !d_handle_match(d_interact_regs()->panel, cmd->params.panel)) { continue; } @@ -5267,7 +5269,7 @@ DF_VIEW_UI_FUNCTION_DEF(file_path_map) UI_FocusHot(value_selected ? UI_FocusKind_On : UI_FocusKind_Off) UI_FocusActive((value_selected && fpms->input_editing) ? UI_FocusKind_On : UI_FocusKind_Off) { - sig = df_line_editf(ws, DF_LineEditFlag_NoBackground, 0, 0, &fpms->input_cursor, &fpms->input_mark, fpms->input_buffer, sizeof(fpms->input_buffer), &fpms->input_size, 0, map_src_path, "###src_editor_%p", map); + sig = df_line_editf(DF_LineEditFlag_NoBackground, 0, 0, &fpms->input_cursor, &fpms->input_mark, fpms->input_buffer, sizeof(fpms->input_buffer), &fpms->input_size, 0, map_src_path, "###src_editor_%p", map); edit_commit = edit_commit || ui_committed(sig); } @@ -5337,7 +5339,7 @@ DF_VIEW_UI_FUNCTION_DEF(file_path_map) UI_FocusHot(value_selected ? UI_FocusKind_On : UI_FocusKind_Off) UI_FocusActive((value_selected && fpms->input_editing) ? UI_FocusKind_On : UI_FocusKind_Off) { - sig = df_line_editf(ws, DF_LineEditFlag_NoBackground, 0, 0, &fpms->input_cursor, &fpms->input_mark, fpms->input_buffer, sizeof(fpms->input_buffer), &fpms->input_size, 0, map_dst_path, "###dst_editor_%p", map); + sig = df_line_editf(DF_LineEditFlag_NoBackground, 0, 0, &fpms->input_cursor, &fpms->input_mark, fpms->input_buffer, sizeof(fpms->input_buffer), &fpms->input_size, 0, map_dst_path, "###dst_editor_%p", map); edit_commit = edit_commit || ui_committed(sig); } @@ -5422,299 +5424,9 @@ DF_VIEW_UI_FUNCTION_DEF(file_path_map) //////////////////////////////// //~ rjf: auto_view_rules @view_hook_impl -typedef struct DF_AutoViewRulesViewState DF_AutoViewRulesViewState; -struct DF_AutoViewRulesViewState -{ - B32 initialized; - Vec2S64 cursor; - TxtPt input_cursor; - TxtPt input_mark; - U8 input_buffer[1024]; - U64 input_size; - B32 input_editing; - F32 src_column_pct; - F32 dst_column_pct; -}; - -DF_VIEW_SETUP_FUNCTION_DEF(auto_view_rules) -{ - DF_AutoViewRulesViewState *avrs = df_view_user_state(view, DF_AutoViewRulesViewState); - if(avrs->initialized == 0) - { - avrs->initialized = 1; - avrs->src_column_pct = 0.5f; - avrs->dst_column_pct = 0.5f; - } -} - -DF_VIEW_CMD_FUNCTION_DEF(auto_view_rules) -{ - DF_AutoViewRulesViewState *avrs = df_view_user_state(view, DF_AutoViewRulesViewState); - - // rjf: process commands - for(D_CmdNode *n = cmds->first; n != 0; n = n->next) - { - D_Cmd *cmd = &n->cmd; - - // rjf: mismatched window/panel => skip - if(df_window_from_handle(cmd->params.window) != ws || - df_panel_from_handle(cmd->params.panel) != panel) - { - continue; - } - } -} - -DF_VIEW_UI_FUNCTION_DEF(auto_view_rules) -{ - ProfBeginFunction(); - Temp scratch = scratch_begin(0, 0); - D_EntityList maps_list = d_query_cached_entity_list_with_kind(D_EntityKind_AutoViewRule); - D_EntityArray maps = d_entity_array_from_list(scratch.arena, &maps_list); - F32 row_height_px = floor_f32(ui_top_font_size()*2.5f); - - //- rjf: grab state - DF_AutoViewRulesViewState *avrs = df_view_user_state(view, DF_AutoViewRulesViewState); - - //- rjf: take controls to start/end editing - B32 edit_begin = 0; - B32 edit_end = 0; - B32 edit_commit = 0; - B32 edit_submit = 0; - UI_Focus(UI_FocusKind_On) if(ui_is_focus_active()) - { - if(!avrs->input_editing) - { - for(UI_Event *evt = 0; ui_next_event(&evt);) - { - if(evt->string.size != 0 || evt->flags & UI_EventFlag_Paste) - { - edit_begin = 1; - break; - } - } - if(ui_slot_press(UI_EventActionSlot_Edit)) - { - edit_begin = 1; - } - } - if(avrs->input_editing) - { - if(ui_slot_press(UI_EventActionSlot_Cancel)) - { - edit_end = 1; - edit_commit = 0; - } - if(ui_slot_press(UI_EventActionSlot_Accept)) - { - edit_end = 1; - edit_commit = 1; - edit_submit = 1; - } - } - } - - //- rjf: build - D_Handle commit_map = d_handle_zero(); - Side commit_side = Side_Invalid; - F32 *col_pcts[] = { &avrs->src_column_pct, &avrs->dst_column_pct }; - Vec2S64 next_cursor = avrs->cursor; - Rng1S64 visible_row_range = {0}; - UI_ScrollListParams scroll_list_params = {0}; - { - scroll_list_params.flags = UI_ScrollListFlag_All; - scroll_list_params.row_height_px = row_height_px; - scroll_list_params.dim_px = dim_2f32(rect); - scroll_list_params.cursor_range = r2s64(v2s64(0, 0), v2s64(1, maps.count + 1)); - scroll_list_params.item_range = r1s64(0, maps.count+2); - scroll_list_params.cursor_min_is_empty_selection[Axis2_Y] = 1; - } - UI_ScrollListSignal scroll_list_sig = {0}; - UI_Focus(UI_FocusKind_On) - UI_ScrollList(&scroll_list_params, - &view->scroll_pos.y, - avrs->input_editing ? 0 : &avrs->cursor, - 0, - &visible_row_range, - &scroll_list_sig) - UI_Focus(UI_FocusKind_Null) - UI_TableF(ArrayCount(col_pcts), col_pcts, "###tbl") - { - next_cursor = avrs->cursor; - - //- rjf: header - if(visible_row_range.min == 0) UI_TableVector UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) - { - UI_TableCell ui_label(str8_lit("Type")); - UI_TableCell ui_label(str8_lit("View Rule")); - } - - //- rjf: map rows - for(S64 row_idx = Max(1, visible_row_range.min); - row_idx <= visible_row_range.max && row_idx <= maps.count+1; - row_idx += 1) UI_TableVector - { - U64 map_idx = row_idx-1; - D_Entity *map = (map_idx < maps.count ? maps.v[map_idx] : &d_nil_entity); - D_Entity *source = d_entity_child_from_kind(map, D_EntityKind_Source); - D_Entity *dest = d_entity_child_from_kind(map, D_EntityKind_Dest); - String8 type = source->name; - String8 view_rule = dest->name; - B32 row_selected = (avrs->cursor.y == row_idx); - - //- rjf: type - UI_TableCell UI_WidthFill - { - //- rjf: editor - { - B32 value_selected = (row_selected && avrs->cursor.x == 0); - - // rjf: begin editing - if(value_selected && edit_begin) - { - avrs->input_editing = 1; - avrs->input_size = Min(sizeof(avrs->input_buffer), type.size); - MemoryCopy(avrs->input_buffer, type.str, avrs->input_size); - avrs->input_cursor = txt_pt(1, 1+avrs->input_size); - avrs->input_mark = txt_pt(1, 1); - } - - // rjf: build - UI_Signal sig = {0}; - UI_FocusHot(value_selected ? UI_FocusKind_On : UI_FocusKind_Off) - UI_FocusActive((value_selected && avrs->input_editing) ? UI_FocusKind_On : UI_FocusKind_Off) - DF_Font(ws, DF_FontSlot_Code) - { - sig = df_line_editf(ws, DF_LineEditFlag_CodeContents|DF_LineEditFlag_NoBackground|DF_LineEditFlag_DisplayStringIsCode, 0, 0, &avrs->input_cursor, &avrs->input_mark, avrs->input_buffer, sizeof(avrs->input_buffer), &avrs->input_size, 0, type, "###src_editor_%p", map); - edit_commit = edit_commit || ui_committed(sig); - } - - // rjf: focus panel on press - if(ui_pressed(sig)) - { - d_cmd(D_CmdKind_FocusPanel); - } - - // rjf: begin editing on double-click - if(!avrs->input_editing && ui_double_clicked(sig)) - { - avrs->input_editing = 1; - avrs->input_size = Min(sizeof(avrs->input_buffer), type.size); - MemoryCopy(avrs->input_buffer, type.str, avrs->input_size); - avrs->input_cursor = txt_pt(1, 1+avrs->input_size); - avrs->input_mark = txt_pt(1, 1); - } - - // rjf: press on non-selected => commit edit, change selected cell - if(ui_pressed(sig) && !value_selected) - { - edit_end = 1; - edit_commit = avrs->input_editing; - next_cursor.x = 0; - next_cursor.y = map_idx+1; - } - - // rjf: store commit information - if(value_selected) - { - commit_side = Side_Min; - commit_map = d_handle_from_entity(map); - } - } - } - - //- rjf: dst - UI_TableCell UI_WidthFill - { - //- rjf: editor - { - B32 value_selected = (row_selected && avrs->cursor.x == 1); - - // rjf: begin editing - if(value_selected && edit_begin) - { - avrs->input_editing = 1; - avrs->input_size = Min(sizeof(avrs->input_buffer), view_rule.size); - MemoryCopy(avrs->input_buffer, view_rule.str, avrs->input_size); - avrs->input_cursor = txt_pt(1, 1+avrs->input_size); - avrs->input_mark = txt_pt(1, 1); - } - - // rjf: build - UI_Signal sig = {0}; - UI_FocusHot(value_selected ? UI_FocusKind_On : UI_FocusKind_Off) - UI_FocusActive((value_selected && avrs->input_editing) ? UI_FocusKind_On : UI_FocusKind_Off) - DF_Font(ws, DF_FontSlot_Code) - { - sig = df_line_editf(ws, DF_LineEditFlag_CodeContents|DF_LineEditFlag_NoBackground|DF_LineEditFlag_DisplayStringIsCode, 0, 0, &avrs->input_cursor, &avrs->input_mark, avrs->input_buffer, sizeof(avrs->input_buffer), &avrs->input_size, 0, view_rule, "###dst_editor_%p", map); - edit_commit = edit_commit || ui_committed(sig); - } - - // rjf: focus panel on press - if(ui_pressed(sig)) - { - d_cmd(D_CmdKind_FocusPanel); - } - - // rjf: begin editing on double-click - if(!avrs->input_editing && ui_double_clicked(sig)) - { - avrs->input_editing = 1; - avrs->input_size = Min(sizeof(avrs->input_buffer), view_rule.size); - MemoryCopy(avrs->input_buffer, view_rule.str, avrs->input_size); - avrs->input_cursor = txt_pt(1, 1+avrs->input_size); - avrs->input_mark = txt_pt(1, 1); - } - - // rjf: press on non-selected => commit edit, change selected cell - if(ui_pressed(sig) && !value_selected) - { - edit_end = 1; - edit_commit = avrs->input_editing; - next_cursor.x = 1; - next_cursor.y = map_idx+1; - } - - // rjf: store commit information - if(value_selected) - { - commit_side = Side_Max; - commit_map = d_handle_from_entity(map); - } - } - } - } - } - - //- rjf: apply commit - if(edit_commit && commit_side != Side_Invalid) - { - String8 new_string = str8(avrs->input_buffer, avrs->input_size); - d_cmd(commit_side == Side_Min ? - D_CmdKind_SetAutoViewRuleType : - D_CmdKind_SetAutoViewRuleViewRule, - .entity = commit_map, - .string = new_string); - } - - //- rjf: apply editing finish - if(edit_end) - { - avrs->input_editing = 0; - } - - //- rjf: move down one row if submitted - if(edit_submit) - { - next_cursor.y += 1; - } - - //- rjf: apply moves to selection - avrs->cursor = next_cursor; - - scratch_end(scratch); - ProfEnd(); -} +DF_VIEW_SETUP_FUNCTION_DEF(auto_view_rules){} +DF_VIEW_CMD_FUNCTION_DEF(auto_view_rules){} +DF_VIEW_UI_FUNCTION_DEF(auto_view_rules){} //////////////////////////////// //~ rjf: breakpoints @view_hook_impl @@ -5732,13 +5444,13 @@ DF_VIEW_SETUP_FUNCTION_DEF(breakpoints) DF_VIEW_CMD_FUNCTION_DEF(breakpoints) { DF_WatchViewState *ewv = df_view_user_state(view, DF_WatchViewState); - df_watch_view_cmds(ws, panel, view, ewv, cmds); + df_watch_view_cmds(view, ewv, cmds); } DF_VIEW_UI_FUNCTION_DEF(breakpoints) { ProfBeginFunction(); DF_WatchViewState *ewv = df_view_user_state(view, DF_WatchViewState); - df_watch_view_build(ws, panel, view, ewv, 0, 10, rect); + df_watch_view_build(view, ewv, 0, 10, rect); ProfEnd(); } @@ -5755,13 +5467,13 @@ DF_VIEW_SETUP_FUNCTION_DEF(watch_pins) DF_VIEW_CMD_FUNCTION_DEF(watch_pins) { DF_WatchViewState *ewv = df_view_user_state(view, DF_WatchViewState); - df_watch_view_cmds(ws, panel, view, ewv, cmds); + df_watch_view_cmds(view, ewv, cmds); } DF_VIEW_UI_FUNCTION_DEF(watch_pins) { ProfBeginFunction(); DF_WatchViewState *ewv = df_view_user_state(view, DF_WatchViewState); - df_watch_view_build(ws, panel, view, ewv, 0, 10, rect); + df_watch_view_build(view, ewv, 0, 10, rect); ProfEnd(); } @@ -5904,14 +5616,14 @@ DF_VIEW_UI_FUNCTION_DEF(scheduler) UI_Palette *palette = ui_top_palette(); if(frozen) { - palette = df_palette_from_code(ws, DF_PaletteCode_NegativePopButton); + palette = df_palette_from_code(DF_PaletteCode_NegativePopButton); } else { - palette = df_palette_from_code(ws, DF_PaletteCode_PositivePopButton); + palette = df_palette_from_code(DF_PaletteCode_PositivePopButton); } UI_Signal sig = {0}; - UI_Palette(palette) sig = df_icon_buttonf(ws, frozen ? DF_IconKind_Locked : DF_IconKind_Unlocked, 0, "###lock_%p", entity); + UI_Palette(palette) sig = df_icon_buttonf(frozen ? DF_IconKind_Locked : DF_IconKind_Unlocked, 0, "###lock_%p", entity); if(ui_clicked(sig)) { D_CmdKind cmd_kind = frozen ? D_CmdKind_ThawEntity : D_CmdKind_FreezeEntity; @@ -5921,7 +5633,7 @@ DF_VIEW_UI_FUNCTION_DEF(scheduler) UI_TableCellSized(ui_pct(1, 0)) UI_FocusHot((row_is_selected && desc_col_rng.min <= cursor.x && cursor.x <= desc_col_rng.max) ? UI_FocusKind_On : UI_FocusKind_Off) { - df_entity_desc_button(ws, entity, &items.v[idx].matches, query, 0); + df_entity_desc_button(entity, &items.v[idx].matches, query, 0); } switch(entity->kind) { @@ -5943,15 +5655,15 @@ DF_VIEW_UI_FUNCTION_DEF(scheduler) } UI_TableCellSized(ui_em(2.25f, 1.f)) UI_FocusHot((row_is_selected && cursor.x == 3) ? UI_FocusKind_On : UI_FocusKind_Off) { - if(ui_clicked(df_icon_buttonf(ws, DF_IconKind_Redo, 0, "###retry"))) + if(ui_clicked(df_icon_buttonf(DF_IconKind_Redo, 0, "###retry"))) { d_cmd(D_CmdKind_Restart, .entity = d_handle_from_entity(entity)); } } UI_TableCellSized(ui_em(2.25f, 1.f)) UI_FocusHot((row_is_selected && cursor.x == 4) ? UI_FocusKind_On : UI_FocusKind_Off) { - DF_Palette(ws, DF_PaletteCode_NegativePopButton) - if(ui_clicked(df_icon_buttonf(ws, DF_IconKind_X, 0, "###kill"))) + DF_Palette(DF_PaletteCode_NegativePopButton) + if(ui_clicked(df_icon_buttonf(DF_IconKind_X, 0, "###kill"))) { d_cmd(D_CmdKind_Kill, .entity = d_handle_from_entity(entity)); } @@ -5969,7 +5681,7 @@ DF_VIEW_UI_FUNCTION_DEF(scheduler) D_LineList lines = d_lines_from_dbgi_key_voff(scratch.arena, &dbgi_key, rip_voff); if(lines.first != 0) { - UI_PrefWidth(ui_children_sum(0)) df_src_loc_button(ws, lines.first->v.file_path, lines.first->v.pt); + UI_PrefWidth(ui_children_sum(0)) df_src_loc_button(lines.first->v.file_path, lines.first->v.pt); } } }break; @@ -6003,7 +5715,7 @@ DF_VIEW_UI_FUNCTION_DEF(call_stack) { ProfBeginFunction(); DF_WatchViewState *wv = df_view_user_state(view, DF_WatchViewState); - df_watch_view_build(ws, panel, view, wv, 0, 10, rect); + df_watch_view_build(view, wv, 0, 10, rect); ProfEnd(); } @@ -6049,8 +5761,8 @@ DF_VIEW_CMD_FUNCTION_DEF(modules) D_Cmd *cmd = &n->cmd; // rjf: mismatched window/panel => skip - if(df_window_from_handle(cmd->params.window) != ws || - df_panel_from_handle(cmd->params.panel) != panel) + if(!d_handle_match(d_interact_regs()->window, cmd->params.window) || + !d_handle_match(d_interact_regs()->panel, cmd->params.panel)) { continue; } @@ -6214,7 +5926,7 @@ DF_VIEW_UI_FUNCTION_DEF(modules) { UI_TableCellSized(ui_pct(1, 0)) UI_FocusHot((row_is_selected) ? UI_FocusKind_On : UI_FocusKind_Off) { - df_entity_desc_button(ws, entity, &items.v[idx].matches, query, 0); + df_entity_desc_button(entity, &items.v[idx].matches, query, 0); } } idx_in_process = 0; @@ -6228,9 +5940,9 @@ DF_VIEW_UI_FUNCTION_DEF(modules) } UI_TableCell UI_FocusHot((row_is_selected && cursor.x == 0) ? UI_FocusKind_On : UI_FocusKind_Off) { - df_entity_desc_button(ws, entity, &items.v[idx].matches, query, 1); + df_entity_desc_button(entity, &items.v[idx].matches, query, 1); } - UI_TableCell DF_Font(ws, DF_FontSlot_Code) UI_FocusHot((row_is_selected && cursor.x == 1) ? UI_FocusKind_On : UI_FocusKind_Off) + UI_TableCell DF_Font(DF_FontSlot_Code) UI_FocusHot((row_is_selected && cursor.x == 1) ? UI_FocusKind_On : UI_FocusKind_Off) { UI_Box *range_box = ui_build_box_from_stringf(UI_BoxFlag_Clickable|UI_BoxFlag_DrawText, "[0x%I64x, 0x%I64x)###vaddr_range_%p", entity->vaddr_rng.min, entity->vaddr_rng.max, entity); UI_Signal sig = ui_signal_from_box(range_box); @@ -6268,7 +5980,7 @@ DF_VIEW_UI_FUNCTION_DEF(modules) UI_WidthFill { UI_Palette(dbgi_is_valid ? ui_top_palette() : ui_build_palette(ui_top_palette(), .text = df_rgba_from_theme_color(DF_ThemeColor_TextNegative))) - sig = df_line_editf(ws, DF_LineEditFlag_NoBackground, 0, 0, &mv->txt_cursor, &mv->txt_mark, mv->txt_buffer, sizeof(mv->txt_buffer), &mv->txt_size, 0, dbgi_path, "###dbg_path_%p", entity); + sig = df_line_editf(DF_LineEditFlag_NoBackground, 0, 0, &mv->txt_cursor, &mv->txt_mark, mv->txt_buffer, sizeof(mv->txt_buffer), &mv->txt_size, 0, dbgi_path, "###dbg_path_%p", entity); edit_commit = (edit_commit || ui_committed(sig)); } @@ -6360,13 +6072,13 @@ DF_VIEW_SETUP_FUNCTION_DEF(watch) DF_VIEW_CMD_FUNCTION_DEF(watch) { DF_WatchViewState *ewv = df_view_user_state(view, DF_WatchViewState); - df_watch_view_cmds(ws, panel, view, ewv, cmds); + df_watch_view_cmds(view, ewv, cmds); } DF_VIEW_UI_FUNCTION_DEF(watch) { ProfBeginFunction(); DF_WatchViewState *ewv = df_view_user_state(view, DF_WatchViewState); - df_watch_view_build(ws, panel, view, ewv, 1*(view->query_string_size == 0), 10, rect); + df_watch_view_build(view, ewv, 1*(view->query_string_size == 0), 10, rect); ProfEnd(); } @@ -6387,7 +6099,7 @@ DF_VIEW_UI_FUNCTION_DEF(locals) { ProfBeginFunction(); DF_WatchViewState *wv = df_view_user_state(view, DF_WatchViewState); - df_watch_view_build(ws, panel, view, wv, 0, 10, rect); + df_watch_view_build(view, wv, 0, 10, rect); ProfEnd(); } @@ -6408,7 +6120,7 @@ DF_VIEW_UI_FUNCTION_DEF(registers) { ProfBeginFunction(); DF_WatchViewState *wv = df_view_user_state(view, DF_WatchViewState); - df_watch_view_build(ws, panel, view, wv, 0, 16, rect); + df_watch_view_build(view, wv, 0, 16, rect); ProfEnd(); } @@ -6429,7 +6141,7 @@ DF_VIEW_UI_FUNCTION_DEF(globals) { ProfBeginFunction(); DF_WatchViewState *ewv = df_view_user_state(view, DF_WatchViewState); - df_watch_view_build(ws, panel, view, ewv, 0, 10, rect); + df_watch_view_build(view, ewv, 0, 10, rect); ProfEnd(); } @@ -6450,7 +6162,7 @@ DF_VIEW_UI_FUNCTION_DEF(thread_locals) { ProfBeginFunction(); DF_WatchViewState *ewv = df_view_user_state(view, DF_WatchViewState); - df_watch_view_build(ws, panel, view, ewv, 0, 10, rect); + df_watch_view_build(view, ewv, 0, 10, rect); ProfEnd(); } @@ -6471,7 +6183,7 @@ DF_VIEW_UI_FUNCTION_DEF(types) { ProfBeginFunction(); DF_WatchViewState *ewv = df_view_user_state(view, DF_WatchViewState); - df_watch_view_build(ws, panel, view, ewv, 0, 10, rect); + df_watch_view_build(view, ewv, 0, 10, rect); ProfEnd(); } @@ -6491,7 +6203,7 @@ DF_VIEW_UI_FUNCTION_DEF(procedures) { ProfBeginFunction(); DF_WatchViewState *ewv = df_view_user_state(view, DF_WatchViewState); - df_watch_view_build(ws, panel, view, ewv, 0, 10, rect); + df_watch_view_build(view, ewv, 0, 10, rect); ProfEnd(); } @@ -6522,8 +6234,8 @@ DF_VIEW_CMD_FUNCTION_DEF(pending_file) D_Cmd *cmd = &n->cmd; // rjf: mismatched window/panel => skip - if(df_window_from_handle(cmd->params.window) != ws || - df_panel_from_handle(cmd->params.panel) != panel) + if(!d_handle_match(d_interact_regs()->window, cmd->params.window) || + !d_handle_match(d_interact_regs()->panel, cmd->params.panel)) { continue; } @@ -6615,8 +6327,7 @@ DF_VIEW_CMD_FUNCTION_DEF(pending_file) view_spec = df_view_spec_from_kind(viewer_kind); } String8 query = d_eval_string_from_file_path(scratch.arena, file_path); - df_view_equip_spec(ws, view, view_spec, query, params_copy); - df_panel_notify_mutation(ws, panel); + df_view_equip_spec(view, view_spec, query, params_copy); } //- rjf: if entity is ready, but we have no viewer for it, then just close this tab @@ -6660,7 +6371,7 @@ DF_VIEW_CMD_FUNCTION_DEF(text) String8 data = hs_data_from_hash(hs_scope, hash); //- rjf: process general code-view commands - df_code_view_cmds(ws, panel, view, cv, cmds, data, &info, 0, r1u64(0, 0), di_key_zero()); + df_code_view_cmds(view, cv, cmds, data, &info, 0, r1u64(0, 0), di_key_zero()); //- rjf: process code-file commands for(D_CmdNode *n = cmds->first; n != 0; n = n->next) @@ -6668,8 +6379,8 @@ DF_VIEW_CMD_FUNCTION_DEF(text) D_Cmd *cmd = &n->cmd; // rjf: mismatched window/panel => skip - if(df_window_from_handle(cmd->params.window) != ws || - df_panel_from_handle(cmd->params.panel) != panel) + if(!d_handle_match(d_interact_regs()->window, cmd->params.window) || + !d_handle_match(d_interact_regs()->panel, cmd->params.panel)) { continue; } @@ -6748,7 +6459,7 @@ DF_VIEW_UI_FUNCTION_DEF(text) UI_PrefWidth(ui_text_dim(10, 1)) UI_Palette(ui_build_palette(ui_top_palette(), .text = df_rgba_from_theme_color(DF_ThemeColor_TextNegative))) { - DF_Font(ws, DF_FontSlot_Icons) ui_label(df_g_icon_kind_text_table[DF_IconKind_WarningBig]); + DF_Font(DF_FontSlot_Icons) ui_label(df_g_icon_kind_text_table[DF_IconKind_WarningBig]); ui_labelf("Could not find \"%S\".", path); } UI_PrefHeight(ui_em(3, 1)) @@ -6757,7 +6468,7 @@ DF_VIEW_UI_FUNCTION_DEF(text) UI_CornerRadius(ui_top_font_size()/3) UI_PrefWidth(ui_text_dim(10, 1)) UI_Focus(UI_FocusKind_On) - DF_Palette(ws, DF_PaletteCode_NeutralPopButton) + DF_Palette(DF_PaletteCode_NeutralPopButton) UI_TextAlignment(UI_TextAlign_Center) if(ui_clicked(ui_buttonf("Find alternative..."))) { @@ -6781,7 +6492,7 @@ DF_VIEW_UI_FUNCTION_DEF(text) DI_KeyList dbgi_keys = {0}; if(!file_is_missing && key_has_data) { - DF_CodeViewBuildResult result = df_code_view_build(scratch.arena, ws, panel, view, cv, DF_CodeViewBuildFlag_All, code_area_rect, data, &info, 0, r1u64(0, 0), di_key_zero()); + DF_CodeViewBuildResult result = df_code_view_build(scratch.arena, view, cv, DF_CodeViewBuildFlag_All, code_area_rect, data, &info, 0, r1u64(0, 0), di_key_zero()); dbgi_keys = result.dbgi_keys; } @@ -6825,7 +6536,7 @@ DF_VIEW_UI_FUNCTION_DEF(text) UI_Palette *palette = ui_top_palette(); if(file_is_out_of_date) { - palette = df_palette_from_code(ws, DF_PaletteCode_NegativePopButton); + palette = df_palette_from_code(DF_PaletteCode_NegativePopButton); } UI_Palette(palette) UI_Row @@ -6837,7 +6548,7 @@ DF_VIEW_UI_FUNCTION_DEF(text) { UI_Box *box = &ui_g_nil_box; UI_Palette(ui_build_palette(ui_top_palette(), .text = df_rgba_from_theme_color(DF_ThemeColor_TextNegative))) - DF_Font(ws, DF_FontSlot_Icons) + DF_Font(DF_FontSlot_Icons) { box = ui_build_box_from_stringf(UI_BoxFlag_DrawText|UI_BoxFlag_Clickable, "%S###file_ood_warning", df_g_icon_kind_text_table[DF_IconKind_WarningBig]); } @@ -6852,7 +6563,7 @@ DF_VIEW_UI_FUNCTION_DEF(text) } } } - DF_Font(ws, DF_FontSlot_Code) + DF_Font(DF_FontSlot_Code) { if(path.size != 0) { @@ -6979,7 +6690,7 @@ DF_VIEW_CMD_FUNCTION_DEF(disasm) ////////////////////////////// //- rjf: process general code-view commands // - df_code_view_cmds(ws, panel, view, &dv->cv, cmds, dasm_text_data, &dasm_text_info, &dasm_info.lines, range, dbgi_key); + df_code_view_cmds(view, &dv->cv, cmds, dasm_text_data, &dasm_text_info, &dasm_info.lines, range, dbgi_key); ////////////////////////////// //- rjf: process disassembly-specific commands @@ -6990,8 +6701,8 @@ DF_VIEW_CMD_FUNCTION_DEF(disasm) D_CmdParams params = cmd->params; // rjf: mismatched window/panel => skip - if(df_window_from_handle(cmd->params.window) != ws || - df_panel_from_handle(cmd->params.panel) != panel) + if(!d_handle_match(d_interact_regs()->window, cmd->params.window) || + !d_handle_match(d_interact_regs()->panel, cmd->params.panel)) { continue; } @@ -7133,7 +6844,7 @@ DF_VIEW_UI_FUNCTION_DEF(disasm) // if(!is_loading && has_disasm) { - df_code_view_build(scratch.arena, ws, panel, view, cv, DF_CodeViewBuildFlag_All, code_area_rect, dasm_text_data, &dasm_text_info, &dasm_info.lines, range, dbgi_key); + df_code_view_build(scratch.arena, view, cv, DF_CodeViewBuildFlag_All, code_area_rect, dasm_text_data, &dasm_text_info, &dasm_info.lines, range, dbgi_key); } ////////////////////////////// @@ -7158,7 +6869,7 @@ DF_VIEW_UI_FUNCTION_DEF(disasm) UI_TextAlignment(UI_TextAlign_Center) UI_PrefWidth(ui_text_dim(10, 1)) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) - DF_Font(ws, DF_FontSlot_Code) + DF_Font(DF_FontSlot_Code) { U64 cursor_vaddr = (1 <= d_interact_regs()->cursor.line && d_interact_regs()->cursor.line <= dasm_info.lines.count) ? (range.min+dasm_info.lines.v[d_interact_regs()->cursor.line-1].code_off) : 0; if(!d_entity_is_nil(dasm_module)) @@ -7205,7 +6916,7 @@ DF_VIEW_CMD_FUNCTION_DEF(output) U128 hash = {0}; TXT_TextInfo info = txt_text_info_from_key_lang(txt_scope, d_interact_regs()->text_key, d_interact_regs()->lang_kind, &hash); String8 data = hs_data_from_hash(hs_scope, hash); - df_code_view_cmds(ws, panel, view, cv, cmds, data, &info, 0, r1u64(0, 0), di_key_zero()); + df_code_view_cmds(view, cv, cmds, data, &info, 0, r1u64(0, 0), di_key_zero()); txt_scope_close(txt_scope); hs_scope_close(hs_scope); scratch_end(scratch); @@ -7244,7 +6955,7 @@ DF_VIEW_UI_FUNCTION_DEF(output) //- rjf: build code contents // { - df_code_view_build(scratch.arena, ws, panel, view, cv, 0, code_area_rect, data, &info, 0, r1u64(0, 0), di_key_zero()); + df_code_view_build(scratch.arena, view, cv, 0, code_area_rect, data, &info, 0, r1u64(0, 0), di_key_zero()); } ////////////////////////////// @@ -7257,7 +6968,7 @@ DF_VIEW_UI_FUNCTION_DEF(output) UI_TextAlignment(UI_TextAlign_Center) UI_PrefWidth(ui_text_dim(10, 1)) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) - DF_Font(ws, DF_FontSlot_Code) + DF_Font(DF_FontSlot_Code) { ui_labelf("(Debug String Output)"); ui_spacer(ui_em(1.5f, 1)); @@ -7359,7 +7070,7 @@ DF_VIEW_UI_FUNCTION_DEF(memory) //- rjf: unpack visual params // FNT_Tag font = df_font_from_slot(DF_FontSlot_Code); - F32 font_size = df_font_size_from_slot(ws, DF_FontSlot_Code); + F32 font_size = df_font_size_from_slot(DF_FontSlot_Code); F32 big_glyph_advance = fnt_dim_from_tag_size_string(font, font_size, 0, 0, str8_lit("H")).x; F32 row_height_px = floor_f32(font_size*2.f); F32 cell_width_px = floor_f32(font_size*2.f * bytes_per_cell); @@ -7688,7 +7399,7 @@ DF_VIEW_UI_FUNCTION_DEF(memory) UI_WidthFill UI_PrefHeight(ui_px(row_height_px, 1.f)) UI_Row header_box = ui_build_box_from_stringf(UI_BoxFlag_DrawSideBottom, "table_header"); UI_Parent(header_box) - DF_Font(ws, DF_FontSlot_Code) + DF_Font(DF_FontSlot_Code) UI_FontSize(font_size) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) { @@ -7843,7 +7554,7 @@ DF_VIEW_UI_FUNCTION_DEF(memory) ////////////////////////////// //- rjf: build rows // - UI_Parent(row_container_box) DF_Font(ws, DF_FontSlot_Code) UI_FontSize(font_size) + UI_Parent(row_container_box) DF_Font(DF_FontSlot_Code) UI_FontSize(font_size) { Rng1U64 selection = r1u64(cursor, mark); U8 *row_ascii_buffer = push_array(scratch.arena, U8, num_columns); @@ -7935,8 +7646,8 @@ DF_VIEW_UI_FUNCTION_DEF(memory) { UI_PrefWidth(ui_children_sum(1)) UI_Row UI_PrefWidth(ui_text_dim(10, 1)) { - DF_Font(ws, DF_FontSlot_Code) ui_label(a->name_string); - DF_Font(ws, DF_FontSlot_Main) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_label(a->kind_string); + DF_Font(DF_FontSlot_Code) ui_label(a->name_string); + DF_Font(DF_FontSlot_Main) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_label(a->kind_string); } if(a->type_string.size != 0) { @@ -8014,7 +7725,7 @@ DF_VIEW_UI_FUNCTION_DEF(memory) ui_set_next_fixed_width(dim_2f32(footer_rect).x); ui_set_next_fixed_height(dim_2f32(footer_rect).y); footer_box = ui_build_box_from_stringf(UI_BoxFlag_DrawBackground|UI_BoxFlag_DrawDropShadow, "footer"); - UI_Parent(footer_box) DF_Font(ws, DF_FontSlot_Code) UI_FontSize(font_size) + UI_Parent(footer_box) DF_Font(DF_FontSlot_Code) UI_FontSize(font_size) { UI_PrefWidth(ui_em(7.5f, 1.f)) UI_HeightFill UI_Column UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_PrefHeight(ui_px(row_height_px, 0.f)) @@ -8445,7 +8156,7 @@ DF_VIEW_UI_FUNCTION_DEF(color_rgba) { 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)) DF_Font(ws, DF_FontSlot_Code) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) + UI_PrefWidth(ui_children_sum(1)) UI_Column UI_PrefWidth(ui_text_dim(10, 1)) UI_PrefHeight(ui_em(2.f, 0.f)) DF_Font(DF_FontSlot_Code) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) { ui_labelf("Hex"); ui_labelf("R"); @@ -8456,7 +8167,7 @@ DF_VIEW_UI_FUNCTION_DEF(color_rgba) 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)) DF_Font(ws, DF_FontSlot_Code) + UI_PrefWidth(ui_children_sum(1)) UI_Column UI_PrefWidth(ui_text_dim(10, 1)) UI_PrefHeight(ui_em(2.f, 0.f)) DF_Font(DF_FontSlot_Code) { String8 hex_string = hex_string_from_rgba_4f32(scratch.arena, rgba); ui_label(hex_string); @@ -8756,7 +8467,7 @@ DF_VIEW_UI_FUNCTION_DEF(exception_filters) UI_FocusHot(sv->cursor.y == row+1 ? UI_FocusKind_On : UI_FocusKind_Off) { DF_ExceptionFiltersOption *opt = &opts.v[row]; - UI_Signal sig = df_icon_buttonf(ws, opt->is_enabled ? DF_IconKind_CheckFilled : DF_IconKind_CheckHollow, &opt->matches, "%S", opt->name); + UI_Signal sig = df_icon_buttonf(opt->is_enabled ? DF_IconKind_CheckFilled : DF_IconKind_CheckHollow, &opt->matches, "%S", opt->name); if(ui_clicked(sig)) { if(opt->exception_code_kind != CTRL_ExceptionCodeKind_Null) @@ -8861,6 +8572,7 @@ DF_VIEW_UI_FUNCTION_DEF(settings) Temp scratch = scratch_begin(0, 0); F32 row_height_px = floor_f32(ui_top_font_size()*2.5f); String8 query = string; + DF_Window *window = df_window_from_handle(d_interact_regs()->window); ////////////////////////////// //- rjf: get state @@ -9093,7 +8805,7 @@ DF_VIEW_UI_FUNCTION_DEF(settings) color < DF_ThemeColor_COUNT; color = (DF_ThemeColor)(color+1)) { - DF_Palette(ws, DF_PaletteCode_Floating) + DF_Palette(DF_PaletteCode_Floating) UI_CtxMenu(color_ctx_menu_keys[color]) UI_Padding(ui_em(1.5f, 1.f)) UI_PrefWidth(ui_em(28.5f, 1)) UI_PrefHeight(ui_children_sum(1.f)) @@ -9150,10 +8862,10 @@ DF_VIEW_UI_FUNCTION_DEF(settings) String8 s_string = push_str8f(scratch.arena, "%.2f", hsva.y); String8 v_string = push_str8f(scratch.arena, "%.2f", hsva.z); String8 a_string = push_str8f(scratch.arena, "%.2f", rgba.w); - UI_Row DF_Font(ws, DF_FontSlot_Code) + UI_Row DF_Font(DF_FontSlot_Code) { UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_PrefWidth(ui_em(4.5f, 1.f)) ui_labelf("Hex"); - UI_Signal sig = df_line_editf(ws, DF_LineEditFlag_Border, 0, 0, &sv->txt_cursor, &sv->txt_mark, sv->txt_buffer, sizeof(sv->txt_buffer), &sv->txt_size, 0, hex_string, "###hex_edit"); + UI_Signal sig = df_line_editf(DF_LineEditFlag_Border, 0, 0, &sv->txt_cursor, &sv->txt_mark, sv->txt_buffer, sizeof(sv->txt_buffer), &sv->txt_size, 0, hex_string, "###hex_edit"); if(ui_committed(sig)) { String8 string = str8(sv->txt_buffer, sv->txt_size); @@ -9166,7 +8878,7 @@ DF_VIEW_UI_FUNCTION_DEF(settings) UI_Row { UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_PrefWidth(ui_em(4.5f, 1.f)) ui_labelf("R"); - UI_Signal sig = df_line_editf(ws, DF_LineEditFlag_Border, 0, 0, &sv->txt_cursor, &sv->txt_mark, sv->txt_buffer, sizeof(sv->txt_buffer), &sv->txt_size, 0, r_string, "###r_edit"); + UI_Signal sig = df_line_editf(DF_LineEditFlag_Border, 0, 0, &sv->txt_cursor, &sv->txt_mark, sv->txt_buffer, sizeof(sv->txt_buffer), &sv->txt_size, 0, r_string, "###r_edit"); if(ui_committed(sig)) { String8 string = str8(sv->txt_buffer, sv->txt_size); @@ -9178,7 +8890,7 @@ DF_VIEW_UI_FUNCTION_DEF(settings) UI_Row { UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_PrefWidth(ui_em(4.5f, 1.f)) ui_labelf("G"); - UI_Signal sig = df_line_editf(ws, DF_LineEditFlag_Border, 0, 0, &sv->txt_cursor, &sv->txt_mark, sv->txt_buffer, sizeof(sv->txt_buffer), &sv->txt_size, 0, g_string, "###g_edit"); + UI_Signal sig = df_line_editf(DF_LineEditFlag_Border, 0, 0, &sv->txt_cursor, &sv->txt_mark, sv->txt_buffer, sizeof(sv->txt_buffer), &sv->txt_size, 0, g_string, "###g_edit"); if(ui_committed(sig)) { String8 string = str8(sv->txt_buffer, sv->txt_size); @@ -9190,7 +8902,7 @@ DF_VIEW_UI_FUNCTION_DEF(settings) UI_Row { UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_PrefWidth(ui_em(4.5f, 1.f)) ui_labelf("B"); - UI_Signal sig = df_line_editf(ws, DF_LineEditFlag_Border, 0, 0, &sv->txt_cursor, &sv->txt_mark, sv->txt_buffer, sizeof(sv->txt_buffer), &sv->txt_size, 0, b_string, "###b_edit"); + UI_Signal sig = df_line_editf(DF_LineEditFlag_Border, 0, 0, &sv->txt_cursor, &sv->txt_mark, sv->txt_buffer, sizeof(sv->txt_buffer), &sv->txt_size, 0, b_string, "###b_edit"); if(ui_committed(sig)) { String8 string = str8(sv->txt_buffer, sv->txt_size); @@ -9203,7 +8915,7 @@ DF_VIEW_UI_FUNCTION_DEF(settings) UI_Row { UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_PrefWidth(ui_em(4.5f, 1.f)) ui_labelf("H"); - UI_Signal sig = df_line_editf(ws, DF_LineEditFlag_Border, 0, 0, &sv->txt_cursor, &sv->txt_mark, sv->txt_buffer, sizeof(sv->txt_buffer), &sv->txt_size, 0, h_string, "###h_edit"); + UI_Signal sig = df_line_editf(DF_LineEditFlag_Border, 0, 0, &sv->txt_cursor, &sv->txt_mark, sv->txt_buffer, sizeof(sv->txt_buffer), &sv->txt_size, 0, h_string, "###h_edit"); if(ui_committed(sig)) { String8 string = str8(sv->txt_buffer, sv->txt_size); @@ -9214,7 +8926,7 @@ DF_VIEW_UI_FUNCTION_DEF(settings) UI_Row { UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_PrefWidth(ui_em(4.5f, 1.f)) ui_labelf("S"); - UI_Signal sig = df_line_editf(ws, DF_LineEditFlag_Border, 0, 0, &sv->txt_cursor, &sv->txt_mark, sv->txt_buffer, sizeof(sv->txt_buffer), &sv->txt_size, 0, s_string, "###s_edit"); + UI_Signal sig = df_line_editf(DF_LineEditFlag_Border, 0, 0, &sv->txt_cursor, &sv->txt_mark, sv->txt_buffer, sizeof(sv->txt_buffer), &sv->txt_size, 0, s_string, "###s_edit"); if(ui_committed(sig)) { String8 string = str8(sv->txt_buffer, sv->txt_size); @@ -9225,7 +8937,7 @@ DF_VIEW_UI_FUNCTION_DEF(settings) UI_Row { UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_PrefWidth(ui_em(4.5f, 1.f)) ui_labelf("V"); - UI_Signal sig = df_line_editf(ws, DF_LineEditFlag_Border, 0, 0, &sv->txt_cursor, &sv->txt_mark, sv->txt_buffer, sizeof(sv->txt_buffer), &sv->txt_size, 0, v_string, "###v_edit"); + UI_Signal sig = df_line_editf(DF_LineEditFlag_Border, 0, 0, &sv->txt_cursor, &sv->txt_mark, sv->txt_buffer, sizeof(sv->txt_buffer), &sv->txt_size, 0, v_string, "###v_edit"); if(ui_committed(sig)) { String8 string = str8(sv->txt_buffer, sv->txt_size); @@ -9237,7 +8949,7 @@ DF_VIEW_UI_FUNCTION_DEF(settings) UI_Row { UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_PrefWidth(ui_em(4.5f, 1.f)) ui_labelf("A"); - UI_Signal sig = df_line_editf(ws, DF_LineEditFlag_Border, 0, 0, &sv->txt_cursor, &sv->txt_mark, sv->txt_buffer, sizeof(sv->txt_buffer), &sv->txt_size, 0, a_string, "###a_edit"); + UI_Signal sig = df_line_editf(DF_LineEditFlag_Border, 0, 0, &sv->txt_cursor, &sv->txt_mark, sv->txt_buffer, sizeof(sv->txt_buffer), &sv->txt_size, 0, a_string, "###a_edit"); if(ui_committed(sig)) { String8 string = str8(sv->txt_buffer, sv->txt_size); @@ -9323,7 +9035,7 @@ DF_VIEW_UI_FUNCTION_DEF(settings) { rgba = df_rgba_from_theme_color(item->color); }break; - case DF_SettingsItemKind_WindowSetting: {val_table = &ws->setting_vals[0];}goto setting; + case DF_SettingsItemKind_WindowSetting: {val_table = &window->setting_vals[0];}goto setting; case DF_SettingsItemKind_GlobalSetting:{}goto setting; setting:; { @@ -9361,7 +9073,7 @@ DF_VIEW_UI_FUNCTION_DEF(settings) if(item->icon_kind != DF_IconKind_Null) { UI_PrefWidth(ui_em(3.f, 1.f)) - DF_Font(ws, DF_FontSlot_Icons) + DF_Font(DF_FontSlot_Icons) UI_Palette(ui_build_palette(ui_top_palette(), .text = rgba)) UI_TextAlignment(UI_TextAlign_Center) ui_label(df_g_icon_kind_text_table[item->icon_kind]); @@ -9388,7 +9100,7 @@ DF_VIEW_UI_FUNCTION_DEF(settings) { ui_spacer(ui_pct(1, 0)); UI_PrefWidth(ui_em(2.5f, 1.f)) - DF_Font(ws, DF_FontSlot_Icons) + DF_Font(DF_FontSlot_Icons) UI_Flags(UI_BoxFlag_DrawTextWeak) ui_label(df_g_icon_kind_text_table[is_toggled ? DF_IconKind_CheckFilled : DF_IconKind_CheckHollow]); } @@ -9396,7 +9108,7 @@ DF_VIEW_UI_FUNCTION_DEF(settings) { ui_spacer(ui_pct(1, 0)); UI_PrefWidth(ui_text_dim(10, 1)) - DF_Palette(ws, DF_PaletteCode_NegativePopButton) + DF_Palette(DF_PaletteCode_NegativePopButton) UI_CornerRadius(ui_top_font_size()*0.5f) UI_FontSize(ui_top_font_size()*0.9f) UI_TextAlignment(UI_TextAlign_Center) diff --git a/src/dbg_frontend/dbg_frontend_views.h b/src/dbg_frontend/dbg_frontend_views.h index 91a2390d..a294ff49 100644 --- a/src/dbg_frontend/dbg_frontend_views.h +++ b/src/dbg_frontend/dbg_frontend_views.h @@ -155,8 +155,8 @@ struct DF_WatchViewState //~ rjf: Code View Functions internal void df_code_view_init(DF_CodeViewState *cv, DF_View *view); -internal void df_code_view_cmds(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewState *cv, D_CmdList *cmds, String8 text_data, TXT_TextInfo *text_info, DASM_LineArray *dasm_lines, Rng1U64 dasm_vaddr_range, DI_Key dasm_dbgi_key); -internal DF_CodeViewBuildResult df_code_view_build(Arena *arena, DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewState *cv, DF_CodeViewBuildFlags flags, Rng2F32 rect, String8 text_data, TXT_TextInfo *text_info, DASM_LineArray *dasm_lines, Rng1U64 dasm_vaddr_range, DI_Key dasm_dbgi_key); +internal void df_code_view_cmds(DF_View *view, DF_CodeViewState *cv, D_CmdList *cmds, String8 text_data, TXT_TextInfo *text_info, DASM_LineArray *dasm_lines, Rng1U64 dasm_vaddr_range, DI_Key dasm_dbgi_key); +internal DF_CodeViewBuildResult df_code_view_build(Arena *arena, DF_View *view, DF_CodeViewState *cv, DF_CodeViewBuildFlags flags, Rng2F32 rect, String8 text_data, TXT_TextInfo *text_info, DASM_LineArray *dasm_lines, Rng1U64 dasm_vaddr_range, DI_Key dasm_dbgi_key); //////////////////////////////// //~ rjf: Watch View Functions @@ -185,7 +185,7 @@ internal void df_watch_view_column_release(DF_WatchViewState *wv, DF_WatchViewCo //- rjf: watch view main hooks internal void df_watch_view_init(DF_WatchViewState *ewv, DF_View *view, DF_WatchViewFillKind fill_kind); -internal void df_watch_view_cmds(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewState *ewv, D_CmdList *cmds); -internal void df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewState *ewv, B32 modifiable, U32 default_radix, Rng2F32 rect); +internal void df_watch_view_cmds(DF_View *view, DF_WatchViewState *ewv, D_CmdList *cmds); +internal void df_watch_view_build(DF_View *view, DF_WatchViewState *ewv, B32 modifiable, U32 default_radix, Rng2F32 rect); #endif // DBG_FRONTEND_VIEWS_H diff --git a/src/dbg_frontend/generated/dbg_frontend.meta.c b/src/dbg_frontend/generated/dbg_frontend.meta.c index fee189a3..b87db111 100644 --- a/src/dbg_frontend/generated/dbg_frontend.meta.c +++ b/src/dbg_frontend/generated/dbg_frontend.meta.c @@ -476,7 +476,7 @@ DF_IconKind_Null, DF_IconKind_Null, }; -DF_IconKind df_entity_kind_icon_kind_table[28] = +DF_IconKind df_entity_kind_icon_kind_table[31] = { DF_IconKind_Null, DF_IconKind_Null, @@ -495,6 +495,9 @@ DF_IconKind_Null, DF_IconKind_Null, DF_IconKind_Null, DF_IconKind_Null, +DF_IconKind_Window, +DF_IconKind_XSplit, +DF_IconKind_Null, DF_IconKind_Briefcase, DF_IconKind_Null, DF_IconKind_Null, diff --git a/src/dbg_frontend/generated/dbg_frontend.meta.h b/src/dbg_frontend/generated/dbg_frontend.meta.h index 27b4b31e..c11f655a 100644 --- a/src/dbg_frontend/generated/dbg_frontend.meta.h +++ b/src/dbg_frontend/generated/dbg_frontend.meta.h @@ -359,7 +359,7 @@ extern String8 df_g_binding_version_remap_new_name_table[7]; extern String8 df_g_icon_kind_text_table[69]; extern DF_ViewSpecInfo df_g_gfx_view_kind_spec_info_table[34]; extern DF_IconKind df_cmd_kind_icon_kind_table[221]; -extern DF_IconKind df_entity_kind_icon_kind_table[28]; +extern DF_IconKind df_entity_kind_icon_kind_table[31]; extern D_CmdParamSlot df_g_cmd_param_slot_2_view_spec_src_map[7]; extern String8 df_g_cmd_param_slot_2_view_spec_dst_map[7]; extern String8 df_g_cmd_param_slot_2_view_spec_cmd_map[7];