Skip to content

Commit

Permalink
sketch out parts of 'whole ui' eval viz pipeline build stage; fix cop…
Browse files Browse the repository at this point in the history
…ypaste issue with string viz
  • Loading branch information
ryanfleury committed Mar 29, 2024
1 parent c1b92c1 commit 81c79c0
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 17 deletions.
7 changes: 7 additions & 0 deletions src/df/core/df_core.mdesk
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,13 @@ DF_CoreCmdTable:// | | |
// rows, this stage offers the ability to build a ui
// stretching over all of the rows.
//
// whole ui build, "wu" -> sometimes, more sophisticated interfaces need to be
// provided for a view rule, that stretch beyond the
// limits of what could be offered inside a watch
// window block. in such cases, the eval/view-rule
// combo will be granted its own tab for example, and
// this stage is used to fill such a ui.
//
// A few other bits are included for various ways in which a view rule may be
// applied throughout the eval visualization pipeline. A list follows:
//
Expand Down
4 changes: 2 additions & 2 deletions src/df/gfx/df_gfx.c
Original file line number Diff line number Diff line change
Expand Up @@ -6878,8 +6878,8 @@ df_single_line_eval_value_strings_from_eval(Arena *arena, DF_EvalVizStringFlags
if(!has_array && direct_type_is_string && (flags & DF_EvalVizStringFlag_ReadOnlyDisplayRules) && eval.mode == EVAL_EvalMode_Addr)
{
U64 string_memory_addr = value_eval.imm_u64;
U64 element_size = tg_byte_size_from_graph_rdi_key(graph, rdi, eval.type_key);
CTRL_ProcessMemorySlice text_slice = ctrl_query_cached_zero_terminated_data_from_process_vaddr_limit(arena, process->ctrl_machine_id, process->ctrl_handle, eval.offset, 256, element_size, 0);
U64 element_size = tg_byte_size_from_graph_rdi_key(graph, rdi, direct_type_key);
CTRL_ProcessMemorySlice text_slice = ctrl_query_cached_zero_terminated_data_from_process_vaddr_limit(arena, process->ctrl_machine_id, process->ctrl_handle, string_memory_addr, 256, element_size, 0);
String8 raw_text = {0};
switch(element_size)
{
Expand Down
7 changes: 7 additions & 0 deletions src/df/gfx/df_gfx.h
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ enum
DF_GfxViewRuleSpecInfoFlag_LineStringize = (1<<1),
DF_GfxViewRuleSpecInfoFlag_RowUI = (1<<2),
DF_GfxViewRuleSpecInfoFlag_BlockUI = (1<<3),
DF_GfxViewRuleSpecInfoFlag_WholeUI = (1<<4),
};

#define DF_GFX_VIEW_RULE_VIZ_ROW_PROD_FUNCTION_SIG(name) void name(void)
Expand All @@ -299,10 +300,15 @@ enum
#define DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_NAME(name) df_gfx_view_rule_block_ui__##name
#define DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(name) DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_SIG(DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_NAME(name))

#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))

typedef DF_GFX_VIEW_RULE_VIZ_ROW_PROD_FUNCTION_SIG(DF_GfxViewRuleVizRowProdHookFunctionType);
typedef DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_SIG(DF_GfxViewRuleLineStringizeHookFunctionType);
typedef DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_SIG(DF_GfxViewRuleRowUIFunctionType);
typedef DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_SIG(DF_GfxViewRuleBlockUIFunctionType);
typedef DF_GFX_VIEW_RULE_WHOLE_UI_FUNCTION_SIG(DF_GfxViewRuleWholeUIFunctionType);

typedef struct DF_GfxViewRuleSpecInfo DF_GfxViewRuleSpecInfo;
struct DF_GfxViewRuleSpecInfo
Expand All @@ -313,6 +319,7 @@ struct DF_GfxViewRuleSpecInfo
DF_GfxViewRuleLineStringizeHookFunctionType *line_stringize;
DF_GfxViewRuleRowUIFunctionType *row_ui;
DF_GfxViewRuleBlockUIFunctionType *block_ui;
DF_GfxViewRuleWholeUIFunctionType *whole_ui;
};

typedef struct DF_GfxViewRuleSpecInfoArray DF_GfxViewRuleSpecInfoArray;
Expand Down
30 changes: 15 additions & 15 deletions src/df/gfx/df_gfx.mdesk
Original file line number Diff line number Diff line change
Expand Up @@ -231,23 +231,23 @@ DF_CmdParamSlot2ViewSpecMap:
//
// NOTE(rjf): see @view_rule_info

@table(string vr ls ru bu)
@table(string vr ls ru bu wu)
DF_GfxViewRuleTable:
{
{"array" - - - -}
{"list" x - - -}
{"dec" - x - -}
{"bin" - x - -}
{"oct" - x - -}
{"hex" - x - -}
{"only" x x - -}
{"omit" x x - -}
{"no_addr" - x - -}
{"rgba" - - x x}
{"text" - - - x}
{"disasm" - - - x}
{"bitmap" - - x x}
{"geo" - - x x}
{"array" - - - - - }
{"list" x - - - - }
{"dec" - x - - - }
{"bin" - x - - - }
{"oct" - x - - - }
{"hex" - x - - - }
{"only" x x - - - }
{"omit" x x - - - }
{"no_addr" - x - - - }
{"rgba" - - x x - }
{"text" - - - x - }
{"disasm" - - - x - }
{"bitmap" - - x x x }
{"geo" - - x x - }
}

////////////////////////////////
Expand Down

0 comments on commit 81c79c0

Please sign in to comment.