TIghtene dup the listers a lot a lot more

master
Allen Webster 2019-10-25 16:33:50 -07:00
parent 6755d4e9ca
commit 14b71b8172
23 changed files with 902 additions and 870 deletions

27
4ed.cpp
View File

@ -7,7 +7,6 @@
* *
*/ */
// TOP // TOP
internal void internal void
@ -345,21 +344,21 @@ App_Init_Sig(app_init){
// NOTE(allen): live set // NOTE(allen): live set
Arena *arena = models->arena; Arena *arena = models->arena;
{ {
models->live_set.count = 0; models->view_set.count = 0;
models->live_set.max = MAX_VIEWS; models->view_set.max = MAX_VIEWS;
models->live_set.views = push_array(arena, View, models->live_set.max); models->view_set.views = push_array(arena, View, models->view_set.max);
//dll_init_sentinel //dll_init_sentinel
models->live_set.free_sentinel.next = &models->live_set.free_sentinel; models->view_set.free_sentinel.next = &models->view_set.free_sentinel;
models->live_set.free_sentinel.prev = &models->live_set.free_sentinel; models->view_set.free_sentinel.prev = &models->view_set.free_sentinel;
i32 max = models->live_set.max; i32 max = models->view_set.max;
View *view = models->live_set.views; View *view = models->view_set.views;
for (i32 i = 0; i < max; ++i, ++view){ for (i32 i = 0; i < max; ++i, ++view){
//dll_insert(&models->live_set.free_sentinel, view); //dll_insert(&models->view_set.free_sentinel, view);
view->next = models->live_set.free_sentinel.next; view->next = models->view_set.free_sentinel.next;
view->prev = &models->live_set.free_sentinel; view->prev = &models->view_set.free_sentinel;
models->live_set.free_sentinel.next = view; models->view_set.free_sentinel.next = view;
view->next->prev = view; view->next->prev = view;
} }
} }
@ -436,7 +435,7 @@ App_Init_Sig(app_init){
// NOTE(allen): setup first panel // NOTE(allen): setup first panel
{ {
Panel *panel = layout_initialize(arena, &models->layout); Panel *panel = layout_initialize(arena, &models->layout);
View *new_view = live_set_alloc_view(&models->lifetime_allocator, &models->live_set, panel); View *new_view = live_set_alloc_view(&models->lifetime_allocator, &models->view_set, panel);
view_init(tctx, models, new_view, models->scratch_buffer, models->view_event_handler); view_init(tctx, models, new_view, models->scratch_buffer, models->view_event_handler);
} }
@ -833,7 +832,7 @@ App_Step_Sig(app_step){
begin_render_section(target, models->frame_counter, literal_dt, animation_dt); begin_render_section(target, models->frame_counter, literal_dt, animation_dt);
models->in_render_mode = true; models->in_render_mode = true;
Live_Views *live_views = &models->live_set; Live_Views *live_views = &models->view_set;
for (Node *node = layout->open_panels.next; for (Node *node = layout->open_panels.next;
node != &layout->open_panels; node != &layout->open_panels;
node = node->next){ node = node->next){

View File

@ -966,7 +966,7 @@ get_view_next(Application_Links *app, View_ID view_id, Access_Flag access)
} }
View_ID result = 0; View_ID result = 0;
if (view != 0){ if (view != 0){
result = view_get_id(&models->live_set, view); result = view_get_id(&models->view_set, view);
} }
return(result); return(result);
} }
@ -983,7 +983,24 @@ get_view_prev(Application_Links *app, View_ID view_id, Access_Flag access)
} }
View_ID result = 0; View_ID result = 0;
if (view != 0){ if (view != 0){
result = view_get_id(&models->live_set, view); result = view_get_id(&models->view_set, view);
}
return(result);
}
api(custom) function View_ID
get_this_ctx_view(Application_Links *app, Access_Flag access)
{
Models *models = (Models*)app->cmd_context;
Thread_Context *tctx = app->tctx;
Thread_Context_Extra_Info *tctx_info = (Thread_Context_Extra_Info*)tctx->user_data;
View_ID result = 0;
if (tctx_info->coroutine != 0){
Coroutine *coroutine = (Coroutine*)tctx_info->coroutine;
View *view = (View*)coroutine->user_data;
if (view != 0){
result = view_get_id(&models->view_set, view);
}
} }
return(result); return(result);
} }
@ -998,7 +1015,7 @@ get_active_view(Application_Links *app, Access_Flag access)
Assert(view != 0); Assert(view != 0);
View_ID result = 0; View_ID result = 0;
if (api_check_view(view, access)){ if (api_check_view(view, access)){
result = view_get_id(&models->live_set, view); result = view_get_id(&models->view_set, view);
} }
return(result); return(result);
} }
@ -1119,7 +1136,7 @@ panel_get_view(Application_Links *app, Panel_ID panel_id, Access_Flag access){
if (panel->kind == PanelKind_Final){ if (panel->kind == PanelKind_Final){
View *view = panel->view; View *view = panel->view;
if (api_check_view(view, access)){ if (api_check_view(view, access)){
result = view_get_id(&models->live_set, view); result = view_get_id(&models->view_set, view);
} }
} }
} }
@ -1162,9 +1179,9 @@ panel_split(Application_Links *app, Panel_ID panel_id, Dimension split_dim){
Panel *new_panel = 0; Panel *new_panel = 0;
if (layout_split_panel(layout, panel, (split_dim == Dimension_X), if (layout_split_panel(layout, panel, (split_dim == Dimension_X),
&new_panel)){ &new_panel)){
Live_Views *live_set = &models->live_set; Live_Views *view_set = &models->view_set;
View *new_view = live_set_alloc_view(&models->lifetime_allocator, View *new_view = live_set_alloc_view(&models->lifetime_allocator,
live_set, new_panel); view_set, new_panel);
view_init(app->tctx, models, new_view, models->scratch_buffer, view_init(app->tctx, models, new_view, models->scratch_buffer,
models->view_event_handler); models->view_event_handler);
result = true; result = true;
@ -2031,7 +2048,6 @@ get_next_input(Application_Links *app, Event_Property get_properties, Event_Prop
User_Input result = {}; User_Input result = {};
if (tctx_info->coroutine != 0){ if (tctx_info->coroutine != 0){
Coroutine *coroutine = (Coroutine*)tctx_info->coroutine; Coroutine *coroutine = (Coroutine*)tctx_info->coroutine;
if (coroutine != 0){
Co_Out *out = (Co_Out*)coroutine->out; Co_Out *out = (Co_Out*)coroutine->out;
out->request = CoRequest_None; out->request = CoRequest_None;
out->get_flags = get_properties; out->get_flags = get_properties;
@ -2045,7 +2061,6 @@ get_next_input(Application_Links *app, Event_Property get_properties, Event_Prop
print_message(app, string_u8_litexpr(M)); print_message(app, string_u8_litexpr(M));
#undef M #undef M
} }
}
return(result); return(result);
} }

View File

@ -68,7 +68,7 @@ struct Models{
Layout layout; Layout layout;
Working_Set working_set; Working_Set working_set;
Live_Views live_set; Live_Views view_set;
Global_History global_history; Global_History global_history;
Text_Layout_Container text_layouts; Text_Layout_Container text_layouts;
Font_Set font_set; Font_Set font_set;

View File

@ -41,6 +41,7 @@ struct Coroutine{
Coroutine *yield_ctx; Coroutine *yield_ctx;
Coroutine_State state; Coroutine_State state;
Coroutine_Type type; Coroutine_Type type;
void *user_data;
}; };
struct Coroutine_Group{ struct Coroutine_Group{

View File

@ -156,7 +156,7 @@ view_get_buffer_rect(Thread_Context *tctx, Models *models, View *view){
Application_Links app = {}; Application_Links app = {};
app.tctx = tctx; app.tctx = tctx;
app.cmd_context = models; app.cmd_context = models;
sub_region = models->buffer_region(&app, view_get_id(&models->live_set, view), sub_region); sub_region = models->buffer_region(&app, view_get_id(&models->view_set, view), sub_region);
region.p0 = rect.p0 + sub_region.p0; region.p0 = rect.p0 + sub_region.p0;
region.p1 = rect.p0 + sub_region.p1; region.p1 = rect.p0 + sub_region.p1;
region.x1 = clamp_top(region.x1, rect.x1); region.x1 = clamp_top(region.x1, rect.x1);
@ -526,6 +526,7 @@ view_init(Thread_Context *tctx, Models *models, View *view, Editing_File *initia
view_push_context(view, &first_ctx); view_push_context(view, &first_ctx);
view->co = coroutine_create(&models->coroutines, view_event_context_base__inner); view->co = coroutine_create(&models->coroutines, view_event_context_base__inner);
view->co->user_data = view;
Co_In in = {}; Co_In in = {};
in.models = models; in.models = models;
in.event_context_base = event_context_base; in.event_context_base = event_context_base;
@ -539,7 +540,7 @@ view_close(Models *models, View *view){
Layout *layout = &models->layout; Layout *layout = &models->layout;
b32 result = false; b32 result = false;
if (layout_close_panel(layout, view->panel)){ if (layout_close_panel(layout, view->panel)){
live_set_free_view(&models->lifetime_allocator, &models->live_set, view); live_set_free_view(&models->lifetime_allocator, &models->view_set, view);
result = true; result = true;
} }
return(result); return(result);
@ -745,11 +746,11 @@ finalize_color(Color_Table color_table, FColor fcolor){
internal View* internal View*
imp_get_view(Models *models, View_ID view_id){ imp_get_view(Models *models, View_ID view_id){
Live_Views *live_set = &models->live_set; Live_Views *view_set = &models->view_set;
View *view = 0; View *view = 0;
view_id -= 1; view_id -= 1;
if (0 <= view_id && view_id < live_set->max){ if (0 <= view_id && view_id < view_set->max){
view = live_set->views + view_id; view = view_set->views + view_id;
if (!view->in_use){ if (!view->in_use){
view = 0; view = 0;
} }

View File

@ -195,46 +195,58 @@ static Snippet default_snippets[] = {
#endif #endif
}; };
static Lister_Activation_Code function void
activate_snippet(Application_Links *app, View_ID view, Lister *lister, String_Const_u8 text_field, void *user_data, b32 activated_by_mouse){ write_snippet(Application_Links *app, View_ID view, Buffer_ID buffer,
i32 index = (i32)PtrAsInt(user_data); i64 pos, Snippet *snippet){
Snippet_Array snippets = *(Snippet_Array*)lister->user_data; String_Const_u8 snippet_text = SCu8(snippet->text);
if (0 <= index && index < snippets.count){ buffer_replace_range(app, buffer, Ii64(pos), snippet_text);
Snippet snippet = snippets.snippets[index]; i64 new_cursor = pos + snippet->cursor_offset;
lister_default(app, view, lister, ListerActivation_Finished); view_set_cursor_and_preferred_x(app, view, seek_pos(new_cursor));
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadWriteVisible); i64 new_mark = pos + snippet->mark_offset;
i64 pos = view_get_cursor_pos(app, view); view_set_mark(app, view, seek_pos(new_mark));
buffer_replace_range(app, buffer, Ii64(pos), SCu8(snippet.text)); auto_indent_buffer(app, buffer, Ii64_size(pos, snippet_text.size));
view_set_cursor_and_preferred_x(app, view, seek_pos(pos + snippet.cursor_offset));
view_set_mark(app, view, seek_pos(pos + snippet.mark_offset));
}
else{
lister_default(app, view, lister, ListerActivation_Finished);
}
return(ListerActivation_Finished);
} }
static void function Snippet*
snippet_lister__parameterized(Application_Links *app, Snippet_Array snippet_array){ get_snippet_from_user(Application_Links *app, Snippet *snippets, i32 snippet_count,
View_ID view = get_active_view(app, Access_Always); String_Const_u8 query){
Scratch_Block scratch(app, Scratch_Share); Scratch_Block scratch(app, Scratch_Share);
i32 option_count = snippet_array.count; Lister *lister = begin_lister(app, scratch);
Lister_Option *options = push_array(scratch, Lister_Option, option_count); lister_set_query(lister, query);
for (i32 i = 0; i < snippet_array.count; i += 1){ lister->handlers = lister_get_default_handlers();
options[i].string = SCu8(snippet_array.snippets[i].name);
options[i].status = SCu8(snippet_array.snippets[i].text); Snippet *snippet = snippets;
options[i].user_data = IntAsPtr(i); for (i32 i = 0; i < snippet_count; i += 1, snippet += 1){
lister_add_item(lister, SCu8(snippet->name), SCu8(snippet->text), snippet, 0);
} }
run_lister_with_options_array(app, "Snippet:", activate_snippet, &snippet_array, sizeof(snippet_array), options, option_count, 0, view); Lister_Result l_result = run_lister(app, lister);
Snippet *result = 0;
if (!l_result.canceled){
result = (Snippet*)l_result.user_data;
}
return(result);
}
function Snippet*
get_snippet_from_user(Application_Links *app, Snippet *snippets, i32 snippet_count,
char *query){
return(get_snippet_from_user(app, snippets, snippet_count, SCu8(query)));
} }
CUSTOM_COMMAND_SIG(snippet_lister) CUSTOM_COMMAND_SIG(snippet_lister)
CUSTOM_DOC("Opens a snippet lister for inserting whole pre-written snippets of text.") CUSTOM_DOC("Opens a snippet lister for inserting whole pre-written snippets of text.")
{ {
Snippet_Array snippet_array = {}; View_ID view = get_this_ctx_view(app, Access_ReadWrite);
snippet_array.snippets = default_snippets; if (view != 0){
snippet_array.count = ArrayCount(default_snippets); Snippet *snippet = get_snippet_from_user(app, default_snippets,
snippet_lister__parameterized(app, snippet_array); ArrayCount(default_snippets),
"Snippet:");
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadWriteVisible);
i64 pos = view_get_cursor_pos(app, view);
write_snippet(app, view, buffer, pos, snippet);
}
} }
// BOTTOM // BOTTOM

View File

@ -73,10 +73,10 @@ typedef void View_Render_Hook(Application_Links *app, View_ID view, Frame_Info f
//////////////////////////////// ////////////////////////////////
function b32 function b32
do_gui_sure_to_kill(Application_Links *app, Buffer_ID buffer, View_ID view); do_buffer_kill_user_check(Application_Links *app, Buffer_ID buffer, View_ID view);
function b32 function b32
do_gui_sure_to_close_4coder(Application_Links *app, View_ID view); do_4coder_close_user_check(Application_Links *app, View_ID view);
#endif #endif

View File

@ -38,7 +38,7 @@ CUSTOM_DOC("Default command for responding to a try-exit event")
} }
if (has_unsaved_changes){ if (has_unsaved_changes){
View_ID view = get_active_view(app, Access_Always); View_ID view = get_active_view(app, Access_Always);
do_exit = do_gui_sure_to_close_4coder(app, view); do_exit = do_4coder_close_user_check(app, view);
} }
} }
if (do_exit){ if (do_exit){

View File

@ -282,7 +282,13 @@ CUSTOM_DOC("Creates a lister of locations that look like function definitions an
if (buffer != 0){ if (buffer != 0){
list_all_functions(app, buffer); list_all_functions(app, buffer);
view = get_active_view(app, Access_Always); view = get_active_view(app, Access_Always);
open_jump_lister(app, &global_heap, view, buffer, JumpListerActivation_OpenInUIView, 0); buffer = view_get_buffer(app, view, Access_Always);
Marker_List *list = get_marker_list_for_buffer(buffer);
if (list != 0){
Jump_Lister_Result jump = get_jump_index_from_user(app, list,
"Function:");
jump_to_jump_lister_result(app, view, list, &jump);
}
} }
} }
@ -298,7 +304,12 @@ CUSTOM_DOC("Creates a lister of locations that look like function definitions an
list_all_functions(app, 0); list_all_functions(app, 0);
View_ID view = get_active_view(app, Access_Always); View_ID view = get_active_view(app, Access_Always);
Buffer_ID buffer = view_get_buffer(app, view, Access_Always); Buffer_ID buffer = view_get_buffer(app, view, Access_Always);
open_jump_lister(app, &global_heap, view, buffer, JumpListerActivation_OpenInUIView, 0); Marker_List *list = get_marker_list_for_buffer(buffer);
if (list != 0){
Jump_Lister_Result jump = get_jump_index_from_user(app, list,
"Function:");
jump_to_jump_lister_result(app, view, list, &jump);
}
} }
// BOTTOM // BOTTOM

View File

@ -1803,7 +1803,7 @@ internal Buffer_Kill_Result
try_buffer_kill(Application_Links *app, Buffer_ID buffer, View_ID gui_view_id, Buffer_Kill_Flag flags){ try_buffer_kill(Application_Links *app, Buffer_ID buffer, View_ID gui_view_id, Buffer_Kill_Flag flags){
Buffer_Kill_Result result = buffer_kill(app, buffer, flags); Buffer_Kill_Result result = buffer_kill(app, buffer, flags);
if (result == BufferKillResult_Dirty){ if (result == BufferKillResult_Dirty){
if (do_gui_sure_to_kill(app, buffer, gui_view_id)){ if (do_buffer_kill_user_check(app, buffer, gui_view_id)){
result = buffer_kill(app, buffer, BufferKill_AlwaysKill); result = buffer_kill(app, buffer, BufferKill_AlwaysKill);
} }
} }

View File

@ -4,100 +4,55 @@
// TOP // TOP
static Lister_Activation_Code function Jump_Lister_Result
activate_jump(Application_Links *app, get_jump_index_from_user(Application_Links *app, Marker_List *list,
View_ID view, Lister *lister, String_Const_u8 query){
String_Const_u8 text_field, void *user_data, b32 activated_by_mouse){ Jump_Lister_Result result = {};
Lister_Activation_Code result_code = ListerActivation_Finished;
i32 list_index = (i32)PtrAsInt(user_data);
Jump_Lister_Parameters *params = (Jump_Lister_Parameters*)lister->user_data;
Marker_List *list = get_marker_list_for_buffer(params->list_buffer_id);
if (list != 0){ if (list != 0){
View_ID target_view = {};
switch (params->activation_rule){
case JumpListerActivation_OpenInUIView:
{
target_view = view;
result_code = ListerActivation_Finished;
}break;
case JumpListerActivation_OpenInTargetViewKeepUI:
{
target_view = params->target_view_id;;
result_code = ListerActivation_Continue;
}break;
case JumpListerActivation_OpenInTargetViewCloseUI:
{
target_view = params->target_view_id;
result_code = ListerActivation_Finished;
}break;
case JumpListerActivation_OpenInNextViewKeepUI:
{
target_view = view;
target_view = get_next_view_looped_primary_panels(app, target_view,
Access_Always);
result_code = ListerActivation_Continue;
}break;
case JumpListerActivation_OpenInNextViewCloseUI:
{
target_view = view;
target_view = get_next_view_looped_primary_panels(app, target_view,
Access_Always);
result_code = ListerActivation_Finished;
}break;
}
ID_Pos_Jump_Location location = {};
if (get_jump_from_list(app, list, list_index, &location)){
Buffer_ID buffer = {};
if (get_jump_buffer(app, &buffer, &location)){
view_set_active(app, target_view);
jump_to_location(app, target_view, buffer, location);
}
}
}
lister_default(app, view, lister, result_code);
return(result_code);
}
static void
open_jump_lister(Application_Links *app, Heap *heap, View_ID ui_view, Buffer_ID list_buffer_id, Jump_Lister_Activation_Rule activation_rule, View_ID optional_target_view){
Marker_List *list = get_or_make_list_for_buffer(app, heap, list_buffer_id);
if (list != 0){
i32 estimated_string_space_size = 0;
Scratch_Block scratch(app); Scratch_Block scratch(app);
Lister *lister = begin_lister(app, scratch);
lister_set_query(lister, query);
lister->handlers = lister_get_default_handlers();
Buffer_ID list_buffer = list->buffer_id;
i32 option_count = list->jump_count; i32 option_count = list->jump_count;
Lister_Option *options = push_array(scratch, Lister_Option, option_count);
Managed_Object stored_jumps = list->jump_array; Managed_Object stored_jumps = list->jump_array;
for (i32 i = 0; i < option_count; i += 1){ for (i32 i = 0; i < option_count; i += 1){
Sticky_Jump_Stored stored = {}; Sticky_Jump_Stored stored = {};
managed_object_load_data(app, stored_jumps, i, 1, &stored); managed_object_load_data(app, stored_jumps, i, 1, &stored);
String_Const_u8 line = push_buffer_line(app, scratch, list_buffer_id, stored.list_line); String_Const_u8 line = push_buffer_line(app, scratch, list_buffer,
options[i].string = line; stored.list_line);
block_zero_struct(&options[i].status); lister_add_item(lister, line, SCu8(), IntAsPtr(i), 0);
options[i].user_data = IntAsPtr(i);
i32 aligned_size = ((i32)line.size) + 1 + 7;
aligned_size = aligned_size - aligned_size%8;
estimated_string_space_size += aligned_size;
} }
Jump_Lister_Parameters jump_lister_params = {}; Lister_Result l_result = run_lister(app, lister);
jump_lister_params.list_buffer_id = list_buffer_id; if (!l_result.canceled){
jump_lister_params.activation_rule = activation_rule; result.success = true;
if (optional_target_view != 0){ result.index = (i32)PtrAsInt(l_result.user_data);
jump_lister_params.target_view_id = optional_target_view; }
} }
run_lister_with_options_array(app, "Jump:", activate_jump, return(result);
&jump_lister_params, sizeof(jump_lister_params), }
options, option_count,
estimated_string_space_size, function Jump_Lister_Result
ui_view); get_jump_index_from_user(Application_Links *app, Marker_List *list, char *query){
return(get_jump_index_from_user(app, list, SCu8(query)));
}
function void
jump_to_jump_lister_result(Application_Links *app, View_ID view,
Marker_List *list, Jump_Lister_Result *jump){
if (jump->success){
ID_Pos_Jump_Location location = {};
if (get_jump_from_list(app, list, jump->index, &location)){
Buffer_ID jump_dst_buffer = {};
if (get_jump_buffer(app, &jump_dst_buffer, &location)){
view_set_active(app, view);
jump_to_location(app, view, jump_dst_buffer, location);
}
}
} }
} }
@ -106,7 +61,11 @@ CUSTOM_DOC("When executed on a buffer with jumps, creates a persistent lister fo
{ {
View_ID view = get_active_view(app, Access_Always); View_ID view = get_active_view(app, Access_Always);
Buffer_ID buffer = view_get_buffer(app, view, Access_Always); Buffer_ID buffer = view_get_buffer(app, view, Access_Always);
open_jump_lister(app, &global_heap, view, buffer, JumpListerActivation_OpenInNextViewKeepUI, 0); Marker_List *list = get_marker_list_for_buffer(buffer);
if (list != 0){
Jump_Lister_Result jump = get_jump_index_from_user(app, list, "Jump:");
jump_to_jump_lister_result(app, view, list, &jump);
}
} }
// BOTTOM // BOTTOM

View File

@ -4,6 +4,9 @@
// TOP // TOP
#if !defined(FCODER_JUMP_LISTER_H)
#define FCODER_JUMP_LISTER_H
typedef i32 Jump_Lister_Activation_Rule; typedef i32 Jump_Lister_Activation_Rule;
enum{ enum{
JumpListerActivation_OpenInUIView = 0, JumpListerActivation_OpenInUIView = 0,
@ -19,4 +22,11 @@ struct Jump_Lister_Parameters{
View_ID target_view_id; View_ID target_view_id;
}; };
struct Jump_Lister_Result{
b32 success;
i32 index;
};
#endif
// BOTTOM // BOTTOM

View File

@ -58,18 +58,13 @@ lister_set_map(Lister *lister, Mapping *mapping, Command_Map_ID map){
} }
function Lister* function Lister*
begin_lister(Application_Links *app, Arena *arena, View_ID view, begin_lister(Application_Links *app, Arena *arena){
void *user_data, umem user_data_size){
Lister *lister = push_array_zero(arena, Lister, 1); Lister *lister = push_array_zero(arena, Lister, 1);
lister->arena = arena; lister->arena = arena;
lister->query = Su8(lister->query_space, 0, sizeof(lister->query_space)); lister->query = Su8(lister->query_space, 0, sizeof(lister->query_space));
lister->text_field = Su8(lister->text_field_space, 0, sizeof(lister->text_field_space)); lister->text_field = Su8(lister->text_field_space, 0, sizeof(lister->text_field_space));
lister->key_string = Su8(lister->key_string_space, 0, sizeof(lister->key_string_space)); lister->key_string = Su8(lister->key_string_space, 0, sizeof(lister->key_string_space));
lister->user_data = user_data; View_ID view = get_this_ctx_view(app, Access_Always);
lister->user_data_size = user_data_size;
if (user_data == 0){
lister->user_data = push_array_zero(arena, u8, user_data_size);
}
global_lister_state[view - 1] = lister; global_lister_state[view - 1] = lister;
lister->restore_all_point = begin_temp(lister->arena); lister->restore_all_point = begin_temp(lister->arena);
View_Context ctx = view_current_context(app, view); View_Context ctx = view_current_context(app, view);
@ -196,6 +191,7 @@ lister_render(Application_Links *app, Frame_Info frame_info, View_ID view){
V2f32(text_field_rect.x0 + 3.f, text_field_rect.y0)); V2f32(text_field_rect.x0 + 3.f, text_field_rect.y0));
} }
Range_f32 x = rect_range_x(list_rect); Range_f32 x = rect_range_x(list_rect);
draw_set_clip(app, list_rect); draw_set_clip(app, list_rect);
@ -363,7 +359,7 @@ lister_update_selection_values(Lister *lister){
} }
function void function void
lister_update_filtered_list(Application_Links *app, View_ID view, Lister *lister){ lister_update_filtered_list(Application_Links *app, Lister *lister){
Scratch_Block scratch(app, Scratch_Share); Scratch_Block scratch(app, Scratch_Share);
Lister_Filtered filtered = lister_get_filtered(scratch, lister); Lister_Filtered filtered = lister_get_filtered(scratch, lister);
@ -400,45 +396,19 @@ lister_update_filtered_list(Application_Links *app, View_ID view, Lister *lister
} }
function void function void
lister_call_refresh_handler(Application_Links *app, View_ID view, Lister *lister){ lister_call_refresh_handler(Application_Links *app, Lister *lister){
if (lister->handlers.refresh != 0){ if (lister->handlers.refresh != 0){
lister->handlers.refresh(app, lister); lister->handlers.refresh(app, lister);
lister->filter_restore_point = begin_temp(lister->arena); lister->filter_restore_point = begin_temp(lister->arena);
lister_update_filtered_list(app, view, lister); lister_update_filtered_list(app, lister);
} }
} }
function void function void
lister_default(Application_Links *app, View_ID view, Lister *lister, Lister_Activation_Code code){ lister_activate(Application_Links *app, Lister *lister, void *user_data, b32 mouse){
switch (code){ lister->out.activated_by_click = mouse;
case ListerActivation_Finished: lister->out.text_field = lister->text_field.string;
{}break;
case ListerActivation_Continue:
{}break;
case ListerActivation_ContinueAndRefresh:
{
lister->item_index = 0;
lister_call_refresh_handler(app, view, lister);
}break;
}
}
function Lister_Activation_Code
lister_call_activate_handler(Application_Links *app, View_ID view, Lister *lister,
void *user_data, b32 activated_by_mouse){
Lister_Activation_Code result = ListerActivation_Finished;
if (lister->handlers.activate != 0){
result = lister->handlers.activate(app, view, lister, lister->text_field.string,
user_data, activated_by_mouse);
}
else{
lister_default(app, view, lister, ListerActivation_Finished);
}
lister->out.user_data = user_data; lister->out.user_data = user_data;
lister->out.activated_by_click = activated_by_mouse;
return(result);
} }
function void* function void*
@ -478,10 +448,11 @@ lister_user_data_at_p(Application_Links *app, View_ID view, Lister *lister, Vec2
} }
function Lister_Result function Lister_Result
run_lister(Application_Links *app, View_ID view, Lister *lister){ run_lister(Application_Links *app, Lister *lister){
lister->filter_restore_point = begin_temp(lister->arena); lister->filter_restore_point = begin_temp(lister->arena);
lister_update_filtered_list(app, view, lister); lister_update_filtered_list(app, lister);
View_ID view = get_this_ctx_view(app, Access_Always);;
View_Context ctx = view_current_context(app, view); View_Context ctx = view_current_context(app, view);
ctx.render_caller = lister_render; ctx.render_caller = lister_render;
ctx.hides_buffer = true; ctx.hides_buffer = true;
@ -517,8 +488,8 @@ run_lister(Application_Links *app, View_ID view, Lister *lister){
lister->raw_item_index < lister->options.count){ lister->raw_item_index < lister->options.count){
user_data = lister_get_user_data(lister, lister->raw_item_index); user_data = lister_get_user_data(lister, lister->raw_item_index);
} }
result = lister_call_activate_handler(app, view, lister, lister_activate(app, lister, user_data, false);
user_data, false); result = ListerActivation_Finished;
}break; }break;
case KeyCode_Backspace: case KeyCode_Backspace:
@ -539,6 +510,9 @@ run_lister(Application_Links *app, View_ID view, Lister *lister){
if (lister->handlers.navigate != 0){ if (lister->handlers.navigate != 0){
lister->handlers.navigate(app, view, lister, -1); lister->handlers.navigate(app, view, lister, -1);
} }
else if (lister->handlers.key_stroke != 0){
result = lister->handlers.key_stroke(app);
}
else{ else{
handled = false; handled = false;
} }
@ -549,6 +523,9 @@ run_lister(Application_Links *app, View_ID view, Lister *lister){
if (lister->handlers.navigate != 0){ if (lister->handlers.navigate != 0){
lister->handlers.navigate(app, view, lister, 1); lister->handlers.navigate(app, view, lister, 1);
} }
else if (lister->handlers.key_stroke != 0){
result = lister->handlers.key_stroke(app);
}
else{ else{
handled = false; handled = false;
} }
@ -560,6 +537,9 @@ run_lister(Application_Links *app, View_ID view, Lister *lister){
lister->handlers.navigate(app, view, lister, lister->handlers.navigate(app, view, lister,
-lister->visible_count); -lister->visible_count);
} }
else if (lister->handlers.key_stroke != 0){
result = lister->handlers.key_stroke(app);
}
else{ else{
handled = false; handled = false;
} }
@ -571,6 +551,9 @@ run_lister(Application_Links *app, View_ID view, Lister *lister){
lister->handlers.navigate(app, view, lister, lister->handlers.navigate(app, view, lister,
lister->visible_count); lister->visible_count);
} }
else if (lister->handlers.key_stroke != 0){
result = lister->handlers.key_stroke(app);
}
else{ else{
handled = false; handled = false;
} }
@ -614,8 +597,8 @@ run_lister(Application_Links *app, View_ID view, Lister *lister){
Vec2_f32 p = V2f32(in.event.mouse.p); Vec2_f32 p = V2f32(in.event.mouse.p);
void *clicked = lister_user_data_at_p(app, view, lister, p); void *clicked = lister_user_data_at_p(app, view, lister, p);
if (lister->hot_user_data == clicked){ if (lister->hot_user_data == clicked){
result = lister_call_activate_handler(app, view, lister, lister_activate(app, lister, clicked, true);
clicked, true); result = ListerActivation_Finished;
} }
} }
lister->hot_user_data = 0; lister->hot_user_data = 0;
@ -632,13 +615,13 @@ run_lister(Application_Links *app, View_ID view, Lister *lister){
{ {
Mouse_State mouse = get_mouse_state(app); Mouse_State mouse = get_mouse_state(app);
lister->scroll.target.y += mouse.wheel; lister->scroll.target.y += mouse.wheel;
lister_update_filtered_list(app, view, lister); lister_update_filtered_list(app, lister);
}break; }break;
case InputEventKind_MouseMove: case InputEventKind_MouseMove:
case InputEventKind_Core: case InputEventKind_Core:
{ {
lister_update_filtered_list(app, view, lister); lister_update_filtered_list(app, lister);
}break; }break;
default: default:
@ -652,7 +635,6 @@ run_lister(Application_Links *app, View_ID view, Lister *lister){
} }
if (!handled){ if (!handled){
// TODO(allen): dedup this stuff.
Mapping *mapping = lister->mapping; Mapping *mapping = lister->mapping;
Command_Map *map = lister->map; Command_Map *map = lister->map;
if (ui_fallback_command_dispatch(app, view, mapping, map, &in)){ if (ui_fallback_command_dispatch(app, view, mapping, map, &in)){
@ -729,7 +711,7 @@ lister__write_string__default(Application_Links *app){
lister_append_key(lister, string); lister_append_key(lister, string);
lister->item_index = 0; lister->item_index = 0;
lister_zero_scroll(lister); lister_zero_scroll(lister);
lister_update_filtered_list(app, view, lister); lister_update_filtered_list(app, lister);
} }
} }
} }
@ -743,7 +725,7 @@ lister__backspace_text_field__default(Application_Links *app){
lister->key_string.string = backspace_utf8(lister->key_string.string); lister->key_string.string = backspace_utf8(lister->key_string.string);
lister->item_index = 0; lister->item_index = 0;
lister_zero_scroll(lister); lister_zero_scroll(lister);
lister_update_filtered_list(app, view, lister); lister_update_filtered_list(app, lister);
} }
} }
@ -765,34 +747,6 @@ lister__navigate__default(Application_Links *app, View_ID view, Lister *lister,
lister_update_selection_values(lister); lister_update_selection_values(lister);
} }
function Lister_Activation_Code
lister__key_stroke__fixed_list(Application_Links *app){
Lister_Activation_Code result = ListerActivation_Continue;
View_ID view = get_active_view(app, Access_Always);
Lister *lister = view_get_lister(view);
if (lister != 0){
User_Input in = get_current_input(app);
if (in.event.kind == InputEventKind_KeyStroke){
void *user_data = 0;
b32 did_shortcut_key = false;
for (Lister_Node *node = lister->options.first;
node != 0;
node = node->next){
Key_Code *key_code = (Key_Code*)(node + 1);
if (*key_code == in.event.key.code){
user_data = node->user_data;
did_shortcut_key = true;
break;
}
}
if (did_shortcut_key){
result = lister_call_activate_handler(app, view, lister, user_data, false);
}
}
}
return(result);
}
function Lister_Handlers function Lister_Handlers
lister_get_default_handlers(void){ lister_get_default_handlers(void){
Lister_Handlers handlers = {}; Lister_Handlers handlers = {};
@ -805,45 +759,47 @@ lister_get_default_handlers(void){
//////////////////////////////// ////////////////////////////////
function Lister_Result function Lister_Result
run_lister_with_refresh_handler(Application_Links *app, String_Const_u8 query, run_lister_with_refresh_handler(Application_Links *app, Arena *arena,
Lister_Handlers handlers, String_Const_u8 query, Lister_Handlers handlers){
void *user_data, i32 user_data_size, View_ID view){
Scratch_Block scratch(app);
Lister_Result result = {}; Lister_Result result = {};
if (handlers.refresh != 0){ if (handlers.refresh != 0){
Lister *lister = begin_lister(app, scratch, view, user_data, user_data_size); Lister *lister = begin_lister(app, arena);
lister_set_query(lister, query); lister_set_query(lister, query);
lister->handlers = handlers; lister->handlers = handlers;
handlers.refresh(app, lister); handlers.refresh(app, lister);
result = run_lister(app, view, lister); result = run_lister(app, lister);
} }
else{ else{
#define M "ERROR: No refresh handler specified for lister (query_string = \"%.*s\")\n" #define M "ERROR: No refresh handler specified for lister (query_string = \"%.*s\")\n"
String_Const_u8 str = push_u8_stringf(scratch, M, string_expand(query)); String_Const_u8 str = push_u8_stringf(arena, M, string_expand(query));
#undef M #undef M
print_message(app, str); print_message(app, str);
result.canceled = true;
} }
return(result); return(result);
} }
function Lister_Result function Lister_Result
run_lister_with_options_array(Application_Links *app, char *query_string, run_lister_with_refresh_handler(Application_Links *app, String_Const_u8 query,
Lister_Activation_Type *activate, Lister_Handlers handlers){
void *user_data, i32 user_data_size,
Lister_Option *options, i32 option_count,
i32 estimated_string_space_size,
View_ID view){
Scratch_Block scratch(app); Scratch_Block scratch(app);
Lister *lister = begin_lister(app, scratch, view, user_data, user_data_size); return(run_lister_with_refresh_handler(app, scratch, query, handlers));
for (i32 i = 0; i < option_count; i += 1){
lister_add_item(lister, options[i].string, options[i].status, options[i].user_data, 0);
}
lister_set_query(lister, query_string);
lister->handlers = lister_get_default_handlers();
lister->handlers.activate = activate;
return(run_lister(app, view, lister));
} }
function Lister_Result
run_lister_with_refresh_handler(Application_Links *app, Arena *arena,
char *query, Lister_Handlers handlers){
return(run_lister_with_refresh_handler(app, arena, SCu8(query), handlers));
}
function Lister_Result
run_lister_with_refresh_handler(Application_Links *app,
char *query, Lister_Handlers handlers){
return(run_lister_with_refresh_handler(app, SCu8(query), handlers));
}
////////////////////////////////
function void function void
lister_choice(Arena *arena, Lister_Choice_List *list, lister_choice(Arena *arena, Lister_Choice_List *list,
String_Const_u8 string, String_Const_u8 status, String_Const_u8 string, String_Const_u8 status,
@ -878,12 +834,68 @@ lister_choice(Arena *arena, Lister_Choice_List *list,
(u64)PtrAsInt(user_data)); (u64)PtrAsInt(user_data));
} }
function void
lister_choice(Arena *arena, Lister_Choice_List *list,
String_Const_u8 string, String_Const_u8 status,
Key_Code code, void *user_data){
lister_choice(arena, list, string, status, code, (u64)PtrAsInt(user_data));
}
function void
lister_choice(Arena *arena, Lister_Choice_List *list,
char *string, String_Const_u8 status,
Key_Code code, void *user_data){
lister_choice(arena, list, string, status, code, (u64)PtrAsInt(user_data));
}
function void
lister_choice(Arena *arena, Lister_Choice_List *list,
String_Const_u8 string, char *status,
Key_Code code, void *user_data){
lister_choice(arena, list, string, status, code, (u64)PtrAsInt(user_data));
}
function void
lister_choice(Arena *arena, Lister_Choice_List *list,
char *string, char *status,
Key_Code code, void *user_data){
lister_choice(arena, list, string, status, code, (u64)PtrAsInt(user_data));
}
function Lister_Activation_Code
lister__key_stroke__choice_list(Application_Links *app){
Lister_Activation_Code result = ListerActivation_Continue;
View_ID view = get_active_view(app, Access_Always);
Lister *lister = view_get_lister(view);
if (lister != 0){
User_Input in = get_current_input(app);
if (in.event.kind == InputEventKind_KeyStroke){
void *user_data = 0;
b32 did_shortcut_key = false;
for (Lister_Node *node = lister->options.first;
node != 0;
node = node->next){
Key_Code *key_code = (Key_Code*)(node + 1);
if (*key_code == in.event.key.code){
user_data = node->user_data;
did_shortcut_key = true;
break;
}
}
if (did_shortcut_key){
lister_activate(app, lister, user_data, false);
result = ListerActivation_Finished;
}
}
}
return(result);
}
function Lister_Choice* function Lister_Choice*
get_choice_from_user(Application_Links *app, String_Const_u8 query, get_choice_from_user(Application_Links *app, String_Const_u8 query,
Lister_Choice_List list){ Lister_Choice_List list){
Scratch_Block scratch(app); Scratch_Block scratch(app);
View_ID view = get_active_view(app, Access_Always); Lister *lister = begin_lister(app, scratch);
Lister *lister = begin_lister(app, scratch, view, 0, 0);
for (Lister_Choice *choice = list.first; for (Lister_Choice *choice = list.first;
choice != 0; choice != 0;
choice = choice->next){ choice = choice->next){
@ -895,11 +907,11 @@ get_choice_from_user(Application_Links *app, String_Const_u8 query,
lister_set_query(lister, query); lister_set_query(lister, query);
Lister_Handlers handlers = {}; Lister_Handlers handlers = {};
handlers.navigate = lister__navigate__default; handlers.navigate = lister__navigate__default;
handlers.key_stroke = lister__key_stroke__fixed_list; handlers.key_stroke = lister__key_stroke__choice_list;
lister->handlers = handlers; lister->handlers = handlers;
lister->handlers.refresh = 0; lister->handlers.refresh = 0;
Lister_Result l_result = run_lister(app, view, lister); Lister_Result l_result = run_lister(app, lister);
Lister_Choice *result = 0; Lister_Choice *result = 0;
if (!l_result.canceled){ if (!l_result.canceled){
result = (Lister_Choice*)l_result.user_data; result = (Lister_Choice*)l_result.user_data;

View File

@ -14,9 +14,6 @@ enum{
ListerActivation_ContinueAndRefresh = 2, ListerActivation_ContinueAndRefresh = 2,
}; };
typedef Lister_Activation_Code Lister_Activation_Type(Application_Links *app, View_ID view, struct Lister *lister,
String_Const_u8 text_field, void *user_data, b32 activated_by_mouse);
typedef void Lister_Regenerate_List_Function_Type(Application_Links *app, struct Lister *lister); typedef void Lister_Regenerate_List_Function_Type(Application_Links *app, struct Lister *lister);
struct Lister_Node{ struct Lister_Node{
@ -48,7 +45,6 @@ typedef void Lister_Navigate_Function(Application_Links *app,
i32 index_delta); i32 index_delta);
struct Lister_Handlers{ struct Lister_Handlers{
Lister_Activation_Type *activate;
Lister_Regenerate_List_Function_Type *refresh; Lister_Regenerate_List_Function_Type *refresh;
Custom_Command_Function *write_character; Custom_Command_Function *write_character;
Custom_Command_Function *backspace; Custom_Command_Function *backspace;
@ -57,9 +53,10 @@ struct Lister_Handlers{
}; };
struct Lister_Result{ struct Lister_Result{
void *user_data;
b32 activated_by_click;
b32 canceled; b32 canceled;
b32 activated_by_click;
String_Const_u8 text_field;
void *user_data;
}; };
struct Lister{ struct Lister{
@ -71,9 +68,6 @@ struct Lister{
Mapping *mapping; Mapping *mapping;
Command_Map *map; Command_Map *map;
void *user_data;
umem user_data_size;
u8 query_space[256]; u8 query_space[256];
u8 text_field_space[256]; u8 text_field_space[256];
u8 key_string_space[256]; u8 key_string_space[256];
@ -109,18 +103,15 @@ struct Lister_Filtered{
//////////////////////////////// ////////////////////////////////
struct Lister_Option{
String_Const_u8 string;
String_Const_u8 status;
void *user_data;
};
struct Lister_Choice{ struct Lister_Choice{
Lister_Choice *next; Lister_Choice *next;
String_Const_u8 string; String_Const_u8 string;
String_Const_u8 status; String_Const_u8 status;
Key_Code key_code; Key_Code key_code;
union{
u64 user_data; u64 user_data;
void *user_data_ptr;
};
}; };
struct Lister_Choice_List{ struct Lister_Choice_List{

View File

@ -79,11 +79,9 @@ generate_all_buffers_list(Application_Links *app, Lister *lister){
function Buffer_ID function Buffer_ID
get_buffer_from_user(Application_Links *app, String_Const_u8 query){ get_buffer_from_user(Application_Links *app, String_Const_u8 query){
View_ID view = get_active_view(app, Access_Always);
Lister_Handlers handlers = lister_get_default_handlers(); Lister_Handlers handlers = lister_get_default_handlers();
handlers.refresh = generate_all_buffers_list; handlers.refresh = generate_all_buffers_list;
Lister_Result l_result = run_lister_with_refresh_handler(app, query, handlers, Lister_Result l_result = run_lister_with_refresh_handler(app, query, handlers);
0, 0, view);
Buffer_ID result = 0; Buffer_ID result = 0;
if (!l_result.canceled){ if (!l_result.canceled){
result = (Buffer_ID)(PtrAsInt(l_result.user_data)); result = (Buffer_ID)(PtrAsInt(l_result.user_data));
@ -98,9 +96,60 @@ get_buffer_from_user(Application_Links *app, char *query){
//////////////////////////////// ////////////////////////////////
function Custom_Command_Function*
get_command_from_user(Application_Links *app, String_Const_u8 query,
i32 *command_ids, i32 command_id_count){
if (command_ids == 0){
command_id_count = command_one_past_last_id;
}
Scratch_Block scratch(app, Scratch_Share);
Lister *lister = begin_lister(app, scratch);
lister_set_query(lister, query);
lister->handlers = lister_get_default_handlers();
for (i32 i = 0; i < command_id_count; i += 1){
i32 j = i;
if (command_ids != 0){
j = command_ids[i];
}
j = clamp(0, j, command_one_past_last_id);
lister_add_item(lister,
SCu8(fcoder_metacmd_table[j].name),
SCu8(fcoder_metacmd_table[j].description),
(void*)fcoder_metacmd_table[j].proc, 0);
}
Lister_Result l_result = run_lister(app, lister);
Custom_Command_Function *result = 0;
if (!l_result.canceled){
result = (Custom_Command_Function*)l_result.user_data;
}
return(result);
}
function Custom_Command_Function*
get_command_from_user(Application_Links *app, String_Const_u8 query){
return(get_command_from_user(app, query, 0, 0));
}
function Custom_Command_Function*
get_command_from_user(Application_Links *app, char *query,
i32 *command_ids, i32 command_id_count){
return(get_command_from_user(app, SCu8(query), command_ids, command_id_count));
}
function Custom_Command_Function*
get_command_from_user(Application_Links *app, char *query){
return(get_command_from_user(app, SCu8(query), 0, 0));
}
////////////////////////////////
function void function void
lister__write_character__file_path(Application_Links *app){ lister__write_character__file_path(Application_Links *app){
View_ID view = get_active_view(app, Access_Always); View_ID view = get_this_ctx_view(app, Access_Always);
Lister *lister = view_get_lister(view); Lister *lister = view_get_lister(view);
if (lister != 0){ if (lister != 0){
User_Input in = get_current_input(app); User_Input in = get_current_input(app);
@ -112,18 +161,18 @@ lister__write_character__file_path(Application_Links *app){
if (character_is_slash(string.str[0])){ if (character_is_slash(string.str[0])){
String_Const_u8 new_hot = lister->text_field.string; String_Const_u8 new_hot = lister->text_field.string;
set_hot_directory(app, new_hot); set_hot_directory(app, new_hot);
lister_call_refresh_handler(app, view, lister); lister_call_refresh_handler(app, lister);
} }
lister->item_index = 0; lister->item_index = 0;
lister_zero_scroll(lister); lister_zero_scroll(lister);
lister_update_filtered_list(app, view, lister); lister_update_filtered_list(app, lister);
} }
} }
} }
function void function void
lister__backspace_text_field__file_path(Application_Links *app){ lister__backspace_text_field__file_path(Application_Links *app){
View_ID view = get_active_view(app, Access_Always); View_ID view = get_this_ctx_view(app, Access_Always);
Lister *lister = view_get_lister(view); Lister *lister = view_get_lister(view);
if (lister != 0){ if (lister != 0){
if (lister->text_field.size > 0){ if (lister->text_field.size > 0){
@ -142,7 +191,7 @@ lister__backspace_text_field__file_path(Application_Links *app){
// TODO(allen): We have to protect against lister_call_refresh_handler // TODO(allen): We have to protect against lister_call_refresh_handler
// changing the text_field here. Clean this up. // changing the text_field here. Clean this up.
String_u8 dingus = lister->text_field; String_u8 dingus = lister->text_field;
lister_call_refresh_handler(app, view, lister); lister_call_refresh_handler(app, lister);
lister->text_field = dingus; lister->text_field = dingus;
} }
else{ else{
@ -153,7 +202,7 @@ lister__backspace_text_field__file_path(Application_Links *app){
lister->item_index = 0; lister->item_index = 0;
lister_zero_scroll(lister); lister_zero_scroll(lister);
lister_update_filtered_list(app, view, lister); lister_update_filtered_list(app, lister);
} }
} }
} }
@ -226,17 +275,52 @@ generate_hot_directory_file_list(Application_Links *app, Lister *lister){
} }
} }
function void struct File_Name_Result{
run_lister_file_system_list(Application_Links *app, char *query_string, b32 canceled;
Lister_Activation_Type *activate_procedure, b32 clicked;
void *user_data, i32 user_data_size, View_ID target_view){ b32 is_folder;
String_Const_u8 file_name_activated;
String_Const_u8 file_name_in_text_field;
String_Const_u8 path_in_text_field;
};
function File_Name_Result
get_file_name_from_user(Application_Links *app, Arena *arena, String_Const_u8 query,
View_ID view){
Lister_Handlers handlers = lister_get_default_handlers(); Lister_Handlers handlers = lister_get_default_handlers();
handlers.activate = activate_procedure;
handlers.refresh = generate_hot_directory_file_list; handlers.refresh = generate_hot_directory_file_list;
handlers.write_character = lister__write_character__file_path; handlers.write_character = lister__write_character__file_path;
handlers.backspace = lister__backspace_text_field__file_path; handlers.backspace = lister__backspace_text_field__file_path;
run_lister_with_refresh_handler(app, SCu8(query_string), handlers,
user_data, user_data_size, target_view); Lister_Result l_result =
run_lister_with_refresh_handler(app, arena, query, handlers);
File_Name_Result result = {};
result.canceled = l_result.canceled;
if (!l_result.canceled){
result.clicked = l_result.activated_by_click;
if (l_result.user_data != 0){
String_Const_u8 name = SCu8((u8*)l_result.user_data);
result.file_name_activated = name;
result.is_folder =
character_is_slash(string_get_character(name, name.size -1 ));
}
result.file_name_in_text_field = string_front_of_path(l_result.text_field);
String_Const_u8 path = string_remove_front_of_path(l_result.text_field);
if (character_is_slash(string_get_character(path, path.size - 1))){
path = string_chop(path, 1);
}
result.path_in_text_field = path;
}
return(result);
}
function File_Name_Result
get_file_name_from_user(Application_Links *app, Arena *arena, char *query,
View_ID view){
return(get_file_name_from_user(app, arena, SCu8(query), view));
} }
//////////////////////////////// ////////////////////////////////
@ -249,7 +333,7 @@ enum{
}; };
function b32 function b32
do_gui_sure_to_kill(Application_Links *app, Buffer_ID buffer, View_ID view){ do_buffer_kill_user_check(Application_Links *app, Buffer_ID buffer, View_ID view){
Scratch_Block scratch(app); Scratch_Block scratch(app);
Lister_Choice_List list = {}; Lister_Choice_List list = {};
lister_choice(scratch, &list, "(N)o" , "", KeyCode_N, SureToKill_No); lister_choice(scratch, &list, "(N)o" , "", KeyCode_N, SureToKill_No);
@ -290,35 +374,8 @@ do_gui_sure_to_kill(Application_Links *app, Buffer_ID buffer, View_ID view){
return(do_kill); return(do_kill);
} }
function Lister_Activation_Code
activate_confirm_close_4coder(Application_Links *app,
View_ID view, Lister *lister,
String_Const_u8 text_field, void *user_data, b32 clicked){
i32 behavior = (i32)PtrAsInt(user_data);
b32 *do_exit = (b32*)user_data;
switch (behavior){
case SureToKill_No:
{}break;
case SureToKill_Yes:
{
allow_immediate_close_without_checking_for_changes = true;
*do_exit = true;
}break;
case SureToKill_Save:
{
save_all_dirty_buffers(app);
allow_immediate_close_without_checking_for_changes = true;
*do_exit = true;
}break;
}
lister_default(app, view, lister, ListerActivation_Finished);
return(ListerActivation_Finished);
}
function b32 function b32
do_gui_sure_to_close_4coder(Application_Links *app, View_ID view){ do_4coder_close_user_check(Application_Links *app, View_ID view){
Scratch_Block scratch(app); Scratch_Block scratch(app);
Lister_Choice_List list = {}; Lister_Choice_List list = {};
lister_choice(scratch, &list, "(N)o" , "", KeyCode_N, SureToKill_No); lister_choice(scratch, &list, "(N)o" , "", KeyCode_N, SureToKill_No);
@ -356,59 +413,32 @@ do_gui_sure_to_close_4coder(Application_Links *app, View_ID view){
//////////////////////////////// ////////////////////////////////
#if 0
function Lister_Activation_Code
activate_switch_buffer(Application_Links *app,
View_ID view, Lister *lister,
String_Const_u8 text_field, void *user_data, b32 activated_by_mouse){
if (user_data != 0){
Buffer_ID buffer_id = (Buffer_ID)(PtrAsInt(user_data));
view_set_buffer(app, view, buffer_id, SetBuffer_KeepOriginalGUI);
}
lister_default(app, view, lister, ListerActivation_Finished);
return(ListerActivation_Finished);
}
#endif
CUSTOM_UI_COMMAND_SIG(interactive_switch_buffer) CUSTOM_UI_COMMAND_SIG(interactive_switch_buffer)
CUSTOM_DOC("Interactively switch to an open buffer.") CUSTOM_DOC("Interactively switch to an open buffer.")
{ {
View_ID view = get_active_view(app, Access_Always); View_ID view = get_active_view(app, Access_Always);
//run_lister_buffer_list(app, "Switch:", activate_switch_buffer, 0, 0, view); Buffer_ID buffer = get_buffer_from_user(app, "Switch:");
Buffer_ID buffer = get_buffer_from_user(app, "Switch: ");
if (buffer != 0){ if (buffer != 0){
view_set_buffer(app, view, buffer, 0); view_set_buffer(app, view, buffer, 0);
} }
} }
#if 0
function Lister_Activation_Code
activate_kill_buffer(Application_Links *app,
View_ID view, Lister *lister,
String_Const_u8 text_field, void *user_data, b32 activated_by_mouse){
lister_default(app, view, lister, ListerActivation_Finished);
if (user_data != 0){
Buffer_ID buffer = (Buffer_ID)(PtrAsInt(user_data));
try_buffer_kill(app, buffer, view, 0);
}
return(ListerActivation_Finished);
}
#endif
CUSTOM_UI_COMMAND_SIG(interactive_kill_buffer) CUSTOM_UI_COMMAND_SIG(interactive_kill_buffer)
CUSTOM_DOC("Interactively kill an open buffer.") CUSTOM_DOC("Interactively kill an open buffer.")
{ {
View_ID view = get_active_view(app, Access_Always); View_ID view = get_active_view(app, Access_Always);
//run_lister_buffer_list(app, "Kill:", activate_kill_buffer, 0, 0, view); Buffer_ID buffer = get_buffer_from_user(app, "Kill:");
Buffer_ID buffer = get_buffer_from_user(app, "Kill: ");
if (buffer != 0){ if (buffer != 0){
try_buffer_kill(app, buffer, view, 0); try_buffer_kill(app, buffer, view, 0);
} }
} }
////////////////////////////////
function Lister_Activation_Code function Lister_Activation_Code
activate_open_or_new__generic(Application_Links *app, View_ID view, activate_open_or_new__generic(Application_Links *app, View_ID view,
String_Const_u8 path, String_Const_u8 file_name, b32 is_folder, String_Const_u8 path, String_Const_u8 file_name,
b32 is_folder,
Buffer_Create_Flag flags){ Buffer_Create_Flag flags){
Lister_Activation_Code result = 0; Lister_Activation_Code result = 0;
@ -441,174 +471,122 @@ activate_open_or_new__generic(Application_Links *app, View_ID view,
return(result); return(result);
} }
function Lister_Activation_Code
activate_open_or_new(Application_Links *app,
View_ID view, Lister *lister,
String_Const_u8 text_field, void *user_data, b32 clicked){
Lister_Activation_Code result = 0;
String_Const_u8 file_name = {};
if (user_data == 0){
file_name = string_front_of_path(text_field);
}
else{
file_name = SCu8((u8*)user_data);
}
if (file_name.size == 0){
result = ListerActivation_Finished;
}
else{
String_Const_u8 path = lister->text_field.string;
if (!character_is_slash(string_get_character(path, path.size - 1))){
path = string_remove_last_folder(path);
}
b32 is_folder = (character_is_slash(string_get_character(file_name, file_name.size - 1)) &&
user_data != 0);
Buffer_Create_Flag flags = 0;
result = activate_open_or_new__generic(app, view, path, file_name, is_folder, flags);
}
lister_default(app, view, lister, result);
return(result);
}
CUSTOM_UI_COMMAND_SIG(interactive_open_or_new) CUSTOM_UI_COMMAND_SIG(interactive_open_or_new)
CUSTOM_DOC("Interactively open a file out of the file system.") CUSTOM_DOC("Interactively open a file out of the file system.")
{ {
View_ID view = get_active_view(app, Access_Always); for (;;){
run_lister_file_system_list(app, "Open:", activate_open_or_new, 0, 0, view); Scratch_Block scratch(app);
} View_ID view = get_this_ctx_view(app, Access_Always);
File_Name_Result result = get_file_name_from_user(app, scratch, "Open:",
view);
if (result.canceled) break;
function Lister_Activation_Code String_Const_u8 file_name = result.file_name_activated;
activate_new(Application_Links *app,
View_ID view, Lister *lister,
String_Const_u8 text_field, void *user_data, b32 clicked){
Lister_Activation_Code result = 0;
String_Const_u8 file_name = string_front_of_path(text_field);
if (user_data != 0){
String_Const_u8 item_name = SCu8((u8*)user_data);
if (item_name.str[item_name.size - 1] == '/'){
file_name = item_name;
}
else if (clicked){
file_name = item_name;
}
}
if (file_name.size == 0){ if (file_name.size == 0){
result = ListerActivation_Finished; file_name = result.file_name_in_text_field;
} }
else{ if (file_name.size == 0) break;
String_Const_u8 path = lister->text_field.string;
if (character_is_slash(string_get_character(path, path.size - 1))){ String_Const_u8 path = result.path_in_text_field;
path = string_remove_last_folder(path); String_Const_u8 full_file_name =
push_u8_stringf(scratch, "%.*s/%.*s",
string_expand(path), string_expand(file_name));
if (result.is_folder){
set_hot_directory(app, full_file_name);
continue;
} }
b32 is_folder = (character_is_slash(string_get_character(file_name, file_name.size - 1)) &&
user_data != 0); Buffer_ID buffer = create_buffer(app, full_file_name, 0);
Buffer_Create_Flag flags = BufferCreate_AlwaysNew; if (buffer != 0){
result = activate_open_or_new__generic(app, view, path, file_name, is_folder, flags); view_set_buffer(app, view, buffer, 0);
}
break;
} }
lister_default(app, view, lister, result);
return(result);
} }
CUSTOM_UI_COMMAND_SIG(interactive_new) CUSTOM_UI_COMMAND_SIG(interactive_new)
CUSTOM_DOC("Interactively creates a new file.") CUSTOM_DOC("Interactively creates a new file.")
{ {
View_ID view = get_active_view(app, Access_Always); for (;;){
run_lister_file_system_list(app, "New:", activate_new, 0, 0, view); Scratch_Block scratch(app);
} View_ID view = get_this_ctx_view(app, Access_Always);
File_Name_Result result = get_file_name_from_user(app, scratch, "New:",
view);
if (result.canceled) break;
function Lister_Activation_Code // NOTE(allen): file_name from the text field always
activate_open(Application_Links *app, // unless this is a folder or a mouse click.
View_ID view, Lister *lister, String_Const_u8 file_name = result.file_name_in_text_field;
String_Const_u8 text_field, void *user_data, b32 clicked){ if (result.is_folder || result.clicked){
Lister_Activation_Code result = 0; file_name = result.file_name_activated;
String_Const_u8 file_name = {};
if (user_data != 0){
file_name = SCu8((u8*)user_data);
} }
if (file_name.size == 0){ if (file_name.size == 0) break;
result = ListerActivation_Finished;
String_Const_u8 path = result.path_in_text_field;
String_Const_u8 full_file_name =
push_u8_stringf(scratch, "%.*s/%.*s",
string_expand(path), string_expand(file_name));
if (result.is_folder){
set_hot_directory(app, full_file_name);
continue;
} }
else{
String_Const_u8 path = lister->text_field.string; Buffer_Create_Flag flags = BufferCreate_AlwaysNew;
if (!character_is_slash(string_get_character(path, path.size - 1))){ Buffer_ID buffer = create_buffer(app, full_file_name, flags);
path = string_remove_last_folder(path); if (buffer != 0){
view_set_buffer(app, view, buffer, 0);
} }
b32 is_folder = (character_is_slash(string_get_character(file_name, file_name.size - 1)) && break;
user_data != 0);
Buffer_Create_Flag flags = BufferCreate_NeverNew;
result = activate_open_or_new__generic(app, view, path, file_name, is_folder, flags);
} }
lister_default(app, view, lister, result);
return(result);
} }
CUSTOM_UI_COMMAND_SIG(interactive_open) CUSTOM_UI_COMMAND_SIG(interactive_open)
CUSTOM_DOC("Interactively opens a file.") CUSTOM_DOC("Interactively opens a file.")
{ {
View_ID view = get_active_view(app, Access_Always); for (;;){
run_lister_file_system_list(app, "Open:", activate_open, 0, 0, view); Scratch_Block scratch(app);
} View_ID view = get_this_ctx_view(app, Access_Always);
File_Name_Result result = get_file_name_from_user(app, scratch, "Open:",
view);
if (result.canceled) break;
#if 0 String_Const_u8 file_name = result.file_name_activated;
function Lister_Activation_Code if (file_name.size == 0) break;
activate_select_theme(Application_Links *app,
View_ID view, struct Lister *lister,
String_Const_u8 text_field, void *user_data, b32 activated_by_mouse){
change_theme_by_index(app, (i32)PtrAsInt(user_data));
lister_default(app, scratch, view, state, ListerActivation_Finished);
return(ListerActivation_Finished);
}
CUSTOM_COMMAND_SIG(open_color_tweaker) String_Const_u8 path = result.path_in_text_field;
CUSTOM_DOC("Opens the 4coder theme selector list.") String_Const_u8 full_file_name =
{ push_u8_stringf(scratch, "%.*s/%.*s",
string_expand(path), string_expand(file_name));
if (result.is_folder){
set_hot_directory(app, full_file_name);
continue;
}
Buffer_Create_Flag flags = BufferCreate_NeverNew;
Buffer_ID buffer = create_buffer(app, full_file_name, flags);
if (buffer != 0){
view_set_buffer(app, view, buffer, 0);
}
break;
}
} }
#endif
//////////////////////////////// ////////////////////////////////
function Lister_Activation_Code
activate_command(Application_Links *app,
View_ID view, Lister *lister,
String_Const_u8 text_field, void *user_data, b32 activated_by_mouse){
(*(Custom_Command_Function**)lister->user_data) = (Custom_Command_Function*)user_data;
lister_default(app, view, lister, ListerActivation_Finished);
return(ListerActivation_Finished);
}
function void
launch_custom_command_lister(Application_Links *app, i32 *command_ids, i32 command_id_count){
if (command_ids == 0){
command_id_count = command_one_past_last_id;
}
Scratch_Block scratch(app, Scratch_Share);
View_ID view = get_active_view(app, Access_Always);
Lister_Option *options = push_array(scratch, Lister_Option, command_id_count);
for (i32 i = 0; i < command_id_count; i += 1){
i32 j = i;
if (command_ids != 0){
j = command_ids[i];
}
j = clamp(0, j, command_one_past_last_id);
options[i].string = SCu8(fcoder_metacmd_table[j].name);
options[i].status = SCu8(fcoder_metacmd_table[j].description);
options[i].user_data = (void*)fcoder_metacmd_table[j].proc;
}
Custom_Command_Function *custom_cmd = 0;
run_lister_with_options_array(app, "Command:", activate_command, &custom_cmd, sizeof(custom_cmd),
options, command_id_count, 0, view);
if (custom_cmd != 0){
animate_in_n_milliseconds(app, 0);
custom_cmd(app);
}
}
CUSTOM_UI_COMMAND_SIG(command_lister) CUSTOM_UI_COMMAND_SIG(command_lister)
CUSTOM_DOC("Opens an interactive list of all registered commands.") CUSTOM_DOC("Opens an interactive list of all registered commands.")
{ {
launch_custom_command_lister(app, 0, 0); Custom_Command_Function *func = get_command_from_user(app, "Command:");
if (func != 0){
View_ID view = get_this_ctx_view(app, Access_Always);
Managed_Scope scope = view_get_managed_scope(app, view);
Custom_Command_Function **call_next =
scope_attachment(app, scope, view_call_next, Custom_Command_Function*);
*call_next = func;
}
} }
// BOTTOM // BOTTOM

View File

@ -1343,31 +1343,47 @@ CUSTOM_DOC("Queries the user for several configuration options and initializes a
/////////////////////////////// ///////////////////////////////
function Lister_Activation_Code function Project_Command_Lister_Result
activate_project_command(Application_Links *app, View_ID view, Lister *lister, String_Const_u8 text_field, void *user_data, b32 activated_by_mouse){ get_project_command_from_user(Application_Links *app, Project *project,
i32 command_index = (i32)PtrAsInt(user_data); String_Const_u8 query){
exec_project_command_by_index(app, command_index); Project_Command_Lister_Result result = {};
lister_default(app, view, lister, ListerActivation_Finished); if (project != 0){
return(ListerActivation_Finished); Scratch_Block scratch(app);
Lister *lister = begin_lister(app, scratch);
lister_set_query(lister, query);
lister->handlers = lister_get_default_handlers();
Project_Command *proj_cmd = project->command_array.commands;
i32 count = project->command_array.count;
for (i32 i = 0; i < count; i += 1, proj_cmd += 1){
lister_add_item(lister, proj_cmd->name, proj_cmd->cmd, IntAsPtr(i), 0);
}
Lister_Result l_result = run_lister(app, lister);
if (!l_result.canceled){
result.success = true;
result.index = (i32)PtrAsInt(l_result.user_data);
}
}
return(result);
}
function Project_Command_Lister_Result
get_project_command_from_user(Application_Links *app, Project *project, char *query){
return(get_project_command_from_user(app, project, SCu8(query)));
} }
CUSTOM_COMMAND_SIG(project_command_lister) CUSTOM_COMMAND_SIG(project_command_lister)
CUSTOM_DOC("Open a lister of all commands in the currently loaded project.") CUSTOM_DOC("Open a lister of all commands in the currently loaded project.")
{ {
if (current_project.loaded){ if (current_project.loaded){
Scratch_Block scratch(app, Scratch_Share); Project_Command_Lister_Result proj_cmd =
get_project_command_from_user(app, &current_project, "Command:");
View_ID view = get_active_view(app, Access_Always); if (proj_cmd.success){
i32 option_count = current_project.command_array.count; exec_project_command_by_index(app, proj_cmd.index);
Lister_Option *options = push_array(scratch, Lister_Option, option_count);
for (i32 i = 0;
i < current_project.command_array.count;
i += 1){
options[i].string = push_string_copy(scratch, current_project.command_array.commands[i].name);
options[i].status = push_string_copy(scratch, current_project.command_array.commands[i].cmd);
options[i].user_data = IntAsPtr(i);
} }
run_lister_with_options_array(app, "Command:", activate_project_command, 0, 0, options, option_count, 0, view);
} }
} }

View File

@ -90,6 +90,13 @@ struct Project_Key_Strings{
String_Const_u8 binary_file; String_Const_u8 binary_file;
}; };
///////////////////////////////
struct Project_Command_Lister_Result{
b32 success;
i32 index;
};
#endif #endif
// BOTTOM // BOTTOM

View File

@ -18,6 +18,12 @@ select_next_scope_after_pos(Application_Links *app, View_ID view, Buffer_ID buff
} }
} }
function b32
range_is_scope_selection(Application_Links *app, Buffer_ID buffer, Range_i64 range){
return (buffer_get_char(app, buffer, range.min) == '{' &&
buffer_get_char(app, buffer, range.max - 1) == '}');
}
CUSTOM_COMMAND_SIG(select_surrounding_scope) CUSTOM_COMMAND_SIG(select_surrounding_scope)
CUSTOM_DOC("Finds the scope enclosed by '{' '}' surrounding the cursor and puts the cursor and mark on the '{' and '}'.") CUSTOM_DOC("Finds the scope enclosed by '{' '}' surrounding the cursor and puts the cursor and mark on the '{' and '}'.")
{ {
@ -58,12 +64,19 @@ CUSTOM_DOC("Finds the first scope started by '{' after the cursor and puts the c
} }
CUSTOM_COMMAND_SIG(select_next_scope_after_current) CUSTOM_COMMAND_SIG(select_next_scope_after_current)
CUSTOM_DOC("Finds the first scope started by '{' after the mark and puts the cursor and mark on the '{' and '}'. This command is meant to be used after a scope is already selected so that it will have the effect of selecting the next scope after the current scope.") CUSTOM_DOC("If a scope is selected, find first scope that starts after the selected scope. Otherwise find the first scope that starts after the cursor.")
{ {
View_ID view = get_active_view(app, Access_ReadVisible); View_ID view = get_active_view(app, Access_ReadVisible);
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadVisible); Buffer_ID buffer = view_get_buffer(app, view, Access_ReadVisible);
i64 pos = view_get_mark_pos(app, view); i64 cursor_pos = view_get_cursor_pos(app, view);
select_next_scope_after_pos(app, view, buffer, pos); i64 mark_pos = view_get_mark_pos(app, view);
Range_i64 range = Ii64(cursor_pos, mark_pos);
if (range_is_scope_selection(app, buffer, range)){
select_next_scope_after_pos(app, view, buffer, range.max);
}
else{
select_next_scope_after_pos(app, view, buffer, cursor_pos);
}
} }
CUSTOM_COMMAND_SIG(select_prev_scope_absolute) CUSTOM_COMMAND_SIG(select_prev_scope_absolute)
@ -103,8 +116,7 @@ CUSTOM_DOC("Deletes the braces surrounding the currently selected scope. Leaves
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadWriteVisible); Buffer_ID buffer = view_get_buffer(app, view, Access_ReadWriteVisible);
Range_i64 range = get_view_range(app, view); Range_i64 range = get_view_range(app, view);
if (buffer_get_char(app, buffer, range.min) == '{' && if (range_is_scope_selection(app, buffer, range)){
buffer_get_char(app, buffer, range.max - 1) == '}'){
i32 top_len = 1; i32 top_len = 1;
i32 bot_len = 1; i32 bot_len = 1;
if (buffer_get_char(app, buffer, range.min - 1) == '\n'){ if (buffer_get_char(app, buffer, range.min - 1) == '\n'){

View File

@ -358,12 +358,12 @@ static Command_Metadata fcoder_metacmd_table[213] = {
{ PROC_LINKS(set_eol_mode_to_lf, 0), false, "set_eol_mode_to_lf", 18, "Puts the buffer in lf line ending mode.", 39, "w:\\4ed\\code\\custom\\4coder_eol.cpp", 33, 93 }, { PROC_LINKS(set_eol_mode_to_lf, 0), false, "set_eol_mode_to_lf", 18, "Puts the buffer in lf line ending mode.", 39, "w:\\4ed\\code\\custom\\4coder_eol.cpp", 33, 93 },
{ PROC_LINKS(set_eol_mode_to_binary, 0), false, "set_eol_mode_to_binary", 22, "Puts the buffer in bin line ending mode.", 40, "w:\\4ed\\code\\custom\\4coder_eol.cpp", 33, 104 }, { PROC_LINKS(set_eol_mode_to_binary, 0), false, "set_eol_mode_to_binary", 22, "Puts the buffer in bin line ending mode.", 40, "w:\\4ed\\code\\custom\\4coder_eol.cpp", 33, 104 },
{ PROC_LINKS(set_eol_mode_from_contents, 0), false, "set_eol_mode_from_contents", 26, "Sets the buffer's line ending mode to match the contents of the buffer.", 71, "w:\\4ed\\code\\custom\\4coder_eol.cpp", 33, 115 }, { PROC_LINKS(set_eol_mode_from_contents, 0), false, "set_eol_mode_from_contents", 26, "Sets the buffer's line ending mode to match the contents of the buffer.", 71, "w:\\4ed\\code\\custom\\4coder_eol.cpp", 33, 115 },
{ PROC_LINKS(interactive_switch_buffer, 0), true, "interactive_switch_buffer", 25, "Interactively switch to an open buffer.", 39, "w:\\4ed\\code\\custom\\4coder_lists.cpp", 35, 373 }, { PROC_LINKS(interactive_switch_buffer, 0), true, "interactive_switch_buffer", 25, "Interactively switch to an open buffer.", 39, "w:\\4ed\\code\\custom\\4coder_lists.cpp", 35, 416 },
{ PROC_LINKS(interactive_kill_buffer, 0), true, "interactive_kill_buffer", 23, "Interactively kill an open buffer.", 34, "w:\\4ed\\code\\custom\\4coder_lists.cpp", 35, 398 }, { PROC_LINKS(interactive_kill_buffer, 0), true, "interactive_kill_buffer", 23, "Interactively kill an open buffer.", 34, "w:\\4ed\\code\\custom\\4coder_lists.cpp", 35, 426 },
{ PROC_LINKS(interactive_open_or_new, 0), true, "interactive_open_or_new", 23, "Interactively open a file out of the file system.", 49, "w:\\4ed\\code\\custom\\4coder_lists.cpp", 35, 473 }, { PROC_LINKS(interactive_open_or_new, 0), true, "interactive_open_or_new", 23, "Interactively open a file out of the file system.", 49, "w:\\4ed\\code\\custom\\4coder_lists.cpp", 35, 474 },
{ PROC_LINKS(interactive_new, 0), true, "interactive_new", 15, "Interactively creates a new file.", 33, "w:\\4ed\\code\\custom\\4coder_lists.cpp", 35, 512 }, { PROC_LINKS(interactive_new, 0), true, "interactive_new", 15, "Interactively creates a new file.", 33, "w:\\4ed\\code\\custom\\4coder_lists.cpp", 35, 508 },
{ PROC_LINKS(interactive_open, 0), true, "interactive_open", 16, "Interactively opens a file.", 27, "w:\\4ed\\code\\custom\\4coder_lists.cpp", 35, 545 }, { PROC_LINKS(interactive_open, 0), true, "interactive_open", 16, "Interactively opens a file.", 27, "w:\\4ed\\code\\custom\\4coder_lists.cpp", 35, 545 },
{ PROC_LINKS(command_lister, 0), true, "command_lister", 14, "Opens an interactive list of all registered commands.", 53, "w:\\4ed\\code\\custom\\4coder_lists.cpp", 35, 608 }, { PROC_LINKS(command_lister, 0), true, "command_lister", 14, "Opens an interactive list of all registered commands.", 53, "w:\\4ed\\code\\custom\\4coder_lists.cpp", 35, 579 },
{ PROC_LINKS(auto_indent_whole_file, 0), false, "auto_indent_whole_file", 22, "Audo-indents the entire current buffer.", 39, "w:\\4ed\\code\\custom\\4coder_auto_indent.cpp", 41, 368 }, { PROC_LINKS(auto_indent_whole_file, 0), false, "auto_indent_whole_file", 22, "Audo-indents the entire current buffer.", 39, "w:\\4ed\\code\\custom\\4coder_auto_indent.cpp", 41, 368 },
{ PROC_LINKS(auto_indent_line_at_cursor, 0), false, "auto_indent_line_at_cursor", 26, "Auto-indents the line on which the cursor sits.", 47, "w:\\4ed\\code\\custom\\4coder_auto_indent.cpp", 41, 377 }, { PROC_LINKS(auto_indent_line_at_cursor, 0), false, "auto_indent_line_at_cursor", 26, "Auto-indents the line on which the cursor sits.", 47, "w:\\4ed\\code\\custom\\4coder_auto_indent.cpp", 41, 377 },
{ PROC_LINKS(auto_indent_range, 0), false, "auto_indent_range", 17, "Auto-indents the range between the cursor and the mark.", 55, "w:\\4ed\\code\\custom\\4coder_auto_indent.cpp", 41, 387 }, { PROC_LINKS(auto_indent_range, 0), false, "auto_indent_range", 17, "Auto-indents the range between the cursor and the mark.", 55, "w:\\4ed\\code\\custom\\4coder_auto_indent.cpp", 41, 387 },
@ -389,7 +389,7 @@ static Command_Metadata fcoder_metacmd_table[213] = {
{ PROC_LINKS(goto_first_jump_same_panel_sticky, 0), false, "goto_first_jump_same_panel_sticky", 33, "If a buffer containing jump locations has been locked in, goes to the first jump in the buffer and views the buffer in the panel where the jump list was.", 153, "w:\\4ed\\code\\custom\\4coder_jump_sticky.cpp", 41, 540 }, { PROC_LINKS(goto_first_jump_same_panel_sticky, 0), false, "goto_first_jump_same_panel_sticky", 33, "If a buffer containing jump locations has been locked in, goes to the first jump in the buffer and views the buffer in the panel where the jump list was.", 153, "w:\\4ed\\code\\custom\\4coder_jump_sticky.cpp", 41, 540 },
{ PROC_LINKS(if_read_only_goto_position, 0), false, "if_read_only_goto_position", 26, "If the buffer in the active view is writable, inserts a character, otherwise performs goto_jump_at_cursor.", 106, "w:\\4ed\\code\\custom\\4coder_jump_sticky.cpp", 41, 562 }, { PROC_LINKS(if_read_only_goto_position, 0), false, "if_read_only_goto_position", 26, "If the buffer in the active view is writable, inserts a character, otherwise performs goto_jump_at_cursor.", 106, "w:\\4ed\\code\\custom\\4coder_jump_sticky.cpp", 41, 562 },
{ PROC_LINKS(if_read_only_goto_position_same_panel, 0), false, "if_read_only_goto_position_same_panel", 37, "If the buffer in the active view is writable, inserts a character, otherwise performs goto_jump_at_cursor_same_panel.", 117, "w:\\4ed\\code\\custom\\4coder_jump_sticky.cpp", 41, 579 }, { PROC_LINKS(if_read_only_goto_position_same_panel, 0), false, "if_read_only_goto_position_same_panel", 37, "If the buffer in the active view is writable, inserts a character, otherwise performs goto_jump_at_cursor_same_panel.", 117, "w:\\4ed\\code\\custom\\4coder_jump_sticky.cpp", 41, 579 },
{ PROC_LINKS(view_jump_list_with_lister, 0), false, "view_jump_list_with_lister", 26, "When executed on a buffer with jumps, creates a persistent lister for all the jumps", 83, "w:\\4ed\\code\\custom\\4coder_jump_lister.cpp", 41, 104 }, { PROC_LINKS(view_jump_list_with_lister, 0), false, "view_jump_list_with_lister", 26, "When executed on a buffer with jumps, creates a persistent lister for all the jumps", 83, "w:\\4ed\\code\\custom\\4coder_jump_lister.cpp", 41, 59 },
{ PROC_LINKS(show_the_log_graph, 0), true, "show_the_log_graph", 18, "Parses *log* and displays the 'log graph' UI", 44, "w:\\4ed\\code\\custom\\4coder_log_parser.cpp", 40, 995 }, { PROC_LINKS(show_the_log_graph, 0), true, "show_the_log_graph", 18, "Parses *log* and displays the 'log graph' UI", 44, "w:\\4ed\\code\\custom\\4coder_log_parser.cpp", 40, 995 },
{ PROC_LINKS(copy, 0), false, "copy", 4, "Copy the text in the range from the cursor to the mark onto the clipboard.", 74, "w:\\4ed\\code\\custom\\4coder_clipboard.cpp", 39, 19 }, { PROC_LINKS(copy, 0), false, "copy", 4, "Copy the text in the range from the cursor to the mark onto the clipboard.", 74, "w:\\4ed\\code\\custom\\4coder_clipboard.cpp", 39, 19 },
{ PROC_LINKS(cut, 0), false, "cut", 3, "Cut the text in the range from the cursor to the mark onto the clipboard.", 73, "w:\\4ed\\code\\custom\\4coder_clipboard.cpp", 39, 28 }, { PROC_LINKS(cut, 0), false, "cut", 3, "Cut the text in the range from the cursor to the mark onto the clipboard.", 73, "w:\\4ed\\code\\custom\\4coder_clipboard.cpp", 39, 28 },
@ -413,19 +413,19 @@ static Command_Metadata fcoder_metacmd_table[213] = {
{ PROC_LINKS(setup_build_bat, 0), false, "setup_build_bat", 15, "Queries the user for several configuration options and initializes a new build batch script.", 92, "w:\\4ed\\code\\custom\\4coder_project_commands.cpp", 46, 1326 }, { PROC_LINKS(setup_build_bat, 0), false, "setup_build_bat", 15, "Queries the user for several configuration options and initializes a new build batch script.", 92, "w:\\4ed\\code\\custom\\4coder_project_commands.cpp", 46, 1326 },
{ PROC_LINKS(setup_build_sh, 0), false, "setup_build_sh", 14, "Queries the user for several configuration options and initializes a new build shell script.", 92, "w:\\4ed\\code\\custom\\4coder_project_commands.cpp", 46, 1332 }, { PROC_LINKS(setup_build_sh, 0), false, "setup_build_sh", 14, "Queries the user for several configuration options and initializes a new build shell script.", 92, "w:\\4ed\\code\\custom\\4coder_project_commands.cpp", 46, 1332 },
{ PROC_LINKS(setup_build_bat_and_sh, 0), false, "setup_build_bat_and_sh", 22, "Queries the user for several configuration options and initializes a new build batch script.", 92, "w:\\4ed\\code\\custom\\4coder_project_commands.cpp", 46, 1338 }, { PROC_LINKS(setup_build_bat_and_sh, 0), false, "setup_build_bat_and_sh", 22, "Queries the user for several configuration options and initializes a new build batch script.", 92, "w:\\4ed\\code\\custom\\4coder_project_commands.cpp", 46, 1338 },
{ PROC_LINKS(project_command_lister, 0), false, "project_command_lister", 22, "Open a lister of all commands in the currently loaded project.", 62, "w:\\4ed\\code\\custom\\4coder_project_commands.cpp", 46, 1354 }, { PROC_LINKS(project_command_lister, 0), false, "project_command_lister", 22, "Open a lister of all commands in the currently loaded project.", 62, "w:\\4ed\\code\\custom\\4coder_project_commands.cpp", 46, 1378 },
{ PROC_LINKS(list_all_functions_current_buffer, 0), false, "list_all_functions_current_buffer", 33, "Creates a jump list of lines of the current buffer that appear to define or declare functions.", 94, "w:\\4ed\\code\\custom\\4coder_function_list.cpp", 43, 267 }, { PROC_LINKS(list_all_functions_current_buffer, 0), false, "list_all_functions_current_buffer", 33, "Creates a jump list of lines of the current buffer that appear to define or declare functions.", 94, "w:\\4ed\\code\\custom\\4coder_function_list.cpp", 43, 267 },
{ PROC_LINKS(list_all_functions_current_buffer_lister, 0), false, "list_all_functions_current_buffer_lister", 40, "Creates a lister of locations that look like function definitions and declarations in the buffer.", 97, "w:\\4ed\\code\\custom\\4coder_function_list.cpp", 43, 277 }, { PROC_LINKS(list_all_functions_current_buffer_lister, 0), false, "list_all_functions_current_buffer_lister", 40, "Creates a lister of locations that look like function definitions and declarations in the buffer.", 97, "w:\\4ed\\code\\custom\\4coder_function_list.cpp", 43, 277 },
{ PROC_LINKS(list_all_functions_all_buffers, 0), false, "list_all_functions_all_buffers", 30, "Creates a jump list of lines from all buffers that appear to define or declare functions.", 89, "w:\\4ed\\code\\custom\\4coder_function_list.cpp", 43, 289 }, { PROC_LINKS(list_all_functions_all_buffers, 0), false, "list_all_functions_all_buffers", 30, "Creates a jump list of lines from all buffers that appear to define or declare functions.", 89, "w:\\4ed\\code\\custom\\4coder_function_list.cpp", 43, 295 },
{ PROC_LINKS(list_all_functions_all_buffers_lister, 0), false, "list_all_functions_all_buffers_lister", 37, "Creates a lister of locations that look like function definitions and declarations all buffers.", 95, "w:\\4ed\\code\\custom\\4coder_function_list.cpp", 43, 295 }, { PROC_LINKS(list_all_functions_all_buffers_lister, 0), false, "list_all_functions_all_buffers_lister", 37, "Creates a lister of locations that look like function definitions and declarations all buffers.", 95, "w:\\4ed\\code\\custom\\4coder_function_list.cpp", 43, 301 },
{ PROC_LINKS(select_surrounding_scope, 0), false, "select_surrounding_scope", 24, "Finds the scope enclosed by '{' '}' surrounding the cursor and puts the cursor and mark on the '{' and '}'.", 107, "w:\\4ed\\code\\custom\\4coder_scope_commands.cpp", 44, 21 }, { PROC_LINKS(select_surrounding_scope, 0), false, "select_surrounding_scope", 24, "Finds the scope enclosed by '{' '}' surrounding the cursor and puts the cursor and mark on the '{' and '}'.", 107, "w:\\4ed\\code\\custom\\4coder_scope_commands.cpp", 44, 27 },
{ PROC_LINKS(select_surrounding_scope_maximal, 0), false, "select_surrounding_scope_maximal", 32, "Selects the top-most scope that surrounds the cursor.", 53, "w:\\4ed\\code\\custom\\4coder_scope_commands.cpp", 44, 33 }, { PROC_LINKS(select_surrounding_scope_maximal, 0), false, "select_surrounding_scope_maximal", 32, "Selects the top-most scope that surrounds the cursor.", 53, "w:\\4ed\\code\\custom\\4coder_scope_commands.cpp", 44, 39 },
{ PROC_LINKS(select_next_scope_absolute, 0), false, "select_next_scope_absolute", 26, "Finds the first scope started by '{' after the cursor and puts the cursor and mark on the '{' and '}'.", 102, "w:\\4ed\\code\\custom\\4coder_scope_commands.cpp", 44, 51 }, { PROC_LINKS(select_next_scope_absolute, 0), false, "select_next_scope_absolute", 26, "Finds the first scope started by '{' after the cursor and puts the cursor and mark on the '{' and '}'.", 102, "w:\\4ed\\code\\custom\\4coder_scope_commands.cpp", 44, 57 },
{ PROC_LINKS(select_next_scope_after_current, 0), false, "select_next_scope_after_current", 31, "Finds the first scope started by '{' after the mark and puts the cursor and mark on the '{' and '}'. This command is meant to be used after a scope is already selected so that it will have the effect of selecting the next scope after the current scope.", 253, "w:\\4ed\\code\\custom\\4coder_scope_commands.cpp", 44, 60 }, { PROC_LINKS(select_next_scope_after_current, 0), false, "select_next_scope_after_current", 31, "If a scope is selected, find first scope that starts after the selected scope. Otherwise find the first scope that starts after the cursor.", 139, "w:\\4ed\\code\\custom\\4coder_scope_commands.cpp", 44, 66 },
{ PROC_LINKS(select_prev_scope_absolute, 0), false, "select_prev_scope_absolute", 26, "Finds the first scope started by '{' before the cursor and puts the cursor and mark on the '{' and '}'.", 103, "w:\\4ed\\code\\custom\\4coder_scope_commands.cpp", 44, 69 }, { PROC_LINKS(select_prev_scope_absolute, 0), false, "select_prev_scope_absolute", 26, "Finds the first scope started by '{' before the cursor and puts the cursor and mark on the '{' and '}'.", 103, "w:\\4ed\\code\\custom\\4coder_scope_commands.cpp", 44, 82 },
{ PROC_LINKS(select_prev_top_most_scope, 0), false, "select_prev_top_most_scope", 26, "Finds the first scope that starts before the cursor, then finds the top most scope that contains that scope.", 108, "w:\\4ed\\code\\custom\\4coder_scope_commands.cpp", 44, 86 }, { PROC_LINKS(select_prev_top_most_scope, 0), false, "select_prev_top_most_scope", 26, "Finds the first scope that starts before the cursor, then finds the top most scope that contains that scope.", 108, "w:\\4ed\\code\\custom\\4coder_scope_commands.cpp", 44, 99 },
{ PROC_LINKS(place_in_scope, 0), false, "place_in_scope", 14, "Wraps the code contained in the range between cursor and mark with a new curly brace scope.", 91, "w:\\4ed\\code\\custom\\4coder_scope_commands.cpp", 44, 93 }, { PROC_LINKS(place_in_scope, 0), false, "place_in_scope", 14, "Wraps the code contained in the range between cursor and mark with a new curly brace scope.", 91, "w:\\4ed\\code\\custom\\4coder_scope_commands.cpp", 44, 106 },
{ PROC_LINKS(delete_current_scope, 0), false, "delete_current_scope", 20, "Deletes the braces surrounding the currently selected scope. Leaves the contents within the scope.", 99, "w:\\4ed\\code\\custom\\4coder_scope_commands.cpp", 44, 99 }, { PROC_LINKS(delete_current_scope, 0), false, "delete_current_scope", 20, "Deletes the braces surrounding the currently selected scope. Leaves the contents within the scope.", 99, "w:\\4ed\\code\\custom\\4coder_scope_commands.cpp", 44, 112 },
{ PROC_LINKS(open_long_braces, 0), false, "open_long_braces", 16, "At the cursor, insert a '{' and '}' separated by a blank line.", 62, "w:\\4ed\\code\\custom\\4coder_combined_write_commands.cpp", 53, 46 }, { PROC_LINKS(open_long_braces, 0), false, "open_long_braces", 16, "At the cursor, insert a '{' and '}' separated by a blank line.", 62, "w:\\4ed\\code\\custom\\4coder_combined_write_commands.cpp", 53, 46 },
{ PROC_LINKS(open_long_braces_semicolon, 0), false, "open_long_braces_semicolon", 26, "At the cursor, insert a '{' and '};' separated by a blank line.", 63, "w:\\4ed\\code\\custom\\4coder_combined_write_commands.cpp", 53, 54 }, { PROC_LINKS(open_long_braces_semicolon, 0), false, "open_long_braces_semicolon", 26, "At the cursor, insert a '{' and '};' separated by a blank line.", 63, "w:\\4ed\\code\\custom\\4coder_combined_write_commands.cpp", 53, 54 },
{ PROC_LINKS(open_long_braces_break, 0), false, "open_long_braces_break", 22, "At the cursor, insert a '{' and '}break;' separated by a blank line.", 68, "w:\\4ed\\code\\custom\\4coder_combined_write_commands.cpp", 53, 62 }, { PROC_LINKS(open_long_braces_break, 0), false, "open_long_braces_break", 22, "At the cursor, insert a '{' and '}break;' separated by a blank line.", 68, "w:\\4ed\\code\\custom\\4coder_combined_write_commands.cpp", 53, 62 },
@ -438,7 +438,7 @@ static Command_Metadata fcoder_metacmd_table[213] = {
{ PROC_LINKS(comment_line, 0), false, "comment_line", 12, "Insert '//' at the beginning of the line after leading whitespace.", 66, "w:\\4ed\\code\\custom\\4coder_combined_write_commands.cpp", 53, 125 }, { PROC_LINKS(comment_line, 0), false, "comment_line", 12, "Insert '//' at the beginning of the line after leading whitespace.", 66, "w:\\4ed\\code\\custom\\4coder_combined_write_commands.cpp", 53, 125 },
{ PROC_LINKS(uncomment_line, 0), false, "uncomment_line", 14, "If present, delete '//' at the beginning of the line after leading whitespace.", 78, "w:\\4ed\\code\\custom\\4coder_combined_write_commands.cpp", 53, 137 }, { PROC_LINKS(uncomment_line, 0), false, "uncomment_line", 14, "If present, delete '//' at the beginning of the line after leading whitespace.", 78, "w:\\4ed\\code\\custom\\4coder_combined_write_commands.cpp", 53, 137 },
{ PROC_LINKS(comment_line_toggle, 0), false, "comment_line_toggle", 19, "Turns uncommented lines into commented lines and vice versa for comments starting with '//'.", 92, "w:\\4ed\\code\\custom\\4coder_combined_write_commands.cpp", 53, 149 }, { PROC_LINKS(comment_line_toggle, 0), false, "comment_line_toggle", 19, "Turns uncommented lines into commented lines and vice versa for comments starting with '//'.", 92, "w:\\4ed\\code\\custom\\4coder_combined_write_commands.cpp", 53, 149 },
{ PROC_LINKS(snippet_lister, 0), false, "snippet_lister", 14, "Opens a snippet lister for inserting whole pre-written snippets of text.", 72, "w:\\4ed\\code\\custom\\4coder_combined_write_commands.cpp", 53, 231 }, { PROC_LINKS(snippet_lister, 0), false, "snippet_lister", 14, "Opens a snippet lister for inserting whole pre-written snippets of text.", 72, "w:\\4ed\\code\\custom\\4coder_combined_write_commands.cpp", 53, 237 },
{ PROC_LINKS(miblo_increment_basic, 0), false, "miblo_increment_basic", 21, "Increment an integer under the cursor by one.", 45, "w:\\4ed\\code\\custom\\4coder_miblo_numbers.cpp", 43, 29 }, { PROC_LINKS(miblo_increment_basic, 0), false, "miblo_increment_basic", 21, "Increment an integer under the cursor by one.", 45, "w:\\4ed\\code\\custom\\4coder_miblo_numbers.cpp", 43, 29 },
{ PROC_LINKS(miblo_decrement_basic, 0), false, "miblo_decrement_basic", 21, "Decrement an integer under the cursor by one.", 45, "w:\\4ed\\code\\custom\\4coder_miblo_numbers.cpp", 43, 44 }, { PROC_LINKS(miblo_decrement_basic, 0), false, "miblo_decrement_basic", 21, "Decrement an integer under the cursor by one.", 45, "w:\\4ed\\code\\custom\\4coder_miblo_numbers.cpp", 43, 44 },
{ PROC_LINKS(miblo_increment_time_stamp, 0), false, "miblo_increment_time_stamp", 26, "Increment a time stamp under the cursor by one second. (format [m]m:ss or h:mm:ss", 81, "w:\\4ed\\code\\custom\\4coder_miblo_numbers.cpp", 43, 231 }, { PROC_LINKS(miblo_increment_time_stamp, 0), false, "miblo_increment_time_stamp", 26, "Increment a time stamp under the cursor by one second. (format [m]m:ss or h:mm:ss", 81, "w:\\4ed\\code\\custom\\4coder_miblo_numbers.cpp", 43, 231 },

View File

@ -54,6 +54,7 @@ vtable->buffer_get_file_attributes = buffer_get_file_attributes;
vtable->get_file_attributes = get_file_attributes; vtable->get_file_attributes = get_file_attributes;
vtable->get_view_next = get_view_next; vtable->get_view_next = get_view_next;
vtable->get_view_prev = get_view_prev; vtable->get_view_prev = get_view_prev;
vtable->get_this_ctx_view = get_this_ctx_view;
vtable->get_active_view = get_active_view; vtable->get_active_view = get_active_view;
vtable->get_active_panel = get_active_panel; vtable->get_active_panel = get_active_panel;
vtable->view_exists = view_exists; vtable->view_exists = view_exists;
@ -228,6 +229,7 @@ buffer_get_file_attributes = vtable->buffer_get_file_attributes;
get_file_attributes = vtable->get_file_attributes; get_file_attributes = vtable->get_file_attributes;
get_view_next = vtable->get_view_next; get_view_next = vtable->get_view_next;
get_view_prev = vtable->get_view_prev; get_view_prev = vtable->get_view_prev;
get_this_ctx_view = vtable->get_this_ctx_view;
get_active_view = vtable->get_active_view; get_active_view = vtable->get_active_view;
get_active_panel = vtable->get_active_panel; get_active_panel = vtable->get_active_panel;
view_exists = vtable->view_exists; view_exists = vtable->view_exists;

View File

@ -52,6 +52,7 @@
#define custom_get_file_attributes_sig() File_Attributes custom_get_file_attributes(Application_Links* app, String_Const_u8 file_name) #define custom_get_file_attributes_sig() File_Attributes custom_get_file_attributes(Application_Links* app, String_Const_u8 file_name)
#define custom_get_view_next_sig() View_ID custom_get_view_next(Application_Links* app, View_ID view_id, Access_Flag access) #define custom_get_view_next_sig() View_ID custom_get_view_next(Application_Links* app, View_ID view_id, Access_Flag access)
#define custom_get_view_prev_sig() View_ID custom_get_view_prev(Application_Links* app, View_ID view_id, Access_Flag access) #define custom_get_view_prev_sig() View_ID custom_get_view_prev(Application_Links* app, View_ID view_id, Access_Flag access)
#define custom_get_this_ctx_view_sig() View_ID custom_get_this_ctx_view(Application_Links* app, Access_Flag access)
#define custom_get_active_view_sig() View_ID custom_get_active_view(Application_Links* app, Access_Flag access) #define custom_get_active_view_sig() View_ID custom_get_active_view(Application_Links* app, Access_Flag access)
#define custom_get_active_panel_sig() Panel_ID custom_get_active_panel(Application_Links* app) #define custom_get_active_panel_sig() Panel_ID custom_get_active_panel(Application_Links* app)
#define custom_view_exists_sig() b32 custom_view_exists(Application_Links* app, View_ID view_id) #define custom_view_exists_sig() b32 custom_view_exists(Application_Links* app, View_ID view_id)
@ -222,6 +223,7 @@ typedef File_Attributes custom_buffer_get_file_attributes_type(Application_Links
typedef File_Attributes custom_get_file_attributes_type(Application_Links* app, String_Const_u8 file_name); typedef File_Attributes custom_get_file_attributes_type(Application_Links* app, String_Const_u8 file_name);
typedef View_ID custom_get_view_next_type(Application_Links* app, View_ID view_id, Access_Flag access); typedef View_ID custom_get_view_next_type(Application_Links* app, View_ID view_id, Access_Flag access);
typedef View_ID custom_get_view_prev_type(Application_Links* app, View_ID view_id, Access_Flag access); typedef View_ID custom_get_view_prev_type(Application_Links* app, View_ID view_id, Access_Flag access);
typedef View_ID custom_get_this_ctx_view_type(Application_Links* app, Access_Flag access);
typedef View_ID custom_get_active_view_type(Application_Links* app, Access_Flag access); typedef View_ID custom_get_active_view_type(Application_Links* app, Access_Flag access);
typedef Panel_ID custom_get_active_panel_type(Application_Links* app); typedef Panel_ID custom_get_active_panel_type(Application_Links* app);
typedef b32 custom_view_exists_type(Application_Links* app, View_ID view_id); typedef b32 custom_view_exists_type(Application_Links* app, View_ID view_id);
@ -393,6 +395,7 @@ custom_buffer_get_file_attributes_type *buffer_get_file_attributes;
custom_get_file_attributes_type *get_file_attributes; custom_get_file_attributes_type *get_file_attributes;
custom_get_view_next_type *get_view_next; custom_get_view_next_type *get_view_next;
custom_get_view_prev_type *get_view_prev; custom_get_view_prev_type *get_view_prev;
custom_get_this_ctx_view_type *get_this_ctx_view;
custom_get_active_view_type *get_active_view; custom_get_active_view_type *get_active_view;
custom_get_active_panel_type *get_active_panel; custom_get_active_panel_type *get_active_panel;
custom_view_exists_type *view_exists; custom_view_exists_type *view_exists;
@ -565,6 +568,7 @@ internal File_Attributes buffer_get_file_attributes(Application_Links* app, Buff
internal File_Attributes get_file_attributes(Application_Links* app, String_Const_u8 file_name); internal File_Attributes get_file_attributes(Application_Links* app, String_Const_u8 file_name);
internal View_ID get_view_next(Application_Links* app, View_ID view_id, Access_Flag access); internal View_ID get_view_next(Application_Links* app, View_ID view_id, Access_Flag access);
internal View_ID get_view_prev(Application_Links* app, View_ID view_id, Access_Flag access); internal View_ID get_view_prev(Application_Links* app, View_ID view_id, Access_Flag access);
internal View_ID get_this_ctx_view(Application_Links* app, Access_Flag access);
internal View_ID get_active_view(Application_Links* app, Access_Flag access); internal View_ID get_active_view(Application_Links* app, Access_Flag access);
internal Panel_ID get_active_panel(Application_Links* app); internal Panel_ID get_active_panel(Application_Links* app);
internal b32 view_exists(Application_Links* app, View_ID view_id); internal b32 view_exists(Application_Links* app, View_ID view_id);
@ -737,6 +741,7 @@ global custom_buffer_get_file_attributes_type *buffer_get_file_attributes = 0;
global custom_get_file_attributes_type *get_file_attributes = 0; global custom_get_file_attributes_type *get_file_attributes = 0;
global custom_get_view_next_type *get_view_next = 0; global custom_get_view_next_type *get_view_next = 0;
global custom_get_view_prev_type *get_view_prev = 0; global custom_get_view_prev_type *get_view_prev = 0;
global custom_get_this_ctx_view_type *get_this_ctx_view = 0;
global custom_get_active_view_type *get_active_view = 0; global custom_get_active_view_type *get_active_view = 0;
global custom_get_active_panel_type *get_active_panel = 0; global custom_get_active_panel_type *get_active_panel = 0;
global custom_view_exists_type *view_exists = 0; global custom_view_exists_type *view_exists = 0;

View File

@ -52,6 +52,7 @@ api(custom) function File_Attributes buffer_get_file_attributes(Application_Link
api(custom) function File_Attributes get_file_attributes(Application_Links* app, String_Const_u8 file_name); api(custom) function File_Attributes get_file_attributes(Application_Links* app, String_Const_u8 file_name);
api(custom) function View_ID get_view_next(Application_Links* app, View_ID view_id, Access_Flag access); api(custom) function View_ID get_view_next(Application_Links* app, View_ID view_id, Access_Flag access);
api(custom) function View_ID get_view_prev(Application_Links* app, View_ID view_id, Access_Flag access); api(custom) function View_ID get_view_prev(Application_Links* app, View_ID view_id, Access_Flag access);
api(custom) function View_ID get_this_ctx_view(Application_Links* app, Access_Flag access);
api(custom) function View_ID get_active_view(Application_Links* app, Access_Flag access); api(custom) function View_ID get_active_view(Application_Links* app, Access_Flag access);
api(custom) function Panel_ID get_active_panel(Application_Links* app); api(custom) function Panel_ID get_active_panel(Application_Links* app);
api(custom) function b32 view_exists(Application_Links* app, View_ID view_id); api(custom) function b32 view_exists(Application_Links* app, View_ID view_id);

View File

@ -44,434 +44,434 @@ lexeme_table_lookup(u64 *hash_array, String_Const_u8 *key_array,
#endif #endif
u64 main_keys_hash_array[121] = { u64 main_keys_hash_array[121] = {
0xd7d4c38040a2a51b,0xdf638ad4b9cf69f1,0x0000000000000000,0x49161f88607bb631, 0xbfcba771fdc3ff37,0x0000000000000000,0x482b4e92d9750a9d,0x9cd567764c09a875,
0x536665a889795331,0xac2560d906339023,0x0000000000000000,0x0000000000000000, 0x2ddccf057a6f0469,0xe68abf205eb2e863,0x0000000000000000,0x0000000000000000,
0x9df913c598e7c12f,0x0000000000000000,0x30a1e151f231a23d,0x0000000000000000, 0x0000000000000000,0x0000000000000000,0xd6aa0bac121748eb,0xd6aa0bac1109048d,
0xdf638ad451f403ad,0xdf63897bcdc00091,0xb02f5667f4aa212d,0x0000000000000000, 0x0000000000000000,0xd6aa0bac11196a39,0xd6aa0bac12221e01,0x0000000000000000,
0x0000000000000000,0x0000000000000000,0x0000000000000000,0xac2560d9187f0241, 0xe68aac478bd4d0db,0xbfcbab347eb1538b,0x0000000000000000,0x8f60fef7e554164b,
0x0000000000000000,0xdf638adf7971e675,0xb2eaca38e283efad,0x0000000000000000, 0xd6aa0bac10fe54db,0x9cd567764c0e1c93,0x8f60feee11d7dd39,0x0000000000000000,
0xdf638ad318e5d1ff,0xdf638ad080551679,0x0000000000000000,0x0000000000000000, 0x0000000000000000,0x482b4e92d1dc4f83,0x0000000000000000,0xd6aa0bac12177a23,
0xdf638ad206456083,0x0000000000000000,0x0000000000000000,0x0000000000000000, 0x482b4e93169498b9,0x8f60fefc139c5187,0xbfcbab625d9024fd,0x0000000000000000,
0x0000000000000000,0x0000000000000000,0xac2560dad36752fb,0x0000000000000000, 0x8f60feed59f98803,0x482b4e92d2f527c3,0x0000000000000000,0x9cd567764c0e7049,
0x536665a889463469,0xb2ea03bb268a134f,0x0000000000000000,0xb2e835e1b80e6623, 0xa11bf1f9effe8ff5,0x482b4e92d9410e2b,0xbfcba7fab26f1df3,0x0000000000000000,
0xd7d4c38040add1c7,0x0000000000000000,0x0000000000000000,0x0000000000000000, 0xb2c2203ec742c8f9,0x0000000000000000,0x0000000000000000,0x0000000000000000,
0xdf638ad4bed34c65,0x9df9cfb653425513,0xd7d4c38040ae41d1,0x0000000000000000, 0x482b4e9313bc8ef9,0x0000000000000000,0x0000000000000000,0x0000000000000000,
0x947a68a4ac1c1501,0x6d88621e3e0beb01,0x0000000000000000,0x536665a88ceccda5, 0xbfcbab347eb17811,0x0000000000000000,0x0000000000000000,0x0000000000000000,
0x0000000000000000,0x536665a88ccb6129,0x0000000000000000,0x0000000000000000, 0x0000000000000000,0x0000000000000000,0xe68b93f55069f805,0x0000000000000000,
0x536665a8896b20ab,0x0000000000000000,0x0000000000000000,0xb07367b671947053, 0x8f60fef7e54b83e5,0x0000000000000000,0x0000000000000000,0x0000000000000000,
0xb2ea3109b4b43533,0x536665a889437cc3,0x0000000000000000,0x0000000000000000, 0xd6aa0bac12244e49,0xbfcba7dfbc5d3575,0x0000000000000000,0x0000000000000000,
0xac2560d91bdcfc25,0x9df91c40ba8cd527,0x0000000000000000,0x536665a889769513, 0x0000000000000000,0xe6f47c713b150d87,0x8f60feefdaffe809,0x0000000000000000,
0xdf638979523c12d1,0x0000000000000000,0x0000000000000000,0xb2c5e55df6610773, 0xe68b8cadaf88313b,0x0000000000000000,0x0000000000000000,0xe68aa235a8c8f37d,
0x0000000000000000,0x536665a8894345fb,0x0000000000000000,0x0000000000000000, 0x482b4e93102aeddd,0x0000000000000000,0x0000000000000000,0x496c5c19e3ebd8b9,
0x0000000000000000,0x0000000000000000,0x0000000000000000,0xac2560daec0e3851, 0xe68b8be5cd1165b3,0x9bb247cc8a92628f,0x0000000000000000,0x0000000000000000,
0x0000000000000000,0xb2c54a9d3317afb5,0xac2560d919a44b01,0x0000000000000000, 0x0000000000000000,0x0000000000000000,0x0000000000000000,0xe68b8c5878fdf7e5,
0xb77ddd8b9e414ce1,0x0000000000000000,0x18f86466c464cb01,0x0000000000000000, 0x9cd567764c09163f,0x06ce5e2ad58e50b9,0xe6f44f88499927eb,0x0000000000000000,
0x0000000000000000,0xd7d4c38040a2854f,0x9df9ce6f49907115,0xac2560d90e3e3341, 0x0000000000000000,0x0000000000000000,0x0000000000000000,0xd6aa0bac122eeac3,
0xdf63897b933beefb,0x0000000000000000,0x9df9cfb6534252e9,0xb2ea06e728b259ed, 0x8f60fef796abac39,0x8f60feffda51df2d,0x8f60fef797eb8201,0xe68b89d89c6dd7c3,
0x0000000000000000,0x0000000000000000,0xb2ea5877c412647b,0x0000000000000000, 0x0000000000000000,0x8f60fefded2bd701,0x482b4e92af827e09,0x9cd567764c099b97,
0xac2560d90618b725,0x34cb86f3fc1ca901,0xdf638ad4a65162c3,0x0000000000000000, 0xce45dbf5e933e8f9,0x8f60fef79fcb7fdd,0x0000000000000000,0xd6aa0bac10fe3491,
0x536665a88c2a1c41,0x49161f88607ba867,0xb2ead185c7065f1b,0x9df91f79b4ec2e9b, 0xbfcba797d431f6ff,0x0000000000000000,0x8f60feee76a24423,0x8f60feefdaac9887,
0x0000000000000000,0xdf638ad4bf72e239,0xac2560dad9a93d8b,0xdf638979520bcfbf, 0x0000000000000000,0xd6aa0bac122e92eb,0x8f60feeebfaa1a5b,0xa1f16a0b9a90fcab,
0xac2560dada9feda1,0x0000000000000000,0x0000000000000000,0x536665a88cc8be73, 0x0000000000000000,0x482b4e92d003f5d9,0x0000000000000000,0x9bb247cc8a9263a9,
0xdf63897b8855fa1b,0xb2c5e570be19f85b,0x9df91ccc8c85f8ed,0xd7d4c38040adb35d, 0x482b4e9313a45d19,0x0000000000000000,0x0000000000000000,0x7f82e4d7b9ad98b5,
0x0000000000000000, 0x0000000000000000,
}; };
u8 main_keys_key_array_0[] = {0x61,0x73,0x6d,}; u8 main_keys_key_array_0[] = {0x74,0x79,0x70,0x65,0x64,0x65,0x66,};
u8 main_keys_key_array_1[] = {0x73,0x74,0x72,0x75,0x63,0x74,}; u8 main_keys_key_array_2[] = {0x66,0x6c,0x6f,0x61,0x74,};
u8 main_keys_key_array_3[] = {0x64,0x6f,}; u8 main_keys_key_array_3[] = {0x6e,0x65,0x77,};
u8 main_keys_key_array_4[] = {0x67,0x6f,0x74,0x6f,}; u8 main_keys_key_array_4[] = {0x73,0x74,0x61,0x74,0x69,0x63,0x5f,0x61,0x73,0x73,0x65,0x72,0x74,};
u8 main_keys_key_array_5[] = {0x66,0x61,0x6c,0x73,0x65,}; u8 main_keys_key_array_5[] = {0x64,0x65,0x63,0x6c,0x74,0x79,0x70,0x65,};
u8 main_keys_key_array_8[] = {0x74,0x79,0x70,0x65,0x64,0x65,0x66,}; u8 main_keys_key_array_10[] = {0x63,0x61,0x73,0x65,};
u8 main_keys_key_array_10[] = {0x74,0x68,0x72,0x65,0x61,0x64,0x5f,0x6c,0x6f,0x63,0x61,0x6c,}; u8 main_keys_key_array_11[] = {0x76,0x6f,0x69,0x64,};
u8 main_keys_key_array_12[] = {0x73,0x69,0x67,0x6e,0x65,0x64,}; u8 main_keys_key_array_13[] = {0x6c,0x6f,0x6e,0x67,};
u8 main_keys_key_array_13[] = {0x66,0x72,0x69,0x65,0x6e,0x64,}; u8 main_keys_key_array_14[] = {0x62,0x6f,0x6f,0x6c,};
u8 main_keys_key_array_14[] = {0x70,0x72,0x6f,0x74,0x65,0x63,0x74,0x65,0x64,}; u8 main_keys_key_array_16[] = {0x63,0x6f,0x6e,0x74,0x69,0x6e,0x75,0x65,};
u8 main_keys_key_array_19[] = {0x63,0x6f,0x6e,0x73,0x74,}; u8 main_keys_key_array_17[] = {0x61,0x6c,0x69,0x67,0x6e,0x6f,0x66,};
u8 main_keys_key_array_21[] = {0x74,0x79,0x70,0x65,0x69,0x64,}; u8 main_keys_key_array_19[] = {0x73,0x69,0x7a,0x65,0x6f,0x66,};
u8 main_keys_key_array_22[] = {0x75,0x6e,0x73,0x69,0x67,0x6e,0x65,0x64,}; u8 main_keys_key_array_20[] = {0x74,0x72,0x75,0x65,};
u8 main_keys_key_array_24[] = {0x72,0x65,0x74,0x75,0x72,0x6e,}; u8 main_keys_key_array_21[] = {0x61,0x73,0x6d,};
u8 main_keys_key_array_25[] = {0x70,0x75,0x62,0x6c,0x69,0x63,}; u8 main_keys_key_array_22[] = {0x66,0x72,0x69,0x65,0x6e,0x64,};
u8 main_keys_key_array_28[] = {0x69,0x6e,0x6c,0x69,0x6e,0x65,}; u8 main_keys_key_array_25[] = {0x75,0x6e,0x69,0x6f,0x6e,};
u8 main_keys_key_array_34[] = {0x77,0x68,0x69,0x6c,0x65,}; u8 main_keys_key_array_27[] = {0x63,0x68,0x61,0x72,};
u8 main_keys_key_array_36[] = {0x62,0x6f,0x6f,0x6c,}; u8 main_keys_key_array_28[] = {0x62,0x72,0x65,0x61,0x6b,};
u8 main_keys_key_array_37[] = {0x6f,0x70,0x65,0x72,0x61,0x74,0x6f,0x72,}; u8 main_keys_key_array_29[] = {0x72,0x65,0x74,0x75,0x72,0x6e,};
u8 main_keys_key_array_39[] = {0x74,0x79,0x70,0x65,0x6e,0x61,0x6d,0x65,}; u8 main_keys_key_array_30[] = {0x64,0x65,0x66,0x61,0x75,0x6c,0x74,};
u8 main_keys_key_array_40[] = {0x74,0x72,0x79,}; u8 main_keys_key_array_32[] = {0x64,0x6f,0x75,0x62,0x6c,0x65,};
u8 main_keys_key_array_44[] = {0x73,0x77,0x69,0x74,0x63,0x68,}; u8 main_keys_key_array_33[] = {0x77,0x68,0x69,0x6c,0x65,};
u8 main_keys_key_array_45[] = {0x61,0x6c,0x69,0x67,0x6e,0x6f,0x66,}; u8 main_keys_key_array_35[] = {0x69,0x6e,0x74,};
u8 main_keys_key_array_46[] = {0x69,0x6e,0x74,}; u8 main_keys_key_array_36[] = {0x70,0x72,0x6f,0x74,0x65,0x63,0x74,0x65,0x64,};
u8 main_keys_key_array_48[] = {0x72,0x65,0x69,0x6e,0x74,0x65,0x72,0x70,0x72,0x65,0x74,0x5f,0x63,0x61,0x73,0x74,}; u8 main_keys_key_array_37[] = {0x66,0x61,0x6c,0x73,0x65,};
u8 main_keys_key_array_49[] = {0x73,0x74,0x61,0x74,0x69,0x63,0x5f,0x63,0x61,0x73,0x74,}; u8 main_keys_key_array_38[] = {0x70,0x72,0x69,0x76,0x61,0x74,0x65,};
u8 main_keys_key_array_51[] = {0x76,0x6f,0x69,0x64,}; u8 main_keys_key_array_40[] = {0x72,0x65,0x69,0x6e,0x74,0x65,0x72,0x70,0x72,0x65,0x74,0x5f,0x63,0x61,0x73,0x74,};
u8 main_keys_key_array_53[] = {0x74,0x68,0x69,0x73,}; u8 main_keys_key_array_44[] = {0x63,0x6f,0x6e,0x73,0x74,};
u8 main_keys_key_array_56[] = {0x63,0x68,0x61,0x72,}; u8 main_keys_key_array_48[] = {0x61,0x6c,0x69,0x67,0x6e,0x61,0x73,};
u8 main_keys_key_array_59[] = {0x6e,0x61,0x6d,0x65,0x73,0x70,0x61,0x63,0x65,}; u8 main_keys_key_array_54[] = {0x6e,0x6f,0x65,0x78,0x63,0x65,0x70,0x74,};
u8 main_keys_key_array_60[] = {0x72,0x65,0x67,0x69,0x73,0x74,0x65,0x72,}; u8 main_keys_key_array_56[] = {0x73,0x69,0x67,0x6e,0x65,0x64,};
u8 main_keys_key_array_61[] = {0x65,0x6c,0x73,0x65,}; u8 main_keys_key_array_60[] = {0x67,0x6f,0x74,0x6f,};
u8 main_keys_key_array_64[] = {0x63,0x61,0x74,0x63,0x68,}; u8 main_keys_key_array_61[] = {0x76,0x69,0x72,0x74,0x75,0x61,0x6c,};
u8 main_keys_key_array_65[] = {0x6e,0x75,0x6c,0x6c,0x70,0x74,0x72,}; u8 main_keys_key_array_65[] = {0x6f,0x70,0x65,0x72,0x61,0x74,0x6f,0x72,};
u8 main_keys_key_array_67[] = {0x63,0x61,0x73,0x65,}; u8 main_keys_key_array_66[] = {0x65,0x78,0x70,0x6f,0x72,0x74,};
u8 main_keys_key_array_68[] = {0x65,0x78,0x70,0x6f,0x72,0x74,}; u8 main_keys_key_array_68[] = {0x74,0x79,0x70,0x65,0x6e,0x61,0x6d,0x65,};
u8 main_keys_key_array_71[] = {0x63,0x6f,0x6e,0x74,0x69,0x6e,0x75,0x65,}; u8 main_keys_key_array_71[] = {0x65,0x78,0x70,0x6c,0x69,0x63,0x69,0x74,};
u8 main_keys_key_array_73[] = {0x65,0x6e,0x75,0x6d,}; u8 main_keys_key_array_72[] = {0x63,0x61,0x74,0x63,0x68,};
u8 main_keys_key_array_79[] = {0x73,0x68,0x6f,0x72,0x74,}; u8 main_keys_key_array_75[] = {0x73,0x74,0x61,0x74,0x69,0x63,0x5f,0x63,0x61,0x73,0x74,};
u8 main_keys_key_array_81[] = {0x65,0x78,0x70,0x6c,0x69,0x63,0x69,0x74,}; u8 main_keys_key_array_76[] = {0x74,0x65,0x6d,0x70,0x6c,0x61,0x74,0x65,};
u8 main_keys_key_array_82[] = {0x63,0x6c,0x61,0x73,0x73,}; u8 main_keys_key_array_77[] = {0x69,0x66,};
u8 main_keys_key_array_84[] = {0x73,0x74,0x61,0x74,0x69,0x63,0x5f,0x61,0x73,0x73,0x65,0x72,0x74,}; u8 main_keys_key_array_83[] = {0x75,0x6e,0x73,0x69,0x67,0x6e,0x65,0x64,};
u8 main_keys_key_array_86[] = {0x64,0x79,0x6e,0x61,0x6d,0x69,0x63,0x5f,0x63,0x61,0x73,0x74,}; u8 main_keys_key_array_84[] = {0x74,0x72,0x79,};
u8 main_keys_key_array_89[] = {0x66,0x6f,0x72,}; u8 main_keys_key_array_85[] = {0x64,0x79,0x6e,0x61,0x6d,0x69,0x63,0x5f,0x63,0x61,0x73,0x74,};
u8 main_keys_key_array_90[] = {0x64,0x65,0x66,0x61,0x75,0x6c,0x74,}; u8 main_keys_key_array_86[] = {0x72,0x65,0x67,0x69,0x73,0x74,0x65,0x72,};
u8 main_keys_key_array_91[] = {0x62,0x72,0x65,0x61,0x6b,}; u8 main_keys_key_array_91[] = {0x65,0x6e,0x75,0x6d,};
u8 main_keys_key_array_92[] = {0x64,0x65,0x6c,0x65,0x74,0x65,}; u8 main_keys_key_array_92[] = {0x73,0x74,0x72,0x75,0x63,0x74,};
u8 main_keys_key_array_94[] = {0x61,0x6c,0x69,0x67,0x6e,0x61,0x73,}; u8 main_keys_key_array_93[] = {0x74,0x79,0x70,0x65,0x69,0x64,};
u8 main_keys_key_array_95[] = {0x6e,0x6f,0x65,0x78,0x63,0x65,0x70,0x74,}; u8 main_keys_key_array_94[] = {0x73,0x74,0x61,0x74,0x69,0x63,};
u8 main_keys_key_array_98[] = {0x76,0x6f,0x6c,0x61,0x74,0x69,0x6c,0x65,}; u8 main_keys_key_array_95[] = {0x76,0x6f,0x6c,0x61,0x74,0x69,0x6c,0x65,};
u8 main_keys_key_array_100[] = {0x66,0x6c,0x6f,0x61,0x74,}; u8 main_keys_key_array_97[] = {0x70,0x75,0x62,0x6c,0x69,0x63,};
u8 main_keys_key_array_101[] = {0x63,0x6f,0x6e,0x73,0x74,0x5f,0x63,0x61,0x73,0x74,}; u8 main_keys_key_array_98[] = {0x73,0x68,0x6f,0x72,0x74,};
u8 main_keys_key_array_102[] = {0x73,0x69,0x7a,0x65,0x6f,0x66,}; u8 main_keys_key_array_99[] = {0x66,0x6f,0x72,};
u8 main_keys_key_array_104[] = {0x6c,0x6f,0x6e,0x67,}; u8 main_keys_key_array_100[] = {0x63,0x6f,0x6e,0x73,0x74,0x5f,0x63,0x61,0x73,0x74,};
u8 main_keys_key_array_105[] = {0x69,0x66,}; u8 main_keys_key_array_101[] = {0x73,0x77,0x69,0x74,0x63,0x68,};
u8 main_keys_key_array_106[] = {0x74,0x65,0x6d,0x70,0x6c,0x61,0x74,0x65,}; u8 main_keys_key_array_103[] = {0x74,0x68,0x69,0x73,};
u8 main_keys_key_array_107[] = {0x70,0x72,0x69,0x76,0x61,0x74,0x65,}; u8 main_keys_key_array_104[] = {0x6e,0x75,0x6c,0x6c,0x70,0x74,0x72,};
u8 main_keys_key_array_109[] = {0x73,0x74,0x61,0x74,0x69,0x63,}; u8 main_keys_key_array_106[] = {0x64,0x65,0x6c,0x65,0x74,0x65,};
u8 main_keys_key_array_110[] = {0x75,0x6e,0x69,0x6f,0x6e,}; u8 main_keys_key_array_107[] = {0x65,0x78,0x74,0x65,0x72,0x6e,};
u8 main_keys_key_array_111[] = {0x65,0x78,0x74,0x65,0x72,0x6e,}; u8 main_keys_key_array_109[] = {0x65,0x6c,0x73,0x65,};
u8 main_keys_key_array_112[] = {0x75,0x73,0x69,0x6e,0x67,}; u8 main_keys_key_array_110[] = {0x69,0x6e,0x6c,0x69,0x6e,0x65,};
u8 main_keys_key_array_115[] = {0x74,0x72,0x75,0x65,}; u8 main_keys_key_array_111[] = {0x6e,0x61,0x6d,0x65,0x73,0x70,0x61,0x63,0x65,};
u8 main_keys_key_array_116[] = {0x64,0x6f,0x75,0x62,0x6c,0x65,}; u8 main_keys_key_array_113[] = {0x75,0x73,0x69,0x6e,0x67,};
u8 main_keys_key_array_117[] = {0x64,0x65,0x63,0x6c,0x74,0x79,0x70,0x65,}; u8 main_keys_key_array_115[] = {0x64,0x6f,};
u8 main_keys_key_array_118[] = {0x76,0x69,0x72,0x74,0x75,0x61,0x6c,}; u8 main_keys_key_array_116[] = {0x63,0x6c,0x61,0x73,0x73,};
u8 main_keys_key_array_119[] = {0x6e,0x65,0x77,}; u8 main_keys_key_array_119[] = {0x74,0x68,0x72,0x65,0x61,0x64,0x5f,0x6c,0x6f,0x63,0x61,0x6c,};
String_Const_u8 main_keys_key_array[121] = { String_Const_u8 main_keys_key_array[121] = {
{main_keys_key_array_0, 3}, {main_keys_key_array_0, 7},
{main_keys_key_array_1, 6},
{0, 0}, {0, 0},
{main_keys_key_array_3, 2}, {main_keys_key_array_2, 5},
{main_keys_key_array_4, 4}, {main_keys_key_array_3, 3},
{main_keys_key_array_5, 5}, {main_keys_key_array_4, 13},
{0, 0}, {main_keys_key_array_5, 8},
{0, 0},
{main_keys_key_array_8, 7},
{0, 0},
{main_keys_key_array_10, 12},
{0, 0},
{main_keys_key_array_12, 6},
{main_keys_key_array_13, 6},
{main_keys_key_array_14, 9},
{0, 0}, {0, 0},
{0, 0}, {0, 0},
{0, 0}, {0, 0},
{0, 0}, {0, 0},
{main_keys_key_array_19, 5}, {main_keys_key_array_10, 4},
{main_keys_key_array_11, 4},
{0, 0}, {0, 0},
{main_keys_key_array_21, 6}, {main_keys_key_array_13, 4},
{main_keys_key_array_22, 8}, {main_keys_key_array_14, 4},
{0, 0}, {0, 0},
{main_keys_key_array_24, 6}, {main_keys_key_array_16, 8},
{main_keys_key_array_25, 6}, {main_keys_key_array_17, 7},
{0, 0},
{main_keys_key_array_19, 6},
{main_keys_key_array_20, 4},
{main_keys_key_array_21, 3},
{main_keys_key_array_22, 6},
{0, 0}, {0, 0},
{0, 0}, {0, 0},
{main_keys_key_array_28, 6}, {main_keys_key_array_25, 5},
{0, 0},
{main_keys_key_array_27, 4},
{main_keys_key_array_28, 5},
{main_keys_key_array_29, 6},
{main_keys_key_array_30, 7},
{0, 0},
{main_keys_key_array_32, 6},
{main_keys_key_array_33, 5},
{0, 0},
{main_keys_key_array_35, 3},
{main_keys_key_array_36, 9},
{main_keys_key_array_37, 5},
{main_keys_key_array_38, 7},
{0, 0},
{main_keys_key_array_40, 16},
{0, 0},
{0, 0},
{0, 0},
{main_keys_key_array_44, 5},
{0, 0},
{0, 0},
{0, 0},
{main_keys_key_array_48, 7},
{0, 0}, {0, 0},
{0, 0}, {0, 0},
{0, 0}, {0, 0},
{0, 0}, {0, 0},
{0, 0}, {0, 0},
{main_keys_key_array_34, 5}, {main_keys_key_array_54, 8},
{0, 0}, {0, 0},
{main_keys_key_array_36, 4}, {main_keys_key_array_56, 6},
{main_keys_key_array_37, 8},
{0, 0},
{main_keys_key_array_39, 8},
{main_keys_key_array_40, 3},
{0, 0}, {0, 0},
{0, 0}, {0, 0},
{0, 0}, {0, 0},
{main_keys_key_array_44, 6}, {main_keys_key_array_60, 4},
{main_keys_key_array_45, 7}, {main_keys_key_array_61, 7},
{main_keys_key_array_46, 3},
{0, 0},
{main_keys_key_array_48, 16},
{main_keys_key_array_49, 11},
{0, 0},
{main_keys_key_array_51, 4},
{0, 0},
{main_keys_key_array_53, 4},
{0, 0}, {0, 0},
{0, 0}, {0, 0},
{main_keys_key_array_56, 4},
{0, 0}, {0, 0},
{main_keys_key_array_65, 8},
{main_keys_key_array_66, 6},
{0, 0}, {0, 0},
{main_keys_key_array_59, 9}, {main_keys_key_array_68, 8},
{main_keys_key_array_60, 8},
{main_keys_key_array_61, 4},
{0, 0},
{0, 0},
{main_keys_key_array_64, 5},
{main_keys_key_array_65, 7},
{0, 0},
{main_keys_key_array_67, 4},
{main_keys_key_array_68, 6},
{0, 0}, {0, 0},
{0, 0}, {0, 0},
{main_keys_key_array_71, 8}, {main_keys_key_array_71, 8},
{main_keys_key_array_72, 5},
{0, 0}, {0, 0},
{main_keys_key_array_73, 4}, {0, 0},
{main_keys_key_array_75, 11},
{main_keys_key_array_76, 8},
{main_keys_key_array_77, 2},
{0, 0}, {0, 0},
{0, 0}, {0, 0},
{0, 0}, {0, 0},
{0, 0}, {0, 0},
{0, 0}, {0, 0},
{main_keys_key_array_79, 5}, {main_keys_key_array_83, 8},
{0, 0}, {main_keys_key_array_84, 3},
{main_keys_key_array_81, 8}, {main_keys_key_array_85, 12},
{main_keys_key_array_82, 5}, {main_keys_key_array_86, 8},
{0, 0},
{main_keys_key_array_84, 13},
{0, 0},
{main_keys_key_array_86, 12},
{0, 0}, {0, 0},
{0, 0}, {0, 0},
{main_keys_key_array_89, 3}, {0, 0},
{main_keys_key_array_90, 7}, {0, 0},
{main_keys_key_array_91, 5}, {main_keys_key_array_91, 4},
{main_keys_key_array_92, 6}, {main_keys_key_array_92, 6},
{0, 0}, {main_keys_key_array_93, 6},
{main_keys_key_array_94, 7}, {main_keys_key_array_94, 6},
{main_keys_key_array_95, 8}, {main_keys_key_array_95, 8},
{0, 0}, {0, 0},
{main_keys_key_array_97, 6},
{main_keys_key_array_98, 5},
{main_keys_key_array_99, 3},
{main_keys_key_array_100, 10},
{main_keys_key_array_101, 6},
{0, 0}, {0, 0},
{main_keys_key_array_98, 8}, {main_keys_key_array_103, 4},
{main_keys_key_array_104, 7},
{0, 0}, {0, 0},
{main_keys_key_array_100, 5}, {main_keys_key_array_106, 6},
{main_keys_key_array_101, 10}, {main_keys_key_array_107, 6},
{main_keys_key_array_102, 6},
{0, 0}, {0, 0},
{main_keys_key_array_104, 4}, {main_keys_key_array_109, 4},
{main_keys_key_array_105, 2}, {main_keys_key_array_110, 6},
{main_keys_key_array_106, 8}, {main_keys_key_array_111, 9},
{main_keys_key_array_107, 7},
{0, 0}, {0, 0},
{main_keys_key_array_109, 6}, {main_keys_key_array_113, 5},
{main_keys_key_array_110, 5}, {0, 0},
{main_keys_key_array_111, 6}, {main_keys_key_array_115, 2},
{main_keys_key_array_112, 5}, {main_keys_key_array_116, 5},
{0, 0}, {0, 0},
{0, 0}, {0, 0},
{main_keys_key_array_115, 4}, {main_keys_key_array_119, 12},
{main_keys_key_array_116, 6},
{main_keys_key_array_117, 8},
{main_keys_key_array_118, 7},
{main_keys_key_array_119, 3},
{0, 0}, {0, 0},
}; };
Lexeme_Table_Value main_keys_value_array[121] = { Lexeme_Table_Value main_keys_value_array[121] = {
{4, TokenCppKind_Asm},
{4, TokenCppKind_Struct},
{0, 0},
{4, TokenCppKind_Do},
{4, TokenCppKind_Goto},
{8, TokenCppKind_LiteralFalse},
{0, 0},
{0, 0},
{4, TokenCppKind_Typedef}, {4, TokenCppKind_Typedef},
{0, 0}, {0, 0},
{4, TokenCppKind_ThreadLocal}, {4, TokenCppKind_Float},
{4, TokenCppKind_New},
{4, TokenCppKind_StaticAssert},
{4, TokenCppKind_DeclType},
{0, 0}, {0, 0},
{4, TokenCppKind_Signed}, {0, 0},
{0, 0},
{0, 0},
{4, TokenCppKind_Case},
{4, TokenCppKind_Void},
{0, 0},
{4, TokenCppKind_Long},
{4, TokenCppKind_Bool},
{0, 0},
{4, TokenCppKind_Continue},
{4, TokenCppKind_AlignOf},
{0, 0},
{4, TokenCppKind_SizeOf},
{8, TokenCppKind_LiteralTrue},
{4, TokenCppKind_Asm},
{4, TokenCppKind_Friend}, {4, TokenCppKind_Friend},
{4, TokenCppKind_Protected},
{0, 0}, {0, 0},
{0, 0}, {0, 0},
{4, TokenCppKind_Union},
{0, 0},
{4, TokenCppKind_Char},
{4, TokenCppKind_Break},
{4, TokenCppKind_Return},
{4, TokenCppKind_Default},
{0, 0},
{4, TokenCppKind_Double},
{4, TokenCppKind_While},
{0, 0},
{4, TokenCppKind_Int},
{4, TokenCppKind_Protected},
{8, TokenCppKind_LiteralFalse},
{4, TokenCppKind_Private},
{0, 0},
{4, TokenCppKind_ReinterpretCast},
{0, 0},
{0, 0}, {0, 0},
{0, 0}, {0, 0},
{4, TokenCppKind_Const}, {4, TokenCppKind_Const},
{0, 0}, {0, 0},
{4, TokenCppKind_TypeID},
{4, TokenCppKind_Unsigned},
{0, 0}, {0, 0},
{4, TokenCppKind_Return},
{4, TokenCppKind_Public},
{0, 0},
{0, 0},
{4, TokenCppKind_Inline},
{0, 0},
{0, 0},
{0, 0},
{0, 0},
{0, 0},
{4, TokenCppKind_While},
{0, 0},
{4, TokenCppKind_Bool},
{4, TokenCppKind_Operator},
{0, 0},
{4, TokenCppKind_Typename},
{4, TokenCppKind_Try},
{0, 0},
{0, 0},
{0, 0},
{4, TokenCppKind_Switch},
{4, TokenCppKind_AlignOf},
{4, TokenCppKind_Int},
{0, 0},
{4, TokenCppKind_ReinterpretCast},
{4, TokenCppKind_StaticCast},
{0, 0},
{4, TokenCppKind_Void},
{0, 0},
{4, TokenCppKind_This},
{0, 0},
{0, 0},
{4, TokenCppKind_Char},
{0, 0},
{0, 0},
{4, TokenCppKind_Namespace},
{4, TokenCppKind_Register},
{4, TokenCppKind_Else},
{0, 0},
{0, 0},
{4, TokenCppKind_Catch},
{4, TokenCppKind_NullPtr},
{0, 0},
{4, TokenCppKind_Case},
{4, TokenCppKind_Export},
{0, 0},
{0, 0},
{4, TokenCppKind_Continue},
{0, 0},
{4, TokenCppKind_Enum},
{0, 0},
{0, 0},
{0, 0},
{0, 0},
{0, 0},
{4, TokenCppKind_Short},
{0, 0},
{4, TokenCppKind_Explicit},
{4, TokenCppKind_Class},
{0, 0},
{4, TokenCppKind_StaticAssert},
{0, 0},
{4, TokenCppKind_DynamicCast},
{0, 0},
{0, 0},
{4, TokenCppKind_For},
{4, TokenCppKind_Default},
{4, TokenCppKind_Break},
{4, TokenCppKind_Delete},
{0, 0}, {0, 0},
{4, TokenCppKind_AlignAs}, {4, TokenCppKind_AlignAs},
{0, 0},
{0, 0},
{0, 0},
{0, 0},
{0, 0},
{4, TokenCppKind_NoExcept}, {4, TokenCppKind_NoExcept},
{0, 0}, {0, 0},
{4, TokenCppKind_Signed},
{0, 0}, {0, 0},
{0, 0},
{0, 0},
{4, TokenCppKind_Goto},
{4, TokenCppKind_Virtual},
{0, 0},
{0, 0},
{0, 0},
{4, TokenCppKind_Operator},
{4, TokenCppKind_Export},
{0, 0},
{4, TokenCppKind_Typename},
{0, 0},
{0, 0},
{4, TokenCppKind_Explicit},
{4, TokenCppKind_Catch},
{0, 0},
{0, 0},
{4, TokenCppKind_StaticCast},
{4, TokenCppKind_Template},
{4, TokenCppKind_If},
{0, 0},
{0, 0},
{0, 0},
{0, 0},
{0, 0},
{4, TokenCppKind_Unsigned},
{4, TokenCppKind_Try},
{4, TokenCppKind_DynamicCast},
{4, TokenCppKind_Register},
{0, 0},
{0, 0},
{0, 0},
{0, 0},
{4, TokenCppKind_Enum},
{4, TokenCppKind_Struct},
{4, TokenCppKind_TypeID},
{4, TokenCppKind_Static},
{4, TokenCppKind_Volatile}, {4, TokenCppKind_Volatile},
{0, 0}, {0, 0},
{4, TokenCppKind_Float}, {4, TokenCppKind_Public},
{4, TokenCppKind_Short},
{4, TokenCppKind_For},
{4, TokenCppKind_ConstCast}, {4, TokenCppKind_ConstCast},
{4, TokenCppKind_SizeOf}, {4, TokenCppKind_Switch},
{0, 0}, {0, 0},
{4, TokenCppKind_Long}, {4, TokenCppKind_This},
{4, TokenCppKind_If}, {4, TokenCppKind_NullPtr},
{4, TokenCppKind_Template},
{4, TokenCppKind_Private},
{0, 0}, {0, 0},
{4, TokenCppKind_Static}, {4, TokenCppKind_Delete},
{4, TokenCppKind_Union},
{4, TokenCppKind_Extern}, {4, TokenCppKind_Extern},
{0, 0},
{4, TokenCppKind_Else},
{4, TokenCppKind_Inline},
{4, TokenCppKind_Namespace},
{0, 0},
{4, TokenCppKind_Using}, {4, TokenCppKind_Using},
{0, 0}, {0, 0},
{4, TokenCppKind_Do},
{4, TokenCppKind_Class},
{0, 0}, {0, 0},
{8, TokenCppKind_LiteralTrue}, {0, 0},
{4, TokenCppKind_Double}, {4, TokenCppKind_ThreadLocal},
{4, TokenCppKind_DeclType},
{4, TokenCppKind_Virtual},
{4, TokenCppKind_New},
{0, 0}, {0, 0},
}; };
i32 main_keys_slot_count = 121; i32 main_keys_slot_count = 121;
u64 main_keys_seed = 0xc6a99799e45617dd; u64 main_keys_seed = 0x25509496d6df2725;
u64 pp_directives_hash_array[25] = { u64 pp_directives_hash_array[25] = {
0xfa6a010b7dbbde13,0x0000000000000000,0xce2f38db2af5366d,0xfa6a010b7d62d06d, 0x0000000000000000,0xa14a48a955ec8363,0x0000000000000000,0x7136ce53f348205b,
0xcc962e54221688f9,0x0000000000000000,0x03b5dc5556efc84d,0xfa6a010b0bc317e5, 0x37ce6c4c8b78b22f,0x37ce6c4cbe897123,0x0000000000000000,0x0000000000000000,
0x0000000000000000,0xcaa053e8a98a24b9,0xcaa053e8a98a2085,0xcc9620cd74b482d5, 0x34cc7d0370d48693,0x0000000000000000,0x85a685922339fb23,0x0000000000000000,
0x0000000000000000,0x0000000000000000,0x0000000000000000,0x0000000000000000, 0xa14a48a95710f7e3,0x0000000000000000,0x34cc7d0370d49bc9,0x34cc7d0370df735f,
0xce2f38da33096dd7,0xce2f38dbf3d6ad6d,0xfa6a010b0bd76809,0x0000000000000000, 0x713637c0adca7df7,0x0000000000000000,0x0000000000000000,0xa14a48a9743d0c09,
0xfa6a010b0edd496d,0xce2f38e88510d3c9,0x0000000000000000,0xcaa053e8aa33abcd, 0x37ce6c4c19255fdf,0xa14a48aa88a0f2e3,0x0000000000000000,0xa14a48a958e03643,
0x0000000000000000, 0x37ce6c4e49825775,
}; };
u8 pp_directives_key_array_0[] = {0x75,0x73,0x69,0x6e,0x67,}; u8 pp_directives_key_array_1[] = {0x69,0x66,0x64,0x65,0x66,};
u8 pp_directives_key_array_2[] = {0x64,0x65,0x66,0x69,0x6e,0x65,}; u8 pp_directives_key_array_3[] = {0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,};
u8 pp_directives_key_array_3[] = {0x75,0x6e,0x64,0x65,0x66,}; u8 pp_directives_key_array_4[] = {0x69,0x6d,0x70,0x6f,0x72,0x74,};
u8 pp_directives_key_array_4[] = {0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,}; u8 pp_directives_key_array_5[] = {0x69,0x66,0x6e,0x64,0x65,0x66,};
u8 pp_directives_key_array_6[] = {0x69,0x66,}; u8 pp_directives_key_array_8[] = {0x65,0x6c,0x69,0x66,};
u8 pp_directives_key_array_7[] = {0x65,0x6e,0x64,0x69,0x66,}; u8 pp_directives_key_array_10[] = {0x69,0x66,};
u8 pp_directives_key_array_9[] = {0x65,0x6c,0x73,0x65,}; u8 pp_directives_key_array_12[] = {0x65,0x6e,0x64,0x69,0x66,};
u8 pp_directives_key_array_10[] = {0x65,0x6c,0x69,0x66,}; u8 pp_directives_key_array_14[] = {0x65,0x6c,0x73,0x65,};
u8 pp_directives_key_array_11[] = {0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,}; u8 pp_directives_key_array_15[] = {0x6c,0x69,0x6e,0x65,};
u8 pp_directives_key_array_16[] = {0x69,0x6d,0x70,0x6f,0x72,0x74,}; u8 pp_directives_key_array_16[] = {0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,};
u8 pp_directives_key_array_17[] = {0x69,0x66,0x6e,0x64,0x65,0x66,}; u8 pp_directives_key_array_19[] = {0x75,0x73,0x69,0x6e,0x67,};
u8 pp_directives_key_array_18[] = {0x65,0x72,0x72,0x6f,0x72,}; u8 pp_directives_key_array_20[] = {0x64,0x65,0x66,0x69,0x6e,0x65,};
u8 pp_directives_key_array_20[] = {0x69,0x66,0x64,0x65,0x66,}; u8 pp_directives_key_array_21[] = {0x75,0x6e,0x64,0x65,0x66,};
u8 pp_directives_key_array_21[] = {0x70,0x72,0x61,0x67,0x6d,0x61,}; u8 pp_directives_key_array_23[] = {0x65,0x72,0x72,0x6f,0x72,};
u8 pp_directives_key_array_23[] = {0x6c,0x69,0x6e,0x65,}; u8 pp_directives_key_array_24[] = {0x70,0x72,0x61,0x67,0x6d,0x61,};
String_Const_u8 pp_directives_key_array[25] = { String_Const_u8 pp_directives_key_array[25] = {
{pp_directives_key_array_0, 5},
{0, 0}, {0, 0},
{pp_directives_key_array_2, 6}, {pp_directives_key_array_1, 5},
{pp_directives_key_array_3, 5},
{pp_directives_key_array_4, 7},
{0, 0}, {0, 0},
{pp_directives_key_array_6, 2}, {pp_directives_key_array_3, 7},
{pp_directives_key_array_7, 5}, {pp_directives_key_array_4, 6},
{0, 0}, {pp_directives_key_array_5, 6},
{pp_directives_key_array_9, 4},
{pp_directives_key_array_10, 4},
{pp_directives_key_array_11, 7},
{0, 0}, {0, 0},
{0, 0}, {0, 0},
{pp_directives_key_array_8, 4},
{0, 0},
{pp_directives_key_array_10, 2},
{0, 0},
{pp_directives_key_array_12, 5},
{0, 0},
{pp_directives_key_array_14, 4},
{pp_directives_key_array_15, 4},
{pp_directives_key_array_16, 7},
{0, 0}, {0, 0},
{0, 0}, {0, 0},
{pp_directives_key_array_16, 6}, {pp_directives_key_array_19, 5},
{pp_directives_key_array_17, 6}, {pp_directives_key_array_20, 6},
{pp_directives_key_array_18, 5}, {pp_directives_key_array_21, 5},
{0, 0},
{pp_directives_key_array_20, 5},
{pp_directives_key_array_21, 6},
{0, 0},
{pp_directives_key_array_23, 4},
{0, 0}, {0, 0},
{pp_directives_key_array_23, 5},
{pp_directives_key_array_24, 6},
}; };
Lexeme_Table_Value pp_directives_value_array[25] = { Lexeme_Table_Value pp_directives_value_array[25] = {
{5, TokenCppKind_PPUsing},
{0, 0}, {0, 0},
{5, TokenCppKind_PPDefine}, {5, TokenCppKind_PPIfDef},
{5, TokenCppKind_PPUndef}, {0, 0},
{5, TokenCppKind_PPInclude}, {5, TokenCppKind_PPVersion},
{5, TokenCppKind_PPImport},
{5, TokenCppKind_PPIfNDef},
{0, 0},
{0, 0},
{5, TokenCppKind_PPElIf},
{0, 0}, {0, 0},
{5, TokenCppKind_PPIf}, {5, TokenCppKind_PPIf},
{0, 0},
{5, TokenCppKind_PPEndIf}, {5, TokenCppKind_PPEndIf},
{0, 0}, {0, 0},
{5, TokenCppKind_PPElse}, {5, TokenCppKind_PPElse},
{5, TokenCppKind_PPElIf},
{5, TokenCppKind_PPVersion},
{0, 0},
{0, 0},
{0, 0},
{0, 0},
{5, TokenCppKind_PPImport},
{5, TokenCppKind_PPIfNDef},
{5, TokenCppKind_PPError},
{0, 0},
{5, TokenCppKind_PPIfDef},
{5, TokenCppKind_PPPragma},
{0, 0},
{5, TokenCppKind_PPLine}, {5, TokenCppKind_PPLine},
{5, TokenCppKind_PPInclude},
{0, 0}, {0, 0},
{0, 0},
{5, TokenCppKind_PPUsing},
{5, TokenCppKind_PPDefine},
{5, TokenCppKind_PPUndef},
{0, 0},
{5, TokenCppKind_PPError},
{5, TokenCppKind_PPPragma},
}; };
i32 pp_directives_slot_count = 25; i32 pp_directives_slot_count = 25;
u64 pp_directives_seed = 0x7dd6fc44901da387; u64 pp_directives_seed = 0x6a6565df267ce22a;
u64 pp_keys_hash_array[2] = { u64 pp_keys_hash_array[2] = {
0x0000000000000000,0x3eb4becea6185ce7, 0x0000000000000000,0xa92d334d98f81307,
}; };
u8 pp_keys_key_array_1[] = {0x64,0x65,0x66,0x69,0x6e,0x65,0x64,}; u8 pp_keys_key_array_1[] = {0x64,0x65,0x66,0x69,0x6e,0x65,0x64,};
String_Const_u8 pp_keys_key_array[2] = { String_Const_u8 pp_keys_key_array[2] = {
@ -483,7 +483,7 @@ Lexeme_Table_Value pp_keys_value_array[2] = {
{4, TokenCppKind_PPDefined}, {4, TokenCppKind_PPDefined},
}; };
i32 pp_keys_slot_count = 2; i32 pp_keys_slot_count = 2;
u64 pp_keys_seed = 0x62441372bace9443; u64 pp_keys_seed = 0x0a7073ccb09f1aa3;
struct Lex_State_Cpp{ struct Lex_State_Cpp{
u32 flags_ZF0; u32 flags_ZF0;
u32 flags_KF0; u32 flags_KF0;