diff --git a/src/df/core/df_core.mdesk b/src/df/core/df_core.mdesk index 8c38aa73..354798a6 100644 --- a/src/df/core/df_core.mdesk +++ b/src/df/core/df_core.mdesk @@ -16,14 +16,6 @@ DF_CfgSrcTable: //////////////////////////////// //~ rjf: Entity Kind Tables -@table(name) -DF_NameKindTable: -{ - {Null} - {EntityName} - {EntityKindName} -} - @table(name name_lower op_delete op_freeze op_edit op_rename op_enable op_cond op_dup lf_mut_user_cfg tr_mut_user_cfg lf_mut_prof_cfg tr_mut_prof_cfg lf_mut_halt lf_mut_dbg tr_mut_halt tr_mut_dbg name_is_code user_lifetime name_label icon_kind display_string) DF_EntityKindTable: { @@ -81,24 +73,24 @@ DF_EntityKindTable: @table(name, name_lower, c_type) DF_CmdParamSlotTable: { - {Window, window, `DF_Handle`} - {Panel, panel, `DF_Handle`} - {DestPanel, dest_panel, `DF_Handle`} - {PrevView, prev_view, `DF_Handle`} - {View, view, `DF_Handle`} - {Entity, entity, `DF_Handle`} - {EntityList, entity_list, `DF_HandleList`} - {String, string, `String8`} - {FilePath, file_path, `String8`} - {TextPoint, text_point, `TxtPt`} - {CmdSpec, cmd_spec, `struct DF_CmdSpec *`} - {ViewSpec, view_spec, `struct DF_ViewSpec *`} - {VirtualAddr, vaddr, `U64`} - {VirtualOff, voff, `U64`} - {Index, index, `U64`} - {ID, id, `U64`} - {PreferDisassembly, prefer_dasm, `B32`} - {ForceConfirm, force_confirm,`B32`} + {Window window `DF_Handle`} + {Panel panel `DF_Handle`} + {DestPanel dest_panel `DF_Handle`} + {PrevView prev_view `DF_Handle`} + {View view `DF_Handle`} + {Entity entity `DF_Handle`} + {EntityList entity_list `DF_HandleList`} + {String string `String8`} + {FilePath file_path `String8`} + {TextPoint text_point `TxtPt`} + {CmdSpec cmd_spec `struct DF_CmdSpec *`} + {ViewSpec view_spec `struct DF_ViewSpec *`} + {VirtualAddr vaddr `U64`} + {VirtualOff voff `U64`} + {Index index `U64`} + {ID id `U64`} + {PreferDisassembly prefer_dasm `B32`} + {ForceConfirm force_confirm `B32`} } @table(name lister_omit q_slot q_ent_kind q_allow_files q_allow_folders q_keep_oi q_select_oi q_is_code q_required canonical_icon string display_name desc search_tags ) @@ -1706,12 +1698,6 @@ DF_DevToggleTable: COUNT, } -@enum DF_NameKind: -{ - @expand(DF_NameKindTable, a) `$(a.name)`, - COUNT, -} - @enum DF_CoreCmdKind: { @expand(DF_CoreCmdTable, a) `$(a.name)`, diff --git a/src/df/core/generated/df_core.meta.h b/src/df/core/generated/df_core.meta.h index 839d6b19..c0c52a0b 100644 --- a/src/df/core/generated/df_core.meta.h +++ b/src/df/core/generated/df_core.meta.h @@ -46,14 +46,6 @@ DF_EntityKind_EndedProcess, DF_EntityKind_COUNT, } DF_EntityKind; -typedef enum DF_NameKind -{ -DF_NameKind_Null, -DF_NameKind_EntityName, -DF_NameKind_EntityKindName, -DF_NameKind_COUNT, -} DF_NameKind; - typedef enum DF_CoreCmdKind { DF_CoreCmdKind_Null, diff --git a/src/df/gfx/df_gfx.c b/src/df/gfx/df_gfx.c index d6b7ed78..b3fffc7d 100644 --- a/src/df/gfx/df_gfx.c +++ b/src/df/gfx/df_gfx.c @@ -9149,7 +9149,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ ui_set_next_pref_width(ui_px(params->margin_width_px, 1)); ui_set_next_pref_height(ui_px(params->line_height_px*(dim_1s64(params->line_num_range)+1), 1.f)); ui_set_next_child_layout_axis(Axis2_Y); - margin_container_box = ui_build_box_from_string(UI_BoxFlag_Clickable, str8_lit("margin_container")); + margin_container_box = ui_build_box_from_string(UI_BoxFlag_Clickable*!!(params->flags & DF_CodeSliceFlag_Clickable), str8_lit("margin_container")); UI_Parent(margin_container_box) UI_PrefHeight(ui_px(params->line_height_px, 1.f)) { U64 line_idx = 0; @@ -9162,7 +9162,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ DF_EntityList line_pins = params->line_pins[line_idx]; ui_set_next_hover_cursor(OS_Cursor_HandPoint); ui_set_next_background_color(v4f32(0, 0, 0, 0)); - UI_Box *line_margin_box = ui_build_box_from_stringf(UI_BoxFlag_Clickable|UI_BoxFlag_DrawBackground|UI_BoxFlag_DrawActiveEffects, "line_margin_%I64x", line_num); + UI_Box *line_margin_box = ui_build_box_from_stringf(UI_BoxFlag_Clickable*!!(params->flags & DF_CodeSliceFlag_Clickable)|UI_BoxFlag_DrawBackground|UI_BoxFlag_DrawActiveEffects, "line_margin_%I64x", line_num); UI_Parent(line_margin_box) { //- rjf: build margin thread ip ui @@ -9215,7 +9215,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ ui_set_next_text_alignment(UI_TextAlign_Center); UI_Key thread_box_key = ui_key_from_stringf(top_container_box->key, "###ip_%p", thread); UI_Box *thread_box = ui_build_box_from_key(UI_BoxFlag_DisableTextTrunc| - UI_BoxFlag_Clickable| + UI_BoxFlag_Clickable*!!(params->flags & DF_CodeSliceFlag_Clickable)| UI_BoxFlag_AnimatePosX| UI_BoxFlag_DrawText, thread_box_key); @@ -9341,7 +9341,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ UI_BoxFlag_DrawHotEffects| UI_BoxFlag_DrawBorder| UI_BoxFlag_AnimatePosX| - UI_BoxFlag_Clickable| + UI_BoxFlag_Clickable*!!(params->flags & DF_CodeSliceFlag_Clickable)| UI_BoxFlag_DisableTextTrunc, "%S##bp_%p", df_g_icon_kind_text_table[DF_IconKind_CircleFilled], @@ -9408,7 +9408,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ UI_BoxFlag_DrawActiveEffects| UI_BoxFlag_DrawHotEffects| UI_BoxFlag_DrawBorder| - UI_BoxFlag_Clickable| + UI_BoxFlag_Clickable*!!(params->flags & DF_CodeSliceFlag_Clickable)| UI_BoxFlag_AnimatePosX| UI_BoxFlag_DisableTextTrunc, "%S##watch_%p", @@ -9472,7 +9472,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ { ui_set_next_hover_cursor(ctrlified ? OS_Cursor_HandPoint : OS_Cursor_IBar); ui_set_next_pref_height(ui_px(params->line_height_px*(dim_1s64(params->line_num_range)+1), 1.f)); - text_container_box = ui_build_box_from_string(UI_BoxFlag_Clickable, str8_lit("text_container")); + text_container_box = ui_build_box_from_string(UI_BoxFlag_Clickable*!!(params->flags & DF_CodeSliceFlag_Clickable), str8_lit("text_container")); } ////////////////////////////// @@ -9530,7 +9530,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ String8 explanation = df_stop_explanation_string_icon_from_ctrl_event(scratch.arena, &stop_event, &icon); UI_Parent(line_extras_boxes[line_idx]) UI_PrefWidth(ui_children_sum(1)) UI_PrefHeight(ui_px(params->line_height_px, 1.f)) { - UI_Box *box = ui_build_box_from_stringf(UI_BoxFlag_DrawBorder|UI_BoxFlag_Clickable, "###exception_info"); + UI_Box *box = ui_build_box_from_stringf(UI_BoxFlag_DrawBorder, "###exception_info"); UI_Parent(box) { UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_FailureBackground)) @@ -9580,7 +9580,10 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ ui_spacer(ui_em(1.5f, 1.f)); ui_set_next_pref_width(ui_children_sum(1)); UI_Key pin_box_key = ui_key_from_stringf(ui_key_zero(), "###pin_%p", pin); - UI_Box *pin_box = ui_build_box_from_key(UI_BoxFlag_AnimatePos|UI_BoxFlag_Clickable|UI_BoxFlag_DrawHotEffects|UI_BoxFlag_DrawBorder, pin_box_key); + UI_Box *pin_box = ui_build_box_from_key(UI_BoxFlag_AnimatePos| + UI_BoxFlag_Clickable*!!(params->flags & DF_CodeSliceFlag_Clickable)| + UI_BoxFlag_DrawHotEffects| + UI_BoxFlag_DrawBorder, pin_box_key); UI_Parent(pin_box) UI_PrefWidth(ui_text_dim(10, 1)) { Vec4F32 pin_color = df_rgba_from_theme_color(DF_ThemeColor_WeakText); diff --git a/src/df/gfx/df_gfx.h b/src/df/gfx/df_gfx.h index ae72efcf..0809b846 100644 --- a/src/df/gfx/df_gfx.h +++ b/src/df/gfx/df_gfx.h @@ -113,7 +113,7 @@ struct DF_ViewSpecInfo DF_ViewSpecFlags flags; String8 name; String8 display_string; - DF_NameKind name_kind; + enum DF_NameKind name_kind; DF_IconKind icon_kind; DF_ViewSetupFunctionType *setup_hook; DF_ViewStringFromStateFunctionType *string_from_state_hook; @@ -302,7 +302,7 @@ enum #define DF_GFX_VIEW_RULE_WHOLE_UI_FUNCTION_SIG(name) void name(struct DF_Window *ws, struct DF_Panel *panel, struct DF_View *view, Rng2F32 rect, DBGI_Scope *dbgi_scope, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, EVAL_String2ExprMap *macro_map, struct DF_CfgNode *cfg) #define DF_GFX_VIEW_RULE_WHOLE_UI_FUNCTION_NAME(name) df_gfx_view_rule_whole_ui__##name -#define DF_GFX_VIEW_RULE_WHOLE_UI_FUNCTION_DEF(name) DF_GFX_VIEW_RULE_WHOLW_UI_FUNCTION_SIG(DF_GFX_VIEW_RULE_WHOLE_UI_FUNCTION_NAME(name)) +#define DF_GFX_VIEW_RULE_WHOLE_UI_FUNCTION_DEF(name) DF_GFX_VIEW_RULE_WHOLE_UI_FUNCTION_SIG(DF_GFX_VIEW_RULE_WHOLE_UI_FUNCTION_NAME(name)) typedef DF_GFX_VIEW_RULE_VIZ_ROW_PROD_FUNCTION_SIG(DF_GfxViewRuleVizRowProdHookFunctionType); typedef DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_SIG(DF_GfxViewRuleLineStringizeHookFunctionType); @@ -383,8 +383,9 @@ enum typedef U32 DF_CodeSliceFlags; enum { - DF_CodeSliceFlag_Margin = (1<<0), - DF_CodeSliceFlag_LineNums = (1<<1), + DF_CodeSliceFlag_Clickable = (1<<0), + DF_CodeSliceFlag_Margin = (1<<1), + DF_CodeSliceFlag_LineNums = (1<<2), }; typedef struct DF_CodeSliceParams DF_CodeSliceParams; diff --git a/src/df/gfx/df_gfx.mdesk b/src/df/gfx/df_gfx.mdesk index 92a4283e..4fbcbf72 100644 --- a/src/df/gfx/df_gfx.mdesk +++ b/src/df/gfx/df_gfx.mdesk @@ -177,6 +177,14 @@ DF_BindingVersionRemapTable: //////////////////////////////// //~ rjf: Gfx Layer View Kinds +@table(name) +DF_NameKindTable: +{ + {Null} + {EntityName} + {EntityKindName} +} + @table(name, name_lower, display_string, name_kind, icon, parameterized_by_entity, can_serialize, can_serialize_entity_path, can_filter, filter_is_code, typing_automatically_filters, inc_in_docs, docs_desc) DF_GfxViewTable: { @@ -196,6 +204,7 @@ DF_GfxViewTable: { PendingEntity "pending_entity" "Pending Entity" EntityName FileOutline 1 0 0 0 0 0 0 "" } { Code "code" "Code" EntityName FileOutline 1 1 1 0 0 0 0 "" } { Disassembly "disassembly" "Disassembly" Null Glasses 0 1 0 0 0 0 1 "Displays disassembled instructions in a textual form from the selected thread's containing process virtual address space." } + { EvalViewer "eval_viewer" "Evaluation Viewer" Null Binoculars 0 1 0 0 0 0 0 "." } { Watch "watch" "Watch" Null Binoculars 0 1 0 1 1 1 1 "The familiar 'watch window' debugger interface. Allows the inputting of a number of expressions. Each expression in the table is evaluated within the context of the selected thread's selected call stack frame. If applicable (depending on visualization rules and the expression's type), these expressions may be hierarchically expanded, which displays children as more rows in the table. The values of these expressions may also be edited, and if possible, can be used to write to registers or memory in attached processes. Also contains a new *view rule* column, not found in other major debuggers, which allows per-row specification of various visualization rules. These view rules may be used to visualize and inspect the evaluation of expressions in a variety of ways. To learn more, read the 'View Rules' section." } { Locals "locals" "Locals" Null Binoculars 0 1 0 1 1 1 1 "Nearly identical to `Watch`, but automatically filled with local variables found within the selected call stack frame of the selected thread, according to the associated debug info. View rules and evaluation values can be edited, like in `Watch`, but unlike `Watch`, expressions cannot be edited or added to the table." } { Registers "registers" "Registers" Null Binoculars 0 1 0 1 1 1 1 "Nearly identical to `Watch`, but automatically filled with all register names according to the selected thread's architecture. View rules and evaluation values can be edited, like in `Watch`, but unlike `Watch`, expressions cannot be edited or added to the table." } @@ -402,6 +411,12 @@ DF_ThemePresetColorTable: //- rjf: enums +@enum DF_NameKind: +{ + @expand(DF_NameKindTable, a) `$(a.name)`, + COUNT, +} + @enum DF_GfxViewKind: { @expand(DF_GfxViewTable a) `$(a.name)`, @@ -541,6 +556,8 @@ DF_ThemePresetColorTable: `$(a.ru == "x" -> "DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_DEF(" .. a.name_lower .. ");")`; @expand(DF_GfxViewRuleTable a) `$(a.bu == "x" -> "DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(" .. a.name_lower .. ");")`; + @expand(DF_GfxViewRuleTable a) + `$(a.wu == "x" -> "DF_GFX_VIEW_RULE_WHOLE_UI_FUNCTION_DEF(" .. a.name_lower .. ");")`; } //- rjf: gfx view rule tables @@ -548,7 +565,7 @@ DF_ThemePresetColorTable: @data(DF_GfxViewRuleSpecInfo) @c_file df_g_gfx_view_rule_spec_info_table: { @expand(DF_GfxViewRuleTable a) - ```{ str8_lit_comp("$(a.string)"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*$(a.vr == "x"))|(DF_GfxViewRuleSpecInfoFlag_LineStringize*$(a.ls == "x"))|(DF_GfxViewRuleSpecInfoFlag_RowUI*$(a.ru == "x"))|(DF_GfxViewRuleSpecInfoFlag_BlockUI*$(a.bu == "x")), $(a.vr == "x" -> "DF_GFX_VIEW_RULE_VIZ_ROW_PROD_FUNCTION_NAME("..a.name_lower..")") $(a.vr != "x" -> 0), $(a.ls == "x" -> "DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_NAME("..a.name_lower..")") $(a.ls != "x" -> 0), $(a.ru == "x" -> "DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_NAME("..a.name_lower..")") $(a.ru != "x" -> 0), $(a.bu == "x" -> "DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_NAME("..a.name_lower..")") $(a.bu != "x" -> 0), }```; + ```{ str8_lit_comp("$(a.string)"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*$(a.vr == "x"))|(DF_GfxViewRuleSpecInfoFlag_LineStringize*$(a.ls == "x"))|(DF_GfxViewRuleSpecInfoFlag_RowUI*$(a.ru == "x"))|(DF_GfxViewRuleSpecInfoFlag_BlockUI*$(a.bu == "x")), $(a.vr == "x" -> "DF_GFX_VIEW_RULE_VIZ_ROW_PROD_FUNCTION_NAME("..a.name_lower..")") $(a.vr != "x" -> 0), $(a.ls == "x" -> "DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_NAME("..a.name_lower..")") $(a.ls != "x" -> 0), $(a.ru == "x" -> "DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_NAME("..a.name_lower..")") $(a.ru != "x" -> 0), $(a.bu == "x" -> "DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_NAME("..a.name_lower..")") $(a.bu != "x" -> 0), $(a.wu == "x" -> "DF_GFX_VIEW_RULE_WHOLE_UI_FUNCTION_NAME("..a.name_lower..")") $(a.wu != "x" -> 0) }```; } //- rjf: default view spec info table diff --git a/src/df/gfx/df_view_rule_hooks.c b/src/df/gfx/df_view_rule_hooks.c index 7e8e5252..898af62f 100644 --- a/src/df/gfx/df_view_rule_hooks.c +++ b/src/df/gfx/df_view_rule_hooks.c @@ -692,72 +692,89 @@ DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(text) Temp scratch = scratch_begin(0, 0); HS_Scope *hs_scope = hs_scope_open(); TXT_Scope *txt_scope = txt_scope_open(); + + ////////////////////////////// + //- rjf: get & initialize state + // DF_ViewRuleHooks_TextState *state = df_view_rule_block_user_state(key, DF_ViewRuleHooks_TextState); if(!state->initialized) { state->initialized = 1; state->cursor = state->mark = txt_pt(1, 1); } - if(state->last_open_frame_idx+1 < df_frame_index()) + + ////////////////////////////// + //- rjf: unpack evaluation / view rule params + // + DF_Entity *thread = df_entity_from_handle(ctrl_ctx->thread); + DF_Entity *process = df_entity_ancestor_from_kind(thread, DF_EntityKind_Process); + DF_TxtTopologyInfo top = df_view_rule_hooks__txt_topology_info_from_cfg(dbgi_scope, ctrl_ctx, parse_ctx, macro_map, cfg); + DF_Eval value_eval = df_value_mode_eval_from_eval(parse_ctx->type_graph, parse_ctx->rdi, ctrl_ctx, eval); + U64 base_vaddr = value_eval.imm_u64 ? value_eval.imm_u64 : value_eval.offset; + Rng1U64 vaddr_range = r1u64(base_vaddr, base_vaddr + (top.size_cap ? top.size_cap : 2048)); + + ////////////////////////////// + //- rjf: evaluation info -> text visualization info + // + String8 data = {0}; + TXT_TextInfo info = {0}; + TXT_LineTokensSlice line_tokens_slice = {0}; { - state->loaded_t = 0; + U128 text_hash = {0}; + U128 text_key = ctrl_hash_store_key_from_process_vaddr_range(process->ctrl_machine_id, process->ctrl_handle, vaddr_range, 1); + info = txt_text_info_from_key_lang(txt_scope, text_key, top.lang, &text_hash); + data = hs_data_from_hash(hs_scope, text_hash); + line_tokens_slice = txt_line_tokens_slice_from_info_data_line_range(scratch.arena, &info, data, r1s64(1, info.lines_count)); } - state->last_open_frame_idx = df_frame_index(); + + ////////////////////////////// + //- rjf: info -> code slice info + // + DF_CodeSliceParams code_slice_params = {0}; { - //- rjf: unpack params - DF_TxtTopologyInfo top = df_view_rule_hooks__txt_topology_info_from_cfg(dbgi_scope, ctrl_ctx, parse_ctx, macro_map, cfg); - - //- rjf: resolve to address value & range - DF_Eval value_eval = df_value_mode_eval_from_eval(parse_ctx->type_graph, parse_ctx->rdi, ctrl_ctx, eval); - U64 base_vaddr = value_eval.imm_u64 ? value_eval.imm_u64 : value_eval.offset; - Rng1U64 vaddr_range = r1u64(base_vaddr, base_vaddr + (top.size_cap ? top.size_cap : 2048)); - - //- rjf: unpack thread/process of eval - DF_Entity *thread = df_entity_from_handle(ctrl_ctx->thread); - DF_Entity *process = df_entity_ancestor_from_kind(thread, DF_EntityKind_Process); - - //- rjf: unpack key for this region in memory - U128 text_key = ctrl_hash_store_key_from_process_vaddr_range(process->ctrl_machine_id, process->ctrl_handle, vaddr_range, 1); - - //- rjf: key -> parsed text info - U128 text_hash = {0}; - TXT_TextInfo info = txt_text_info_from_key_lang(txt_scope, text_key, top.lang, &text_hash); - String8 data = hs_data_from_hash(hs_scope, text_hash); - TXT_LineTokensSlice line_tokens_slice = txt_line_tokens_slice_from_info_data_line_range(scratch.arena, &info, data, r1s64(1, info.lines_count)); - - //- rjf: info -> code slice info - DF_CodeSliceParams code_slice_params = {0}; + code_slice_params.flags = DF_CodeSliceFlag_LineNums; + code_slice_params.line_num_range = r1s64(1, info.lines_count); + code_slice_params.line_text = push_array(scratch.arena, String8, info.lines_count); + code_slice_params.line_ranges = push_array(scratch.arena, Rng1U64, info.lines_count); + code_slice_params.line_tokens = push_array(scratch.arena, TXT_TokenArray, info.lines_count); + code_slice_params.line_bps = push_array(scratch.arena, DF_EntityList, info.lines_count); + code_slice_params.line_ips = push_array(scratch.arena, DF_EntityList, info.lines_count); + code_slice_params.line_pins = push_array(scratch.arena, DF_EntityList, info.lines_count); + code_slice_params.line_dasm2src = push_array(scratch.arena, DF_TextLineDasm2SrcInfoList, info.lines_count); + code_slice_params.line_src2dasm = push_array(scratch.arena, DF_TextLineSrc2DasmInfoList, info.lines_count); + for(U64 line_idx = 0; line_idx < info.lines_count; line_idx += 1) { - code_slice_params.flags = DF_CodeSliceFlag_LineNums; - code_slice_params.line_num_range = r1s64(1, info.lines_count); - code_slice_params.line_text = push_array(scratch.arena, String8, info.lines_count); - code_slice_params.line_ranges = push_array(scratch.arena, Rng1U64, info.lines_count); - code_slice_params.line_tokens = push_array(scratch.arena, TXT_TokenArray, info.lines_count); - code_slice_params.line_bps = push_array(scratch.arena, DF_EntityList, info.lines_count); - code_slice_params.line_ips = push_array(scratch.arena, DF_EntityList, info.lines_count); - code_slice_params.line_pins = push_array(scratch.arena, DF_EntityList, info.lines_count); - code_slice_params.line_dasm2src = push_array(scratch.arena, DF_TextLineDasm2SrcInfoList, info.lines_count); - code_slice_params.line_src2dasm = push_array(scratch.arena, DF_TextLineSrc2DasmInfoList, info.lines_count); - for(U64 line_idx = 0; line_idx < info.lines_count; line_idx += 1) - { - code_slice_params.line_text[line_idx] = str8_substr(data, info.lines_ranges[line_idx]); - code_slice_params.line_ranges[line_idx] = info.lines_ranges[line_idx]; - code_slice_params.line_tokens[line_idx] = line_tokens_slice.line_tokens[line_idx]; - } - code_slice_params.font = df_font_from_slot(DF_FontSlot_Code); - code_slice_params.font_size = ui_top_font_size(); - code_slice_params.line_height_px = ui_top_font_size()*1.5f; - code_slice_params.margin_width_px = 0; - code_slice_params.line_num_width_px = ui_top_font_size()*5.f; - code_slice_params.line_text_max_width_px = ui_top_font_size()*2.f*info.lines_max_size; + code_slice_params.line_text[line_idx] = str8_substr(data, info.lines_ranges[line_idx]); + code_slice_params.line_ranges[line_idx] = info.lines_ranges[line_idx]; + code_slice_params.line_tokens[line_idx] = line_tokens_slice.line_tokens[line_idx]; + } + code_slice_params.font = df_font_from_slot(DF_FontSlot_Code); + code_slice_params.font_size = ui_top_font_size(); + code_slice_params.line_height_px = ui_top_font_size()*1.5f; + code_slice_params.margin_width_px = 0; + code_slice_params.line_num_width_px = ui_top_font_size()*5.f; + code_slice_params.line_text_max_width_px = ui_top_font_size()*2.f*info.lines_max_size; + } + + ////////////////////////////// + //- rjf: build UI + // + if(info.lines_count != 0) + { + //- rjf: build top-level container + UI_Box *container = &ui_g_nil_box; + UI_PrefWidth(ui_px(dim.x, 1.f)) UI_PrefHeight(ui_px(dim.y, 1.f)) + { + container = ui_build_box_from_stringf(UI_BoxFlag_AllowOverflow|UI_BoxFlag_Clip, "###text_container"); } //- rjf: build code slice - if(info.lines_count != 0) UI_Padding(ui_pct(1, 0)) UI_PrefWidth(ui_px(info.lines_max_size*ui_top_font_size()*1.2f, 1.f)) UI_Column UI_Padding(ui_pct(1, 0)) + UI_WidthFill UI_HeightFill UI_Parent(container) { - DF_CodeSliceSignal sig = df_code_slice(ws, ctrl_ctx, parse_ctx, &code_slice_params, &state->cursor, &state->mark, &state->preferred_column, str8_lit("###code_slice")); + DF_CodeSliceSignal slice_sig = df_code_slice(ws, ctrl_ctx, parse_ctx, &code_slice_params, &state->cursor, &state->mark, &state->preferred_column, str8_lit("###slice")); } } + txt_scope_close(txt_scope); hs_scope_close(hs_scope); scratch_end(scratch); @@ -1002,10 +1019,11 @@ DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(bitmap) F32 rate = 1 - pow_f32(2, (-15.f * df_dt())); if(expected_size != 0) { + F32 img_dim = dim.y - ui_top_font_size()*2.f; UI_Padding(ui_pct(1.f, 0.f)) - UI_PrefWidth(ui_px(dim.y*((F32)topology_info.width/(F32)topology_info.height), 1.f)) + UI_PrefWidth(ui_px(img_dim*((F32)topology_info.width/(F32)topology_info.height), 1.f)) UI_Column UI_Padding(ui_pct(1.f, 0.f)) - UI_PrefHeight(ui_px(dim.y, 1.f)) + UI_PrefHeight(ui_px(img_dim, 1.f)) { ui_set_next_hover_cursor(OS_Cursor_HandPoint); UI_Box *box = ui_build_box_from_stringf(UI_BoxFlag_DrawBorder|UI_BoxFlag_DrawBackground|UI_BoxFlag_Clickable|UI_BoxFlag_DrawHotEffects, "image_box"); @@ -1114,6 +1132,11 @@ DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(bitmap) scratch_end(scratch); } +DF_GFX_VIEW_RULE_WHOLE_UI_FUNCTION_DEF(bitmap) +{ + +} + //////////////////////////////// //~ rjf: "geo" diff --git a/src/df/gfx/df_views.c b/src/df/gfx/df_views.c index d48213ed..d963cc39 100644 --- a/src/df/gfx/df_views.c +++ b/src/df/gfx/df_views.c @@ -1052,7 +1052,7 @@ df_eval_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_EvalW UI_Parent(canvas_box) UI_WidthFill UI_HeightFill { 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 - scroll_list_params.row_height_px); + (row->skipped_size_in_rows+row->size_in_rows+row->chopped_size_in_rows)*scroll_list_params.row_height_px); row->expand_ui_rule_spec->info.block_ui(ws, row->key, row->eval, scope, &ctrl_ctx, &parse_ctx, ¯o_map, row->expand_ui_rule_node, canvas_dim); } } @@ -1064,6 +1064,13 @@ df_eval_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_EvalW next_cursor_tbl = v2s64(DF_EvalWatchViewColumnKind_Expr, (semantic_idx+1)); pressed = 1; } + if(ui_double_clicked(sig)) + { + DF_CmdParams p = df_cmd_params_from_view(ws, panel, view); + p.view_spec = df_view_spec_from_gfx_view_kind(DF_GfxViewKind_EvalViewer); + df_cmd_params_mark_slot(&p, DF_CmdParamSlot_ViewSpec); + df_push_cmd__root(&p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_OpenTab)); + } } //- rjf: build normal row @@ -5007,7 +5014,7 @@ DF_VIEW_UI_FUNCTION_DEF(Code) if(text_info_is_ready) { // rjf: fill basics - code_slice_params.flags = DF_CodeSliceFlag_Margin|DF_CodeSliceFlag_LineNums; + code_slice_params.flags = DF_CodeSliceFlag_Margin|DF_CodeSliceFlag_LineNums|DF_CodeSliceFlag_Clickable; code_slice_params.line_num_range = visible_line_num_range; code_slice_params.line_text = push_array(scratch.arena, String8, visible_line_count); code_slice_params.line_ranges = push_array(scratch.arena, Rng1U64, visible_line_count); @@ -6068,7 +6075,7 @@ DF_VIEW_UI_FUNCTION_DEF(Disassembly) if(has_disasm) { // rjf: fill basics - code_slice_params.flags = DF_CodeSliceFlag_Margin|DF_CodeSliceFlag_LineNums; + code_slice_params.flags = DF_CodeSliceFlag_Margin|DF_CodeSliceFlag_LineNums|DF_CodeSliceFlag_Clickable; code_slice_params.line_num_range = visible_line_num_range; code_slice_params.line_text = push_array(scratch.arena, String8, visible_line_count); code_slice_params.line_ranges = push_array(scratch.arena, Rng1U64, visible_line_count); @@ -6531,6 +6538,16 @@ DF_VIEW_UI_FUNCTION_DEF(Disassembly) ProfEnd(); } +//////////////////////////////// +//~ rjf: EvalViewer @view_hook_impl + +DF_VIEW_SETUP_FUNCTION_DEF(EvalViewer) {} +DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(EvalViewer) { return str8_lit(""); } +DF_VIEW_CMD_FUNCTION_DEF(EvalViewer) {} +DF_VIEW_UI_FUNCTION_DEF(EvalViewer) +{ +} + //////////////////////////////// //~ rjf: Watch @view_hook_impl @@ -6903,7 +6920,7 @@ DF_VIEW_UI_FUNCTION_DEF(Output) if(txti_buffer_is_ready) { // rjf: fill basics - code_slice_params.flags = DF_CodeSliceFlag_LineNums; + code_slice_params.flags = DF_CodeSliceFlag_LineNums|DF_CodeSliceFlag_Clickable; code_slice_params.line_num_range = visible_line_num_range; code_slice_params.line_text = slice.line_text; code_slice_params.line_ranges = slice.line_ranges; diff --git a/src/df/gfx/generated/df_gfx.meta.c b/src/df/gfx/generated/df_gfx.meta.c index dde6d4cf..287fc4c8 100644 --- a/src/df/gfx/generated/df_gfx.meta.c +++ b/src/df/gfx/generated/df_gfx.meta.c @@ -715,23 +715,23 @@ str8_lit_comp("open_profile"), DF_GfxViewRuleSpecInfo df_g_gfx_view_rule_spec_info_table[14] = { -{ str8_lit_comp("array"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*0)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*0), 0, 0, 0, 0, }, -{ str8_lit_comp("list"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*1)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*0)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*0), DF_GFX_VIEW_RULE_VIZ_ROW_PROD_FUNCTION_NAME(list) , 0, 0, 0, }, -{ str8_lit_comp("dec"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*1)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*0), 0, DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_NAME(dec) , 0, 0, }, -{ str8_lit_comp("bin"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*1)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*0), 0, DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_NAME(bin) , 0, 0, }, -{ str8_lit_comp("oct"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*1)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*0), 0, DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_NAME(oct) , 0, 0, }, -{ str8_lit_comp("hex"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*1)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*0), 0, DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_NAME(hex) , 0, 0, }, -{ str8_lit_comp("only"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*1)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*1)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*0), DF_GFX_VIEW_RULE_VIZ_ROW_PROD_FUNCTION_NAME(only) , DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_NAME(only) , 0, 0, }, -{ str8_lit_comp("omit"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*1)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*1)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*0), DF_GFX_VIEW_RULE_VIZ_ROW_PROD_FUNCTION_NAME(omit) , DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_NAME(omit) , 0, 0, }, -{ str8_lit_comp("no_addr"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*1)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*0), 0, DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_NAME(no_addr) , 0, 0, }, -{ str8_lit_comp("rgba"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*0)|(DF_GfxViewRuleSpecInfoFlag_RowUI*1)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*1), 0, 0, DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_NAME(rgba) , DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_NAME(rgba) , }, -{ str8_lit_comp("text"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*0)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*1), 0, 0, 0, DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_NAME(text) , }, -{ str8_lit_comp("disasm"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*0)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*1), 0, 0, 0, DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_NAME(disasm) , }, -{ str8_lit_comp("bitmap"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*0)|(DF_GfxViewRuleSpecInfoFlag_RowUI*1)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*1), 0, 0, DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_NAME(bitmap) , DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_NAME(bitmap) , }, -{ str8_lit_comp("geo"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*0)|(DF_GfxViewRuleSpecInfoFlag_RowUI*1)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*1), 0, 0, DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_NAME(geo) , DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_NAME(geo) , }, +{ str8_lit_comp("array"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*0)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*0), 0, 0, 0, 0, 0 }, +{ str8_lit_comp("list"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*1)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*0)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*0), DF_GFX_VIEW_RULE_VIZ_ROW_PROD_FUNCTION_NAME(list) , 0, 0, 0, 0 }, +{ str8_lit_comp("dec"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*1)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*0), 0, DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_NAME(dec) , 0, 0, 0 }, +{ str8_lit_comp("bin"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*1)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*0), 0, DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_NAME(bin) , 0, 0, 0 }, +{ str8_lit_comp("oct"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*1)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*0), 0, DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_NAME(oct) , 0, 0, 0 }, +{ str8_lit_comp("hex"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*1)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*0), 0, DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_NAME(hex) , 0, 0, 0 }, +{ str8_lit_comp("only"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*1)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*1)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*0), DF_GFX_VIEW_RULE_VIZ_ROW_PROD_FUNCTION_NAME(only) , DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_NAME(only) , 0, 0, 0 }, +{ str8_lit_comp("omit"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*1)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*1)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*0), DF_GFX_VIEW_RULE_VIZ_ROW_PROD_FUNCTION_NAME(omit) , DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_NAME(omit) , 0, 0, 0 }, +{ str8_lit_comp("no_addr"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*1)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*0), 0, DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_NAME(no_addr) , 0, 0, 0 }, +{ str8_lit_comp("rgba"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*0)|(DF_GfxViewRuleSpecInfoFlag_RowUI*1)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*1), 0, 0, DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_NAME(rgba) , DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_NAME(rgba) , 0 }, +{ str8_lit_comp("text"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*0)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*1), 0, 0, 0, DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_NAME(text) , 0 }, +{ str8_lit_comp("disasm"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*0)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*1), 0, 0, 0, DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_NAME(disasm) , 0 }, +{ str8_lit_comp("bitmap"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*0)|(DF_GfxViewRuleSpecInfoFlag_RowUI*1)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*1), 0, 0, DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_NAME(bitmap) , DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_NAME(bitmap) , DF_GFX_VIEW_RULE_WHOLE_UI_FUNCTION_NAME(bitmap) }, +{ str8_lit_comp("geo"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*0)|(DF_GfxViewRuleSpecInfoFlag_RowUI*1)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*1), 0, 0, DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_NAME(geo) , DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_NAME(geo) , 0 }, }; -DF_ViewSpecInfo df_g_gfx_view_kind_spec_info_table[29] = +DF_ViewSpecInfo df_g_gfx_view_kind_spec_info_table[30] = { {(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|0*DF_ViewSpecFlag_CanFilter|0*DF_ViewSpecFlag_FilterIsCode|0*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("null"), str8_lit_comp(""), DF_NameKind_Null, DF_IconKind_Null, DF_VIEW_SETUP_FUNCTION_NAME(Null), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(Null), DF_VIEW_CMD_FUNCTION_NAME(Null), DF_VIEW_UI_FUNCTION_NAME(Null)}, {(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|0*DF_ViewSpecFlag_CanFilter|0*DF_ViewSpecFlag_FilterIsCode|0*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("empty"), str8_lit_comp(""), DF_NameKind_Null, DF_IconKind_Null, DF_VIEW_SETUP_FUNCTION_NAME(Empty), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(Empty), DF_VIEW_CMD_FUNCTION_NAME(Empty), DF_VIEW_UI_FUNCTION_NAME(Empty)}, @@ -749,6 +749,7 @@ DF_ViewSpecInfo df_g_gfx_view_kind_spec_info_table[29] = {(0|1*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|0*DF_ViewSpecFlag_CanFilter|0*DF_ViewSpecFlag_FilterIsCode|0*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("pending_entity"), str8_lit_comp("Pending Entity"), DF_NameKind_EntityName, DF_IconKind_FileOutline, DF_VIEW_SETUP_FUNCTION_NAME(PendingEntity), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(PendingEntity), DF_VIEW_CMD_FUNCTION_NAME(PendingEntity), DF_VIEW_UI_FUNCTION_NAME(PendingEntity)}, {(0|1*DF_ViewSpecFlag_ParameterizedByEntity|1*DF_ViewSpecFlag_CanSerialize|1*DF_ViewSpecFlag_CanSerializeEntityPath|0*DF_ViewSpecFlag_CanFilter|0*DF_ViewSpecFlag_FilterIsCode|0*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("code"), str8_lit_comp("Code"), DF_NameKind_EntityName, DF_IconKind_FileOutline, DF_VIEW_SETUP_FUNCTION_NAME(Code), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(Code), DF_VIEW_CMD_FUNCTION_NAME(Code), DF_VIEW_UI_FUNCTION_NAME(Code)}, {(0|0*DF_ViewSpecFlag_ParameterizedByEntity|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|0*DF_ViewSpecFlag_CanFilter|0*DF_ViewSpecFlag_FilterIsCode|0*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("disassembly"), str8_lit_comp("Disassembly"), DF_NameKind_Null, DF_IconKind_Glasses, DF_VIEW_SETUP_FUNCTION_NAME(Disassembly), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(Disassembly), DF_VIEW_CMD_FUNCTION_NAME(Disassembly), DF_VIEW_UI_FUNCTION_NAME(Disassembly)}, +{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|0*DF_ViewSpecFlag_CanFilter|0*DF_ViewSpecFlag_FilterIsCode|0*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("eval_viewer"), str8_lit_comp("Evaluation Viewer"), DF_NameKind_Null, DF_IconKind_Binoculars, DF_VIEW_SETUP_FUNCTION_NAME(EvalViewer), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(EvalViewer), DF_VIEW_CMD_FUNCTION_NAME(EvalViewer), DF_VIEW_UI_FUNCTION_NAME(EvalViewer)}, {(0|0*DF_ViewSpecFlag_ParameterizedByEntity|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|1*DF_ViewSpecFlag_CanFilter|1*DF_ViewSpecFlag_FilterIsCode|1*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("watch"), str8_lit_comp("Watch"), DF_NameKind_Null, DF_IconKind_Binoculars, DF_VIEW_SETUP_FUNCTION_NAME(Watch), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(Watch), DF_VIEW_CMD_FUNCTION_NAME(Watch), DF_VIEW_UI_FUNCTION_NAME(Watch)}, {(0|0*DF_ViewSpecFlag_ParameterizedByEntity|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|1*DF_ViewSpecFlag_CanFilter|1*DF_ViewSpecFlag_FilterIsCode|1*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("locals"), str8_lit_comp("Locals"), DF_NameKind_Null, DF_IconKind_Binoculars, DF_VIEW_SETUP_FUNCTION_NAME(Locals), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(Locals), DF_VIEW_CMD_FUNCTION_NAME(Locals), DF_VIEW_UI_FUNCTION_NAME(Locals)}, {(0|0*DF_ViewSpecFlag_ParameterizedByEntity|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|1*DF_ViewSpecFlag_CanFilter|1*DF_ViewSpecFlag_FilterIsCode|1*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("registers"), str8_lit_comp("Registers"), DF_NameKind_Null, DF_IconKind_Binoculars, DF_VIEW_SETUP_FUNCTION_NAME(Registers), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(Registers), DF_VIEW_CMD_FUNCTION_NAME(Registers), DF_VIEW_UI_FUNCTION_NAME(Registers)}, diff --git a/src/df/gfx/generated/df_gfx.meta.h b/src/df/gfx/generated/df_gfx.meta.h index 595f1ecd..f9efdf56 100644 --- a/src/df/gfx/generated/df_gfx.meta.h +++ b/src/df/gfx/generated/df_gfx.meta.h @@ -6,6 +6,14 @@ #ifndef DF_GFX_META_H #define DF_GFX_META_H +typedef enum DF_NameKind +{ +DF_NameKind_Null, +DF_NameKind_EntityName, +DF_NameKind_EntityKindName, +DF_NameKind_COUNT, +} DF_NameKind; + typedef enum DF_GfxViewKind { DF_GfxViewKind_Null, @@ -24,6 +32,7 @@ DF_GfxViewKind_Modules, DF_GfxViewKind_PendingEntity, DF_GfxViewKind_Code, DF_GfxViewKind_Disassembly, +DF_GfxViewKind_EvalViewer, DF_GfxViewKind_Watch, DF_GfxViewKind_Locals, DF_GfxViewKind_Registers, @@ -129,6 +138,7 @@ DF_VIEW_SETUP_FUNCTION_DEF(Modules); DF_VIEW_SETUP_FUNCTION_DEF(PendingEntity); DF_VIEW_SETUP_FUNCTION_DEF(Code); DF_VIEW_SETUP_FUNCTION_DEF(Disassembly); +DF_VIEW_SETUP_FUNCTION_DEF(EvalViewer); DF_VIEW_SETUP_FUNCTION_DEF(Watch); DF_VIEW_SETUP_FUNCTION_DEF(Locals); DF_VIEW_SETUP_FUNCTION_DEF(Registers); @@ -158,6 +168,7 @@ DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(Modules); DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(PendingEntity); DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(Code); DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(Disassembly); +DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(EvalViewer); DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(Watch); DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(Locals); DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(Registers); @@ -187,6 +198,7 @@ DF_VIEW_CMD_FUNCTION_DEF(Modules); DF_VIEW_CMD_FUNCTION_DEF(PendingEntity); DF_VIEW_CMD_FUNCTION_DEF(Code); DF_VIEW_CMD_FUNCTION_DEF(Disassembly); +DF_VIEW_CMD_FUNCTION_DEF(EvalViewer); DF_VIEW_CMD_FUNCTION_DEF(Watch); DF_VIEW_CMD_FUNCTION_DEF(Locals); DF_VIEW_CMD_FUNCTION_DEF(Registers); @@ -216,6 +228,7 @@ DF_VIEW_UI_FUNCTION_DEF(Modules); DF_VIEW_UI_FUNCTION_DEF(PendingEntity); DF_VIEW_UI_FUNCTION_DEF(Code); DF_VIEW_UI_FUNCTION_DEF(Disassembly); +DF_VIEW_UI_FUNCTION_DEF(EvalViewer); DF_VIEW_UI_FUNCTION_DEF(Watch); DF_VIEW_UI_FUNCTION_DEF(Locals); DF_VIEW_UI_FUNCTION_DEF(Registers); @@ -248,6 +261,7 @@ DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(text); DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(disasm); DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(bitmap); DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(geo); +DF_GFX_VIEW_RULE_WHOLE_UI_FUNCTION_DEF(bitmap); C_LINKAGE_BEGIN extern String8 df_g_theme_preset_display_string_table[9]; extern String8 df_g_theme_preset_code_string_table[9]; @@ -267,7 +281,7 @@ extern String8 df_g_cmd_param_slot_2_view_spec_cmd_map[7]; extern DF_StringBindingPair df_g_default_binding_table[97]; extern String8 df_g_binding_version_remap_old_name_table[3]; extern String8 df_g_binding_version_remap_new_name_table[3]; -extern DF_ViewSpecInfo df_g_gfx_view_kind_spec_info_table[29]; +extern DF_ViewSpecInfo df_g_gfx_view_kind_spec_info_table[30]; extern String8 df_g_theme_color_display_string_table[54]; extern String8 df_g_theme_color_cfg_string_table[54]; read_only global U8 df_g_icon_font_bytes__data[] =