begin folding font size parameters into main cfg tree settings path; allow per-tab font sizes, eliminate all redundant font size lookups/applications

This commit is contained in:
Ryan Fleury
2025-04-16 12:10:56 -07:00
parent 51f46cb5b8
commit 950199026b
9 changed files with 160 additions and 203 deletions
+17 -19
View File
@@ -4,7 +4,7 @@
//- GENERATED CODE
C_LINKAGE_BEGIN
RD_VocabInfo rd_vocab_info_table[315] =
RD_VocabInfo rd_vocab_info_table[314] =
{
{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},
@@ -107,6 +107,7 @@ RD_VocabInfo rd_vocab_info_table[315] =
{str8_lit_comp("yaw"), str8_lit_comp(""), str8_lit_comp("Yaw"), str8_lit_comp(""), RD_IconKind_Null},
{str8_lit_comp("pitch"), str8_lit_comp(""), str8_lit_comp("Pitch"), str8_lit_comp(""), RD_IconKind_Null},
{str8_lit_comp("zoom"), str8_lit_comp(""), str8_lit_comp("Zoom"), str8_lit_comp(""), RD_IconKind_Null},
{str8_lit_comp("font_size"), str8_lit_comp(""), str8_lit_comp("Font Size"), str8_lit_comp(""), RD_IconKind_Null},
{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},
@@ -149,10 +150,8 @@ RD_VocabInfo rd_vocab_info_table[315] =
{str8_lit_comp("down_one_frame"), str8_lit_comp(""), str8_lit_comp("Down One Frame"), str8_lit_comp(""), RD_IconKind_DownArrow},
{str8_lit_comp("select_entity"), str8_lit_comp(""), str8_lit_comp("Select Entity"), str8_lit_comp(""), RD_IconKind_RadioHollow},
{str8_lit_comp("deselect_entity"), str8_lit_comp(""), str8_lit_comp("Deselect Entity"), str8_lit_comp(""), RD_IconKind_RadioFilled},
{str8_lit_comp("inc_ui_font_scale"), str8_lit_comp(""), str8_lit_comp("Increase UI Font Scale"), str8_lit_comp(""), RD_IconKind_Null},
{str8_lit_comp("dec_ui_font_scale"), str8_lit_comp(""), str8_lit_comp("Decrease UI Font Scale"), str8_lit_comp(""), RD_IconKind_Null},
{str8_lit_comp("inc_code_font_scale"), str8_lit_comp(""), str8_lit_comp("Increase Code Font Scale"), str8_lit_comp(""), RD_IconKind_Null},
{str8_lit_comp("dec_code_font_scale"), str8_lit_comp(""), str8_lit_comp("Decrease Code Font Scale"), str8_lit_comp(""), RD_IconKind_Null},
{str8_lit_comp("inc_font_size"), str8_lit_comp(""), str8_lit_comp("Increase Font Size"), str8_lit_comp(""), RD_IconKind_Null},
{str8_lit_comp("dec_font_size"), str8_lit_comp(""), str8_lit_comp("Decrease Font Size"), str8_lit_comp(""), RD_IconKind_Null},
{str8_lit_comp("open_window"), str8_lit_comp(""), str8_lit_comp("Open New Window"), str8_lit_comp(""), RD_IconKind_Window},
{str8_lit_comp("close_window"), str8_lit_comp(""), str8_lit_comp("Close Window"), str8_lit_comp(""), RD_IconKind_Window},
{str8_lit_comp("toggle_fullscreen"), str8_lit_comp(""), str8_lit_comp("Toggle Fullscreen"), str8_lit_comp(""), RD_IconKind_Window},
@@ -323,14 +322,16 @@ RD_VocabInfo rd_vocab_info_table[315] =
{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[17] =
RD_NameSchemaInfo rd_name_schema_info_table[19] =
{
{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_main_text': bool,\n @default(0) 'smooth_code_text': bool,\n @default(1) 'hint_main_text': bool,\n @default(1) 'hint_code_text': bool,\n @default(2) 'tab_width': @range[1, 32] u64,\n @can_be_per_window 'main_font_size': @range[6, 72] u64,\n @can_be_per_window 'code_font_size': @range[1, 32] u64,\n}\n")},
{str8_lit_comp("text"), str8_lit_comp("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("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")},
{str8_lit_comp("memory"), str8_lit_comp("x:\n{\n 'size': code_string,\n @default(16) 'num_columns': @range[1, 64] u64,\n @default(1) 'bytes_per_cell': @range[1, 8] u64,\n}\n")},
{str8_lit_comp("bitmap"), str8_lit_comp("x:\n{\n @order(0) 'w': u64,\n @order(1) 'h': u64,\n 'fmt': tex2dformat,\n}\n")},
{str8_lit_comp("geo3d"), str8_lit_comp("x:\n{\n 'count': code_string,\n 'vtx': code_string,\n 'vtx_size': code_string,\n 'yaw': @range[0, 1] f32,\n 'pitch': @range[-0.5, 0] f32,\n 'zoom': @range[0, 100] f32,\n}\n")},
{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_main_text': bool,\n @default(0) 'smooth_code_text': bool,\n @default(1) 'hint_main_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 @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("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")},
{str8_lit_comp("memory"), str8_lit_comp("@inherit(tab) x:\n{\n 'size': code_string,\n @default(16) 'num_columns': @range[1, 64] u64,\n @default(1) 'bytes_per_cell': @range[1, 8] u64,\n}\n")},
{str8_lit_comp("bitmap"), str8_lit_comp("@inherit(tab) x:\n{\n @order(0) 'w': u64,\n @order(1) 'h': u64,\n 'fmt': tex2dformat,\n}\n")},
{str8_lit_comp("geo3d"), str8_lit_comp("@inherit(tab) x:\n{\n 'count': code_string,\n 'vtx': code_string,\n 'vtx_size': code_string,\n 'yaw': @range[0, 1] f32,\n 'pitch': @range[-0.5, 0] f32,\n 'zoom': @range[0, 100] f32,\n}\n")},
{str8_lit_comp("target"), str8_lit_comp("@commands(enable_cfg, launch_and_run, launch_and_step_into, remove_cfg)\n@collection_commands(add_target)\nx:\n{\n 'label': code_string,\n 'executable': path,\n 'arguments': string,\n 'working_directory': path,\n 'entry_point': code_string,\n 'stdout_path': path,\n 'stderr_path': path,\n 'stdin_path': path,\n 'environment': query,\n 'debug_subprocesses': bool,\n @no_expand @default(0) 'enabled': bool,\n}\n")},
{str8_lit_comp("breakpoint"), str8_lit_comp("@commands(enable_cfg, remove_cfg)\n@collection_commands(toggle_breakpoint, add_breakpoint, add_address_breakpoint)\nx:\n{\n 'label': code_string,\n 'condition': code_string,\n 'source_location': path_pt,\n 'address_location': code_string,\n 'hit_count': u64,\n 'address_range_size': @or(0, 1, 2, 4, 8) u64,\n 'break_on_write': bool,\n 'break_on_read': bool,\n 'break_on_execute': bool,\n @no_expand @default(1) 'enabled': bool,\n}\n")},
{str8_lit_comp("watch_pin"), str8_lit_comp("@commands(remove_cfg)\n@collection_commands(add_watch_pin)\nx:\n{\n 'expression': code_string,\n 'view_rule': code_string,\n 'source_location': path_pt,\n 'address_location': code_string,\n}\n")},
@@ -344,7 +345,7 @@ RD_NameSchemaInfo rd_name_schema_info_table[17] =
{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[41] =
Rng1U64 rd_reg_slot_range_table[40] =
{
{0},
{OffsetOf(RD_Regs, machine), OffsetOf(RD_Regs, machine) + sizeof(CTRL_Handle)},
@@ -375,7 +376,6 @@ Rng1U64 rd_reg_slot_range_table[41] =
{OffsetOf(RD_Regs, expr), OffsetOf(RD_Regs, expr) + sizeof(String8)},
{OffsetOf(RD_Regs, ui_key), OffsetOf(RD_Regs, ui_key) + sizeof(UI_Key)},
{OffsetOf(RD_Regs, off_px), OffsetOf(RD_Regs, off_px) + sizeof(Vec2F32)},
{OffsetOf(RD_Regs, lister_flags), OffsetOf(RD_Regs, lister_flags) + sizeof(RD_ListerFlags)},
{OffsetOf(RD_Regs, reg_slot), OffsetOf(RD_Regs, reg_slot) + sizeof(RD_RegSlot)},
{OffsetOf(RD_Regs, pid), OffsetOf(RD_Regs, pid) + sizeof(U32)},
{OffsetOf(RD_Regs, force_confirm), OffsetOf(RD_Regs, force_confirm) + sizeof(B32)},
@@ -389,7 +389,7 @@ Rng1U64 rd_reg_slot_range_table[41] =
{OffsetOf(RD_Regs, os_event), OffsetOf(RD_Regs, os_event) + sizeof(OS_Event *)},
};
RD_CmdKindInfo rd_cmd_kind_info_table[215] =
RD_CmdKindInfo rd_cmd_kind_info_table[213] =
{
{0},
{ str8_lit_comp("launch_and_run"), str8_lit_comp("Starts debugging a new instance of a target, then runs."), str8_lit_comp("launch,start,run,target"), 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*1)|(RD_QueryFlag_Required*1), RD_RegSlot_Cfg, str8_lit_comp("query:targets"), str8_lit_comp(""), CTRL_EntityKind_Null}},
@@ -434,10 +434,8 @@ RD_CmdKindInfo rd_cmd_kind_info_table[215] =
{ str8_lit_comp("down_one_frame"), str8_lit_comp("Selects the call stack frame below the currently selected."), str8_lit_comp("callstack,unwind"), 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("select_entity"), str8_lit_comp("Selects a control entity."), 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("deselect_entity"), str8_lit_comp("Deselects a control entity."), 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("inc_ui_font_scale"), str8_lit_comp("Increases the font size used for UI."), 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}},
{ str8_lit_comp("dec_ui_font_scale"), str8_lit_comp("Decreases the font size used for UI."), 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}},
{ str8_lit_comp("inc_code_font_scale"), str8_lit_comp("Increases the font size used for code."), 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}},
{ str8_lit_comp("dec_code_font_scale"), str8_lit_comp("Decreases the font size used for code."), 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}},
{ str8_lit_comp("inc_font_size"), str8_lit_comp("Increases the font size by one point."), 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}},
{ str8_lit_comp("dec_font_size"), str8_lit_comp("Decreases the font size by one point."), 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}},
{ str8_lit_comp("open_window"), str8_lit_comp("Opens a new window."), 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}},
{ str8_lit_comp("close_window"), str8_lit_comp("Closes an opened window."), 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}},
{ str8_lit_comp("toggle_fullscreen"), str8_lit_comp("Toggles fullscreen view on the active window."), 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}},
+5 -10
View File
@@ -37,7 +37,6 @@ RD_RegSlot_VoffRange,
RD_RegSlot_Expr,
RD_RegSlot_UIKey,
RD_RegSlot_OffPx,
RD_RegSlot_ListerFlags,
RD_RegSlot_RegSlot,
RD_RegSlot_PID,
RD_RegSlot_ForceConfirm,
@@ -97,10 +96,8 @@ RD_CmdKind_UpOneFrame,
RD_CmdKind_DownOneFrame,
RD_CmdKind_SelectEntity,
RD_CmdKind_DeselectEntity,
RD_CmdKind_IncUIFontScale,
RD_CmdKind_DecUIFontScale,
RD_CmdKind_IncCodeFontScale,
RD_CmdKind_DecCodeFontScale,
RD_CmdKind_IncFontSize,
RD_CmdKind_DecFontSize,
RD_CmdKind_OpenWindow,
RD_CmdKind_CloseWindow,
RD_CmdKind_ToggleFullscreen,
@@ -563,7 +560,6 @@ Rng1U64 voff_range;
String8 expr;
UI_Key ui_key;
Vec2F32 off_px;
RD_ListerFlags lister_flags;
RD_RegSlot reg_slot;
U32 pid;
B32 force_confirm;
@@ -627,7 +623,6 @@ RD_Query query;
.expr = rd_regs()->expr,\
.ui_key = rd_regs()->ui_key,\
.off_px = rd_regs()->off_px,\
.lister_flags = rd_regs()->lister_flags,\
.reg_slot = rd_regs()->reg_slot,\
.pid = rd_regs()->pid,\
.force_confirm = rd_regs()->force_confirm,\
@@ -641,9 +636,9 @@ RD_Query query;
.os_event = rd_regs()->os_event,\
C_LINKAGE_BEGIN
extern RD_VocabInfo rd_vocab_info_table[315];
extern RD_NameSchemaInfo rd_name_schema_info_table[17];
extern Rng1U64 rd_reg_slot_range_table[41];
extern RD_VocabInfo rd_vocab_info_table[314];
extern RD_NameSchemaInfo rd_name_schema_info_table[19];
extern Rng1U64 rd_reg_slot_range_table[40];
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];
+48 -29
View File
@@ -120,6 +120,7 @@ RD_VocabTable:
{yaw "" "Yaw" "" Null }
{pitch "" "Pitch" "" Null }
{zoom "" "Zoom" "" Null }
{font_size "" "Font Size" "" Null }
}
@struct RD_VocabInfo:
@@ -148,25 +149,46 @@ RD_VocabTable:
settings,
```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_main_text': bool,
@default(0) 'smooth_code_text': bool,
@default(1) 'hint_main_text': bool,
@default(1) 'hint_code_text': bool,
@default(2) 'tab_width': @range[1, 32] u64,
@can_be_per_window 'main_font_size': @range[6, 72] u64,
@can_be_per_window 'code_font_size': @range[1, 32] u64,
@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_main_text': bool,
@default(0) 'smooth_code_text': bool,
@default(1) 'hint_main_text': bool,
@default(1) 'hint_code_text': bool,
@default(2) 'tab_width': @range[1, 32] u64,
@default(11) 'font_size': @range[6, 72] u64,
}
```
}
//- rjf: windows
{
window,
```
x:
{
@default(11) 'font_size': @range[6, 72] u64,
}
```
}
//- rjf: tabs
{
tab,
```
x:
{
@default(11) 'font_size': @range[6, 72] u64,
}
```
}
@@ -175,7 +197,7 @@ RD_VocabTable:
{
text,
```
x:
@inherit(tab) x:
{
'lang':lang,
'size':code_string,
@@ -186,7 +208,7 @@ RD_VocabTable:
{
disasm,
```
x:
@inherit(tab) x:
{
'arch': arch,
'syntax': dasm_syntax,
@@ -202,7 +224,7 @@ RD_VocabTable:
{
memory,
```
x:
@inherit(tab) x:
{
'size': code_string,
@default(16) 'num_columns': @range[1, 64] u64,
@@ -213,7 +235,7 @@ RD_VocabTable:
{
bitmap,
```
x:
@inherit(tab) x:
{
@order(0) 'w': u64,
@order(1) 'h': u64,
@@ -224,7 +246,7 @@ RD_VocabTable:
{
geo3d,
```
x:
@inherit(tab) x:
{
'count': code_string,
'vtx': code_string,
@@ -396,7 +418,6 @@ RD_RegTable:
// rjf: ui context
{UI_Key ui_key UIKey }
{Vec2F32 off_px OffPx }
{RD_ListerFlags lister_flags ListerFlags }
{RD_RegSlot reg_slot RegSlot }
// rjf: general parameters
@@ -466,10 +487,8 @@ RD_CmdTable: // | | | |
{DeselectEntity 0 0 "" Null null Nil Null 0 0 0 0 0 0 0 RadioFilled "deselect_entity" "Deselect Entity" "Deselects a control entity." "" "" }
//- rjf: font sizes
{IncUIFontScale 1 1 "" Null null Nil Null 0 0 0 0 0 0 0 Null "inc_ui_font_scale" "Increase UI Font Scale" "Increases the font size used for UI." "" "" }
{DecUIFontScale 1 1 "" Null null Nil Null 0 0 0 0 0 0 0 Null "dec_ui_font_scale" "Decrease UI Font Scale" "Decreases the font size used for UI." "" "" }
{IncCodeFontScale 1 1 "" Null null Nil Null 0 0 0 0 0 0 0 Null "inc_code_font_scale" "Increase Code Font Scale" "Increases the font size used for code." "" "" }
{DecCodeFontScale 1 1 "" Null null Nil Null 0 0 0 0 0 0 0 Null "dec_code_font_scale" "Decrease Code Font Scale" "Decreases the font size used for code." "" "" }
{IncFontSize 1 1 "" Null null Nil Null 0 0 0 0 0 0 0 Null "inc_font_size" "Increase Font Size" "Increases the font size by one point." "" "" }
{DecFontSize 1 1 "" Null null Nil Null 0 0 0 0 0 0 0 Null "dec_font_size" "Decrease Font Size" "Decreases the font size by one point." "" "" }
//- rjf: windows
{OpenWindow 1 1 "" Null null Nil Null 0 0 0 0 0 0 0 Window "open_window" "Open New Window" "Opens a new window." "" "" }
+41 -92
View File
@@ -2320,7 +2320,7 @@ rd_view_ui(Rng2F32 rect)
//////////////////////////////
//- rjf: fill view container
//
UI_Parent(view_container)
UI_Parent(view_container) UI_FontSize(rd_setting_f32_from_name(str8_lit("font_size")))
{
////////////////////////////
//- rjf: special-case view: "getting started"
@@ -5280,6 +5280,7 @@ rd_window_frame(void)
//
if(rd_state->first_window_state == ws && rd_state->last_window_state == ws && ws->frames_alive == 0)
{
F32 font_size = rd_setting_f32_from_name(str8_lit("font_size"));
RD_FontSlot english_font_slots[] = {RD_FontSlot_Main, RD_FontSlot_Code};
RD_FontSlot icon_font_slot = RD_FontSlot_Icons;
for(U64 idx = 0; idx < ArrayCount(english_font_slots); idx += 1)
@@ -5289,12 +5290,12 @@ rd_window_frame(void)
String8 sample_text = str8_lit("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890~!@#$%^&*()-_+=[{]}\\|;:'\",<.>/?");
fnt_push_run_from_string(scratch.arena,
rd_font_from_slot(slot),
rd_font_size_from_slot(RD_FontSlot_Code),
font_size,
0, 0, 0,
sample_text);
fnt_push_run_from_string(scratch.arena,
rd_font_from_slot(slot),
rd_font_size_from_slot(RD_FontSlot_Main),
font_size,
0, 0, 0,
sample_text);
scratch_end(scratch);
@@ -5304,17 +5305,17 @@ rd_window_frame(void)
Temp scratch = scratch_begin(0, 0);
fnt_push_run_from_string(scratch.arena,
rd_font_from_slot(icon_font_slot),
rd_font_size_from_slot(icon_font_slot),
font_size,
0, 0, FNT_RasterFlag_Smooth,
rd_icon_kind_text_table[icon_kind]);
fnt_push_run_from_string(scratch.arena,
rd_font_from_slot(icon_font_slot),
rd_font_size_from_slot(RD_FontSlot_Main),
font_size,
0, 0, FNT_RasterFlag_Smooth,
rd_icon_kind_text_table[icon_kind]);
fnt_push_run_from_string(scratch.arena,
rd_font_from_slot(icon_font_slot),
rd_font_size_from_slot(RD_FontSlot_Code),
font_size,
0, 0, FNT_RasterFlag_Smooth,
rd_icon_kind_text_table[icon_kind]);
scratch_end(scratch);
@@ -5425,15 +5426,14 @@ rd_window_frame(void)
//- rjf: @window_ui_part set up
//
{
// rjf: gather font info
FNT_Tag main_font = rd_font_from_slot(RD_FontSlot_Main);
F32 main_font_size = rd_font_size_from_slot(RD_FontSlot_Main);
FNT_Tag icon_font = rd_font_from_slot(RD_FontSlot_Icons);
// rjf: get top-level font size info
F32 top_level_font_size = 0;
RD_RegsScope(.view = 0) top_level_font_size = rd_setting_f32_from_name(str8_lit("font_size"));
// rjf: build icon info
UI_IconInfo icon_info = {0};
{
icon_info.icon_font = icon_font;
icon_info.icon_font = rd_font_from_slot(RD_FontSlot_Icons);
icon_info.icon_kind_text_map[UI_IconKind_RightArrow] = rd_icon_kind_text_table[RD_IconKind_RightScroll];
icon_info.icon_kind_text_map[UI_IconKind_DownArrow] = rd_icon_kind_text_table[RD_IconKind_DownScroll];
icon_info.icon_kind_text_map[UI_IconKind_LeftArrow] = rd_icon_kind_text_table[RD_IconKind_LeftScroll];
@@ -5459,9 +5459,9 @@ rd_window_frame(void)
// rjf: begin & push initial stack values
ui_begin_build(ws->os, &ws->ui_events, &icon_info, ws->theme, &animation_info, rd_state->frame_dt, rd_state->frame_dt);
ui_push_font(main_font);
ui_push_font_size(main_font_size);
ui_push_text_padding(main_font_size*0.3f);
ui_push_font(rd_font_from_slot(RD_FontSlot_Main));
ui_push_font_size(top_level_font_size);
ui_push_text_padding(floor_f32(ui_top_font_size()*0.3f));
ui_push_pref_width(ui_px(floor_f32(ui_top_font_size()*20.f), 1.f));
ui_push_pref_height(ui_px(floor_f32(ui_top_font_size()*3.f), 1.f));
ui_push_blur_size(10.f);
@@ -6275,7 +6275,6 @@ rd_window_frame(void)
FloatingViewTask *first_floating_view_task = 0;
FloatingViewTask *last_floating_view_task = 0;
RD_Font(RD_FontSlot_Code)
UI_FontSize(rd_font_size_from_slot(RD_FontSlot_Main))
{
//- rjf: try to add hover eval first
{
@@ -6561,7 +6560,6 @@ rd_window_frame(void)
//
ProfScope("build all floating views")
RD_Font(RD_FontSlot_Code)
UI_FontSize(rd_font_size_from_slot(RD_FontSlot_Main))
UI_TagF("floating")
UI_Focus(ui_any_ctx_menu_is_open() || ws->menu_bar_focused ? UI_FocusKind_Off : UI_FocusKind_Null)
{
@@ -7181,16 +7179,12 @@ rd_window_frame(void)
os_window_push_custom_title_bar_client_area(ws->os, sig.box->rect);
if(ui_hovering(sig) && !can_play)
{
UI_Tooltip
RD_Font(RD_FontSlot_Main)
UI_FontSize(rd_font_size_from_slot(RD_FontSlot_Main))
UI_Tooltip RD_Font(RD_FontSlot_Main)
ui_labelf("Disabled: %s", have_targets ? "Targets are currently running" : "No active targets exist");
}
if(ui_hovering(sig) && can_play)
{
UI_Tooltip
RD_Font(RD_FontSlot_Main)
UI_FontSize(rd_font_size_from_slot(RD_FontSlot_Main))
UI_Tooltip RD_Font(RD_FontSlot_Main)
{
if(can_stop)
{
@@ -7227,9 +7221,7 @@ rd_window_frame(void)
os_window_push_custom_title_bar_client_area(ws->os, sig.box->rect);
if(ui_hovering(sig))
{
UI_Tooltip
RD_Font(RD_FontSlot_Main)
UI_FontSize(rd_font_size_from_slot(RD_FontSlot_Main))
UI_Tooltip RD_Font(RD_FontSlot_Main)
{
ui_labelf("Restart");
}
@@ -7248,16 +7240,12 @@ rd_window_frame(void)
os_window_push_custom_title_bar_client_area(ws->os, sig.box->rect);
if(ui_hovering(sig) && !can_pause)
{
UI_Tooltip
RD_Font(RD_FontSlot_Main)
UI_FontSize(rd_font_size_from_slot(RD_FontSlot_Main))
UI_Tooltip RD_Font(RD_FontSlot_Main)
ui_labelf("Disabled: Already halted");
}
if(ui_hovering(sig) && can_pause)
{
UI_Tooltip
RD_Font(RD_FontSlot_Main)
UI_FontSize(rd_font_size_from_slot(RD_FontSlot_Main))
UI_Tooltip RD_Font(RD_FontSlot_Main)
ui_labelf("Halt all attached processes");
}
if(ui_clicked(sig))
@@ -7277,16 +7265,11 @@ rd_window_frame(void)
}
if(ui_hovering(sig) && !can_stop)
{
UI_Tooltip
RD_Font(RD_FontSlot_Main)
UI_FontSize(rd_font_size_from_slot(RD_FontSlot_Main))
ui_labelf("Disabled: No processes are running");
UI_Tooltip RD_Font(RD_FontSlot_Main) ui_labelf("Disabled: No processes are running");
}
if(ui_hovering(sig) && can_stop)
{
UI_Tooltip
RD_Font(RD_FontSlot_Main)
UI_FontSize(rd_font_size_from_slot(RD_FontSlot_Main))
UI_Tooltip RD_Font(RD_FontSlot_Main)
ui_labelf("Kill all attached processes");
}
if(ui_clicked(sig))
@@ -7305,16 +7288,11 @@ rd_window_frame(void)
{
if(can_play)
{
UI_Tooltip
RD_Font(RD_FontSlot_Main)
UI_FontSize(rd_font_size_from_slot(RD_FontSlot_Main))
ui_labelf("Step Over");
UI_Tooltip RD_Font(RD_FontSlot_Main) ui_labelf("Step Over");
}
else
{
UI_Tooltip
RD_Font(RD_FontSlot_Main)
UI_FontSize(rd_font_size_from_slot(RD_FontSlot_Main))
UI_Tooltip RD_Font(RD_FontSlot_Main)
ui_labelf("Disabled: %s", have_targets ? "Targets are currently running" : "No active targets exist");
}
}
@@ -7334,16 +7312,12 @@ rd_window_frame(void)
{
if(can_play)
{
UI_Tooltip
RD_Font(RD_FontSlot_Main)
UI_FontSize(rd_font_size_from_slot(RD_FontSlot_Main))
UI_Tooltip RD_Font(RD_FontSlot_Main)
ui_labelf("Step Into");
}
else
{
UI_Tooltip
RD_Font(RD_FontSlot_Main)
UI_FontSize(rd_font_size_from_slot(RD_FontSlot_Main))
UI_Tooltip RD_Font(RD_FontSlot_Main)
ui_labelf("Disabled: %s", have_targets ? "Targets are currently running" : "No active targets exist");
}
}
@@ -7361,23 +7335,17 @@ rd_window_frame(void)
os_window_push_custom_title_bar_client_area(ws->os, sig.box->rect);
if(ui_hovering(sig) && !can_step && can_pause)
{
UI_Tooltip
RD_Font(RD_FontSlot_Main)
UI_FontSize(rd_font_size_from_slot(RD_FontSlot_Main))
UI_Tooltip RD_Font(RD_FontSlot_Main)
ui_labelf("Disabled: Running");
}
if(ui_hovering(sig) && !can_step && !can_stop)
{
UI_Tooltip
RD_Font(RD_FontSlot_Main)
UI_FontSize(rd_font_size_from_slot(RD_FontSlot_Main))
UI_Tooltip RD_Font(RD_FontSlot_Main)
ui_labelf("Disabled: No processes are running");
}
if(ui_hovering(sig) && can_step)
{
UI_Tooltip
RD_Font(RD_FontSlot_Main)
UI_FontSize(rd_font_size_from_slot(RD_FontSlot_Main))
UI_Tooltip RD_Font(RD_FontSlot_Main)
ui_labelf("Step Out");
}
if(ui_clicked(sig))
@@ -7608,9 +7576,7 @@ rd_window_frame(void)
UI_PrefWidth(ui_text_dim(10, 1))
UI_TextAlignment(UI_TextAlign_Center)
{
RD_Font(RD_FontSlot_Icons)
UI_FontSize(rd_font_size_from_slot(RD_FontSlot_Icons))
ui_label(rd_icon_kind_text_table[RD_IconKind_WarningBig]);
RD_Font(RD_FontSlot_Icons) ui_label(rd_icon_kind_text_table[RD_IconKind_WarningBig]);
rd_label(error_string);
}
}
@@ -8494,7 +8460,7 @@ rd_window_frame(void)
}
UI_PrefWidth(ui_px(tab_close_width_px, 1.f)) UI_TextAlignment(UI_TextAlign_Center)
RD_Font(RD_FontSlot_Icons)
UI_FontSize(rd_font_size_from_slot(RD_FontSlot_Icons)*0.75f)
UI_FontSize(ui_top_font_size()*0.75f)
UI_TagF(".") UI_TagF("weak") UI_TagF("implicit")
UI_CornerRadius00(0)
UI_CornerRadius01(0)
@@ -8529,7 +8495,6 @@ rd_window_frame(void)
else if(ui_right_clicked(sig))
{
rd_cmd(RD_CmdKind_PushQuery,
.do_implicit_root = 1,
.ui_key = sig.box->key,
.off_px = v2f32(0, sig.box->rect.y1 - sig.box->rect.y0),
.expr = push_str8f(scratch.arena, "$%I64x", tab->id));
@@ -8714,11 +8679,11 @@ rd_window_frame(void)
ui_eat_event(evt);
if(evt->delta_2f32.y < 0)
{
rd_cmd(RD_CmdKind_IncUIFontScale);
rd_cmd(RD_CmdKind_IncFontSize);
}
else if(evt->delta_2f32.y > 0)
{
rd_cmd(RD_CmdKind_DecUIFontScale);
rd_cmd(RD_CmdKind_DecFontSize);
}
}
}
@@ -9383,7 +9348,6 @@ rd_lister_item_array_from_regs_needle_cursor_off(Arena *arena, RD_Regs *regs, St
{
Temp scratch = scratch_begin(&arena, 1);
DI_Scope *di_scope = di_scope_open();
RD_ListerFlags flags = regs->lister_flags;
String8 needle_path = rd_lister_query_path_from_input_string_off(needle, cursor_off);
RD_ListerItemChunkList item_list = {0};
DI_KeyList dbgi_keys_list = d_push_active_dbgi_key_list(scratch.arena);
@@ -10402,6 +10366,9 @@ rd_font_from_slot(RD_FontSlot slot)
internal F32
rd_font_size_from_slot(RD_FontSlot slot)
{
F32 result = (F32)rd_setting_u64_from_name(str8_lit("font_size"));
return result;
#if 0
F32 result = 11.f;
// rjf: determine config key based on slot
@@ -10430,8 +10397,8 @@ rd_font_size_from_slot(RD_FontSlot slot)
F32 dpi = os_dpi_from_window(ws->os);
result = 11.f * (dpi / 96.f);
}
return result;
#endif
}
internal FNT_RasterFlags
@@ -12501,7 +12468,7 @@ rd_frame(void)
// rjf: command has required query -> prep query
else
{
rd_cmd(RD_CmdKind_PushQuery, .lister_flags = rd_regs()->lister_flags|RD_ListerFlag_LineEdit|RD_ListerFlag_Commands|RD_ListerFlag_Descriptions);
rd_cmd(RD_CmdKind_PushQuery);
}
}break;
@@ -12822,42 +12789,24 @@ rd_frame(void)
}break;
//- rjf: font sizes
case RD_CmdKind_IncUIFontScale:
case RD_CmdKind_IncFontSize:
{
fnt_reset();
F32 current_font_size = rd_font_size_from_slot(RD_FontSlot_Main);
F32 new_font_size = clamp_1f32(r1f32(6, 72), current_font_size+1);
RD_Cfg *window = rd_cfg_from_id(rd_regs()->window);
RD_Cfg *main_font_size = rd_cfg_child_from_string_or_alloc(window, str8_lit("main_font_size"));
RD_Cfg *main_font_size = rd_cfg_child_from_string_or_alloc(window, str8_lit("font_size"));
rd_cfg_new_replacef(main_font_size, "%f", new_font_size);
}break;
case RD_CmdKind_DecUIFontScale:
case RD_CmdKind_DecFontSize:
{
fnt_reset();
F32 current_font_size = rd_font_size_from_slot(RD_FontSlot_Main);
F32 new_font_size = clamp_1f32(r1f32(6, 72), current_font_size-1);
RD_Cfg *window = rd_cfg_from_id(rd_regs()->window);
RD_Cfg *main_font_size = rd_cfg_child_from_string_or_alloc(window, str8_lit("main_font_size"));
RD_Cfg *main_font_size = rd_cfg_child_from_string_or_alloc(window, str8_lit("font_size"));
rd_cfg_new_replacef(main_font_size, "%f", new_font_size);
}break;
case RD_CmdKind_IncCodeFontScale:
{
fnt_reset();
F32 current_font_size = rd_font_size_from_slot(RD_FontSlot_Code);
F32 new_font_size = clamp_1f32(r1f32(6, 72), current_font_size+1);
RD_Cfg *window = rd_cfg_from_id(rd_regs()->window);
RD_Cfg *code_font_size = rd_cfg_child_from_string_or_alloc(window, str8_lit("code_font_size"));
rd_cfg_new_replacef(code_font_size, "%f", new_font_size);
}break;
case RD_CmdKind_DecCodeFontScale:
{
fnt_reset();
F32 current_font_size = rd_font_size_from_slot(RD_FontSlot_Code);
F32 new_font_size = clamp_1f32(r1f32(6, 72), current_font_size-1);
RD_Cfg *window = rd_cfg_from_id(rd_regs()->window);
RD_Cfg *code_font_size = rd_cfg_child_from_string_or_alloc(window, str8_lit("code_font_size"));
rd_cfg_new_replacef(code_font_size, "%f", new_font_size);
}break;
//- rjf: panel creation
case RD_CmdKind_NewPanelLeft: {split_dir = Dir2_Left;}goto split;
+1 -31
View File
@@ -159,37 +159,6 @@ enum
RD_CmdKindFlag_ListInIPCDocs = (1<<1),
};
////////////////////////////////
//~ rjf: Lister Flags
typedef U32 RD_ListerFlags;
enum
{
//- rjf: lister visual settings
RD_ListerFlag_LineEdit = (1<<0), // determines whether or not the lister has its own line edit, or if the filtering string is sourced by a user
RD_ListerFlag_Descriptions = (1<<1), // determines whether or not the lister items have descriptions (taller & bigger buttons)
RD_ListerFlag_KindLabel = (1<<2), // determines whether or not the lister items have labels for each item's kind
RD_ListerFlag_SizeByAnchor = (1<<3), // determines whether or not the lister is sized by the anchor box
//- rjf: lister item sources
RD_ListerFlag_Locals = (1<<4),
RD_ListerFlag_Registers = (1<<5),
RD_ListerFlag_ViewRules = (1<<6),
RD_ListerFlag_ViewRuleParams = (1<<7),
RD_ListerFlag_Members = (1<<8),
RD_ListerFlag_Globals = (1<<9),
RD_ListerFlag_ThreadLocals = (1<<10),
RD_ListerFlag_Procedures = (1<<11),
RD_ListerFlag_Types = (1<<12),
RD_ListerFlag_Languages = (1<<13),
RD_ListerFlag_Architectures = (1<<14),
RD_ListerFlag_Tex2DFormats = (1<<15),
RD_ListerFlag_Files = (1<<16),
RD_ListerFlag_Commands = (1<<17),
RD_ListerFlag_Settings = (1<<18),
RD_ListerFlag_SystemProcesses= (1<<19),
};
////////////////////////////////
//~ rjf: Generated Code
@@ -899,6 +868,7 @@ internal MD_Node *rd_schema_from_name(String8 name);
internal String8 rd_setting_from_name(String8 name);
#define rd_setting_b32_from_name(name) (str8_match(rd_setting_from_name(name), str8_lit("1"), 0))
#define rd_setting_u64_from_name(name) (u64_from_str8(rd_setting_from_name(name), 10))
#define rd_setting_f32_from_name(name) ((F32)f64_from_str8(rd_setting_from_name(name)))
internal RD_Cfg *rd_immediate_cfg_from_key(String8 string);
internal RD_Cfg *rd_immediate_cfg_from_keyf(char *fmt, ...);
+40 -15
View File
@@ -277,12 +277,20 @@ E_TYPE_EXPAND_RANGE_FUNCTION_DEF(registers)
////////////////////////////////
//~ rjf: Schema Type Hooks
typedef struct RD_SchemaNode RD_SchemaNode;
struct RD_SchemaNode
{
RD_SchemaNode *next;
MD_Node *schema;
};
typedef struct RD_SchemaIRExt RD_SchemaIRExt;
struct RD_SchemaIRExt
{
RD_Cfg *cfg;
CTRL_Entity *entity;
MD_Node *schema;
RD_SchemaNode *first_schema;
RD_SchemaNode *last_schema;
};
E_TYPE_IREXT_FUNCTION_DEF(schema)
@@ -298,7 +306,18 @@ E_TYPE_IREXT_FUNCTION_DEF(schema)
MD_Node *schema = rd_schema_from_name(type->name);
ext->cfg = rd_cfg_from_eval_space(interpret.space);
ext->entity = rd_ctrl_entity_from_eval_space(interpret.space);
ext->schema = schema;
for MD_EachNode(tag, schema->first_tag)
{
if(str8_match(tag->string, str8_lit("inherit"), 0))
{
RD_SchemaNode *n = push_array(arena, RD_SchemaNode, 1);
n->schema = rd_schema_from_name(tag->first->string);
SLLQueuePush(ext->first_schema, ext->last_schema, n);
}
}
RD_SchemaNode *n = push_array(arena, RD_SchemaNode, 1);
n->schema = schema;
SLLQueuePush(ext->first_schema, ext->last_schema, n);
scratch_end(scratch);
}
E_IRExt result = {ext};
@@ -312,12 +331,15 @@ E_TYPE_ACCESS_FUNCTION_DEF(schema)
if(expr->kind == E_ExprKind_MemberAccess)
{
MD_Node *child_schema = &md_nil_node;
for MD_EachNode(child, ext->schema->first)
for(RD_SchemaNode *n = ext->first_schema; n != 0; n = n->next)
{
if(str8_match(child->string, expr->first->next->string, 0))
for MD_EachNode(child, n->schema->first)
{
child_schema = child;
break;
if(str8_match(child->string, expr->first->next->string, 0))
{
child_schema = child;
break;
}
}
}
if(child_schema != &md_nil_node)
@@ -479,7 +501,6 @@ E_TYPE_EXPAND_INFO_FUNCTION_DEF(schema)
// rjf: unpack
RD_SchemaIRExt *ext = (RD_SchemaIRExt *)irtree->user_data;
MD_Node *schema = ext->schema;
// rjf: gather expansion children
typedef struct ExpandChildNode ExpandChildNode;
@@ -491,17 +512,21 @@ E_TYPE_EXPAND_INFO_FUNCTION_DEF(schema)
ExpandChildNode *first_child_node = 0;
ExpandChildNode *last_child_node = 0;
U64 child_count = 0;
for MD_EachNode(child, schema->first)
for(RD_SchemaNode *n = ext->first_schema; n != 0; n = n->next)
{
if(!md_node_has_tag(child, str8_lit("no_expand"), 0))
MD_Node *schema = n->schema;
for MD_EachNode(child, schema->first)
{
FuzzyMatchRangeList matches = fuzzy_match_find(scratch.arena, filter, child->string);
if(matches.count == matches.needle_part_count)
if(!md_node_has_tag(child, str8_lit("no_expand"), 0))
{
ExpandChildNode *n = push_array(scratch.arena, ExpandChildNode, 1);
n->n = child;
SLLQueuePush(first_child_node, last_child_node, n);
child_count += 1;
FuzzyMatchRangeList matches = fuzzy_match_find(scratch.arena, filter, child->string);
if(matches.count == matches.needle_part_count)
{
ExpandChildNode *n = push_array(scratch.arena, ExpandChildNode, 1);
n->n = child;
SLLQueuePush(first_child_node, last_child_node, n);
child_count += 1;
}
}
}
}
+6 -6
View File
@@ -34,7 +34,7 @@ rd_code_view_build(Arena *arena, RD_CodeViewState *cv, RD_CodeViewBuildFlags fla
//- rjf: extract invariants
//
FNT_Tag code_font = rd_font_from_slot(RD_FontSlot_Code);
F32 code_font_size = rd_font_size_from_slot(RD_FontSlot_Code);
F32 code_font_size = ui_top_font_size();
F32 code_tab_size = fnt_column_size_from_tag_size(code_font, code_font_size)*rd_setting_u64_from_name(str8_lit("tab_width"));
FNT_Metrics code_font_metrics = fnt_metrics_from_tag_size(code_font, code_font_size);
F32 code_line_height = ceil_f32(fnt_line_height_from_metrics(&code_font_metrics) * 1.5f);
@@ -779,11 +779,11 @@ rd_code_view_build(Arena *arena, RD_CodeViewState *cv, RD_CodeViewBuildFlags fla
ui_eat_event(evt);
if(evt->delta_2f32.y < 0)
{
rd_cmd(RD_CmdKind_IncCodeFontScale);
rd_cmd(RD_CmdKind_IncFontSize);
}
else if(evt->delta_2f32.y > 0)
{
rd_cmd(RD_CmdKind_DecCodeFontScale);
rd_cmd(RD_CmdKind_DecFontSize);
}
}
}
@@ -2270,7 +2270,7 @@ RD_VIEW_UI_FUNCTION_DEF(memory)
//
FNT_Tag font = rd_font_from_slot(RD_FontSlot_Code);
FNT_RasterFlags font_raster_flags = rd_raster_flags_from_slot(RD_FontSlot_Code);
F32 font_size = rd_font_size_from_slot(RD_FontSlot_Code);
F32 font_size = ui_top_font_size();
F32 big_glyph_advance = fnt_dim_from_tag_size_string(font, font_size, 0, 0, str8_lit("H")).x;
F32 row_height_px = floor_f32(font_size*2.f);
F32 cell_width_px = floor_f32(font_size*2.f * bytes_per_cell);
@@ -2735,11 +2735,11 @@ RD_VIEW_UI_FUNCTION_DEF(memory)
ui_eat_event(evt);
if(evt->delta_2f32.y < 0)
{
rd_cmd(RD_CmdKind_IncCodeFontScale);
rd_cmd(RD_CmdKind_IncFontSize);
}
else if(evt->delta_2f32.y > 0)
{
rd_cmd(RD_CmdKind_DecCodeFontScale);
rd_cmd(RD_CmdKind_DecFontSize);
}
}
}
-1
View File
@@ -116,7 +116,6 @@ struct RD_CodeSliceSignal
////////////////////////////////
//~ rjf: UI Building Helpers
#define RD_Palette(code) UI_Palette(rd_palette_from_code(code))
#define RD_Font(slot) UI_Font(rd_font_from_slot(slot)) UI_TextRasterFlags(rd_raster_flags_from_slot((slot)))
////////////////////////////////
+2
View File
@@ -1945,6 +1945,7 @@ ui_tooltip_begin_base(void)
ui_push_parent(ui_state->tooltip_root);
ui_push_flags(0);
ui_push_text_raster_flags(ui_bottom_text_raster_flags());
ui_push_font_size(ui_bottom_font_size());
ui_push_tag(str8_lit("."));
ui_push_tag(str8_lit("floating"));
}
@@ -1954,6 +1955,7 @@ ui_tooltip_end_base(void)
{
ui_pop_tag();
ui_pop_tag();
ui_pop_font_size();
ui_pop_text_raster_flags();
ui_pop_flags();
ui_pop_parent();