diff --git a/4ed.cpp b/4ed.cpp index 7ac8f926..250e2bd3 100644 --- a/4ed.cpp +++ b/4ed.cpp @@ -757,16 +757,10 @@ App_Step_Sig(app_step){ panel != 0; panel = layout_get_next_open_panel(layout, panel)){ View *view = panel->view; - if (!view->ui_mode){ - File_Edit_Positions edit_pos = view_get_edit_pos(view); - edit_pos.scroll.position = view_normalize_buffer_point(models, view, edit_pos.scroll.target); - block_zero_struct(&edit_pos.scroll.target); - view_set_edit_pos(view, edit_pos); - } - else{ - view->ui_scroll.position = view->ui_scroll.target; - block_zero_struct(&view->ui_scroll.target); - } + File_Edit_Positions edit_pos = view_get_edit_pos(view); + edit_pos.scroll.position = view_normalize_buffer_point(models, view, edit_pos.scroll.target); + block_zero_struct(&edit_pos.scroll.target); + view_set_edit_pos(view, edit_pos); } } @@ -780,32 +774,20 @@ App_Step_Sig(app_step){ View_ID view_id = view_get_id(&models->live_set, view); b32 new_target = (b32)view->new_scroll_target; - if (view->ui_mode){ - Vec2_f32 pending = view->ui_scroll.target - view->ui_scroll.position; - if (!near_zero(pending, 0.5f)){ - Vec2_f32 partial = scroll_rule(pending, view_id, new_target, animation_dt); - view->ui_scroll.position += partial; - models->animate_next_frame = true; - } - else{ - view->ui_scroll.position = view->ui_scroll.target; - } + + File_Edit_Positions edit_pos = view_get_edit_pos(view); + Vec2_f32 pending = view_buffer_point_difference(models, view, + edit_pos.scroll.target, edit_pos.scroll.position); + if (!near_zero(pending, 0.5f)){ + Vec2_f32 partial = scroll_rule(pending, view_id, new_target, animation_dt); + edit_pos.scroll.position = view_move_buffer_point(models, view, + edit_pos.scroll.position, partial); + view_set_edit_pos(view, edit_pos); + models->animate_next_frame = true; } else{ - File_Edit_Positions edit_pos = view_get_edit_pos(view); - Vec2_f32 pending = view_buffer_point_difference(models, view, - edit_pos.scroll.target, edit_pos.scroll.position); - if (!near_zero(pending, 0.5f)){ - Vec2_f32 partial = scroll_rule(pending, view_id, new_target, animation_dt); - edit_pos.scroll.position = view_move_buffer_point(models, view, - edit_pos.scroll.position, partial); - view_set_edit_pos(view, edit_pos); - models->animate_next_frame = true; - } - else{ - edit_pos.scroll.position = edit_pos.scroll.target; - view_set_edit_pos(view, edit_pos); - } + edit_pos.scroll.position = edit_pos.scroll.target; + view_set_edit_pos(view, edit_pos); } } } diff --git a/4ed_api_implementation.cpp b/4ed_api_implementation.cpp index 08bdf0af..1da048fe 100644 --- a/4ed_api_implementation.cpp +++ b/4ed_api_implementation.cpp @@ -1350,23 +1350,8 @@ view_get_buffer_scroll(Application_Links *app, View_ID view_id){ Buffer_Scroll result = {}; View *view = imp_get_view(models, view_id); if (api_check_view(view)){ - if (!view->ui_mode){ - File_Edit_Positions edit_pos = view_get_edit_pos(view); - result = edit_pos.scroll; - } - } - return(result); -} - -api(custom) function Basic_Scroll -view_get_basic_scroll(Application_Links *app, View_ID view_id){ - Models *models = (Models*)app->cmd_context; - Basic_Scroll result = {}; - View *view = imp_get_view(models, view_id); - if (api_check_view(view)){ - if (view->ui_mode){ - result = view->ui_scroll; - } + File_Edit_Positions edit_pos = view_get_edit_pos(view); + result = edit_pos.scroll; } return(result); } @@ -1409,11 +1394,6 @@ view_get_setting(Application_Links *app, View_ID view_id, View_Setting_ID settin *value_out = !view->hide_file_bar; }break; - case ViewSetting_UICommandMap: - { - *value_out = view->ui_map_id; - }break; - default: { result = false; @@ -1448,11 +1428,6 @@ view_set_setting(Application_Links *app, View_ID view_id, View_Setting_ID settin view->hide_file_bar = (b8)!value; }break; - case ViewSetting_UICommandMap: - { - view->ui_map_id = value; - }break; - default: { result = false; @@ -1523,36 +1498,16 @@ view_set_buffer_scroll(Application_Links *app, View_ID view_id, Buffer_Scroll sc b32 result = false; View *view = imp_get_view(models, view_id); if (api_check_view(view)){ - if (!view->ui_mode){ - scroll.position = view_normalize_buffer_point(models, view, scroll.position); - scroll.target = view_normalize_buffer_point(models, view, scroll.target); - scroll.target.pixel_shift.x = f32_round32(scroll.target.pixel_shift.x); - scroll.target.pixel_shift.y = f32_round32(scroll.target.pixel_shift.y); - scroll.target.pixel_shift.x = clamp_bot(0.f, scroll.target.pixel_shift.x); - Buffer_Layout_Item_List line = view_get_line_layout(models, view, scroll.target.line_number); - scroll.target.pixel_shift.y = clamp(0.f, scroll.target.pixel_shift.y, line.height); - view_set_scroll(models, view, scroll); - view->new_scroll_target = true; - result = true; - } - } - return(result); -} - -api(custom) function b32 -view_set_basic_scroll(Application_Links *app, View_ID view_id, Basic_Scroll scroll) -{ - Models *models = (Models*)app->cmd_context; - b32 result = false; - View *view = imp_get_view(models, view_id); - if (api_check_view(view)){ - if (view->ui_mode){ - scroll.target.x = f32_round32(scroll.target.x); - scroll.target.y = f32_round32(scroll.target.y); - view->ui_scroll = scroll; - view->new_scroll_target = true; - result = true; - } + scroll.position = view_normalize_buffer_point(models, view, scroll.position); + scroll.target = view_normalize_buffer_point(models, view, scroll.target); + scroll.target.pixel_shift.x = f32_round32(scroll.target.pixel_shift.x); + scroll.target.pixel_shift.y = f32_round32(scroll.target.pixel_shift.y); + scroll.target.pixel_shift.x = clamp_bot(0.f, scroll.target.pixel_shift.x); + Buffer_Layout_Item_List line = view_get_line_layout(models, view, scroll.target.line_number); + scroll.target.pixel_shift.y = clamp(0.f, scroll.target.pixel_shift.y, line.height); + view_set_scroll(models, view, scroll); + view->new_scroll_target = true; + result = true; } return(result); } @@ -1593,7 +1548,8 @@ view_set_buffer(Application_Links *app, View_ID view_id, Buffer_ID buffer_id, Se if (file != view->file){ view_set_file(models, view, file); if (!(flags & SetBuffer_KeepOriginalGUI)){ - view_quit_ui(models, view); + //view_quit_ui(models, view); + // TODO(allen): back to base context } } result = true; @@ -1619,67 +1575,36 @@ view_post_fade(Application_Links *app, View_ID view_id, f32 seconds, Range_i64 r } api(custom) function b32 -view_begin_ui_mode(Application_Links *app, View_ID view_id) -{ +view_push_context(Application_Links *app, View_ID view_id, View_Context *ctx){ Models *models = (Models*)app->cmd_context; View *view = imp_get_view(models, view_id); b32 result = false; if (api_check_view(view)){ - if (!view->ui_mode){ - view->ui_mode = true; - result = true; - } - } - return(result); -} - -api(custom) function b32 -view_end_ui_mode(Application_Links *app, View_ID view_id) -{ - Models *models = (Models*)app->cmd_context; - View *view = imp_get_view(models, view_id); - b32 result = false; - if (api_check_view(view) && view->ui_mode){ - view_quit_ui(models, view); - view->ui_mode = false; + view_push_context(models, view, ctx); result = true; } return(result); } api(custom) function b32 -view_is_in_ui_mode(Application_Links *app, View_ID view_id){ +view_pop_context(Application_Links *app, View_ID view_id){ Models *models = (Models*)app->cmd_context; View *view = imp_get_view(models, view_id); b32 result = false; if (api_check_view(view)){ - result = view->ui_mode; - } - return(result); -} - -api(custom) function b32 -view_set_quit_ui_handler(Application_Links *app, View_ID view_id, UI_Quit_Function_Type *quit_function) -{ - Models *models = (Models*)app->cmd_context; - View *view = imp_get_view(models, view_id); - b32 result = false; - if (api_check_view(view)){ - view->ui_quit = quit_function; + view_pop_context(models, view); result = true; } return(result); } -api(custom) function b32 -view_get_quit_ui_handler(Application_Links *app, View_ID view_id, UI_Quit_Function_Type **quit_function_out) -{ +api(custom) function View_Context +view_current_context(Application_Links *app, View_ID view_id){ Models *models = (Models*)app->cmd_context; View *view = imp_get_view(models, view_id); - b32 result = false; + View_Context result = {}; if (api_check_view(view)){ - *quit_function_out = view->ui_quit; - result = true; + result = view_current_context(models, view); } return(result); } diff --git a/4ed_view.cpp b/4ed_view.cpp index b34dd635..f85ab25c 100644 --- a/4ed_view.cpp +++ b/4ed_view.cpp @@ -66,18 +66,14 @@ free_all_queries(Query_Set *set){ internal Command_Map_ID view_get_map(View *view){ - if (view->ui_mode){ - return(view->ui_map_id); - } - else{ - return(view->file->settings.base_map_id); - } + return(view->file->settings.base_map_id); } internal u32 view_get_access_flags(View *view){ u32 result = AccessOpen; - if (view->ui_mode){ + View_Context_Node *node = view->ctx; + if (node != 0 && node->ctx.hides_buffer){ result |= AccessHidden; } result |= file_get_access_flags(view->file); @@ -611,6 +607,51 @@ co_send_core_event(Models *models, View *view, Core_Code code){ //////////////////////////////// +function View_Context_Node* +view__alloc_context_node(Live_Views *views){ + View_Context_Node *node = views->free_nodes; + if (node != 0){ + sll_stack_pop(views->free_nodes); + } + else{ + node = push_array(views->node_arena, View_Context_Node, 1); + } + return(node); +} + +function void +view__free_context_node(Live_Views *views, View_Context_Node *node){ + sll_stack_push(views->free_nodes, node); +} + +function void +view_push_context(Models *models, View *view, View_Context *ctx){ + View_Context_Node *node = view__alloc_context_node(&models->live_set); + sll_stack_push(view->ctx, node); + block_copy_struct(&node->ctx, ctx); +} + +function void +view_pop_context(Models *models, View *view){ + View_Context_Node *node = view->ctx; + if (node != 0){ + sll_stack_pop(view->ctx); + view__free_context_node(&models->live_set, node); + } +} + +function View_Context +view_current_context(Models *models, View *view){ + View_Context ctx = {}; + View_Context_Node *node = view->ctx; + if (node != 0){ + block_copy_struct(&ctx, &node->ctx); + } + return(ctx); +} + +//////////////////////////////// + internal b32 file_is_viewed(Layout *layout, Editing_File *file){ b32 is_viewed = false; @@ -683,16 +724,6 @@ finalize_color(Color_Table color_table, int_color color){ return(color_argb); } -internal void -view_quit_ui(Models *models, View *view){ - Assert(view != 0); - view->ui_mode = false; - if (view->ui_quit != 0){ - view->ui_quit(&models->app_links, view_get_id(&models->live_set, view)); - view->ui_quit = 0; - } -} - //////////////////////////////// internal View* diff --git a/4ed_view.h b/4ed_view.h index 93ea7df8..26c8ee62 100644 --- a/4ed_view.h +++ b/4ed_view.h @@ -56,6 +56,11 @@ struct Query_Set{ Query_Slot *used_slot; }; +struct View_Context_Node{ + View_Context_Node *next; + View_Context ctx; +}; + struct View{ View *next; View *prev; @@ -74,10 +79,7 @@ struct View{ Coroutine *co; Co_Out co_out; - b8 ui_mode; - Command_Map_ID ui_map_id; - Basic_Scroll ui_scroll; - UI_Quit_Function_Type *ui_quit; + View_Context_Node *ctx; b8 hide_scrollbar; b8 hide_file_bar; @@ -87,6 +89,8 @@ struct View{ }; struct Live_Views{ + Arena *node_arena; + View_Context_Node *free_nodes; View *views; View free_sentinel; i32 count; diff --git a/custom/4coder_base_commands.cpp b/custom/4coder_base_commands.cpp index cc358c21..176b4d1e 100644 --- a/custom/4coder_base_commands.cpp +++ b/custom/4coder_base_commands.cpp @@ -226,50 +226,42 @@ CUSTOM_COMMAND_SIG(click_set_cursor_and_mark) CUSTOM_DOC("Sets the cursor position and mark to the mouse position.") { View_ID view = get_active_view(app, AccessProtected); - if (!view_is_in_ui_mode(app, view)){ - Mouse_State mouse = get_mouse_state(app); - i64 pos = view_pos_from_xy(app, view, V2(mouse.p)); - view_set_cursor_and_preferred_x(app, view, seek_pos(pos)); - view_set_mark(app, view, seek_pos(pos)); - } + Mouse_State mouse = get_mouse_state(app); + i64 pos = view_pos_from_xy(app, view, V2(mouse.p)); + view_set_cursor_and_preferred_x(app, view, seek_pos(pos)); + view_set_mark(app, view, seek_pos(pos)); } CUSTOM_COMMAND_SIG(click_set_cursor) CUSTOM_DOC("Sets the cursor position to the mouse position.") { View_ID view = get_active_view(app, AccessProtected); - if (!view_is_in_ui_mode(app, view)){ - Mouse_State mouse = get_mouse_state(app); - i64 pos = view_pos_from_xy(app, view, V2(mouse.p)); - view_set_cursor_and_preferred_x(app, view, seek_pos(pos)); - no_mark_snap_to_cursor(app, view); - } + Mouse_State mouse = get_mouse_state(app); + i64 pos = view_pos_from_xy(app, view, V2(mouse.p)); + view_set_cursor_and_preferred_x(app, view, seek_pos(pos)); + no_mark_snap_to_cursor(app, view); } CUSTOM_COMMAND_SIG(click_set_cursor_if_lbutton) CUSTOM_DOC("If the mouse left button is pressed, sets the cursor position to the mouse position.") { View_ID view = get_active_view(app, AccessProtected); - if (!view_is_in_ui_mode(app, view)){ - Mouse_State mouse = get_mouse_state(app); - if (mouse.l){ - i64 pos = view_pos_from_xy(app, view, V2(mouse.p)); - view_set_cursor_and_preferred_x(app, view, seek_pos(pos)); - } - no_mark_snap_to_cursor(app, view); + Mouse_State mouse = get_mouse_state(app); + if (mouse.l){ + i64 pos = view_pos_from_xy(app, view, V2(mouse.p)); + view_set_cursor_and_preferred_x(app, view, seek_pos(pos)); } + no_mark_snap_to_cursor(app, view); } CUSTOM_COMMAND_SIG(click_set_mark) CUSTOM_DOC("Sets the mark position to the mouse position.") { View_ID view = get_active_view(app, AccessProtected); - if (!view_is_in_ui_mode(app, view)){ - Mouse_State mouse = get_mouse_state(app); - i64 pos = view_pos_from_xy(app, view, V2(mouse.p)); - view_set_mark(app, view, seek_pos(pos)); - no_mark_snap_to_cursor(app, view); - } + Mouse_State mouse = get_mouse_state(app); + i64 pos = view_pos_from_xy(app, view, V2(mouse.p)); + view_set_mark(app, view, seek_pos(pos)); + no_mark_snap_to_cursor(app, view); } CUSTOM_COMMAND_SIG(mouse_wheel_scroll) @@ -278,16 +270,9 @@ CUSTOM_DOC("Reads the scroll wheel value from the mouse state and scrolls accord View_ID view = get_active_view(app, AccessProtected); Mouse_State mouse = get_mouse_state(app); if (mouse.wheel != 0){ - if (view_is_in_ui_mode(app, view)){ - Basic_Scroll scroll = view_get_basic_scroll(app, view); - scroll.target.y += mouse.wheel; - view_set_basic_scroll(app, view, scroll); - } - else{ - Buffer_Scroll scroll = view_get_buffer_scroll(app, view); - scroll.target = view_move_buffer_point(app, view, scroll.target, V2f32(0.f, (f32)mouse.wheel)); - view_set_buffer_scroll(app, view, scroll); - } + Buffer_Scroll scroll = view_get_buffer_scroll(app, view); + scroll.target = view_move_buffer_point(app, view, scroll.target, V2f32(0.f, (f32)mouse.wheel)); + view_set_buffer_scroll(app, view, scroll); } } @@ -1578,13 +1563,11 @@ CUSTOM_DOC("Set the other non-active panel to view the buffer that the active pa CUSTOM_COMMAND_SIG(swap_buffers_between_panels) CUSTOM_DOC("Set the other non-active panel to view the buffer that the active panel views, and switch to that panel.") { - View_ID view1 = get_active_view(app, AccessAll); + View_ID view1 = get_active_view(app, AccessProtected); change_active_panel(app); - View_ID view2 = get_active_view(app, AccessAll); + View_ID view2 = get_active_view(app, AccessProtected); - if (view1 != view2 && - !view_is_in_ui_mode(app, view1) && - !view_is_in_ui_mode(app, view2)){ + if (view1 != view2){ Buffer_ID buffer1 = view_get_buffer(app, view1, AccessAll); Buffer_ID buffer2 = view_get_buffer(app, view2, AccessAll); if (buffer1 != buffer2){ diff --git a/custom/4coder_combined_write_commands.cpp b/custom/4coder_combined_write_commands.cpp index ae260f07..31cd1e9c 100644 --- a/custom/4coder_combined_write_commands.cpp +++ b/custom/4coder_combined_write_commands.cpp @@ -217,7 +217,6 @@ activate_snippet(Application_Links *app, Heap *heap, View_ID view, struct Lister static void snippet_lister__parameterized(Application_Links *app, Snippet_Array snippet_array){ View_ID view = get_active_view(app, AccessAll); - view_end_ui_mode(app, view); Scratch_Block scratch(app, Scratch_Share); i32 option_count = snippet_array.count; Lister_Option *options = push_array(scratch, Lister_Option, option_count); diff --git a/custom/4coder_default_framework.cpp b/custom/4coder_default_framework.cpp index eacb1435..3edb3020 100644 --- a/custom/4coder_default_framework.cpp +++ b/custom/4coder_default_framework.cpp @@ -248,7 +248,9 @@ create_or_switch_to_buffer_and_clear_by_name(Application_Links *app, String_Cons View_ID view_with_buffer_already_open = get_first_view_with_buffer(app, search_buffer); if (view_with_buffer_already_open != 0){ target_view = view_with_buffer_already_open; - view_end_ui_mode(app, target_view); + // TODO(allen): there needs to be something like + // view_exit_to_base_context(app, target_view); + //view_end_ui_mode(app, target_view); } else{ view_set_buffer(app, target_view, search_buffer, 0); diff --git a/custom/4coder_default_hooks.cpp b/custom/4coder_default_hooks.cpp index aa9b04c5..378244df 100644 --- a/custom/4coder_default_hooks.cpp +++ b/custom/4coder_default_hooks.cpp @@ -26,20 +26,14 @@ CUSTOM_DOC("Input consumption loop for base view behavior") View_ID view = get_active_view(app, AccessAll); - Command_Map_ID map_id = 0; - if (view_is_in_ui_mode(app, view)){ - view_get_setting(app, view, ViewSetting_UICommandMap, &map_id); - } - else{ - Buffer_ID buffer = view_get_buffer(app, view, AccessAll); - Managed_Scope buffer_scope = buffer_get_managed_scope(app, buffer); - Command_Map_ID *map_id_ptr = - scope_attachment(app, buffer_scope, buffer_map_id, Command_Map_ID); - if (*map_id_ptr == 0){ - *map_id_ptr = mapid_file; - } - map_id = *map_id_ptr; + Buffer_ID buffer = view_get_buffer(app, view, AccessAll); + Managed_Scope buffer_scope = buffer_get_managed_scope(app, buffer); + Command_Map_ID *map_id_ptr = + scope_attachment(app, buffer_scope, buffer_map_id, Command_Map_ID); + if (*map_id_ptr == 0){ + *map_id_ptr = mapid_file; } + Command_Map_ID map_id = *map_id_ptr; Command_Binding binding = map_get_binding_recursive(&framework_mapping, map_id, &input.event); @@ -713,62 +707,12 @@ default_buffer_render_caller(Application_Links *app, Frame_Info frame_info, View text_layout_free(app, text_layout_id); } -internal void -default_ui_render_caller(Application_Links *app, View_ID view_id, Rect_f32 rect, Face_ID face_id){ - UI_Data *ui_data = 0; - Arena *ui_arena = 0; - if (view_get_ui_data(app, view_id, ViewGetUIFlag_KeepDataAsIs, &ui_data, &ui_arena)){ - Basic_Scroll scroll = view_get_basic_scroll(app, view_id); - - for (UI_Item *item = ui_data->list.first; - item != 0; - item = item->next){ - Rect_f32 item_rect = Rf32(item->rect_outer); - item_rect.p0 += rect.p0; - item_rect.p1 += rect.p0; - - switch (item->coordinates){ - case UICoordinates_ViewSpace: - { - item_rect.p0 -= scroll.position; - item_rect.p1 -= scroll.position; - }break; - case UICoordinates_PanelSpace: - {}break; - } - - if (rect_overlap(item_rect, rect)){ - Rect_f32 inner = rect_inner(item_rect, (f32)item->inner_margin); - - Face_Metrics metrics = get_face_metrics(app, face_id); - f32 line_height = metrics.line_height; - f32 info_height = (f32)item->line_count*line_height; - - draw_rectangle(app, inner, 0.f, Stag_Back); - Vec2_f32 p = V2f32(inner.x0 + 3.f, f32_round32((inner.y0 + inner.y1 - info_height)*0.5f)); - for (i32 i = 0; i < item->line_count; i += 1){ - draw_fancy_string(app, face_id, item->lines[i].first, p, Stag_Default, 0, 0, V2(1.f, 0)); - p.y += line_height; - } - if (item->inner_margin > 0){ - draw_margin(app, item_rect, inner, get_margin_color(item->activation_level)); - } - } - } - } -} -internal void -default_ui_render_caller(Application_Links *app, View_ID view, Rect_f32 rect){ - Buffer_ID buffer = view_get_buffer(app, view, AccessAll); - Face_ID face_id = get_face_id(app, buffer); - default_ui_render_caller(app, view, rect, face_id); -} - internal void default_render_view(Application_Links *app, Frame_Info frame_info, View_ID view, b32 is_active){ Rect_f32 view_rect = view_get_screen_rect(app, view); Rect_f32 inner = rect_inner(view_rect, 3); - draw_rectangle(app, view_rect, 0.f, get_margin_color(is_active?UIActivation_Active:UIActivation_None)); + draw_rectangle(app, view_rect, 0.f, + get_margin_color(is_active?UIHighlight_Active:UIHighlight_None)); draw_rectangle(app, inner, 0.f, Stag_Back); Rect_f32 prev_clip = draw_set_clip(app, inner); @@ -776,12 +720,7 @@ default_render_view(Application_Links *app, Frame_Info frame_info, View_ID view, View_Render_Hook **hook_ptr = scope_attachment(app, scope, view_render_hook, View_Render_Hook*); if (*hook_ptr == 0){ - if (view_is_in_ui_mode(app, view)){ - default_ui_render_caller(app, view, inner); - } - else{ - default_buffer_render_caller(app, frame_info, view, inner); - } + default_buffer_render_caller(app, frame_info, view, inner); } else{ View_Render_Hook *hook = *hook_ptr; diff --git a/custom/4coder_default_include.cpp b/custom/4coder_default_include.cpp index 9b94b29a..15efbaef 100644 --- a/custom/4coder_default_include.cpp +++ b/custom/4coder_default_include.cpp @@ -31,7 +31,7 @@ #include "4coder_helper.h" #include "4coder_insertion.h" #include "4coder_fancy.h" -#include "4coder_ui_helper.h" +#include "4coder_lister_base.h" #include "4coder_default_framework.h" #include "4coder_config.h" #include "4coder_auto_indent.h" @@ -67,7 +67,7 @@ #include "4coder_default_framework_variables.cpp" #include "4coder_helper.cpp" #include "4coder_fancy.cpp" -#include "4coder_ui_helper.cpp" +#include "4coder_lister_base.cpp" #include "4coder_font_helper.cpp" #include "4coder_config.cpp" #include "4coder_default_framework.cpp" diff --git a/custom/4coder_helper.cpp b/custom/4coder_helper.cpp index 8bafe2a6..07136f49 100644 --- a/custom/4coder_helper.cpp +++ b/custom/4coder_helper.cpp @@ -166,14 +166,8 @@ view_move_buffer_point(Application_Links *app, View_ID view, Buffer_Point buffer internal void view_zero_scroll(Application_Links *app, View_ID view){ - if (view_is_in_ui_mode(app, view)){ - Basic_Scroll scroll = {}; - view_set_basic_scroll(app, view, scroll); - } - else{ - Buffer_Scroll scroll = {}; - view_set_buffer_scroll(app, view, scroll); - } + Buffer_Scroll scroll = {}; + view_set_buffer_scroll(app, view, scroll); } internal void @@ -2205,15 +2199,15 @@ get_margin_color(i32 level){ int_color margin = 0; switch (level){ default: - case UIActivation_None: + case UIHighlight_None: { margin = Stag_List_Item; }break; - case UIActivation_Hover: + case UIHighlight_Hover: { margin = Stag_List_Item_Hover; }break; - case UIActivation_Active: + case UIHighlight_Active: { margin = Stag_List_Item_Active; }break; @@ -2223,14 +2217,6 @@ get_margin_color(i32 level){ //////////////////////////////// -UI_QUIT_FUNCTION(ui_quit_clear_render_hook){ - Managed_Scope scope = view_get_managed_scope(app, view); - View_Render_Hook **hook = scope_attachment(app, scope, view_render_hook, View_Render_Hook*); - *hook = 0; -} - -//////////////////////////////// - // TODO(allen): REWRITE THIS EXACTLY HOW YOU WANT IT --- start --- internal Child_Process_Set_Target_Flags diff --git a/custom/4coder_jump_lister.cpp b/custom/4coder_jump_lister.cpp index a4247e37..09bef4e1 100644 --- a/custom/4coder_jump_lister.cpp +++ b/custom/4coder_jump_lister.cpp @@ -68,7 +68,6 @@ open_jump_lister(Application_Links *app, Heap *heap, View_ID ui_view, Buffer_ID Marker_List *list = get_or_make_list_for_buffer(app, heap, list_buffer_id); if (list != 0){ i32 estimated_string_space_size = 0; - view_end_ui_mode(app, ui_view); Scratch_Block scratch(app); i32 option_count = list->jump_count; Lister_Option *options = push_array(scratch, Lister_Option, option_count); diff --git a/custom/4coder_lister_base.cpp b/custom/4coder_lister_base.cpp new file mode 100644 index 00000000..69c1f7b3 --- /dev/null +++ b/custom/4coder_lister_base.cpp @@ -0,0 +1,666 @@ +/* + * Helpers for ui data structures. + */ + +// TOP + +static Vec2_f32 +panel_space_from_screen_space(Vec2_f32 p, Vec2_f32 file_region_p0){ + return(p - file_region_p0); +} + +static Vec2_f32 +get_mouse_position_in_panel_space(Mouse_State mouse, Vec2_f32 file_region_p0){ + return(panel_space_from_screen_space(V2f32(mouse.p), file_region_p0)); +} + +static Vec2_f32 +get_mouse_position_in_panel_space(Application_Links *app, Vec2_f32 file_region_p0){ + return(get_mouse_position_in_panel_space(get_mouse_state(app), file_region_p0)); +} + +//////////////////////////////// + +#if 0 +internal void +default_ui_render_caller(Application_Links *app, View_ID view_id, Rect_f32 rect, Face_ID face_id){ + UI_Data *ui_data = 0; + Arena *ui_arena = 0; + if (view_get_ui_data(app, view_id, ViewGetUIFlag_KeepDataAsIs, &ui_data, &ui_arena)){ + Basic_Scroll scroll = view_get_basic_scroll(app, view_id); + + for (UI_Item *item = ui_data->list.first; + item != 0; + item = item->next){ + Rect_f32 item_rect = Rf32(item->rect_outer); + item_rect.p0 += rect.p0; + item_rect.p1 += rect.p0; + + switch (item->coordinates){ + case UICoordinates_ViewSpace: + { + item_rect.p0 -= scroll.position; + item_rect.p1 -= scroll.position; + }break; + case UICoordinates_PanelSpace: + {}break; + } + + if (rect_overlap(item_rect, rect)){ + Rect_f32 inner = rect_inner(item_rect, (f32)item->inner_margin); + + Face_Metrics metrics = get_face_metrics(app, face_id); + f32 line_height = metrics.line_height; + f32 info_height = (f32)item->line_count*line_height; + + draw_rectangle(app, inner, 0.f, Stag_Back); + Vec2_f32 p = V2f32(inner.x0 + 3.f, f32_round32((inner.y0 + inner.y1 - info_height)*0.5f)); + for (i32 i = 0; i < item->line_count; i += 1){ + draw_fancy_string(app, face_id, item->lines[i].first, p, Stag_Default, 0, 0, V2(1.f, 0)); + p.y += line_height; + } + if (item->inner_margin > 0){ + draw_margin(app, item_rect, inner, get_margin_color(item->activation_level)); + } + } + } + } +} +internal void +default_ui_render_caller(Application_Links *app, View_ID view, Rect_f32 rect){ + Buffer_ID buffer = view_get_buffer(app, view, AccessAll); + Face_ID face_id = get_face_id(app, buffer); + default_ui_render_caller(app, view, rect, face_id); +} +#endif + +//////////////////////////////// + +Lister_State global_lister_state_[16] = {}; +Lister_State *global_lister_state = global_lister_state_ - 1; + +static Lister_State* +view_get_lister_state(View_ID view){ + return(&global_lister_state[view]); +} + +function void +init_lister_state(Application_Links *app, Lister_State *state, Heap *heap){ + state->initialized = true; + state->set_view_vertical_focus_to_item = false; + state->highlighted_node = 0; + state->hot_user_data = 0; + state->item_index = 0; + state->filter_restore_point_is_set = false; + block_zero_struct(&state->scroll); +} + +function f32 +lister_get_text_field_height(f32 line_height){ + return(line_height); +} + +function f32 +lister_get_block_height(f32 line_height){ + return(line_height*2); +} + +function Lister_Top_Level_Layout +lister_get_top_level_layout(Rect_f32 rect, f32 line_height){ + f32 text_field_height = lister_get_text_field_height(line_height); + Lister_Top_Level_Layout layout = {}; + layout.text_field_rect = Rf32(rect.x0, rect.y0, + rect.x1, clamp_top(rect.y0 + text_field_height, rect.y1)); + layout.list_rect = Rf32(rect.x0, layout.text_field_rect.y0, rect.x1, rect.y1); + return(layout); +} + +function void* +lister_user_data_at_p(Application_Links *app, View_ID view, Lister_State *state, Vec2_f32 p){ + Rect_f32 region = view_get_buffer_region(app, view); + p -= region.p0; + p += state->scroll.position; + + Face_ID face_id = get_face_id(app, 0); + Face_Metrics metrics = get_face_metrics(app, face_id); + f32 line_height = metrics.line_height; + f32 block_height = lister_get_block_height(line_height); + + Lister_Top_Level_Layout layout = lister_get_top_level_layout(region, line_height); + + void *result = 0; + if (rect_contains_point(layout.list_rect, p)){ + i32 index = (i32)((p.y - layout.list_rect.y0)/block_height); + if (0 < index && index < state->filtered.count){ + Lister_Node *node = state->filtered.node_ptrs[index]; + result = node->user_data; + } + } + + return(result); +} + +function Lister_Filtered +lister_get_filtered(Arena *arena, Lister_State *state){ + i32 node_count = state->lister.data.options.count; + + Lister_Filtered filtered = {}; + filtered.exact_matches.node_ptrs = push_array(arena, Lister_Node*, 1); + filtered.before_extension_matches.node_ptrs = push_array(arena, Lister_Node*, node_count); + filtered.substring_matches.node_ptrs = push_array(arena, Lister_Node*, node_count); + + Temp_Memory_Block temp(arena); + + String_Const_u8 key = state->lister.data.key_string.string; + key = push_string_copy(arena, key); + string_mod_replace_character(key, '_', '*'); + string_mod_replace_character(key, ' ', '*'); + + List_String_Const_u8 absolutes = {}; + string_list_push(arena, &absolutes, string_u8_litexpr("")); + List_String_Const_u8 splits = string_split(arena, key, (u8*)"*", 1); + b32 has_wildcard = (splits.node_count > 1); + string_list_push(&absolutes, &splits); + string_list_push(arena, &absolutes, string_u8_litexpr("")); + + for (Lister_Node *node = state->lister.data.options.first; + node != 0; + node = node->next){ + String_Const_u8 node_string = node->string; + if (key.size == 0 || string_wildcard_match_insensitive(absolutes, node_string)){ + if (string_match_insensitive(node_string, key) && filtered.exact_matches.count == 0){ + filtered.exact_matches.node_ptrs[filtered.exact_matches.count++] = node; + } + else if (!has_wildcard && + string_match_insensitive(string_prefix(node_string, key.size), key) && + node->string.size > key.size && + node->string.str[key.size] == '.'){ + filtered.before_extension_matches.node_ptrs[filtered.before_extension_matches.count++] = node; + } + else{ + filtered.substring_matches.node_ptrs[filtered.substring_matches.count++] = node; + } + } + } + + return(filtered); +} + +static void +lister_update_filtered_list(Application_Links *app, View_ID view, Lister_State *state){ + Scratch_Block scratch(app, Scratch_Share); + + Lister_Filtered filtered = lister_get_filtered(scratch, state); + + Lister_Node_Ptr_Array node_ptr_arrays[] = { + filtered.exact_matches, + filtered.before_extension_matches, + filtered.substring_matches, + }; + + Arena *arena = state->lister.arena; + if (state->filter_restore_point_is_set){ + end_temp(state->filter_restore_point); + } + else{ + state->filter_restore_point = begin_temp(arena); + state->filter_restore_point_is_set = true; + } + + i32 total_count = 0; + for (i32 array_index = 0; array_index < ArrayCount(node_ptr_arrays); array_index += 1){ + Lister_Node_Ptr_Array node_ptr_array = node_ptr_arrays[array_index]; + total_count += node_ptr_array.count; + } + + Lister_Node **node_ptrs = push_array(arena, Lister_Node*, total_count); + state->filtered.node_ptrs = node_ptrs; + state->filtered.count = total_count; + + state->raw_item_index = -1; + state->highlighted_node = 0; + + i32 counter = 0; + for (i32 array_index = 0; array_index < ArrayCount(node_ptr_arrays); array_index += 1){ + Lister_Node_Ptr_Array node_ptr_array = node_ptr_arrays[array_index]; + for (i32 node_index = 0; node_index < node_ptr_array.count; node_index += 1){ + Lister_Node *node = node_ptr_array.node_ptrs[node_index]; + node_ptrs[counter] = node; + if (state->item_index == counter){ + state->highlighted_node = node; + state->raw_item_index = node->raw_index; + } + counter += 1; + } + } +} + +function void +lister_render(Application_Links *app, View_ID view, Frame_Info frame_info, Rect_f32 inner){ + Scratch_Block scratch(app); + + Lister_State *state = view_get_lister_state(view); + + Basic_Scroll scroll = state->scroll; + Rect_f32 region = view_get_buffer_region(app, view); + Vec2_f32 view_m = get_mouse_position_in_panel_space(app, region.p0); + view_m += scroll.position; + + Face_ID face_id = get_face_id(app, 0); + Face_Metrics metrics = get_face_metrics(app, face_id); + f32 line_height = metrics.line_height; + f32 block_height = lister_get_block_height(line_height); + f32 text_field_height = lister_get_text_field_height(line_height); + + Range_f32 x = rect_range_x(region); + f32 y_pos = region.y0; + + { + Fancy_String_List text_field = {}; + push_fancy_string(scratch, &text_field, fancy_id(Stag_Pop1), + state->lister.data.query.string); + push_fancy_stringf(scratch, &text_field, fancy_id(Stag_Pop1), " "); + push_fancy_string(scratch, &text_field, fancy_id(Stag_Default), + state->lister.data.text_field.string); + draw_fancy_string(app, face_id, text_field.first, V2f32(x.min, y_pos), + Stag_Default, Stag_Back, 0, V2f32(1.f, 0.f)); + y_pos += text_field_height; + } + + i32 count = state->filtered.count; + for (i32 i = 0; i < count; i += 1){ + Lister_Node *node = state->filtered.node_ptrs[i]; + (void)node; + + Range_f32 y = If32(y_pos, y_pos + block_height); + y_pos = y.max; + + Rect_f32 item_rect = Rf32(x, y); + Rect_f32 item_inner = rect_inner(item_rect, 3.f); + + UI_Highlight_Level highlight = UIHighlight_None; + draw_rectangle(app, item_rect, 3.f, get_margin_color(highlight)); + draw_rectangle(app, item_inner, 3.f, Stag_Back); + + + } + +#if 0 + i32 item_index_counter = 0; + for (i32 array_index = 0; array_index < ArrayCount(node_ptr_arrays); array_index += 1){ + Lister_Node_Ptr_Array node_ptr_array = node_ptr_arrays[array_index]; + for (i32 node_index = 0; node_index < node_ptr_array.count; node_index += 1){ + Lister_Node *node = node_ptr_array.node_ptrs[node_index]; + + Rect_f32 item_rect = Rf32(x0, y_pos, x1, y_pos + block_height); + y_pos = item_rect.y1; + + UI_Item item = {}; + item.activation_level = UIActivation_None; + item.coordinates = UICoordinates_ViewSpace; + item.rect_outer = Ri32(item_rect); + item.inner_margin = 3; + + if (!is_theme_list){ + Fancy_String_List list = {}; + push_fancy_string (ui_arena, &list, fancy_id(Stag_Default), node->string); + push_fancy_stringf(ui_arena, &list, fancy_id(Stag_Default), " "); + push_fancy_string (ui_arena, &list, fancy_id(Stag_Pop2 ), node->status); + item.lines[0] = list; + item.line_count = 1; + } + else{ + //i32 style_index = node->index; + + String_Const_u8 name = string_u8_litexpr("name"); + item.lines[0] = fancy_string_list_single(push_fancy_string(ui_arena, fancy_id(Stag_Default), name)); + + Fancy_String_List list = {}; + push_fancy_stringf(ui_arena, &list, fancy_id(Stag_Keyword ), "if "); + push_fancy_stringf(ui_arena, &list, fancy_id(Stag_Default ), "(x < "); + push_fancy_stringf(ui_arena, &list, fancy_id(Stag_Int_Constant), "0"); + push_fancy_stringf(ui_arena, &list, fancy_id(Stag_Default ), ") { x = "); + push_fancy_stringf(ui_arena, &list, fancy_id(Stag_Int_Constant), "0"); + push_fancy_stringf(ui_arena, &list, fancy_id(Stag_Default ), "; } "); + push_fancy_stringf(ui_arena, &list, fancy_id(Stag_Comment ), "// comment"); + item.lines[1] = list; + + item.line_count = 2; + } + + item.user_data = node->user_data; + + UI_Item *item_ptr = ui_list_add_item(ui_arena, &ui_data->list, item); + if (rect_contains_point(item_rect, view_m)){ + hovered_item = item_ptr; + } + if (state->item_index == item_index_counter){ + highlighted_item = item_ptr; + state->raw_item_index = node->raw_index; + } + item_index_counter += 1; + if (node->user_data == state->hot_user_data && hot_item != 0){ + hot_item = item_ptr; + } + } + } + state->item_count_after_filter = item_index_counter; + + if (hovered_item != 0){ + hovered_item->activation_level = UIActivation_Hover; + } + if (hot_item != 0){ + if (hot_item == hovered_item){ + hot_item->activation_level = UIActivation_Active; + } + else{ + hot_item->activation_level = UIActivation_Hover; + } + } + if (highlighted_item != 0){ + highlighted_item->activation_level = UIActivation_Active; + } + + if (state->set_view_vertical_focus_to_item){ + if (highlighted_item != 0){ + view_set_vertical_focus_basic(app, view, + (f32)highlighted_item->rect_outer.y0, + (f32)highlighted_item->rect_outer.y1); + } + state->set_view_vertical_focus_to_item = false; + } + + { + // TODO(allen): switch to float + Rect_i32 item_rect = {}; + item_rect.x0 = (i32)x0; + item_rect.y0 = 0; + item_rect.x1 = (i32)x1; + item_rect.y1 = item_rect.y0 + (i32)text_field_height; + y_pos = (f32)item_rect.y1; + + UI_Item item = {}; + item.activation_level = UIActivation_Active; + item.coordinates = UICoordinates_PanelSpace; + item.rect_outer = item_rect; + item.inner_margin = 0; + { + Fancy_String_List list = {}; + push_fancy_string (ui_arena, &list, fancy_id(Stag_Pop1 ), state->lister.data.query.string); + push_fancy_stringf(ui_arena, &list, fancy_id(Stag_Pop1 ), " "); + push_fancy_string (ui_arena, &list, fancy_id(Stag_Default), state->lister.data.text_field.string); + item.lines[0] = list; + item.line_count = 1; + } + item.user_data = 0; + + + ui_list_add_item(ui_arena, &ui_data->list, item); + } + + ui_data_compute_bounding_boxes(ui_data); +#endif + +} + +static Lister_Prealloced_String +lister_prealloced(String_Const_u8 string){ + Lister_Prealloced_String result = {}; + result.string = string; + return(result); +} + +static void +lister_first_init(Application_Links *app, Lister *lister, void *user_data, i32 user_data_size){ + if (lister->arena == 0) { + lister->arena = reserve_arena(app, KB(16)); + } + else{ + linalloc_clear(lister->arena); + } + block_zero_struct(&lister->data); + lister->data.query = Su8(lister->data.query_space, 0, sizeof(lister->data.query_space)); + lister->data.text_field = Su8(lister->data.text_field_space, 0, sizeof(lister->data.text_field_space)); + lister->data.key_string = Su8(lister->data.key_string_space, 0, sizeof(lister->data.key_string_space)); + lister->data.user_data = push_array(lister->arena, char, user_data_size); + lister->data.user_data_size = user_data_size; + if (user_data != 0){ + block_copy(lister->data.user_data, user_data, user_data_size); + } +} + +static void +lister_begin_new_item_set(Application_Links *app, Lister *lister){ + linalloc_clear(lister->arena); + block_zero_struct(&lister->data.options); +} + +static void* +lister_add_item(Lister *lister, Lister_Prealloced_String string, Lister_Prealloced_String status, + void *user_data, umem extra_space){ + void *base_memory = push_array(lister->arena, u8, sizeof(Lister_Node) + extra_space); + Lister_Node *node = (Lister_Node*)base_memory; + node->string = string.string; + node->status = status.string; + node->user_data = user_data; + node->raw_index = lister->data.options.count; + zdll_push_back(lister->data.options.first, lister->data.options.last, node); + lister->data.options.count += 1; + void *result = (node + 1); + return(result); +} + +static void* +lister_add_item(Lister *lister, Lister_Prealloced_String string, String_Const_u8 status, + void *user_data, umem extra_space){ + return(lister_add_item(lister, string, lister_prealloced(push_string_copy(lister->arena, status)), + user_data, extra_space)); +} + +static void* +lister_add_item(Lister *lister, String_Const_u8 string, Lister_Prealloced_String status, + void *user_data, umem extra_space){ + return(lister_add_item(lister, lister_prealloced(push_string_copy(lister->arena, string)), status, + user_data, extra_space)); +} + +static void* +lister_add_item(Lister *lister, String_Const_u8 string, String_Const_u8 status, void *user_data, umem extra_space){ + return(lister_add_item(lister, + lister_prealloced(push_string_copy(lister->arena, string)), + lister_prealloced(push_string_copy(lister->arena, status)), + user_data, extra_space)); +} + +static void* +lister_add_theme_item(Lister *lister, + Lister_Prealloced_String string, i32 index, + void *user_data, i32 extra_space){ + Lister_Node *node = push_array(lister->arena, Lister_Node, 1); + node->string = string.string; + node->index = index; + node->user_data = user_data; + node->raw_index = lister->data.options.count; + zdll_push_back(lister->data.options.first, lister->data.options.last, node); + lister->data.options.count += 1; + void *result = push_array(lister->arena, char, extra_space); + push_align(lister->arena, 8); + return(result); +} + +static void* +lister_add_theme_item(Lister *lister, String_Const_u8 string, i32 index, + void *user_data, i32 extra_space){ + return(lister_add_theme_item(lister, lister_prealloced(push_string_copy(lister->arena, string)), index, + user_data, extra_space)); +} + +static void* +lister_get_user_data(Lister_Data *lister_data, i32 index){ + void *result = 0; + if (0 <= index && index < lister_data->options.count){ + i32 counter = 0; + for (Lister_Node *node = lister_data->options.first; + node != 0; + node = node->next, counter += 1){ + if (counter == index){ + result = node->user_data; + break; + } + } + } + return(result); +} + +static void +lister_call_refresh_handler(Application_Links *app, Lister *lister){ + if (lister->data.handlers.refresh != 0){ + lister->data.handlers.refresh(app, lister); + } +} + +static void +lister_default(Application_Links *app, Heap *heap, View_ID view, Lister_State *state, Lister_Activation_Code code){ + switch (code){ + case ListerActivation_Finished: + { + + }break; + + case ListerActivation_Continue: + {}break; + + case ListerActivation_ContinueAndRefresh: + { + state->item_index = 0; + lister_call_refresh_handler(app, &state->lister); + lister_update_filtered_list(app, view, state); + }break; + } +} + +static Lister_Activation_Code +lister_call_activate_handler(Application_Links *app, Heap *heap, View_ID view, Lister_State *state, void *user_data, b32 activated_by_mouse){ + Lister_Activation_Code result = ListerActivation_Finished; + Lister_Data *lister = &state->lister.data; + if (lister->handlers.activate != 0){ + result = lister->handlers.activate(app, heap, view, state, lister->text_field.string, user_data, activated_by_mouse); + } + else{ + lister_default(app, heap, view, state, ListerActivation_Finished); + } + return(result); +} + +static void +lister_set_string(String_Const_u8 string, String_u8 *target){ + target->size = 0; + string_append(target, string); +} +static void +lister_append_string(String_Const_u8 string, String_u8 *target){ + string_append(target, string); +} + +static void +lister_set_query(Lister_Data *lister, String_Const_u8 string){ + lister_set_string(string, &lister->query); +} +static void +lister_set_query(Lister_Data *lister, char *string){ + lister_set_string(SCu8(string), &lister->query); +} +static void +lister_set_text_field(Lister_Data *lister, String_Const_u8 string){ + lister_set_string(string, &lister->text_field); +} +static void +lister_set_text_field(Lister_Data *lister, char *string){ + lister_set_string(SCu8(string), &lister->text_field); +} +static void +lister_set_key(Lister_Data *lister, String_Const_u8 string){ + lister_set_string(string, &lister->key_string); +} +static void +lister_set_key(Lister_Data *lister, char *string){ + lister_set_string(SCu8(string), &lister->key_string); +} + +static void +lister_set_query(Lister *lister, String_Const_u8 string){ + lister_set_query(&lister->data, string); +} +static void +lister_set_query(Lister *lister, char *string){ + lister_set_query(&lister->data, string); +} +static void +lister_set_text_field(Lister *lister, String_Const_u8 string){ + lister_set_text_field(&lister->data, string); +} +static void +lister_set_text_field(Lister *lister, char *string){ + lister_set_text_field(&lister->data, string); +} +static void +lister_set_key(Lister *lister, String_Const_u8 string){ + lister_set_key(&lister->data, string); +} +static void +lister_set_key(Lister *lister, char *string){ + lister_set_key(&lister->data, string); +} + +static void +lister_append_query(Lister_Data *lister, String_Const_u8 string){ + lister_append_string(string, &lister->query); +} +static void +lister_append_query(Lister_Data *lister, char *string){ + lister_append_string(SCu8(string), &lister->query); +} +static void +lister_append_text_field(Lister_Data *lister, String_Const_u8 string){ + lister_append_string(string, &lister->text_field); +} +static void +lister_append_text_field(Lister_Data *lister, char *string){ + lister_append_string(SCu8(string), &lister->text_field); +} +static void +lister_append_key(Lister_Data *lister, String_Const_u8 string){ + lister_append_string(string, &lister->key_string); +} +static void +lister_append_key(Lister_Data *lister, char *string){ + lister_append_string(SCu8(string), &lister->key_string); +} + +static void +lister_append_query(Lister *lister, String_Const_u8 string){ + lister_append_query(&lister->data, string); +} +static void +lister_append_query(Lister *lister, char *string){ + lister_append_query(&lister->data, string); +} +static void +lister_append_text_field(Lister *lister, String_Const_u8 string){ + lister_append_text_field(&lister->data, string); +} +static void +lister_append_text_field(Lister *lister, char *string){ + lister_append_text_field(&lister->data, string); +} +static void +lister_append_key(Lister *lister, String_Const_u8 string){ + lister_append_key(&lister->data, string); +} +static void +lister_append_key(Lister *lister, char *string){ + lister_append_key(&lister->data, string); +} + +// BOTTOM + diff --git a/custom/4coder_ui_helper.h b/custom/4coder_lister_base.h similarity index 71% rename from custom/4coder_ui_helper.h rename to custom/4coder_lister_base.h index 2d591ab1..cdc6269a 100644 --- a/custom/4coder_ui_helper.h +++ b/custom/4coder_lister_base.h @@ -7,51 +7,6 @@ #if !defined(FCODER_UI_HELPER_H) #define FCODER_UI_HELPER_H -typedef i8 UI_Item_Type; -enum UI_Activation_Level{ - UIActivation_None = 0, - UIActivation_Hover = 1, - UIActivation_Active = 2, -}; - -typedef u8 UI_Coordinate_System; -enum{ - UICoordinates_ViewSpace = 0, - UICoordinates_PanelSpace = 1, - UICoordinates_COUNT = 2, -}; - -struct UI_Item{ - UI_Item *next; - UI_Item *prev; - UI_Activation_Level activation_level; - UI_Coordinate_System coordinates; - Rect_i32 rect_outer; - i32 inner_margin; - Fancy_String_List lines[4]; - i32 line_count; - void *user_data; -}; - -struct UI_List{ - UI_Item *first; - UI_Item *last; - i32 count; -}; - -struct UI_Data{ - UI_List list; - Rect_i32 bounding_box[UICoordinates_COUNT]; -}; - -struct UI_Storage{ - UI_Data *data; - Arena *arena; - Temp_Memory temp; -}; - -//////////////////////////////// - typedef i32 Lister_Activation_Code; enum{ ListerActivation_Finished = 0, @@ -114,7 +69,6 @@ struct Lister_Data{ String_u8 text_field; String_u8 key_string; Lister_Option_List options; - b32 theme_list; }; struct Lister{ @@ -125,23 +79,32 @@ struct Lister{ struct Lister_State{ b32 initialized; Lister lister; - - // Action defered to next UI update b32 set_view_vertical_focus_to_item; - - // State set directly by input handlers + Lister_Node *highlighted_node; void *hot_user_data; i32 item_index; - - // State of UI computed during UI update i32 raw_item_index; - i32 item_count_after_filter; + b32 filter_restore_point_is_set; + Temp_Memory filter_restore_point; + Lister_Node_Ptr_Array filtered; + Basic_Scroll scroll; }; struct Lister_Prealloced_String{ String_Const_u8 string; }; +struct Lister_Filtered{ + Lister_Node_Ptr_Array exact_matches; + Lister_Node_Ptr_Array before_extension_matches; + Lister_Node_Ptr_Array substring_matches; +}; + +struct Lister_Top_Level_Layout{ + Rect_f32 text_field_rect; + Rect_f32 list_rect; +}; + //////////////////////////////// struct Lister_Option{ diff --git a/custom/4coder_lists.cpp b/custom/4coder_lists.cpp index 7bf82303..8b76c95a 100644 --- a/custom/4coder_lists.cpp +++ b/custom/4coder_lists.cpp @@ -18,7 +18,7 @@ CUSTOM_DOC("A lister mode command that inserts a new character to the text field lister_append_key(&state->lister, string); state->item_index = 0; view_zero_scroll(app, view); - lister_update_ui(app, view, state); + lister_update_filtered_list(app, view, state); } } } @@ -33,7 +33,7 @@ CUSTOM_DOC("A lister mode command that backspaces one character from the text fi state->lister.data.key_string.string = backspace_utf8(state->lister.data.key_string.string); state->item_index = 0; view_zero_scroll(app, view); - lister_update_ui(app, view, state); + lister_update_filtered_list(app, view, state); } } @@ -45,10 +45,10 @@ CUSTOM_DOC("A lister mode command that moves the highlighted item one up in the if (state->initialized){ state->item_index = state->item_index - 1; if (state->item_index < 0){ - state->item_index = state->item_count_after_filter - 1; + state->item_index = state->filtered.count - 1; } state->set_view_vertical_focus_to_item = true; - lister_update_ui(app, view, state); + lister_update_filtered_list(app, view, state); } } @@ -59,11 +59,11 @@ CUSTOM_DOC("A lister mode command that moves the highlighted item one down in th Lister_State *state = view_get_lister_state(view); if (state->initialized){ state->item_index = state->item_index + 1; - if (state->item_index > state->item_count_after_filter - 1){ + if (state->item_index > state->filtered.count - 1){ state->item_index = 0; } state->set_view_vertical_focus_to_item = true; - lister_update_ui(app, view, state); + lister_update_filtered_list(app, view, state); } } @@ -86,7 +86,7 @@ CUSTOM_DOC("A lister mode command that inserts a character into the text field o } state->item_index = 0; view_zero_scroll(app, view); - lister_update_ui(app, view, state); + lister_update_filtered_list(app, view, state); } } } @@ -124,7 +124,7 @@ CUSTOM_DOC("A lister mode command that backspaces one character from the text fi state->item_index = 0; view_zero_scroll(app, view); - lister_update_ui(app, view, state); + lister_update_filtered_list(app, view, state); } } } @@ -166,6 +166,10 @@ lister_input_handling_loop(Application_Links *app, View_ID view){ Heap *heap = &global_heap; Lister_State *state = view_get_lister_state(view); + Managed_Scope scope = view_get_managed_scope(app, view); + View_Render_Hook **hook = scope_attachment(app, scope, view_render_hook, View_Render_Hook*); + *hook = lister_render; + for (;;){ User_Input in = get_user_input(app, EventPropertyGroup_Any, @@ -174,6 +178,7 @@ lister_input_handling_loop(Application_Links *app, View_ID view){ break; } + Lister_Activation_Code result = ListerActivation_Continue; b32 handled = true; switch (in.event.kind){ case InputEventKind_TextInsert: @@ -185,7 +190,6 @@ lister_input_handling_loop(Application_Links *app, View_ID view){ case InputEventKind_KeyStroke: { - Lister_Activation_Code result = ListerActivation_Continue; switch (in.event.key.code){ case KeyCode_Return: case KeyCode_Tab: @@ -243,9 +247,6 @@ lister_input_handling_loop(Application_Links *app, View_ID view){ } }break; } - if (result == ListerActivation_Finished){ - goto done; - } }break; case InputEventKind_MouseButton: @@ -253,8 +254,9 @@ lister_input_handling_loop(Application_Links *app, View_ID view){ switch (in.event.mouse.code){ case MouseCode_Left: { - UI_Item clicked = lister_get_clicked_item(app, view); - state->hot_user_data = clicked.user_data; + Vec2_f32 p = V2f32(in.event.mouse.p); + void *clicked = lister_user_data_at_p(app, view, state, p); + state->hot_user_data = clicked; }break; default: @@ -270,10 +272,11 @@ lister_input_handling_loop(Application_Links *app, View_ID view){ case MouseCode_Left: { if (state->hot_user_data != 0){ - UI_Item clicked = lister_get_clicked_item(app, view); - if (state->hot_user_data == clicked.user_data){ - lister_call_activate_handler(app, heap, view, state, - clicked.user_data, true); + Vec2_f32 p = V2f32(in.event.mouse.p); + void *clicked = lister_user_data_at_p(app, view, state, p); + if (state->hot_user_data == clicked){ + result = lister_call_activate_handler(app, heap, view, state, + clicked, true); } } state->hot_user_data = 0; @@ -288,19 +291,17 @@ lister_input_handling_loop(Application_Links *app, View_ID view){ case InputEventKind_MouseWheel: { - Basic_Scroll scroll = view_get_basic_scroll(app, view); Mouse_State mouse = get_mouse_state(app); - scroll.target.y += mouse.wheel; - view_set_basic_scroll(app, view, scroll); + state->scroll.target.y += mouse.wheel; if (state->initialized){ - lister_update_ui(app, view, state); + lister_update_filtered_list(app, view, state); } }break; case InputEventKind_MouseMove: case InputEventKind_Core: { - lister_update_ui(app, view, state); + lister_update_filtered_list(app, view, state); }break; default: @@ -309,11 +310,16 @@ lister_input_handling_loop(Application_Links *app, View_ID view){ }break; } + if (result == ListerActivation_Finished){ + break; + } if (!handled){ leave_command_input_unhandled(app); } } - done:; + + hook = scope_attachment(app, scope, view_render_hook, View_Render_Hook*); + *hook = 0; } //////////////////////////////// @@ -350,11 +356,9 @@ begin_integrated_lister__with_refresh_handler(Application_Links *app, char *quer lister_set_query(&state->lister, query_string); state->lister.data.handlers = handlers; handlers.refresh(app, &state->lister); - lister_update_ui(app, view, state); + lister_update_filtered_list(app, view, state); - view_begin_ui_mode(app, view); lister_input_handling_loop(app, view); - view_end_ui_mode(app, view); state->initialized = false; linalloc_clear(state->lister.arena); @@ -396,11 +400,9 @@ begin_integrated_lister__basic_list(Application_Links *app, char *query_string, lister_set_query(&state->lister, query_string); state->lister.data.handlers = lister_get_default_handlers(); state->lister.data.handlers.activate = activate; - lister_update_ui(app, view, state); + lister_update_filtered_list(app, view, state); - view_begin_ui_mode(app, view); lister_input_handling_loop(app, view); - view_end_ui_mode(app, view); state->initialized = false; linalloc_clear(state->lister.arena); } @@ -428,11 +430,9 @@ begin_integrated_lister__with_fixed_options(Application_Links *app, char *query_ lister_set_query(&state->lister, query_string); state->lister.data.handlers = handlers; state->lister.data.handlers.refresh = 0; - lister_update_ui(app, view, state); + lister_update_filtered_list(app, view, state); - view_begin_ui_mode(app, view); lister_input_handling_loop(app, view); - view_end_ui_mode(app, view); state->initialized = false; linalloc_clear(state->lister.arena); } @@ -464,7 +464,6 @@ begin_integrated_lister__theme_list(Application_Links *app, char *query_string, Lister_State *state = view_get_lister_state(view); init_lister_state(app, state, heap); lister_first_init(app, &state->lister, user_data, user_data_size); - state->lister.data.theme_list = true; for (i32 i = 0; i < option_count; i += 1){ lister_add_theme_item(&state->lister, SCu8(options[i].string), @@ -474,11 +473,9 @@ begin_integrated_lister__theme_list(Application_Links *app, char *query_string, lister_set_query(&state->lister, query_string); state->lister.data.handlers = handlers; state->lister.data.handlers.refresh = 0; - lister_update_ui(app, view, state); + lister_update_filtered_list(app, view, state); - view_begin_ui_mode(app, view); lister_input_handling_loop(app, view); - view_end_ui_mode(app, view); state->initialized = false; linalloc_clear(state->lister.arena); } @@ -776,7 +773,6 @@ CUSTOM_COMMAND_SIG(interactive_switch_buffer) CUSTOM_DOC("Interactively switch to an open buffer.") { View_ID view = get_active_view(app, AccessAll); - view_end_ui_mode(app, view); begin_integrated_lister__buffer_list(app, "Switch:", activate_switch_buffer, 0, 0, view); } @@ -796,7 +792,6 @@ CUSTOM_COMMAND_SIG(interactive_kill_buffer) CUSTOM_DOC("Interactively kill an open buffer.") { View_ID view = get_active_view(app, AccessAll); - view_end_ui_mode(app, view); begin_integrated_lister__buffer_list(app, "Kill:", activate_kill_buffer, 0, 0, view); } @@ -868,7 +863,6 @@ CUSTOM_COMMAND_SIG(interactive_open_or_new) CUSTOM_DOC("Interactively open a file out of the file system.") { View_ID view = get_active_view(app, AccessAll); - view_end_ui_mode(app, view); begin_integrated_lister__file_system_list(app, "Open:", activate_open_or_new, 0, 0, view); } @@ -908,7 +902,6 @@ CUSTOM_COMMAND_SIG(interactive_new) CUSTOM_DOC("Interactively creates a new file.") { View_ID view = get_active_view(app, AccessAll); - view_end_ui_mode(app, view); begin_integrated_lister__file_system_list(app, "New:", activate_new, 0, 0, view); } @@ -942,7 +935,6 @@ CUSTOM_COMMAND_SIG(interactive_open) CUSTOM_DOC("Interactively opens a file.") { View_ID view = get_active_view(app, AccessAll); - view_end_ui_mode(app, view); begin_integrated_lister__file_system_list(app, "Open:", activate_open, 0, 0, view); } @@ -1004,7 +996,6 @@ launch_custom_command_lister(Application_Links *app, i32 *command_ids, i32 comma Scratch_Block scratch(app, Scratch_Share); View_ID view = get_active_view(app, AccessAll); - view_end_ui_mode(app, view); Lister_Option *options = push_array(scratch, Lister_Option, command_id_count); for (i32 i = 0; i < command_id_count; i += 1){ i32 j = i; diff --git a/custom/4coder_log_parser.cpp b/custom/4coder_log_parser.cpp index e547c666..024b3c54 100644 --- a/custom/4coder_log_parser.cpp +++ b/custom/4coder_log_parser.cpp @@ -6,9 +6,9 @@ * Log parser. * */ - + // TOP - + internal u64 log_parse__string_code(Log_Parse *parse, String_Const_u8 string, Log_String_Source string_source){ u64 result = 0; @@ -30,7 +30,7 @@ log_parse__string_code(Log_Parse *parse, String_Const_u8 string, Log_String_Sour } return(result); } - + internal String_Const_u8 log_parse__get_string(Log_Parse *parse, u64 code){ Table_Lookup lookup = table_lookup(&parse->id_to_string_table, code); @@ -42,7 +42,7 @@ log_parse__get_string(Log_Parse *parse, u64 code){ } return(result); } - + internal Log_Event* log_parse__event(Log_Parse *parse, String_Const_u8 file_name, String_Const_u8 line_number, String_Const_u8 event_name){ @@ -55,7 +55,7 @@ log_parse__event(Log_Parse *parse, new_event->event_number = parse->event_count; return(new_event); } - + internal Log_Tag* log_parse__tag(Log_Parse *parse, Log_Event *event, String_Const_u8 tag_name, String_Const_u8 tag_value){ Log_Tag *new_tag = push_array(parse->arena, Log_Tag, 1); @@ -103,7 +103,7 @@ log_parse__tag(Log_Parse *parse, Log_Event *event, String_Const_u8 tag_name, Str } return(new_tag); } - + internal Log_Event_List* log_parse_get_list_tag_value(Log_Parse *parse, u64 name, Log_Tag_Value value){ Log_Event_List *result = 0; @@ -116,7 +116,7 @@ log_parse_get_list_tag_value(Log_Parse *parse, u64 name, Log_Tag_Value value){ } return(result); } - + internal Log_Event_List* log_parse__get_or_make_list_tag_value(Log_Parse *parse, Log_Tag *tag){ Log_Event_List *result = 0; @@ -135,7 +135,7 @@ log_parse__get_or_make_list_tag_value(Log_Parse *parse, Log_Tag *tag){ } return(result); } - + internal Log_Event_List* log_parse_get_list_tag_name(Log_Parse *parse, u64 name){ Log_Event_List *result = 0; @@ -147,7 +147,7 @@ log_parse_get_list_tag_name(Log_Parse *parse, u64 name){ } return(result); } - + internal Log_Event_List* log_parse__get_or_make_list_tag_name(Log_Parse *parse, Log_Tag *tag){ Log_Event_List *result = 0; @@ -163,7 +163,7 @@ log_parse__get_or_make_list_tag_name(Log_Parse *parse, Log_Tag *tag){ } return(result); } - + internal Log_Parse make_log_parse(Arena *arena, String_Const_u8 source){ Log_Parse parse = {}; @@ -171,82 +171,82 @@ make_log_parse(Arena *arena, String_Const_u8 source){ parse.string_id_counter = 1; parse.string_to_id_table = make_table_Data_u64(arena->base_allocator, 500); parse.id_to_string_table = make_table_u64_Data(arena->base_allocator, 500); - + for (;source.size > 0;){ umem end_of_line = string_find_first(source, '\n'); String_Const_u8 line = string_prefix(source, end_of_line); line = string_skip_chop_whitespace(line); source = string_skip(source, end_of_line + 1); - + String_Const_u8 src_file_name = {}; String_Const_u8 src_line_number = {}; b32 got_source_position = false; - + String_Const_u8 whole_line = line; - + { umem colon1 = string_find_first(line, ':'); src_file_name = string_prefix(line, colon1); line = string_skip(line, colon1 + 1); - + umem colon2 = string_find_first(line, ':'); src_line_number = string_prefix(line, colon2); line = string_skip(line, colon2 + 1); - + if (string_is_integer(src_line_number, 10)){ got_source_position = true; } } - + if (!got_source_position){ line = whole_line; - + umem colon0 = string_find_first(line, ':'); umem colon1 = string_find_first(line, colon0 + 1, ':'); src_file_name = string_prefix(line, colon1); line = string_skip(line, colon1 + 1); - + umem colon2 = string_find_first(line, ':'); src_line_number = string_prefix(line, colon2); line = string_skip(line, colon2 + 1); - + if (string_is_integer(src_line_number, 10)){ got_source_position = true; } } - + if (got_source_position){ umem bracket_open = string_find_first(line, '['); String_Const_u8 event_name = string_prefix(line, bracket_open); event_name = string_skip_chop_whitespace(event_name); line = string_skip(line, bracket_open + 1); - + Log_Event *event = log_parse__event(&parse, src_file_name, src_line_number, event_name); - + for (;line.size > 0;){ umem bracket_close = string_find_first(line, ']'); String_Const_u8 tag = string_prefix(line, bracket_close); line = string_skip(line, bracket_close + 1); bracket_open = string_find_first(line, '['); line = string_skip(line, bracket_open + 1); - + umem equal_sign = string_find_first(tag, '='); String_Const_u8 tag_name = string_prefix(tag, equal_sign); String_Const_u8 tag_contents = string_skip(tag, equal_sign + 1); - + log_parse__tag(&parse, event, tag_name, tag_contents); } } } - + //////////////////////////////// - + // NOTE(allen): fill acceleration structures - + parse.tag_value_to_event_list_table = make_table_Data_u64(arena->base_allocator, Thousand(1)); parse.tag_name_to_event_list_table = make_table_u64_u64(arena->base_allocator, 100); - + for (Log_Event *event = parse.first_event; event != 0; event = event->next){ @@ -269,7 +269,7 @@ make_log_parse(Arena *arena, String_Const_u8 source){ } } } - + for (Log_Event *event = parse.first_event; event != 0; event = event->next){ @@ -281,12 +281,12 @@ make_log_parse(Arena *arena, String_Const_u8 source){ table_insert(&event->tag_name_to_tag_ptr_table, tag->name, (u64)PtrAsInt(tag)); } } - + return(parse); } - + //////////////////////////////// - + internal void log_events_sort_by_tag__inner(Log_Event **events, Log_Sort_Key *keys, i32 first, i32 one_past_last){ if (first + 1 < one_past_last){ @@ -323,7 +323,7 @@ log_events_sort_by_tag__inner(Log_Event **events, Log_Sort_Key *keys, i32 first, log_events_sort_by_tag__inner(events, keys, j + 1, one_past_last); } } - + internal void log_events_sort_by_tag(Arena *scratch, Log_Event_Ptr_Array array, u64 tag_name){ Temp_Memory temp = begin_temp(scratch); @@ -343,12 +343,12 @@ log_events_sort_by_tag(Arena *scratch, Log_Event_Ptr_Array array, u64 tag_name){ } keys[i].number = event->event_number; } - + log_events_sort_by_tag__inner(array.events, keys, 0, array.count); - + end_temp(temp); } - + internal Log_Event_Ptr_Array log_event_array_from_list(Arena *arena, Log_Event_List list){ Log_Event_Ptr_Array array = {}; @@ -363,16 +363,16 @@ log_event_array_from_list(Arena *arena, Log_Event_List list){ } return(array); } - + //////////////////////////////// - + global View_ID log_view = 0; global Arena *log_arena = {}; global Log_Parse log_parse = {}; global Log_Graph log_graph = {}; global Log_Filter_Set log_filter_set = {}; global Log_Filter_Set log_preview_set = {}; - + internal void log_filter_set_init(Log_Filter_Set *set){ block_zero_struct(set); @@ -380,7 +380,7 @@ log_filter_set_init(Log_Filter_Set *set){ sll_stack_push(set->free_filters, &set->filters_memory[i]); } } - + internal Log_Filter_Set* log_filter_set_from_tab(Log_Graph_List_Tab tab){ Log_Filter_Set *result = 0; @@ -396,7 +396,7 @@ log_filter_set_from_tab(Log_Graph_List_Tab tab){ } return(result); } - + internal Log_Filter* log_filter_set__new_filter(Log_Filter_Set *set, Log_Filter *prototype){ Log_Filter *result = set->free_filters; @@ -421,7 +421,7 @@ log_filter_set__new_filter(Log_Filter_Set *set, Log_Filter *prototype){ } return(result); } - + internal void log_filter_set__free_filter(Log_Filter_Set *set, Log_Filter *filter){ zdll_remove(set->first, set->last, filter); @@ -429,7 +429,7 @@ log_filter_set__free_filter(Log_Filter_Set *set, Log_Filter *filter){ set->alter_counter += 1; sll_stack_push(set->free_filters, filter); } - + internal void log_graph_fill(Application_Links *app, Rect_f32 layout_region, Face_ID face_id){ if (log_parse.arena != 0){ @@ -444,22 +444,22 @@ log_graph_fill(Application_Links *app, Rect_f32 layout_region, Face_ID face_id){ log_graph.filter_alter_counter = log_filter_set.alter_counter; log_graph.preview_alter_counter = log_preview_set.alter_counter; log_graph.tab = LogTab_Filters; - + f32 details_h = rect_height(layout_region)*.22f; details_h = clamp_top(details_h, 250.f); - + Rect_f32 details_region = Rf32(layout_region.x0, layout_region.y0, layout_region.x1, layout_region.y0 + details_h); Rect_f32 event_list_region = Rf32(layout_region.x0, layout_region.y0 + details_h, layout_region.x1, layout_region.y1); - + log_graph.details_region = details_region; log_graph.details_region.p0 -= layout_region.p0; log_graph.details_region.p1 -= layout_region.p0; - + u64 thread_code = log_parse__string_code(&log_parse, string_u8_litexpr("thread"), LogParse_ExternalString); - + if (log_filter_set.count == 0){ // NOTE(allen): everything goes into the filtered list for (Log_Event *event = log_parse.first_event; @@ -483,7 +483,7 @@ log_graph_fill(Application_Links *app, Rect_f32 layout_region, Face_ID face_id){ else if (filter->kind == LogFilter_Tag){ filter_list = log_parse_get_list_tag_name(&log_parse, filter->tag_name_code); } - + // NOTE(allen): combine with existing result if (filter == log_filter_set.first){ for (Log_Event_Ptr_Node *node = filter_list->first; @@ -502,7 +502,7 @@ log_graph_fill(Application_Links *app, Rect_f32 layout_region, Face_ID face_id){ node_a != 0; node_a = next){ next = node_a->next; - + b32 remove_node_a = true; for (Log_Event_Ptr_Node *node_b = filter_list->first; node_b != 0; @@ -512,7 +512,7 @@ log_graph_fill(Application_Links *app, Rect_f32 layout_region, Face_ID face_id){ break; } } - + if (remove_node_a){ *fixup_ptr = next; } @@ -524,19 +524,19 @@ log_graph_fill(Application_Links *app, Rect_f32 layout_region, Face_ID face_id){ } } } - + log_graph.event_array = log_event_array_from_list(log_arena, log_graph.filtered_list); log_events_sort_by_tag(log_arena, log_graph.event_array, thread_code); - + b32 had_a_tag = true; u64 thread_id_value = 0; Log_Graph_Thread_Bucket *prev_bucket = 0; - + for (i32 i = 0; i < log_graph.event_array.count; i += 1){ Table_u64_u64 *tag_table = &log_graph.event_array.events[i]->tag_name_to_tag_ptr_table; Table_Lookup lookup = table_lookup(tag_table, thread_code); - + b32 emit_next_bucket = false; if (!lookup.found_match){ if (had_a_tag){ @@ -559,7 +559,7 @@ log_graph_fill(Application_Links *app, Rect_f32 layout_region, Face_ID face_id){ emit_next_bucket = true; } } - + if (emit_next_bucket){ Log_Graph_Thread_Bucket *bucket = push_array(log_arena, Log_Graph_Thread_Bucket, 1); sll_queue_push(log_graph.first_bucket, log_graph.last_bucket, bucket); @@ -576,16 +576,16 @@ log_graph_fill(Application_Links *app, Rect_f32 layout_region, Face_ID face_id){ if (prev_bucket != 0){ prev_bucket->range.one_past_last = log_graph.event_array.count; } - + Face_Metrics metrics = get_face_metrics(app, face_id); f32 line_height = metrics.line_height; f32 box_h = f32_floor32(line_height*1.5f); f32 box_w = f32_floor32(rect_width(event_list_region)/log_graph.bucket_count); f32 y_cursor = event_list_region.y0 - layout_region.y0; - + if (log_graph.bucket_count > 0){ f32 y_bottom = 0.f; - + for (;;){ i32 smallest_event_number = max_i32; i32 bucket_with_next_event_index = -1; @@ -605,13 +605,13 @@ log_graph_fill(Application_Links *app, Rect_f32 layout_region, Face_ID face_id){ } } } - + if (bucket_with_next_event == 0){ break; } - + bucket_with_next_event->range.first += 1; - + Log_Graph_Box *box_node = push_array(log_arena, Log_Graph_Box, 1); sll_queue_push(log_graph.first_box, log_graph.last_box, box_node); log_graph.box_count += 1; @@ -619,32 +619,32 @@ log_graph_fill(Application_Links *app, Rect_f32 layout_region, Face_ID face_id){ box_w*(bucket_with_next_event_index + 1), y_cursor + box_h); box_node->rect = rect; box_node->event = next_event; - + y_bottom = Max(y_bottom, rect.y1); - + y_cursor += box_h; } - + log_graph.max_y_scroll = clamp_bot(line_height, y_bottom - rect_height(event_list_region)*0.5f); } } } - + internal void log_parse_fill(Application_Links *app, Buffer_ID buffer){ if (log_arena == 0){ log_arena = reserve_arena(app); } - + linalloc_clear(log_arena); block_zero_struct(&log_graph); log_filter_set_init(&log_filter_set); log_filter_set_init(&log_preview_set); - + String_Const_u8 log_text = push_whole_buffer(app, log_arena, buffer); log_parse = make_log_parse(log_arena, log_text); } - + internal void log_graph_render__tag(Arena *arena, Fancy_String_List *line, Log_Parse *log, Log_Tag *tag){ String_Const_u8 tag_name = log_parse__get_string(log, tag->name); @@ -660,7 +660,7 @@ log_graph_render__tag(Arena *arena, Fancy_String_List *line, Log_Parse *log, Log } push_fancy_stringf(arena, line, white, "]"); } - + internal void log_graph_render(Application_Links *app, View_ID view, Frame_Info frame_info, Rect_f32 inner){ if (log_parse.arena != 0){ @@ -675,28 +675,28 @@ log_graph_render(Application_Links *app, View_ID view, Frame_Info frame_info, Re } log_graph.y_scroll = clamp(0.f, y_scroll, log_graph.max_y_scroll); log_graph.selected_event = selected_event; - + Mouse_State mouse = get_mouse_state(app); Vec2_f32 m_p = V2f32(mouse.p) - inner.p0; - + Face_Metrics metrics = get_face_metrics(app, log_graph.face_id); f32 line_height = metrics.line_height; - + Log_Event *hover_event = 0; - + b32 in_details_region = (rect_contains_point(log_graph.details_region, m_p)); - + for (Log_Graph_Box *box_node = log_graph.first_box; box_node != 0; box_node = box_node->next){ Scratch_Block scratch(app); - + Rect_f32 box = box_node->rect; box.y0 -= log_graph.y_scroll; box.y1 -= log_graph.y_scroll; - + Rect_f32 box_inner = rect_inner(box, 3.f); - + Fancy_Color margin_color = dark_gray; if (!in_details_region && hover_event == 0 && rect_contains_point(box, m_p)){ margin_color = gray; @@ -705,16 +705,16 @@ log_graph_render(Application_Links *app, View_ID view, Frame_Info frame_info, Re if (box_node->event == log_graph.selected_event){ margin_color = light_gray; } - + draw_rectangle_fancy(app, box , margin_color); draw_rectangle_fancy(app, box_inner, black ); - + Log_Event *event = box_node->event; - + String_Const_u8 event_name = log_parse__get_string(&log_parse, event->event_name); Fancy_String_List line = {}; push_fancy_string(scratch, &line, white, event_name); - + for (Log_Filter *filter = log_preview_set.first; filter != 0; filter = filter->next){ @@ -728,29 +728,29 @@ log_graph_render(Application_Links *app, View_ID view, Frame_Info frame_info, Re log_graph_render__tag(scratch, &line, &log_parse, tag); } } - - + + Vec2_f32 p = V2f32(box_inner.x0 + 3.f, (f32_round32((box_inner.y0 + box_inner.y1 - line_height)*0.5f))); draw_fancy_string(app, log_graph.face_id, line.first, p, 0, 0, 0, V2f32(1.f, 0.f)); } - + { Scratch_Block scratch(app); - + Rect_f32 box = log_graph.details_region; Rect_f32 box_inner = rect_inner(box, 3.f); - + Log_Graph_List_Tab current_tab = log_graph.tab; Log_Filter_Set *viewing_filter_set = log_filter_set_from_tab(current_tab); - + draw_rectangle_fancy(app, box , dark_gray); draw_rectangle_fancy(app, box_inner, black ); - + { f32 y_cursor = box_inner.y0 + 3.f; if (y_cursor + line_height > box_inner.y1) goto finish_list_display; - + { f32 x_cursor = box_inner.x0 + 3.f; for (i32 i = LogTab_ERROR + 1; i < LogTab_COUNT; i += 1){ @@ -766,13 +766,13 @@ log_graph_render(Application_Links *app, View_ID view, Frame_Info frame_info, Re push_fancy_stringf(scratch, &line, color, "previews"); }break; } - + Vec2_f32 p = V2f32(x_cursor, y_cursor); f32 advance = get_fancy_string_advance(app, log_graph.face_id, line.first); draw_fancy_string(app, log_graph.face_id, line.first, p, Stag_Default, Stag_Back, 0, V2f32(1.f, 0.f)); x_cursor += advance + metrics.normal_advance; - + if (log_graph.has_unused_click){ Rect_f32 click_rect = Rf32(p.x, p.y, p.x + advance, p.y + line_height); if (rect_contains_point(click_rect, log_graph.unused_click)){ @@ -782,18 +782,18 @@ log_graph_render(Application_Links *app, View_ID view, Frame_Info frame_info, Re } } } - + if (viewing_filter_set != 0){ for (Log_Filter *filter = viewing_filter_set->first, *next = 0; filter != 0; filter = next){ next = filter->next; - + y_cursor += line_height; if (y_cursor + line_height > box_inner.y1) goto finish_list_display; - + Fancy_String_List line = {}; - + if (filter->kind == LogFilter_TagValue){ push_fancy_stringf(scratch, &line, white, "val ["); String_Const_u8 tag_name = log_parse__get_string(&log_parse, filter->tag_name_code); @@ -814,12 +814,12 @@ log_graph_render(Application_Links *app, View_ID view, Frame_Info frame_info, Re push_fancy_stringf(scratch, &line, green, "%.*s", string_expand(tag_name)); push_fancy_stringf(scratch, &line, white, "]"); } - + Vec2_f32 p = V2f32(box_inner.x0 + 3.f, y_cursor); f32 advance = get_fancy_string_advance(app, log_graph.face_id, line.first); draw_fancy_string(app, log_graph.face_id, line.first, p, Stag_Default, Stag_Back, 0, V2f32(1.f, 0.f)); - + if (log_graph.has_unused_click){ Rect_f32 click_rect = Rf32(p.x, p.y, p.x + advance, p.y + line_height); if (rect_contains_point(click_rect, log_graph.unused_click)){ @@ -829,45 +829,45 @@ log_graph_render(Application_Links *app, View_ID view, Frame_Info frame_info, Re } } } - + finish_list_display:; } - + Log_Event *view_event = (hover_event!=0)?hover_event:log_graph.selected_event; if (view_event != 0){ f32 y_cursor = box_inner.y0 + 3.f; if (y_cursor + line_height > box_inner.y1) goto finish_event_display; - + { Fancy_String_List line = {}; String_Const_u8 file_name = log_parse__get_string(&log_parse, view_event->src_file_name); push_fancy_stringf(scratch, &line, green, "[%d] ", view_event->event_number); push_fancy_stringf(scratch, &line, white, "%.*s:", string_expand(file_name)); push_fancy_stringf(scratch, &line, pink, "%llu", view_event->line_number); - + Vec2_f32 right_p = V2f32(box_inner.x1 - 3.f, y_cursor); f32 advance = get_fancy_string_advance(app, log_graph.face_id, line.first); Vec2 p = V2f32(right_p.x - advance, right_p.y); draw_fancy_string(app, log_graph.face_id, line.first, p, Stag_Default, Stag_Back, 0, V2(1.f, 0.f)); } - + for (Log_Tag *tag = view_event->first_tag; tag != 0; tag = tag->next){ y_cursor += line_height; if (y_cursor + line_height > box_inner.y1) goto finish_event_display; - + { Fancy_String_List line = {}; log_graph_render__tag(scratch, &line, &log_parse, tag); - + Vec2_f32 right_p = V2f32(box_inner.x1 - 3.f, y_cursor); f32 advance = get_fancy_string_advance(app, log_graph.face_id, line.first); Vec2 p = V2f32(right_p.x - advance, right_p.y); draw_fancy_string(app, log_graph.face_id, line.first, p, Stag_Default, Stag_Back, 0, V2(1.f, 0.f)); - + if (log_graph.has_unused_click){ Rect_f32 click_rect = Rf32(p.x, p.y, right_p.x, p.y + line_height); if (rect_contains_point(click_rect, log_graph.unused_click)){ @@ -894,35 +894,15 @@ log_graph_render(Application_Links *app, View_ID view, Frame_Info frame_info, Re } } } - + finish_event_display:; } } - + log_graph.has_unused_click = false; } } -CUSTOM_COMMAND_SIG(log_graph__escape) -CUSTOM_DOC("Ends the log grapher") -{ - if (log_view != 0){ - view_end_ui_mode(app, log_view); - log_view = 0; - } -} - -CUSTOM_COMMAND_SIG(log_graph__scroll_wheel) -CUSTOM_DOC("Scrolls the log graph") -{ - if (log_view != 0){ - Mouse_State mouse = get_mouse_state(app); - if (mouse.wheel != 0){ - log_graph.y_scroll += mouse.wheel; - } - } -} - internal Log_Graph_Box* log_graph__get_box_at_point(Log_Graph *graph, Vec2_f32 p){ Log_Graph_Box *result = 0; @@ -980,9 +960,6 @@ log_graph__click_jump_to_event_source(Application_Links *app, Vec2_f32 m_p){ target_buffer = get_buffer_by_name(app, file_name, AccessAll); } if (target_buffer != 0){ - if (target_view == log_view){ - view_end_ui_mode(app, target_view); - } set_view_to_location(app, target_view, target_buffer, seek_line_col(event->line_number, 1)); } diff --git a/custom/4coder_project_commands.cpp b/custom/4coder_project_commands.cpp index ee8c63ec..e57684eb 100644 --- a/custom/4coder_project_commands.cpp +++ b/custom/4coder_project_commands.cpp @@ -1342,7 +1342,6 @@ CUSTOM_DOC("Open a lister of all commands in the currently loaded project.") Scratch_Block scratch(app, Scratch_Share); View_ID view = get_active_view(app, AccessAll); - view_end_ui_mode(app, view); i32 option_count = current_project.command_array.count; Lister_Option *options = push_array(scratch, Lister_Option, option_count); for (i32 i = 0; diff --git a/custom/4coder_types.h b/custom/4coder_types.h index adb69e7c..376fcf28 100644 --- a/custom/4coder_types.h +++ b/custom/4coder_types.h @@ -43,6 +43,13 @@ TYPEDEF i32 Panel_ID; TYPEDEF u32 Text_Layout_ID; +typedef i32 UI_Highlight_Level; +enum{ + UIHighlight_None, + UIHighlight_Hover, + UIHighlight_Active, +}; + STRUCT Buffer_Point{ i64 line_number; Vec2 pixel_shift; @@ -94,12 +101,16 @@ STRUCT Character_Predicate{ u8 b[32]; }; +struct View_Context{ + Void_Func ctx_ptr; + b32 hides_buffer; +}; + ENUM(i32, View_Setting_ID){ ViewSetting_Null, ViewSetting_ShowWhitespace, ViewSetting_ShowScrollbar, ViewSetting_ShowFileBar, - ViewSetting_UICommandMap }; ENUM(u32, Buffer_Create_Flag){ @@ -241,12 +252,12 @@ STRUCT Buffer_Identifier{ Buffer_ID id; }; -STRUCT Buffer_Scroll{ +struct Buffer_Scroll{ Buffer_Point position; Buffer_Point target; }; -STRUCT Basic_Scroll{ +struct Basic_Scroll{ Vec2_f32 position; Vec2_f32 target; }; @@ -351,9 +362,6 @@ struct Query_Bar_Group{ ~Query_Bar_Group(); }; -TYPEDEF_FUNC void UI_Quit_Function_Type(struct Application_Links *app, View_ID view); -#define UI_QUIT_FUNCTION(name) void name(struct Application_Links *app, View_ID view) - STRUCT Theme_Color{ id_color tag; argb_color color; diff --git a/custom/4coder_ui_helper.cpp b/custom/4coder_ui_helper.cpp deleted file mode 100644 index 979a8a46..00000000 --- a/custom/4coder_ui_helper.cpp +++ /dev/null @@ -1,721 +0,0 @@ -/* - * Helpers for ui data structures. - */ - -// TOP - -typedef u32 View_Get_UI_Flags; -enum{ - ViewGetUIFlag_KeepDataAsIs = 0, - ViewGetUIFlag_ClearData = 1, -}; - -static b32 -view_get_ui_data(Application_Links *app, View_ID view_id, View_Get_UI_Flags flags, UI_Data **ui_data_out, Arena **ui_arena_out){ - b32 result = false; - Managed_Scope scope = view_get_managed_scope(app, view_id); - if (scope != 0){ - Managed_Object *ui_data_object_ptr = scope_attachment(app, scope, view_ui_data, Managed_Object); - Managed_Object ui_data_object = *ui_data_object_ptr; - if (ui_data_object == 0){ - Managed_Object new_ui_data_object = alloc_managed_memory_in_scope(app, scope, sizeof(UI_Storage), 1); - - Base_Allocator *allocator = managed_scope_allocator(app, scope); - Arena arena_temp = make_arena(allocator, KB(8)); - Arena *arena = push_array(&arena_temp, Arena, 1); - block_copy_struct(arena, &arena_temp); - - UI_Data *ui_data = push_array(arena, UI_Data, 1); - UI_Storage storage = {}; - storage.data = ui_data; - storage.arena = arena; - storage.temp = begin_temp(arena); - if (managed_object_store_data(app, new_ui_data_object, 0, 1, &storage)){ - *ui_data_object_ptr = new_ui_data_object; - ui_data_object = new_ui_data_object; - } - - } - if (ui_data_object != 0){ - UI_Storage storage = {}; - if (managed_object_load_data(app, ui_data_object, 0, 1, &storage)){ - *ui_data_out = storage.data; - *ui_arena_out = storage.arena; - if ((flags & ViewGetUIFlag_ClearData) != 0){ - end_temp(storage.temp); - } - result = true; - } - } - } - return(result); -} - -static b32 -view_clear_ui_data(Application_Links *app, View_ID view_id){ - b32 result = false; - Managed_Scope scope = view_get_managed_scope(app, view_id); - if (scope != 0){ - Managed_Object *ui_data_object_ptr = scope_attachment(app, scope, view_ui_data, Managed_Object); - Managed_Object ui_data_object = *ui_data_object_ptr; - if (ui_data_object != 0){ - UI_Storage storage = {}; - if (managed_object_load_data(app, ui_data_object, 0, 1, &storage)){ - Arena arena_temp = *storage.arena; - linalloc_clear(&arena_temp); - managed_object_free(app, ui_data_object); - *ui_data_object_ptr = 0; - result = true; - } - } - } - return(result); -} - -//////////////////////////////// - -static UI_Item* -ui_list_add_item(Arena *arena, UI_List *list, UI_Item item){ - UI_Item *node = push_array(arena, UI_Item, 1); - block_copy_struct(node, &item); - zdll_push_back(list->first, list->last, node); - list->count += 1; - return(node); -} - -static void -ui_data_compute_bounding_boxes(UI_Data *ui_data){ - for (u32 i = 0; i < UICoordinates_COUNT; ++i){ - ui_data->bounding_box[i] = Ri32_negative_infinity; - } - for (UI_Item *item = ui_data->list.first; - item != 0; - item = item->next){ - if (item->coordinates >= UICoordinates_COUNT){ - item->coordinates = UICoordinates_ViewSpace; - } - Rect_i32 *box = &ui_data->bounding_box[item->coordinates]; - *box = rect_union(*box, item->rect_outer); - } -} - -static void -ui_control_set_top(UI_Data *data, i32 top_y){ - data->bounding_box[UICoordinates_ViewSpace].y0 = top_y; -} - -static void -ui_control_set_bottom(UI_Data *data, i32 bottom_y){ - data->bounding_box[UICoordinates_ViewSpace].y1 = bottom_y; -} - -static UI_Item* -ui_control_get_mouse_hit(UI_Data *data, Vec2_f32 view_p, Vec2_f32 panel_p){ - UI_Item *result = 0; - for (UI_Item *item = data->list.first; item != 0 && result == 0; item = item->next){ - Rect_f32 r = Rf32(item->rect_outer); - switch (item->coordinates){ - case UICoordinates_ViewSpace: - { - if (rect_contains_point(r, view_p)){ - result = item; - } - }break; - case UICoordinates_PanelSpace: - { - if (rect_contains_point(r, panel_p)){ - result = item; - } - }break; - } - } - return(result); -} - -//////////////////////////////// - -static void -view_set_vertical_focus_basic(Application_Links *app, View_ID view, f32 y_top, f32 y_bot){ - Rect_f32 buffer_region = view_get_buffer_region(app, view); - Basic_Scroll scroll = view_get_basic_scroll(app, view); - f32 view_height = rect_height(buffer_region); - Interval_f32 view_y = If32(scroll.target.y, scroll.target.y + view_height); - Interval_f32 acceptable_y = If32(lerp(view_y.min, 0.10f, view_y.max), - lerp(view_y.min, 0.90f, view_y.max)); - f32 acceptable_height = range_size(acceptable_y); - f32 skirt_height = acceptable_y.min - view_y.min; - - f32 height = y_bot - y_top; - if (height > acceptable_height){ - scroll.target.y = y_top - skirt_height; - view_set_basic_scroll(app, view, scroll); - } - else{ - if (y_top < acceptable_y.min){ - scroll.target.y = y_top - skirt_height; - view_set_basic_scroll(app, view, scroll); - } - else if (y_bot > acceptable_y.max){ - scroll.target.y = y_bot + skirt_height - view_height; - view_set_basic_scroll(app, view, scroll); - } - } -} - -static Vec2_f32 -panel_space_from_screen_space(Vec2_f32 p, Vec2_f32 file_region_p0){ - return(p - file_region_p0); -} - -static Vec2_f32 -get_mouse_position_in_panel_space(Mouse_State mouse, Vec2_f32 file_region_p0){ - return(panel_space_from_screen_space(V2f32(mouse.p), file_region_p0)); -} - -static Vec2_f32 -get_mouse_position_in_panel_space(Application_Links *app, Vec2_f32 file_region_p0){ - return(get_mouse_position_in_panel_space(get_mouse_state(app), file_region_p0)); -} - -//////////////////////////////// - -// TODO(allen): VIEW_16_LIMIT -Lister_State global_lister_state_[16] = {}; -Lister_State *global_lister_state = global_lister_state_ - 1; - -static Lister_State* -view_get_lister_state(View_ID view){ - return(&global_lister_state[view]); -} - -static i32 -lister_standard_arena_size_round_up(i32 arena_size){ - if (arena_size < (64 << 10)){ - arena_size = (64 << 10); - } - else{ - arena_size += (4 << 10) - 1; - arena_size -= arena_size%(4 << 10); - } - return(arena_size); -} - -static void -init_lister_state(Application_Links *app, Lister_State *state, Heap *heap){ - state->initialized = true; - state->hot_user_data = 0; - state->item_index = 0; - state->set_view_vertical_focus_to_item = false; - state->item_count_after_filter = 0; -} - -UI_QUIT_FUNCTION(lister_quit_function){ - Lister_State *state = view_get_lister_state(view); - state->initialized = false; - view_clear_ui_data(app, view); -} - -static UI_Item -lister_get_clicked_item(Application_Links *app, View_ID view_id){ - UI_Item result = {}; - UI_Data *ui_data = 0; - Arena *ui_arena = 0; - if (view_get_ui_data(app, view_id, ViewGetUIFlag_KeepDataAsIs, &ui_data, &ui_arena)){ - Mouse_State mouse = get_mouse_state(app); - Rect_f32 region = view_get_buffer_region(app, view_id); - Vec2_f32 m_panel_space = get_mouse_position_in_panel_space(mouse, region.p0); - Basic_Scroll scroll = view_get_basic_scroll(app, view_id); - Vec2_f32 m_view_space = m_panel_space + scroll.position; - UI_Item *clicked = ui_control_get_mouse_hit(ui_data, m_view_space, m_panel_space); - if (clicked != 0){ - result = *clicked; - } - } - return(result); -} - -static f32 -lister_get_text_field_height(f32 line_height){ - return(line_height); -} - -static f32 -lister_get_block_height(f32 line_height, b32 is_theme_list){ - f32 block_height = 0; - if (is_theme_list){ - block_height = line_height*3 + 6; - } - else{ - block_height = line_height*2; - } - return(block_height); -} - -static void -lister_update_ui(Application_Links *app, View_ID view, Lister_State *state){ - b32 is_theme_list = state->lister.data.theme_list; - - Rect_f32 screen_rect = view_get_screen_rect(app, view); - - Face_ID face_id = get_face_id(app, 0); - Face_Metrics metrics = get_face_metrics(app, face_id); - - Basic_Scroll scroll = view_get_basic_scroll(app, view); - - f32 x0 = 0; - f32 x1 = (rect_width(screen_rect)); - f32 line_height = metrics.line_height; - f32 block_height = lister_get_block_height(line_height, is_theme_list); - f32 text_field_height = lister_get_text_field_height(metrics.line_height); - - Scratch_Block scratch(app, Scratch_Share); - - Rect_f32 region = view_get_buffer_region(app, view); - Vec2_f32 view_m = get_mouse_position_in_panel_space(app, region.p0); - view_m += scroll.position; - - f32 y_pos = text_field_height; - - state->raw_item_index = -1; - - i32 node_count = state->lister.data.options.count; - Lister_Node_Ptr_Array exact_matches = {}; - exact_matches.node_ptrs = push_array(scratch, Lister_Node*, 1); - Lister_Node_Ptr_Array before_extension_matches = {}; - before_extension_matches.node_ptrs = push_array(scratch, Lister_Node*, node_count); - Lister_Node_Ptr_Array substring_matches = {}; - substring_matches.node_ptrs = push_array(scratch, Lister_Node*, node_count); - - { - Temp_Memory temp = begin_temp(scratch); - String_Const_u8 key = state->lister.data.key_string.string; - key = push_string_copy(scratch, key); - string_mod_replace_character(key, '_', '*'); - string_mod_replace_character(key, ' ', '*'); - - List_String_Const_u8 absolutes = {}; - string_list_push(scratch, &absolutes, string_u8_litexpr("")); - List_String_Const_u8 splits = string_split(scratch, key, (u8*)"*", 1); - b32 has_wildcard = (splits.node_count > 1); - string_list_push(&absolutes, &splits); - string_list_push(scratch, &absolutes, string_u8_litexpr("")); - - for (Lister_Node *node = state->lister.data.options.first; - node != 0; - node = node->next){ - String_Const_u8 node_string = node->string; - - if (key.size == 0 || string_wildcard_match_insensitive(absolutes, node_string)){ - if (string_match_insensitive(node_string, key) && exact_matches.count == 0){ - exact_matches.node_ptrs[exact_matches.count++] = node; - } - else if (!has_wildcard && - string_match_insensitive(string_prefix(node_string, key.size), key) && - node->string.size > key.size && - node->string.str[key.size] == '.'){ - before_extension_matches.node_ptrs[before_extension_matches.count++] = node; - } - else{ - substring_matches.node_ptrs[substring_matches.count++] = node; - } - } - } - - end_temp(temp); - } - - Lister_Node_Ptr_Array node_ptr_arrays[] = { - exact_matches, - before_extension_matches, - substring_matches, - }; - - UI_Data *ui_data = 0; - Arena *ui_arena = 0; - if (view_get_ui_data(app, view, ViewGetUIFlag_ClearData, &ui_data, &ui_arena)){ - block_zero_struct(ui_data); - - UI_Item *highlighted_item = 0; - UI_Item *hot_item = 0; - UI_Item *hovered_item = 0; - i32 item_index_counter = 0; - for (i32 array_index = 0; array_index < ArrayCount(node_ptr_arrays); array_index += 1){ - Lister_Node_Ptr_Array node_ptr_array = node_ptr_arrays[array_index]; - for (i32 node_index = 0; node_index < node_ptr_array.count; node_index += 1){ - Lister_Node *node = node_ptr_array.node_ptrs[node_index]; - - Rect_f32 item_rect = Rf32(x0, y_pos, x1, y_pos + block_height); - y_pos = item_rect.y1; - - UI_Item item = {}; - item.activation_level = UIActivation_None; - item.coordinates = UICoordinates_ViewSpace; - item.rect_outer = Ri32(item_rect); - item.inner_margin = 3; - - if (!is_theme_list){ - Fancy_String_List list = {}; - push_fancy_string (ui_arena, &list, fancy_id(Stag_Default), node->string); - push_fancy_stringf(ui_arena, &list, fancy_id(Stag_Default), " "); - push_fancy_string (ui_arena, &list, fancy_id(Stag_Pop2 ), node->status); - item.lines[0] = list; - item.line_count = 1; - } - else{ - //i32 style_index = node->index; - - String_Const_u8 name = string_u8_litexpr("name"); - item.lines[0] = fancy_string_list_single(push_fancy_string(ui_arena, fancy_id(Stag_Default), name)); - - Fancy_String_List list = {}; - push_fancy_stringf(ui_arena, &list, fancy_id(Stag_Keyword ), "if "); - push_fancy_stringf(ui_arena, &list, fancy_id(Stag_Default ), "(x < "); - push_fancy_stringf(ui_arena, &list, fancy_id(Stag_Int_Constant), "0"); - push_fancy_stringf(ui_arena, &list, fancy_id(Stag_Default ), ") { x = "); - push_fancy_stringf(ui_arena, &list, fancy_id(Stag_Int_Constant), "0"); - push_fancy_stringf(ui_arena, &list, fancy_id(Stag_Default ), "; } "); - push_fancy_stringf(ui_arena, &list, fancy_id(Stag_Comment ), "// comment"); - item.lines[1] = list; - - item.line_count = 2; - } - - item.user_data = node->user_data; - - UI_Item *item_ptr = ui_list_add_item(ui_arena, &ui_data->list, item); - if (rect_contains_point(item_rect, view_m)){ - hovered_item = item_ptr; - } - if (state->item_index == item_index_counter){ - highlighted_item = item_ptr; - state->raw_item_index = node->raw_index; - } - item_index_counter += 1; - if (node->user_data == state->hot_user_data && hot_item != 0){ - hot_item = item_ptr; - } - } - } - state->item_count_after_filter = item_index_counter; - - if (hovered_item != 0){ - hovered_item->activation_level = UIActivation_Hover; - } - if (hot_item != 0){ - if (hot_item == hovered_item){ - hot_item->activation_level = UIActivation_Active; - } - else{ - hot_item->activation_level = UIActivation_Hover; - } - } - if (highlighted_item != 0){ - highlighted_item->activation_level = UIActivation_Active; - } - - if (state->set_view_vertical_focus_to_item){ - if (highlighted_item != 0){ - view_set_vertical_focus_basic(app, view, - (f32)highlighted_item->rect_outer.y0, - (f32)highlighted_item->rect_outer.y1); - } - state->set_view_vertical_focus_to_item = false; - } - - { - // TODO(allen): switch to float - Rect_i32 item_rect = {}; - item_rect.x0 = (i32)x0; - item_rect.y0 = 0; - item_rect.x1 = (i32)x1; - item_rect.y1 = item_rect.y0 + (i32)text_field_height; - y_pos = (f32)item_rect.y1; - - UI_Item item = {}; - item.activation_level = UIActivation_Active; - item.coordinates = UICoordinates_PanelSpace; - item.rect_outer = item_rect; - item.inner_margin = 0; - { - Fancy_String_List list = {}; - push_fancy_string (ui_arena, &list, fancy_id(Stag_Pop1 ), state->lister.data.query.string); - push_fancy_stringf(ui_arena, &list, fancy_id(Stag_Pop1 ), " "); - push_fancy_string (ui_arena, &list, fancy_id(Stag_Default), state->lister.data.text_field.string); - item.lines[0] = list; - item.line_count = 1; - } - item.user_data = 0; - - - ui_list_add_item(ui_arena, &ui_data->list, item); - } - - ui_data_compute_bounding_boxes(ui_data); - - // TODO(allen): what to do with control now? - //UI_Control control = ui_list_to_ui_control(scratch, &list); - view_set_quit_ui_handler(app, view, lister_quit_function); - } -} - -static Lister_Prealloced_String -lister_prealloced(String_Const_u8 string){ - Lister_Prealloced_String result = {}; - result.string = string; - return(result); -} - -static void -lister_first_init(Application_Links *app, Lister *lister, void *user_data, i32 user_data_size){ - if (lister->arena == 0) { - lister->arena = reserve_arena(app, KB(16)); - } - else{ - linalloc_clear(lister->arena); - } - block_zero_struct(&lister->data); - lister->data.query = Su8(lister->data.query_space, 0, sizeof(lister->data.query_space)); - lister->data.text_field = Su8(lister->data.text_field_space, 0, sizeof(lister->data.text_field_space)); - lister->data.key_string = Su8(lister->data.key_string_space, 0, sizeof(lister->data.key_string_space)); - lister->data.user_data = push_array(lister->arena, char, user_data_size); - lister->data.user_data_size = user_data_size; - if (user_data != 0){ - block_copy(lister->data.user_data, user_data, user_data_size); - } -} - -static void -lister_begin_new_item_set(Application_Links *app, Lister *lister){ - linalloc_clear(lister->arena); - block_zero_struct(&lister->data.options); -} - -static void* -lister_add_item(Lister *lister, Lister_Prealloced_String string, Lister_Prealloced_String status, - void *user_data, umem extra_space){ - void *base_memory = push_array(lister->arena, u8, sizeof(Lister_Node) + extra_space); - Lister_Node *node = (Lister_Node*)base_memory; - node->string = string.string; - node->status = status.string; - node->user_data = user_data; - node->raw_index = lister->data.options.count; - zdll_push_back(lister->data.options.first, lister->data.options.last, node); - lister->data.options.count += 1; - void *result = (node + 1); - return(result); -} - -static void* -lister_add_item(Lister *lister, Lister_Prealloced_String string, String_Const_u8 status, - void *user_data, umem extra_space){ - return(lister_add_item(lister, string, lister_prealloced(push_string_copy(lister->arena, status)), - user_data, extra_space)); -} - -static void* -lister_add_item(Lister *lister, String_Const_u8 string, Lister_Prealloced_String status, - void *user_data, umem extra_space){ - return(lister_add_item(lister, lister_prealloced(push_string_copy(lister->arena, string)), status, - user_data, extra_space)); -} - -static void* -lister_add_item(Lister *lister, String_Const_u8 string, String_Const_u8 status, void *user_data, umem extra_space){ - return(lister_add_item(lister, - lister_prealloced(push_string_copy(lister->arena, string)), - lister_prealloced(push_string_copy(lister->arena, status)), - user_data, extra_space)); -} - -static void* -lister_add_theme_item(Lister *lister, - Lister_Prealloced_String string, i32 index, - void *user_data, i32 extra_space){ - Lister_Node *node = push_array(lister->arena, Lister_Node, 1); - node->string = string.string; - node->index = index; - node->user_data = user_data; - node->raw_index = lister->data.options.count; - zdll_push_back(lister->data.options.first, lister->data.options.last, node); - lister->data.options.count += 1; - void *result = push_array(lister->arena, char, extra_space); - push_align(lister->arena, 8); - return(result); -} - -static void* -lister_add_theme_item(Lister *lister, String_Const_u8 string, i32 index, - void *user_data, i32 extra_space){ - return(lister_add_theme_item(lister, lister_prealloced(push_string_copy(lister->arena, string)), index, - user_data, extra_space)); -} - -static void* -lister_get_user_data(Lister_Data *lister_data, i32 index){ - void *result = 0; - if (0 <= index && index < lister_data->options.count){ - i32 counter = 0; - for (Lister_Node *node = lister_data->options.first; - node != 0; - node = node->next, counter += 1){ - if (counter == index){ - result = node->user_data; - break; - } - } - } - return(result); -} - -static void -lister_call_refresh_handler(Application_Links *app, Lister *lister){ - if (lister->data.handlers.refresh != 0){ - lister->data.handlers.refresh(app, lister); - } -} - -static void -lister_default(Application_Links *app, Heap *heap, View_ID view, Lister_State *state, Lister_Activation_Code code){ - switch (code){ - case ListerActivation_Finished: - { - - }break; - - case ListerActivation_Continue: - {}break; - - case ListerActivation_ContinueAndRefresh: - { - state->item_index = 0; - lister_call_refresh_handler(app, &state->lister); - lister_update_ui(app, view, state); - }break; - } -} - -static Lister_Activation_Code -lister_call_activate_handler(Application_Links *app, Heap *heap, View_ID view, Lister_State *state, void *user_data, b32 activated_by_mouse){ - Lister_Activation_Code result = ListerActivation_Finished; - Lister_Data *lister = &state->lister.data; - if (lister->handlers.activate != 0){ - result = lister->handlers.activate(app, heap, view, state, lister->text_field.string, user_data, activated_by_mouse); - } - else{ - lister_default(app, heap, view, state, ListerActivation_Finished); - } - return(result); -} - -static void -lister_set_string(String_Const_u8 string, String_u8 *target){ - target->size = 0; - string_append(target, string); -} -static void -lister_append_string(String_Const_u8 string, String_u8 *target){ - string_append(target, string); -} - -static void -lister_set_query(Lister_Data *lister, String_Const_u8 string){ - lister_set_string(string, &lister->query); -} -static void -lister_set_query(Lister_Data *lister, char *string){ - lister_set_string(SCu8(string), &lister->query); -} -static void -lister_set_text_field(Lister_Data *lister, String_Const_u8 string){ - lister_set_string(string, &lister->text_field); -} -static void -lister_set_text_field(Lister_Data *lister, char *string){ - lister_set_string(SCu8(string), &lister->text_field); -} -static void -lister_set_key(Lister_Data *lister, String_Const_u8 string){ - lister_set_string(string, &lister->key_string); -} -static void -lister_set_key(Lister_Data *lister, char *string){ - lister_set_string(SCu8(string), &lister->key_string); -} - -static void -lister_set_query(Lister *lister, String_Const_u8 string){ - lister_set_query(&lister->data, string); -} -static void -lister_set_query(Lister *lister, char *string){ - lister_set_query(&lister->data, string); -} -static void -lister_set_text_field(Lister *lister, String_Const_u8 string){ - lister_set_text_field(&lister->data, string); -} -static void -lister_set_text_field(Lister *lister, char *string){ - lister_set_text_field(&lister->data, string); -} -static void -lister_set_key(Lister *lister, String_Const_u8 string){ - lister_set_key(&lister->data, string); -} -static void -lister_set_key(Lister *lister, char *string){ - lister_set_key(&lister->data, string); -} - -static void -lister_append_query(Lister_Data *lister, String_Const_u8 string){ - lister_append_string(string, &lister->query); -} -static void -lister_append_query(Lister_Data *lister, char *string){ - lister_append_string(SCu8(string), &lister->query); -} -static void -lister_append_text_field(Lister_Data *lister, String_Const_u8 string){ - lister_append_string(string, &lister->text_field); -} -static void -lister_append_text_field(Lister_Data *lister, char *string){ - lister_append_string(SCu8(string), &lister->text_field); -} -static void -lister_append_key(Lister_Data *lister, String_Const_u8 string){ - lister_append_string(string, &lister->key_string); -} -static void -lister_append_key(Lister_Data *lister, char *string){ - lister_append_string(SCu8(string), &lister->key_string); -} - -static void -lister_append_query(Lister *lister, String_Const_u8 string){ - lister_append_query(&lister->data, string); -} -static void -lister_append_query(Lister *lister, char *string){ - lister_append_query(&lister->data, string); -} -static void -lister_append_text_field(Lister *lister, String_Const_u8 string){ - lister_append_text_field(&lister->data, string); -} -static void -lister_append_text_field(Lister *lister, char *string){ - lister_append_text_field(&lister->data, string); -} -static void -lister_append_key(Lister *lister, String_Const_u8 string){ - lister_append_key(&lister->data, string); -} -static void -lister_append_key(Lister *lister, char *string){ - lister_append_key(&lister->data, string); -} - -// BOTTOM - diff --git a/custom/generated/command_metadata.h b/custom/generated/command_metadata.h index f0cf0838..3d973f34 100644 --- a/custom/generated/command_metadata.h +++ b/custom/generated/command_metadata.h @@ -2,7 +2,7 @@ #define command_id(c) (fcoder_metacmd_ID_##c) #define command_metadata(c) (&fcoder_metacmd_table[command_id(c)]) #define command_metadata_by_id(id) (&fcoder_metacmd_table[id]) -#define command_one_past_last_id 210 +#define command_one_past_last_id 208 #if defined(CUSTOM_COMMAND_SIG) #define PROC_LINKS(x,y) x #else @@ -164,8 +164,6 @@ CUSTOM_COMMAND_SIG(goto_first_jump_same_panel_sticky); CUSTOM_COMMAND_SIG(if_read_only_goto_position); CUSTOM_COMMAND_SIG(if_read_only_goto_position_same_panel); CUSTOM_COMMAND_SIG(view_jump_list_with_lister); -CUSTOM_COMMAND_SIG(log_graph__escape); -CUSTOM_COMMAND_SIG(log_graph__scroll_wheel); CUSTOM_COMMAND_SIG(show_the_log_graph); CUSTOM_COMMAND_SIG(copy); CUSTOM_COMMAND_SIG(cut); @@ -230,27 +228,27 @@ char *source_name; i32 source_name_len; i32 line_number; }; -static Command_Metadata fcoder_metacmd_table[210] = { +static Command_Metadata fcoder_metacmd_table[208] = { { PROC_LINKS(default_view_input_handler, 0), "default_view_input_handler", 26, "Input consumption loop for base view behavior", 45, "w:\\4ed\\code\\custom\\4coder_default_hooks.cpp", 43, 17 }, -{ PROC_LINKS(seek_beginning_of_textual_line, 0), "seek_beginning_of_textual_line", 30, "Seeks the cursor to the beginning of the line across all text.", 62, "w:\\4ed\\code\\custom\\4coder_helper.cpp", 36, 1984 }, -{ PROC_LINKS(seek_end_of_textual_line, 0), "seek_end_of_textual_line", 24, "Seeks the cursor to the end of the line across all text.", 56, "w:\\4ed\\code\\custom\\4coder_helper.cpp", 36, 1990 }, -{ PROC_LINKS(seek_beginning_of_line, 0), "seek_beginning_of_line", 22, "Seeks the cursor to the beginning of the visual line.", 53, "w:\\4ed\\code\\custom\\4coder_helper.cpp", 36, 1996 }, -{ PROC_LINKS(seek_end_of_line, 0), "seek_end_of_line", 16, "Seeks the cursor to the end of the visual line.", 47, "w:\\4ed\\code\\custom\\4coder_helper.cpp", 36, 2002 }, -{ PROC_LINKS(goto_beginning_of_file, 0), "goto_beginning_of_file", 22, "Sets the cursor to the beginning of the file.", 45, "w:\\4ed\\code\\custom\\4coder_helper.cpp", 36, 2008 }, -{ PROC_LINKS(goto_end_of_file, 0), "goto_end_of_file", 16, "Sets the cursor to the end of the file.", 39, "w:\\4ed\\code\\custom\\4coder_helper.cpp", 36, 2016 }, +{ PROC_LINKS(seek_beginning_of_textual_line, 0), "seek_beginning_of_textual_line", 30, "Seeks the cursor to the beginning of the line across all text.", 62, "w:\\4ed\\code\\custom\\4coder_helper.cpp", 36, 1978 }, +{ PROC_LINKS(seek_end_of_textual_line, 0), "seek_end_of_textual_line", 24, "Seeks the cursor to the end of the line across all text.", 56, "w:\\4ed\\code\\custom\\4coder_helper.cpp", 36, 1984 }, +{ PROC_LINKS(seek_beginning_of_line, 0), "seek_beginning_of_line", 22, "Seeks the cursor to the beginning of the visual line.", 53, "w:\\4ed\\code\\custom\\4coder_helper.cpp", 36, 1990 }, +{ PROC_LINKS(seek_end_of_line, 0), "seek_end_of_line", 16, "Seeks the cursor to the end of the visual line.", 47, "w:\\4ed\\code\\custom\\4coder_helper.cpp", 36, 1996 }, +{ PROC_LINKS(goto_beginning_of_file, 0), "goto_beginning_of_file", 22, "Sets the cursor to the beginning of the file.", 45, "w:\\4ed\\code\\custom\\4coder_helper.cpp", 36, 2002 }, +{ PROC_LINKS(goto_end_of_file, 0), "goto_end_of_file", 16, "Sets the cursor to the end of the file.", 39, "w:\\4ed\\code\\custom\\4coder_helper.cpp", 36, 2010 }, { PROC_LINKS(change_active_panel, 0), "change_active_panel", 19, "Change the currently active panel, moving to the panel with the next highest view_id.", 85, "w:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 196 }, { PROC_LINKS(change_active_panel_backwards, 0), "change_active_panel_backwards", 29, "Change the currently active panel, moving to the panel with the next lowest view_id.", 84, "w:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 206 }, { PROC_LINKS(open_panel_vsplit, 0), "open_panel_vsplit", 17, "Create a new panel by vertically splitting the active panel.", 60, "w:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 216 }, { PROC_LINKS(open_panel_hsplit, 0), "open_panel_hsplit", 17, "Create a new panel by horizontally splitting the active panel.", 62, "w:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 226 }, -{ PROC_LINKS(suppress_mouse, 0), "suppress_mouse", 14, "Hides the mouse and causes all mosue input (clicks, position, wheel) to be ignored.", 83, "w:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 289 }, -{ PROC_LINKS(allow_mouse, 0), "allow_mouse", 11, "Shows the mouse and causes all mouse input to be processed normally.", 68, "w:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 295 }, -{ PROC_LINKS(toggle_mouse, 0), "toggle_mouse", 12, "Toggles the mouse suppression mode, see suppress_mouse and allow_mouse.", 71, "w:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 301 }, -{ PROC_LINKS(set_mode_to_original, 0), "set_mode_to_original", 20, "Sets the edit mode to 4coder original.", 38, "w:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 307 }, -{ PROC_LINKS(set_mode_to_notepad_like, 0), "set_mode_to_notepad_like", 24, "Sets the edit mode to Notepad like.", 35, "w:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 313 }, -{ PROC_LINKS(toggle_highlight_line_at_cursor, 0), "toggle_highlight_line_at_cursor", 31, "Toggles the line highlight at the cursor.", 41, "w:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 319 }, -{ PROC_LINKS(toggle_highlight_enclosing_scopes, 0), "toggle_highlight_enclosing_scopes", 33, "In code files scopes surrounding the cursor are highlighted with distinguishing colors.", 87, "w:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 325 }, -{ PROC_LINKS(toggle_paren_matching_helper, 0), "toggle_paren_matching_helper", 28, "In code files matching parentheses pairs are colored with distinguishing colors.", 80, "w:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 331 }, -{ PROC_LINKS(toggle_fullscreen, 0), "toggle_fullscreen", 17, "Toggle fullscreen mode on or off. The change(s) do not take effect until the next frame.", 89, "w:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 337 }, +{ PROC_LINKS(suppress_mouse, 0), "suppress_mouse", 14, "Hides the mouse and causes all mosue input (clicks, position, wheel) to be ignored.", 83, "w:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 291 }, +{ PROC_LINKS(allow_mouse, 0), "allow_mouse", 11, "Shows the mouse and causes all mouse input to be processed normally.", 68, "w:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 297 }, +{ PROC_LINKS(toggle_mouse, 0), "toggle_mouse", 12, "Toggles the mouse suppression mode, see suppress_mouse and allow_mouse.", 71, "w:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 303 }, +{ PROC_LINKS(set_mode_to_original, 0), "set_mode_to_original", 20, "Sets the edit mode to 4coder original.", 38, "w:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 309 }, +{ PROC_LINKS(set_mode_to_notepad_like, 0), "set_mode_to_notepad_like", 24, "Sets the edit mode to Notepad like.", 35, "w:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 315 }, +{ PROC_LINKS(toggle_highlight_line_at_cursor, 0), "toggle_highlight_line_at_cursor", 31, "Toggles the line highlight at the cursor.", 41, "w:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 321 }, +{ PROC_LINKS(toggle_highlight_enclosing_scopes, 0), "toggle_highlight_enclosing_scopes", 33, "In code files scopes surrounding the cursor are highlighted with distinguishing colors.", 87, "w:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 327 }, +{ PROC_LINKS(toggle_paren_matching_helper, 0), "toggle_paren_matching_helper", 28, "In code files matching parentheses pairs are colored with distinguishing colors.", 80, "w:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 333 }, +{ PROC_LINKS(toggle_fullscreen, 0), "toggle_fullscreen", 17, "Toggle fullscreen mode on or off. The change(s) do not take effect until the next frame.", 89, "w:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 339 }, { PROC_LINKS(write_text_input, 0), "write_text_input", 16, "Inserts whatever character was used to trigger this command.", 60, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 58 }, { PROC_LINKS(write_space, 0), "write_space", 11, "Inserts an underscore.", 22, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 66 }, { PROC_LINKS(write_underscore, 0), "write_underscore", 16, "Inserts an underscore.", 22, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 72 }, @@ -266,100 +264,100 @@ static Command_Metadata fcoder_metacmd_table[210] = { { PROC_LINKS(center_view, 0), "center_view", 11, "Centers the view vertically on the line on which the cursor sits.", 65, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 199 }, { PROC_LINKS(left_adjust_view, 0), "left_adjust_view", 16, "Sets the left size of the view near the x position of the cursor.", 65, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 213 }, { PROC_LINKS(click_set_cursor_and_mark, 0), "click_set_cursor_and_mark", 25, "Sets the cursor position and mark to the mouse position.", 56, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 225 }, -{ PROC_LINKS(click_set_cursor, 0), "click_set_cursor", 16, "Sets the cursor position to the mouse position.", 47, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 237 }, -{ PROC_LINKS(click_set_cursor_if_lbutton, 0), "click_set_cursor_if_lbutton", 27, "If the mouse left button is pressed, sets the cursor position to the mouse position.", 84, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 249 }, -{ PROC_LINKS(click_set_mark, 0), "click_set_mark", 14, "Sets the mark position to the mouse position.", 45, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 263 }, -{ PROC_LINKS(mouse_wheel_scroll, 0), "mouse_wheel_scroll", 18, "Reads the scroll wheel value from the mouse state and scrolls accordingly.", 74, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 275 }, -{ PROC_LINKS(move_up, 0), "move_up", 7, "Moves the cursor up one line.", 29, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 336 }, -{ PROC_LINKS(move_down, 0), "move_down", 9, "Moves the cursor down one line.", 31, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 342 }, -{ PROC_LINKS(move_up_10, 0), "move_up_10", 10, "Moves the cursor up ten lines.", 30, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 348 }, -{ PROC_LINKS(move_down_10, 0), "move_down_10", 12, "Moves the cursor down ten lines.", 32, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 354 }, -{ PROC_LINKS(move_down_textual, 0), "move_down_textual", 17, "Moves down to the next line of actual text, regardless of line wrapping.", 72, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 360 }, -{ PROC_LINKS(page_up, 0), "page_up", 7, "Scrolls the view up one view height and moves the cursor up one view height.", 76, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 370 }, -{ PROC_LINKS(page_down, 0), "page_down", 9, "Scrolls the view down one view height and moves the cursor down one view height.", 80, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 378 }, -{ PROC_LINKS(move_up_to_blank_line, 0), "move_up_to_blank_line", 21, "Seeks the cursor up to the next blank line.", 43, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 408 }, -{ PROC_LINKS(move_down_to_blank_line, 0), "move_down_to_blank_line", 23, "Seeks the cursor down to the next blank line.", 45, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 414 }, -{ PROC_LINKS(move_up_to_blank_line_skip_whitespace, 0), "move_up_to_blank_line_skip_whitespace", 37, "Seeks the cursor up to the next blank line and places it at the end of the line.", 80, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 420 }, -{ PROC_LINKS(move_down_to_blank_line_skip_whitespace, 0), "move_down_to_blank_line_skip_whitespace", 39, "Seeks the cursor down to the next blank line and places it at the end of the line.", 82, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 426 }, -{ PROC_LINKS(move_up_to_blank_line_end, 0), "move_up_to_blank_line_end", 25, "Seeks the cursor up to the next blank line and places it at the end of the line.", 80, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 432 }, -{ PROC_LINKS(move_down_to_blank_line_end, 0), "move_down_to_blank_line_end", 27, "Seeks the cursor down to the next blank line and places it at the end of the line.", 82, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 438 }, -{ PROC_LINKS(move_left, 0), "move_left", 9, "Moves the cursor one character to the left.", 43, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 444 }, -{ PROC_LINKS(move_right, 0), "move_right", 10, "Moves the cursor one character to the right.", 44, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 456 }, -{ PROC_LINKS(move_right_whitespace_boundary, 0), "move_right_whitespace_boundary", 30, "Seek right for the next boundary between whitespace and non-whitespace.", 71, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 478 }, -{ PROC_LINKS(move_left_whitespace_boundary, 0), "move_left_whitespace_boundary", 29, "Seek left for the next boundary between whitespace and non-whitespace.", 70, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 486 }, -{ PROC_LINKS(move_right_token_boundary, 0), "move_right_token_boundary", 25, "Seek right for the next end of a token.", 39, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 494 }, -{ PROC_LINKS(move_left_token_boundary, 0), "move_left_token_boundary", 24, "Seek left for the next beginning of a token.", 44, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 502 }, -{ PROC_LINKS(move_right_whitespace_or_token_boundary, 0), "move_right_whitespace_or_token_boundary", 39, "Seek right for the next end of a token or boundary between whitespace and non-whitespace.", 89, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 510 }, -{ PROC_LINKS(move_left_whitespace_or_token_boundary, 0), "move_left_whitespace_or_token_boundary", 38, "Seek left for the next end of a token or boundary between whitespace and non-whitespace.", 88, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 518 }, -{ PROC_LINKS(move_right_alpha_numeric_boundary, 0), "move_right_alpha_numeric_boundary", 33, "Seek right for boundary between alphanumeric characters and non-alphanumeric characters.", 88, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 526 }, -{ PROC_LINKS(move_left_alpha_numeric_boundary, 0), "move_left_alpha_numeric_boundary", 32, "Seek left for boundary between alphanumeric characters and non-alphanumeric characters.", 87, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 534 }, -{ PROC_LINKS(move_right_alpha_numeric_or_camel_boundary, 0), "move_right_alpha_numeric_or_camel_boundary", 42, "Seek right for boundary between alphanumeric characters or camel case word and non-alphanumeric characters.", 107, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 542 }, -{ PROC_LINKS(move_left_alpha_numeric_or_camel_boundary, 0), "move_left_alpha_numeric_or_camel_boundary", 41, "Seek left for boundary between alphanumeric characters or camel case word and non-alphanumeric characters.", 106, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 550 }, -{ PROC_LINKS(select_all, 0), "select_all", 10, "Puts the cursor at the top of the file, and the mark at the bottom of the file.", 79, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 560 }, -{ PROC_LINKS(to_uppercase, 0), "to_uppercase", 12, "Converts all ascii text in the range between the cursor and the mark to uppercase.", 82, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 573 }, -{ PROC_LINKS(to_lowercase, 0), "to_lowercase", 12, "Converts all ascii text in the range between the cursor and the mark to lowercase.", 82, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 586 }, -{ PROC_LINKS(clean_all_lines, 0), "clean_all_lines", 15, "Removes trailing whitespace from all lines in the current buffer.", 65, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 599 }, -{ PROC_LINKS(basic_change_active_panel, 0), "basic_change_active_panel", 25, "Change the currently active panel, moving to the panel with the next highest view_id. Will not skipe the build panel if it is open.", 132, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 633 }, -{ PROC_LINKS(close_panel, 0), "close_panel", 11, "Closes the currently active panel if it is not the only panel open.", 67, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 641 }, -{ PROC_LINKS(show_scrollbar, 0), "show_scrollbar", 14, "Sets the current view to show it's scrollbar.", 45, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 650 }, -{ PROC_LINKS(hide_scrollbar, 0), "hide_scrollbar", 14, "Sets the current view to hide it's scrollbar.", 45, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 657 }, -{ PROC_LINKS(show_filebar, 0), "show_filebar", 12, "Sets the current view to show it's filebar.", 43, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 664 }, -{ PROC_LINKS(hide_filebar, 0), "hide_filebar", 12, "Sets the current view to hide it's filebar.", 43, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 671 }, -{ PROC_LINKS(toggle_filebar, 0), "toggle_filebar", 14, "Toggles the visibility status of the current view's filebar.", 60, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 678 }, -{ PROC_LINKS(toggle_fps_meter, 0), "toggle_fps_meter", 16, "Toggles the visibility of the FPS performance meter", 51, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 687 }, -{ PROC_LINKS(increase_face_size, 0), "increase_face_size", 18, "Increase the size of the face used by the current buffer.", 57, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 693 }, -{ PROC_LINKS(decrease_face_size, 0), "decrease_face_size", 18, "Decrease the size of the face used by the current buffer.", 57, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 704 }, -{ PROC_LINKS(mouse_wheel_change_face_size, 0), "mouse_wheel_change_face_size", 28, "Reads the state of the mouse wheel and uses it to either increase or decrease the face size.", 92, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 715 }, -{ PROC_LINKS(toggle_virtual_whitespace, 0), "toggle_virtual_whitespace", 25, "Toggles the current buffer's virtual whitespace status.", 55, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 732 }, -{ PROC_LINKS(toggle_show_whitespace, 0), "toggle_show_whitespace", 22, "Toggles the current buffer's whitespace visibility status.", 58, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 741 }, -{ PROC_LINKS(toggle_line_numbers, 0), "toggle_line_numbers", 19, "Toggles the left margin line numbers.", 37, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 750 }, -{ PROC_LINKS(eol_dosify, 0), "eol_dosify", 10, "Puts the buffer in DOS line ending mode.", 40, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 756 }, -{ PROC_LINKS(eol_nixify, 0), "eol_nixify", 10, "Puts the buffer in NIX line ending mode.", 40, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 764 }, -{ PROC_LINKS(exit_4coder, 0), "exit_4coder", 11, "Attempts to close 4coder.", 25, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 772 }, -{ PROC_LINKS(goto_line, 0), "goto_line", 9, "Queries the user for a number, and jumps the cursor to the corresponding line.", 78, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 780 }, -{ PROC_LINKS(search, 0), "search", 6, "Begins an incremental search down through the current buffer for a user specified string.", 89, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1009 }, -{ PROC_LINKS(reverse_search, 0), "reverse_search", 14, "Begins an incremental search up through the current buffer for a user specified string.", 87, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1015 }, -{ PROC_LINKS(search_identifier, 0), "search_identifier", 17, "Begins an incremental search down through the current buffer for the word or token under the cursor.", 100, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1021 }, -{ PROC_LINKS(reverse_search_identifier, 0), "reverse_search_identifier", 25, "Begins an incremental search up through the current buffer for the word or token under the cursor.", 98, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1027 }, -{ PROC_LINKS(replace_in_range, 0), "replace_in_range", 16, "Queries the user for a needle and string. Replaces all occurences of needle with string in the range between cursor and the mark in the active buffer.", 150, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1074 }, -{ PROC_LINKS(replace_in_buffer, 0), "replace_in_buffer", 17, "Queries the user for a needle and string. Replaces all occurences of needle with string in the active buffer.", 109, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1083 }, -{ PROC_LINKS(replace_in_all_buffers, 0), "replace_in_all_buffers", 22, "Queries the user for a needle and string. Replaces all occurences of needle with string in all editable buffers.", 112, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1092 }, -{ PROC_LINKS(query_replace, 0), "query_replace", 13, "Queries the user for two strings, and incrementally replaces every occurence of the first string with the second string.", 120, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1184 }, -{ PROC_LINKS(query_replace_identifier, 0), "query_replace_identifier", 24, "Queries the user for a string, and incrementally replace every occurence of the word or token found at the cursor with the specified string.", 140, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1205 }, -{ PROC_LINKS(query_replace_selection, 0), "query_replace_selection", 23, "Queries the user for a string, and incrementally replace every occurence of the string found in the selected range with the specified string.", 141, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1221 }, -{ PROC_LINKS(save_all_dirty_buffers, 0), "save_all_dirty_buffers", 22, "Saves all buffers marked dirty (showing the '*' indicator).", 59, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1256 }, -{ PROC_LINKS(delete_file_query, 0), "delete_file_query", 17, "Deletes the file of the current buffer if 4coder has the appropriate access rights. Will ask the user for confirmation first.", 125, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1281 }, -{ PROC_LINKS(save_to_query, 0), "save_to_query", 13, "Queries the user for a file name and saves the contents of the current buffer, altering the buffer's name too.", 110, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1325 }, -{ PROC_LINKS(rename_file_query, 0), "rename_file_query", 17, "Queries the user for a new name and renames the file of the current buffer, altering the buffer's name too.", 107, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1358 }, -{ PROC_LINKS(make_directory_query, 0), "make_directory_query", 20, "Queries the user for a name and creates a new directory with the given name.", 76, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1396 }, -{ PROC_LINKS(move_line_up, 0), "move_line_up", 12, "Swaps the line under the cursor with the line above it, and moves the cursor up with it.", 88, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1430 }, -{ PROC_LINKS(move_line_down, 0), "move_line_down", 14, "Swaps the line under the cursor with the line below it, and moves the cursor down with it.", 90, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1436 }, -{ PROC_LINKS(duplicate_line, 0), "duplicate_line", 14, "Create a copy of the line on which the cursor sits.", 51, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1442 }, -{ PROC_LINKS(delete_line, 0), "delete_line", 11, "Delete the line the on which the cursor sits.", 45, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1456 }, -{ PROC_LINKS(open_file_in_quotes, 0), "open_file_in_quotes", 19, "Reads a filename from surrounding '\"' characters and attempts to open the corresponding file.", 94, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1521 }, -{ PROC_LINKS(open_matching_file_cpp, 0), "open_matching_file_cpp", 22, "If the current file is a *.cpp or *.h, attempts to open the corresponding *.h or *.cpp file in the other view.", 110, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1553 }, -{ PROC_LINKS(view_buffer_other_panel, 0), "view_buffer_other_panel", 23, "Set the other non-active panel to view the buffer that the active panel views, and switch to that panel.", 104, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1566 }, -{ PROC_LINKS(swap_buffers_between_panels, 0), "swap_buffers_between_panels", 27, "Set the other non-active panel to view the buffer that the active panel views, and switch to that panel.", 104, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1578 }, -{ PROC_LINKS(kill_buffer, 0), "kill_buffer", 11, "Kills the current buffer.", 25, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1614 }, -{ PROC_LINKS(save, 0), "save", 4, "Saves the current buffer.", 25, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1622 }, -{ PROC_LINKS(reopen, 0), "reopen", 6, "Reopen the current buffer from the hard drive.", 46, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1632 }, -{ PROC_LINKS(undo, 0), "undo", 4, "Advances backwards through the undo history of the current buffer.", 66, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1861 }, -{ PROC_LINKS(redo, 0), "redo", 4, "Advances forwards through the undo history of the current buffer.", 65, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1874 }, -{ PROC_LINKS(undo_all_buffers, 0), "undo_all_buffers", 16, "Advances backward through the undo history in the buffer containing the most recent regular edit.", 97, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1888 }, -{ PROC_LINKS(redo_all_buffers, 0), "redo_all_buffers", 16, "Advances forward through the undo history in the buffer containing the most recent regular edit.", 96, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1959 }, -{ PROC_LINKS(open_in_other, 0), "open_in_other", 13, "Interactively opens a file in the other panel.", 46, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 2060 }, +{ PROC_LINKS(click_set_cursor, 0), "click_set_cursor", 16, "Sets the cursor position to the mouse position.", 47, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 235 }, +{ PROC_LINKS(click_set_cursor_if_lbutton, 0), "click_set_cursor_if_lbutton", 27, "If the mouse left button is pressed, sets the cursor position to the mouse position.", 84, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 245 }, +{ PROC_LINKS(click_set_mark, 0), "click_set_mark", 14, "Sets the mark position to the mouse position.", 45, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 257 }, +{ PROC_LINKS(mouse_wheel_scroll, 0), "mouse_wheel_scroll", 18, "Reads the scroll wheel value from the mouse state and scrolls accordingly.", 74, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 267 }, +{ PROC_LINKS(move_up, 0), "move_up", 7, "Moves the cursor up one line.", 29, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 321 }, +{ PROC_LINKS(move_down, 0), "move_down", 9, "Moves the cursor down one line.", 31, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 327 }, +{ PROC_LINKS(move_up_10, 0), "move_up_10", 10, "Moves the cursor up ten lines.", 30, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 333 }, +{ PROC_LINKS(move_down_10, 0), "move_down_10", 12, "Moves the cursor down ten lines.", 32, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 339 }, +{ PROC_LINKS(move_down_textual, 0), "move_down_textual", 17, "Moves down to the next line of actual text, regardless of line wrapping.", 72, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 345 }, +{ PROC_LINKS(page_up, 0), "page_up", 7, "Scrolls the view up one view height and moves the cursor up one view height.", 76, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 355 }, +{ PROC_LINKS(page_down, 0), "page_down", 9, "Scrolls the view down one view height and moves the cursor down one view height.", 80, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 363 }, +{ PROC_LINKS(move_up_to_blank_line, 0), "move_up_to_blank_line", 21, "Seeks the cursor up to the next blank line.", 43, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 393 }, +{ PROC_LINKS(move_down_to_blank_line, 0), "move_down_to_blank_line", 23, "Seeks the cursor down to the next blank line.", 45, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 399 }, +{ PROC_LINKS(move_up_to_blank_line_skip_whitespace, 0), "move_up_to_blank_line_skip_whitespace", 37, "Seeks the cursor up to the next blank line and places it at the end of the line.", 80, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 405 }, +{ PROC_LINKS(move_down_to_blank_line_skip_whitespace, 0), "move_down_to_blank_line_skip_whitespace", 39, "Seeks the cursor down to the next blank line and places it at the end of the line.", 82, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 411 }, +{ PROC_LINKS(move_up_to_blank_line_end, 0), "move_up_to_blank_line_end", 25, "Seeks the cursor up to the next blank line and places it at the end of the line.", 80, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 417 }, +{ PROC_LINKS(move_down_to_blank_line_end, 0), "move_down_to_blank_line_end", 27, "Seeks the cursor down to the next blank line and places it at the end of the line.", 82, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 423 }, +{ PROC_LINKS(move_left, 0), "move_left", 9, "Moves the cursor one character to the left.", 43, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 429 }, +{ PROC_LINKS(move_right, 0), "move_right", 10, "Moves the cursor one character to the right.", 44, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 441 }, +{ PROC_LINKS(move_right_whitespace_boundary, 0), "move_right_whitespace_boundary", 30, "Seek right for the next boundary between whitespace and non-whitespace.", 71, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 463 }, +{ PROC_LINKS(move_left_whitespace_boundary, 0), "move_left_whitespace_boundary", 29, "Seek left for the next boundary between whitespace and non-whitespace.", 70, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 471 }, +{ PROC_LINKS(move_right_token_boundary, 0), "move_right_token_boundary", 25, "Seek right for the next end of a token.", 39, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 479 }, +{ PROC_LINKS(move_left_token_boundary, 0), "move_left_token_boundary", 24, "Seek left for the next beginning of a token.", 44, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 487 }, +{ PROC_LINKS(move_right_whitespace_or_token_boundary, 0), "move_right_whitespace_or_token_boundary", 39, "Seek right for the next end of a token or boundary between whitespace and non-whitespace.", 89, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 495 }, +{ PROC_LINKS(move_left_whitespace_or_token_boundary, 0), "move_left_whitespace_or_token_boundary", 38, "Seek left for the next end of a token or boundary between whitespace and non-whitespace.", 88, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 503 }, +{ PROC_LINKS(move_right_alpha_numeric_boundary, 0), "move_right_alpha_numeric_boundary", 33, "Seek right for boundary between alphanumeric characters and non-alphanumeric characters.", 88, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 511 }, +{ PROC_LINKS(move_left_alpha_numeric_boundary, 0), "move_left_alpha_numeric_boundary", 32, "Seek left for boundary between alphanumeric characters and non-alphanumeric characters.", 87, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 519 }, +{ PROC_LINKS(move_right_alpha_numeric_or_camel_boundary, 0), "move_right_alpha_numeric_or_camel_boundary", 42, "Seek right for boundary between alphanumeric characters or camel case word and non-alphanumeric characters.", 107, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 527 }, +{ PROC_LINKS(move_left_alpha_numeric_or_camel_boundary, 0), "move_left_alpha_numeric_or_camel_boundary", 41, "Seek left for boundary between alphanumeric characters or camel case word and non-alphanumeric characters.", 106, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 535 }, +{ PROC_LINKS(select_all, 0), "select_all", 10, "Puts the cursor at the top of the file, and the mark at the bottom of the file.", 79, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 545 }, +{ PROC_LINKS(to_uppercase, 0), "to_uppercase", 12, "Converts all ascii text in the range between the cursor and the mark to uppercase.", 82, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 558 }, +{ PROC_LINKS(to_lowercase, 0), "to_lowercase", 12, "Converts all ascii text in the range between the cursor and the mark to lowercase.", 82, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 571 }, +{ PROC_LINKS(clean_all_lines, 0), "clean_all_lines", 15, "Removes trailing whitespace from all lines in the current buffer.", 65, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 584 }, +{ PROC_LINKS(basic_change_active_panel, 0), "basic_change_active_panel", 25, "Change the currently active panel, moving to the panel with the next highest view_id. Will not skipe the build panel if it is open.", 132, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 618 }, +{ PROC_LINKS(close_panel, 0), "close_panel", 11, "Closes the currently active panel if it is not the only panel open.", 67, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 626 }, +{ PROC_LINKS(show_scrollbar, 0), "show_scrollbar", 14, "Sets the current view to show it's scrollbar.", 45, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 635 }, +{ PROC_LINKS(hide_scrollbar, 0), "hide_scrollbar", 14, "Sets the current view to hide it's scrollbar.", 45, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 642 }, +{ PROC_LINKS(show_filebar, 0), "show_filebar", 12, "Sets the current view to show it's filebar.", 43, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 649 }, +{ PROC_LINKS(hide_filebar, 0), "hide_filebar", 12, "Sets the current view to hide it's filebar.", 43, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 656 }, +{ PROC_LINKS(toggle_filebar, 0), "toggle_filebar", 14, "Toggles the visibility status of the current view's filebar.", 60, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 663 }, +{ PROC_LINKS(toggle_fps_meter, 0), "toggle_fps_meter", 16, "Toggles the visibility of the FPS performance meter", 51, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 672 }, +{ PROC_LINKS(increase_face_size, 0), "increase_face_size", 18, "Increase the size of the face used by the current buffer.", 57, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 678 }, +{ PROC_LINKS(decrease_face_size, 0), "decrease_face_size", 18, "Decrease the size of the face used by the current buffer.", 57, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 689 }, +{ PROC_LINKS(mouse_wheel_change_face_size, 0), "mouse_wheel_change_face_size", 28, "Reads the state of the mouse wheel and uses it to either increase or decrease the face size.", 92, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 700 }, +{ PROC_LINKS(toggle_virtual_whitespace, 0), "toggle_virtual_whitespace", 25, "Toggles the current buffer's virtual whitespace status.", 55, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 717 }, +{ PROC_LINKS(toggle_show_whitespace, 0), "toggle_show_whitespace", 22, "Toggles the current buffer's whitespace visibility status.", 58, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 726 }, +{ PROC_LINKS(toggle_line_numbers, 0), "toggle_line_numbers", 19, "Toggles the left margin line numbers.", 37, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 735 }, +{ PROC_LINKS(eol_dosify, 0), "eol_dosify", 10, "Puts the buffer in DOS line ending mode.", 40, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 741 }, +{ PROC_LINKS(eol_nixify, 0), "eol_nixify", 10, "Puts the buffer in NIX line ending mode.", 40, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 749 }, +{ PROC_LINKS(exit_4coder, 0), "exit_4coder", 11, "Attempts to close 4coder.", 25, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 757 }, +{ PROC_LINKS(goto_line, 0), "goto_line", 9, "Queries the user for a number, and jumps the cursor to the corresponding line.", 78, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 765 }, +{ PROC_LINKS(search, 0), "search", 6, "Begins an incremental search down through the current buffer for a user specified string.", 89, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 994 }, +{ PROC_LINKS(reverse_search, 0), "reverse_search", 14, "Begins an incremental search up through the current buffer for a user specified string.", 87, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1000 }, +{ PROC_LINKS(search_identifier, 0), "search_identifier", 17, "Begins an incremental search down through the current buffer for the word or token under the cursor.", 100, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1006 }, +{ PROC_LINKS(reverse_search_identifier, 0), "reverse_search_identifier", 25, "Begins an incremental search up through the current buffer for the word or token under the cursor.", 98, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1012 }, +{ PROC_LINKS(replace_in_range, 0), "replace_in_range", 16, "Queries the user for a needle and string. Replaces all occurences of needle with string in the range between cursor and the mark in the active buffer.", 150, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1059 }, +{ PROC_LINKS(replace_in_buffer, 0), "replace_in_buffer", 17, "Queries the user for a needle and string. Replaces all occurences of needle with string in the active buffer.", 109, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1068 }, +{ PROC_LINKS(replace_in_all_buffers, 0), "replace_in_all_buffers", 22, "Queries the user for a needle and string. Replaces all occurences of needle with string in all editable buffers.", 112, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1077 }, +{ PROC_LINKS(query_replace, 0), "query_replace", 13, "Queries the user for two strings, and incrementally replaces every occurence of the first string with the second string.", 120, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1169 }, +{ PROC_LINKS(query_replace_identifier, 0), "query_replace_identifier", 24, "Queries the user for a string, and incrementally replace every occurence of the word or token found at the cursor with the specified string.", 140, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1190 }, +{ PROC_LINKS(query_replace_selection, 0), "query_replace_selection", 23, "Queries the user for a string, and incrementally replace every occurence of the string found in the selected range with the specified string.", 141, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1206 }, +{ PROC_LINKS(save_all_dirty_buffers, 0), "save_all_dirty_buffers", 22, "Saves all buffers marked dirty (showing the '*' indicator).", 59, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1241 }, +{ PROC_LINKS(delete_file_query, 0), "delete_file_query", 17, "Deletes the file of the current buffer if 4coder has the appropriate access rights. Will ask the user for confirmation first.", 125, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1266 }, +{ PROC_LINKS(save_to_query, 0), "save_to_query", 13, "Queries the user for a file name and saves the contents of the current buffer, altering the buffer's name too.", 110, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1310 }, +{ PROC_LINKS(rename_file_query, 0), "rename_file_query", 17, "Queries the user for a new name and renames the file of the current buffer, altering the buffer's name too.", 107, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1343 }, +{ PROC_LINKS(make_directory_query, 0), "make_directory_query", 20, "Queries the user for a name and creates a new directory with the given name.", 76, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1381 }, +{ PROC_LINKS(move_line_up, 0), "move_line_up", 12, "Swaps the line under the cursor with the line above it, and moves the cursor up with it.", 88, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1415 }, +{ PROC_LINKS(move_line_down, 0), "move_line_down", 14, "Swaps the line under the cursor with the line below it, and moves the cursor down with it.", 90, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1421 }, +{ PROC_LINKS(duplicate_line, 0), "duplicate_line", 14, "Create a copy of the line on which the cursor sits.", 51, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1427 }, +{ PROC_LINKS(delete_line, 0), "delete_line", 11, "Delete the line the on which the cursor sits.", 45, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1441 }, +{ PROC_LINKS(open_file_in_quotes, 0), "open_file_in_quotes", 19, "Reads a filename from surrounding '\"' characters and attempts to open the corresponding file.", 94, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1506 }, +{ PROC_LINKS(open_matching_file_cpp, 0), "open_matching_file_cpp", 22, "If the current file is a *.cpp or *.h, attempts to open the corresponding *.h or *.cpp file in the other view.", 110, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1538 }, +{ PROC_LINKS(view_buffer_other_panel, 0), "view_buffer_other_panel", 23, "Set the other non-active panel to view the buffer that the active panel views, and switch to that panel.", 104, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1551 }, +{ PROC_LINKS(swap_buffers_between_panels, 0), "swap_buffers_between_panels", 27, "Set the other non-active panel to view the buffer that the active panel views, and switch to that panel.", 104, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1563 }, +{ PROC_LINKS(kill_buffer, 0), "kill_buffer", 11, "Kills the current buffer.", 25, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1597 }, +{ PROC_LINKS(save, 0), "save", 4, "Saves the current buffer.", 25, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1605 }, +{ PROC_LINKS(reopen, 0), "reopen", 6, "Reopen the current buffer from the hard drive.", 46, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1615 }, +{ PROC_LINKS(undo, 0), "undo", 4, "Advances backwards through the undo history of the current buffer.", 66, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1844 }, +{ PROC_LINKS(redo, 0), "redo", 4, "Advances forwards through the undo history of the current buffer.", 65, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1857 }, +{ PROC_LINKS(undo_all_buffers, 0), "undo_all_buffers", 16, "Advances backward through the undo history in the buffer containing the most recent regular edit.", 97, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1871 }, +{ PROC_LINKS(redo_all_buffers, 0), "redo_all_buffers", 16, "Advances forward through the undo history in the buffer containing the most recent regular edit.", 96, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1942 }, +{ PROC_LINKS(open_in_other, 0), "open_in_other", 13, "Interactively opens a file in the other panel.", 46, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 2043 }, { PROC_LINKS(lister__write_string__default, 0), "lister__write_string__default", 29, "A lister mode command that inserts a new character to the text field.", 69, "w:\\4ed\\code\\custom\\4coder_lists.cpp", 35, 8 }, { PROC_LINKS(lister__backspace_text_field__default, 0), "lister__backspace_text_field__default", 37, "A lister mode command that backspaces one character from the text field.", 72, "w:\\4ed\\code\\custom\\4coder_lists.cpp", 35, 26 }, { PROC_LINKS(lister__move_up__default, 0), "lister__move_up__default", 24, "A lister mode command that moves the highlighted item one up in the list.", 73, "w:\\4ed\\code\\custom\\4coder_lists.cpp", 35, 40 }, { PROC_LINKS(lister__move_down__default, 0), "lister__move_down__default", 26, "A lister mode command that moves the highlighted item one down in the list.", 75, "w:\\4ed\\code\\custom\\4coder_lists.cpp", 35, 55 }, { PROC_LINKS(lister__write_character__file_path, 0), "lister__write_character__file_path", 34, "A lister mode command that inserts a character into the text field of a file system list.", 89, "w:\\4ed\\code\\custom\\4coder_lists.cpp", 35, 70 }, { PROC_LINKS(lister__backspace_text_field__file_path, 0), "lister__backspace_text_field__file_path", 39, "A lister mode command that backspaces one character from the text field of a file system list.", 94, "w:\\4ed\\code\\custom\\4coder_lists.cpp", 35, 94 }, -{ PROC_LINKS(interactive_switch_buffer, 0), "interactive_switch_buffer", 25, "Interactively switch to an open buffer.", 39, "w:\\4ed\\code\\custom\\4coder_lists.cpp", 35, 775 }, -{ PROC_LINKS(interactive_kill_buffer, 0), "interactive_kill_buffer", 23, "Interactively kill an open buffer.", 34, "w:\\4ed\\code\\custom\\4coder_lists.cpp", 35, 795 }, -{ PROC_LINKS(interactive_open_or_new, 0), "interactive_open_or_new", 23, "Interactively open a file out of the file system.", 49, "w:\\4ed\\code\\custom\\4coder_lists.cpp", 35, 867 }, -{ PROC_LINKS(interactive_new, 0), "interactive_new", 15, "Interactively creates a new file.", 33, "w:\\4ed\\code\\custom\\4coder_lists.cpp", 35, 907 }, -{ PROC_LINKS(interactive_open, 0), "interactive_open", 16, "Interactively opens a file.", 27, "w:\\4ed\\code\\custom\\4coder_lists.cpp", 35, 941 }, -{ PROC_LINKS(command_lister, 0), "command_lister", 14, "Opens an interactive list of all registered commands.", 53, "w:\\4ed\\code\\custom\\4coder_lists.cpp", 35, 1022 }, +{ PROC_LINKS(interactive_switch_buffer, 0), "interactive_switch_buffer", 25, "Interactively switch to an open buffer.", 39, "w:\\4ed\\code\\custom\\4coder_lists.cpp", 35, 772 }, +{ PROC_LINKS(interactive_kill_buffer, 0), "interactive_kill_buffer", 23, "Interactively kill an open buffer.", 34, "w:\\4ed\\code\\custom\\4coder_lists.cpp", 35, 791 }, +{ PROC_LINKS(interactive_open_or_new, 0), "interactive_open_or_new", 23, "Interactively open a file out of the file system.", 49, "w:\\4ed\\code\\custom\\4coder_lists.cpp", 35, 862 }, +{ PROC_LINKS(interactive_new, 0), "interactive_new", 15, "Interactively creates a new file.", 33, "w:\\4ed\\code\\custom\\4coder_lists.cpp", 35, 901 }, +{ PROC_LINKS(interactive_open, 0), "interactive_open", 16, "Interactively opens a file.", 27, "w:\\4ed\\code\\custom\\4coder_lists.cpp", 35, 934 }, +{ PROC_LINKS(command_lister, 0), "command_lister", 14, "Opens an interactive list of all registered commands.", 53, "w:\\4ed\\code\\custom\\4coder_lists.cpp", 35, 1013 }, { PROC_LINKS(auto_indent_whole_file, 0), "auto_indent_whole_file", 22, "Audo-indents the entire current buffer.", 39, "w:\\4ed\\code\\custom\\4coder_auto_indent.cpp", 41, 356 }, { PROC_LINKS(auto_indent_line_at_cursor, 0), "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, 365 }, { PROC_LINKS(auto_indent_range, 0), "auto_indent_range", 17, "Auto-indents the range between the cursor and the mark.", 55, "w:\\4ed\\code\\custom\\4coder_auto_indent.cpp", 41, 375 }, @@ -385,10 +383,8 @@ static Command_Metadata fcoder_metacmd_table[210] = { { PROC_LINKS(goto_first_jump_same_panel_sticky, 0), "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), "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), "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), "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, 103 }, -{ PROC_LINKS(log_graph__escape, 0), "log_graph__escape", 17, "Ends the log grapher", 20, "w:\\4ed\\code\\custom\\4coder_log_parser.cpp", 40, 906 }, -{ PROC_LINKS(log_graph__scroll_wheel, 0), "log_graph__scroll_wheel", 23, "Scrolls the log graph", 21, "w:\\4ed\\code\\custom\\4coder_log_parser.cpp", 40, 915 }, -{ PROC_LINKS(show_the_log_graph, 0), "show_the_log_graph", 18, "Parses *log* and displays the 'log graph' UI", 44, "w:\\4ed\\code\\custom\\4coder_log_parser.cpp", 40, 1013 }, +{ PROC_LINKS(view_jump_list_with_lister, 0), "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, 102 }, +{ PROC_LINKS(show_the_log_graph, 0), "show_the_log_graph", 18, "Parses *log* and displays the 'log graph' UI", 44, "w:\\4ed\\code\\custom\\4coder_log_parser.cpp", 40, 990 }, { PROC_LINKS(copy, 0), "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), "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(paste, 0), "paste", 5, "At the cursor, insert the text at the top of the clipboard.", 59, "w:\\4ed\\code\\custom\\4coder_clipboard.cpp", 39, 39 }, @@ -434,7 +430,7 @@ static Command_Metadata fcoder_metacmd_table[210] = { { PROC_LINKS(comment_line, 0), "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), "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), "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), "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, 232 }, +{ PROC_LINKS(snippet_lister, 0), "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(miblo_increment_basic, 0), "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), "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), "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 }, @@ -597,59 +593,57 @@ static i32 fcoder_metacmd_ID_goto_first_jump_same_panel_sticky = 151; static i32 fcoder_metacmd_ID_if_read_only_goto_position = 152; static i32 fcoder_metacmd_ID_if_read_only_goto_position_same_panel = 153; static i32 fcoder_metacmd_ID_view_jump_list_with_lister = 154; -static i32 fcoder_metacmd_ID_log_graph__escape = 155; -static i32 fcoder_metacmd_ID_log_graph__scroll_wheel = 156; -static i32 fcoder_metacmd_ID_show_the_log_graph = 157; -static i32 fcoder_metacmd_ID_copy = 158; -static i32 fcoder_metacmd_ID_cut = 159; -static i32 fcoder_metacmd_ID_paste = 160; -static i32 fcoder_metacmd_ID_paste_next = 161; -static i32 fcoder_metacmd_ID_paste_and_indent = 162; -static i32 fcoder_metacmd_ID_paste_next_and_indent = 163; -static i32 fcoder_metacmd_ID_execute_previous_cli = 164; -static i32 fcoder_metacmd_ID_execute_any_cli = 165; -static i32 fcoder_metacmd_ID_build_search = 166; -static i32 fcoder_metacmd_ID_build_in_build_panel = 167; -static i32 fcoder_metacmd_ID_close_build_panel = 168; -static i32 fcoder_metacmd_ID_change_to_build_panel = 169; -static i32 fcoder_metacmd_ID_close_all_code = 170; -static i32 fcoder_metacmd_ID_open_all_code = 171; -static i32 fcoder_metacmd_ID_open_all_code_recursive = 172; -static i32 fcoder_metacmd_ID_load_project = 173; -static i32 fcoder_metacmd_ID_project_fkey_command = 174; -static i32 fcoder_metacmd_ID_project_go_to_root_directory = 175; -static i32 fcoder_metacmd_ID_setup_new_project = 176; -static i32 fcoder_metacmd_ID_setup_build_bat = 177; -static i32 fcoder_metacmd_ID_setup_build_sh = 178; -static i32 fcoder_metacmd_ID_setup_build_bat_and_sh = 179; -static i32 fcoder_metacmd_ID_project_command_lister = 180; -static i32 fcoder_metacmd_ID_list_all_functions_current_buffer = 181; -static i32 fcoder_metacmd_ID_list_all_functions_current_buffer_lister = 182; -static i32 fcoder_metacmd_ID_list_all_functions_all_buffers = 183; -static i32 fcoder_metacmd_ID_list_all_functions_all_buffers_lister = 184; -static i32 fcoder_metacmd_ID_select_surrounding_scope = 185; -static i32 fcoder_metacmd_ID_select_next_scope_absolute = 186; -static i32 fcoder_metacmd_ID_select_next_scope_after_current = 187; -static i32 fcoder_metacmd_ID_select_prev_scope_absolute = 188; -static i32 fcoder_metacmd_ID_place_in_scope = 189; -static i32 fcoder_metacmd_ID_delete_current_scope = 190; -static i32 fcoder_metacmd_ID_open_long_braces = 191; -static i32 fcoder_metacmd_ID_open_long_braces_semicolon = 192; -static i32 fcoder_metacmd_ID_open_long_braces_break = 193; -static i32 fcoder_metacmd_ID_if0_off = 194; -static i32 fcoder_metacmd_ID_write_todo = 195; -static i32 fcoder_metacmd_ID_write_hack = 196; -static i32 fcoder_metacmd_ID_write_note = 197; -static i32 fcoder_metacmd_ID_write_block = 198; -static i32 fcoder_metacmd_ID_write_zero_struct = 199; -static i32 fcoder_metacmd_ID_comment_line = 200; -static i32 fcoder_metacmd_ID_uncomment_line = 201; -static i32 fcoder_metacmd_ID_comment_line_toggle = 202; -static i32 fcoder_metacmd_ID_snippet_lister = 203; -static i32 fcoder_metacmd_ID_miblo_increment_basic = 204; -static i32 fcoder_metacmd_ID_miblo_decrement_basic = 205; -static i32 fcoder_metacmd_ID_miblo_increment_time_stamp = 206; -static i32 fcoder_metacmd_ID_miblo_decrement_time_stamp = 207; -static i32 fcoder_metacmd_ID_miblo_increment_time_stamp_minute = 208; -static i32 fcoder_metacmd_ID_miblo_decrement_time_stamp_minute = 209; +static i32 fcoder_metacmd_ID_show_the_log_graph = 155; +static i32 fcoder_metacmd_ID_copy = 156; +static i32 fcoder_metacmd_ID_cut = 157; +static i32 fcoder_metacmd_ID_paste = 158; +static i32 fcoder_metacmd_ID_paste_next = 159; +static i32 fcoder_metacmd_ID_paste_and_indent = 160; +static i32 fcoder_metacmd_ID_paste_next_and_indent = 161; +static i32 fcoder_metacmd_ID_execute_previous_cli = 162; +static i32 fcoder_metacmd_ID_execute_any_cli = 163; +static i32 fcoder_metacmd_ID_build_search = 164; +static i32 fcoder_metacmd_ID_build_in_build_panel = 165; +static i32 fcoder_metacmd_ID_close_build_panel = 166; +static i32 fcoder_metacmd_ID_change_to_build_panel = 167; +static i32 fcoder_metacmd_ID_close_all_code = 168; +static i32 fcoder_metacmd_ID_open_all_code = 169; +static i32 fcoder_metacmd_ID_open_all_code_recursive = 170; +static i32 fcoder_metacmd_ID_load_project = 171; +static i32 fcoder_metacmd_ID_project_fkey_command = 172; +static i32 fcoder_metacmd_ID_project_go_to_root_directory = 173; +static i32 fcoder_metacmd_ID_setup_new_project = 174; +static i32 fcoder_metacmd_ID_setup_build_bat = 175; +static i32 fcoder_metacmd_ID_setup_build_sh = 176; +static i32 fcoder_metacmd_ID_setup_build_bat_and_sh = 177; +static i32 fcoder_metacmd_ID_project_command_lister = 178; +static i32 fcoder_metacmd_ID_list_all_functions_current_buffer = 179; +static i32 fcoder_metacmd_ID_list_all_functions_current_buffer_lister = 180; +static i32 fcoder_metacmd_ID_list_all_functions_all_buffers = 181; +static i32 fcoder_metacmd_ID_list_all_functions_all_buffers_lister = 182; +static i32 fcoder_metacmd_ID_select_surrounding_scope = 183; +static i32 fcoder_metacmd_ID_select_next_scope_absolute = 184; +static i32 fcoder_metacmd_ID_select_next_scope_after_current = 185; +static i32 fcoder_metacmd_ID_select_prev_scope_absolute = 186; +static i32 fcoder_metacmd_ID_place_in_scope = 187; +static i32 fcoder_metacmd_ID_delete_current_scope = 188; +static i32 fcoder_metacmd_ID_open_long_braces = 189; +static i32 fcoder_metacmd_ID_open_long_braces_semicolon = 190; +static i32 fcoder_metacmd_ID_open_long_braces_break = 191; +static i32 fcoder_metacmd_ID_if0_off = 192; +static i32 fcoder_metacmd_ID_write_todo = 193; +static i32 fcoder_metacmd_ID_write_hack = 194; +static i32 fcoder_metacmd_ID_write_note = 195; +static i32 fcoder_metacmd_ID_write_block = 196; +static i32 fcoder_metacmd_ID_write_zero_struct = 197; +static i32 fcoder_metacmd_ID_comment_line = 198; +static i32 fcoder_metacmd_ID_uncomment_line = 199; +static i32 fcoder_metacmd_ID_comment_line_toggle = 200; +static i32 fcoder_metacmd_ID_snippet_lister = 201; +static i32 fcoder_metacmd_ID_miblo_increment_basic = 202; +static i32 fcoder_metacmd_ID_miblo_decrement_basic = 203; +static i32 fcoder_metacmd_ID_miblo_increment_time_stamp = 204; +static i32 fcoder_metacmd_ID_miblo_decrement_time_stamp = 205; +static i32 fcoder_metacmd_ID_miblo_increment_time_stamp_minute = 206; +static i32 fcoder_metacmd_ID_miblo_decrement_time_stamp_minute = 207; #endif diff --git a/custom/generated/custom_api.cpp b/custom/generated/custom_api.cpp index f40e4745..e7c96a09 100644 --- a/custom/generated/custom_api.cpp +++ b/custom/generated/custom_api.cpp @@ -77,7 +77,6 @@ vtable->panel_get_margin = panel_get_margin; vtable->view_close = view_close; vtable->view_get_buffer_region = view_get_buffer_region; vtable->view_get_buffer_scroll = view_get_buffer_scroll; -vtable->view_get_basic_scroll = view_get_basic_scroll; vtable->view_set_active = view_set_active; vtable->view_get_setting = view_get_setting; vtable->view_set_setting = view_set_setting; @@ -86,15 +85,12 @@ vtable->buffer_compute_cursor = buffer_compute_cursor; vtable->view_compute_cursor = view_compute_cursor; vtable->view_set_cursor = view_set_cursor; vtable->view_set_buffer_scroll = view_set_buffer_scroll; -vtable->view_set_basic_scroll = view_set_basic_scroll; vtable->view_set_mark = view_set_mark; vtable->view_set_buffer = view_set_buffer; vtable->view_post_fade = view_post_fade; -vtable->view_begin_ui_mode = view_begin_ui_mode; -vtable->view_end_ui_mode = view_end_ui_mode; -vtable->view_is_in_ui_mode = view_is_in_ui_mode; -vtable->view_set_quit_ui_handler = view_set_quit_ui_handler; -vtable->view_get_quit_ui_handler = view_get_quit_ui_handler; +vtable->view_push_context = view_push_context; +vtable->view_pop_context = view_pop_context; +vtable->view_current_context = view_current_context; vtable->create_user_managed_scope = create_user_managed_scope; vtable->destroy_user_managed_scope = destroy_user_managed_scope; vtable->get_global_managed_scope = get_global_managed_scope; @@ -252,7 +248,6 @@ panel_get_margin = vtable->panel_get_margin; view_close = vtable->view_close; view_get_buffer_region = vtable->view_get_buffer_region; view_get_buffer_scroll = vtable->view_get_buffer_scroll; -view_get_basic_scroll = vtable->view_get_basic_scroll; view_set_active = vtable->view_set_active; view_get_setting = vtable->view_get_setting; view_set_setting = vtable->view_set_setting; @@ -261,15 +256,12 @@ buffer_compute_cursor = vtable->buffer_compute_cursor; view_compute_cursor = vtable->view_compute_cursor; view_set_cursor = vtable->view_set_cursor; view_set_buffer_scroll = vtable->view_set_buffer_scroll; -view_set_basic_scroll = vtable->view_set_basic_scroll; view_set_mark = vtable->view_set_mark; view_set_buffer = vtable->view_set_buffer; view_post_fade = vtable->view_post_fade; -view_begin_ui_mode = vtable->view_begin_ui_mode; -view_end_ui_mode = vtable->view_end_ui_mode; -view_is_in_ui_mode = vtable->view_is_in_ui_mode; -view_set_quit_ui_handler = vtable->view_set_quit_ui_handler; -view_get_quit_ui_handler = vtable->view_get_quit_ui_handler; +view_push_context = vtable->view_push_context; +view_pop_context = vtable->view_pop_context; +view_current_context = vtable->view_current_context; create_user_managed_scope = vtable->create_user_managed_scope; destroy_user_managed_scope = vtable->destroy_user_managed_scope; get_global_managed_scope = vtable->get_global_managed_scope; diff --git a/custom/generated/custom_api.h b/custom/generated/custom_api.h index 3ecb645b..867e486f 100644 --- a/custom/generated/custom_api.h +++ b/custom/generated/custom_api.h @@ -75,7 +75,6 @@ #define custom_view_close_sig() b32 custom_view_close(Application_Links* app, View_ID view_id) #define custom_view_get_buffer_region_sig() Rect_f32 custom_view_get_buffer_region(Application_Links* app, View_ID view_id) #define custom_view_get_buffer_scroll_sig() Buffer_Scroll custom_view_get_buffer_scroll(Application_Links* app, View_ID view_id) -#define custom_view_get_basic_scroll_sig() Basic_Scroll custom_view_get_basic_scroll(Application_Links* app, View_ID view_id) #define custom_view_set_active_sig() b32 custom_view_set_active(Application_Links* app, View_ID view_id) #define custom_view_get_setting_sig() b32 custom_view_get_setting(Application_Links* app, View_ID view_id, View_Setting_ID setting, i64* value_out) #define custom_view_set_setting_sig() b32 custom_view_set_setting(Application_Links* app, View_ID view_id, View_Setting_ID setting, i64 value) @@ -84,15 +83,12 @@ #define custom_view_compute_cursor_sig() Buffer_Cursor custom_view_compute_cursor(Application_Links* app, View_ID view_id, Buffer_Seek seek) #define custom_view_set_cursor_sig() b32 custom_view_set_cursor(Application_Links* app, View_ID view_id, Buffer_Seek seek) #define custom_view_set_buffer_scroll_sig() b32 custom_view_set_buffer_scroll(Application_Links* app, View_ID view_id, Buffer_Scroll scroll) -#define custom_view_set_basic_scroll_sig() b32 custom_view_set_basic_scroll(Application_Links* app, View_ID view_id, Basic_Scroll scroll) #define custom_view_set_mark_sig() b32 custom_view_set_mark(Application_Links* app, View_ID view_id, Buffer_Seek seek) #define custom_view_set_buffer_sig() b32 custom_view_set_buffer(Application_Links* app, View_ID view_id, Buffer_ID buffer_id, Set_Buffer_Flag flags) #define custom_view_post_fade_sig() b32 custom_view_post_fade(Application_Links* app, View_ID view_id, f32 seconds, Range_i64 range, int_color color) -#define custom_view_begin_ui_mode_sig() b32 custom_view_begin_ui_mode(Application_Links* app, View_ID view_id) -#define custom_view_end_ui_mode_sig() b32 custom_view_end_ui_mode(Application_Links* app, View_ID view_id) -#define custom_view_is_in_ui_mode_sig() b32 custom_view_is_in_ui_mode(Application_Links* app, View_ID view_id) -#define custom_view_set_quit_ui_handler_sig() b32 custom_view_set_quit_ui_handler(Application_Links* app, View_ID view_id, UI_Quit_Function_Type* quit_function) -#define custom_view_get_quit_ui_handler_sig() b32 custom_view_get_quit_ui_handler(Application_Links* app, View_ID view_id, UI_Quit_Function_Type** quit_function_out) +#define custom_view_push_context_sig() b32 custom_view_push_context(Application_Links* app, View_ID view_id, View_Context* ctx) +#define custom_view_pop_context_sig() b32 custom_view_pop_context(Application_Links* app, View_ID view_id) +#define custom_view_current_context_sig() View_Context custom_view_current_context(Application_Links* app, View_ID view_id) #define custom_create_user_managed_scope_sig() Managed_Scope custom_create_user_managed_scope(Application_Links* app) #define custom_destroy_user_managed_scope_sig() b32 custom_destroy_user_managed_scope(Application_Links* app, Managed_Scope scope) #define custom_get_global_managed_scope_sig() Managed_Scope custom_get_global_managed_scope(Application_Links* app) @@ -246,7 +242,6 @@ typedef Rect_i32 custom_panel_get_margin_type(Application_Links* app, Panel_ID p typedef b32 custom_view_close_type(Application_Links* app, View_ID view_id); typedef Rect_f32 custom_view_get_buffer_region_type(Application_Links* app, View_ID view_id); typedef Buffer_Scroll custom_view_get_buffer_scroll_type(Application_Links* app, View_ID view_id); -typedef Basic_Scroll custom_view_get_basic_scroll_type(Application_Links* app, View_ID view_id); typedef b32 custom_view_set_active_type(Application_Links* app, View_ID view_id); typedef b32 custom_view_get_setting_type(Application_Links* app, View_ID view_id, View_Setting_ID setting, i64* value_out); typedef b32 custom_view_set_setting_type(Application_Links* app, View_ID view_id, View_Setting_ID setting, i64 value); @@ -255,15 +250,12 @@ typedef Buffer_Cursor custom_buffer_compute_cursor_type(Application_Links* app, typedef Buffer_Cursor custom_view_compute_cursor_type(Application_Links* app, View_ID view_id, Buffer_Seek seek); typedef b32 custom_view_set_cursor_type(Application_Links* app, View_ID view_id, Buffer_Seek seek); typedef b32 custom_view_set_buffer_scroll_type(Application_Links* app, View_ID view_id, Buffer_Scroll scroll); -typedef b32 custom_view_set_basic_scroll_type(Application_Links* app, View_ID view_id, Basic_Scroll scroll); typedef b32 custom_view_set_mark_type(Application_Links* app, View_ID view_id, Buffer_Seek seek); typedef b32 custom_view_set_buffer_type(Application_Links* app, View_ID view_id, Buffer_ID buffer_id, Set_Buffer_Flag flags); typedef b32 custom_view_post_fade_type(Application_Links* app, View_ID view_id, f32 seconds, Range_i64 range, int_color color); -typedef b32 custom_view_begin_ui_mode_type(Application_Links* app, View_ID view_id); -typedef b32 custom_view_end_ui_mode_type(Application_Links* app, View_ID view_id); -typedef b32 custom_view_is_in_ui_mode_type(Application_Links* app, View_ID view_id); -typedef b32 custom_view_set_quit_ui_handler_type(Application_Links* app, View_ID view_id, UI_Quit_Function_Type* quit_function); -typedef b32 custom_view_get_quit_ui_handler_type(Application_Links* app, View_ID view_id, UI_Quit_Function_Type** quit_function_out); +typedef b32 custom_view_push_context_type(Application_Links* app, View_ID view_id, View_Context* ctx); +typedef b32 custom_view_pop_context_type(Application_Links* app, View_ID view_id); +typedef View_Context custom_view_current_context_type(Application_Links* app, View_ID view_id); typedef Managed_Scope custom_create_user_managed_scope_type(Application_Links* app); typedef b32 custom_destroy_user_managed_scope_type(Application_Links* app, Managed_Scope scope); typedef Managed_Scope custom_get_global_managed_scope_type(Application_Links* app); @@ -418,7 +410,6 @@ custom_panel_get_margin_type *panel_get_margin; custom_view_close_type *view_close; custom_view_get_buffer_region_type *view_get_buffer_region; custom_view_get_buffer_scroll_type *view_get_buffer_scroll; -custom_view_get_basic_scroll_type *view_get_basic_scroll; custom_view_set_active_type *view_set_active; custom_view_get_setting_type *view_get_setting; custom_view_set_setting_type *view_set_setting; @@ -427,15 +418,12 @@ custom_buffer_compute_cursor_type *buffer_compute_cursor; custom_view_compute_cursor_type *view_compute_cursor; custom_view_set_cursor_type *view_set_cursor; custom_view_set_buffer_scroll_type *view_set_buffer_scroll; -custom_view_set_basic_scroll_type *view_set_basic_scroll; custom_view_set_mark_type *view_set_mark; custom_view_set_buffer_type *view_set_buffer; custom_view_post_fade_type *view_post_fade; -custom_view_begin_ui_mode_type *view_begin_ui_mode; -custom_view_end_ui_mode_type *view_end_ui_mode; -custom_view_is_in_ui_mode_type *view_is_in_ui_mode; -custom_view_set_quit_ui_handler_type *view_set_quit_ui_handler; -custom_view_get_quit_ui_handler_type *view_get_quit_ui_handler; +custom_view_push_context_type *view_push_context; +custom_view_pop_context_type *view_pop_context; +custom_view_current_context_type *view_current_context; custom_create_user_managed_scope_type *create_user_managed_scope; custom_destroy_user_managed_scope_type *destroy_user_managed_scope; custom_get_global_managed_scope_type *get_global_managed_scope; @@ -591,7 +579,6 @@ internal Rect_i32 panel_get_margin(Application_Links* app, Panel_ID panel_id); internal b32 view_close(Application_Links* app, View_ID view_id); internal Rect_f32 view_get_buffer_region(Application_Links* app, View_ID view_id); internal Buffer_Scroll view_get_buffer_scroll(Application_Links* app, View_ID view_id); -internal Basic_Scroll view_get_basic_scroll(Application_Links* app, View_ID view_id); internal b32 view_set_active(Application_Links* app, View_ID view_id); internal b32 view_get_setting(Application_Links* app, View_ID view_id, View_Setting_ID setting, i64* value_out); internal b32 view_set_setting(Application_Links* app, View_ID view_id, View_Setting_ID setting, i64 value); @@ -600,15 +587,12 @@ internal Buffer_Cursor buffer_compute_cursor(Application_Links* app, Buffer_ID b internal Buffer_Cursor view_compute_cursor(Application_Links* app, View_ID view_id, Buffer_Seek seek); internal b32 view_set_cursor(Application_Links* app, View_ID view_id, Buffer_Seek seek); internal b32 view_set_buffer_scroll(Application_Links* app, View_ID view_id, Buffer_Scroll scroll); -internal b32 view_set_basic_scroll(Application_Links* app, View_ID view_id, Basic_Scroll scroll); internal b32 view_set_mark(Application_Links* app, View_ID view_id, Buffer_Seek seek); internal b32 view_set_buffer(Application_Links* app, View_ID view_id, Buffer_ID buffer_id, Set_Buffer_Flag flags); internal b32 view_post_fade(Application_Links* app, View_ID view_id, f32 seconds, Range_i64 range, int_color color); -internal b32 view_begin_ui_mode(Application_Links* app, View_ID view_id); -internal b32 view_end_ui_mode(Application_Links* app, View_ID view_id); -internal b32 view_is_in_ui_mode(Application_Links* app, View_ID view_id); -internal b32 view_set_quit_ui_handler(Application_Links* app, View_ID view_id, UI_Quit_Function_Type* quit_function); -internal b32 view_get_quit_ui_handler(Application_Links* app, View_ID view_id, UI_Quit_Function_Type** quit_function_out); +internal b32 view_push_context(Application_Links* app, View_ID view_id, View_Context* ctx); +internal b32 view_pop_context(Application_Links* app, View_ID view_id); +internal View_Context view_current_context(Application_Links* app, View_ID view_id); internal Managed_Scope create_user_managed_scope(Application_Links* app); internal b32 destroy_user_managed_scope(Application_Links* app, Managed_Scope scope); internal Managed_Scope get_global_managed_scope(Application_Links* app); @@ -764,7 +748,6 @@ global custom_panel_get_margin_type *panel_get_margin = 0; global custom_view_close_type *view_close = 0; global custom_view_get_buffer_region_type *view_get_buffer_region = 0; global custom_view_get_buffer_scroll_type *view_get_buffer_scroll = 0; -global custom_view_get_basic_scroll_type *view_get_basic_scroll = 0; global custom_view_set_active_type *view_set_active = 0; global custom_view_get_setting_type *view_get_setting = 0; global custom_view_set_setting_type *view_set_setting = 0; @@ -773,15 +756,12 @@ global custom_buffer_compute_cursor_type *buffer_compute_cursor = 0; global custom_view_compute_cursor_type *view_compute_cursor = 0; global custom_view_set_cursor_type *view_set_cursor = 0; global custom_view_set_buffer_scroll_type *view_set_buffer_scroll = 0; -global custom_view_set_basic_scroll_type *view_set_basic_scroll = 0; global custom_view_set_mark_type *view_set_mark = 0; global custom_view_set_buffer_type *view_set_buffer = 0; global custom_view_post_fade_type *view_post_fade = 0; -global custom_view_begin_ui_mode_type *view_begin_ui_mode = 0; -global custom_view_end_ui_mode_type *view_end_ui_mode = 0; -global custom_view_is_in_ui_mode_type *view_is_in_ui_mode = 0; -global custom_view_set_quit_ui_handler_type *view_set_quit_ui_handler = 0; -global custom_view_get_quit_ui_handler_type *view_get_quit_ui_handler = 0; +global custom_view_push_context_type *view_push_context = 0; +global custom_view_pop_context_type *view_pop_context = 0; +global custom_view_current_context_type *view_current_context = 0; global custom_create_user_managed_scope_type *create_user_managed_scope = 0; global custom_destroy_user_managed_scope_type *destroy_user_managed_scope = 0; global custom_get_global_managed_scope_type *get_global_managed_scope = 0; diff --git a/custom/generated/custom_api_master_list.h b/custom/generated/custom_api_master_list.h index b6f21f3b..6e01199f 100644 --- a/custom/generated/custom_api_master_list.h +++ b/custom/generated/custom_api_master_list.h @@ -75,7 +75,6 @@ api(custom) function Rect_i32 panel_get_margin(Application_Links* app, Panel_ID api(custom) function b32 view_close(Application_Links* app, View_ID view_id); api(custom) function Rect_f32 view_get_buffer_region(Application_Links* app, View_ID view_id); api(custom) function Buffer_Scroll view_get_buffer_scroll(Application_Links* app, View_ID view_id); -api(custom) function Basic_Scroll view_get_basic_scroll(Application_Links* app, View_ID view_id); api(custom) function b32 view_set_active(Application_Links* app, View_ID view_id); api(custom) function b32 view_get_setting(Application_Links* app, View_ID view_id, View_Setting_ID setting, i64* value_out); api(custom) function b32 view_set_setting(Application_Links* app, View_ID view_id, View_Setting_ID setting, i64 value); @@ -84,15 +83,12 @@ api(custom) function Buffer_Cursor buffer_compute_cursor(Application_Links* app, api(custom) function Buffer_Cursor view_compute_cursor(Application_Links* app, View_ID view_id, Buffer_Seek seek); api(custom) function b32 view_set_cursor(Application_Links* app, View_ID view_id, Buffer_Seek seek); api(custom) function b32 view_set_buffer_scroll(Application_Links* app, View_ID view_id, Buffer_Scroll scroll); -api(custom) function b32 view_set_basic_scroll(Application_Links* app, View_ID view_id, Basic_Scroll scroll); api(custom) function b32 view_set_mark(Application_Links* app, View_ID view_id, Buffer_Seek seek); api(custom) function b32 view_set_buffer(Application_Links* app, View_ID view_id, Buffer_ID buffer_id, Set_Buffer_Flag flags); api(custom) function b32 view_post_fade(Application_Links* app, View_ID view_id, f32 seconds, Range_i64 range, int_color color); -api(custom) function b32 view_begin_ui_mode(Application_Links* app, View_ID view_id); -api(custom) function b32 view_end_ui_mode(Application_Links* app, View_ID view_id); -api(custom) function b32 view_is_in_ui_mode(Application_Links* app, View_ID view_id); -api(custom) function b32 view_set_quit_ui_handler(Application_Links* app, View_ID view_id, UI_Quit_Function_Type* quit_function); -api(custom) function b32 view_get_quit_ui_handler(Application_Links* app, View_ID view_id, UI_Quit_Function_Type** quit_function_out); +api(custom) function b32 view_push_context(Application_Links* app, View_ID view_id, View_Context* ctx); +api(custom) function b32 view_pop_context(Application_Links* app, View_ID view_id); +api(custom) function View_Context view_current_context(Application_Links* app, View_ID view_id); api(custom) function Managed_Scope create_user_managed_scope(Application_Links* app); api(custom) function b32 destroy_user_managed_scope(Application_Links* app, Managed_Scope scope); api(custom) function Managed_Scope get_global_managed_scope(Application_Links* app);