diff --git a/src/df/core/df_core.mdesk b/src/df/core/df_core.mdesk index 9e74d323..4f468cc3 100644 --- a/src/df/core/df_core.mdesk +++ b/src/df/core/df_core.mdesk @@ -504,6 +504,7 @@ DF_CoreViewRuleTable: {RGBA rgba "rgba" - x - x "Color (RGBA)" x "Displays as a color, interpreting the data as encoding R, G, B, and A values." } {Text text "text" - x - x "Text" x "Displays as text." } {Disasm disasm "disasm" - x - x "Disassembly" x "Displays as disassembled instructions, interpreting the data as raw machine code." } + {Graph graph "graph" - x - x "Graph" x "Displays as a pointer graph, visualizing nodes and edges formed by pointers directly." } {Bitmap bitmap "bitmap" - x - x "Bitmap" x "Displays as a bitmap, interpreting the data as raw pixel data." } {Geo geo "geo" - x - x "Geometry" x "Displays as geometry, interpreting the data as vertex data." } } diff --git a/src/df/core/generated/df_core.meta.c b/src/df/core/generated/df_core.meta.c index 104282c8..a0fc19d5 100644 --- a/src/df/core/generated/df_core.meta.c +++ b/src/df/core/generated/df_core.meta.c @@ -428,7 +428,7 @@ DF_CmdSpecInfo df_g_core_cmd_kind_spec_info_table[209] = { str8_lit_comp("toggle_dev_menu"), str8_lit_comp("Opens and closes the developer menu."), str8_lit_comp(""), str8_lit_comp("Toggle Developer Menu"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Null}, }; -DF_CoreViewRuleSpecInfo df_g_core_view_rule_spec_info_table[16] = +DF_CoreViewRuleSpecInfo df_g_core_view_rule_spec_info_table[17] = { {str8_lit_comp(""), str8_lit_comp(""), str8_lit_comp(""), (DF_CoreViewRuleSpecInfoFlag_Inherited*0)|(DF_CoreViewRuleSpecInfoFlag_Expandable*0)|(DF_CoreViewRuleSpecInfoFlag_EvalResolution*0)|(DF_CoreViewRuleSpecInfoFlag_VizBlockProd*0), 0, 0, }, {str8_lit_comp("array"), str8_lit_comp("Array"), str8_lit_comp("Specifies that a pointer points to N elements, rather than only 1."), (DF_CoreViewRuleSpecInfoFlag_Inherited*0)|(DF_CoreViewRuleSpecInfoFlag_Expandable*0)|(DF_CoreViewRuleSpecInfoFlag_EvalResolution*1)|(DF_CoreViewRuleSpecInfoFlag_VizBlockProd*0), DF_CORE_VIEW_RULE_EVAL_RESOLUTION_FUNCTION_NAME(array) , 0, }, @@ -444,6 +444,7 @@ DF_CoreViewRuleSpecInfo df_g_core_view_rule_spec_info_table[16] = {str8_lit_comp("rgba"), str8_lit_comp("Color (RGBA)"), str8_lit_comp("Displays as a color, interpreting the data as encoding R, G, B, and A values."), (DF_CoreViewRuleSpecInfoFlag_Inherited*0)|(DF_CoreViewRuleSpecInfoFlag_Expandable*1)|(DF_CoreViewRuleSpecInfoFlag_EvalResolution*0)|(DF_CoreViewRuleSpecInfoFlag_VizBlockProd*1), 0, DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_NAME(rgba) , }, {str8_lit_comp("text"), str8_lit_comp("Text"), str8_lit_comp("Displays as text."), (DF_CoreViewRuleSpecInfoFlag_Inherited*0)|(DF_CoreViewRuleSpecInfoFlag_Expandable*1)|(DF_CoreViewRuleSpecInfoFlag_EvalResolution*0)|(DF_CoreViewRuleSpecInfoFlag_VizBlockProd*1), 0, DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_NAME(text) , }, {str8_lit_comp("disasm"), str8_lit_comp("Disassembly"), str8_lit_comp("Displays as disassembled instructions, interpreting the data as raw machine code."), (DF_CoreViewRuleSpecInfoFlag_Inherited*0)|(DF_CoreViewRuleSpecInfoFlag_Expandable*1)|(DF_CoreViewRuleSpecInfoFlag_EvalResolution*0)|(DF_CoreViewRuleSpecInfoFlag_VizBlockProd*1), 0, DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_NAME(disasm) , }, +{str8_lit_comp("graph"), str8_lit_comp("Graph"), str8_lit_comp("Displays as a pointer graph, visualizing nodes and edges formed by pointers directly."), (DF_CoreViewRuleSpecInfoFlag_Inherited*0)|(DF_CoreViewRuleSpecInfoFlag_Expandable*1)|(DF_CoreViewRuleSpecInfoFlag_EvalResolution*0)|(DF_CoreViewRuleSpecInfoFlag_VizBlockProd*1), 0, DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_NAME(graph) , }, {str8_lit_comp("bitmap"), str8_lit_comp("Bitmap"), str8_lit_comp("Displays as a bitmap, interpreting the data as raw pixel data."), (DF_CoreViewRuleSpecInfoFlag_Inherited*0)|(DF_CoreViewRuleSpecInfoFlag_Expandable*1)|(DF_CoreViewRuleSpecInfoFlag_EvalResolution*0)|(DF_CoreViewRuleSpecInfoFlag_VizBlockProd*1), 0, DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_NAME(bitmap) , }, {str8_lit_comp("geo"), str8_lit_comp("Geometry"), str8_lit_comp("Displays as geometry, interpreting the data as vertex data."), (DF_CoreViewRuleSpecInfoFlag_Inherited*0)|(DF_CoreViewRuleSpecInfoFlag_Expandable*1)|(DF_CoreViewRuleSpecInfoFlag_EvalResolution*0)|(DF_CoreViewRuleSpecInfoFlag_VizBlockProd*1), 0, DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_NAME(geo) , }, }; diff --git a/src/df/core/generated/df_core.meta.h b/src/df/core/generated/df_core.meta.h index dce096e6..470e4a9f 100644 --- a/src/df/core/generated/df_core.meta.h +++ b/src/df/core/generated/df_core.meta.h @@ -351,6 +351,7 @@ DF_CoreViewRuleKind_NoAddr, DF_CoreViewRuleKind_RGBA, DF_CoreViewRuleKind_Text, DF_CoreViewRuleKind_Disasm, +DF_CoreViewRuleKind_Graph, DF_CoreViewRuleKind_Bitmap, DF_CoreViewRuleKind_Geo, DF_CoreViewRuleKind_COUNT, @@ -414,6 +415,7 @@ DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_DEF(omit); DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_DEF(rgba); DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_DEF(text); DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_DEF(disasm); +DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_DEF(graph); DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_DEF(bitmap); DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_DEF(geo); diff --git a/src/df/gfx/df_gfx.c b/src/df/gfx/df_gfx.c index 9bca1876..e59611d1 100644 --- a/src/df/gfx/df_gfx.c +++ b/src/df/gfx/df_gfx.c @@ -5870,7 +5870,7 @@ df_window_update_and_render(Arena *arena, OS_EventList *events, DF_Window *ws, D ui_label(df_g_icon_kind_text_table[icon_kind]); } UI_TextColor(df_rgba_from_theme_color(view_is_selected ? DF_ThemeColor_PlainText : DF_ThemeColor_WeakText)) - UI_PrefWidth(ui_text_dim(10, 1)) + UI_PrefWidth(ui_text_dim(10, 0)) ui_label(label); if(view->query_string_size != 0) { diff --git a/src/df/gfx/df_view_rule_hooks.c b/src/df/gfx/df_view_rule_hooks.c index 991965bd..5565e160 100644 --- a/src/df/gfx/df_view_rule_hooks.c +++ b/src/df/gfx/df_view_rule_hooks.c @@ -911,6 +911,31 @@ DF_VIEW_UI_FUNCTION_DEF(disasm) { } +//////////////////////////////// +//~ rjf: "graph" + +DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_DEF(graph) +{ + DF_EvalVizBlock *vb = df_eval_viz_block_begin(arena, DF_EvalVizBlockKind_Canvas, key, df_expand_key_make(df_hash_from_expand_key(key), 1), depth); + vb->eval = eval; + vb->string = string; + vb->cfg_table = *cfg_table; + vb->visual_idx_range = r1u64(0, 8); + vb->semantic_idx_range = r1u64(0, 1); + df_eval_viz_block_end(out, vb); +} + +DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(graph) +{ +} + +DF_VIEW_SETUP_FUNCTION_DEF(graph) {} +DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(graph) { return str8_lit(""); } +DF_VIEW_CMD_FUNCTION_DEF(graph) {} +DF_VIEW_UI_FUNCTION_DEF(graph) +{ +} + //////////////////////////////// //~ rjf: "bitmap" diff --git a/src/df/gfx/df_views.c b/src/df/gfx/df_views.c index e8d59ccf..37f00d6f 100644 --- a/src/df/gfx/df_views.c +++ b/src/df/gfx/df_views.c @@ -1077,7 +1077,10 @@ df_eval_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_EvalW DF_CfgNode *cfg_root = push_array(scratch.arena, DF_CfgNode, 1); cfg_root->first = cfg_root->last = cfg; cfg_root->next = cfg_root->parent = &df_g_nil_cfg_node; - cfg->parent = cfg_root; + if(cfg != &df_g_nil_cfg_node) + { + cfg->parent = cfg_root; + } DF_CmdParams p = df_cmd_params_from_view(ws, panel, view); p.string = row->edit_expr; p.view_spec = df_tab_view_spec_from_gfx_view_rule_spec(row->expand_ui_rule_spec);