mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-06-17 17:42:22 -07:00
bindings resetting function
This commit is contained in:
@@ -60,7 +60,7 @@ str8_lit_comp(""),
|
||||
str8_lit_comp(""),
|
||||
};
|
||||
|
||||
RD_VocabInfo rd_vocab_info_table[340] =
|
||||
RD_VocabInfo rd_vocab_info_table[341] =
|
||||
{
|
||||
{str8_lit_comp("type_view"), str8_lit_comp("type_views"), str8_lit_comp("Type View"), str8_lit_comp("Type Views"), 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},
|
||||
@@ -223,6 +223,7 @@ RD_VocabInfo rd_vocab_info_table[340] =
|
||||
{str8_lit_comp("bring_to_front"), str8_lit_comp(""), str8_lit_comp("Bring To Front"), str8_lit_comp(""), RD_IconKind_Window},
|
||||
{str8_lit_comp("popup_accept"), str8_lit_comp(""), str8_lit_comp("Popup Accept"), str8_lit_comp(""), RD_IconKind_Null},
|
||||
{str8_lit_comp("popup_cancel"), str8_lit_comp(""), str8_lit_comp("Popup Cancel"), str8_lit_comp(""), RD_IconKind_Null},
|
||||
{str8_lit_comp("reset_to_default_bindings"), str8_lit_comp(""), str8_lit_comp("Reset To Default Bindings"), str8_lit_comp(""), RD_IconKind_Null},
|
||||
{str8_lit_comp("reset_to_default_panels"), str8_lit_comp(""), str8_lit_comp("Reset To Default Panel Layout"), str8_lit_comp(""), RD_IconKind_Window},
|
||||
{str8_lit_comp("reset_to_compact_panels"), str8_lit_comp(""), str8_lit_comp("Reset To Compact Panel Layout"), str8_lit_comp(""), RD_IconKind_Window},
|
||||
{str8_lit_comp("reset_to_simple_panels"), str8_lit_comp(""), str8_lit_comp("Reset To Simple Panel Layout"), str8_lit_comp(""), RD_IconKind_Window},
|
||||
@@ -479,7 +480,7 @@ Rng1U64 rd_reg_slot_range_table[43] =
|
||||
{OffsetOf(RD_Regs, os_event), OffsetOf(RD_Regs, os_event) + sizeof(OS_Event *)},
|
||||
};
|
||||
|
||||
RD_CmdKindInfo rd_cmd_kind_info_table[233] =
|
||||
RD_CmdKindInfo rd_cmd_kind_info_table[234] =
|
||||
{
|
||||
{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_CmdKindFlag_ListInTextPt*0)|(RD_CmdKindFlag_ListInTextRng*0), {(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}},
|
||||
@@ -535,6 +536,7 @@ RD_CmdKindInfo rd_cmd_kind_info_table[233] =
|
||||
{ str8_lit_comp("bring_to_front"), str8_lit_comp("Brings all windows to the front, and focuses the most recently focused window."), str8_lit_comp("top"), str8_lit_comp(""), (RD_CmdKindFlag_ListInUI*0)|(RD_CmdKindFlag_ListInIPCDocs*1)|(RD_CmdKindFlag_ListInTextPt*0)|(RD_CmdKindFlag_ListInTextRng*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("popup_accept"), str8_lit_comp("Accepts the active popup prompt."), str8_lit_comp(""), str8_lit_comp(""), (RD_CmdKindFlag_ListInUI*0)|(RD_CmdKindFlag_ListInIPCDocs*1)|(RD_CmdKindFlag_ListInTextPt*0)|(RD_CmdKindFlag_ListInTextRng*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("popup_cancel"), str8_lit_comp("Cancels the active popup prompt."), str8_lit_comp(""), str8_lit_comp(""), (RD_CmdKindFlag_ListInUI*0)|(RD_CmdKindFlag_ListInIPCDocs*1)|(RD_CmdKindFlag_ListInTextPt*0)|(RD_CmdKindFlag_ListInTextRng*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("reset_to_default_bindings"), str8_lit_comp("Resets all keybindings to their defaults."), str8_lit_comp(""), str8_lit_comp(""), (RD_CmdKindFlag_ListInUI*1)|(RD_CmdKindFlag_ListInIPCDocs*1)|(RD_CmdKindFlag_ListInTextPt*0)|(RD_CmdKindFlag_ListInTextRng*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("reset_to_default_panels"), str8_lit_comp("Resets the window to the default panel layout."), str8_lit_comp("panel"), str8_lit_comp(""), (RD_CmdKindFlag_ListInUI*1)|(RD_CmdKindFlag_ListInIPCDocs*1)|(RD_CmdKindFlag_ListInTextPt*0)|(RD_CmdKindFlag_ListInTextRng*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("reset_to_compact_panels"), str8_lit_comp("Resets the window to the compact panel layout."), str8_lit_comp("panel"), str8_lit_comp(""), (RD_CmdKindFlag_ListInUI*1)|(RD_CmdKindFlag_ListInIPCDocs*1)|(RD_CmdKindFlag_ListInTextPt*0)|(RD_CmdKindFlag_ListInTextRng*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("reset_to_simple_panels"), str8_lit_comp("Resets the window to the simple panel layout."), str8_lit_comp("panel"), str8_lit_comp(""), (RD_CmdKindFlag_ListInUI*1)|(RD_CmdKindFlag_ListInIPCDocs*1)|(RD_CmdKindFlag_ListInTextPt*0)|(RD_CmdKindFlag_ListInTextRng*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}},
|
||||
|
||||
@@ -110,6 +110,7 @@ RD_CmdKind_ToggleFullscreen,
|
||||
RD_CmdKind_BringToFront,
|
||||
RD_CmdKind_PopupAccept,
|
||||
RD_CmdKind_PopupCancel,
|
||||
RD_CmdKind_ResetToDefaultBindings,
|
||||
RD_CmdKind_ResetToDefaultPanels,
|
||||
RD_CmdKind_ResetToCompactPanels,
|
||||
RD_CmdKind_ResetToSimplePanels,
|
||||
@@ -567,7 +568,7 @@ Z(getting_started)\
|
||||
C_LINKAGE_BEGIN
|
||||
extern String8 rd_tab_fast_path_view_name_table[24];
|
||||
extern String8 rd_tab_fast_path_query_name_table[24];
|
||||
extern RD_VocabInfo rd_vocab_info_table[340];
|
||||
extern RD_VocabInfo rd_vocab_info_table[341];
|
||||
extern RD_NameSchemaInfo rd_name_schema_info_table[24];
|
||||
extern Rng1U64 rd_reg_slot_range_table[43];
|
||||
extern String8 rd_binding_version_remap_old_name_table[8];
|
||||
|
||||
@@ -810,6 +810,9 @@ RD_CmdTable: // | | | |
|
||||
{PopupAccept 0 1 0 0 "" Null null Nil Null 0 0 0 0 0 0 0 Null "popup_accept" "Popup Accept" "Accepts the active popup prompt." "" "" }
|
||||
{PopupCancel 0 1 0 0 "" Null null Nil Null 0 0 0 0 0 0 0 Null "popup_cancel" "Popup Cancel" "Cancels the active popup prompt." "" "" }
|
||||
|
||||
//- rjf: keybindings
|
||||
{ResetToDefaultBindings 1 1 0 0 "" Null null Nil Null 0 0 0 0 0 0 0 Null "reset_to_default_bindings" "Reset To Default Bindings" "Resets all keybindings to their defaults." "" "" }
|
||||
|
||||
//- rjf: panel splitting
|
||||
{ResetToDefaultPanels 1 1 0 0 "" Null null Nil Null 0 0 0 0 0 0 0 Window "reset_to_default_panels" "Reset To Default Panel Layout" "Resets the window to the default panel layout." "panel" "" }
|
||||
{ResetToCompactPanels 1 1 0 0 "" Null null Nil Null 0 0 0 0 0 0 0 Window "reset_to_compact_panels" "Reset To Compact Panel Layout" "Resets the window to the compact panel layout." "panel" "" }
|
||||
|
||||
+24
-16
@@ -12536,6 +12536,29 @@ rd_frame(void)
|
||||
rd_state->popup_key = ui_key_zero();
|
||||
}break;
|
||||
|
||||
//- rjf: keybindings
|
||||
case RD_CmdKind_ResetToDefaultBindings:
|
||||
{
|
||||
RD_Cfg *user = rd_cfg_child_from_string(rd_state->root_cfg, str8_lit("user"));
|
||||
RD_CfgList all_keybindings = rd_cfg_child_list_from_string(scratch.arena, user, str8_lit("keybindings"));
|
||||
for(RD_CfgNode *n = all_keybindings.first; n != 0; n = n->next)
|
||||
{
|
||||
rd_cfg_release(n->v);
|
||||
}
|
||||
RD_Cfg *keybindings = rd_cfg_new(user, str8_lit("keybindings"));
|
||||
for EachElement(idx, rd_default_binding_table)
|
||||
{
|
||||
String8 name = rd_default_binding_table[idx].string;
|
||||
RD_Binding binding = rd_default_binding_table[idx].binding;
|
||||
RD_Cfg *binding_root = rd_cfg_new(keybindings, str8_zero());
|
||||
rd_cfg_new(binding_root, name);
|
||||
rd_cfg_new(binding_root, os_g_key_cfg_string_table[binding.key]);
|
||||
if(binding.modifiers & OS_Modifier_Ctrl) {rd_cfg_newf(binding_root, "ctrl");}
|
||||
if(binding.modifiers & OS_Modifier_Shift) {rd_cfg_newf(binding_root, "shift");}
|
||||
if(binding.modifiers & OS_Modifier_Alt) {rd_cfg_newf(binding_root, "alt");}
|
||||
}
|
||||
}break;
|
||||
|
||||
//- rjf: config path saving/loading/applying
|
||||
case RD_CmdKind_OpenRecentProject:
|
||||
{
|
||||
@@ -12666,22 +12689,7 @@ rd_frame(void)
|
||||
//- rjf: if config did not define any keybindings for the user, then we need to build a sensible default
|
||||
if(file_is_okay && kind == RD_CmdKind_OpenUser)
|
||||
{
|
||||
RD_CfgList all_keybindings = rd_cfg_child_list_from_string(scratch.arena, file_root, str8_lit("keybindings"));
|
||||
if(all_keybindings.count == 0)
|
||||
{
|
||||
RD_Cfg *keybindings = rd_cfg_new(file_root, str8_lit("keybindings"));
|
||||
for EachElement(idx, rd_default_binding_table)
|
||||
{
|
||||
String8 name = rd_default_binding_table[idx].string;
|
||||
RD_Binding binding = rd_default_binding_table[idx].binding;
|
||||
RD_Cfg *binding_root = rd_cfg_new(keybindings, str8_zero());
|
||||
rd_cfg_new(binding_root, name);
|
||||
rd_cfg_new(binding_root, os_g_key_cfg_string_table[binding.key]);
|
||||
if(binding.modifiers & OS_Modifier_Ctrl) {rd_cfg_newf(binding_root, "ctrl");}
|
||||
if(binding.modifiers & OS_Modifier_Shift) {rd_cfg_newf(binding_root, "shift");}
|
||||
if(binding.modifiers & OS_Modifier_Alt) {rd_cfg_newf(binding_root, "alt");}
|
||||
}
|
||||
}
|
||||
rd_cmd(RD_CmdKind_ResetToDefaultBindings);
|
||||
}
|
||||
|
||||
//- rjf: record recently-opened projects in the user
|
||||
|
||||
@@ -210,12 +210,6 @@
|
||||
// attached (condition or label). (#407)
|
||||
// - Made several visual improvements.
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: 0.9.16 TODO notes
|
||||
//
|
||||
// [ ] maybe add extra caching layer to process memory querying? we pay a pretty
|
||||
// heavy cost even to just read 8 bytes...
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: post-0.9.16 TODO notes
|
||||
//
|
||||
@@ -306,6 +300,8 @@
|
||||
// [ ] audio waveform views
|
||||
//
|
||||
//- eval improvements
|
||||
// [ ] maybe add extra caching layer to process memory querying? we pay a pretty
|
||||
// heavy cost even to just read 8 bytes...
|
||||
// [ ] evaluate `foo.bar` symbol names without escape hatch?
|
||||
// [ ] serializing eval view maps (?)
|
||||
// [ ] EVAL LOOKUP RULES -> currently going 0 -> rdis_count, but we need
|
||||
|
||||
Reference in New Issue
Block a user