mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-06-19 02:22:23 -07:00
more eval type operators for metadata decorations; fix target environment string list evaluation / edits
This commit is contained in:
@@ -75,6 +75,8 @@ E_TypeKindTable:
|
||||
{Lens "lens" 0 }
|
||||
{LensSpec "lens_spec" 0 }
|
||||
{MetaExpr "meta_expr" 0 }
|
||||
{MetaDisplayName "meta_display_name" 0 }
|
||||
{MetaDescription "meta_description" 0 }
|
||||
}
|
||||
|
||||
@table(name op_kind precedence op_pre op_sep op_pos op_chain)
|
||||
|
||||
@@ -492,6 +492,27 @@ e_type_key_cons_ptr(Arch arch, E_TypeKey element_type_key, U64 count, E_TypeFlag
|
||||
return key;
|
||||
}
|
||||
|
||||
internal E_TypeKey
|
||||
e_type_key_cons_meta_expr(E_TypeKey type_key, String8 expr)
|
||||
{
|
||||
E_TypeKey key = e_type_key_cons(.kind = E_TypeKind_MetaExpr, .direct_key = type_key, .name = expr);
|
||||
return key;
|
||||
}
|
||||
|
||||
internal E_TypeKey
|
||||
e_type_key_cons_meta_display_name(E_TypeKey type_key, String8 name)
|
||||
{
|
||||
E_TypeKey key = e_type_key_cons(.kind = E_TypeKind_MetaDisplayName, .direct_key = type_key, .name = name);
|
||||
return key;
|
||||
}
|
||||
|
||||
internal E_TypeKey
|
||||
e_type_key_cons_meta_description(E_TypeKey type_key, String8 desc)
|
||||
{
|
||||
E_TypeKey key = e_type_key_cons(.kind = E_TypeKind_MetaDescription, .direct_key = type_key, .name = desc);
|
||||
return key;
|
||||
}
|
||||
|
||||
internal E_TypeKey
|
||||
e_type_key_cons_base(Type *type)
|
||||
{
|
||||
@@ -1492,6 +1513,8 @@ e_type_key_unwrap(E_TypeKey key, E_TypeUnwrapFlags flags)
|
||||
default:{done = 1;}break;
|
||||
case E_TypeKind_Modifier: {done = !(flags & E_TypeUnwrapFlag_Modifiers);}break;
|
||||
case E_TypeKind_Lens: {done = !(flags & E_TypeUnwrapFlag_Lenses);}break;
|
||||
case E_TypeKind_MetaDisplayName:
|
||||
case E_TypeKind_MetaDescription:
|
||||
case E_TypeKind_MetaExpr: {done = !(flags & E_TypeUnwrapFlag_Meta);}break;
|
||||
case E_TypeKind_Enum: {done = !(flags & E_TypeUnwrapFlag_Enums);}break;
|
||||
case E_TypeKind_Alias: {done = !(flags & E_TypeUnwrapFlag_Aliases);}break;
|
||||
|
||||
@@ -254,6 +254,9 @@ internal E_TypeKey e_type_key_cons_(E_ConsTypeParams *params);
|
||||
//- rjf: constructed type construction helpers
|
||||
internal E_TypeKey e_type_key_cons_array(E_TypeKey element_type_key, U64 count, E_TypeFlags flags);
|
||||
internal E_TypeKey e_type_key_cons_ptr(Arch arch, E_TypeKey element_type_key, U64 count, E_TypeFlags flags);
|
||||
internal E_TypeKey e_type_key_cons_meta_expr(E_TypeKey type_key, String8 expr);
|
||||
internal E_TypeKey e_type_key_cons_meta_display_name(E_TypeKey type_key, String8 name);
|
||||
internal E_TypeKey e_type_key_cons_meta_description(E_TypeKey type_key, String8 desc);
|
||||
internal E_TypeKey e_type_key_cons_base(Type *type);
|
||||
internal E_TypeKey e_type_key_file(void);
|
||||
internal E_TypeKey e_type_key_folder(void);
|
||||
|
||||
@@ -14,7 +14,7 @@ str8_lit_comp("CharLiteral"),
|
||||
str8_lit_comp("Symbol"),
|
||||
};
|
||||
|
||||
String8 e_type_kind_basic_string_table[59] =
|
||||
String8 e_type_kind_basic_string_table[61] =
|
||||
{
|
||||
str8_lit_comp(""),
|
||||
str8_lit_comp("void"),
|
||||
@@ -75,9 +75,11 @@ str8_lit_comp("set"),
|
||||
str8_lit_comp("lens"),
|
||||
str8_lit_comp("lens_spec"),
|
||||
str8_lit_comp("meta_expr"),
|
||||
str8_lit_comp("meta_display_name"),
|
||||
str8_lit_comp("meta_description"),
|
||||
};
|
||||
|
||||
U8 e_type_kind_basic_byte_size_table[59] =
|
||||
U8 e_type_kind_basic_byte_size_table[61] =
|
||||
{
|
||||
0,
|
||||
0,
|
||||
@@ -138,6 +140,8 @@ U8 e_type_kind_basic_byte_size_table[59] =
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
};
|
||||
|
||||
String8 e_expr_kind_strings[48] =
|
||||
|
||||
@@ -78,6 +78,8 @@ E_TypeKind_Set,
|
||||
E_TypeKind_Lens,
|
||||
E_TypeKind_LensSpec,
|
||||
E_TypeKind_MetaExpr,
|
||||
E_TypeKind_MetaDisplayName,
|
||||
E_TypeKind_MetaDescription,
|
||||
E_TypeKind_COUNT,
|
||||
E_TypeKind_FirstBasic = E_TypeKind_Void,
|
||||
E_TypeKind_LastBasic = E_TypeKind_ComplexF128,
|
||||
@@ -163,8 +165,8 @@ E_InterpretationCode_COUNT,
|
||||
|
||||
C_LINKAGE_BEGIN
|
||||
extern String8 e_token_kind_strings[6];
|
||||
extern String8 e_type_kind_basic_string_table[59];
|
||||
extern U8 e_type_kind_basic_byte_size_table[59];
|
||||
extern String8 e_type_kind_basic_string_table[61];
|
||||
extern U8 e_type_kind_basic_byte_size_table[61];
|
||||
extern String8 e_expr_kind_strings[48];
|
||||
extern E_OpInfo e_expr_kind_op_info_table[48];
|
||||
extern String8 e_interpretation_code_display_strings[11];
|
||||
|
||||
@@ -332,8 +332,8 @@ RD_VocabInfo rd_vocab_info_table[321] =
|
||||
RD_NameSchemaInfo rd_name_schema_info_table[20] =
|
||||
{
|
||||
{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}\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) 'thread_lines': bool,\n @default(1) 'thread_glow': bool,\n @default(1) 'breakpoint_lines': bool,\n @default(1) 'breakpoint_glow': bool,\n\n //- rjf: occluding background settings\n @default(0) 'opaque_backgrounds': bool,\n @default(1) 'background_blur': bool,\n\n //- rjf: text rasterization settings\n @default(1) 'smooth_ui_text': bool,\n @default(1) 'hint_ui_text': bool,\n @default(0) 'smooth_code_text': bool,\n @default(1) 'hint_code_text': bool,\n @default(11) 'font_size': @range[6, 72] u64,\n}\n")},
|
||||
{str8_lit_comp("tab"), str8_lit_comp("x:\n{\n @default(11) 'font_size': @range[6, 72] 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) 'thread_lines': bool,\n @default(1) 'thread_glow': bool,\n @default(1) 'breakpoint_lines': bool,\n @default(1) 'breakpoint_glow': bool,\n\n //- rjf: occluding background settings\n @default(0) 'opaque_backgrounds': bool,\n @default(1) 'background_blur': bool,\n\n //- rjf: text rasterization settings\n @default(1) 'smooth_ui_text': bool,\n @default(1) 'hint_ui_text': bool,\n @default(0) 'smooth_code_text': bool,\n @default(1) 'hint_code_text': bool,\n @default(11) @display_name('Window Font Size') 'font_size': @range[6, 72] u64,\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")},
|
||||
{str8_lit_comp("text"), str8_lit_comp("@inherit(tab) x:\n{\n 'lang':lang,\n 'size':code_string,\n @default(1) 'show_line_numbers':bool,\n}\n")},
|
||||
{str8_lit_comp("disasm"), str8_lit_comp("@inherit(tab) x:\n{\n 'arch': arch,\n 'syntax': dasm_syntax,\n 'size': code_string,\n @default(1) 'show_addresses': bool,\n @default(0) 'show_code_bytes': bool,\n @default(1) 'show_source_lines': bool,\n @default(1) 'show_symbol_names': bool,\n @default(1) 'show_line_numbers': bool,\n}\n")},
|
||||
@@ -353,7 +353,7 @@ RD_NameSchemaInfo rd_name_schema_info_table[20] =
|
||||
{str8_lit_comp("thread"), str8_lit_comp("x:{'label':code_string, 'id':u64, @no_expand 'active':bool, 'call_stack':query}")},
|
||||
};
|
||||
|
||||
Rng1U64 rd_reg_slot_range_table[40] =
|
||||
Rng1U64 rd_reg_slot_range_table[41] =
|
||||
{
|
||||
{0},
|
||||
{OffsetOf(RD_Regs, machine), OffsetOf(RD_Regs, machine) + sizeof(CTRL_Handle)},
|
||||
@@ -390,6 +390,7 @@ Rng1U64 rd_reg_slot_range_table[40] =
|
||||
{OffsetOf(RD_Regs, prefer_disasm), OffsetOf(RD_Regs, prefer_disasm) + sizeof(B32)},
|
||||
{OffsetOf(RD_Regs, no_rich_tooltip), OffsetOf(RD_Regs, no_rich_tooltip) + sizeof(B32)},
|
||||
{OffsetOf(RD_Regs, do_implicit_root), OffsetOf(RD_Regs, do_implicit_root) + sizeof(B32)},
|
||||
{OffsetOf(RD_Regs, do_lister), OffsetOf(RD_Regs, do_lister) + sizeof(B32)},
|
||||
{OffsetOf(RD_Regs, dir2), OffsetOf(RD_Regs, dir2) + sizeof(Dir2)},
|
||||
{OffsetOf(RD_Regs, string), OffsetOf(RD_Regs, string) + sizeof(String8)},
|
||||
{OffsetOf(RD_Regs, cmd_name), OffsetOf(RD_Regs, cmd_name) + sizeof(String8)},
|
||||
|
||||
@@ -43,6 +43,7 @@ RD_RegSlot_ForceConfirm,
|
||||
RD_RegSlot_PreferDisasm,
|
||||
RD_RegSlot_NoRichTooltip,
|
||||
RD_RegSlot_DoImplicitRoot,
|
||||
RD_RegSlot_DoLister,
|
||||
RD_RegSlot_Dir2,
|
||||
RD_RegSlot_String,
|
||||
RD_RegSlot_CmdName,
|
||||
@@ -567,6 +568,7 @@ B32 force_confirm;
|
||||
B32 prefer_disasm;
|
||||
B32 no_rich_tooltip;
|
||||
B32 do_implicit_root;
|
||||
B32 do_lister;
|
||||
Dir2 dir2;
|
||||
String8 string;
|
||||
String8 cmd_name;
|
||||
@@ -630,6 +632,7 @@ RD_Query query;
|
||||
.prefer_disasm = rd_regs()->prefer_disasm,\
|
||||
.no_rich_tooltip = rd_regs()->no_rich_tooltip,\
|
||||
.do_implicit_root = rd_regs()->do_implicit_root,\
|
||||
.do_lister = rd_regs()->do_lister,\
|
||||
.dir2 = rd_regs()->dir2,\
|
||||
.string = rd_regs()->string,\
|
||||
.cmd_name = rd_regs()->cmd_name,\
|
||||
@@ -639,7 +642,7 @@ RD_Query query;
|
||||
C_LINKAGE_BEGIN
|
||||
extern RD_VocabInfo rd_vocab_info_table[321];
|
||||
extern RD_NameSchemaInfo rd_name_schema_info_table[20];
|
||||
extern Rng1U64 rd_reg_slot_range_table[40];
|
||||
extern Rng1U64 rd_reg_slot_range_table[41];
|
||||
extern String8 rd_binding_version_remap_old_name_table[8];
|
||||
extern String8 rd_binding_version_remap_new_name_table[8];
|
||||
extern String8 rd_icon_kind_text_table[74];
|
||||
|
||||
@@ -206,7 +206,7 @@ RD_VocabTable:
|
||||
@default(1) 'hint_ui_text': bool,
|
||||
@default(0) 'smooth_code_text': bool,
|
||||
@default(1) 'hint_code_text': bool,
|
||||
@default(11) 'font_size': @range[6, 72] u64,
|
||||
@default(11) @display_name('Window Font Size') 'font_size': @range[6, 72] u64,
|
||||
}
|
||||
```
|
||||
}
|
||||
@@ -217,7 +217,7 @@ RD_VocabTable:
|
||||
```
|
||||
x:
|
||||
{
|
||||
@default(11) 'font_size': @range[6, 72] u64,
|
||||
@default(11) @display_name('Tab Font Size') 'font_size': @range[6, 72] u64,
|
||||
}
|
||||
```
|
||||
}
|
||||
@@ -461,6 +461,7 @@ RD_RegTable:
|
||||
{B32 prefer_disasm PreferDisasm }
|
||||
{B32 no_rich_tooltip NoRichTooltip }
|
||||
{B32 do_implicit_root DoImplicitRoot}
|
||||
{B32 do_lister DoLister }
|
||||
{Dir2 dir2 Dir2 }
|
||||
{String8 string String }
|
||||
{String8 cmd_name CmdName }
|
||||
|
||||
+81
-48
@@ -1666,6 +1666,12 @@ rd_eval_space_read(void *u, E_Space space, void *out, Rng1U64 range)
|
||||
}
|
||||
}
|
||||
|
||||
// rjf: if no child key? -> just read from this cfg's child string - first 8 bytes -> offset of string (just 8), then string's content
|
||||
if(child_key.size == 0)
|
||||
{
|
||||
read_data = cfg->first->string;
|
||||
}
|
||||
|
||||
// rjf: perform read
|
||||
Rng1U64 legal_range = r1u64(0, read_data.size);
|
||||
Rng1U64 read_range = intersect_1u64(range, legal_range);
|
||||
@@ -1779,17 +1785,27 @@ rd_eval_space_write(void *u, E_Space space, void *in, Rng1U64 range)
|
||||
RD_Cfg *root_cfg = rd_cfg_from_eval_space(space);
|
||||
String8 child_key = e_string_from_id(space.u64s[1]);
|
||||
|
||||
// rjf: zero-range? delete child
|
||||
if(range.min == range.max)
|
||||
// rjf: no child key? -> overwrite child string
|
||||
if(child_key.size == 0)
|
||||
{
|
||||
rd_cfg_release(rd_cfg_child_from_string(root_cfg, child_key));
|
||||
rd_cfg_new_replace(root_cfg, write_string);
|
||||
}
|
||||
|
||||
// rjf: non-zero-range? create child if needed & write value
|
||||
// rjf: child key -> look up & edit child
|
||||
else
|
||||
{
|
||||
RD_Cfg *child_cfg = rd_cfg_child_from_string_or_alloc(root_cfg, child_key);
|
||||
rd_cfg_new_replace(child_cfg, write_string);
|
||||
// rjf: zero-range? delete child
|
||||
if(range.min == range.max)
|
||||
{
|
||||
rd_cfg_release(rd_cfg_child_from_string(root_cfg, child_key));
|
||||
}
|
||||
|
||||
// rjf: non-zero-range? create child if needed & write value
|
||||
else
|
||||
{
|
||||
RD_Cfg *child_cfg = rd_cfg_child_from_string_or_alloc(root_cfg, child_key);
|
||||
rd_cfg_new_replace(child_cfg, write_string);
|
||||
}
|
||||
}
|
||||
}break;
|
||||
|
||||
@@ -2661,7 +2677,7 @@ rd_view_ui(Rng2F32 rect)
|
||||
// the "collection of all watches", to build a watch window. but this behavior is not
|
||||
// as desirable if we are just using some other expression as the root.
|
||||
//
|
||||
B32 implicit_root = !rd_view_cfg_value_from_string(str8_lit("explicit_root")).u64;
|
||||
B32 implicit_root = (rd_cfg_child_from_string(rd_cfg_from_id(rd_regs()->view), str8_lit("explicit_root")) == &rd_nil_cfg);
|
||||
|
||||
//////////////////////////////
|
||||
//- rjf: determine autocompletion string
|
||||
@@ -4287,7 +4303,7 @@ rd_view_ui(Rng2F32 rect)
|
||||
{
|
||||
// rjf: set up base parameters
|
||||
cell_params.flags = (RD_CellFlag_KeyboardClickable|RD_CellFlag_NoBackground|RD_CellFlag_CodeContents);
|
||||
cell_params.depth = (cell_x == 0 ? row_depth : 0);
|
||||
cell_params.depth = (cell->flags & RD_WatchCellFlag_Indented ? row_depth : 0);
|
||||
cell_params.cursor = &cell_edit_state->cursor;
|
||||
cell_params.mark = &cell_edit_state->mark;
|
||||
cell_params.edit_buffer = cell_edit_state->input_buffer;
|
||||
@@ -4454,7 +4470,7 @@ rd_view_ui(Rng2F32 rect)
|
||||
ui_kill_action();
|
||||
}
|
||||
|
||||
// rjf: this watch window is being queried? -> move curosr & accept
|
||||
// rjf: this watch window is a lister? -> move cursor & accept
|
||||
RD_Cfg *lister = rd_cfg_child_from_string(view, str8_lit("lister"));
|
||||
if(lister != &rd_nil_cfg)
|
||||
{
|
||||
@@ -4676,7 +4692,7 @@ rd_view_ui(Rng2F32 rect)
|
||||
//
|
||||
if(vs->query_is_selected) UI_Focus(UI_FocusKind_On)
|
||||
{
|
||||
if(ui_is_focus_active() && rd_cfg_child_from_string(view, str8_lit("lister")) == &rd_nil_cfg && ui_slot_press(UI_EventActionSlot_Cancel))
|
||||
if(ui_is_focus_active() && ui_slot_press(UI_EventActionSlot_Cancel))
|
||||
{
|
||||
vs->query_is_selected = 0;
|
||||
vs->query_string_size = 0;
|
||||
@@ -6307,6 +6323,7 @@ rd_window_frame(void)
|
||||
String8 expr;
|
||||
B32 is_focused;
|
||||
B32 is_anchored;
|
||||
B32 reset_open;
|
||||
UI_Signal signal; // NOTE(rjf): output, from build
|
||||
B32 pressed;
|
||||
B32 pressed_outside;
|
||||
@@ -6487,8 +6504,25 @@ rd_window_frame(void)
|
||||
//- rjf: try to add opened query
|
||||
if(query_is_open)
|
||||
{
|
||||
// rjf: unpack view for query
|
||||
RD_Cfg *root = rd_immediate_cfg_from_keyf("window_query_%p", window);
|
||||
RD_Cfg *view = rd_cfg_child_from_string_or_alloc(root, str8_lit("watch"));
|
||||
RD_Cfg *query = rd_cfg_child_from_string_or_alloc(view, str8_lit("query"));
|
||||
RD_Cfg *cmd = rd_cfg_child_from_string(query, str8_lit("cmd"));
|
||||
B32 is_lister = (rd_cfg_child_from_string(view, str8_lit("lister")) != &rd_nil_cfg);
|
||||
B32 root_is_explicit = (rd_cfg_child_from_string(view, str8_lit("explicit_root")) != &rd_nil_cfg);
|
||||
RD_ViewState *vs = rd_view_state_from_cfg(view);
|
||||
|
||||
// rjf: did this view ID change? -> reset open animation
|
||||
B32 reset_open = 0;
|
||||
if(view->id != ws->query_last_view_id)
|
||||
{
|
||||
ws->query_last_view_id = view->id;
|
||||
reset_open = 1;
|
||||
}
|
||||
|
||||
// rjf: unpack query info
|
||||
String8 cmd_name = ws->query_regs->cmd_name;
|
||||
String8 cmd_name = cmd->first->string;
|
||||
RD_CmdKindInfo *cmd_kind_info = rd_cmd_kind_info_from_string(cmd_name);
|
||||
String8 query_expr = ws->query_regs->expr;
|
||||
if(cmd_name.size != 0)
|
||||
@@ -6496,26 +6530,8 @@ rd_window_frame(void)
|
||||
query_expr = cmd_kind_info->query.expr;
|
||||
}
|
||||
B32 query_is_anchored = (!ui_box_is_nil(ui_box_from_key(ws->query_regs->ui_key)));
|
||||
B32 query_is_lister = (cmd_name.size != 0);
|
||||
B32 size_query_by_expr_eval = (query_is_anchored || query_expr.size == 0);
|
||||
|
||||
// rjf: build view for query
|
||||
RD_Cfg *root = rd_immediate_cfg_from_keyf("window_query_%p", window);
|
||||
RD_Cfg *view = rd_cfg_child_from_string_or_alloc(root, str8_lit("watch"));
|
||||
RD_Cfg *query = rd_cfg_child_from_string_or_alloc(view, str8_lit("query"));
|
||||
RD_Cfg *cmd = rd_cfg_child_from_string_or_alloc(query, str8_lit("cmd"));
|
||||
rd_cfg_new_replace(cmd, cmd_name);
|
||||
RD_ViewState *vs = rd_view_state_from_cfg(view);
|
||||
if(query_is_lister)
|
||||
{
|
||||
rd_cfg_child_from_string_or_alloc(view, str8_lit("lister"));
|
||||
vs->query_is_selected = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
rd_cfg_release(rd_cfg_child_from_string(view, str8_lit("lister")));
|
||||
}
|
||||
|
||||
// rjf: compute query expression
|
||||
if(query_expr.size == 0)
|
||||
{
|
||||
@@ -6532,18 +6548,6 @@ rd_window_frame(void)
|
||||
}
|
||||
}
|
||||
|
||||
// rjf: determine if we want an explicit root
|
||||
B32 do_explicit_root = (!ws->query_regs->do_implicit_root && (query_expr.size == 0 || !query_is_lister));
|
||||
if(do_explicit_root)
|
||||
{
|
||||
RD_Cfg *explicit_root = rd_cfg_child_from_string_or_alloc(view, str8_lit("explicit_root"));
|
||||
rd_cfg_new(explicit_root, str8_lit("1"));
|
||||
}
|
||||
else
|
||||
{
|
||||
rd_cfg_release(rd_cfg_child_from_string(view, str8_lit("explicit_root")));
|
||||
}
|
||||
|
||||
// rjf: evaluate query expression
|
||||
E_Eval query_eval = e_eval_from_string(scratch.arena, query_expr);
|
||||
|
||||
@@ -6560,7 +6564,7 @@ rd_window_frame(void)
|
||||
F32 query_height_px = max_query_height_px;
|
||||
if(size_query_by_expr_eval)
|
||||
{
|
||||
query_height_px = row_height_px * (predicted_block_tree.total_row_count - !do_explicit_root);
|
||||
query_height_px = row_height_px * (predicted_block_tree.total_row_count - !root_is_explicit);
|
||||
query_height_px = Min(query_height_px, max_query_height_px);
|
||||
}
|
||||
rect = r2f32p(content_rect_center.x - query_width_px/2,
|
||||
@@ -6580,7 +6584,14 @@ rd_window_frame(void)
|
||||
}
|
||||
}
|
||||
|
||||
// rjf: close queries via 'cancel'
|
||||
if(ui_slot_press(UI_EventActionSlot_Cancel))
|
||||
{
|
||||
rd_cmd(RD_CmdKind_CancelQuery);
|
||||
}
|
||||
|
||||
// rjf: push query task
|
||||
else
|
||||
{
|
||||
FloatingViewTask *t = push_array(scratch.arena, FloatingViewTask, 1);
|
||||
SLLQueuePush(first_floating_view_task, last_floating_view_task, t);
|
||||
@@ -6592,6 +6603,7 @@ rd_window_frame(void)
|
||||
t->expr = query_expr;
|
||||
t->is_focused = 1;
|
||||
t->is_anchored = query_is_anchored;
|
||||
t->reset_open = reset_open;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6616,7 +6628,7 @@ rd_window_frame(void)
|
||||
String8 expr = t->expr;
|
||||
B32 is_focused = t->is_focused;
|
||||
B32 is_anchored = t->is_anchored;
|
||||
F32 open_t = ui_anim(ui_key_from_stringf(ui_key_zero(), "floating_view_open_%p", view), 1.f, .rate = is_anchored ? fast_open_rate : slow_open_rate);
|
||||
F32 open_t = ui_anim(ui_key_from_stringf(ui_key_zero(), "floating_view_open_%p", view), 1.f, .rate = is_anchored ? fast_open_rate : slow_open_rate, .reset = t->reset_open, .initial = 0.f);
|
||||
|
||||
// rjf: build cfg tree
|
||||
RD_Cfg *expr_root = rd_cfg_child_from_string_or_alloc(view, str8_lit("expression"));
|
||||
@@ -6763,7 +6775,7 @@ rd_window_frame(void)
|
||||
RD_CmdKindInfo *cmd_kind_info = rd_cmd_kind_info_from_string(cmd_name);
|
||||
|
||||
// rjf: close queries
|
||||
if(ui_slot_press(UI_EventActionSlot_Cancel) || query_floating_view_task->pressed_outside)
|
||||
if(query_floating_view_task->pressed_outside)
|
||||
{
|
||||
rd_cmd(RD_CmdKind_CancelQuery);
|
||||
}
|
||||
@@ -12571,8 +12583,8 @@ rd_frame(void)
|
||||
//- rjf: open lister
|
||||
case RD_CmdKind_OpenLister:
|
||||
{
|
||||
String8 expr = push_str8f(scratch.arena, "query:commands, query:recent_files, query:recent_projects, query:procedures, query:$%I64x, query:$%I64x", rd_regs()->view, rd_regs()->window);
|
||||
rd_cmd(RD_CmdKind_PushQuery, .expr = expr, .do_implicit_root = 1);
|
||||
String8 expr = push_str8f(scratch.arena, "query:commands, query:$%I64x, query:$%I64x, query:recent_files, query:recent_projects, query:procedures", rd_regs()->view, rd_regs()->window);
|
||||
rd_cmd(RD_CmdKind_PushQuery, .expr = expr, .do_implicit_root = 1, .do_lister = 1);
|
||||
}break;
|
||||
|
||||
//- rjf: command fast path
|
||||
@@ -12589,7 +12601,7 @@ rd_frame(void)
|
||||
// rjf: command has required query -> prep query
|
||||
else
|
||||
{
|
||||
rd_cmd(RD_CmdKind_PushQuery);
|
||||
rd_cmd(RD_CmdKind_PushQuery, .do_implicit_root = 1, .do_lister = 1);
|
||||
}
|
||||
}break;
|
||||
|
||||
@@ -14675,7 +14687,8 @@ Z(getting_started)
|
||||
|
||||
// rjf: floating queries -> set up window to build immediate-mode top-level query
|
||||
RD_Cfg *view = &rd_nil_cfg;
|
||||
if(cmd_name.size == 0 || cmd_kind_info->query.flags & RD_QueryFlag_Floating)
|
||||
B32 is_floating = (cmd_name.size == 0 || cmd_kind_info->query.flags & RD_QueryFlag_Floating);
|
||||
if(is_floating)
|
||||
{
|
||||
RD_Cfg *window = rd_cfg_from_id(rd_regs()->window);
|
||||
RD_WindowState *ws = rd_window_state_from_cfg(window);
|
||||
@@ -14686,6 +14699,7 @@ Z(getting_started)
|
||||
ws->query_regs = rd_regs_copy(ws->query_arena, rd_regs());
|
||||
}
|
||||
RD_Cfg *window_query = rd_immediate_cfg_from_keyf("window_query_%p", window);
|
||||
rd_cfg_release_all_children(window_query);
|
||||
view = rd_cfg_child_from_string_or_alloc(window_query, str8_lit("watch"));
|
||||
}
|
||||
|
||||
@@ -14699,6 +14713,25 @@ Z(getting_started)
|
||||
RD_Cfg *query = rd_cfg_child_from_string_or_alloc(view, str8_lit("query"));
|
||||
RD_Cfg *cmd = rd_cfg_child_from_string_or_alloc(query, str8_lit("cmd"));
|
||||
RD_Cfg *input = rd_cfg_child_from_string_or_alloc(query, str8_lit("input"));
|
||||
if(is_floating)
|
||||
{
|
||||
if(rd_regs()->do_implicit_root)
|
||||
{
|
||||
rd_cfg_release(rd_cfg_child_from_string(view, str8_lit("explicit_root")));
|
||||
}
|
||||
else
|
||||
{
|
||||
rd_cfg_child_from_string_or_alloc(view, str8_lit("explicit_root"));
|
||||
}
|
||||
if(!rd_regs()->do_lister)
|
||||
{
|
||||
rd_cfg_release(rd_cfg_child_from_string(view, str8_lit("lister")));
|
||||
}
|
||||
else
|
||||
{
|
||||
rd_cfg_child_from_string_or_alloc(view, str8_lit("lister"));
|
||||
}
|
||||
}
|
||||
|
||||
// rjf: choose initial input string
|
||||
String8 initial_input = {0};
|
||||
|
||||
@@ -523,6 +523,7 @@ struct RD_WindowState
|
||||
B32 query_is_active;
|
||||
Arena *query_arena;
|
||||
RD_Regs *query_regs;
|
||||
RD_CfgID query_last_view_id;
|
||||
|
||||
// rjf: hover eval state
|
||||
B32 hover_eval_focused;
|
||||
|
||||
+34
-18
@@ -420,29 +420,45 @@ E_TYPE_ACCESS_FUNCTION_DEF(schema)
|
||||
}
|
||||
if(!expr_is_simple && expr != &e_expr_nil)
|
||||
{
|
||||
child_type_key = e_type_key_cons(.kind = E_TypeKind_MetaExpr, .name = child->first->string, .direct_key = child_type_key);
|
||||
child_type_key = e_type_key_cons_meta_expr(child_type_key, child->first->string);
|
||||
}
|
||||
scratch_end(scratch);
|
||||
}
|
||||
|
||||
//- rjf: extend child type with ranges
|
||||
MD_Node *range = md_tag_from_string(child_schema->first, str8_lit("range"), 0);
|
||||
if(!md_node_is_nil(range))
|
||||
//- rjf: extend child type with decorative meta info
|
||||
{
|
||||
Temp scratch = scratch_begin(&arena, 1);
|
||||
E_Expr *min_bound = e_parse_expr_from_text(scratch.arena, range->first->string).expr;
|
||||
E_Expr *max_bound = e_parse_expr_from_text(scratch.arena, range->first->next->string).expr;
|
||||
E_Expr *args[] =
|
||||
MD_Node *display_name = md_tag_from_string(child_schema, str8_lit("display_name"), 0);
|
||||
MD_Node *description = md_tag_from_string(child_schema, str8_lit("description"), 0);
|
||||
if(!md_node_is_nil(display_name))
|
||||
{
|
||||
min_bound,
|
||||
max_bound,
|
||||
};
|
||||
child_type_key = e_type_key_cons(.kind = E_TypeKind_Lens,
|
||||
.name = str8_lit("range1"),
|
||||
.direct_key = child_type_key,
|
||||
.count = 2,
|
||||
.args = args);
|
||||
scratch_end(scratch);
|
||||
child_type_key = e_type_key_cons_meta_display_name(child_type_key, display_name->first->string);
|
||||
}
|
||||
if(!md_node_is_nil(description))
|
||||
{
|
||||
child_type_key = e_type_key_cons_meta_description(child_type_key, description->first->string);
|
||||
}
|
||||
}
|
||||
|
||||
//- rjf: extend child type with ranges
|
||||
{
|
||||
MD_Node *range = md_tag_from_string(child_schema->first, str8_lit("range"), 0);
|
||||
if(!md_node_is_nil(range))
|
||||
{
|
||||
Temp scratch = scratch_begin(&arena, 1);
|
||||
E_Expr *min_bound = e_parse_expr_from_text(scratch.arena, range->first->string).expr;
|
||||
E_Expr *max_bound = e_parse_expr_from_text(scratch.arena, range->first->next->string).expr;
|
||||
E_Expr *args[] =
|
||||
{
|
||||
min_bound,
|
||||
max_bound,
|
||||
};
|
||||
child_type_key = e_type_key_cons(.kind = E_TypeKind_Lens,
|
||||
.name = str8_lit("range1"),
|
||||
.direct_key = child_type_key,
|
||||
.count = 2,
|
||||
.args = args);
|
||||
scratch_end(scratch);
|
||||
}
|
||||
}
|
||||
|
||||
//- rjf: evaluate
|
||||
@@ -903,7 +919,7 @@ E_TYPE_ACCESS_FUNCTION_DEF(environment)
|
||||
{
|
||||
RD_Cfg *cfg = cfgs->v[rhs_value.u64];
|
||||
result.root = e_irtree_set_space(arena, rd_eval_space_from_cfg(cfg), e_irtree_const_u(arena, 0));
|
||||
result.type_key = e_type_key_cons_ptr(arch_from_context(), e_type_key_basic(E_TypeKind_U8), 1, E_TypeFlag_IsCodeText);
|
||||
result.type_key = e_type_key_cons_array(e_type_key_basic(E_TypeKind_U8), cfg->first->string.size, E_TypeFlag_IsCodeText);
|
||||
result.mode = E_Mode_Offset;
|
||||
}
|
||||
}
|
||||
|
||||
+19
-18
@@ -825,7 +825,6 @@ rd_id_from_watch_cell(RD_WatchCell *cell)
|
||||
result = e_hash_from_string(result, str8_struct(&cell->kind));
|
||||
if(cell->kind != RD_WatchCellKind_Expr)
|
||||
{
|
||||
// result = e_hash_from_string(result, str8_struct(&cell->eval.irtree.mode));
|
||||
result = e_hash_from_string(result, str8_struct(&cell->index));
|
||||
result = e_hash_from_string(result, str8_struct(&cell->default_pct));
|
||||
}
|
||||
@@ -1026,7 +1025,9 @@ rd_watch_row_info_from_row(Arena *arena, EV_Row *row)
|
||||
}
|
||||
|
||||
// rjf: determine row's group cfg
|
||||
if(info.group_cfg_name.size != 0)
|
||||
if(info.group_cfg_name.size != 0 && (block_type->expand.id_from_num == E_TYPE_EXPAND_ID_FROM_NUM_FUNCTION_NAME(cfgs) ||
|
||||
block_type->expand.id_from_num == E_TYPE_EXPAND_ID_FROM_NUM_FUNCTION_NAME(watches) ||
|
||||
block_type->expand.id_from_num == E_TYPE_EXPAND_ID_FROM_NUM_FUNCTION_NAME(environment)))
|
||||
{
|
||||
RD_CfgID id = row->key.child_id;
|
||||
info.group_cfg_child = rd_cfg_from_id(id);
|
||||
@@ -1125,7 +1126,7 @@ rd_watch_row_info_from_row(Arena *arena, EV_Row *row)
|
||||
RD_Cfg *w_cfg = style->first;
|
||||
F32 next_pct = 0;
|
||||
#define take_pct() (next_pct = (F32)f64_from_str8(w_cfg->string), w_cfg = w_cfg->next, next_pct)
|
||||
rd_watch_cell_list_push_new(arena, &info.cells, RD_WatchCellKind_Expr, .default_pct = 0.35f, .pct = take_pct());
|
||||
rd_watch_cell_list_push_new(arena, &info.cells, RD_WatchCellKind_Expr, .flags = RD_WatchCellFlag_Indented, .default_pct = 0.35f, .pct = take_pct());
|
||||
rd_watch_cell_list_push_new(arena, &info.cells, RD_WatchCellKind_Eval, .default_pct = 0.65f, .pct = take_pct());
|
||||
#undef take_pct
|
||||
}
|
||||
@@ -1153,7 +1154,7 @@ rd_watch_row_info_from_row(Arena *arena, EV_Row *row)
|
||||
dr_fstrs_push_new(arena, &fstrs, ¶ms, push_str8f(arena, "(PID: %I64u)", pid));
|
||||
dr_fstrs_push_new(arena, &fstrs, ¶ms, str8_lit(" "));
|
||||
dr_fstrs_push_new(arena, &fstrs, ¶ms, name);
|
||||
rd_watch_cell_list_push_new(arena, &info.cells, RD_WatchCellKind_Expr, .flags = RD_WatchCellFlag_Button, .pct = 1.f, .fstrs = fstrs);
|
||||
rd_watch_cell_list_push_new(arena, &info.cells, RD_WatchCellKind_Expr, .flags = RD_WatchCellFlag_Button|RD_WatchCellFlag_Indented, .pct = 1.f, .fstrs = fstrs);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1161,14 +1162,14 @@ rd_watch_row_info_from_row(Arena *arena, EV_Row *row)
|
||||
else if(rd_cfg_child_from_string(rd_cfg_from_id(rd_regs()->view), str8_lit("lister")) != &rd_nil_cfg)
|
||||
{
|
||||
info.can_expand = 0;
|
||||
rd_watch_cell_list_push_new(arena, &info.cells, RD_WatchCellKind_Expr, .flags = RD_WatchCellFlag_Button, .pct = 1.f);
|
||||
rd_watch_cell_list_push_new(arena, &info.cells, RD_WatchCellKind_Expr, .flags = RD_WatchCellFlag_Button|RD_WatchCellFlag_Indented, .pct = 1.f);
|
||||
}
|
||||
|
||||
// rjf: top-level cfg rows
|
||||
else if(is_top_level && evalled_cfg != &rd_nil_cfg)
|
||||
{
|
||||
RD_Cfg *cfg = evalled_cfg;
|
||||
rd_watch_cell_list_push_new(arena, &info.cells, RD_WatchCellKind_Expr, .flags = RD_WatchCellFlag_Button, .pct = 1.f, .fstrs = rd_title_fstrs_from_cfg(arena, cfg));
|
||||
rd_watch_cell_list_push_new(arena, &info.cells, RD_WatchCellKind_Expr, .flags = RD_WatchCellFlag_Button|RD_WatchCellFlag_Indented, .pct = 1.f, .fstrs = rd_title_fstrs_from_cfg(arena, cfg));
|
||||
MD_NodePtrList schemas = rd_schemas_from_name(cfg->string);
|
||||
for(MD_NodePtrNode *n = schemas.first; n != 0; n = n->next)
|
||||
{
|
||||
@@ -1233,7 +1234,7 @@ rd_watch_row_info_from_row(Arena *arena, EV_Row *row)
|
||||
else if(is_top_level && evalled_entity != &ctrl_entity_nil)
|
||||
{
|
||||
CTRL_Entity *entity = evalled_entity;
|
||||
rd_watch_cell_list_push_new(arena, &info.cells, RD_WatchCellKind_Expr, .flags = RD_WatchCellFlag_Button, .pct = 1.f, .fstrs = rd_title_fstrs_from_ctrl_entity(arena, entity, 1));
|
||||
rd_watch_cell_list_push_new(arena, &info.cells, RD_WatchCellKind_Expr, .flags = RD_WatchCellFlag_Indented|RD_WatchCellFlag_Button, .pct = 1.f, .fstrs = rd_title_fstrs_from_ctrl_entity(arena, entity, 1));
|
||||
if(entity->kind == CTRL_EntityKind_Machine ||
|
||||
entity->kind == CTRL_EntityKind_Process ||
|
||||
entity->kind == CTRL_EntityKind_Thread)
|
||||
@@ -1257,7 +1258,7 @@ rd_watch_row_info_from_row(Arena *arena, EV_Row *row)
|
||||
// rjf: singular row for queries
|
||||
else if(row->eval.space.kind == RD_EvalSpaceKind_MetaQuery)
|
||||
{
|
||||
rd_watch_cell_list_push_new(arena, &info.cells, RD_WatchCellKind_Expr, .pct = 1.f);
|
||||
rd_watch_cell_list_push_new(arena, &info.cells, RD_WatchCellFlag_Indented|RD_WatchCellKind_Expr, .pct = 1.f);
|
||||
}
|
||||
|
||||
// rjf: singular button for commands
|
||||
@@ -1266,13 +1267,13 @@ rd_watch_row_info_from_row(Arena *arena, EV_Row *row)
|
||||
E_Type *type = e_type_from_key__cached(row->eval.irtree.type_key);
|
||||
if(type->kind == E_TypeKind_Set)
|
||||
{
|
||||
rd_watch_cell_list_push_new(arena, &info.cells, RD_WatchCellKind_Expr, .flags = 0, .pct = 1.f);
|
||||
rd_watch_cell_list_push_new(arena, &info.cells, RD_WatchCellKind_Expr, .flags = RD_WatchCellFlag_Indented, .pct = 1.f);
|
||||
}
|
||||
else
|
||||
{
|
||||
String8 cmd_name = e_string_from_id(e_value_eval_from_eval(row->eval).value.u64);
|
||||
RD_CmdKindInfo *cmd_kind_info = rd_cmd_kind_info_from_string(cmd_name);
|
||||
rd_watch_cell_list_push_new(arena, &info.cells, RD_WatchCellKind_Expr, .flags = RD_WatchCellFlag_Button|RD_WatchCellFlag_ActivateWithSingleClick, .pct = 1.f, .fstrs = rd_title_fstrs_from_code_name(arena, cmd_kind_info->string));
|
||||
rd_watch_cell_list_push_new(arena, &info.cells, RD_WatchCellKind_Expr, .flags = RD_WatchCellFlag_Indented|RD_WatchCellFlag_Button|RD_WatchCellFlag_ActivateWithSingleClick, .pct = 1.f, .fstrs = rd_title_fstrs_from_code_name(arena, cmd_kind_info->string));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1285,7 +1286,7 @@ rd_watch_row_info_from_row(Arena *arena, EV_Row *row)
|
||||
// rjf: for 'add-new' rows in meta-cfg evaluation spaces, only do expr
|
||||
else if(row->eval.expr == &e_expr_nil && info.group_cfg_name.size != 0 && info.group_cfg_child == &rd_nil_cfg)
|
||||
{
|
||||
rd_watch_cell_list_push_new(arena, &info.cells, RD_WatchCellKind_Expr, .pct = 1.f);
|
||||
rd_watch_cell_list_push_new(arena, &info.cells, RD_WatchCellKind_Expr, .flags = RD_WatchCellFlag_Indented, .pct = 1.f);
|
||||
}
|
||||
|
||||
// rjf: for meta-evaluation space booleans, only do expr
|
||||
@@ -1294,7 +1295,7 @@ rd_watch_row_info_from_row(Arena *arena, EV_Row *row)
|
||||
row->eval.space.kind == RD_EvalSpaceKind_MetaCmd ||
|
||||
row->eval.space.kind == RD_EvalSpaceKind_MetaCtrlEntity))
|
||||
{
|
||||
rd_watch_cell_list_push_new(arena, &info.cells, RD_WatchCellKind_Expr, .pct = 1.f);
|
||||
rd_watch_cell_list_push_new(arena, &info.cells, RD_WatchCellKind_Expr, .flags = RD_WatchCellFlag_Indented, .pct = 1.f);
|
||||
}
|
||||
|
||||
// rjf: for meta-cfg evaluation spaces, only do expr/value
|
||||
@@ -1314,21 +1315,21 @@ rd_watch_row_info_from_row(Arena *arena, EV_Row *row)
|
||||
RD_Cfg *w_cfg = style->first;
|
||||
F32 next_pct = 0;
|
||||
#define take_pct() (next_pct = (F32)f64_from_str8(w_cfg->string), w_cfg = w_cfg->next, next_pct)
|
||||
rd_watch_cell_list_push_new(arena, &info.cells, RD_WatchCellKind_Expr, .default_pct = 0.35f, .pct = take_pct());
|
||||
rd_watch_cell_list_push_new(arena, &info.cells, RD_WatchCellKind_Expr, .flags = RD_WatchCellFlag_Indented, .default_pct = 0.35f, .pct = take_pct());
|
||||
rd_watch_cell_list_push_new(arena, &info.cells, RD_WatchCellKind_Eval, .default_pct = 0.65f, .pct = take_pct());
|
||||
#undef take_pct
|
||||
}
|
||||
|
||||
// rjf: procedures collections get only expr/value/view-rule
|
||||
// rjf: procedures collections get only expr/value
|
||||
else if(block_type->kind == E_TypeKind_Set && str8_match(block_type->name, str8_lit("procedures"), 0))
|
||||
{
|
||||
info.cell_style_key = str8_lit("expr_value_viewrule");
|
||||
info.cell_style_key = str8_lit("procedure_expr_eval");
|
||||
RD_Cfg *view = rd_cfg_from_id(rd_regs()->view);
|
||||
RD_Cfg *style = rd_cfg_child_from_string(view, info.cell_style_key);
|
||||
RD_Cfg *w_cfg = style->first;
|
||||
F32 next_pct = 0;
|
||||
#define take_pct() (next_pct = (F32)f64_from_str8(w_cfg->string), w_cfg = w_cfg->next, next_pct)
|
||||
rd_watch_cell_list_push_new(arena, &info.cells, RD_WatchCellKind_Expr, .default_pct = 0.75f, .pct = take_pct());
|
||||
rd_watch_cell_list_push_new(arena, &info.cells, RD_WatchCellKind_Expr, .flags = RD_WatchCellFlag_Indented, .default_pct = 0.75f, .pct = take_pct());
|
||||
rd_watch_cell_list_push_new(arena, &info.cells, RD_WatchCellKind_Eval, .string = str8_lit("lens:hex((U64)($expr))"), .default_pct = 0.25f, .pct = take_pct());
|
||||
#undef take_pct
|
||||
}
|
||||
@@ -1369,7 +1370,7 @@ rd_watch_row_info_from_row(Arena *arena, EV_Row *row)
|
||||
RD_Cfg *w_cfg = style->first;
|
||||
F32 next_pct = 0;
|
||||
#define take_pct() (next_pct = (F32)f64_from_str8(w_cfg->string), w_cfg = w_cfg->next, next_pct)
|
||||
rd_watch_cell_list_push_new(arena, &info.cells, RD_WatchCellKind_Expr, .default_pct = 0.35f, .pct = take_pct());
|
||||
rd_watch_cell_list_push_new(arena, &info.cells, RD_WatchCellKind_Expr, .flags = RD_WatchCellFlag_Indented, .default_pct = 0.35f, .pct = take_pct());
|
||||
rd_watch_cell_list_push_new(arena, &info.cells, RD_WatchCellKind_Eval, .default_pct = 0.40f, .pct = take_pct());
|
||||
rd_watch_cell_list_push_new(arena, &info.cells, RD_WatchCellKind_Eval, .string = str8_lit("typeof(raw($expr))"), .default_pct = 0.25f, .pct = take_pct());
|
||||
#undef take_pct
|
||||
@@ -1538,7 +1539,7 @@ rd_info_from_watch_row_cell(Arena *arena, EV_Row *row, EV_StringFlags string_fla
|
||||
if(result.eval.space.kind == RD_EvalSpaceKind_MetaCfg ||
|
||||
result.eval.space.kind == RD_EvalSpaceKind_MetaCtrlEntity)
|
||||
{
|
||||
string_params.flags |= EV_StringFlag_DisableStringQuotes;
|
||||
string_params.flags |= EV_StringFlag_DisableStringQuotes|EV_StringFlag_DisableAddresses;
|
||||
}
|
||||
if(result.eval.space.kind == RD_EvalSpaceKind_MetaCtrlEntity &&
|
||||
rd_ctrl_entity_from_eval_space(result.eval.space)->kind == CTRL_EntityKind_Module)
|
||||
|
||||
@@ -60,6 +60,7 @@ enum
|
||||
RD_WatchCellFlag_IsNonCode = (1<<3),
|
||||
RD_WatchCellFlag_CanEdit = (1<<4),
|
||||
RD_WatchCellFlag_IsErrored = (1<<5),
|
||||
RD_WatchCellFlag_Indented = (1<<6),
|
||||
};
|
||||
|
||||
typedef struct RD_WatchCell RD_WatchCell;
|
||||
@@ -67,11 +68,11 @@ struct RD_WatchCell
|
||||
{
|
||||
RD_WatchCell *next;
|
||||
RD_WatchCellKind kind;
|
||||
RD_WatchCellFlags flags;
|
||||
U64 index;
|
||||
String8 string;
|
||||
E_Eval eval;
|
||||
DR_FStrList fstrs;
|
||||
RD_WatchCellFlags flags;
|
||||
F32 default_pct;
|
||||
F32 pct;
|
||||
F32 px;
|
||||
|
||||
@@ -3232,8 +3232,8 @@ rd_cell(RD_CellParams *params, String8 string)
|
||||
{
|
||||
B32 is_toggled = !!params->toggled_out[0];
|
||||
F32 toggle_t = ui_anim(ui_key_from_stringf(key, "toggled"), (F32)is_toggled, .initial = (F32)is_toggled);
|
||||
F32 height_px = ui_top_font_size() * 1.75f;
|
||||
F32 padding_px = (ui_top_px_height() - height_px) / 2.f;
|
||||
F32 height_px = ceil_f32(ui_top_font_size() * 1.75f);
|
||||
F32 padding_px = ceil_f32((ui_top_px_height() - height_px) / 2.f);
|
||||
UI_PrefWidth(ui_children_sum(1.f))
|
||||
UI_HeightFill
|
||||
UI_Column UI_Padding(ui_px(padding_px, 1.f))
|
||||
@@ -3255,7 +3255,7 @@ rd_cell(RD_CellParams *params, String8 string)
|
||||
UI_PrefWidth(ui_px(height_px, 1.f))
|
||||
{
|
||||
F32 extratoggler_padding_px = floor_f32(ui_top_font_size()*0.35f);
|
||||
F32 toggler_size_px = height_px - extratoggler_padding_px*2.f;
|
||||
F32 toggler_size_px = ceil_f32(height_px - extratoggler_padding_px*2.f) - 1.f;
|
||||
UI_Column UI_Padding(ui_px(extratoggler_padding_px, 1.f))
|
||||
UI_Row UI_Padding(ui_px(extratoggler_padding_px, 1.f))
|
||||
UI_PrefWidth(ui_px(toggler_size_px, 1.f))
|
||||
@@ -3281,8 +3281,8 @@ rd_cell(RD_CellParams *params, String8 string)
|
||||
if(params->flags & RD_CellFlag_Slider && !is_focus_active)
|
||||
UI_Parent(box)
|
||||
{
|
||||
F32 height_px = ui_top_font_size() * 1.75f;
|
||||
F32 padding_px = (ui_top_px_height() - height_px) / 2.f;
|
||||
F32 height_px = ceil_f32(ui_top_font_size() * 1.75f);
|
||||
F32 padding_px = ceil_f32((ui_top_px_height() - height_px) / 2.f);
|
||||
UI_PrefWidth(ui_children_sum(1.f))
|
||||
UI_HeightFill
|
||||
UI_Column UI_Padding(ui_px(padding_px, 1.f))
|
||||
@@ -3292,7 +3292,7 @@ rd_cell(RD_CellParams *params, String8 string)
|
||||
UI_CornerRadius(floor_f32(height_px/2.f - 1.f))
|
||||
{
|
||||
F32 extratoggler_padding_px = floor_f32(ui_top_font_size()*0.35f);
|
||||
F32 toggler_size_px = height_px - extratoggler_padding_px*2.f;
|
||||
F32 toggler_size_px = ceil_f32(height_px - extratoggler_padding_px*2.f) - 1.f;
|
||||
ui_set_next_hover_cursor(OS_Cursor_LeftRight);
|
||||
UI_Box *slider_box = ui_build_box_from_stringf(UI_BoxFlag_DrawHotEffects|UI_BoxFlag_DrawBorder|UI_BoxFlag_DrawBackground|UI_BoxFlag_Clickable, "slider");
|
||||
UI_Parent(slider_box) UI_TagF("pop")
|
||||
|
||||
Reference in New Issue
Block a user