finish pass to convert everything over to ui events, eliminate nav actions; intermix os events & ui event production with commands

This commit is contained in:
Ryan Fleury
2024-05-13 11:48:42 -07:00
parent 58192b8356
commit e41eb9430f
11 changed files with 347 additions and 576 deletions
+18
View File
@@ -6490,6 +6490,24 @@ df_push_cmd__root(DF_CmdParams *params, DF_CmdSpec *spec)
if(params->voff != 0) { log_msgf("| voff: 0x%I64x\n", params->voff); }
if(params->index != 0) { log_msgf("| index: 0x%I64x\n", params->index); }
if(params->id != 0) { log_msgf("| id: 0x%I64x\n", params->id); }
if(params->os_event != 0)
{
String8 kind_string = str8_lit("<unknown>");
switch(params->os_event->kind)
{
default:{}break;
case OS_EventKind_Press: {kind_string = str8_lit("press");}break;
case OS_EventKind_Release: {kind_string = str8_lit("release");}break;
case OS_EventKind_MouseMove: {kind_string = str8_lit("mousemove");}break;
case OS_EventKind_Text: {kind_string = str8_lit("text");}break;
case OS_EventKind_Scroll: {kind_string = str8_lit("scroll");}break;
case OS_EventKind_WindowLoseFocus:{kind_string = str8_lit("losefocus");}break;
case OS_EventKind_WindowClose: {kind_string = str8_lit("closewindow");}break;
case OS_EventKind_FileDrop: {kind_string = str8_lit("filedrop");}break;
case OS_EventKind_Wakeup: {kind_string = str8_lit("wakeup");}break;
}
log_msgf("| os_event->kind: %S\n", kind_string);
}
#undef HandleParamPrint
log_msgf("--------------------------------\n");
scratch_end(scratch);
+4
View File
@@ -89,6 +89,7 @@ DF_CmdParamSlotTable:
{CmdSpec cmd_spec `struct DF_CmdSpec *`}
{ViewSpec view_spec `struct DF_ViewSpec *`}
{CfgNode cfg_node `struct DF_CfgNode *`}
{OSEvent os_event `struct OS_Event *`}
{VirtualAddr vaddr `U64`}
{VirtualOff voff `U64`}
{Index index `U64`}
@@ -114,6 +115,9 @@ DF_CoreCmdTable:// | | |
//- rjf: notifications
{Error 1 Null Nil 0 0 0 0 0 0 Null "error" "Error" "Notifies of an error." "" }
//- rjf: os event passthrough
{OSEvent 1 Null Nil 0 0 0 0 0 0 Null "os_event" "OS Event" "" "" }
//- rjf: low-level target control operations
{LaunchAndRun 0 EntityList Target 0 0 0 0 0 1 Play "launch_and_run" "Launch and Run" "Starts debugging a new instance of a target, then runs." "launch,start,run,target" }
{LaunchAndInit 0 EntityList Target 0 0 0 0 0 1 PlayStepForward "launch_and_init" "Launch and Initialize" "Starts debugging a new instance of a target, then stops at the program's entry point." "launch,start,entry,point" }
+4 -2
View File
@@ -4,7 +4,7 @@
//- GENERATED CODE
C_LINKAGE_BEGIN
Rng1U64 df_g_cmd_param_slot_range_table[21] =
Rng1U64 df_g_cmd_param_slot_range_table[22] =
{
{0},
{OffsetOf(DF_CmdParams, window), OffsetOf(DF_CmdParams, window) + sizeof(DF_Handle)},
@@ -20,6 +20,7 @@ Rng1U64 df_g_cmd_param_slot_range_table[21] =
{OffsetOf(DF_CmdParams, cmd_spec), OffsetOf(DF_CmdParams, cmd_spec) + sizeof(struct DF_CmdSpec *)},
{OffsetOf(DF_CmdParams, view_spec), OffsetOf(DF_CmdParams, view_spec) + sizeof(struct DF_ViewSpec *)},
{OffsetOf(DF_CmdParams, cfg_node), OffsetOf(DF_CmdParams, cfg_node) + sizeof(struct DF_CfgNode *)},
{OffsetOf(DF_CmdParams, os_event), OffsetOf(DF_CmdParams, os_event) + sizeof(struct OS_Event *)},
{OffsetOf(DF_CmdParams, vaddr), OffsetOf(DF_CmdParams, vaddr) + sizeof(U64)},
{OffsetOf(DF_CmdParams, voff), OffsetOf(DF_CmdParams, voff) + sizeof(U64)},
{OffsetOf(DF_CmdParams, index), OffsetOf(DF_CmdParams, index) + sizeof(U64)},
@@ -216,12 +217,13 @@ DF_CoreCmdKind_Null,
DF_CoreCmdKind_Null,
};
DF_CmdSpecInfo df_g_core_cmd_kind_spec_info_table[214] =
DF_CmdSpecInfo df_g_core_cmd_kind_spec_info_table[215] =
{
{ str8_lit_comp(""), str8_lit_comp(""), str8_lit_comp(""), str8_lit_comp(""), (DF_CmdSpecFlag_OmitFromLists*1), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Null},
{ str8_lit_comp("exit"), str8_lit_comp("Exits the debugger."), str8_lit_comp("quit,close,abort"), str8_lit_comp("Exit"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_X},
{ str8_lit_comp("run_command"), str8_lit_comp("Runs a command from the command palette."), str8_lit_comp("help,cmd"), str8_lit_comp("Run Command"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_CmdSpec, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Null},
{ str8_lit_comp("error"), str8_lit_comp("Notifies of an error."), str8_lit_comp(""), str8_lit_comp("Error"), (DF_CmdSpecFlag_OmitFromLists*1), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Null},
{ str8_lit_comp("os_event"), str8_lit_comp(""), str8_lit_comp(""), str8_lit_comp("OS Event"), (DF_CmdSpecFlag_OmitFromLists*1), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Null},
{ 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("Launch and Run"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_EntityList, DF_EntityKind_Target, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*1)}, DF_IconKind_Play},
{ str8_lit_comp("launch_and_init"), str8_lit_comp("Starts debugging a new instance of a target, then stops at the program's entry point."), str8_lit_comp("launch,start,entry,point"), str8_lit_comp("Launch and Initialize"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_EntityList, DF_EntityKind_Target, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*1)}, DF_IconKind_PlayStepForward},
{ str8_lit_comp("kill"), str8_lit_comp("Kills the specified existing debugged process(es)."), str8_lit_comp("stop,kill"), str8_lit_comp("Kill"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_EntityList, DF_EntityKind_Process, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*1)}, DF_IconKind_Stop},
+4 -1
View File
@@ -53,6 +53,7 @@ DF_CoreCmdKind_Null,
DF_CoreCmdKind_Exit,
DF_CoreCmdKind_RunCommand,
DF_CoreCmdKind_Error,
DF_CoreCmdKind_OSEvent,
DF_CoreCmdKind_LaunchAndRun,
DF_CoreCmdKind_LaunchAndInit,
DF_CoreCmdKind_Kill,
@@ -378,6 +379,7 @@ DF_CmdParamSlot_TextPoint,
DF_CmdParamSlot_CmdSpec,
DF_CmdParamSlot_ViewSpec,
DF_CmdParamSlot_CfgNode,
DF_CmdParamSlot_OSEvent,
DF_CmdParamSlot_VirtualAddr,
DF_CmdParamSlot_VirtualOff,
DF_CmdParamSlot_Index,
@@ -405,6 +407,7 @@ TxtPt text_point;
struct DF_CmdSpec * cmd_spec;
struct DF_ViewSpec * view_spec;
struct DF_CfgNode * cfg_node;
struct OS_Event * os_event;
U64 vaddr;
U64 voff;
U64 index;
@@ -1522,7 +1525,7 @@ struct {B32 *value_ptr; String8 name;} DEV_toggle_table[] =
{&DEV_updating_indicator, str8_lit_comp("updating_indicator")},
};
C_LINKAGE_BEGIN
extern Rng1U64 df_g_cmd_param_slot_range_table[21];
extern Rng1U64 df_g_cmd_param_slot_range_table[22];
extern DF_IconKind df_g_entity_kind_icon_kind_table[27];
extern String8 df_g_entity_kind_display_string_table[27];
extern String8 df_g_entity_kind_name_label_table[27];