mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-06-23 12:15:00 -07:00
dead code elimination, user/project setting evaluation, work on color view ui
This commit is contained in:
@@ -26,7 +26,7 @@ D_CmdTable: // | | |
|
||||
{SetThreadIP 0 1 "" Vaddr null Nil Null 0 0 0 0 1 1 1 Null "set_thread_ip" "Set Thread IP" "Sets the specified thread's instruction pointer at the specified address." "" "" }
|
||||
|
||||
//- rjf: high-level composite target control operations
|
||||
{RunToLine 0 1 "" Null null Nil Null 0 0 0 0 0 0 0 Play "run_to_line" "Run To Line" "Runs until a particular source line is hit." "" "$text_pt," }
|
||||
{RunToLine 1 1 "" Null null Nil Null 0 0 0 0 0 0 0 Play "run_to_line" "Run To Line" "Runs until a particular source line is hit." "" "$text_pt," }
|
||||
{Run 1 1 "" Null null Nil Null 0 0 0 0 0 0 0 Play "run" "Run" "Runs all targets after starting them if they have not been started yet." "play" "" }
|
||||
{Restart 1 1 "" Null null Nil Null 0 0 0 0 0 0 0 Redo "restart" "Restart" "Kills all attached processes, then launches all active targets." "restart,retry" "" }
|
||||
{StepInto 1 1 "" Null null Nil Null 0 0 0 0 0 0 0 StepInto "step_into" "Step Into" "Steps once, possibly into function calls, for either source lines or instructions (whichever is selected)." "" "" }
|
||||
@@ -59,47 +59,6 @@ D_CmdTable: // | | |
|
||||
COUNT,
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Built-In VieNull w Rules
|
||||
|
||||
@table(coverage_check name name_lower string ih ex xp vb display_name docs schema description)
|
||||
D_ViewRuleTable:
|
||||
{
|
||||
{x Default default "default" - - - x "Default" - "" "" }
|
||||
{x Array array "array" - - x - "Array" x "x:{expr}" "Specifies that a pointer points to N elements, rather than only 1." }
|
||||
{x Slice slice "slice" - - x - "Slice" x "" "Specifies that a pointer within a struct, also containing an integer, points to the number of elements encoded by the integer." }
|
||||
{- List list "list" - - - x "List" - "x:{member}" "Specifies that some struct, union, or class forms the top of a linked list, and the member which points at the following element in the list." }
|
||||
{x ByteSwap bswap "bswap" x - x - "Byte Swap" x "" "Specifies that all integral evaluations should be byte-swapped, such that their endianness is reversed." }
|
||||
{x Cast cast "cast" - - x - "Cast" x "x:{type}" "Specifies that the expression to which the view rule is applied should be casted to the provided type." }
|
||||
{- BaseDec base_dec "dec" x - - - "Decimal Base (Base 10)" x "" "Specifies that all integral evaluations should appear in base-10 form." }
|
||||
{- BaseBin base_bin "bin" x - - - "Binary Base (Base 2)" x "" "Specifies that all integral evaluations should appear in base-2 form." }
|
||||
{- BaseOct base_oct "oct" x - - - "Octal Base (Base 8)" x "" "Specifies that all integral evaluations should appear in base-8 form." }
|
||||
{- BaseHex base_hex "hex" x - - - "Hexadecimal Base (Base 16)" x "" "Specifies that all integral evaluations should appear in base-16 form." }
|
||||
{- Only only "only" x - - x "Only Specified Members" x "x:{member}" "Specifies that only the specified members should appear in struct, union, or class evaluations." }
|
||||
{- Omit omit "omit" x - - x "Omit Specified Members" x "x:{member}" "Omits a list of member names from appearing in struct, union, or class evaluations." }
|
||||
{- NoAddr no_addr "no_addr" x - - - "Disable Address Values" x "" "Displays only what pointers point to, if possible, without the pointer's address value." }
|
||||
{x Checkbox checkbox "checkbox" - - - - "Checkbox" x "" "Displays simple integer values as checkboxes, encoding zero or nonzero values." }
|
||||
{- ColorRGBA color_rgba "color_rgba" - x - x "Color (RGBA)" x "" "Displays as a color, interpreting the data as encoding R, G, B, and A values." }
|
||||
{x Text text "text" - x - x "Text" x "x:{'lang':lang, 'size':expr}" "Displays as text." }
|
||||
{x Disasm disasm "disasm" - x - x "Disassembly" x "x:{'arch':arch, 'size':expr}" "Displays as disassembled instructions, interpreting the data as raw machine code." }
|
||||
{x Memory memory "memory" - x - x "Memory" x "x:{'size':expr}" "Displays as a raw memory grid." }
|
||||
{- Graph graph "graph" - x - x "Graph" x "" "Displays as a pointer graph, visualizing nodes and edges formed by pointers directly." }
|
||||
{x Bitmap bitmap "bitmap" - x - x "Bitmap" x "x:{'w':expr, 'h':expr, 'fmt':tex2dformat}" "Displays as a bitmap, interpreting the data as raw pixel data." }
|
||||
{- Geo3D geo3d "geo3d" - x - x "Geometry (3D)" x "x:{'count':expr, 'vtx':expr, 'vtx_size':expr}" "Displays as geometry, interpreting the data as index or vertex data." }
|
||||
}
|
||||
|
||||
@enum D_ViewRuleKind:
|
||||
{
|
||||
@expand(D_ViewRuleTable a) `$(a.name)`,
|
||||
COUNT,
|
||||
}
|
||||
|
||||
@data(D_ViewRuleSpecInfo) @c_file d_core_view_rule_spec_info_table:
|
||||
{
|
||||
@expand(D_ViewRuleTable a)
|
||||
```{str8_lit_comp("$(a.string)"), str8_lit_comp("$(a.display_name)"), str8_lit_comp("$(a.schema)"), str8_lit_comp("$(a.description)"), (D_ViewRuleSpecInfoFlag_Inherited*$(a.ih == "x"))|(D_ViewRuleSpecInfoFlag_Expandable*$(a.ex == "x"))|(D_ViewRuleSpecInfoFlag_ExprResolution*$(a.xp == "x"))|(D_ViewRuleSpecInfoFlag_VizBlockProd*$(a.vb == "x")), }```;
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Developer Toggles
|
||||
|
||||
|
||||
@@ -196,59 +196,6 @@ d_cmd_list_push_new(Arena *arena, D_CmdList *cmds, D_CmdKind kind, D_CmdParams *
|
||||
cmds->count += 1;
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: View Rule Spec Stateful Functions
|
||||
|
||||
internal void
|
||||
d_register_view_rule_specs(D_ViewRuleSpecInfoArray specs)
|
||||
{
|
||||
for(U64 idx = 0; idx < specs.count; idx += 1)
|
||||
{
|
||||
// rjf: extract info from array slot
|
||||
D_ViewRuleSpecInfo *info = &specs.v[idx];
|
||||
|
||||
// rjf: skip empties
|
||||
if(info->string.size == 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// rjf: determine hash/slot
|
||||
U64 hash = d_hash_from_string(info->string);
|
||||
U64 slot_idx = hash%d_state->view_rule_spec_table_size;
|
||||
|
||||
// rjf: allocate node & push
|
||||
D_ViewRuleSpec *spec = push_array(d_state->arena, D_ViewRuleSpec, 1);
|
||||
SLLStackPush_N(d_state->view_rule_spec_table[slot_idx], spec, hash_next);
|
||||
|
||||
// rjf: fill node
|
||||
D_ViewRuleSpecInfo *info_copy = &spec->info;
|
||||
MemoryCopyStruct(info_copy, info);
|
||||
info_copy->string = push_str8_copy(d_state->arena, info->string);
|
||||
info_copy->display_string = push_str8_copy(d_state->arena, info->display_string);
|
||||
info_copy->description = push_str8_copy(d_state->arena, info->description);
|
||||
}
|
||||
}
|
||||
|
||||
internal D_ViewRuleSpec *
|
||||
d_view_rule_spec_from_string(String8 string)
|
||||
{
|
||||
D_ViewRuleSpec *spec = &d_nil_core_view_rule_spec;
|
||||
{
|
||||
U64 hash = d_hash_from_string(string);
|
||||
U64 slot_idx = hash%d_state->view_rule_spec_table_size;
|
||||
for(D_ViewRuleSpec *s = d_state->view_rule_spec_table[slot_idx]; s != 0; s = s->hash_next)
|
||||
{
|
||||
if(str8_match(string, s->info.string, 0))
|
||||
{
|
||||
spec = s;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return spec;
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Stepping "Trap Net" Builders
|
||||
|
||||
@@ -1668,16 +1615,8 @@ d_init(void)
|
||||
hs_submit_data(d_state->output_log_key, 0, str8_zero());
|
||||
d_state->ctrl_entity_store = ctrl_entity_store_alloc();
|
||||
d_state->ctrl_stop_arena = arena_alloc();
|
||||
d_state->view_rule_spec_table_size = 1024;
|
||||
d_state->view_rule_spec_table = push_array(arena, D_ViewRuleSpec *, d_state->view_rule_spec_table_size);
|
||||
d_state->ctrl_msg_arena = arena_alloc();
|
||||
|
||||
// rjf: register core view rules
|
||||
{
|
||||
D_ViewRuleSpecInfoArray array = {d_core_view_rule_spec_info_table, ArrayCount(d_core_view_rule_spec_info_table)};
|
||||
d_register_view_rule_specs(array);
|
||||
}
|
||||
|
||||
// rjf: set up caches
|
||||
d_state->unwind_cache.slots_count = 1024;
|
||||
d_state->unwind_cache.slots = push_array(arena, D_UnwindCacheSlot, d_state->unwind_cache.slots_count);
|
||||
|
||||
@@ -169,42 +169,6 @@ D_RunKind;
|
||||
|
||||
#include "dbg_engine/generated/dbg_engine.meta.h"
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: View Rules
|
||||
|
||||
typedef U32 D_ViewRuleSpecInfoFlags; // NOTE(rjf): see @view_rule_info
|
||||
enum
|
||||
{
|
||||
D_ViewRuleSpecInfoFlag_Inherited = (1<<0),
|
||||
D_ViewRuleSpecInfoFlag_Expandable = (1<<1),
|
||||
D_ViewRuleSpecInfoFlag_ExprResolution = (1<<2),
|
||||
D_ViewRuleSpecInfoFlag_VizBlockProd = (1<<3),
|
||||
};
|
||||
|
||||
typedef struct D_ViewRuleSpecInfo D_ViewRuleSpecInfo;
|
||||
struct D_ViewRuleSpecInfo
|
||||
{
|
||||
String8 string;
|
||||
String8 display_string;
|
||||
String8 schema;
|
||||
String8 description;
|
||||
D_ViewRuleSpecInfoFlags flags;
|
||||
};
|
||||
|
||||
typedef struct D_ViewRuleSpecInfoArray D_ViewRuleSpecInfoArray;
|
||||
struct D_ViewRuleSpecInfoArray
|
||||
{
|
||||
D_ViewRuleSpecInfo *v;
|
||||
U64 count;
|
||||
};
|
||||
|
||||
typedef struct D_ViewRuleSpec D_ViewRuleSpec;
|
||||
struct D_ViewRuleSpec
|
||||
{
|
||||
D_ViewRuleSpec *hash_next;
|
||||
D_ViewRuleSpecInfo info;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Command Types
|
||||
|
||||
@@ -363,10 +327,6 @@ struct D_State
|
||||
D_RunLocalsCache member_caches[2];
|
||||
U64 member_cache_gen;
|
||||
|
||||
// rjf: view rule specification table
|
||||
U64 view_rule_spec_table_size;
|
||||
D_ViewRuleSpec **view_rule_spec_table;
|
||||
|
||||
// rjf: user -> ctrl driving state
|
||||
Arena *ctrl_last_run_arena;
|
||||
D_RunKind ctrl_last_run_kind;
|
||||
@@ -391,7 +351,6 @@ struct D_State
|
||||
////////////////////////////////
|
||||
//~ rjf: Globals
|
||||
|
||||
read_only global D_ViewRuleSpec d_nil_core_view_rule_spec = {0};
|
||||
global D_State *d_state = 0;
|
||||
|
||||
////////////////////////////////
|
||||
@@ -426,12 +385,6 @@ internal D_CmdParams d_cmd_params_copy(Arena *arena, D_CmdParams *src);
|
||||
//- rjf: command lists
|
||||
internal void d_cmd_list_push_new(Arena *arena, D_CmdList *cmds, D_CmdKind kind, D_CmdParams *params);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: View Rule Spec Stateful Functions
|
||||
|
||||
internal void d_register_view_rule_specs(D_ViewRuleSpecInfoArray specs);
|
||||
internal D_ViewRuleSpec *d_view_rule_spec_from_string(String8 string);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Stepping "Trap Net" Builders
|
||||
|
||||
|
||||
@@ -3,31 +3,3 @@
|
||||
|
||||
//- GENERATED CODE
|
||||
|
||||
C_LINKAGE_BEGIN
|
||||
D_ViewRuleSpecInfo d_core_view_rule_spec_info_table[21] =
|
||||
{
|
||||
{str8_lit_comp("default"), str8_lit_comp("Default"), str8_lit_comp(""), str8_lit_comp(""), (D_ViewRuleSpecInfoFlag_Inherited*0)|(D_ViewRuleSpecInfoFlag_Expandable*0)|(D_ViewRuleSpecInfoFlag_ExprResolution*0)|(D_ViewRuleSpecInfoFlag_VizBlockProd*1), },
|
||||
{str8_lit_comp("array"), str8_lit_comp("Array"), str8_lit_comp("x:{expr}"), str8_lit_comp("Specifies that a pointer points to N elements, rather than only 1."), (D_ViewRuleSpecInfoFlag_Inherited*0)|(D_ViewRuleSpecInfoFlag_Expandable*0)|(D_ViewRuleSpecInfoFlag_ExprResolution*1)|(D_ViewRuleSpecInfoFlag_VizBlockProd*0), },
|
||||
{str8_lit_comp("slice"), str8_lit_comp("Slice"), str8_lit_comp(""), str8_lit_comp("Specifies that a pointer within a struct, also containing an integer, points to the number of elements encoded by the integer."), (D_ViewRuleSpecInfoFlag_Inherited*0)|(D_ViewRuleSpecInfoFlag_Expandable*0)|(D_ViewRuleSpecInfoFlag_ExprResolution*1)|(D_ViewRuleSpecInfoFlag_VizBlockProd*0), },
|
||||
{str8_lit_comp("list"), str8_lit_comp("List"), str8_lit_comp("x:{member}"), str8_lit_comp("Specifies that some struct, union, or class forms the top of a linked list, and the member which points at the following element in the list."), (D_ViewRuleSpecInfoFlag_Inherited*0)|(D_ViewRuleSpecInfoFlag_Expandable*0)|(D_ViewRuleSpecInfoFlag_ExprResolution*0)|(D_ViewRuleSpecInfoFlag_VizBlockProd*1), },
|
||||
{str8_lit_comp("bswap"), str8_lit_comp("Byte Swap"), str8_lit_comp(""), str8_lit_comp("Specifies that all integral evaluations should be byte-swapped, such that their endianness is reversed."), (D_ViewRuleSpecInfoFlag_Inherited*1)|(D_ViewRuleSpecInfoFlag_Expandable*0)|(D_ViewRuleSpecInfoFlag_ExprResolution*1)|(D_ViewRuleSpecInfoFlag_VizBlockProd*0), },
|
||||
{str8_lit_comp("cast"), str8_lit_comp("Cast"), str8_lit_comp("x:{type}"), str8_lit_comp("Specifies that the expression to which the view rule is applied should be casted to the provided type."), (D_ViewRuleSpecInfoFlag_Inherited*0)|(D_ViewRuleSpecInfoFlag_Expandable*0)|(D_ViewRuleSpecInfoFlag_ExprResolution*1)|(D_ViewRuleSpecInfoFlag_VizBlockProd*0), },
|
||||
{str8_lit_comp("dec"), str8_lit_comp("Decimal Base (Base 10)"), str8_lit_comp(""), str8_lit_comp("Specifies that all integral evaluations should appear in base-10 form."), (D_ViewRuleSpecInfoFlag_Inherited*1)|(D_ViewRuleSpecInfoFlag_Expandable*0)|(D_ViewRuleSpecInfoFlag_ExprResolution*0)|(D_ViewRuleSpecInfoFlag_VizBlockProd*0), },
|
||||
{str8_lit_comp("bin"), str8_lit_comp("Binary Base (Base 2)"), str8_lit_comp(""), str8_lit_comp("Specifies that all integral evaluations should appear in base-2 form."), (D_ViewRuleSpecInfoFlag_Inherited*1)|(D_ViewRuleSpecInfoFlag_Expandable*0)|(D_ViewRuleSpecInfoFlag_ExprResolution*0)|(D_ViewRuleSpecInfoFlag_VizBlockProd*0), },
|
||||
{str8_lit_comp("oct"), str8_lit_comp("Octal Base (Base 8)"), str8_lit_comp(""), str8_lit_comp("Specifies that all integral evaluations should appear in base-8 form."), (D_ViewRuleSpecInfoFlag_Inherited*1)|(D_ViewRuleSpecInfoFlag_Expandable*0)|(D_ViewRuleSpecInfoFlag_ExprResolution*0)|(D_ViewRuleSpecInfoFlag_VizBlockProd*0), },
|
||||
{str8_lit_comp("hex"), str8_lit_comp("Hexadecimal Base (Base 16)"), str8_lit_comp(""), str8_lit_comp("Specifies that all integral evaluations should appear in base-16 form."), (D_ViewRuleSpecInfoFlag_Inherited*1)|(D_ViewRuleSpecInfoFlag_Expandable*0)|(D_ViewRuleSpecInfoFlag_ExprResolution*0)|(D_ViewRuleSpecInfoFlag_VizBlockProd*0), },
|
||||
{str8_lit_comp("only"), str8_lit_comp("Only Specified Members"), str8_lit_comp("x:{member}"), str8_lit_comp("Specifies that only the specified members should appear in struct, union, or class evaluations."), (D_ViewRuleSpecInfoFlag_Inherited*1)|(D_ViewRuleSpecInfoFlag_Expandable*0)|(D_ViewRuleSpecInfoFlag_ExprResolution*0)|(D_ViewRuleSpecInfoFlag_VizBlockProd*1), },
|
||||
{str8_lit_comp("omit"), str8_lit_comp("Omit Specified Members"), str8_lit_comp("x:{member}"), str8_lit_comp("Omits a list of member names from appearing in struct, union, or class evaluations."), (D_ViewRuleSpecInfoFlag_Inherited*1)|(D_ViewRuleSpecInfoFlag_Expandable*0)|(D_ViewRuleSpecInfoFlag_ExprResolution*0)|(D_ViewRuleSpecInfoFlag_VizBlockProd*1), },
|
||||
{str8_lit_comp("no_addr"), str8_lit_comp("Disable Address Values"), str8_lit_comp(""), str8_lit_comp("Displays only what pointers point to, if possible, without the pointer's address value."), (D_ViewRuleSpecInfoFlag_Inherited*1)|(D_ViewRuleSpecInfoFlag_Expandable*0)|(D_ViewRuleSpecInfoFlag_ExprResolution*0)|(D_ViewRuleSpecInfoFlag_VizBlockProd*0), },
|
||||
{str8_lit_comp("checkbox"), str8_lit_comp("Checkbox"), str8_lit_comp(""), str8_lit_comp("Displays simple integer values as checkboxes, encoding zero or nonzero values."), (D_ViewRuleSpecInfoFlag_Inherited*0)|(D_ViewRuleSpecInfoFlag_Expandable*0)|(D_ViewRuleSpecInfoFlag_ExprResolution*0)|(D_ViewRuleSpecInfoFlag_VizBlockProd*0), },
|
||||
{str8_lit_comp("color_rgba"), str8_lit_comp("Color (RGBA)"), str8_lit_comp(""), str8_lit_comp("Displays as a color, interpreting the data as encoding R, G, B, and A values."), (D_ViewRuleSpecInfoFlag_Inherited*0)|(D_ViewRuleSpecInfoFlag_Expandable*1)|(D_ViewRuleSpecInfoFlag_ExprResolution*0)|(D_ViewRuleSpecInfoFlag_VizBlockProd*1), },
|
||||
{str8_lit_comp("text"), str8_lit_comp("Text"), str8_lit_comp("x:{'lang':lang, 'size':expr}"), str8_lit_comp("Displays as text."), (D_ViewRuleSpecInfoFlag_Inherited*0)|(D_ViewRuleSpecInfoFlag_Expandable*1)|(D_ViewRuleSpecInfoFlag_ExprResolution*0)|(D_ViewRuleSpecInfoFlag_VizBlockProd*1), },
|
||||
{str8_lit_comp("disasm"), str8_lit_comp("Disassembly"), str8_lit_comp("x:{'arch':arch, 'size':expr}"), str8_lit_comp("Displays as disassembled instructions, interpreting the data as raw machine code."), (D_ViewRuleSpecInfoFlag_Inherited*0)|(D_ViewRuleSpecInfoFlag_Expandable*1)|(D_ViewRuleSpecInfoFlag_ExprResolution*0)|(D_ViewRuleSpecInfoFlag_VizBlockProd*1), },
|
||||
{str8_lit_comp("memory"), str8_lit_comp("Memory"), str8_lit_comp("x:{'size':expr}"), str8_lit_comp("Displays as a raw memory grid."), (D_ViewRuleSpecInfoFlag_Inherited*0)|(D_ViewRuleSpecInfoFlag_Expandable*1)|(D_ViewRuleSpecInfoFlag_ExprResolution*0)|(D_ViewRuleSpecInfoFlag_VizBlockProd*1), },
|
||||
{str8_lit_comp("graph"), str8_lit_comp("Graph"), str8_lit_comp(""), str8_lit_comp("Displays as a pointer graph, visualizing nodes and edges formed by pointers directly."), (D_ViewRuleSpecInfoFlag_Inherited*0)|(D_ViewRuleSpecInfoFlag_Expandable*1)|(D_ViewRuleSpecInfoFlag_ExprResolution*0)|(D_ViewRuleSpecInfoFlag_VizBlockProd*1), },
|
||||
{str8_lit_comp("bitmap"), str8_lit_comp("Bitmap"), str8_lit_comp("x:{'w':expr, 'h':expr, 'fmt':tex2dformat}"), str8_lit_comp("Displays as a bitmap, interpreting the data as raw pixel data."), (D_ViewRuleSpecInfoFlag_Inherited*0)|(D_ViewRuleSpecInfoFlag_Expandable*1)|(D_ViewRuleSpecInfoFlag_ExprResolution*0)|(D_ViewRuleSpecInfoFlag_VizBlockProd*1), },
|
||||
{str8_lit_comp("geo3d"), str8_lit_comp("Geometry (3D)"), str8_lit_comp("x:{'count':expr, 'vtx':expr, 'vtx_size':expr}"), str8_lit_comp("Displays as geometry, interpreting the data as index or vertex data."), (D_ViewRuleSpecInfoFlag_Inherited*0)|(D_ViewRuleSpecInfoFlag_Expandable*1)|(D_ViewRuleSpecInfoFlag_ExprResolution*0)|(D_ViewRuleSpecInfoFlag_VizBlockProd*1), },
|
||||
};
|
||||
|
||||
C_LINKAGE_END
|
||||
|
||||
|
||||
@@ -44,32 +44,6 @@ D_CmdKind_Attach,
|
||||
D_CmdKind_COUNT,
|
||||
} D_CmdKind;
|
||||
|
||||
typedef enum D_ViewRuleKind
|
||||
{
|
||||
D_ViewRuleKind_Default,
|
||||
D_ViewRuleKind_Array,
|
||||
D_ViewRuleKind_Slice,
|
||||
D_ViewRuleKind_List,
|
||||
D_ViewRuleKind_ByteSwap,
|
||||
D_ViewRuleKind_Cast,
|
||||
D_ViewRuleKind_BaseDec,
|
||||
D_ViewRuleKind_BaseBin,
|
||||
D_ViewRuleKind_BaseOct,
|
||||
D_ViewRuleKind_BaseHex,
|
||||
D_ViewRuleKind_Only,
|
||||
D_ViewRuleKind_Omit,
|
||||
D_ViewRuleKind_NoAddr,
|
||||
D_ViewRuleKind_Checkbox,
|
||||
D_ViewRuleKind_ColorRGBA,
|
||||
D_ViewRuleKind_Text,
|
||||
D_ViewRuleKind_Disasm,
|
||||
D_ViewRuleKind_Memory,
|
||||
D_ViewRuleKind_Graph,
|
||||
D_ViewRuleKind_Bitmap,
|
||||
D_ViewRuleKind_Geo3D,
|
||||
D_ViewRuleKind_COUNT,
|
||||
} D_ViewRuleKind;
|
||||
|
||||
global B32 DEV_simulate_lag = 0;
|
||||
global B32 DEV_draw_ui_text_pos = 0;
|
||||
global B32 DEV_draw_ui_focus_debug = 0;
|
||||
|
||||
@@ -1701,6 +1701,9 @@ fancy_viz_eval_tests(void)
|
||||
unsigned int example_color_u32 = 0xff6f30ff;
|
||||
struct {float r, g, b, a;} example_color_struct = {0.50f, 0.95f, 0.75f, 1.00f};
|
||||
int x0 = 0;
|
||||
raddbg_pin(color(example_color_4f32));
|
||||
raddbg_pin(color(example_color_u32));
|
||||
raddbg_pin(color(example_color_struct));
|
||||
|
||||
//- rjf: multiline text
|
||||
char *long_string = ("This is an example of some very long text with line breaks\n"
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
//- GENERATED CODE
|
||||
|
||||
C_LINKAGE_BEGIN
|
||||
RD_VocabInfo rd_vocab_info_table[314] =
|
||||
RD_VocabInfo rd_vocab_info_table[315] =
|
||||
{
|
||||
{str8_lit_comp("auto_view_rule"), str8_lit_comp("auto_view_rules"), str8_lit_comp("Auto View Rule"), str8_lit_comp("Auto View Rules"), RD_IconKind_Binoculars},
|
||||
{str8_lit_comp("file_path_map"), str8_lit_comp("file_path_maps"), str8_lit_comp("File Path Map"), str8_lit_comp("File Path Maps"), RD_IconKind_FileOutline},
|
||||
@@ -110,6 +110,7 @@ RD_VocabInfo rd_vocab_info_table[314] =
|
||||
{str8_lit_comp("font_size"), str8_lit_comp(""), str8_lit_comp("Font Size"), str8_lit_comp(""), RD_IconKind_Null},
|
||||
{str8_lit_comp("row_height"), str8_lit_comp(""), str8_lit_comp("Row Height"), str8_lit_comp(""), RD_IconKind_Null},
|
||||
{str8_lit_comp("tab_height"), str8_lit_comp(""), str8_lit_comp("Tab Height"), str8_lit_comp(""), RD_IconKind_Null},
|
||||
{str8_lit_comp("rgba"), str8_lit_comp(""), str8_lit_comp("RGBA"), str8_lit_comp(""), RD_IconKind_Palette},
|
||||
{str8_lit_comp("launch_and_run"), str8_lit_comp(""), str8_lit_comp("Launch and Run"), str8_lit_comp(""), RD_IconKind_Play},
|
||||
{str8_lit_comp("launch_and_step_into"), str8_lit_comp(""), str8_lit_comp("Launch and Step Into"), str8_lit_comp(""), RD_IconKind_PlayStepForward},
|
||||
{str8_lit_comp("kill"), str8_lit_comp(""), str8_lit_comp("Kill"), str8_lit_comp(""), RD_IconKind_X},
|
||||
@@ -322,9 +323,10 @@ RD_VocabInfo rd_vocab_info_table[314] =
|
||||
{str8_lit_comp("log_marker"), str8_lit_comp(""), str8_lit_comp("Log Marker"), str8_lit_comp(""), RD_IconKind_Null},
|
||||
};
|
||||
|
||||
RD_NameSchemaInfo rd_name_schema_info_table[20] =
|
||||
RD_NameSchemaInfo rd_name_schema_info_table[21] =
|
||||
{
|
||||
{str8_lit_comp("settings"), str8_lit_comp("x:\n{\n @default(1) 'hover_animations': bool,\n @default(1) 'press_animations': bool,\n @default(0) 'focus_animations': bool,\n @default(1) 'tooltip_animations': bool,\n @default(1) 'menu_animations': bool,\n @default(1) 'scrolling_animations': bool,\n @default(1) 'background_blur': bool,\n @default(1) 'thread_lines': bool,\n @default(1) 'breakpoint_lines': bool,\n @default(1) 'thread_glow': bool,\n @default(1) 'breakpoint_glow': bool,\n @default(0) 'opaque_backgrounds': bool,\n @default(1) 'smooth_ui_text': bool,\n @default(0) 'smooth_code_text': bool,\n @default(1) 'hint_ui_text': bool,\n @default(1) 'hint_code_text': bool,\n @default(2) 'tab_width': @range[1, 32] u64,\n @default(11) 'font_size': @range[6, 72] u64,\n @default(3.f) 'row_height': @range[1.75f, 5.f] f32,\n @default(3.f) 'tab_height': @range[1.75f, 5.f] f32,\n}\n")},
|
||||
{str8_lit_comp("user"), str8_lit_comp("x:\n{\n @default(2) @display_name('User Tab Width') 'tab_width': @range[1, 32] u64,\n}\n")},
|
||||
{str8_lit_comp("project"), str8_lit_comp("x:\n{\n @default(2) @display_name('Project Tab Width') 'tab_width': @range[1, 32] u64,\n}\n")},
|
||||
{str8_lit_comp("window"), str8_lit_comp("x:\n{\n //- rjf: animations\n @default(1) 'hover_animations': bool,\n @default(1) 'press_animations': bool,\n @default(0) 'focus_animations': bool,\n @default(1) 'tooltip_animations': bool,\n @default(1) 'menu_animations': bool,\n @default(1) 'scrolling_animations': bool,\n\n //- rjf: thread & breakpoint decorations\n @default(1) @display_name('Thread Lines') @description(\"Controls whether or not a long horizontal line is drawn before the next line or instruction that the selected thread will execute in source and disassembly views.\")\n 'thread_lines': bool,\n @default(1) @display_name('Thread Glow') @description(\"Controls whether or not a glowing effect is drawn on the selected thread in source and disassembly views.\")\n 'thread_glow': bool,\n @default(1) @display_name('Breakpoint Lines') @description(\"Controls whether or not a long horizontal line is drawn before the line or instruction at which a breakpoint is placed, in source and disassembly views.\")\n 'breakpoint_lines': bool,\n @default(1) @display_name('Breakpoint Glow') @description(\"Controls whether or not a glowing effect is drawn on breakpoints in source and disassembly views.\")\n 'breakpoint_glow': bool,\n\n //- rjf: occluding background settings\n @default(0) @display_name('Opaque Backgrounds') @description(\"Controls whether or not all floating background colors are forced to be fully opaque.\")\n 'opaque_backgrounds': bool,\n @default(1) @display_name('Background Blur') @description(\"Controls whether or not occluded regions behind floating elements are blurred.\")\n 'background_blur': bool,\n\n //- rjf: text rasterization settings\n @default(1) @display_name('Smooth UI Text') @description(\"Controls whether or not UI text is fully anti-aliased, for a smoother appearance.\")\n 'smooth_ui_text': bool,\n @default(1) @display_name('Hint UI Text') @description(\"Controls whether or not UI text is hinted, for better text readability at small sizes.\")\n 'hint_ui_text': bool,\n @default(0) @display_name('Smooth Code Text') @description(\"Controls whether or not code text is fully anti-aliased, for a smoother appearance.\")\n 'smooth_code_text': bool,\n @default(1) @display_name('Hint Code Text') @description(\"Controls whether or not code text is hinted, for better text readability at small sizes.\")\n 'hint_code_text': bool,\n @default(11) @display_name('Window Font Size') @description(\"Controls the window's default font size. Does not apply to tabs with their own font size set.\")\n 'font_size': @range[6, 72] u64,\n\n //- rjf: size settings\n @default(3.f) @display_name('Window Row Height') @description(\"Controls the window's default row height, in multiples of the font size. Does not apply to tabs with their own row height set.\")\n 'row_height': @range[1.75f, 5.f] f32,\n @default(3.f) @description(\"Controls the height of tabs, in multiples of the font size.\")\n 'tab_height': @range[1.75f, 5.f] f32,\n}\n")},
|
||||
{str8_lit_comp("tab"), str8_lit_comp("x:\n{\n @default(11) @display_name('Tab Font Size') 'font_size': @range[6, 72] u64,\n}\n")},
|
||||
{str8_lit_comp("watch"), str8_lit_comp("@inherit(tab) x:\n{\n @default(3.f) @display_name('Tab Row Height') 'row_height': @range[1.75f, 5.f] f32,\n}\n")},
|
||||
@@ -409,7 +411,7 @@ RD_CmdKindInfo rd_cmd_kind_info_table[211] =
|
||||
{ str8_lit_comp("halt"), str8_lit_comp("Halts all attached processes."), str8_lit_comp("pause"), str8_lit_comp(""), (RD_CmdKindFlag_ListInUI*1)|(RD_CmdKindFlag_ListInIPCDocs*1), {(RD_QueryFlag_AllowFiles*0)|(RD_QueryFlag_AllowFolders*0)|(RD_QueryFlag_CodeInput*0)|(RD_QueryFlag_KeepOldInput*0)|(RD_QueryFlag_SelectOldInput*0)|(RD_QueryFlag_Floating*0)|(RD_QueryFlag_Required*0), RD_RegSlot_Null, str8_lit_comp(""), str8_lit_comp(""), CTRL_EntityKind_Null}},
|
||||
{ str8_lit_comp("soft_halt_refresh"), str8_lit_comp("Interrupts all attached processes to collect data, and then resumes them."), str8_lit_comp(""), str8_lit_comp(""), (RD_CmdKindFlag_ListInUI*0)|(RD_CmdKindFlag_ListInIPCDocs*0), {(RD_QueryFlag_AllowFiles*0)|(RD_QueryFlag_AllowFolders*0)|(RD_QueryFlag_CodeInput*0)|(RD_QueryFlag_KeepOldInput*0)|(RD_QueryFlag_SelectOldInput*0)|(RD_QueryFlag_Floating*0)|(RD_QueryFlag_Required*0), RD_RegSlot_Null, str8_lit_comp(""), str8_lit_comp(""), CTRL_EntityKind_Null}},
|
||||
{ str8_lit_comp("set_thread_ip"), str8_lit_comp("Sets the specified thread's instruction pointer at the specified address."), str8_lit_comp(""), str8_lit_comp(""), (RD_CmdKindFlag_ListInUI*0)|(RD_CmdKindFlag_ListInIPCDocs*1), {(RD_QueryFlag_AllowFiles*0)|(RD_QueryFlag_AllowFolders*0)|(RD_QueryFlag_CodeInput*1)|(RD_QueryFlag_KeepOldInput*0)|(RD_QueryFlag_SelectOldInput*0)|(RD_QueryFlag_Floating*1)|(RD_QueryFlag_Required*1), RD_RegSlot_Vaddr, str8_lit_comp(""), str8_lit_comp(""), CTRL_EntityKind_Null}},
|
||||
{ str8_lit_comp("run_to_line"), str8_lit_comp("Runs until a particular source line is hit."), str8_lit_comp(""), str8_lit_comp("$text_pt,"), (RD_CmdKindFlag_ListInUI*0)|(RD_CmdKindFlag_ListInIPCDocs*1), {(RD_QueryFlag_AllowFiles*0)|(RD_QueryFlag_AllowFolders*0)|(RD_QueryFlag_CodeInput*0)|(RD_QueryFlag_KeepOldInput*0)|(RD_QueryFlag_SelectOldInput*0)|(RD_QueryFlag_Floating*0)|(RD_QueryFlag_Required*0), RD_RegSlot_Null, str8_lit_comp(""), str8_lit_comp(""), CTRL_EntityKind_Null}},
|
||||
{ str8_lit_comp("run_to_line"), str8_lit_comp("Runs until a particular source line is hit."), str8_lit_comp(""), str8_lit_comp("$text_pt,"), (RD_CmdKindFlag_ListInUI*1)|(RD_CmdKindFlag_ListInIPCDocs*1), {(RD_QueryFlag_AllowFiles*0)|(RD_QueryFlag_AllowFolders*0)|(RD_QueryFlag_CodeInput*0)|(RD_QueryFlag_KeepOldInput*0)|(RD_QueryFlag_SelectOldInput*0)|(RD_QueryFlag_Floating*0)|(RD_QueryFlag_Required*0), RD_RegSlot_Null, str8_lit_comp(""), str8_lit_comp(""), CTRL_EntityKind_Null}},
|
||||
{ str8_lit_comp("run"), str8_lit_comp("Runs all targets after starting them if they have not been started yet."), str8_lit_comp("play"), str8_lit_comp(""), (RD_CmdKindFlag_ListInUI*1)|(RD_CmdKindFlag_ListInIPCDocs*1), {(RD_QueryFlag_AllowFiles*0)|(RD_QueryFlag_AllowFolders*0)|(RD_QueryFlag_CodeInput*0)|(RD_QueryFlag_KeepOldInput*0)|(RD_QueryFlag_SelectOldInput*0)|(RD_QueryFlag_Floating*0)|(RD_QueryFlag_Required*0), RD_RegSlot_Null, str8_lit_comp(""), str8_lit_comp(""), CTRL_EntityKind_Null}},
|
||||
{ str8_lit_comp("restart"), str8_lit_comp("Kills all attached processes, then launches all active targets."), str8_lit_comp("restart,retry"), str8_lit_comp(""), (RD_CmdKindFlag_ListInUI*1)|(RD_CmdKindFlag_ListInIPCDocs*1), {(RD_QueryFlag_AllowFiles*0)|(RD_QueryFlag_AllowFolders*0)|(RD_QueryFlag_CodeInput*0)|(RD_QueryFlag_KeepOldInput*0)|(RD_QueryFlag_SelectOldInput*0)|(RD_QueryFlag_Floating*0)|(RD_QueryFlag_Required*0), RD_RegSlot_Null, str8_lit_comp(""), str8_lit_comp(""), CTRL_EntityKind_Null}},
|
||||
{ str8_lit_comp("step_into"), str8_lit_comp("Steps once, possibly into function calls, for either source lines or instructions (whichever is selected)."), str8_lit_comp(""), str8_lit_comp(""), (RD_CmdKindFlag_ListInUI*1)|(RD_CmdKindFlag_ListInIPCDocs*1), {(RD_QueryFlag_AllowFiles*0)|(RD_QueryFlag_AllowFolders*0)|(RD_QueryFlag_CodeInput*0)|(RD_QueryFlag_KeepOldInput*0)|(RD_QueryFlag_SelectOldInput*0)|(RD_QueryFlag_Floating*0)|(RD_QueryFlag_Required*0), RD_RegSlot_Null, str8_lit_comp(""), str8_lit_comp(""), CTRL_EntityKind_Null}},
|
||||
|
||||
@@ -640,8 +640,8 @@ RD_Query query;
|
||||
.os_event = rd_regs()->os_event,\
|
||||
|
||||
C_LINKAGE_BEGIN
|
||||
extern RD_VocabInfo rd_vocab_info_table[314];
|
||||
extern RD_NameSchemaInfo rd_name_schema_info_table[20];
|
||||
extern RD_VocabInfo rd_vocab_info_table[315];
|
||||
extern RD_NameSchemaInfo rd_name_schema_info_table[21];
|
||||
extern Rng1U64 rd_reg_slot_range_table[42];
|
||||
extern String8 rd_binding_version_remap_old_name_table[8];
|
||||
extern String8 rd_binding_version_remap_new_name_table[8];
|
||||
|
||||
+15
-84
@@ -123,6 +123,7 @@ RD_VocabTable:
|
||||
{font_size "" "Font Size" "" Null }
|
||||
{row_height "" "Row Height" "" Null }
|
||||
{tab_height "" "Tab Height" "" Null }
|
||||
{rgba "" "RGBA" "" Palette }
|
||||
}
|
||||
|
||||
@struct RD_VocabInfo:
|
||||
@@ -146,31 +147,22 @@ RD_VocabTable:
|
||||
|
||||
@table(name schema) RD_SchemaTable:
|
||||
{
|
||||
//- rjf: settings
|
||||
//- rjf: users / projects
|
||||
{
|
||||
settings,
|
||||
```x:
|
||||
user
|
||||
```
|
||||
x:
|
||||
{
|
||||
@default(1) 'hover_animations': bool,
|
||||
@default(1) 'press_animations': bool,
|
||||
@default(0) 'focus_animations': bool,
|
||||
@default(1) 'tooltip_animations': bool,
|
||||
@default(1) 'menu_animations': bool,
|
||||
@default(1) 'scrolling_animations': bool,
|
||||
@default(1) 'background_blur': bool,
|
||||
@default(1) 'thread_lines': bool,
|
||||
@default(1) 'breakpoint_lines': bool,
|
||||
@default(1) 'thread_glow': bool,
|
||||
@default(1) 'breakpoint_glow': bool,
|
||||
@default(0) 'opaque_backgrounds': bool,
|
||||
@default(1) 'smooth_ui_text': bool,
|
||||
@default(0) 'smooth_code_text': bool,
|
||||
@default(1) 'hint_ui_text': bool,
|
||||
@default(1) 'hint_code_text': bool,
|
||||
@default(2) 'tab_width': @range[1, 32] u64,
|
||||
@default(11) 'font_size': @range[6, 72] u64,
|
||||
@default(3.f) 'row_height': @range[1.75f, 5.f] f32,
|
||||
@default(3.f) 'tab_height': @range[1.75f, 5.f] f32,
|
||||
@default(2) @display_name('User Tab Width') 'tab_width': @range[1, 32] u64,
|
||||
}
|
||||
```
|
||||
}
|
||||
{
|
||||
project
|
||||
```
|
||||
x:
|
||||
{
|
||||
@default(2) @display_name('Project Tab Width') 'tab_width': @range[1, 32] u64,
|
||||
}
|
||||
```
|
||||
}
|
||||
@@ -1102,67 +1094,6 @@ RD_IconTable:
|
||||
@expand(RD_IconTable a) `str8_lit_comp("$(a.text)")`;
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: View Rules
|
||||
|
||||
@table(name name_lower display_name params_schema icon can_filter filter_is_code typing_automatically_filters can_use_in_watch_table can_fill_value_cell can_expand show_in_docs description)
|
||||
RD_ViewRuleTable:
|
||||
{
|
||||
//- rjf: basics
|
||||
{ Empty empty "" "" Null 0 0 0 0 0 0 0 "" }
|
||||
{ GettingStarted getting_started "Getting Started" "" QuestionMark 0 0 0 0 0 0 0 "" }
|
||||
|
||||
//- rjf: meta (settings)
|
||||
{ Settings settings "Settings" "" Gear 0 0 0 0 0 0 1 "An interface to modify general settings for the debugger's appearance and behavior." }
|
||||
|
||||
//- rjf: temporary view for loading files - must analyze file before picking viewer
|
||||
{ PendingFile pending_file "Pending File" "" FileOutline 0 0 0 0 0 0 0 "" }
|
||||
|
||||
//- rjf: visualizers
|
||||
{ Watch watch "Watch" "" Binoculars 1 1 1 0 0 0 1 "The familiar 'watch window' debugger interface. Allows the inputting of a number of expressions. Each expression in the table is evaluated within the context of the selected thread's selected call stack frame. If applicable (depending on visualization rules and the expression's type), these expressions may be hierarchically expanded, which displays children as more rows in the table. The values of these expressions may also be edited, and if possible, can be used to write to registers or memory in attached processes. Also contains a new *view rule* column, not found in other major debuggers, which allows per-row specification of various visualization rules. These view rules may be used to visualize and inspect the evaluation of expressions in a variety of ways. To learn more, read the 'View Rules' section." }
|
||||
{ Text text "Text" "x:{'lang':lang, 'size':expr}" FileOutline 0 0 0 1 0 1 0 "" }
|
||||
{ Disasm disasm "Disassembly" "x:{'arch':arch, 'size':expr, 'addresses':bool, 'code_bytes':bool}" Glasses 0 0 0 1 0 1 1 "Displays disassembled instructions in a textual form from the selected thread's containing process virtual address space." }
|
||||
{ Memory memory "Memory" "x:{'size':expr}" Grid 0 0 0 1 0 1 1 "A hex-editor-like grid interface for viewing memory." }
|
||||
{ Bitmap bitmap "Bitmap" "x:{'w':expr, 'h':expr, 'fmt':tex2dformat}" Binoculars 0 0 0 1 0 1 1 "Visualizes memory as a bitmap." }
|
||||
{ Checkbox checkbox "Checkbox" "" CheckFilled 0 0 0 1 1 0 1 "Visualizes memory as an RGBA color." }
|
||||
{ ColorRGBA color_rgba "Color (RGBA)" "" Palette 0 0 0 1 1 1 1 "Visualizes memory as an RGBA color." }
|
||||
{ Geo3D geo3d "Geometry (3D)" "x:{'count':expr, 'vtx':expr, 'vtx_size':expr}" Binoculars 0 0 0 1 0 1 1 "Visualizes memory as 3D geometry." }
|
||||
}
|
||||
|
||||
/*
|
||||
@enum RD_ViewRuleKind:
|
||||
{
|
||||
Null,
|
||||
@expand(RD_ViewRuleTable a) `$(a.name)`,
|
||||
COUNT
|
||||
}
|
||||
|
||||
@struct RD_ViewRuleInfo:
|
||||
{
|
||||
`String8 string`;
|
||||
`String8 description`;
|
||||
`String8 display_name`;
|
||||
`String8 params_schema`;
|
||||
`RD_IconKind icon_kind`;
|
||||
`RD_ViewRuleInfoFlags flags`;
|
||||
`EV_ExpandRuleInfoHookFunctionType *expr_expand_info`;
|
||||
`RD_ViewRuleUIFunctionType *ui`;
|
||||
}
|
||||
|
||||
@gen
|
||||
{
|
||||
`RD_VIEW_RULE_UI_FUNCTION_DEF(null);`,
|
||||
@expand(RD_ViewRuleTable a) `$(a.can_use_in_watch_table != 0 && a.can_expand != 0 -> "EV_EXPAND_RULE_INFO_FUNCTION_DEF(" .. a.name_lower .. ");")`,
|
||||
@expand(RD_ViewRuleTable a) `RD_VIEW_RULE_UI_FUNCTION_DEF($(a.name_lower));`,
|
||||
}
|
||||
|
||||
@data(RD_ViewRuleInfo) rd_view_rule_kind_info_table:
|
||||
{
|
||||
`{{0}, {0}, {0}, {0}, RD_IconKind_Null, 0, EV_EXPAND_RULE_INFO_FUNCTION_NAME(nil), RD_VIEW_RULE_UI_FUNCTION_NAME(null)}`,
|
||||
@expand(RD_ViewRuleTable a) `{str8_lit_comp("$(a.name_lower)"), str8_lit_comp("$(a.description)"), str8_lit_comp("$(a.display_name)"), str8_lit_comp("$(a.params_schema)"), RD_IconKind_$(a.icon), (RD_ViewRuleInfoFlag_ShowInDocs*$(a.show_in_docs)|RD_ViewRuleInfoFlag_CanFilter*$(a.can_filter)|RD_ViewRuleInfoFlag_FilterIsCode*$(a.filter_is_code)|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*$(a.typing_automatically_filters)|RD_ViewRuleInfoFlag_CanUseInWatchTable*$(a.can_use_in_watch_table)|RD_ViewRuleInfoFlag_CanFillValueCell*$(a.can_fill_value_cell)|RD_ViewRuleInfoFlag_CanExpand*$(a.can_expand)), $(a.can_expand != 0 -> "EV_EXPAND_RULE_INFO_FUNCTION_NAME(" .. a.name_lower .. ")") $(a.can_expand == 0 -> "EV_EXPAND_RULE_INFO_FUNCTION_NAME(nil)"), RD_VIEW_RULE_UI_FUNCTION_NAME($(a.name_lower))}`,
|
||||
}
|
||||
*/
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Theme Tables
|
||||
|
||||
|
||||
+71
-28
@@ -1176,17 +1176,9 @@ rd_setting_from_name(String8 name)
|
||||
{
|
||||
String8 result = {0};
|
||||
{
|
||||
// rjf: find most-granular config scope to begin looking for the setting
|
||||
// rjf: find most-granular config scopes to begin looking for the setting
|
||||
RD_Cfg *view_cfg = rd_cfg_from_id(rd_regs()->view);
|
||||
RD_Cfg *start_cfg = view_cfg;
|
||||
for(RD_Cfg *p = start_cfg->parent; p != &rd_nil_cfg; p = p->parent)
|
||||
{
|
||||
if(str8_match(p->string, str8_lit("transient"), 0))
|
||||
{
|
||||
start_cfg = &rd_nil_cfg;
|
||||
break;
|
||||
}
|
||||
}
|
||||
RD_Cfg *start_cfg = &rd_nil_cfg;
|
||||
if(start_cfg == &rd_nil_cfg) { start_cfg = rd_cfg_from_id(rd_regs()->panel); }
|
||||
if(start_cfg == &rd_nil_cfg) { start_cfg = rd_cfg_from_id(rd_regs()->window); }
|
||||
|
||||
@@ -1200,23 +1192,27 @@ rd_setting_from_name(String8 name)
|
||||
// rjf: return resultant child string stored under this key
|
||||
result = setting->first->string;
|
||||
|
||||
// rjf: no result -> look for default in settings
|
||||
// rjf: no result -> look for default in schemas
|
||||
if(result.size == 0) ProfScope("default setting schema lookup")
|
||||
{
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
String8 schema_names[] =
|
||||
MD_Node *schema = &md_nil_node;
|
||||
{
|
||||
view_cfg->string,
|
||||
str8_lit("settings"),
|
||||
};
|
||||
for EachElement(idx, schema_names)
|
||||
{
|
||||
MD_NodePtrList schemas = rd_schemas_from_name(schema_names[idx]);
|
||||
for(MD_NodePtrNode *n = schemas.first; n != 0; n = n->next)
|
||||
MD_NodePtrList schemas = rd_schemas_from_name(view_cfg->string);
|
||||
for(MD_NodePtrNode *n = schemas.first; n != 0 && schema == &md_nil_node; n = n->next)
|
||||
{
|
||||
MD_Node *schema = n->v;
|
||||
MD_Node *setting = md_child_from_string(schema, name, 0);
|
||||
MD_Node *default_tag = md_tag_from_string(setting, str8_lit("default"), 0);
|
||||
schema = md_child_from_string(n->v, name, 0);
|
||||
}
|
||||
for(RD_Cfg *cfg = start_cfg; cfg != &rd_nil_cfg && schema == &md_nil_node; cfg = cfg->parent)
|
||||
{
|
||||
MD_NodePtrList schemas = rd_schemas_from_name(cfg->string);
|
||||
for(MD_NodePtrNode *n = schemas.first; n != 0 && schema == &md_nil_node; n = n->next)
|
||||
{
|
||||
schema = md_child_from_string(n->v, name, 0);
|
||||
}
|
||||
}
|
||||
if(schema != &md_nil_node)
|
||||
{
|
||||
MD_Node *default_tag = md_tag_from_string(schema, str8_lit("default"), 0);
|
||||
if(default_tag != &md_nil_node)
|
||||
{
|
||||
result = default_tag->first->string;
|
||||
@@ -1225,7 +1221,6 @@ rd_setting_from_name(String8 name)
|
||||
}
|
||||
}
|
||||
end_default_search:;
|
||||
scratch_end(scratch);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
@@ -2990,6 +2985,19 @@ rd_view_ui(Rng2F32 rect)
|
||||
RD_Cfg *cfg = rd_cfg_from_eval_space(eval.space);
|
||||
rd_cmd(RD_CmdKind_CompleteQuery, .cfg = cfg->id);
|
||||
}break;
|
||||
case RD_EvalSpaceKind_MetaCtrlEntity:
|
||||
{
|
||||
CTRL_Entity *entity = rd_ctrl_entity_from_eval_space(eval.space);
|
||||
RD_RegsScope(.ctrl_entity = entity->handle)
|
||||
{
|
||||
if(0){}
|
||||
else if(entity->kind == CTRL_EntityKind_Thread) { rd_regs()->thread = entity->handle; }
|
||||
else if(entity->kind == CTRL_EntityKind_Module) { rd_regs()->module = entity->handle; }
|
||||
else if(entity->kind == CTRL_EntityKind_Process) { rd_regs()->process = entity->handle; }
|
||||
else if(entity->kind == CTRL_EntityKind_Machine) { rd_regs()->machine = entity->handle; }
|
||||
rd_cmd(RD_CmdKind_CompleteQuery);
|
||||
}
|
||||
}break;
|
||||
case RD_EvalSpaceKind_MetaUnattachedProcess:
|
||||
{
|
||||
U64 pid = eval.value.u128.u64[0];
|
||||
@@ -4725,7 +4733,11 @@ rd_view_ui(Rng2F32 rect)
|
||||
RD_ViewUIRule *view_ui_rule = rd_view_ui_rule_from_string(view_name);
|
||||
E_Eval expr_eval = e_eval_from_string(scratch.arena, expr_string);
|
||||
E_IRTreeAndType *prev_overridden_irtree = e_ir_state->overridden_irtree;
|
||||
e_ir_state->overridden_irtree = expr_eval.irtree.prev;
|
||||
e_ir_state->overridden_irtree = &expr_eval.irtree;
|
||||
for(E_IRTreeAndType *prev = expr_eval.irtree.prev; prev != 0; prev = prev->prev)
|
||||
{
|
||||
e_ir_state->overridden_irtree = prev;
|
||||
}
|
||||
view_ui_rule->ui(expr_eval, rect);
|
||||
e_ir_state->overridden_irtree = prev_overridden_irtree;
|
||||
scratch_end(scratch);
|
||||
@@ -12100,6 +12112,26 @@ rd_frame(void)
|
||||
}
|
||||
}
|
||||
|
||||
//- rjf: add macros for user/project
|
||||
{
|
||||
E_TypeKey type_key = e_string2typekey_map_lookup(rd_state->meta_name2type_map, str8_lit("user"));
|
||||
E_Space space = rd_eval_space_from_cfg(rd_cfg_child_from_string(rd_state->root_cfg, str8_lit("user")));
|
||||
E_Expr *expr = e_push_expr(scratch.arena, E_ExprKind_LeafOffset, 0);
|
||||
expr->space = space;
|
||||
expr->mode = E_Mode_Offset;
|
||||
expr->type_key = type_key;
|
||||
e_string2expr_map_insert(scratch.arena, ctx->macro_map, str8_lit("user_settings"), expr);
|
||||
}
|
||||
{
|
||||
E_TypeKey type_key = e_string2typekey_map_lookup(rd_state->meta_name2type_map, str8_lit("project"));
|
||||
E_Space space = rd_eval_space_from_cfg(rd_cfg_child_from_string(rd_state->root_cfg, str8_lit("project")));
|
||||
E_Expr *expr = e_push_expr(scratch.arena, E_ExprKind_LeafOffset, 0);
|
||||
expr->space = space;
|
||||
expr->mode = E_Mode_Offset;
|
||||
expr->type_key = type_key;
|
||||
e_string2expr_map_insert(scratch.arena, ctx->macro_map, str8_lit("project_settings"), expr);
|
||||
}
|
||||
|
||||
//- rjf: add macros for evallable control entities
|
||||
String8 evallable_ctrl_names[] =
|
||||
{
|
||||
@@ -12479,8 +12511,7 @@ rd_frame(void)
|
||||
{str8_lit("disasm"), 0, 0, 0, 0, 0, {0}, RD_VIEW_UI_FUNCTION_NAME(disasm), EV_EXPAND_RULE_INFO_FUNCTION_NAME(disasm)},
|
||||
{str8_lit("memory"), 0, 0, 0, 0, 0, {0}, RD_VIEW_UI_FUNCTION_NAME(memory), EV_EXPAND_RULE_INFO_FUNCTION_NAME(memory)},
|
||||
{str8_lit("bitmap"), 0, 0, 0, 0, 0, {0}, RD_VIEW_UI_FUNCTION_NAME(bitmap), EV_EXPAND_RULE_INFO_FUNCTION_NAME(bitmap)},
|
||||
{str8_lit("checkbox"), 0, 0, 0, 0, 0, {0}, RD_VIEW_UI_FUNCTION_NAME(checkbox), 0},
|
||||
{str8_lit("color_rgba"), 0, 0, 0, 0, 0, {0}, RD_VIEW_UI_FUNCTION_NAME(color_rgba), EV_EXPAND_RULE_INFO_FUNCTION_NAME(color_rgba)},
|
||||
{str8_lit("color"), 0, 0, 0, 0, 0, {0}, RD_VIEW_UI_FUNCTION_NAME(color), EV_EXPAND_RULE_INFO_FUNCTION_NAME(color)},
|
||||
{str8_lit("geo3d"), 0, 0, 0, 0, 0, {0}, RD_VIEW_UI_FUNCTION_NAME(geo3d), EV_EXPAND_RULE_INFO_FUNCTION_NAME(geo3d)},
|
||||
};
|
||||
|
||||
@@ -12639,7 +12670,19 @@ rd_frame(void)
|
||||
//- rjf: open lister
|
||||
case RD_CmdKind_OpenLister:
|
||||
{
|
||||
String8 expr = push_str8f(scratch.arena, "query:commands, query:$%I64x, query:$%I64x, query:recent_files, query:recent_projects, query:procedures, query:processes, query:threads, query:modules", rd_regs()->view, rd_regs()->window);
|
||||
String8 expr = push_str8f(scratch.arena,
|
||||
"query:commands, "
|
||||
"query:$%I64x, "
|
||||
"query:$%I64x, "
|
||||
"query:recent_files, "
|
||||
"query:recent_projects, "
|
||||
"query:procedures, "
|
||||
"query:processes, "
|
||||
"query:threads, "
|
||||
"query:modules, "
|
||||
"query:user_settings, "
|
||||
"query:project_settings, ",
|
||||
rd_regs()->view, rd_regs()->window);
|
||||
rd_cmd(RD_CmdKind_PushQuery, .expr = expr, .do_implicit_root = 1, .do_lister = 1, .do_big_rows = 1);
|
||||
}break;
|
||||
|
||||
|
||||
+164
-60
@@ -3307,7 +3307,7 @@ RD_VIEW_UI_FUNCTION_DEF(bitmap)
|
||||
//- rjf: image-region canvas interaction
|
||||
//
|
||||
Vec2S32 mouse_bmp = {-1, -1};
|
||||
if(ui_hovering(canvas_sig) && !ui_dragging(canvas_sig))
|
||||
if(ui_hovering(canvas_sig) && !ui_dragging(canvas_sig)) RD_Font(RD_FontSlot_Code)
|
||||
{
|
||||
Vec2F32 mouse_scr = sub_2f32(ui_mouse(), rect.p0);
|
||||
Vec2F32 mouse_cvs = rd_bitmap_canvas_from_screen_pos(view_center_pos, zoom, canvas_rect, mouse_scr);
|
||||
@@ -3380,43 +3380,118 @@ RD_VIEW_UI_FUNCTION_DEF(bitmap)
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: "checkbox"
|
||||
//~ rjf: rgba @view_hook_impl
|
||||
|
||||
RD_VIEW_UI_FUNCTION_DEF(checkbox)
|
||||
typedef struct RD_EvalColor RD_EvalColor;
|
||||
struct RD_EvalColor
|
||||
{
|
||||
E_Eval value_eval = e_value_eval_from_eval(eval);
|
||||
if(ui_clicked(rd_icon_buttonf(value_eval.value.u64 == 0 ? RD_IconKind_CheckHollow : RD_IconKind_CheckFilled, 0, "###check")))
|
||||
{
|
||||
rd_commit_eval_value_string(eval, value_eval.value.u64 == 0 ? str8_lit("1") : str8_lit("0"));
|
||||
}
|
||||
}
|
||||
Vec4F32 rgba;
|
||||
E_Eval rgba_evals[4];
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: color_rgba @view_hook_impl
|
||||
|
||||
internal Vec4F32
|
||||
rd_rgba_from_eval_params(E_Eval eval, MD_Node *params)
|
||||
internal RD_EvalColor
|
||||
rd_eval_color_from_eval(E_Eval eval)
|
||||
{
|
||||
Vec4F32 rgba = {0};
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
|
||||
//- rjf: walk eval's type tree, find all four component evaluations
|
||||
E_Eval component_evals[4] = {0};
|
||||
{
|
||||
E_Eval value_eval = e_value_eval_from_eval(eval);
|
||||
E_TypeKey type_key = eval.irtree.type_key;
|
||||
E_TypeKind type_kind = e_type_kind_from_key(type_key);
|
||||
U64 type_size = e_type_byte_size_from_key(type_key);
|
||||
if(16 <= type_size)
|
||||
typedef struct LeafTask LeafTask;
|
||||
struct LeafTask
|
||||
{
|
||||
e_space_read(eval.space, &rgba, r1u64(eval.value.u64, eval.value.u64 + 16));
|
||||
}
|
||||
else if(4 <= type_size)
|
||||
LeafTask *next;
|
||||
E_Eval eval;
|
||||
};
|
||||
U64 num_components_left = 4;
|
||||
LeafTask start_task = {0, eval};
|
||||
LeafTask *first_task = &start_task;
|
||||
LeafTask *last_task = first_task;
|
||||
for(LeafTask *t = first_task; t != 0 && num_components_left > 0; t = t->next)
|
||||
{
|
||||
U32 hex_val = value_eval.value.u32;
|
||||
rgba = rgba_from_u32(hex_val);
|
||||
E_Type *type = e_type_from_key__cached(e_type_key_unwrap(t->eval.irtree.type_key, E_TypeUnwrapFlag_AllDecorative));
|
||||
switch(type->kind)
|
||||
{
|
||||
default:{}break;
|
||||
|
||||
// rjf: leaf u32 -> take all 4 components
|
||||
case E_TypeKind_U32:
|
||||
{
|
||||
component_evals[0] = e_value_eval_from_eval(e_eval_wrapf(scratch.arena, t->eval, "(float32)(($ & 0xff000000) >> 24) / 255.f"));
|
||||
component_evals[1] = e_value_eval_from_eval(e_eval_wrapf(scratch.arena, t->eval, "(float32)(($ & 0x00ff0000) >> 16) / 255.f"));
|
||||
component_evals[2] = e_value_eval_from_eval(e_eval_wrapf(scratch.arena, t->eval, "(float32)(($ & 0x0000ff00) >> 8) / 255.f"));
|
||||
component_evals[3] = e_value_eval_from_eval(e_eval_wrapf(scratch.arena, t->eval, "(float32)(($ & 0x000000ff) >> 0) / 255.f"));
|
||||
num_components_left -= 4;
|
||||
}break;
|
||||
|
||||
//- rjf: array -> generate tasks for first four elements
|
||||
case E_TypeKind_Array:
|
||||
{
|
||||
component_evals[0] = e_value_eval_from_eval(e_eval_wrapf(scratch.arena, t->eval, "(float32)($[0])"));
|
||||
component_evals[1] = e_value_eval_from_eval(e_eval_wrapf(scratch.arena, t->eval, "(float32)($[1])"));
|
||||
component_evals[2] = e_value_eval_from_eval(e_eval_wrapf(scratch.arena, t->eval, "(float32)($[2])"));
|
||||
component_evals[3] = e_value_eval_from_eval(e_eval_wrapf(scratch.arena, t->eval, "(float32)($[3])"));
|
||||
num_components_left -= 4;
|
||||
}break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return rgba;
|
||||
|
||||
//- rjf: swizzle / extract the component values from the evals, depending on this lens
|
||||
// (the lens implicitly tells us the format)
|
||||
RD_EvalColor result = {0};
|
||||
{
|
||||
E_Type *lens_type = e_type_from_key__cached(eval.irtree.type_key);
|
||||
for(E_Type *t = lens_type; t->kind == E_TypeKind_Lens; t = e_type_from_key__cached(t->direct_type_key))
|
||||
{
|
||||
if(str8_match(t->name, str8_lit("color"), 0))
|
||||
{
|
||||
lens_type = t;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(lens_type->kind == E_TypeKind_Lens)
|
||||
{
|
||||
if(lens_type->count < 1 || str8_match(lens_type->args[0]->string, str8_lit("rgba"), 0))
|
||||
{
|
||||
result.rgba_evals[0] = component_evals[0];
|
||||
result.rgba_evals[1] = component_evals[1];
|
||||
result.rgba_evals[2] = component_evals[2];
|
||||
result.rgba_evals[3] = component_evals[3];
|
||||
}
|
||||
else if(str8_match(lens_type->args[0]->string, str8_lit("argb"), 0))
|
||||
{
|
||||
result.rgba_evals[0] = component_evals[1];
|
||||
result.rgba_evals[1] = component_evals[2];
|
||||
result.rgba_evals[2] = component_evals[3];
|
||||
result.rgba_evals[3] = component_evals[0];
|
||||
}
|
||||
else if(str8_match(lens_type->args[0]->string, str8_lit("bgra"), 0))
|
||||
{
|
||||
result.rgba_evals[0] = component_evals[2];
|
||||
result.rgba_evals[1] = component_evals[1];
|
||||
result.rgba_evals[2] = component_evals[0];
|
||||
result.rgba_evals[3] = component_evals[3];
|
||||
}
|
||||
else if(str8_match(lens_type->args[0]->string, str8_lit("abgr"), 0))
|
||||
{
|
||||
result.rgba_evals[0] = component_evals[3];
|
||||
result.rgba_evals[1] = component_evals[2];
|
||||
result.rgba_evals[2] = component_evals[1];
|
||||
result.rgba_evals[3] = component_evals[0];
|
||||
}
|
||||
for EachIndex(idx, 4)
|
||||
{
|
||||
result.rgba.v[idx] = e_value_eval_from_eval(result.rgba_evals[idx]).value.f32;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
scratch_end(scratch);
|
||||
return result;
|
||||
}
|
||||
|
||||
EV_EXPAND_RULE_INFO_FUNCTION_DEF(color_rgba)
|
||||
EV_EXPAND_RULE_INFO_FUNCTION_DEF(color)
|
||||
{
|
||||
EV_ExpandInfo info = {0};
|
||||
info.row_count = 8;
|
||||
@@ -3424,16 +3499,26 @@ EV_EXPAND_RULE_INFO_FUNCTION_DEF(color_rgba)
|
||||
return info;
|
||||
}
|
||||
|
||||
RD_VIEW_UI_FUNCTION_DEF(color_rgba)
|
||||
RD_VIEW_UI_FUNCTION_DEF(color)
|
||||
{
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
Vec2F32 dim = dim_2f32(rect);
|
||||
F32 padding = ui_top_font_size()*3.f;
|
||||
Vec4F32 rgba = {0}; // TODO(rjf): @cfg rd_rgba_from_eval_params(eval, params);
|
||||
F32 sv_dim_px = Min(dim.x, dim.y);
|
||||
if(sv_dim_px == dim.x)
|
||||
{
|
||||
padding = ui_top_font_size()*30.f;
|
||||
}
|
||||
sv_dim_px -= padding*2.f;
|
||||
sv_dim_px = Min(sv_dim_px, ui_top_font_size()*70.f);
|
||||
RD_EvalColor eval_color = rd_eval_color_from_eval(eval);
|
||||
Vec4F32 rgba = eval_color.rgba;
|
||||
Vec4F32 hsva = hsva_from_rgba(rgba);
|
||||
|
||||
//////////////////////////////
|
||||
//- rjf: too small -> just show components
|
||||
if(dim.y <= ui_top_font_size()*8.f)
|
||||
//
|
||||
if(dim.y <= ui_top_font_size()*12.f)
|
||||
{
|
||||
//- rjf: build text box
|
||||
UI_Box *text_box = &ui_nil_box;
|
||||
@@ -3444,11 +3529,11 @@ RD_VIEW_UI_FUNCTION_DEF(color_rgba)
|
||||
{
|
||||
DR_FStrParams params = {ui_top_font(), ui_top_text_raster_flags(), ui_color_from_name(str8_lit("text")), ui_top_font_size()};
|
||||
dr_fstrs_push_new(scratch.arena, &fstrs, ¶ms, str8_lit("("));
|
||||
dr_fstrs_push_new(scratch.arena, &fstrs, ¶ms, push_str8f(scratch.arena, "%.2f", rgba.x), .color = v4f32(1.f, 0.25f, 0.25f, 1.f), .underline_thickness = 4.f);
|
||||
dr_fstrs_push_new(scratch.arena, &fstrs, ¶ms, push_str8f(scratch.arena, "%.2f", rgba.x), .color = linear_from_srgba(v4f32(1.f, 0.25f, 0.25f, 1.f)), .underline_thickness = 4.f);
|
||||
dr_fstrs_push_new(scratch.arena, &fstrs, ¶ms, str8_lit(", "));
|
||||
dr_fstrs_push_new(scratch.arena, &fstrs, ¶ms, push_str8f(scratch.arena, "%.2f", rgba.y), .color = v4f32(0.25f, 1.f, 0.25f, 1.f), .underline_thickness = 4.f);
|
||||
dr_fstrs_push_new(scratch.arena, &fstrs, ¶ms, push_str8f(scratch.arena, "%.2f", rgba.y), .color = linear_from_srgba(v4f32(0.25f, 1.f, 0.25f, 1.f)), .underline_thickness = 4.f);
|
||||
dr_fstrs_push_new(scratch.arena, &fstrs, ¶ms, str8_lit(", "));
|
||||
dr_fstrs_push_new(scratch.arena, &fstrs, ¶ms, push_str8f(scratch.arena, "%.2f", rgba.z), .color = v4f32(0.25f, 0.25f, 1.f, 1.f), .underline_thickness = 4.f);
|
||||
dr_fstrs_push_new(scratch.arena, &fstrs, ¶ms, push_str8f(scratch.arena, "%.2f", rgba.z), .color = linear_from_srgba(v4f32(0.25f, 0.25f, 1.f, 1.f)), .underline_thickness = 4.f);
|
||||
dr_fstrs_push_new(scratch.arena, &fstrs, ¶ms, str8_lit(", "));
|
||||
dr_fstrs_push_new(scratch.arena, &fstrs, ¶ms, push_str8f(scratch.arena, "%.2f", rgba.w), .color = v4f32(1.f, 1.f, 1.f, 1.f), .underline_thickness = 4.f);
|
||||
dr_fstrs_push_new(scratch.arena, &fstrs, ¶ms, str8_lit(")"));
|
||||
@@ -3479,45 +3564,64 @@ RD_VIEW_UI_FUNCTION_DEF(color_rgba)
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////
|
||||
//- rjf: large enough -> full color picker
|
||||
//
|
||||
else
|
||||
{
|
||||
UI_WidthFill UI_HeightFill UI_Column UI_Padding(ui_px(padding, 1.f)) UI_Row UI_Padding(ui_pct(1.f, 0.f)) UI_HeightFill
|
||||
UI_WidthFill UI_HeightFill
|
||||
UI_PrefHeight(ui_children_sum(1)) UI_Column UI_Padding(ui_pct(1.f, 0.f))
|
||||
UI_PrefHeight(ui_children_sum(1)) UI_Row UI_Padding(ui_pct(1.f, 0.f))
|
||||
UI_PrefWidth(ui_px(sv_dim_px, 1.f))
|
||||
UI_PrefHeight(ui_px(sv_dim_px, 1.f))
|
||||
RD_Font(RD_FontSlot_Code)
|
||||
{
|
||||
UI_PrefWidth(ui_px(dim.y - padding*2, 1.f))
|
||||
{
|
||||
UI_Signal sv_sig = ui_sat_val_pickerf(hsva.x, &hsva.y, &hsva.z, "sat_val_picker");
|
||||
}
|
||||
UI_Signal sv_sig = ui_sat_val_pickerf(hsva.x, &hsva.y, &hsva.z, "sat_val_picker");
|
||||
ui_spacer(ui_em(1.f, 1.f));
|
||||
UI_PrefWidth(ui_em(3.f, 1.f))
|
||||
{
|
||||
UI_Signal h_sig = ui_hue_pickerf(&hsva.x, hsva.y, hsva.z, "hue_picker");
|
||||
}
|
||||
UI_PrefWidth(ui_children_sum(1)) UI_Column UI_PrefWidth(ui_text_dim(10, 1)) UI_PrefHeight(ui_em(2.f, 0.f)) RD_Font(RD_FontSlot_Code)
|
||||
UI_TagF("weak")
|
||||
ui_spacer(ui_em(1.f, 1.f));
|
||||
UI_PrefWidth(ui_children_sum(1)) UI_Column
|
||||
{
|
||||
ui_labelf("Hex");
|
||||
ui_labelf("R");
|
||||
ui_labelf("G");
|
||||
ui_labelf("B");
|
||||
ui_labelf("H");
|
||||
ui_labelf("S");
|
||||
ui_labelf("V");
|
||||
ui_labelf("A");
|
||||
}
|
||||
UI_PrefWidth(ui_children_sum(1)) UI_Column UI_PrefWidth(ui_text_dim(10, 1)) UI_PrefHeight(ui_em(2.f, 0.f)) RD_Font(RD_FontSlot_Code)
|
||||
{
|
||||
String8 hex_string = hex_string_from_rgba_4f32(scratch.arena, rgba);
|
||||
ui_label(hex_string);
|
||||
ui_labelf("%.2f", rgba.x);
|
||||
ui_labelf("%.2f", rgba.y);
|
||||
ui_labelf("%.2f", rgba.z);
|
||||
ui_labelf("%.2f", hsva.x);
|
||||
ui_labelf("%.2f", hsva.y);
|
||||
ui_labelf("%.2f", hsva.z);
|
||||
ui_labelf("%.2f", rgba.w);
|
||||
UI_PrefWidth(ui_em(6.f, 0.f)) UI_PrefHeight(ui_em(6.f, 0.f))
|
||||
UI_BackgroundColor(linear_from_srgba(v4f32(rgba.x, rgba.y, rgba.z, 1.f)))
|
||||
UI_CornerRadius(4.f)
|
||||
UI_PrefWidth(ui_em(6.f, 1.f)) UI_PrefHeight(ui_em(6.f, 1.f))
|
||||
ui_build_box_from_string(UI_BoxFlag_DrawBorder|UI_BoxFlag_DrawBackground, str8_lit(""));
|
||||
ui_spacer(ui_em(2.f, 1.f));
|
||||
UI_PrefWidth(ui_children_sum(1)) UI_PrefHeight(ui_children_sum(1)) UI_Row
|
||||
{
|
||||
UI_PrefWidth(ui_children_sum(1)) UI_Column UI_PrefWidth(ui_text_dim(10, 1)) UI_PrefHeight(ui_em(2.f, 0.f)) RD_Font(RD_FontSlot_Code)
|
||||
UI_TagF("weak")
|
||||
{
|
||||
ui_labelf("Hex");
|
||||
ui_labelf("R");
|
||||
ui_labelf("G");
|
||||
ui_labelf("B");
|
||||
ui_labelf("H");
|
||||
ui_labelf("S");
|
||||
ui_labelf("V");
|
||||
ui_labelf("A");
|
||||
}
|
||||
UI_PrefWidth(ui_children_sum(1)) UI_Column UI_PrefWidth(ui_text_dim(10, 1)) UI_PrefHeight(ui_em(2.f, 0.f)) RD_Font(RD_FontSlot_Code)
|
||||
{
|
||||
String8 hex_string = hex_string_from_rgba_4f32(scratch.arena, rgba);
|
||||
ui_label(hex_string);
|
||||
ui_labelf("%.2f", rgba.x);
|
||||
ui_labelf("%.2f", rgba.y);
|
||||
ui_labelf("%.2f", rgba.z);
|
||||
ui_labelf("%.2f", hsva.x);
|
||||
ui_labelf("%.2f", hsva.y);
|
||||
ui_labelf("%.2f", hsva.z);
|
||||
ui_labelf("%.2f", rgba.w);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
scratch_end(scratch);
|
||||
}
|
||||
|
||||
|
||||
@@ -245,15 +245,14 @@ EV_EXPAND_RULE_INFO_FUNCTION_DEF(text);
|
||||
EV_EXPAND_RULE_INFO_FUNCTION_DEF(disasm);
|
||||
EV_EXPAND_RULE_INFO_FUNCTION_DEF(memory);
|
||||
EV_EXPAND_RULE_INFO_FUNCTION_DEF(bitmap);
|
||||
EV_EXPAND_RULE_INFO_FUNCTION_DEF(color_rgba);
|
||||
EV_EXPAND_RULE_INFO_FUNCTION_DEF(color);
|
||||
EV_EXPAND_RULE_INFO_FUNCTION_DEF(geo3d);
|
||||
|
||||
RD_VIEW_UI_FUNCTION_DEF(text);
|
||||
RD_VIEW_UI_FUNCTION_DEF(disasm);
|
||||
RD_VIEW_UI_FUNCTION_DEF(memory);
|
||||
RD_VIEW_UI_FUNCTION_DEF(bitmap);
|
||||
RD_VIEW_UI_FUNCTION_DEF(checkbox);
|
||||
RD_VIEW_UI_FUNCTION_DEF(color_rgba);
|
||||
RD_VIEW_UI_FUNCTION_DEF(color);
|
||||
RD_VIEW_UI_FUNCTION_DEF(geo3d);
|
||||
|
||||
#endif // RADDBG_VIEWS_H
|
||||
|
||||
@@ -129,6 +129,23 @@ rd_title_fstrs_from_cfg(Arena *arena, RD_Cfg *cfg)
|
||||
}
|
||||
}
|
||||
|
||||
//- rjf: push bucket name
|
||||
if(cfg->parent == rd_state->root_cfg)
|
||||
{
|
||||
if(str8_match(cfg->string, str8_lit("user"), 0))
|
||||
{
|
||||
dr_fstrs_push_new(arena, &result, ¶ms, str8_lit("User"), .font = rd_font_from_slot(RD_FontSlot_Main), .raster_flags = rd_raster_flags_from_slot(RD_FontSlot_Main));
|
||||
dr_fstrs_push_new(arena, &result, ¶ms, str8_lit(" "));
|
||||
start_secondary();
|
||||
}
|
||||
else if(str8_match(cfg->string, str8_lit("project"), 0))
|
||||
{
|
||||
dr_fstrs_push_new(arena, &result, ¶ms, str8_lit("Project"), .font = rd_font_from_slot(RD_FontSlot_Main), .raster_flags = rd_raster_flags_from_slot(RD_FontSlot_Main));
|
||||
dr_fstrs_push_new(arena, &result, ¶ms, str8_lit(" "));
|
||||
start_secondary();
|
||||
}
|
||||
}
|
||||
|
||||
//- rjf: push label
|
||||
if(label_string.size != 0)
|
||||
{
|
||||
|
||||
@@ -479,7 +479,7 @@ ui_do_color_tooltip_hsv(Vec3F32 hsv)
|
||||
{
|
||||
UI_PrefWidth(ui_em(22.f, 1.f)) UI_PrefHeight(ui_em(6.f, 1.f)) UI_Row UI_Padding(ui_pct(1, 0))
|
||||
{
|
||||
UI_BackgroundColor(v4f32(rgb.x, rgb.y, rgb.z, 1.f))
|
||||
UI_BackgroundColor(linear_from_srgba(v4f32(rgb.x, rgb.y, rgb.z, 1.f)))
|
||||
UI_CornerRadius(4.f)
|
||||
UI_PrefWidth(ui_em(6.f, 1.f)) UI_PrefHeight(ui_em(6.f, 1.f))
|
||||
ui_build_box_from_string(UI_BoxFlag_DrawBorder|UI_BoxFlag_DrawBackground, str8_lit(""));
|
||||
@@ -518,7 +518,7 @@ ui_do_color_tooltip_hsva(Vec4F32 hsva)
|
||||
{
|
||||
UI_PrefWidth(ui_em(22.f, 1.f)) UI_PrefHeight(ui_em(6.f, 1.f)) UI_Row UI_Padding(ui_pct(1, 0))
|
||||
{
|
||||
UI_BackgroundColor(rgba)
|
||||
UI_BackgroundColor(linear_from_srgba(rgba))
|
||||
UI_CornerRadius(4.f)
|
||||
UI_PrefWidth(ui_em(6.f, 1.f)) UI_PrefHeight(ui_em(6.f, 1.f))
|
||||
ui_build_box_from_string(UI_BoxFlag_DrawBorder|UI_BoxFlag_DrawBackground, str8_lit(""));
|
||||
|
||||
Reference in New Issue
Block a user