From 0e51ffa80de85b69360325cafbe788e013a63f7f Mon Sep 17 00:00:00 2001 From: Allen Webster Date: Thu, 10 Oct 2019 15:57:02 -0700 Subject: [PATCH] New mapping system looking decent --- 4ed.cpp | 68 +-- 4ed.h | 5 +- 4ed_api_implementation.cpp | 101 +++- 4ed_app_models.h | 16 +- 4ed_app_target.cpp | 11 +- custom/4coder_base_commands.cpp | 63 +- .../4coder_command_map.cpp | 37 ++ 4ed_command.h => custom/4coder_command_map.h | 2 +- custom/4coder_config.cpp | 21 - custom/4coder_config.h | 3 - custom/4coder_custom.cpp | 3 +- custom/4coder_default_bindings.cpp | 21 +- custom/4coder_default_framework.cpp | 19 +- custom/4coder_default_framework.h | 7 - custom/4coder_default_framework_variables.cpp | 16 +- custom/4coder_default_hooks.cpp | 133 ++-- custom/4coder_default_include.cpp | 4 +- custom/4coder_helper.cpp | 275 +-------- custom/4coder_helper.h | 19 - custom/4coder_log_parser.cpp | 19 +- custom/4coder_remapping_commands.cpp | 58 -- custom/4coder_types.h | 99 +-- custom/bin/buildsuper_x64.bat | 2 +- custom/bin/buildsuper_x86.bat | 2 +- custom/generated/command_metadata.h | 503 ++++++++-------- custom/generated/custom_api.cpp | 6 +- custom/generated/custom_api.h | 15 +- custom/generated/custom_api_master_list.h | 3 +- custom/generated/remapping.h | 569 +++++------------- platform_linux/linux_4ed.cpp | 2 +- platform_mac/mac_4ed.cpp | 2 +- platform_win32/win32_4ed.cpp | 9 +- 32 files changed, 780 insertions(+), 1333 deletions(-) rename 4ed_command.cpp => custom/4coder_command_map.cpp (87%) rename 4ed_command.h => custom/4coder_command_map.h (97%) delete mode 100644 custom/4coder_remapping_commands.cpp diff --git a/4ed.cpp b/4ed.cpp index 858ce9aa..0181f1dd 100644 --- a/4ed.cpp +++ b/4ed.cpp @@ -111,6 +111,7 @@ DELTA_RULE_SIG(fallback_scroll_rule){ return(pending_delta); } +#if 0 #define DEFAULT_MAP_SIZE 10 #define DEFAULT_UI_MAP_SIZE 32 @@ -331,6 +332,7 @@ interpret_binding_buffer(Models *models, void *buffer, i32 size){ return(result); } +#endif #include "4ed_api_implementation.cpp" @@ -338,12 +340,8 @@ internal void command_caller(Coroutine *coroutine){ Command_In *cmd_in = (Command_In*)coroutine->in; Models *models = cmd_in->models; - if (models->command_caller != 0){ - models->command_caller(&models->app_links, cmd_in->bind.custom); - } - else{ - cmd_in->bind.custom(&models->app_links); - } + Assert(models->command_caller != 0); + models->command_caller(&models->app_links); } // App Functions @@ -581,7 +579,9 @@ force_abort_coroutine(Models *models, View *view){ models->command_coroutine = app_coroutine_run(models, Co_Command, models->command_coroutine, &user_in, models->command_coroutine_flags); } if (models->command_coroutine != 0){ - // TODO(allen): post grave warning +#define M "SERIOUS ERROR: command did not terminate when passed an abort" + print_message(&models->app_links, string_u8_litexpr(M)); +#undef M models->command_coroutine = 0; } init_query_set(&view->query_set); @@ -589,6 +589,21 @@ force_abort_coroutine(Models *models, View *view){ internal b32 launch_command_via_event(Models *models, View *view, Input_Event *event){ + block_copy_struct(&models->event, event); + Assert(models->command_coroutine == 0); + Coroutine *command_coroutine = coroutine_create(&models->coroutines, command_caller); + models->command_coroutine = command_coroutine; + Command_In cmd_in = {models}; + models->event_unhandled = false; + models->command_coroutine = app_coroutine_run(models, + Co_Command, models->command_coroutine, + &cmd_in, models->command_coroutine_flags); + if (match_core_code(event, CoreCode_Animate)){ + models->animate_next_frame = true; + } + return(!models->event_unhandled); + +#if 0 b32 result = false; Command_Map_ID map = view_get_map(view); @@ -612,13 +627,13 @@ launch_command_via_event(Models *models, View *view, Input_Event *event){ result = false; } - models->prev_command = cmd_bind; if (match_core_code(event, CoreCode_Animate)){ models->animate_next_frame = true; } } return(result); +#endif } internal void @@ -667,7 +682,9 @@ App_Init_Sig(app_init){ custom_api_fill_vtable(&custom_vtable); API_VTable_system system_vtable = {}; system_api_fill_vtable(&system_vtable); - api.init_apis(&custom_vtable, &system_vtable); + Custom_Layer_Init_Type *custom_init = api.init_apis(&custom_vtable, &system_vtable); + Assert(custom_init != 0); + custom_init(&models->app_links); // NOTE(allen): coroutines coroutine_system_init(&models->coroutines); @@ -697,15 +714,6 @@ App_Init_Sig(app_init){ } } - { - Assert(models->config_api.get_bindings != 0); - Scratch_Block scratch(models->tctx, Scratch_Share); - u8 *memory = push_array(scratch, u8, KB(64)); - i32 wanted_size = models->config_api.get_bindings(memory, KB(64)); - Assert(wanted_size <= KB(64)); - interpret_binding_buffer(models, memory, wanted_size); - } - managed_ids_init(models->tctx->allocator, &models->managed_id_set); lifetime_allocator_init(models->tctx->allocator, &models->lifetime_allocator); dynamic_workspace_init(&models->lifetime_allocator, DynamicWorkspace_Global, 0, &models->dynamic_workspace); @@ -1057,35 +1065,23 @@ App_Step_Sig(app_step){ Event_Property event_flags = get_event_properties(event); if ((get_flags & event_flags) != 0){ - event_was_handled = true; - - Command_Map_ID map = view_get_map(view); - Command_Binding cmd_bind = map_get_binding_recursive(&models->mapping, map, event); - User_Input user_in = {}; user_in.event = *event; - user_in.command = cmd_bind.custom; user_in.abort = ((abort_flags & event_flags) != 0); models->event_unhandled = false; models->command_coroutine = app_coroutine_run(models, Co_Command, command_coroutine, &user_in, models->command_coroutine_flags); - if (models->event_unhandled){ - event_was_handled = false; - } - if (!HasFlag(event_flags, EventProperty_Animate)){ models->animate_next_frame = true; } - if (models->command_coroutine == 0){ init_query_set(&view->query_set); } + event_was_handled = !models->event_unhandled; } } else{ - if (launch_command_via_event(models, view, event)){ - event_was_handled = true; - } + event_was_handled = launch_command_via_event(models, view, event); } }break; } @@ -1124,9 +1120,11 @@ App_Step_Sig(app_step){ } // NOTE(allen): send panel size update - if (models->layout.panel_state_dirty && models->hooks[hook_buffer_viewer_update] != 0){ + if (models->layout.panel_state_dirty){ models->layout.panel_state_dirty = false; - models->hooks[hook_buffer_viewer_update](&models->app_links); + if (models->buffer_viewer_update != 0){ + models->buffer_viewer_update(&models->app_links); + } } // NOTE(allen): dt @@ -1226,7 +1224,7 @@ App_Step_Sig(app_step){ models->keep_playing = false; } if (!models->keep_playing){ - Hook_Function *exit_func = models->hooks[hook_exit]; + Hook_Function *exit_func = models->exit; if (exit_func != 0){ if (exit_func(&models->app_links) == 0){ models->animate_next_frame = true; diff --git a/4ed.h b/4ed.h index 6e12797d..ff546206 100644 --- a/4ed.h +++ b/4ed.h @@ -42,9 +42,8 @@ char **argv) typedef App_Read_Command_Line_Sig(App_Read_Command_Line); struct Custom_API{ - Get_Binding_Data_Function *get_bindings; - _Get_Version_Function *get_version; - _Init_APIs *init_apis; + _Get_Version_Type *get_version; + _Init_APIs_Type *init_apis; }; #define App_Init_Sig(name) \ diff --git a/4ed_api_implementation.cpp b/4ed_api_implementation.cpp index 224296a5..244dfb71 100644 --- a/4ed_api_implementation.cpp +++ b/4ed_api_implementation.cpp @@ -66,14 +66,6 @@ global_set_setting(Application_Links *app, Global_Setting_ID setting, i64 value) return(result); } -api(custom) function b32 -global_set_mapping(Application_Links *app, void *data, i32 size) -{ - Models *models = (Models*)app->cmd_context; - b32 result = interpret_binding_buffer(models, data, size); - return(result); -} - api(custom) function Rect_f32 global_get_screen_rectangle(Application_Links *app){ Models *models = (Models*)app->cmd_context; @@ -632,10 +624,12 @@ buffer_get_setting(Application_Links *app, Buffer_ID buffer_id, Buffer_Setting_I if (api_check_buffer(file)){ result = true; switch (setting){ +#if 0 case BufferSetting_MapID: { *value_out = file->settings.base_map_id; }break; +#endif case BufferSetting_Eol: { @@ -675,6 +669,7 @@ buffer_set_setting(Application_Links *app, Buffer_ID buffer_id, Buffer_Setting_I if (api_check_buffer(file)){ result = true; switch (setting){ +#if 0 case BufferSetting_MapID: { Command_Map_ID id = mapping_validate_id(&models->mapping, value); @@ -682,6 +677,7 @@ buffer_set_setting(Application_Links *app, Buffer_ID buffer_id, Buffer_Setting_I file->settings.base_map_id = id; } }break; +#endif case BufferSetting_Eol: { @@ -1384,7 +1380,7 @@ 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) +view_get_setting(Application_Links *app, View_ID view_id, View_Setting_ID setting, i64 *value_out) { Models *models = (Models*)app->cmd_context; View *view = imp_get_view(models, view_id); @@ -1899,6 +1895,7 @@ managed_scope_get_attachment(Application_Links *app, Managed_Scope scope, Manage #define M \ "ERROR: scope attachment already exists with a size smaller than the requested size; no attachment pointer can be returned." print_message(app, string_u8_litexpr(M)); +#undef M } } return(result); @@ -2113,6 +2110,85 @@ leave_command_input_unhandled(Application_Links *app){ models->event_unhandled = true; } +api(custom) function void +set_custom_hook(Application_Links *app, Hook_ID hook_id, Void_Func *func_ptr){ + Models *models = (Models*)app->cmd_context; + switch (hook_id){ + case HookID_FileOutOfSync: + { + models->file_out_of_sync = (Hook_Function*)func_ptr; + }break; + case HookID_Exit: + { + models->exit = (Hook_Function*)func_ptr; + }break; + case HookID_BufferViewerUpdate: + { + models->buffer_viewer_update = (Hook_Function*)func_ptr; + }break; + case HookID_ScrollRule: + { + models->scroll_rule = (Delta_Rule_Function*)func_ptr; + }break; + case HookID_NewFile: + { + models->hook_new_file = (Buffer_Hook_Function*)func_ptr; + }break; + case HookID_OpenFile: + { + models->hook_open_file = (Buffer_Hook_Function*)func_ptr; + }break; + case HookID_SaveFile: + { + models->hook_save_file = (Buffer_Hook_Function*)func_ptr; + }break; + case HookID_EndFile: + { + models->hook_end_file = (Buffer_Hook_Function*)func_ptr; + }break; + case HookID_FileEditRange: + { + models->hook_file_edit_range = (File_Edit_Range_Function*)func_ptr; + }break; + case HookID_FileExternallyModified: + { + models->hook_file_externally_modified = (File_Externally_Modified_Function*)func_ptr; + }break; + case HookID_CommandCaller: + { + models->command_caller = (Command_Caller_Hook_Function*)func_ptr; + }break; + case HookID_RenderCaller: + { + models->render_caller = (Render_Caller_Function*)func_ptr; + }break; + case HookID_InputFilter: + { + models->input_filter = (Input_Filter_Function*)func_ptr; + }break; + case HookID_Start: + { + models->hook_start = (Start_Hook_Function*)func_ptr; + }break; + case HookID_BufferNameResolver: + { + models->buffer_name_resolver = (Buffer_Name_Resolver_Function*)func_ptr; + }break; + case HookID_ModifyColorTable: + { + models->modify_color_table = (Modify_Color_Table_Function*)func_ptr; + }break; + case HookID_ClipboardChange: + { + models->clipboard_change = (Clipboard_Change_Hook_Function*)func_ptr; + }break; + case HookID_GetViewBufferRegion: + { + models->get_view_buffer_region = (Get_View_Buffer_Region_Function*)func_ptr; + }break; + } +} + api(custom) function Mouse_State get_mouse_state(Application_Links *app) { @@ -2570,13 +2646,6 @@ set_gui_up_down_keys(Application_Links *app, Key_Code up_key, Key_Modifier up_ke models->user_down_key_modifier = down_key_modifier; } -api(custom) function b32 -set_edit_finished_hook_repeat_speed(Application_Links *app, u32 milliseconds){ - Models *models = (Models*)app->cmd_context; - models->edit_finished_hook_repeat_speed = milliseconds; - return(true); -} - api(custom) function void send_exit_signal(Application_Links *app) { diff --git a/4ed_app_models.h b/4ed_app_models.h index d2b6a42f..db790de6 100644 --- a/4ed_app_models.h +++ b/4ed_app_models.h @@ -45,9 +45,6 @@ struct Models{ Face_ID global_face_id; - Mapping mapping; - Command_Binding prev_command; - Coroutine_Group coroutines; Coroutine *command_coroutine; u32 command_coroutine_flags[2]; @@ -57,10 +54,12 @@ struct Models{ Application_Links app_links; - Hook_Function *hooks[hook_type_count]; - Start_Hook_Function *hook_start; - Buffer_Hook_Function *hook_open_file; + Hook_Function *file_out_of_sync; + Hook_Function *exit; + Hook_Function *buffer_viewer_update; + Delta_Rule_Function *scroll_rule; Buffer_Hook_Function *hook_new_file; + Buffer_Hook_Function *hook_open_file; Buffer_Hook_Function *hook_save_file; Buffer_Hook_Function *hook_end_file; File_Edit_Range_Function *hook_file_edit_range; @@ -68,7 +67,7 @@ struct Models{ Command_Caller_Hook_Function *command_caller; Render_Caller_Function *render_caller; Input_Filter_Function *input_filter; - Delta_Rule_Function *scroll_rule; + Start_Hook_Function *hook_start; Buffer_Name_Resolver_Function *buffer_name_resolver; Modify_Color_Table_Function *modify_color_table; Clipboard_Change_Hook_Function *clipboard_change; @@ -108,8 +107,6 @@ struct Models{ Panel *resizing_intermediate_panel; - u32 edit_finished_hook_repeat_speed; - Plat_Handle period_wakeup_timer; i32 frame_counter; u32 next_animate_delay; @@ -168,7 +165,6 @@ struct App_Coroutine_State{ struct Command_In{ Models *models; - Command_Binding bind; }; struct File_Init{ diff --git a/4ed_app_target.cpp b/4ed_app_target.cpp index 15929f8c..bc9ba908 100644 --- a/4ed_app_target.cpp +++ b/4ed_app_target.cpp @@ -20,31 +20,28 @@ #include "generated/custom_api.h" #include "4coder_table.h" +#include "4coder_string_match.h" +#include "4coder_token.h" +#include "4coder_command_map.h" #include "4coder_system_types.h" #define DYNAMIC_LINK_API #include "generated/system_api.h" - #include "4ed_font_interface.h" #define DYNAMIC_LINK_API #include "generated/graphics_api.h" #define DYNAMIC_LINK_API #include "generated/font_api.h" -#include "4coder_string_match.h" - #include "4ed_render_target.h" #include "4ed.h" #include "4ed_buffer_model.h" #include "4ed_coroutine.h" -#include "4coder_token.h" - #include "4ed_dynamic_variables.h" #include "4ed_buffer_model.h" #include "4ed_translation.h" -#include "4ed_command.h" #include "4ed_buffer.h" #include "4ed_history.h" #include "4ed_file.h" @@ -74,6 +71,7 @@ #include "4coder_table.cpp" #include "4coder_log.cpp" #include "4coder_buffer_seek_constructors.cpp" +#include "4coder_command_map.cpp" #include "generated/custom_api.cpp" #define DYNAMIC_LINK_API @@ -92,7 +90,6 @@ #include "4ed_font_set.cpp" #include "4ed_translation.cpp" #include "4ed_render_target.cpp" -#include "4ed_command.cpp" #include "4ed_buffer.cpp" #include "4ed_string_matching.cpp" #include "4ed_history.cpp" diff --git a/custom/4coder_base_commands.cpp b/custom/4coder_base_commands.cpp index 52ce79d6..9c897185 100644 --- a/custom/4coder_base_commands.cpp +++ b/custom/4coder_base_commands.cpp @@ -844,7 +844,7 @@ isearch(Application_Links *app, Scan_Direction start_scan, String_Const_u8 query } isearch__update_highlight(app, view, Ii64_size(pos, match_size)); - in = get_user_input(app, EventProperty_AnyKey, EventProperty_Escape); + in = get_user_input(app, EventPropertyGroup_AnyKeyboardEvent, EventProperty_Escape); if (in.abort){ break; } @@ -887,25 +887,29 @@ isearch(Application_Links *app, Scan_Direction start_scan, String_Const_u8 query } } + // TODO(allen): how to detect if the input corresponds to + // a search or rsearch command, a scroll wheel command? + b32 do_scan_action = false; + b32 do_scroll_wheel = false; Scan_Direction change_scan = scan; if (!string_change){ - if (in.command == search || - match_key_code(&in, KeyCode_PageDown) || + if (match_key_code(&in, KeyCode_PageDown) || match_key_code(&in, KeyCode_Down)){ change_scan = Scan_Forward; do_scan_action = true; } - if (in.command == reverse_search || - match_key_code(&in, KeyCode_PageUp) || + if (match_key_code(&in, KeyCode_PageUp) || match_key_code(&in, KeyCode_Up)){ change_scan = Scan_Backward; do_scan_action = true; } +#if 0 if (in.command == mouse_wheel_scroll){ - mouse_wheel_scroll(app); + do_scroll_wheel = true; } +#endif } if (string_change){ @@ -955,6 +959,12 @@ isearch(Application_Links *app, Scan_Direction start_scan, String_Const_u8 query }break; } } + else if (do_scroll_wheel){ + mouse_wheel_scroll(app); + } + else{ + leave_command_input_unhandled(app); + } } view_disable_highlight_range(app, view); @@ -1264,24 +1274,29 @@ CUSTOM_DOC("Deletes the file of the current buffer if 4coder has the appropriate b32 cancelled = false; for (;!cancelled;){ User_Input in = get_user_input(app, EventProperty_AnyKey, 0); - switch (in.event.key.code){ - case KeyCode_Y: - { - delete_file_base(app, file_name, buffer); - cancelled = true; - }break; - - case KeyCode_Shift: - case KeyCode_Control: - case KeyCode_Alt: - case KeyCode_Command: - case KeyCode_CapsLock: - {}break; - - default: - { - cancelled = true; - }break; + if (in.abort){ + cancelled = true; + } + else{ + switch (in.event.key.code){ + case KeyCode_Y: + { + delete_file_base(app, file_name, buffer); + cancelled = true; + }break; + + case KeyCode_Shift: + case KeyCode_Control: + case KeyCode_Alt: + case KeyCode_Command: + case KeyCode_CapsLock: + {}break; + + default: + { + cancelled = true; + }break; + } } } } diff --git a/4ed_command.cpp b/custom/4coder_command_map.cpp similarity index 87% rename from 4ed_command.cpp rename to custom/4coder_command_map.cpp index def0ef89..0838bd6c 100644 --- a/4ed_command.cpp +++ b/custom/4coder_command_map.cpp @@ -324,5 +324,42 @@ map_get_binding_recursive(Mapping *mapping, Command_Map_ID map_id, Input_Event * return(map_get_binding_recursive(mapping, map, event)); } +//////////////////////////////// + +internal void +map_set_binding_key__wrapperv(Mapping *mapping, Command_Map *map, + Custom_Command_Function *custom, Key_Code code, va_list args){ + u32 flags = 0; + for (;;){ + i32 v = va_arg(args, i32); + if (v <= 0){ + break; + } + flags |= v; + } + Key_Modifiers mod = {}; + mod.modifiers[MDFR_SHIFT_INDEX] = HasFlag(flags, MDFR_SHIFT); + mod.modifiers[MDFR_CONTROL_INDEX] = HasFlag(flags, MDFR_CTRL); + mod.modifiers[MDFR_ALT_INDEX] = HasFlag(flags, MDFR_ALT); + mod.modifiers[MDFR_COMMAND_INDEX] = HasFlag(flags, MDFR_CMND); + return(map_set_binding_key(mapping, map, custom, code, &mod)); +} +internal void +map_set_binding_key__wrapper(Mapping *mapping, Command_Map *map, + Custom_Command_Function *custom, Key_Code code, ...){ + va_list args; + va_start(args, code); + map_set_binding_key__wrapperv(mapping, map, custom, code, args); + va_end(args); +} + +#define MappingScope() Mapping *m = 0; Command_Map *map = 0 +#define SelectMapping(N) m = (N) +#define SelectMap(ID) map = mapping_get_or_make_map(m, (ID)) +#define ParentMap(ID) map_set_parent(m, map, (ID)) +#define BindTextInput(F) map_set_binding_text_input(map, (F)) +// TODO(allen): detect compiler and apply va args extensions correctly +#define Bind(F, K, ...) map_set_binding_key__wrapper(m, map, (F), (K), __VA_ARGS__, 0) + // BOTTOM diff --git a/4ed_command.h b/custom/4coder_command_map.h similarity index 97% rename from 4ed_command.h rename to custom/4coder_command_map.h index 5a3da70e..8efd05c1 100644 --- a/4ed_command.h +++ b/custom/4coder_command_map.h @@ -12,7 +12,7 @@ #if !defined(FRED_COMMAND_H) #define FRED_COMMAND_H -union Command_Binding{ +struct Command_Binding{ Custom_Command_Function *custom; }; diff --git a/custom/4coder_config.cpp b/custom/4coder_config.cpp index a7b5197f..8fc8864a 100644 --- a/custom/4coder_config.cpp +++ b/custom/4coder_config.cpp @@ -1125,21 +1125,6 @@ typed_array_reference_list(Arena *arena, Config *parsed, Config_Compound *compou //////////////////////////////// -static void -change_mapping(Application_Links *app, String_Const_u8 mapping){ - b32 did_remap = false; - for (i32 i = 0; i < named_map_count; ++i){ - if (string_match(mapping, named_maps[i].name)){ - did_remap = true; - named_maps[i].remap_command(app); - break; - } - } - if (!did_remap){ - print_message(app, string_u8_litexpr("Leaving bindings unaltered.\n")); - } -} - static void change_mode(Application_Links *app, String_Const_u8 mode){ fcoder_mode = FCoderMode_Original; @@ -1184,7 +1169,6 @@ config_init_default(Config_Data *config){ block_zero_struct(&config->code_exts); - config->current_mapping = SCu8(config->current_mapping_space, (umem)0); config->mode = SCu8(config->mode_space, (umem)0); config->use_scroll_bars = false; @@ -1248,9 +1232,6 @@ config_parse__data(Arena *arena, String_Const_u8 file_name, String_Const_u8 data config->code_exts = parse_extension_line_to_extension_list(arena, str); } - config_fixed_string_var(parsed, "mapping", 0, - &config->current_mapping, config->current_mapping_space); - config_fixed_string_var(parsed, "mode", 0, &config->mode, config->mode_space); @@ -1460,7 +1441,6 @@ load_config_and_apply(Application_Links *app, Arena *out_arena, Config_Data *con { config_feedback_string(scratch, &list, "user_name", config->user_name); config_feedback_extension_list(scratch, &list, "treat_as_code", &config->code_exts); - config_feedback_string(scratch, &list, "current_mapping", config->current_mapping); config_feedback_string(scratch, &list, "mode", config->mode); @@ -1507,7 +1487,6 @@ load_config_and_apply(Application_Links *app, Arena *out_arena, Config_Data *con end_temp(temp2); // Apply config - change_mapping(app, config->current_mapping); change_mode(app, config->mode); highlight_line_at_cursor = config->use_line_highlight; do_matching_enclosure_highlight = config->use_scope_highlight; diff --git a/custom/4coder_config.h b/custom/4coder_config.h index 938a73f4..b974cc0c 100644 --- a/custom/4coder_config.h +++ b/custom/4coder_config.h @@ -185,9 +185,6 @@ struct Config_Data{ String_Const_u8_Array code_exts; - u8 current_mapping_space[256]; - String_Const_u8 current_mapping; - u8 mode_space[64]; String_Const_u8 mode; diff --git a/custom/4coder_custom.cpp b/custom/4coder_custom.cpp index 8f604f4c..3dda1c74 100644 --- a/custom/4coder_custom.cpp +++ b/custom/4coder_custom.cpp @@ -9,10 +9,11 @@ get_version(i32 maj, i32 min, i32 patch){ return(maj == MAJOR && min == MINOR && patch == PATCH); } -extern "C" void +extern "C" Custom_Layer_Init_Type* init_apis(API_VTable_custom *custom_vtable, API_VTable_system *system_vtable){ custom_api_read_vtable(custom_vtable); system_api_read_vtable(system_vtable); + return(custom_layer_init); } // BOTTOM diff --git a/custom/4coder_default_bindings.cpp b/custom/4coder_default_bindings.cpp index 628bb95f..d6ed0aa4 100644 --- a/custom/4coder_default_bindings.cpp +++ b/custom/4coder_default_bindings.cpp @@ -8,25 +8,20 @@ #define FCODER_DEFAULT_BINDINGS_CPP #include "4coder_default_include.cpp" +#include "generated/remapping.h" // NOTE(allen|a4.0.22): This no longer serves as very good example code. // Good example code will be coming soon, but in the mean time you can go // to 4coder_remapping_commands.cpp for examples of what binding code looks like. #if !defined(NO_BINDING) -extern "C" i32 -get_bindings(void *data, i32 size){ - Bind_Helper context_ = begin_bind_helper(data, size); - Bind_Helper *context = &context_; - - set_all_default_hooks(context); -#if defined(__APPLE__) && defined(__MACH__) - mac_default_keys(context); -#else - default_keys(context); -#endif - - return(end_bind_helper(context)); +void +custom_layer_init(Application_Links *app){ + set_all_default_hooks(app); + Thread_Context *tctx = get_thread_context(app); + mapping_init(tctx, &framework_mapping); + setup_default_mapping(&framework_mapping); + fill_log_graph_command_map(&framework_mapping); } #endif //NO_BINDING diff --git a/custom/4coder_default_framework.cpp b/custom/4coder_default_framework.cpp index c2789de0..eacb1435 100644 --- a/custom/4coder_default_framework.cpp +++ b/custom/4coder_default_framework.cpp @@ -342,20 +342,6 @@ CUSTOM_DOC("Toggle fullscreen mode on or off. The change(s) do not take effect //////////////////////////////// -CUSTOM_COMMAND_SIG(remap_interactive) -CUSTOM_DOC("Switch to a named key binding map.") -{ - Query_Bar bar = {}; - u8 space[1024]; - bar.prompt = string_u8_litexpr("Map Name: "); - bar.string = SCu8(space, (umem)0); - bar.string_capacity = sizeof(space); - if (!query_user_string(app, &bar)) return; - change_mapping(app, bar.string); -} - -//////////////////////////////// - static void default_4coder_initialize(Application_Links *app, char **command_line_files, i32 file_count, i32 override_font_size, b32 override_hinting){ Thread_Context *tctx = get_thread_context(app); @@ -386,8 +372,11 @@ default_4coder_initialize(Application_Links *app, char **command_line_files, i32 view_highlight_range = managed_id_declare(app, SCu8("DEFAULT.highlight" )); view_highlight_buffer = managed_id_declare(app, SCu8("DEFAULT.highlight_buf" )); view_render_hook = managed_id_declare(app, SCu8("DEFAULT.render" )); + + buffer_map_id = managed_id_declare(app, SCu8("DEFAULT.buffer_map_id")); + sticky_jump_marker_handle = managed_id_declare(app, SCu8("DEFAULT.sticky_jump_marker_handle")); - attachment_tokens = managed_id_declare(app, SCu8("DEFAULT.tokens")); + attachment_tokens = managed_id_declare(app, SCu8("DEFAULT.tokens")); // open command line files Scratch_Block scratch(app); diff --git a/custom/4coder_default_framework.h b/custom/4coder_default_framework.h index a9132900..c4d23203 100644 --- a/custom/4coder_default_framework.h +++ b/custom/4coder_default_framework.h @@ -7,13 +7,6 @@ #if !defined(FCODER_DEFAULT_FRAMEWORK_H) #define FCODER_DEFAULT_FRAMEWORK_H -enum Default_Maps{ - default_code_map = 1, - default_lister_ui_map, - default_log_graph_map, - default_maps_count, -}; - //////////////////////////////// typedef i64 Rewrite_Type; diff --git a/custom/4coder_default_framework_variables.cpp b/custom/4coder_default_framework_variables.cpp index fa3bdd7f..446a1453 100644 --- a/custom/4coder_default_framework_variables.cpp +++ b/custom/4coder_default_framework_variables.cpp @@ -5,9 +5,6 @@ the default 4coder behavior. // TOP -global Named_Mapping *named_maps = 0; -global i32 named_map_count = 0; - global b32 allow_immediate_close_without_checking_for_changes = false; global char *default_extensions[] = { @@ -44,6 +41,8 @@ global Managed_ID view_highlight_range = 0; global Managed_ID view_highlight_buffer = 0; global Managed_ID view_render_hook = 0; +global Managed_ID buffer_map_id = 0; + global Managed_ID sticky_jump_marker_handle = 0; global Managed_ID attachment_tokens = 0; @@ -80,5 +79,16 @@ global Config_Data global_config = {}; global char previous_isearch_query[256] = {}; +global Mapping framework_mapping = {}; + +enum{ + mapid_global = 1, + mapid_file, + default_code_map, + default_lister_ui_map, + default_log_graph_map, + default_maps_count, +}; + // BOTTOM diff --git a/custom/4coder_default_hooks.cpp b/custom/4coder_default_hooks.cpp index 5bd00487..66e2fa35 100644 --- a/custom/4coder_default_hooks.cpp +++ b/custom/4coder_default_hooks.cpp @@ -4,17 +4,7 @@ // TOP -CUSTOM_COMMAND_SIG(set_bindings_choose); -CUSTOM_COMMAND_SIG(set_bindings_default); - -global Named_Mapping named_maps_values[] = { - {string_u8_litexpr("choose") , set_bindings_choose }, - {string_u8_litexpr("default") , set_bindings_default }, -}; - START_HOOK_SIG(default_start){ - named_maps = named_maps_values; - named_map_count = ArrayCount(named_maps_values); default_4coder_initialize(app, files, file_count); default_4coder_side_by_side_panels(app, files, file_count); if (global_config.automatically_load_project){ @@ -24,48 +14,74 @@ START_HOOK_SIG(default_start){ return(0); } -// NOTE(allen|a4.0.9): All command calls can now go through this hook -// If this hook is not implemented a default behavior of calling the -// command is used. It is important to note that paste_next does not -// work without this hook. -// NOTE(allen|a4.0.10): As of this version the word_complete command -// also relies on this particular command caller hook. COMMAND_CALLER_HOOK(default_command_caller){ - // app, cmd + // app + // NOTE(allen): Get the binding from the buffer's current map + User_Input input = get_command_input(app); View_ID view = get_active_view(app, AccessAll); - Managed_Scope scope = view_get_managed_scope(app, view); - Rewrite_Type *next_rewrite = scope_attachment(app, scope, view_next_rewrite_loc, Rewrite_Type); - *next_rewrite = Rewrite_None; - if (fcoder_mode == FCoderMode_NotepadLike){ - for (View_ID view_it = get_view_next(app, 0, AccessAll); - view_it != 0; - view_it = get_view_next(app, view_it, AccessAll)){ - Managed_Scope scope_it = view_get_managed_scope(app, view_it); - b32 *snap_mark_to_cursor = scope_attachment(app, scope_it, view_snap_mark_to_cursor, b32); - *snap_mark_to_cursor = true; + + 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; } - cmd(app); + Command_Binding binding = map_get_binding_recursive(&framework_mapping, map_id, &input.event); - next_rewrite = scope_attachment(app, scope, view_next_rewrite_loc, Rewrite_Type); - if (next_rewrite != 0){ - Rewrite_Type *rewrite = scope_attachment(app, scope, view_rewrite_loc, Rewrite_Type); - *rewrite = *next_rewrite; + if (binding.custom == 0){ + // NOTE(allen): we don't have anything to do with this input, + // leave it marked unhandled so that if there's a follow up + // event it is not blocked. + leave_command_input_unhandled(app); + } + else{ + // NOTE(allen): before the command is called do some book keeping + Managed_Scope scope = view_get_managed_scope(app, view); + Rewrite_Type *next_rewrite = scope_attachment(app, scope, view_next_rewrite_loc, Rewrite_Type); + *next_rewrite = Rewrite_None; if (fcoder_mode == FCoderMode_NotepadLike){ for (View_ID view_it = get_view_next(app, 0, AccessAll); view_it != 0; view_it = get_view_next(app, view_it, AccessAll)){ Managed_Scope scope_it = view_get_managed_scope(app, view_it); b32 *snap_mark_to_cursor = scope_attachment(app, scope_it, view_snap_mark_to_cursor, b32); - if (*snap_mark_to_cursor){ - i64 pos = view_get_cursor_pos(app, view_it); - view_set_mark(app, view_it, seek_pos(pos)); + *snap_mark_to_cursor = true; + } + } + + // NOTE(allen): call the command + binding.custom(app); + + // NOTE(allen): after the command is called do some book keeping + next_rewrite = scope_attachment(app, scope, view_next_rewrite_loc, Rewrite_Type); + if (next_rewrite != 0){ + Rewrite_Type *rewrite = scope_attachment(app, scope, view_rewrite_loc, Rewrite_Type); + *rewrite = *next_rewrite; + if (fcoder_mode == FCoderMode_NotepadLike){ + for (View_ID view_it = get_view_next(app, 0, AccessAll); + view_it != 0; + view_it = get_view_next(app, view_it, AccessAll)){ + Managed_Scope scope_it = view_get_managed_scope(app, view_it); + b32 *snap_mark_to_cursor = scope_attachment(app, scope_it, view_snap_mark_to_cursor, b32); + if (*snap_mark_to_cursor){ + i64 pos = view_get_cursor_pos(app, view_it); + view_set_mark(app, view_it, seek_pos(pos)); + } } } } } + return(0); } @@ -1024,15 +1040,9 @@ BUFFER_HOOK_SIG(default_file_settings){ } Command_Map_ID map_id = (treat_as_code)?(default_code_map):(mapid_file); - Command_Map_ID map_id_query = 0; - - buffer_set_setting(app, buffer_id, BufferSetting_MapID, default_lister_ui_map); - buffer_get_setting(app, buffer_id, BufferSetting_MapID, &map_id_query); - Assert(map_id_query == default_lister_ui_map); - - buffer_set_setting(app, buffer_id, BufferSetting_MapID, map_id); - buffer_get_setting(app, buffer_id, BufferSetting_MapID, &map_id_query); - Assert(map_id_query == map_id); + Managed_Scope scope = buffer_get_managed_scope(app, buffer_id); + Command_Map_ID *map_id_ptr = scope_attachment(app, scope, buffer_map_id, Command_Map_ID); + *map_id_ptr = map_id; // NOTE(allen): Decide buffer settings b32 wrap_lines = true; @@ -1274,26 +1284,25 @@ DELTA_RULE_SIG(smooth_scroll_rule){ } internal void -set_all_default_hooks(Bind_Helper *context){ - set_hook(context, hook_exit, default_exit); - set_hook(context, hook_buffer_viewer_update, default_view_adjust); +set_all_default_hooks(Application_Links *app){ + set_custom_hook(app, HookID_Exit, default_exit); + set_custom_hook(app, HookID_BufferViewerUpdate, default_view_adjust); - set_start_hook(context, default_start); - set_open_file_hook(context, default_file_settings); - set_new_file_hook(context, default_new_file); - set_save_file_hook(context, default_file_save); - set_file_edit_range_hook(context, default_file_edit_range); - set_file_externally_modified_hook(context, default_file_externally_modified); + set_custom_hook(app, HookID_Start, default_start); + set_custom_hook(app, HookID_OpenFile, default_file_settings); + set_custom_hook(app, HookID_NewFile, default_new_file); + set_custom_hook(app, HookID_SaveFile, default_file_save); + set_custom_hook(app, HookID_FileEditRange, default_file_edit_range); + set_custom_hook(app, HookID_FileExternallyModified, default_file_externally_modified); + set_custom_hook(app, HookID_EndFile, end_file_close_jump_list); - set_end_file_hook(context, end_file_close_jump_list); - - set_command_caller(context, default_command_caller); - set_render_caller(context, default_render_caller); - set_input_filter(context, default_suppress_mouse_filter); - set_scroll_rule(context, smooth_scroll_rule); - set_buffer_name_resolver(context, default_buffer_name_resolution); - set_modify_color_table_hook(context, default_modify_color_table); - set_get_view_buffer_region_hook(context, default_view_buffer_region); + set_custom_hook(app, HookID_CommandCaller, default_command_caller); + set_custom_hook(app, HookID_RenderCaller, default_render_caller); + set_custom_hook(app, HookID_InputFilter, default_suppress_mouse_filter); + set_custom_hook(app, HookID_ScrollRule, smooth_scroll_rule); + set_custom_hook(app, HookID_BufferNameResolver, default_buffer_name_resolution); + set_custom_hook(app, HookID_ModifyColorTable, default_modify_color_table); + set_custom_hook(app, HookID_GetViewBufferRegion, default_view_buffer_region); } // BOTTOM diff --git a/custom/4coder_default_include.cpp b/custom/4coder_default_include.cpp index 05571955..9b94b29a 100644 --- a/custom/4coder_default_include.cpp +++ b/custom/4coder_default_include.cpp @@ -25,8 +25,8 @@ #include "4coder_table.h" #include "4coder_token.h" - #include "generated/lexer_cpp.h" +#include "4coder_command_map.h" #include "4coder_string_match.h" #include "4coder_helper.h" #include "4coder_insertion.h" @@ -63,6 +63,7 @@ #include "4coder_token.cpp" #include "generated/lexer_cpp.cpp" +#include "4coder_command_map.cpp" #include "4coder_default_framework_variables.cpp" #include "4coder_helper.cpp" #include "4coder_fancy.cpp" @@ -89,7 +90,6 @@ #include "4coder_miblo_numbers.cpp" #include "4coder_default_hooks.cpp" -#include "4coder_remapping_commands.cpp" #endif diff --git a/custom/4coder_helper.cpp b/custom/4coder_helper.cpp index 0d1a7b1b..e49abeb4 100644 --- a/custom/4coder_helper.cpp +++ b/custom/4coder_helper.cpp @@ -6,275 +6,7 @@ #define scope_attachment(app,S,I,T) ((T*)managed_scope_get_attachment((app), (S), (I), sizeof(T))) -//////////////////////////////// - -internal Binding_Unit* -write_unit(Bind_Helper *helper, Binding_Unit unit){ - Binding_Unit *p = 0; - helper->write_total += sizeof(*p); - if (helper->error == 0 && helper->cursor != helper->end){ - p = helper->cursor++; - *p = unit; - } - return p; -} - -internal Bind_Helper -begin_bind_helper(void *data, i32 size){ - Bind_Helper result = {}; - result.cursor = (Binding_Unit*)data; - result.start = result.cursor; - result.end = result.start + size / sizeof(*result.cursor); - Binding_Unit unit = {}; - unit.type = unit_header; - unit.header.total_size = sizeof(*result.header); - result.header = write_unit(&result, unit); - result.header->header.user_map_count = 0; - return(result); -} - -internal void -begin_map(Bind_Helper *helper, i32 mapid, b32 replace){ - if (helper->group != 0 && helper->error == 0){ - helper->error = BH_ERR_MISSING_END; - } - if (!helper->error && mapid < mapid_global){ - ++helper->header->header.user_map_count; - } - - Binding_Unit unit; - unit.type = unit_map_begin; - unit.map_begin.mapid = mapid; - unit.map_begin.replace = replace; - helper->group = write_unit(helper, unit); - helper->group->map_begin.bind_count = 0; -} - -internal void -begin_map(Bind_Helper *helper, i32 mapid){ - begin_map(helper, mapid, false); -} - -internal void -restart_map(Bind_Helper *helper, i32 mapid){ - begin_map(helper, mapid, true); -} - -internal void -end_map(Bind_Helper *helper){ - if (helper->group == 0 && helper->error == 0){ - helper->error = BH_ERR_MISSING_BEGIN; - } - helper->group = 0; -} - -internal void -bind(Bind_Helper *helper, Key_Code code, u8 modifiers, Custom_Command_Function *func){ - if (helper->group == 0 && helper->error == 0){ - helper->error = BH_ERR_MISSING_BEGIN; - } - if (!helper->error){ - ++helper->group->map_begin.bind_count; - } - - Binding_Unit unit; - unit.type = unit_callback; - unit.callback.func = func; - unit.callback.code = code; - unit.callback.modifiers = modifiers; - - write_unit(helper, unit); -} - -internal void -bind_text_input(Bind_Helper *helper, Custom_Command_Function *func){ - bind(helper, 0, 0, func); -} - -internal void -bind_text_input(Bind_Helper *helper, unsigned char modifiers, Custom_Command_Function *func){ - bind(helper, 0, modifiers, func); -} - -internal void -inherit_map(Bind_Helper *helper, i32 mapid){ - if (helper->group == 0 && helper->error == 0) helper->error = BH_ERR_MISSING_BEGIN; - if (!helper->error && mapid < mapid_global) ++helper->header->header.user_map_count; - Binding_Unit unit = {}; - unit.type = unit_inherit; - unit.map_inherit.mapid = mapid; - write_unit(helper, unit); -} - -internal void -set_hook(Bind_Helper *helper, i32 hook_id, Hook_Function *func){ - Binding_Unit unit = {}; - unit.type = unit_hook; - unit.hook.hook_id = hook_id; - unit.hook.func = (void*)func; - write_unit(helper, unit); -} - -internal void -set_scroll_rule(Bind_Helper *helper, Delta_Rule_Function *func){ - Binding_Unit unit = {}; - unit.type = unit_hook; - unit.hook.hook_id = special_hook_scroll_rule; - unit.hook.func = (void*)func; - write_unit(helper, unit); -} - -internal void -set_buffer_name_resolver(Bind_Helper *helper, Buffer_Name_Resolver_Function *func){ - Binding_Unit unit = {}; - unit.type = unit_hook; - unit.hook.hook_id = special_hook_buffer_name_resolver; - unit.hook.func = (void*)func; - write_unit(helper, unit); -} - -internal void -set_modify_color_table_hook(Bind_Helper *helper, Modify_Color_Table_Function *func){ - Binding_Unit unit = {}; - unit.type = unit_hook; - unit.hook.hook_id = special_hook_modify_color_table; - unit.hook.func = (void*)func; - write_unit(helper, unit); -} - -internal void -set_clipboard_change_hook(Bind_Helper *helper, Clipboard_Change_Hook_Function *func){ - Binding_Unit unit = {}; - unit.type = unit_hook; - unit.hook.hook_id = special_hook_clipboard_change; - unit.hook.func = (void*)func; - write_unit(helper, unit); -} - -internal void -set_get_view_buffer_region_hook(Bind_Helper *helper, Get_View_Buffer_Region_Function *func){ - Binding_Unit unit = {}; - unit.type = unit_hook; - unit.hook.hook_id = special_hook_get_view_buffer_region; - unit.hook.func = (void*)func; - write_unit(helper, unit); -} - -internal void -set_new_file_hook(Bind_Helper *helper, Buffer_Hook_Function *func){ - Binding_Unit unit = {}; - unit.type = unit_hook; - unit.hook.hook_id = special_hook_new_file; - unit.hook.func = (void*)func; - write_unit(helper, unit); -} - -internal void -set_start_hook(Bind_Helper *helper, Start_Hook_Function *func){ - Binding_Unit unit = {}; - unit.type = unit_hook; - unit.hook.hook_id = special_hook_start; - unit.hook.func = (void*)func; - write_unit(helper, unit); -} - -internal void -set_open_file_hook(Bind_Helper *helper, Buffer_Hook_Function *func){ - Binding_Unit unit = {}; - unit.type = unit_hook; - unit.hook.hook_id = special_hook_open_file; - unit.hook.func = (void*)func; - write_unit(helper, unit); -} - -internal void -set_save_file_hook(Bind_Helper *helper, Buffer_Hook_Function *func){ - Binding_Unit unit = {}; - unit.type = unit_hook; - unit.hook.hook_id = special_hook_save_file; - unit.hook.func = (void*)func; - write_unit(helper, unit); -} - -internal void -set_end_file_hook(Bind_Helper *helper, Buffer_Hook_Function *func){ - Binding_Unit unit = {}; - unit.type = unit_hook; - unit.hook.hook_id = special_hook_end_file; - unit.hook.func = (void*)func; - write_unit(helper, unit); -} - -internal void -set_file_edit_range_hook(Bind_Helper *helper, File_Edit_Range_Function *func){ - Binding_Unit unit = {}; - unit.type = unit_hook; - unit.hook.hook_id = special_hook_file_edit_range; - unit.hook.func = (void*)func; - write_unit(helper, unit); -} - -internal void -set_file_externally_modified_hook(Bind_Helper *helper, File_Externally_Modified_Function *func){ - Binding_Unit unit = {}; - unit.type = unit_hook; - unit.hook.hook_id = special_hook_file_externally_modified; - unit.hook.func = (void*)func; - write_unit(helper, unit); -} - -internal void -set_command_caller(Bind_Helper *helper, Command_Caller_Hook_Function *func){ - Binding_Unit unit = {}; - unit.type = unit_hook; - unit.hook.hook_id = special_hook_command_caller; - unit.hook.func = (void*)func; - write_unit(helper, unit); -} - -internal void -set_render_caller(Bind_Helper *helper, Render_Caller_Function *func){ - Binding_Unit unit = {}; - unit.type = unit_hook; - unit.hook.hook_id = special_hook_render_caller; - unit.hook.func = (void*)func; - write_unit(helper, unit); -} - -internal void -set_input_filter(Bind_Helper *helper, Input_Filter_Function *func){ - Binding_Unit unit = {}; - unit.type = unit_hook; - unit.hook.hook_id = special_hook_input_filter; - unit.hook.func = (void*)func; - write_unit(helper, unit); -} - -internal i32 -end_bind_helper(Bind_Helper *helper){ - if (helper->header){ - helper->header->header.total_size = (i32)(helper->cursor - helper->start); - helper->header->header.error = helper->error; - } - i32 result = helper->write_total; - return(result); -} - -internal Bind_Buffer -end_bind_helper_get_buffer(Bind_Helper *helper){ - i32 size = end_bind_helper(helper); - Bind_Buffer result = {}; - result.data = helper->start; - result.size = size; - return(result); -} - -internal u32 -get_key_code(char *buffer){ - String_Const_u8 str = SCu8(buffer); - Character_Consume_Result consume = utf8_consume(str.str, str.size); - return(consume.codepoint); -} +#define set_custom_hook(app,ID,F) set_custom_hook((app),(ID),(Void_Func*)(F)) //////////////////////////////// @@ -1552,7 +1284,7 @@ query_user_general(Application_Links *app, Query_Bar *bar, b32 force_number){ // types specified in the flags. The first set of flags are inputs you'd like to intercept // that you don't want to abort on. The second set are inputs that you'd like to cause // the command to abort. If an event satisfies both flags, it is treated as an abort. - User_Input in = get_user_input(app, EventProperty_AnyKey, + User_Input in = get_user_input(app, EventPropertyGroup_AnyKeyboardEvent, EventProperty_Escape| EventProperty_MouseLeft| EventProperty_MouseRight); @@ -1600,6 +1332,9 @@ query_user_general(Application_Links *app, Query_Bar *bar, b32 force_number){ string_append(&string, insert_string); bar->string = string.string; } + else{ + leave_command_input_unhandled(app); + } } return(success); diff --git a/custom/4coder_helper.h b/custom/4coder_helper.h index 254b2889..1a92ab3c 100644 --- a/custom/4coder_helper.h +++ b/custom/4coder_helper.h @@ -7,25 +7,6 @@ #if !defined(FCODER_HELPER_H) #define FCODER_HELPER_H -struct Bind_Helper{ - Binding_Unit *cursor, *start, *end; - Binding_Unit *header, *group; - i32 write_total; - i32 error; -}; - -#define BH_ERR_NONE 0 -#define BH_ERR_MISSING_END 1 -#define BH_ERR_MISSING_BEGIN 2 -#define BH_ERR_OUT_OF_MEMORY 3 - -struct Bind_Buffer{ - void *data; - i32 size; -}; - -//////////////////////////////// - struct File_Name_Data{ String_Const_u8 file_name; Data data; diff --git a/custom/4coder_log_parser.cpp b/custom/4coder_log_parser.cpp index 3dfbea8a..48780018 100644 --- a/custom/4coder_log_parser.cpp +++ b/custom/4coder_log_parser.cpp @@ -1021,15 +1021,16 @@ CUSTOM_DOC("Jump to the code that logged the event record at the mouse point in } internal void -fill_log_graph_command_map(Bind_Helper *context){ - begin_map(context, default_log_graph_map); - bind(context, KeyCode_Escape, MDFR_NONE, log_graph__escape); - //bind(context, KeyCodeExt_MouseWheel, MDFR_NONE, log_graph__scroll_wheel); - //bind(context, KeyCodeExt_MouseLeft, MDFR_NONE, log_graph__click_jump_to_event_source); - //bind(context, KeyCodeExt_MouseRight, MDFR_NONE, log_graph__click_select_event); - bind(context, KeyCode_PageUp, MDFR_NONE, log_graph__page_up); - bind(context, KeyCode_PageDown, MDFR_NONE, log_graph__page_down); - end_map(context); +fill_log_graph_command_map(Mapping *mapping){ + MappingScope(); + SelectMapping(mapping); + SelectMap(default_log_graph_map); + Bind(log_graph__escape, KeyCode_Escape); + //Bind(KeyCodeExt_MouseWheel, MDFR_NONE, log_graph__scroll_wheel); + //Bind(KeyCodeExt_MouseLeft, MDFR_NONE, log_graph__click_jump_to_event_source); + //Bind(KeyCodeExt_MouseRight, MDFR_NONE, log_graph__click_select_event); + Bind(log_graph__page_up, KeyCode_PageUp); + Bind(log_graph__page_down, KeyCode_PageDown); } CUSTOM_COMMAND_SIG(show_the_log_graph) diff --git a/custom/4coder_remapping_commands.cpp b/custom/4coder_remapping_commands.cpp deleted file mode 100644 index ae7ebe50..00000000 --- a/custom/4coder_remapping_commands.cpp +++ /dev/null @@ -1,58 +0,0 @@ -/* -4coder_remapping_commands.cpp - Commands that remap all of the keys to one of the maps -in the set of default maps. -*/ - -// TOP - -#if !defined(FCODER_REMAPPING_COMMANDS_CPP) -#define FCODER_REMAPPING_COMMANDS_CPP - -// -// Buffer Filling Helpers -// - -#include "generated/remapping.h" - -void -default_keys(Bind_Helper *context){ - fill_keys_default(context); - fill_log_graph_command_map(context); -} - -// -// Remapping Commands -// - -static Bind_Helper -get_context_on_arena(Arena *arena){ - Bind_Helper result = {}; - result = begin_bind_helper(push_array(arena, char, MB(1)), MB(1)); - return(result); -} - -CUSTOM_COMMAND_SIG(set_bindings_choose) -CUSTOM_DOC("Remap keybindings using the 'choose' mapping rule.") -{ -#if OS_WINDOWS || OS_LINUX - set_bindings_default(app); -#elif OS_MAC - set_bindings_mac_default(app); -#endif -} - -CUSTOM_COMMAND_SIG(set_bindings_default) -CUSTOM_DOC("Remap keybindings using the 'default' mapping rule.") -{ - Scratch_Block scratch(app, Scratch_Share); - Bind_Helper context = get_context_on_arena(scratch); - set_all_default_hooks(&context); - default_keys(&context); - Bind_Buffer result = end_bind_helper_get_buffer(&context); - global_set_mapping(app, result.data, result.size); -} - -#endif - -// BOTTOM - diff --git a/custom/4coder_types.h b/custom/4coder_types.h index 2fed6bee..9efd5c25 100644 --- a/custom/4coder_types.h +++ b/custom/4coder_types.h @@ -18,9 +18,12 @@ struct Application_Links{ void *current_coroutine; i32 type_coroutine; }; -typedef b32 _Get_Version_Function(i32 maj, i32 min, i32 patch); -typedef void _Init_APIs(struct API_VTable_custom *custom_vtable, - struct API_VTable_system *system_vtable); +typedef void Custom_Layer_Init_Type(Application_Links *app); +void custom_layer_init(Application_Links *app); + +typedef b32 _Get_Version_Type(i32 maj, i32 min, i32 patch); +typedef Custom_Layer_Init_Type *_Init_APIs_Type(struct API_VTable_custom *custom_vtable, + struct API_VTable_system *system_vtable); //////////////////////////////// @@ -89,7 +92,6 @@ ENUM(i32, Global_Setting_ID){ ENUM(i32, Buffer_Setting_ID){ BufferSetting_Null, - BufferSetting_MapID, BufferSetting_Eol, BufferSetting_Unimportant, BufferSetting_ReadOnly, @@ -455,9 +457,9 @@ TYPEDEF void Custom_Command_Function(struct Application_Links *app); #define CUSTOM_ALIAS(x) CUSTOM_ALIAS(x) #endif +// TODO(allen): rename STRUCT User_Input{ Input_Event event; - Custom_Command_Function *command; b32 abort; }; @@ -469,42 +471,37 @@ STRUCT Frame_Info{ TYPEDEF_FUNC void Render_Callback(struct Application_Links *app); -ENUM(i32, Hook_ID){ - hook_file_out_of_sync, - hook_exit, - hook_buffer_viewer_update, - // never below this - hook_type_count +typedef i32 Hook_ID; +enum{ + HookID_FileOutOfSync, + HookID_Exit, + HookID_BufferViewerUpdate, + HookID_ScrollRule, + HookID_NewFile, + HookID_OpenFile, + HookID_SaveFile, + HookID_EndFile, + HookID_FileEditRange, + HookID_FileExternallyModified, + HookID_CommandCaller, + HookID_RenderCaller, + HookID_InputFilter, + HookID_Start, + HookID_BufferNameResolver, + HookID_ModifyColorTable, + HookID_ClipboardChange, + HookID_GetViewBufferRegion, }; -ENUM(i32, Special_Hook_ID){ - special_hook_scroll_rule = hook_type_count, - special_hook_new_file, - special_hook_open_file, - special_hook_save_file, - special_hook_end_file, - special_hook_file_edit_range, - special_hook_file_edit_finished, - special_hook_file_externally_modified, - special_hook_command_caller, - special_hook_render_caller, - special_hook_input_filter, - special_hook_start, - special_hook_buffer_name_resolver, - special_hook_modify_color_table, - special_hook_clipboard_change, - special_hook_get_view_buffer_region, -}; - -TYPEDEF_FUNC i32 Command_Caller_Hook_Function(struct Application_Links *app, Custom_Command_Function *cmd); -#define COMMAND_CALLER_HOOK(name) i32 name(struct Application_Links *app, Custom_Command_Function *cmd) - -TYPEDEF_FUNC void Render_Caller_Function(struct Application_Links *app, Frame_Info frame_info); -#define RENDER_CALLER_SIG(name) void name(struct Application_Links *app, Frame_Info frame_info) - TYPEDEF_FUNC i32 Hook_Function(struct Application_Links *app); #define HOOK_SIG(name) i32 name(struct Application_Links *app) +TYPEDEF_FUNC i32 Command_Caller_Hook_Function(struct Application_Links *app); +#define COMMAND_CALLER_HOOK(name) i32 name(struct Application_Links *app) + +TYPEDEF_FUNC void Render_Caller_Function(struct Application_Links *app, Frame_Info frame_info); +#define RENDER_CALLER_SIG(name) void name(struct Application_Links *app, Frame_Info frame_info) + TYPEDEF_FUNC i32 Buffer_Hook_Function(struct Application_Links *app, Buffer_ID buffer_id); #define BUFFER_HOOK_SIG(name) i32 name(struct Application_Links *app, Buffer_ID buffer_id) @@ -560,36 +557,6 @@ TYPEDEF_FUNC i32 Get_Binding_Data_Function(void *data, i32 size); typedef i64 Command_Map_ID; -// NOTE(allen): Definitions for the format that Get_Binding_Data uses to launch 4coder. -// TODO(allen): Transition to a more dynamic Command_Map system. - - -ENUM(i32, Binding_Unit_Type){ - unit_header, - unit_map_begin, - unit_callback, - unit_inherit, - unit_hook -}; - -ENUM(i32, Map_ID){ - mapid_global = (1 << 24), - mapid_file, - mapid_nomap -}; - - -STRUCT Binding_Unit{ - Binding_Unit_Type type; - UNION{ - STRUCT{ i32 total_size; i32 user_map_count; i32 error; } header; - STRUCT{ i32 mapid; i32 replace; i32 bind_count; } map_begin; - STRUCT{ i32 mapid; } map_inherit; - STRUCT{ Key_Code code; uint8_t modifiers; Custom_Command_Function *func; } callback; - STRUCT{ i32 hook_id; void *func; } hook; - }; -}; - STRUCT Color_Picker{ String_Const_u8 title; argb_color *dest; diff --git a/custom/bin/buildsuper_x64.bat b/custom/bin/buildsuper_x64.bat index 4b0d4011..57d69fcb 100644 --- a/custom/bin/buildsuper_x64.bat +++ b/custom/bin/buildsuper_x64.bat @@ -40,7 +40,7 @@ set preproc_file=4coder_command_metadata.i set meta_opts=/P /Fi%preproc_file% /DMETA_PASS set build_dll=/LD /link /INCREMENTAL:NO /OPT:REF /RELEASE /PDBALTPATH:%%%%_PDB%%%% -set build_dll=%build_dll% /EXPORT:get_bindings /EXPORT:get_version /EXPORT:init_apis +set build_dll=%build_dll% /EXPORT:get_version /EXPORT:init_apis call cl %opts% %meta_opts% %target% call cl %opts% "%custom_root%\4coder_metadata_generator.cpp" /Femetadata_generator diff --git a/custom/bin/buildsuper_x86.bat b/custom/bin/buildsuper_x86.bat index e591d146..934dbf68 100644 --- a/custom/bin/buildsuper_x86.bat +++ b/custom/bin/buildsuper_x86.bat @@ -17,7 +17,7 @@ set opts=%opts% /GR- /nologo /FC set debug=/Zi set release=/O2 /Zi set build_dll=/LD /link /INCREMENTAL:NO /OPT:REF -set build_dll=%build_dll% /EXPORT:get_bindings /EXPORT:get_version /EXPORT:init_apis +set build_dll=%build_dll% /EXPORT:get_version /EXPORT:init_apis set mode=%debug% if "%2" == "release" (set mode=%release%) diff --git a/custom/generated/command_metadata.h b/custom/generated/command_metadata.h index 22db7c2b..4e217561 100644 --- a/custom/generated/command_metadata.h +++ b/custom/generated/command_metadata.h @@ -2,14 +2,14 @@ #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 227 +#define command_one_past_last_id 224 #if defined(CUSTOM_COMMAND_SIG) #define PROC_LINKS(x,y) x #else #define PROC_LINKS(x,y) y #endif #if defined(CUSTOM_COMMAND_SIG) -CUSTOM_COMMAND_SIG(set_bindings_default); +CUSTOM_COMMAND_SIG(miblo_decrement_time_stamp_minute); CUSTOM_COMMAND_SIG(seek_beginning_of_textual_line); CUSTOM_COMMAND_SIG(seek_end_of_textual_line); CUSTOM_COMMAND_SIG(seek_beginning_of_line); @@ -29,7 +29,6 @@ CUSTOM_COMMAND_SIG(toggle_highlight_line_at_cursor); CUSTOM_COMMAND_SIG(toggle_highlight_enclosing_scopes); CUSTOM_COMMAND_SIG(toggle_paren_matching_helper); CUSTOM_COMMAND_SIG(toggle_fullscreen); -CUSTOM_COMMAND_SIG(remap_interactive); CUSTOM_COMMAND_SIG(write_text_input); CUSTOM_COMMAND_SIG(write_space); CUSTOM_COMMAND_SIG(write_underscore); @@ -234,8 +233,6 @@ CUSTOM_COMMAND_SIG(miblo_decrement_basic); CUSTOM_COMMAND_SIG(miblo_increment_time_stamp); CUSTOM_COMMAND_SIG(miblo_decrement_time_stamp); CUSTOM_COMMAND_SIG(miblo_increment_time_stamp_minute); -CUSTOM_COMMAND_SIG(miblo_decrement_time_stamp_minute); -CUSTOM_COMMAND_SIG(set_bindings_choose); #endif struct Command_Metadata{ PROC_LINKS(Custom_Command_Function, void) *proc; @@ -247,14 +244,14 @@ char *source_name; i32 source_name_len; i32 line_number; }; -static Command_Metadata fcoder_metacmd_table[227] = { -{ PROC_LINKS(set_bindings_default, 0), "set_bindings_default", 20, "Remap keybindings using the 'default' mapping rule.", 51, "w:\\4ed\\code\\custom\\4coder_remapping_commands.cpp", 48, 44 }, -{ 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, 2221 }, -{ 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, 2227 }, -{ 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, 2233 }, -{ 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, 2239 }, -{ 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, 2245 }, -{ 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, 2253 }, +static Command_Metadata fcoder_metacmd_table[224] = { +{ PROC_LINKS(miblo_decrement_time_stamp_minute, 0), "miblo_decrement_time_stamp_minute", 33, "Decrement a time stamp under the cursor by one minute. (format [m]m:ss or h:mm:ss", 81, "w:\\4ed\\code\\custom\\4coder_miblo_numbers.cpp", 43, 249 }, +{ 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, 1956 }, +{ 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, 1962 }, +{ 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, 1968 }, +{ 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, 1974 }, +{ 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, 1980 }, +{ 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, 1988 }, { 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 }, @@ -268,7 +265,6 @@ static Command_Metadata fcoder_metacmd_table[227] = { { 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(remap_interactive, 0), "remap_interactive", 17, "Switch to a named key binding map.", 34, "w:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 345 }, { 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 }, @@ -335,37 +331,37 @@ static Command_Metadata fcoder_metacmd_table[227] = { { 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, 972 }, -{ 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, 978 }, -{ 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, 984 }, -{ 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, 995 }, -{ 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, 1046 }, -{ 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, 1055 }, -{ 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, 1064 }, -{ 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, 1157 }, -{ 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, 1177 }, -{ 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, 1193 }, -{ 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, 1228 }, -{ 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, 1253 }, -{ 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, 1291 }, -{ 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, 1323 }, -{ 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, 1360 }, -{ 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, 1393 }, -{ 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, 1399 }, -{ 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, 1405 }, -{ 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, 1419 }, -{ 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, 1484 }, -{ 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, 1516 }, -{ 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, 1529 }, -{ 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, 1541 }, -{ PROC_LINKS(kill_buffer, 0), "kill_buffer", 11, "Kills the current buffer.", 25, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1577 }, -{ PROC_LINKS(save, 0), "save", 4, "Saves the current buffer.", 25, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1585 }, -{ PROC_LINKS(reopen, 0), "reopen", 6, "Reopen the current buffer from the hard drive.", 46, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1595 }, -{ 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, 1822 }, -{ 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, 1835 }, -{ 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, 1849 }, -{ 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, 1920 }, -{ 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, 2021 }, +{ 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, 982 }, +{ 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, 988 }, +{ 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, 994 }, +{ 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, 1005 }, +{ 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, 1056 }, +{ 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, 1065 }, +{ 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, 1074 }, +{ 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, 1167 }, +{ 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, 1187 }, +{ 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, 1203 }, +{ 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, 1238 }, +{ 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, 1263 }, +{ 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, 1306 }, +{ 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, 1338 }, +{ 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, 1375 }, +{ 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, 1408 }, +{ 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, 1414 }, +{ 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, 1420 }, +{ 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, 1434 }, +{ 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, 1499 }, +{ 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, 1531 }, +{ 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, 1544 }, +{ 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, 1556 }, +{ PROC_LINKS(kill_buffer, 0), "kill_buffer", 11, "Kills the current buffer.", 25, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1592 }, +{ PROC_LINKS(save, 0), "save", 4, "Saves the current buffer.", 25, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1600 }, +{ PROC_LINKS(reopen, 0), "reopen", 6, "Reopen the current buffer from the hard drive.", 46, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1610 }, +{ 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, 1837 }, +{ 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, 1850 }, +{ 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, 1864 }, +{ 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, 1935 }, +{ 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, 2036 }, { PROC_LINKS(lister__quit, 0), "lister__quit", 12, "A lister mode command that quits the list without executing any actions.", 72, "w:\\4ed\\code\\custom\\4coder_lists.cpp", 35, 8 }, { PROC_LINKS(lister__activate, 0), "lister__activate", 16, "A lister mode command that activates the list's action on the highlighted item.", 79, "w:\\4ed\\code\\custom\\4coder_lists.cpp", 35, 15 }, { PROC_LINKS(lister__write_character, 0), "lister__write_character", 23, "A lister mode command that dispatches to the lister's write character handler.", 78, "w:\\4ed\\code\\custom\\4coder_lists.cpp", 35, 30 }, @@ -421,7 +417,7 @@ static Command_Metadata fcoder_metacmd_table[227] = { { PROC_LINKS(log_graph__page_down, 0), "log_graph__page_down", 20, "Scroll the log graph down one whole page", 40, "w:\\4ed\\code\\custom\\4coder_log_parser.cpp", 40, 934 }, { PROC_LINKS(log_graph__click_select_event, 0), "log_graph__click_select_event", 29, "Select the event record at the mouse point in the log graph", 59, "w:\\4ed\\code\\custom\\4coder_log_parser.cpp", 40, 968 }, { PROC_LINKS(log_graph__click_jump_to_event_source, 0), "log_graph__click_jump_to_event_source", 37, "Jump to the code that logged the event record at the mouse point in the log graph", 81, "w:\\4ed\\code\\custom\\4coder_log_parser.cpp", 40, 987 }, -{ PROC_LINKS(show_the_log_graph, 0), "show_the_log_graph", 18, "Parser *log* and displays the 'log graph' UI", 44, "w:\\4ed\\code\\custom\\4coder_log_parser.cpp", 40, 1035 }, +{ PROC_LINKS(show_the_log_graph, 0), "show_the_log_graph", 18, "Parser *log* and displays the 'log graph' UI", 44, "w:\\4ed\\code\\custom\\4coder_log_parser.cpp", 40, 1036 }, { 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 }, @@ -473,10 +469,8 @@ static Command_Metadata fcoder_metacmd_table[227] = { { 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 }, { PROC_LINKS(miblo_decrement_time_stamp, 0), "miblo_decrement_time_stamp", 26, "Decrement 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, 237 }, { PROC_LINKS(miblo_increment_time_stamp_minute, 0), "miblo_increment_time_stamp_minute", 33, "Increment a time stamp under the cursor by one minute. (format [m]m:ss or h:mm:ss", 81, "w:\\4ed\\code\\custom\\4coder_miblo_numbers.cpp", 43, 243 }, -{ PROC_LINKS(miblo_decrement_time_stamp_minute, 0), "miblo_decrement_time_stamp_minute", 33, "Decrement a time stamp under the cursor by one minute. (format [m]m:ss or h:mm:ss", 81, "w:\\4ed\\code\\custom\\4coder_miblo_numbers.cpp", 43, 249 }, -{ PROC_LINKS(set_bindings_choose, 0), "set_bindings_choose", 19, "Remap keybindings using the 'choose' mapping rule.", 50, "w:\\4ed\\code\\custom\\4coder_remapping_commands.cpp", 48, 34 }, }; -static i32 fcoder_metacmd_ID_set_bindings_default = 0; +static i32 fcoder_metacmd_ID_miblo_decrement_time_stamp_minute = 0; static i32 fcoder_metacmd_ID_seek_beginning_of_textual_line = 1; static i32 fcoder_metacmd_ID_seek_end_of_textual_line = 2; static i32 fcoder_metacmd_ID_seek_beginning_of_line = 3; @@ -496,211 +490,208 @@ static i32 fcoder_metacmd_ID_toggle_highlight_line_at_cursor = 16; static i32 fcoder_metacmd_ID_toggle_highlight_enclosing_scopes = 17; static i32 fcoder_metacmd_ID_toggle_paren_matching_helper = 18; static i32 fcoder_metacmd_ID_toggle_fullscreen = 19; -static i32 fcoder_metacmd_ID_remap_interactive = 20; -static i32 fcoder_metacmd_ID_write_text_input = 21; -static i32 fcoder_metacmd_ID_write_space = 22; -static i32 fcoder_metacmd_ID_write_underscore = 23; -static i32 fcoder_metacmd_ID_delete_char = 24; -static i32 fcoder_metacmd_ID_backspace_char = 25; -static i32 fcoder_metacmd_ID_set_mark = 26; -static i32 fcoder_metacmd_ID_cursor_mark_swap = 27; -static i32 fcoder_metacmd_ID_delete_range = 28; -static i32 fcoder_metacmd_ID_backspace_alpha_numeric_boundary = 29; -static i32 fcoder_metacmd_ID_delete_alpha_numeric_boundary = 30; -static i32 fcoder_metacmd_ID_snipe_backward_whitespace_or_token_boundary = 31; -static i32 fcoder_metacmd_ID_snipe_forward_whitespace_or_token_boundary = 32; -static i32 fcoder_metacmd_ID_center_view = 33; -static i32 fcoder_metacmd_ID_left_adjust_view = 34; -static i32 fcoder_metacmd_ID_click_set_cursor_and_mark = 35; -static i32 fcoder_metacmd_ID_click_set_cursor = 36; -static i32 fcoder_metacmd_ID_click_set_cursor_if_lbutton = 37; -static i32 fcoder_metacmd_ID_click_set_mark = 38; -static i32 fcoder_metacmd_ID_mouse_wheel_scroll = 39; -static i32 fcoder_metacmd_ID_move_up = 40; -static i32 fcoder_metacmd_ID_move_down = 41; -static i32 fcoder_metacmd_ID_move_up_10 = 42; -static i32 fcoder_metacmd_ID_move_down_10 = 43; -static i32 fcoder_metacmd_ID_move_down_textual = 44; -static i32 fcoder_metacmd_ID_page_up = 45; -static i32 fcoder_metacmd_ID_page_down = 46; -static i32 fcoder_metacmd_ID_move_up_to_blank_line = 47; -static i32 fcoder_metacmd_ID_move_down_to_blank_line = 48; -static i32 fcoder_metacmd_ID_move_up_to_blank_line_skip_whitespace = 49; -static i32 fcoder_metacmd_ID_move_down_to_blank_line_skip_whitespace = 50; -static i32 fcoder_metacmd_ID_move_up_to_blank_line_end = 51; -static i32 fcoder_metacmd_ID_move_down_to_blank_line_end = 52; -static i32 fcoder_metacmd_ID_move_left = 53; -static i32 fcoder_metacmd_ID_move_right = 54; -static i32 fcoder_metacmd_ID_move_right_whitespace_boundary = 55; -static i32 fcoder_metacmd_ID_move_left_whitespace_boundary = 56; -static i32 fcoder_metacmd_ID_move_right_token_boundary = 57; -static i32 fcoder_metacmd_ID_move_left_token_boundary = 58; -static i32 fcoder_metacmd_ID_move_right_whitespace_or_token_boundary = 59; -static i32 fcoder_metacmd_ID_move_left_whitespace_or_token_boundary = 60; -static i32 fcoder_metacmd_ID_move_right_alpha_numeric_boundary = 61; -static i32 fcoder_metacmd_ID_move_left_alpha_numeric_boundary = 62; -static i32 fcoder_metacmd_ID_move_right_alpha_numeric_or_camel_boundary = 63; -static i32 fcoder_metacmd_ID_move_left_alpha_numeric_or_camel_boundary = 64; -static i32 fcoder_metacmd_ID_select_all = 65; -static i32 fcoder_metacmd_ID_to_uppercase = 66; -static i32 fcoder_metacmd_ID_to_lowercase = 67; -static i32 fcoder_metacmd_ID_clean_all_lines = 68; -static i32 fcoder_metacmd_ID_basic_change_active_panel = 69; -static i32 fcoder_metacmd_ID_close_panel = 70; -static i32 fcoder_metacmd_ID_show_scrollbar = 71; -static i32 fcoder_metacmd_ID_hide_scrollbar = 72; -static i32 fcoder_metacmd_ID_show_filebar = 73; -static i32 fcoder_metacmd_ID_hide_filebar = 74; -static i32 fcoder_metacmd_ID_toggle_filebar = 75; -static i32 fcoder_metacmd_ID_toggle_fps_meter = 76; -static i32 fcoder_metacmd_ID_increase_face_size = 77; -static i32 fcoder_metacmd_ID_decrease_face_size = 78; -static i32 fcoder_metacmd_ID_mouse_wheel_change_face_size = 79; -static i32 fcoder_metacmd_ID_toggle_virtual_whitespace = 80; -static i32 fcoder_metacmd_ID_toggle_show_whitespace = 81; -static i32 fcoder_metacmd_ID_toggle_line_numbers = 82; -static i32 fcoder_metacmd_ID_eol_dosify = 83; -static i32 fcoder_metacmd_ID_eol_nixify = 84; -static i32 fcoder_metacmd_ID_exit_4coder = 85; -static i32 fcoder_metacmd_ID_goto_line = 86; -static i32 fcoder_metacmd_ID_search = 87; -static i32 fcoder_metacmd_ID_reverse_search = 88; -static i32 fcoder_metacmd_ID_search_identifier = 89; -static i32 fcoder_metacmd_ID_reverse_search_identifier = 90; -static i32 fcoder_metacmd_ID_replace_in_range = 91; -static i32 fcoder_metacmd_ID_replace_in_buffer = 92; -static i32 fcoder_metacmd_ID_replace_in_all_buffers = 93; -static i32 fcoder_metacmd_ID_query_replace = 94; -static i32 fcoder_metacmd_ID_query_replace_identifier = 95; -static i32 fcoder_metacmd_ID_query_replace_selection = 96; -static i32 fcoder_metacmd_ID_save_all_dirty_buffers = 97; -static i32 fcoder_metacmd_ID_delete_file_query = 98; -static i32 fcoder_metacmd_ID_save_to_query = 99; -static i32 fcoder_metacmd_ID_rename_file_query = 100; -static i32 fcoder_metacmd_ID_make_directory_query = 101; -static i32 fcoder_metacmd_ID_move_line_up = 102; -static i32 fcoder_metacmd_ID_move_line_down = 103; -static i32 fcoder_metacmd_ID_duplicate_line = 104; -static i32 fcoder_metacmd_ID_delete_line = 105; -static i32 fcoder_metacmd_ID_open_file_in_quotes = 106; -static i32 fcoder_metacmd_ID_open_matching_file_cpp = 107; -static i32 fcoder_metacmd_ID_view_buffer_other_panel = 108; -static i32 fcoder_metacmd_ID_swap_buffers_between_panels = 109; -static i32 fcoder_metacmd_ID_kill_buffer = 110; -static i32 fcoder_metacmd_ID_save = 111; -static i32 fcoder_metacmd_ID_reopen = 112; -static i32 fcoder_metacmd_ID_undo = 113; -static i32 fcoder_metacmd_ID_redo = 114; -static i32 fcoder_metacmd_ID_undo_all_buffers = 115; -static i32 fcoder_metacmd_ID_redo_all_buffers = 116; -static i32 fcoder_metacmd_ID_open_in_other = 117; -static i32 fcoder_metacmd_ID_lister__quit = 118; -static i32 fcoder_metacmd_ID_lister__activate = 119; -static i32 fcoder_metacmd_ID_lister__write_character = 120; -static i32 fcoder_metacmd_ID_lister__backspace_text_field = 121; -static i32 fcoder_metacmd_ID_lister__move_up = 122; -static i32 fcoder_metacmd_ID_lister__move_down = 123; -static i32 fcoder_metacmd_ID_lister__wheel_scroll = 124; -static i32 fcoder_metacmd_ID_lister__mouse_press = 125; -static i32 fcoder_metacmd_ID_lister__mouse_release = 126; -static i32 fcoder_metacmd_ID_lister__repaint = 127; -static i32 fcoder_metacmd_ID_lister__write_string__default = 128; -static i32 fcoder_metacmd_ID_lister__backspace_text_field__default = 129; -static i32 fcoder_metacmd_ID_lister__move_up__default = 130; -static i32 fcoder_metacmd_ID_lister__move_down__default = 131; -static i32 fcoder_metacmd_ID_lister__write_character__file_path = 132; -static i32 fcoder_metacmd_ID_lister__backspace_text_field__file_path = 133; -static i32 fcoder_metacmd_ID_lister__write_character__fixed_list = 134; -static i32 fcoder_metacmd_ID_interactive_switch_buffer = 135; -static i32 fcoder_metacmd_ID_interactive_kill_buffer = 136; -static i32 fcoder_metacmd_ID_interactive_open_or_new = 137; -static i32 fcoder_metacmd_ID_interactive_new = 138; -static i32 fcoder_metacmd_ID_interactive_open = 139; -static i32 fcoder_metacmd_ID_command_lister = 140; -static i32 fcoder_metacmd_ID_auto_indent_whole_file = 141; -static i32 fcoder_metacmd_ID_auto_indent_line_at_cursor = 142; -static i32 fcoder_metacmd_ID_auto_indent_range = 143; -static i32 fcoder_metacmd_ID_write_text_and_auto_indent = 144; -static i32 fcoder_metacmd_ID_list_all_locations = 145; -static i32 fcoder_metacmd_ID_list_all_substring_locations = 146; -static i32 fcoder_metacmd_ID_list_all_locations_case_insensitive = 147; -static i32 fcoder_metacmd_ID_list_all_substring_locations_case_insensitive = 148; -static i32 fcoder_metacmd_ID_list_all_locations_of_identifier = 149; -static i32 fcoder_metacmd_ID_list_all_locations_of_identifier_case_insensitive = 150; -static i32 fcoder_metacmd_ID_list_all_locations_of_selection = 151; -static i32 fcoder_metacmd_ID_list_all_locations_of_selection_case_insensitive = 152; -static i32 fcoder_metacmd_ID_list_all_locations_of_type_definition = 153; -static i32 fcoder_metacmd_ID_list_all_locations_of_type_definition_of_identifier = 154; -static i32 fcoder_metacmd_ID_word_complete = 155; -static i32 fcoder_metacmd_ID_goto_jump_at_cursor = 156; -static i32 fcoder_metacmd_ID_goto_jump_at_cursor_same_panel = 157; -static i32 fcoder_metacmd_ID_goto_next_jump = 158; -static i32 fcoder_metacmd_ID_goto_prev_jump = 159; -static i32 fcoder_metacmd_ID_goto_next_jump_no_skips = 160; -static i32 fcoder_metacmd_ID_goto_prev_jump_no_skips = 161; -static i32 fcoder_metacmd_ID_goto_first_jump = 162; -static i32 fcoder_metacmd_ID_goto_first_jump_same_panel_sticky = 163; -static i32 fcoder_metacmd_ID_if_read_only_goto_position = 164; -static i32 fcoder_metacmd_ID_if_read_only_goto_position_same_panel = 165; -static i32 fcoder_metacmd_ID_view_jump_list_with_lister = 166; -static i32 fcoder_metacmd_ID_log_graph__escape = 167; -static i32 fcoder_metacmd_ID_log_graph__scroll_wheel = 168; -static i32 fcoder_metacmd_ID_log_graph__page_up = 169; -static i32 fcoder_metacmd_ID_log_graph__page_down = 170; -static i32 fcoder_metacmd_ID_log_graph__click_select_event = 171; -static i32 fcoder_metacmd_ID_log_graph__click_jump_to_event_source = 172; -static i32 fcoder_metacmd_ID_show_the_log_graph = 173; -static i32 fcoder_metacmd_ID_copy = 174; -static i32 fcoder_metacmd_ID_cut = 175; -static i32 fcoder_metacmd_ID_paste = 176; -static i32 fcoder_metacmd_ID_paste_next = 177; -static i32 fcoder_metacmd_ID_paste_and_indent = 178; -static i32 fcoder_metacmd_ID_paste_next_and_indent = 179; -static i32 fcoder_metacmd_ID_execute_previous_cli = 180; -static i32 fcoder_metacmd_ID_execute_any_cli = 181; -static i32 fcoder_metacmd_ID_build_search = 182; -static i32 fcoder_metacmd_ID_build_in_build_panel = 183; -static i32 fcoder_metacmd_ID_close_build_panel = 184; -static i32 fcoder_metacmd_ID_change_to_build_panel = 185; -static i32 fcoder_metacmd_ID_close_all_code = 186; -static i32 fcoder_metacmd_ID_open_all_code = 187; -static i32 fcoder_metacmd_ID_open_all_code_recursive = 188; -static i32 fcoder_metacmd_ID_load_project = 189; -static i32 fcoder_metacmd_ID_project_fkey_command = 190; -static i32 fcoder_metacmd_ID_project_go_to_root_directory = 191; -static i32 fcoder_metacmd_ID_setup_new_project = 192; -static i32 fcoder_metacmd_ID_setup_build_bat = 193; -static i32 fcoder_metacmd_ID_setup_build_sh = 194; -static i32 fcoder_metacmd_ID_setup_build_bat_and_sh = 195; -static i32 fcoder_metacmd_ID_project_command_lister = 196; -static i32 fcoder_metacmd_ID_list_all_functions_current_buffer = 197; -static i32 fcoder_metacmd_ID_list_all_functions_current_buffer_lister = 198; -static i32 fcoder_metacmd_ID_list_all_functions_all_buffers = 199; -static i32 fcoder_metacmd_ID_list_all_functions_all_buffers_lister = 200; -static i32 fcoder_metacmd_ID_select_surrounding_scope = 201; -static i32 fcoder_metacmd_ID_select_next_scope_absolute = 202; -static i32 fcoder_metacmd_ID_select_next_scope_after_current = 203; -static i32 fcoder_metacmd_ID_select_prev_scope_absolute = 204; -static i32 fcoder_metacmd_ID_place_in_scope = 205; -static i32 fcoder_metacmd_ID_delete_current_scope = 206; -static i32 fcoder_metacmd_ID_open_long_braces = 207; -static i32 fcoder_metacmd_ID_open_long_braces_semicolon = 208; -static i32 fcoder_metacmd_ID_open_long_braces_break = 209; -static i32 fcoder_metacmd_ID_if0_off = 210; -static i32 fcoder_metacmd_ID_write_todo = 211; -static i32 fcoder_metacmd_ID_write_hack = 212; -static i32 fcoder_metacmd_ID_write_note = 213; -static i32 fcoder_metacmd_ID_write_block = 214; -static i32 fcoder_metacmd_ID_write_zero_struct = 215; -static i32 fcoder_metacmd_ID_comment_line = 216; -static i32 fcoder_metacmd_ID_uncomment_line = 217; -static i32 fcoder_metacmd_ID_comment_line_toggle = 218; -static i32 fcoder_metacmd_ID_snippet_lister = 219; -static i32 fcoder_metacmd_ID_miblo_increment_basic = 220; -static i32 fcoder_metacmd_ID_miblo_decrement_basic = 221; -static i32 fcoder_metacmd_ID_miblo_increment_time_stamp = 222; -static i32 fcoder_metacmd_ID_miblo_decrement_time_stamp = 223; -static i32 fcoder_metacmd_ID_miblo_increment_time_stamp_minute = 224; -static i32 fcoder_metacmd_ID_miblo_decrement_time_stamp_minute = 225; -static i32 fcoder_metacmd_ID_set_bindings_choose = 226; +static i32 fcoder_metacmd_ID_write_text_input = 20; +static i32 fcoder_metacmd_ID_write_space = 21; +static i32 fcoder_metacmd_ID_write_underscore = 22; +static i32 fcoder_metacmd_ID_delete_char = 23; +static i32 fcoder_metacmd_ID_backspace_char = 24; +static i32 fcoder_metacmd_ID_set_mark = 25; +static i32 fcoder_metacmd_ID_cursor_mark_swap = 26; +static i32 fcoder_metacmd_ID_delete_range = 27; +static i32 fcoder_metacmd_ID_backspace_alpha_numeric_boundary = 28; +static i32 fcoder_metacmd_ID_delete_alpha_numeric_boundary = 29; +static i32 fcoder_metacmd_ID_snipe_backward_whitespace_or_token_boundary = 30; +static i32 fcoder_metacmd_ID_snipe_forward_whitespace_or_token_boundary = 31; +static i32 fcoder_metacmd_ID_center_view = 32; +static i32 fcoder_metacmd_ID_left_adjust_view = 33; +static i32 fcoder_metacmd_ID_click_set_cursor_and_mark = 34; +static i32 fcoder_metacmd_ID_click_set_cursor = 35; +static i32 fcoder_metacmd_ID_click_set_cursor_if_lbutton = 36; +static i32 fcoder_metacmd_ID_click_set_mark = 37; +static i32 fcoder_metacmd_ID_mouse_wheel_scroll = 38; +static i32 fcoder_metacmd_ID_move_up = 39; +static i32 fcoder_metacmd_ID_move_down = 40; +static i32 fcoder_metacmd_ID_move_up_10 = 41; +static i32 fcoder_metacmd_ID_move_down_10 = 42; +static i32 fcoder_metacmd_ID_move_down_textual = 43; +static i32 fcoder_metacmd_ID_page_up = 44; +static i32 fcoder_metacmd_ID_page_down = 45; +static i32 fcoder_metacmd_ID_move_up_to_blank_line = 46; +static i32 fcoder_metacmd_ID_move_down_to_blank_line = 47; +static i32 fcoder_metacmd_ID_move_up_to_blank_line_skip_whitespace = 48; +static i32 fcoder_metacmd_ID_move_down_to_blank_line_skip_whitespace = 49; +static i32 fcoder_metacmd_ID_move_up_to_blank_line_end = 50; +static i32 fcoder_metacmd_ID_move_down_to_blank_line_end = 51; +static i32 fcoder_metacmd_ID_move_left = 52; +static i32 fcoder_metacmd_ID_move_right = 53; +static i32 fcoder_metacmd_ID_move_right_whitespace_boundary = 54; +static i32 fcoder_metacmd_ID_move_left_whitespace_boundary = 55; +static i32 fcoder_metacmd_ID_move_right_token_boundary = 56; +static i32 fcoder_metacmd_ID_move_left_token_boundary = 57; +static i32 fcoder_metacmd_ID_move_right_whitespace_or_token_boundary = 58; +static i32 fcoder_metacmd_ID_move_left_whitespace_or_token_boundary = 59; +static i32 fcoder_metacmd_ID_move_right_alpha_numeric_boundary = 60; +static i32 fcoder_metacmd_ID_move_left_alpha_numeric_boundary = 61; +static i32 fcoder_metacmd_ID_move_right_alpha_numeric_or_camel_boundary = 62; +static i32 fcoder_metacmd_ID_move_left_alpha_numeric_or_camel_boundary = 63; +static i32 fcoder_metacmd_ID_select_all = 64; +static i32 fcoder_metacmd_ID_to_uppercase = 65; +static i32 fcoder_metacmd_ID_to_lowercase = 66; +static i32 fcoder_metacmd_ID_clean_all_lines = 67; +static i32 fcoder_metacmd_ID_basic_change_active_panel = 68; +static i32 fcoder_metacmd_ID_close_panel = 69; +static i32 fcoder_metacmd_ID_show_scrollbar = 70; +static i32 fcoder_metacmd_ID_hide_scrollbar = 71; +static i32 fcoder_metacmd_ID_show_filebar = 72; +static i32 fcoder_metacmd_ID_hide_filebar = 73; +static i32 fcoder_metacmd_ID_toggle_filebar = 74; +static i32 fcoder_metacmd_ID_toggle_fps_meter = 75; +static i32 fcoder_metacmd_ID_increase_face_size = 76; +static i32 fcoder_metacmd_ID_decrease_face_size = 77; +static i32 fcoder_metacmd_ID_mouse_wheel_change_face_size = 78; +static i32 fcoder_metacmd_ID_toggle_virtual_whitespace = 79; +static i32 fcoder_metacmd_ID_toggle_show_whitespace = 80; +static i32 fcoder_metacmd_ID_toggle_line_numbers = 81; +static i32 fcoder_metacmd_ID_eol_dosify = 82; +static i32 fcoder_metacmd_ID_eol_nixify = 83; +static i32 fcoder_metacmd_ID_exit_4coder = 84; +static i32 fcoder_metacmd_ID_goto_line = 85; +static i32 fcoder_metacmd_ID_search = 86; +static i32 fcoder_metacmd_ID_reverse_search = 87; +static i32 fcoder_metacmd_ID_search_identifier = 88; +static i32 fcoder_metacmd_ID_reverse_search_identifier = 89; +static i32 fcoder_metacmd_ID_replace_in_range = 90; +static i32 fcoder_metacmd_ID_replace_in_buffer = 91; +static i32 fcoder_metacmd_ID_replace_in_all_buffers = 92; +static i32 fcoder_metacmd_ID_query_replace = 93; +static i32 fcoder_metacmd_ID_query_replace_identifier = 94; +static i32 fcoder_metacmd_ID_query_replace_selection = 95; +static i32 fcoder_metacmd_ID_save_all_dirty_buffers = 96; +static i32 fcoder_metacmd_ID_delete_file_query = 97; +static i32 fcoder_metacmd_ID_save_to_query = 98; +static i32 fcoder_metacmd_ID_rename_file_query = 99; +static i32 fcoder_metacmd_ID_make_directory_query = 100; +static i32 fcoder_metacmd_ID_move_line_up = 101; +static i32 fcoder_metacmd_ID_move_line_down = 102; +static i32 fcoder_metacmd_ID_duplicate_line = 103; +static i32 fcoder_metacmd_ID_delete_line = 104; +static i32 fcoder_metacmd_ID_open_file_in_quotes = 105; +static i32 fcoder_metacmd_ID_open_matching_file_cpp = 106; +static i32 fcoder_metacmd_ID_view_buffer_other_panel = 107; +static i32 fcoder_metacmd_ID_swap_buffers_between_panels = 108; +static i32 fcoder_metacmd_ID_kill_buffer = 109; +static i32 fcoder_metacmd_ID_save = 110; +static i32 fcoder_metacmd_ID_reopen = 111; +static i32 fcoder_metacmd_ID_undo = 112; +static i32 fcoder_metacmd_ID_redo = 113; +static i32 fcoder_metacmd_ID_undo_all_buffers = 114; +static i32 fcoder_metacmd_ID_redo_all_buffers = 115; +static i32 fcoder_metacmd_ID_open_in_other = 116; +static i32 fcoder_metacmd_ID_lister__quit = 117; +static i32 fcoder_metacmd_ID_lister__activate = 118; +static i32 fcoder_metacmd_ID_lister__write_character = 119; +static i32 fcoder_metacmd_ID_lister__backspace_text_field = 120; +static i32 fcoder_metacmd_ID_lister__move_up = 121; +static i32 fcoder_metacmd_ID_lister__move_down = 122; +static i32 fcoder_metacmd_ID_lister__wheel_scroll = 123; +static i32 fcoder_metacmd_ID_lister__mouse_press = 124; +static i32 fcoder_metacmd_ID_lister__mouse_release = 125; +static i32 fcoder_metacmd_ID_lister__repaint = 126; +static i32 fcoder_metacmd_ID_lister__write_string__default = 127; +static i32 fcoder_metacmd_ID_lister__backspace_text_field__default = 128; +static i32 fcoder_metacmd_ID_lister__move_up__default = 129; +static i32 fcoder_metacmd_ID_lister__move_down__default = 130; +static i32 fcoder_metacmd_ID_lister__write_character__file_path = 131; +static i32 fcoder_metacmd_ID_lister__backspace_text_field__file_path = 132; +static i32 fcoder_metacmd_ID_lister__write_character__fixed_list = 133; +static i32 fcoder_metacmd_ID_interactive_switch_buffer = 134; +static i32 fcoder_metacmd_ID_interactive_kill_buffer = 135; +static i32 fcoder_metacmd_ID_interactive_open_or_new = 136; +static i32 fcoder_metacmd_ID_interactive_new = 137; +static i32 fcoder_metacmd_ID_interactive_open = 138; +static i32 fcoder_metacmd_ID_command_lister = 139; +static i32 fcoder_metacmd_ID_auto_indent_whole_file = 140; +static i32 fcoder_metacmd_ID_auto_indent_line_at_cursor = 141; +static i32 fcoder_metacmd_ID_auto_indent_range = 142; +static i32 fcoder_metacmd_ID_write_text_and_auto_indent = 143; +static i32 fcoder_metacmd_ID_list_all_locations = 144; +static i32 fcoder_metacmd_ID_list_all_substring_locations = 145; +static i32 fcoder_metacmd_ID_list_all_locations_case_insensitive = 146; +static i32 fcoder_metacmd_ID_list_all_substring_locations_case_insensitive = 147; +static i32 fcoder_metacmd_ID_list_all_locations_of_identifier = 148; +static i32 fcoder_metacmd_ID_list_all_locations_of_identifier_case_insensitive = 149; +static i32 fcoder_metacmd_ID_list_all_locations_of_selection = 150; +static i32 fcoder_metacmd_ID_list_all_locations_of_selection_case_insensitive = 151; +static i32 fcoder_metacmd_ID_list_all_locations_of_type_definition = 152; +static i32 fcoder_metacmd_ID_list_all_locations_of_type_definition_of_identifier = 153; +static i32 fcoder_metacmd_ID_word_complete = 154; +static i32 fcoder_metacmd_ID_goto_jump_at_cursor = 155; +static i32 fcoder_metacmd_ID_goto_jump_at_cursor_same_panel = 156; +static i32 fcoder_metacmd_ID_goto_next_jump = 157; +static i32 fcoder_metacmd_ID_goto_prev_jump = 158; +static i32 fcoder_metacmd_ID_goto_next_jump_no_skips = 159; +static i32 fcoder_metacmd_ID_goto_prev_jump_no_skips = 160; +static i32 fcoder_metacmd_ID_goto_first_jump = 161; +static i32 fcoder_metacmd_ID_goto_first_jump_same_panel_sticky = 162; +static i32 fcoder_metacmd_ID_if_read_only_goto_position = 163; +static i32 fcoder_metacmd_ID_if_read_only_goto_position_same_panel = 164; +static i32 fcoder_metacmd_ID_view_jump_list_with_lister = 165; +static i32 fcoder_metacmd_ID_log_graph__escape = 166; +static i32 fcoder_metacmd_ID_log_graph__scroll_wheel = 167; +static i32 fcoder_metacmd_ID_log_graph__page_up = 168; +static i32 fcoder_metacmd_ID_log_graph__page_down = 169; +static i32 fcoder_metacmd_ID_log_graph__click_select_event = 170; +static i32 fcoder_metacmd_ID_log_graph__click_jump_to_event_source = 171; +static i32 fcoder_metacmd_ID_show_the_log_graph = 172; +static i32 fcoder_metacmd_ID_copy = 173; +static i32 fcoder_metacmd_ID_cut = 174; +static i32 fcoder_metacmd_ID_paste = 175; +static i32 fcoder_metacmd_ID_paste_next = 176; +static i32 fcoder_metacmd_ID_paste_and_indent = 177; +static i32 fcoder_metacmd_ID_paste_next_and_indent = 178; +static i32 fcoder_metacmd_ID_execute_previous_cli = 179; +static i32 fcoder_metacmd_ID_execute_any_cli = 180; +static i32 fcoder_metacmd_ID_build_search = 181; +static i32 fcoder_metacmd_ID_build_in_build_panel = 182; +static i32 fcoder_metacmd_ID_close_build_panel = 183; +static i32 fcoder_metacmd_ID_change_to_build_panel = 184; +static i32 fcoder_metacmd_ID_close_all_code = 185; +static i32 fcoder_metacmd_ID_open_all_code = 186; +static i32 fcoder_metacmd_ID_open_all_code_recursive = 187; +static i32 fcoder_metacmd_ID_load_project = 188; +static i32 fcoder_metacmd_ID_project_fkey_command = 189; +static i32 fcoder_metacmd_ID_project_go_to_root_directory = 190; +static i32 fcoder_metacmd_ID_setup_new_project = 191; +static i32 fcoder_metacmd_ID_setup_build_bat = 192; +static i32 fcoder_metacmd_ID_setup_build_sh = 193; +static i32 fcoder_metacmd_ID_setup_build_bat_and_sh = 194; +static i32 fcoder_metacmd_ID_project_command_lister = 195; +static i32 fcoder_metacmd_ID_list_all_functions_current_buffer = 196; +static i32 fcoder_metacmd_ID_list_all_functions_current_buffer_lister = 197; +static i32 fcoder_metacmd_ID_list_all_functions_all_buffers = 198; +static i32 fcoder_metacmd_ID_list_all_functions_all_buffers_lister = 199; +static i32 fcoder_metacmd_ID_select_surrounding_scope = 200; +static i32 fcoder_metacmd_ID_select_next_scope_absolute = 201; +static i32 fcoder_metacmd_ID_select_next_scope_after_current = 202; +static i32 fcoder_metacmd_ID_select_prev_scope_absolute = 203; +static i32 fcoder_metacmd_ID_place_in_scope = 204; +static i32 fcoder_metacmd_ID_delete_current_scope = 205; +static i32 fcoder_metacmd_ID_open_long_braces = 206; +static i32 fcoder_metacmd_ID_open_long_braces_semicolon = 207; +static i32 fcoder_metacmd_ID_open_long_braces_break = 208; +static i32 fcoder_metacmd_ID_if0_off = 209; +static i32 fcoder_metacmd_ID_write_todo = 210; +static i32 fcoder_metacmd_ID_write_hack = 211; +static i32 fcoder_metacmd_ID_write_note = 212; +static i32 fcoder_metacmd_ID_write_block = 213; +static i32 fcoder_metacmd_ID_write_zero_struct = 214; +static i32 fcoder_metacmd_ID_comment_line = 215; +static i32 fcoder_metacmd_ID_uncomment_line = 216; +static i32 fcoder_metacmd_ID_comment_line_toggle = 217; +static i32 fcoder_metacmd_ID_snippet_lister = 218; +static i32 fcoder_metacmd_ID_miblo_increment_basic = 219; +static i32 fcoder_metacmd_ID_miblo_decrement_basic = 220; +static i32 fcoder_metacmd_ID_miblo_increment_time_stamp = 221; +static i32 fcoder_metacmd_ID_miblo_decrement_time_stamp = 222; +static i32 fcoder_metacmd_ID_miblo_increment_time_stamp_minute = 223; #endif diff --git a/custom/generated/custom_api.cpp b/custom/generated/custom_api.cpp index 4ad18b1d..de43fdbd 100644 --- a/custom/generated/custom_api.cpp +++ b/custom/generated/custom_api.cpp @@ -1,7 +1,6 @@ function void custom_api_fill_vtable(API_VTable_custom *vtable){ vtable->global_set_setting = global_set_setting; -vtable->global_set_mapping = global_set_mapping; vtable->global_get_screen_rectangle = global_get_screen_rectangle; vtable->get_thread_context = get_thread_context; vtable->create_child_process = create_child_process; @@ -120,6 +119,7 @@ vtable->get_user_input = get_user_input; vtable->get_command_input = get_command_input; vtable->set_command_input = set_command_input; vtable->leave_command_input_unhandled = leave_command_input_unhandled; +vtable->set_custom_hook = set_custom_hook; vtable->get_mouse_state = get_mouse_state; vtable->get_active_query_bars = get_active_query_bars; vtable->start_query_bar = start_query_bar; @@ -151,7 +151,6 @@ vtable->finalize_color = finalize_color; vtable->push_hot_directory = push_hot_directory; vtable->set_hot_directory = set_hot_directory; vtable->set_gui_up_down_keys = set_gui_up_down_keys; -vtable->set_edit_finished_hook_repeat_speed = set_edit_finished_hook_repeat_speed; vtable->send_exit_signal = send_exit_signal; vtable->set_window_title = set_window_title; vtable->draw_string_oriented = draw_string_oriented; @@ -176,7 +175,6 @@ vtable->buffer_find_all_matches = buffer_find_all_matches; function void custom_api_read_vtable(API_VTable_custom *vtable){ global_set_setting = vtable->global_set_setting; -global_set_mapping = vtable->global_set_mapping; global_get_screen_rectangle = vtable->global_get_screen_rectangle; get_thread_context = vtable->get_thread_context; create_child_process = vtable->create_child_process; @@ -295,6 +293,7 @@ get_user_input = vtable->get_user_input; get_command_input = vtable->get_command_input; set_command_input = vtable->set_command_input; leave_command_input_unhandled = vtable->leave_command_input_unhandled; +set_custom_hook = vtable->set_custom_hook; get_mouse_state = vtable->get_mouse_state; get_active_query_bars = vtable->get_active_query_bars; start_query_bar = vtable->start_query_bar; @@ -326,7 +325,6 @@ finalize_color = vtable->finalize_color; push_hot_directory = vtable->push_hot_directory; set_hot_directory = vtable->set_hot_directory; set_gui_up_down_keys = vtable->set_gui_up_down_keys; -set_edit_finished_hook_repeat_speed = vtable->set_edit_finished_hook_repeat_speed; send_exit_signal = vtable->send_exit_signal; set_window_title = vtable->set_window_title; draw_string_oriented = vtable->draw_string_oriented; diff --git a/custom/generated/custom_api.h b/custom/generated/custom_api.h index d9d8d32c..81463c72 100644 --- a/custom/generated/custom_api.h +++ b/custom/generated/custom_api.h @@ -1,5 +1,4 @@ #define custom_global_set_setting_sig() b32 custom_global_set_setting(Application_Links* app, Global_Setting_ID setting, i64 value) -#define custom_global_set_mapping_sig() b32 custom_global_set_mapping(Application_Links* app, void* data, i32 size) #define custom_global_get_screen_rectangle_sig() Rect_f32 custom_global_get_screen_rectangle(Application_Links* app) #define custom_get_thread_context_sig() Thread_Context* custom_get_thread_context(Application_Links* app) #define custom_create_child_process_sig() b32 custom_create_child_process(Application_Links* app, String_Const_u8 path, String_Const_u8 command, Child_Process_ID* child_process_id_out) @@ -118,6 +117,7 @@ #define custom_get_command_input_sig() User_Input custom_get_command_input(Application_Links* app) #define custom_set_command_input_sig() void custom_set_command_input(Application_Links* app, Input_Event* event) #define custom_leave_command_input_unhandled_sig() void custom_leave_command_input_unhandled(Application_Links* app) +#define custom_set_custom_hook_sig() void custom_set_custom_hook(Application_Links* app, Hook_ID hook_id, Void_Func* func_ptr) #define custom_get_mouse_state_sig() Mouse_State custom_get_mouse_state(Application_Links* app) #define custom_get_active_query_bars_sig() b32 custom_get_active_query_bars(Application_Links* app, View_ID view_id, i32 max_result_count, Query_Bar_Ptr_Array* array_out) #define custom_start_query_bar_sig() b32 custom_start_query_bar(Application_Links* app, Query_Bar* bar, u32 flags) @@ -149,7 +149,6 @@ #define custom_push_hot_directory_sig() String_Const_u8 custom_push_hot_directory(Application_Links* app, Arena* arena) #define custom_set_hot_directory_sig() b32 custom_set_hot_directory(Application_Links* app, String_Const_u8 string) #define custom_set_gui_up_down_keys_sig() void custom_set_gui_up_down_keys(Application_Links* app, Key_Code up_key, Key_Modifier up_key_modifier, Key_Code down_key, Key_Modifier down_key_modifier) -#define custom_set_edit_finished_hook_repeat_speed_sig() b32 custom_set_edit_finished_hook_repeat_speed(Application_Links* app, u32 milliseconds) #define custom_send_exit_signal_sig() void custom_send_exit_signal(Application_Links* app) #define custom_set_window_title_sig() b32 custom_set_window_title(Application_Links* app, String_Const_u8 title) #define custom_draw_string_oriented_sig() Vec2 custom_draw_string_oriented(Application_Links* app, Face_ID font_id, String_Const_u8 str, Vec2 point, int_color color, u32 flags, Vec2 delta) @@ -170,7 +169,6 @@ #define custom_animate_in_n_milliseconds_sig() void custom_animate_in_n_milliseconds(Application_Links* app, u32 n) #define custom_buffer_find_all_matches_sig() String_Match_List custom_buffer_find_all_matches(Application_Links* app, Arena* arena, Buffer_ID buffer, i32 string_id, Range_i64 range, String_Const_u8 needle, Character_Predicate* predicate, Scan_Direction direction) typedef b32 custom_global_set_setting_type(Application_Links* app, Global_Setting_ID setting, i64 value); -typedef b32 custom_global_set_mapping_type(Application_Links* app, void* data, i32 size); typedef Rect_f32 custom_global_get_screen_rectangle_type(Application_Links* app); typedef Thread_Context* custom_get_thread_context_type(Application_Links* app); typedef b32 custom_create_child_process_type(Application_Links* app, String_Const_u8 path, String_Const_u8 command, Child_Process_ID* child_process_id_out); @@ -289,6 +287,7 @@ typedef User_Input custom_get_user_input_type(Application_Links* app, Event_Prop typedef User_Input custom_get_command_input_type(Application_Links* app); typedef void custom_set_command_input_type(Application_Links* app, Input_Event* event); typedef void custom_leave_command_input_unhandled_type(Application_Links* app); +typedef void custom_set_custom_hook_type(Application_Links* app, Hook_ID hook_id, Void_Func* func_ptr); typedef Mouse_State custom_get_mouse_state_type(Application_Links* app); typedef b32 custom_get_active_query_bars_type(Application_Links* app, View_ID view_id, i32 max_result_count, Query_Bar_Ptr_Array* array_out); typedef b32 custom_start_query_bar_type(Application_Links* app, Query_Bar* bar, u32 flags); @@ -320,7 +319,6 @@ typedef argb_color custom_finalize_color_type(Application_Links* app, int_color typedef String_Const_u8 custom_push_hot_directory_type(Application_Links* app, Arena* arena); typedef b32 custom_set_hot_directory_type(Application_Links* app, String_Const_u8 string); typedef void custom_set_gui_up_down_keys_type(Application_Links* app, Key_Code up_key, Key_Modifier up_key_modifier, Key_Code down_key, Key_Modifier down_key_modifier); -typedef b32 custom_set_edit_finished_hook_repeat_speed_type(Application_Links* app, u32 milliseconds); typedef void custom_send_exit_signal_type(Application_Links* app); typedef b32 custom_set_window_title_type(Application_Links* app, String_Const_u8 title); typedef Vec2 custom_draw_string_oriented_type(Application_Links* app, Face_ID font_id, String_Const_u8 str, Vec2 point, int_color color, u32 flags, Vec2 delta); @@ -342,7 +340,6 @@ typedef void custom_animate_in_n_milliseconds_type(Application_Links* app, u32 n typedef String_Match_List custom_buffer_find_all_matches_type(Application_Links* app, Arena* arena, Buffer_ID buffer, i32 string_id, Range_i64 range, String_Const_u8 needle, Character_Predicate* predicate, Scan_Direction direction); struct API_VTable_custom{ custom_global_set_setting_type *global_set_setting; -custom_global_set_mapping_type *global_set_mapping; custom_global_get_screen_rectangle_type *global_get_screen_rectangle; custom_get_thread_context_type *get_thread_context; custom_create_child_process_type *create_child_process; @@ -461,6 +458,7 @@ custom_get_user_input_type *get_user_input; custom_get_command_input_type *get_command_input; custom_set_command_input_type *set_command_input; custom_leave_command_input_unhandled_type *leave_command_input_unhandled; +custom_set_custom_hook_type *set_custom_hook; custom_get_mouse_state_type *get_mouse_state; custom_get_active_query_bars_type *get_active_query_bars; custom_start_query_bar_type *start_query_bar; @@ -492,7 +490,6 @@ custom_finalize_color_type *finalize_color; custom_push_hot_directory_type *push_hot_directory; custom_set_hot_directory_type *set_hot_directory; custom_set_gui_up_down_keys_type *set_gui_up_down_keys; -custom_set_edit_finished_hook_repeat_speed_type *set_edit_finished_hook_repeat_speed; custom_send_exit_signal_type *send_exit_signal; custom_set_window_title_type *set_window_title; custom_draw_string_oriented_type *draw_string_oriented; @@ -515,7 +512,6 @@ custom_buffer_find_all_matches_type *buffer_find_all_matches; }; #if defined(STATIC_LINK_API) internal b32 global_set_setting(Application_Links* app, Global_Setting_ID setting, i64 value); -internal b32 global_set_mapping(Application_Links* app, void* data, i32 size); internal Rect_f32 global_get_screen_rectangle(Application_Links* app); internal Thread_Context* get_thread_context(Application_Links* app); internal b32 create_child_process(Application_Links* app, String_Const_u8 path, String_Const_u8 command, Child_Process_ID* child_process_id_out); @@ -634,6 +630,7 @@ internal User_Input get_user_input(Application_Links* app, Event_Property get_pr internal User_Input get_command_input(Application_Links* app); internal void set_command_input(Application_Links* app, Input_Event* event); internal void leave_command_input_unhandled(Application_Links* app); +internal void set_custom_hook(Application_Links* app, Hook_ID hook_id, Void_Func* func_ptr); internal Mouse_State get_mouse_state(Application_Links* app); internal b32 get_active_query_bars(Application_Links* app, View_ID view_id, i32 max_result_count, Query_Bar_Ptr_Array* array_out); internal b32 start_query_bar(Application_Links* app, Query_Bar* bar, u32 flags); @@ -665,7 +662,6 @@ internal argb_color finalize_color(Application_Links* app, int_color color); internal String_Const_u8 push_hot_directory(Application_Links* app, Arena* arena); internal b32 set_hot_directory(Application_Links* app, String_Const_u8 string); internal void set_gui_up_down_keys(Application_Links* app, Key_Code up_key, Key_Modifier up_key_modifier, Key_Code down_key, Key_Modifier down_key_modifier); -internal b32 set_edit_finished_hook_repeat_speed(Application_Links* app, u32 milliseconds); internal void send_exit_signal(Application_Links* app); internal b32 set_window_title(Application_Links* app, String_Const_u8 title); internal Vec2 draw_string_oriented(Application_Links* app, Face_ID font_id, String_Const_u8 str, Vec2 point, int_color color, u32 flags, Vec2 delta); @@ -688,7 +684,6 @@ internal String_Match_List buffer_find_all_matches(Application_Links* app, Arena #undef STATIC_LINK_API #elif defined(DYNAMIC_LINK_API) global custom_global_set_setting_type *global_set_setting = 0; -global custom_global_set_mapping_type *global_set_mapping = 0; global custom_global_get_screen_rectangle_type *global_get_screen_rectangle = 0; global custom_get_thread_context_type *get_thread_context = 0; global custom_create_child_process_type *create_child_process = 0; @@ -807,6 +802,7 @@ global custom_get_user_input_type *get_user_input = 0; global custom_get_command_input_type *get_command_input = 0; global custom_set_command_input_type *set_command_input = 0; global custom_leave_command_input_unhandled_type *leave_command_input_unhandled = 0; +global custom_set_custom_hook_type *set_custom_hook = 0; global custom_get_mouse_state_type *get_mouse_state = 0; global custom_get_active_query_bars_type *get_active_query_bars = 0; global custom_start_query_bar_type *start_query_bar = 0; @@ -838,7 +834,6 @@ global custom_finalize_color_type *finalize_color = 0; global custom_push_hot_directory_type *push_hot_directory = 0; global custom_set_hot_directory_type *set_hot_directory = 0; global custom_set_gui_up_down_keys_type *set_gui_up_down_keys = 0; -global custom_set_edit_finished_hook_repeat_speed_type *set_edit_finished_hook_repeat_speed = 0; global custom_send_exit_signal_type *send_exit_signal = 0; global custom_set_window_title_type *set_window_title = 0; global custom_draw_string_oriented_type *draw_string_oriented = 0; diff --git a/custom/generated/custom_api_master_list.h b/custom/generated/custom_api_master_list.h index 12d21de3..a0631e78 100644 --- a/custom/generated/custom_api_master_list.h +++ b/custom/generated/custom_api_master_list.h @@ -1,5 +1,4 @@ api(custom) function b32 global_set_setting(Application_Links* app, Global_Setting_ID setting, i64 value); -api(custom) function b32 global_set_mapping(Application_Links* app, void* data, i32 size); api(custom) function Rect_f32 global_get_screen_rectangle(Application_Links* app); api(custom) function Thread_Context* get_thread_context(Application_Links* app); api(custom) function b32 create_child_process(Application_Links* app, String_Const_u8 path, String_Const_u8 command, Child_Process_ID* child_process_id_out); @@ -118,6 +117,7 @@ api(custom) function User_Input get_user_input(Application_Links* app, Event_Pro api(custom) function User_Input get_command_input(Application_Links* app); api(custom) function void set_command_input(Application_Links* app, Input_Event* event); api(custom) function void leave_command_input_unhandled(Application_Links* app); +api(custom) function void set_custom_hook(Application_Links* app, Hook_ID hook_id, Void_Func* func_ptr); api(custom) function Mouse_State get_mouse_state(Application_Links* app); api(custom) function b32 get_active_query_bars(Application_Links* app, View_ID view_id, i32 max_result_count, Query_Bar_Ptr_Array* array_out); api(custom) function b32 start_query_bar(Application_Links* app, Query_Bar* bar, u32 flags); @@ -149,7 +149,6 @@ api(custom) function argb_color finalize_color(Application_Links* app, int_color api(custom) function String_Const_u8 push_hot_directory(Application_Links* app, Arena* arena); api(custom) function b32 set_hot_directory(Application_Links* app, String_Const_u8 string); api(custom) function void set_gui_up_down_keys(Application_Links* app, Key_Code up_key, Key_Modifier up_key_modifier, Key_Code down_key, Key_Modifier down_key_modifier); -api(custom) function b32 set_edit_finished_hook_repeat_speed(Application_Links* app, u32 milliseconds); api(custom) function void send_exit_signal(Application_Links* app); api(custom) function b32 set_window_title(Application_Links* app, String_Const_u8 title); api(custom) function Vec2 draw_string_oriented(Application_Links* app, Face_ID font_id, String_Const_u8 str, Vec2 point, int_color color, u32 flags, Vec2 delta); diff --git a/custom/generated/remapping.h b/custom/generated/remapping.h index a062d10f..26cc209b 100644 --- a/custom/generated/remapping.h +++ b/custom/generated/remapping.h @@ -1,408 +1,167 @@ +/* + * nonsense remapping.h file gotta remove it before I ship hopefully + */ + #if defined(CUSTOM_COMMAND_SIG) -void fill_keys_default(Bind_Helper *context){ - begin_map(context, mapid_global); - bind(context, KeyCode_Comma, MDFR_CTRL, change_active_panel); - bind(context, KeyCode_Comma, MDFR_CTRL|MDFR_SHIFT, change_active_panel_backwards); - bind(context, KeyCode_N, MDFR_CTRL, interactive_new); - bind(context, KeyCode_O, MDFR_CTRL, interactive_open_or_new); - bind(context, KeyCode_O, MDFR_ALT, open_in_other); - bind(context, KeyCode_K, MDFR_CTRL, interactive_kill_buffer); - bind(context, KeyCode_I, MDFR_CTRL, interactive_switch_buffer); - bind(context, KeyCode_H, MDFR_CTRL, project_go_to_root_directory); - bind(context, KeyCode_S, MDFR_CTRL|MDFR_SHIFT, save_all_dirty_buffers); - bind(context, KeyCode_Period, MDFR_ALT, change_to_build_panel); - bind(context, KeyCode_Comma, MDFR_ALT, close_build_panel); - bind(context, KeyCode_N, MDFR_ALT, goto_next_jump); - bind(context, KeyCode_N, MDFR_ALT|MDFR_SHIFT, goto_prev_jump); - bind(context, KeyCode_M, MDFR_ALT|MDFR_SHIFT, goto_first_jump); - bind(context, KeyCode_M, MDFR_ALT, build_in_build_panel); - bind(context, KeyCode_B, MDFR_ALT, toggle_filebar); - bind(context, KeyCode_Z, MDFR_ALT, execute_any_cli); - bind(context, KeyCode_Z, MDFR_ALT|MDFR_SHIFT, execute_previous_cli); - bind(context, KeyCode_X, MDFR_ALT, command_lister); - bind(context, KeyCode_X, MDFR_ALT|MDFR_SHIFT, project_command_lister); - bind(context, KeyCode_I, MDFR_CTRL|MDFR_SHIFT, list_all_functions_all_buffers_lister); - bind(context, KeyCode_F1, MDFR_NONE, project_fkey_command); - bind(context, KeyCode_F2, MDFR_NONE, project_fkey_command); - bind(context, KeyCode_F3, MDFR_NONE, project_fkey_command); - bind(context, KeyCode_F4, MDFR_NONE, project_fkey_command); - bind(context, KeyCode_F5, MDFR_NONE, project_fkey_command); - bind(context, KeyCode_F6, MDFR_NONE, project_fkey_command); - bind(context, KeyCode_F7, MDFR_NONE, project_fkey_command); - bind(context, KeyCode_F8, MDFR_NONE, project_fkey_command); - bind(context, KeyCode_F9, MDFR_NONE, project_fkey_command); - bind(context, KeyCode_F10, MDFR_NONE, project_fkey_command); - bind(context, KeyCode_F11, MDFR_NONE, project_fkey_command); - bind(context, KeyCode_F12, MDFR_NONE, project_fkey_command); - bind(context, KeyCode_F13, MDFR_NONE, project_fkey_command); - bind(context, KeyCode_F14, MDFR_NONE, project_fkey_command); - bind(context, KeyCode_F15, MDFR_NONE, project_fkey_command); - bind(context, KeyCode_F16, MDFR_NONE, project_fkey_command); - bind(context, KeyCode_F4, MDFR_ALT, exit_4coder); - //bind(context, KeyCodeExt_MouseWheel, MDFR_NONE, mouse_wheel_scroll); - //bind(context, KeyCodeExt_MouseWheel, MDFR_CTRL, mouse_wheel_change_face_size); - end_map(context); - begin_map(context, mapid_file); - bind_text_input(context, write_text_input); - //bind(context, KeyCodeExt_MouseLeft, MDFR_NONE, click_set_cursor_and_mark); - //bind(context, KeyCodeExt_ClickActivateView, MDFR_NONE, click_set_cursor_and_mark); - //bind(context, KeyCodeExt_MouseLeftRelease, MDFR_NONE, click_set_cursor); - //bind(context, KeyCodeExt_MouseMove, MDFR_NONE, click_set_cursor_if_lbutton); - bind(context, KeyCode_Delete, MDFR_NONE, delete_char); - bind(context, KeyCode_Delete, MDFR_SHIFT, delete_char); - bind(context, KeyCode_Backspace, MDFR_NONE, backspace_char); - bind(context, KeyCode_Backspace, MDFR_SHIFT, backspace_char); - bind(context, KeyCode_Up, MDFR_NONE, move_up); - bind(context, KeyCode_Down, MDFR_NONE, move_down); - bind(context, KeyCode_Left, MDFR_NONE, move_left); - bind(context, KeyCode_Right, MDFR_NONE, move_right); - bind(context, KeyCode_Up, MDFR_SHIFT, move_up); - bind(context, KeyCode_Down, MDFR_SHIFT, move_down); - bind(context, KeyCode_Left, MDFR_SHIFT, move_left); - bind(context, KeyCode_Right, MDFR_SHIFT, move_right); - bind(context, KeyCode_End, MDFR_NONE, seek_end_of_line); - bind(context, KeyCode_Home, MDFR_NONE, seek_beginning_of_line); - bind(context, KeyCode_PageUp, MDFR_CTRL, goto_beginning_of_file); - bind(context, KeyCode_PageDown, MDFR_CTRL, goto_end_of_file); - bind(context, KeyCode_PageUp, MDFR_NONE, page_up); - bind(context, KeyCode_PageDown, MDFR_NONE, page_down); - bind(context, KeyCode_End, MDFR_SHIFT, seek_end_of_line); - bind(context, KeyCode_Home, MDFR_SHIFT, seek_beginning_of_line); - bind(context, KeyCode_PageUp, MDFR_CTRL|MDFR_SHIFT, goto_beginning_of_file); - bind(context, KeyCode_PageDown, MDFR_CTRL|MDFR_SHIFT, goto_end_of_file); - bind(context, KeyCode_PageUp, MDFR_SHIFT, page_up); - bind(context, KeyCode_PageDown, MDFR_SHIFT, page_down); - bind(context, KeyCode_Up, MDFR_CTRL, move_up_to_blank_line_skip_whitespace); - bind(context, KeyCode_Down, MDFR_CTRL, move_down_to_blank_line_end); - bind(context, KeyCode_Left, MDFR_CTRL, move_left_whitespace_boundary); - bind(context, KeyCode_Right, MDFR_CTRL, move_right_whitespace_boundary); - bind(context, KeyCode_Up, MDFR_CTRL|MDFR_SHIFT, move_up_to_blank_line_skip_whitespace); - bind(context, KeyCode_Down, MDFR_CTRL|MDFR_SHIFT, move_down_to_blank_line_end); - bind(context, KeyCode_Left, MDFR_CTRL|MDFR_SHIFT, move_left_whitespace_boundary); - bind(context, KeyCode_Right, MDFR_CTRL|MDFR_SHIFT, move_right_whitespace_boundary); - bind(context, KeyCode_Up, MDFR_ALT, move_line_up); - bind(context, KeyCode_Down, MDFR_ALT, move_line_down); - bind(context, KeyCode_Backspace, MDFR_CTRL, backspace_alpha_numeric_boundary); - bind(context, KeyCode_Delete, MDFR_CTRL, delete_alpha_numeric_boundary); - bind(context, KeyCode_Backspace, MDFR_ALT, snipe_backward_whitespace_or_token_boundary); - bind(context, KeyCode_Delete, MDFR_ALT, snipe_forward_whitespace_or_token_boundary); - bind(context, KeyCode_Space, MDFR_CTRL, set_mark); - bind(context, KeyCode_A, MDFR_CTRL, replace_in_range); - bind(context, KeyCode_C, MDFR_CTRL, copy); - bind(context, KeyCode_D, MDFR_CTRL, delete_range); - bind(context, KeyCode_D, MDFR_CTRL|MDFR_SHIFT, delete_line); - bind(context, KeyCode_E, MDFR_CTRL, center_view); - bind(context, KeyCode_E, MDFR_CTRL|MDFR_SHIFT, left_adjust_view); - bind(context, KeyCode_F, MDFR_CTRL, search); - bind(context, KeyCode_F, MDFR_CTRL|MDFR_SHIFT, list_all_locations); - bind(context, KeyCode_F, MDFR_ALT, list_all_substring_locations_case_insensitive); - bind(context, KeyCode_G, MDFR_CTRL, goto_line); - bind(context, KeyCode_G, MDFR_CTRL|MDFR_SHIFT, list_all_locations_of_selection); - bind(context, KeyCode_J, MDFR_CTRL, snippet_lister); - bind(context, KeyCode_K, MDFR_CTRL|MDFR_SHIFT, kill_buffer); - bind(context, KeyCode_L, MDFR_CTRL, duplicate_line); - bind(context, KeyCode_M, MDFR_CTRL, cursor_mark_swap); - bind(context, KeyCode_O, MDFR_CTRL|MDFR_SHIFT, reopen); - bind(context, KeyCode_Q, MDFR_CTRL, query_replace); - bind(context, KeyCode_Q, MDFR_CTRL|MDFR_SHIFT, query_replace_identifier); - bind(context, KeyCode_Q, MDFR_ALT, query_replace_selection); - bind(context, KeyCode_R, MDFR_CTRL, reverse_search); - bind(context, KeyCode_S, MDFR_CTRL, save); - bind(context, KeyCode_T, MDFR_CTRL, search_identifier); - bind(context, KeyCode_T, MDFR_CTRL|MDFR_SHIFT, list_all_locations_of_identifier); - bind(context, KeyCode_V, MDFR_CTRL, paste_and_indent); - bind(context, KeyCode_V, MDFR_CTRL|MDFR_SHIFT, paste_next_and_indent); - bind(context, KeyCode_X, MDFR_CTRL, cut); - bind(context, KeyCode_Y, MDFR_CTRL, redo); - bind(context, KeyCode_Z, MDFR_CTRL, undo); - bind(context, KeyCode_1, MDFR_CTRL, view_buffer_other_panel); - bind(context, KeyCode_2, MDFR_CTRL, swap_buffers_between_panels); - bind(context, KeyCode_Return, MDFR_NONE, if_read_only_goto_position); - bind(context, KeyCode_Return, MDFR_SHIFT, if_read_only_goto_position_same_panel); - bind(context, KeyCode_Period, MDFR_CTRL|MDFR_SHIFT, view_jump_list_with_lister); - end_map(context); - begin_map(context, default_code_map); - inherit_map(context, mapid_file); - bind_text_input(context, write_text_and_auto_indent); - bind(context, KeyCode_Left, MDFR_CTRL, move_left_alpha_numeric_boundary); - bind(context, KeyCode_Left, MDFR_CTRL|MDFR_SHIFT, move_left_alpha_numeric_boundary); - bind(context, KeyCode_Right, MDFR_CTRL, move_right_alpha_numeric_boundary); - bind(context, KeyCode_Right, MDFR_CTRL|MDFR_SHIFT, move_right_alpha_numeric_boundary); - bind(context, KeyCode_Left, MDFR_ALT, move_left_alpha_numeric_or_camel_boundary); - bind(context, KeyCode_Left, MDFR_ALT|MDFR_SHIFT, move_left_alpha_numeric_or_camel_boundary); - bind(context, KeyCode_Right, MDFR_ALT|MDFR_SHIFT, move_right_alpha_numeric_or_camel_boundary); - bind(context, KeyCode_Semicolon, MDFR_CTRL, comment_line_toggle); - bind(context, KeyCode_Tab, MDFR_NONE, word_complete); - bind(context, KeyCode_Tab, MDFR_CTRL, auto_indent_range); - bind(context, KeyCode_Tab, MDFR_SHIFT, auto_indent_line_at_cursor); - bind(context, KeyCode_R, MDFR_ALT, write_block); - bind(context, KeyCode_T, MDFR_ALT, write_todo); - bind(context, KeyCode_Y, MDFR_ALT, write_note); - bind(context, KeyCode_D, MDFR_ALT, list_all_locations_of_type_definition); - bind(context, KeyCode_T, MDFR_ALT, list_all_locations_of_type_definition_of_identifier); - bind(context, KeyCode_LeftBracket, MDFR_CTRL, open_long_braces); - bind(context, KeyCode_LeftBracket, MDFR_CTRL|MDFR_SHIFT, open_long_braces_semicolon); - bind(context, KeyCode_RightBracket, MDFR_CTRL|MDFR_SHIFT, open_long_braces_break); - bind(context, KeyCode_LeftBracket, MDFR_ALT, select_surrounding_scope); - bind(context, KeyCode_RightBracket, MDFR_ALT, select_prev_scope_absolute); - bind(context, KeyCode_Quote, MDFR_ALT, select_next_scope_absolute); - bind(context, KeyCode_Quote, MDFR_ALT|MDFR_SHIFT, select_next_scope_after_current); - bind(context, KeyCode_ForwardSlash, MDFR_ALT, place_in_scope); - bind(context, KeyCode_Minus, MDFR_ALT, delete_current_scope); - bind(context, KeyCode_I, MDFR_ALT, if0_off); - bind(context, KeyCode_1, MDFR_ALT, open_file_in_quotes); - bind(context, KeyCode_2, MDFR_ALT, open_matching_file_cpp); - bind(context, KeyCode_0, MDFR_CTRL, write_zero_struct); - end_map(context); - begin_map(context, default_lister_ui_map); - bind_text_input(context, lister__write_character); - bind(context, KeyCode_Escape, MDFR_NONE, lister__quit); - bind(context, KeyCode_Return, MDFR_NONE, lister__activate); - bind(context, KeyCode_Tab, MDFR_NONE, lister__activate); - bind(context, KeyCode_Backspace, MDFR_NONE, lister__backspace_text_field); - bind(context, KeyCode_Backspace, MDFR_CTRL, lister__backspace_text_field); - bind(context, KeyCode_Backspace, MDFR_ALT, lister__backspace_text_field); - bind(context, KeyCode_Backspace, MDFR_CMND, lister__backspace_text_field); - bind(context, KeyCode_Backspace, MDFR_CTRL|MDFR_ALT, lister__backspace_text_field); - bind(context, KeyCode_Backspace, MDFR_ALT|MDFR_CMND, lister__backspace_text_field); - bind(context, KeyCode_Backspace, MDFR_CTRL|MDFR_CMND, lister__backspace_text_field); - bind(context, KeyCode_Backspace, MDFR_CTRL|MDFR_ALT|MDFR_CMND, lister__backspace_text_field); - bind(context, KeyCode_Up, MDFR_NONE, lister__move_up); - bind(context, KeyCode_K, MDFR_ALT, lister__move_up); - bind(context, KeyCode_PageUp, MDFR_NONE, lister__move_up); - bind(context, KeyCode_Down, MDFR_NONE, lister__move_down); - bind(context, KeyCode_J, MDFR_ALT, lister__move_down); - bind(context, KeyCode_PageDown, MDFR_NONE, lister__move_down); - //bind(context, KeyCodeExt_MouseWheel, MDFR_NONE, lister__wheel_scroll); - //bind(context, KeyCodeExt_MouseLeft, MDFR_NONE, lister__mouse_press); - //bind(context, KeyCodeExt_MouseLeftRelease, MDFR_NONE, lister__mouse_release); - //bind(context, KeyCodeExt_MouseMove, MDFR_NONE, lister__repaint); - //bind(context, KeyCodeExt_Animate, MDFR_NONE, lister__repaint); - end_map(context); + +function void +setup_default_mapping(Mapping *mapping){ + MappingScope(); + SelectMapping(mapping); + + SelectMap(mapid_global); + Bind(change_active_panel, KeyCode_Comma, MDFR_CTRL); + Bind(change_active_panel_backwards, KeyCode_Comma, MDFR_CTRL, MDFR_SHIFT); + Bind(interactive_new, KeyCode_N, MDFR_CTRL); + Bind(interactive_open_or_new, KeyCode_O, MDFR_CTRL); + Bind(open_in_other, KeyCode_O, MDFR_ALT); + Bind(interactive_kill_buffer, KeyCode_K, MDFR_CTRL); + Bind(interactive_switch_buffer, KeyCode_I, MDFR_CTRL); + Bind(project_go_to_root_directory, KeyCode_H, MDFR_CTRL); + Bind(save_all_dirty_buffers, KeyCode_S, MDFR_CTRL, MDFR_SHIFT); + Bind(change_to_build_panel, KeyCode_Period, MDFR_ALT); + Bind(close_build_panel, KeyCode_Comma, MDFR_ALT); + Bind(goto_next_jump, KeyCode_N, MDFR_ALT); + Bind(goto_prev_jump, KeyCode_N, MDFR_ALT, MDFR_SHIFT); + Bind(goto_first_jump, KeyCode_M, MDFR_ALT, MDFR_SHIFT); + Bind(build_in_build_panel, KeyCode_M, MDFR_ALT); + Bind(toggle_filebar, KeyCode_B, MDFR_ALT); + Bind(execute_any_cli, KeyCode_Z, MDFR_ALT); + Bind(execute_previous_cli, KeyCode_Z, MDFR_ALT, MDFR_SHIFT); + Bind(command_lister, KeyCode_X, MDFR_ALT); + Bind(project_command_lister, KeyCode_X, MDFR_ALT, MDFR_SHIFT); + Bind(list_all_functions_all_buffers_lister, KeyCode_I, MDFR_CTRL, MDFR_SHIFT); + Bind(project_fkey_command, KeyCode_F1); + Bind(project_fkey_command, KeyCode_F2); + Bind(project_fkey_command, KeyCode_F3); + Bind(project_fkey_command, KeyCode_F4); + Bind(project_fkey_command, KeyCode_F5); + Bind(project_fkey_command, KeyCode_F6); + Bind(project_fkey_command, KeyCode_F7); + Bind(project_fkey_command, KeyCode_F8); + Bind(project_fkey_command, KeyCode_F9); + Bind(project_fkey_command, KeyCode_F10); + Bind(project_fkey_command, KeyCode_F11); + Bind(project_fkey_command, KeyCode_F12); + Bind(project_fkey_command, KeyCode_F13); + Bind(project_fkey_command, KeyCode_F14); + Bind(project_fkey_command, KeyCode_F15); + Bind(project_fkey_command, KeyCode_F16); + Bind(exit_4coder, KeyCode_F4, MDFR_ALT); + //Bind(KeyCodeExt_MouseWheel, mouse_wheel_scroll); + //Bind(KeyCodeExt_MouseWheel, MDFR_CTRL, mouse_wheel_change_face_size); + + SelectMap(mapid_file); + ParentMap(mapid_global); + BindTextInput(write_text_input); + //Bind(KeyCodeExt_MouseLeft, click_set_cursor_and_mark); + //Bind(KeyCodeExt_ClickActivateView, click_set_cursor_and_mark); + //Bind(KeyCodeExt_MouseLeftRelease, click_set_cursor); + //Bind(KeyCodeExt_MouseMove, click_set_cursor_if_lbutton); + Bind(delete_char, KeyCode_Delete); + Bind(backspace_char, KeyCode_Backspace); + Bind(move_up, KeyCode_Up); + Bind(move_down, KeyCode_Down); + Bind(move_left, KeyCode_Left); + Bind(move_right, KeyCode_Right); + Bind(seek_end_of_line, KeyCode_End); + Bind(seek_beginning_of_line, KeyCode_Home); + Bind(page_up, KeyCode_PageUp); + Bind(page_down, KeyCode_PageDown); + Bind(goto_beginning_of_file, KeyCode_PageUp, MDFR_CTRL); + Bind(goto_end_of_file, KeyCode_PageDown, MDFR_CTRL); + Bind(move_up_to_blank_line_skip_whitespace, KeyCode_Up, MDFR_CTRL); + Bind(move_down_to_blank_line_end, KeyCode_Down, MDFR_CTRL); + Bind(move_left_whitespace_boundary, KeyCode_Left, MDFR_CTRL); + Bind(move_right_whitespace_boundary, KeyCode_Right, MDFR_CTRL); + Bind(move_line_up, KeyCode_Up, MDFR_ALT); + Bind(move_line_down, KeyCode_Down, MDFR_ALT); + Bind(backspace_alpha_numeric_boundary, KeyCode_Backspace, MDFR_CTRL); + Bind(delete_alpha_numeric_boundary, KeyCode_Delete, MDFR_CTRL); + Bind(snipe_backward_whitespace_or_token_boundary, KeyCode_Backspace, MDFR_ALT); + Bind(snipe_forward_whitespace_or_token_boundary, KeyCode_Delete, MDFR_ALT); + Bind(set_mark, KeyCode_Space, MDFR_CTRL); + Bind(replace_in_range, KeyCode_A, MDFR_CTRL); + Bind(copy, KeyCode_C, MDFR_CTRL); + Bind(delete_range, KeyCode_D, MDFR_CTRL); + Bind(delete_line, KeyCode_D, MDFR_CTRL, MDFR_SHIFT); + Bind(center_view, KeyCode_E, MDFR_CTRL); + Bind(left_adjust_view, KeyCode_E, MDFR_CTRL, MDFR_SHIFT); + Bind(search, KeyCode_F, MDFR_CTRL); + Bind(list_all_locations, KeyCode_F, MDFR_CTRL, MDFR_SHIFT); + Bind(list_all_substring_locations_case_insensitive, KeyCode_F, MDFR_ALT); + Bind(goto_line, KeyCode_G, MDFR_CTRL); + Bind(list_all_locations_of_selection, KeyCode_G, MDFR_CTRL, MDFR_SHIFT); + Bind(snippet_lister, KeyCode_J, MDFR_CTRL); + Bind(kill_buffer, KeyCode_K, MDFR_CTRL, MDFR_SHIFT); + Bind(duplicate_line, KeyCode_L, MDFR_CTRL); + Bind(cursor_mark_swap, KeyCode_M, MDFR_CTRL); + Bind(reopen, KeyCode_O, MDFR_CTRL, MDFR_SHIFT); + Bind(query_replace, KeyCode_Q, MDFR_CTRL); + Bind(query_replace_identifier, KeyCode_Q, MDFR_CTRL, MDFR_SHIFT); + Bind(query_replace_selection, KeyCode_Q, MDFR_ALT); + Bind(reverse_search, KeyCode_R, MDFR_CTRL); + Bind(save, KeyCode_S, MDFR_CTRL); + Bind(search_identifier, KeyCode_T, MDFR_CTRL); + Bind(list_all_locations_of_identifier, KeyCode_T, MDFR_CTRL, MDFR_SHIFT); + Bind(paste_and_indent, KeyCode_V, MDFR_CTRL); + Bind(paste_next_and_indent, KeyCode_V, MDFR_CTRL, MDFR_SHIFT); + Bind(cut, KeyCode_X, MDFR_CTRL); + Bind(redo, KeyCode_Y, MDFR_CTRL); + Bind(undo, KeyCode_Z, MDFR_CTRL); + Bind(view_buffer_other_panel, KeyCode_1, MDFR_CTRL); + Bind(swap_buffers_between_panels, KeyCode_2, MDFR_CTRL); + Bind(if_read_only_goto_position, KeyCode_Return); + Bind(if_read_only_goto_position_same_panel, KeyCode_Return, MDFR_SHIFT); + Bind(view_jump_list_with_lister, KeyCode_Period, MDFR_CTRL, MDFR_SHIFT); + + SelectMap(default_code_map); + ParentMap(mapid_file); + BindTextInput(write_text_and_auto_indent); + Bind(move_left_alpha_numeric_boundary, KeyCode_Left, MDFR_CTRL); + Bind(move_right_alpha_numeric_boundary, KeyCode_Right, MDFR_CTRL); + Bind(move_left_alpha_numeric_or_camel_boundary, KeyCode_Left, MDFR_ALT); + Bind(move_right_alpha_numeric_or_camel_boundary, KeyCode_Right, MDFR_ALT); + Bind(comment_line_toggle, KeyCode_Semicolon, MDFR_CTRL); + Bind(word_complete, KeyCode_Tab); + Bind(auto_indent_range, KeyCode_Tab, MDFR_CTRL); + Bind(auto_indent_line_at_cursor, KeyCode_Tab, MDFR_SHIFT); + Bind(write_block, KeyCode_R, MDFR_ALT); + Bind(write_todo, KeyCode_T, MDFR_ALT); + Bind(write_note, KeyCode_Y, MDFR_ALT); + Bind(list_all_locations_of_type_definition, KeyCode_D, MDFR_ALT); + Bind(list_all_locations_of_type_definition_of_identifier, KeyCode_T, MDFR_ALT); + Bind(open_long_braces, KeyCode_LeftBracket, MDFR_CTRL); + Bind(open_long_braces_semicolon, KeyCode_LeftBracket, MDFR_CTRL, MDFR_SHIFT); + Bind(open_long_braces_break, KeyCode_RightBracket, MDFR_CTRL, MDFR_SHIFT); + Bind(select_surrounding_scope, KeyCode_LeftBracket, MDFR_ALT); + Bind(select_prev_scope_absolute, KeyCode_RightBracket, MDFR_ALT); + Bind(select_next_scope_absolute, KeyCode_Quote, MDFR_ALT); + Bind(select_next_scope_after_current, KeyCode_Quote, MDFR_ALT, MDFR_SHIFT); + Bind(place_in_scope, KeyCode_ForwardSlash, MDFR_ALT); + Bind(delete_current_scope, KeyCode_Minus, MDFR_ALT); + Bind(if0_off, KeyCode_I, MDFR_ALT); + Bind(open_file_in_quotes, KeyCode_1, MDFR_ALT); + Bind(open_matching_file_cpp, KeyCode_2, MDFR_ALT); + Bind(write_zero_struct, KeyCode_0, MDFR_CTRL); + + SelectMap(default_lister_ui_map); + ParentMap(mapid_global); + BindTextInput(lister__write_character); + Bind(lister__quit, KeyCode_Escape); + Bind(lister__activate, KeyCode_Return); + Bind(lister__activate, KeyCode_Tab); + Bind(lister__backspace_text_field, KeyCode_Backspace); + Bind(lister__move_up, KeyCode_Up); + Bind(lister__move_down, KeyCode_Down); + //Bind(KeyCodeExt_MouseWheel, MDFR_NONE, lister__wheel_scroll); + //Bind(KeyCodeExt_MouseLeft, MDFR_NONE, lister__mouse_press); + //Bind(KeyCodeExt_MouseLeftRelease, MDFR_NONE, lister__mouse_release); + //Bind(KeyCodeExt_MouseMove, MDFR_NONE, lister__repaint); + //Bind(KeyCodeExt_Animate, MDFR_NONE, lister__repaint); } + #endif -#if defined(CUSTOM_COMMAND_SIG) -#define LINK_PROCS(x) x -#else -#define LINK_PROCS(x) -#endif -struct Meta_Key_Bind{ - int32_t vanilla; - uint32_t keycode; - uint32_t modifiers; - char *command; - int32_t command_len; - LINK_PROCS(Custom_Command_Function *proc;) -}; -struct Meta_Sub_Map{ - char *name; - int32_t name_len; - char *description; - int32_t description_len; - char *parent; - int32_t parent_len; - Meta_Key_Bind *binds; - int32_t bind_count; -}; -struct Meta_Mapping{ - char *name; - int32_t name_len; - char *description; - int32_t description_len; - Meta_Sub_Map *sub_maps; - int32_t sub_map_count; - LINK_PROCS(void (*fill_keys_proc)(Bind_Helper *context);) -}; -static Meta_Key_Bind fcoder_binds_for_default_mapid_global[43] = { - {0, 44, 1, "change_active_panel", 19, LINK_PROCS(change_active_panel)}, - {0, 60, 1, "change_active_panel_backwards", 29, LINK_PROCS(change_active_panel_backwards)}, - {0, 110, 1, "interactive_new", 15, LINK_PROCS(interactive_new)}, - {0, 111, 1, "interactive_open_or_new", 23, LINK_PROCS(interactive_open_or_new)}, - {0, 111, 2, "open_in_other", 13, LINK_PROCS(open_in_other)}, - {0, 107, 1, "interactive_kill_buffer", 23, LINK_PROCS(interactive_kill_buffer)}, - {0, 105, 1, "interactive_switch_buffer", 25, LINK_PROCS(interactive_switch_buffer)}, - {0, 104, 1, "project_go_to_root_directory", 28, LINK_PROCS(project_go_to_root_directory)}, - {0, 83, 1, "save_all_dirty_buffers", 22, LINK_PROCS(save_all_dirty_buffers)}, - {0, 55315, 0, "toggle_filebar", 14, LINK_PROCS(toggle_filebar)}, - {0, 55308, 0, "toggle_filebar", 14, LINK_PROCS(toggle_filebar)}, - {0, 55313, 0, "toggle_filebar", 14, LINK_PROCS(toggle_filebar)}, - {0, 46, 2, "change_to_build_panel", 21, LINK_PROCS(change_to_build_panel)}, - {0, 44, 2, "close_build_panel", 17, LINK_PROCS(close_build_panel)}, - {0, 110, 2, "goto_next_jump", 14, LINK_PROCS(goto_next_jump)}, - {0, 78, 2, "goto_prev_jump", 14, LINK_PROCS(goto_prev_jump)}, - {0, 77, 2, "goto_first_jump", 15, LINK_PROCS(goto_first_jump)}, - {0, 109, 2, "build_in_build_panel", 20, LINK_PROCS(build_in_build_panel)}, - {0, 98, 2, "toggle_filebar", 14, LINK_PROCS(toggle_filebar)}, - {0, 122, 2, "execute_any_cli", 15, LINK_PROCS(execute_any_cli)}, - {0, 90, 2, "execute_previous_cli", 20, LINK_PROCS(execute_previous_cli)}, - {0, 120, 2, "command_lister", 14, LINK_PROCS(command_lister)}, - {0, 88, 2, "project_command_lister", 22, LINK_PROCS(project_command_lister)}, - {0, 73, 1, "list_all_functions_all_buffers_lister", 37, LINK_PROCS(list_all_functions_all_buffers_lister)}, - {0, 69, 2, "exit_4coder", 11, LINK_PROCS(exit_4coder)}, - {0, 55326, 0, "project_fkey_command", 20, LINK_PROCS(project_fkey_command)}, - {0, 55327, 0, "project_fkey_command", 20, LINK_PROCS(project_fkey_command)}, - {0, 55328, 0, "project_fkey_command", 20, LINK_PROCS(project_fkey_command)}, - {0, 55329, 0, "project_fkey_command", 20, LINK_PROCS(project_fkey_command)}, - {0, 55330, 0, "project_fkey_command", 20, LINK_PROCS(project_fkey_command)}, - {0, 55331, 0, "project_fkey_command", 20, LINK_PROCS(project_fkey_command)}, - {0, 55332, 0, "project_fkey_command", 20, LINK_PROCS(project_fkey_command)}, - {0, 55333, 0, "project_fkey_command", 20, LINK_PROCS(project_fkey_command)}, - {0, 55334, 0, "project_fkey_command", 20, LINK_PROCS(project_fkey_command)}, - {0, 55335, 0, "project_fkey_command", 20, LINK_PROCS(project_fkey_command)}, - {0, 55336, 0, "project_fkey_command", 20, LINK_PROCS(project_fkey_command)}, - {0, 55337, 0, "project_fkey_command", 20, LINK_PROCS(project_fkey_command)}, - {0, 55338, 0, "project_fkey_command", 20, LINK_PROCS(project_fkey_command)}, - {0, 55339, 0, "project_fkey_command", 20, LINK_PROCS(project_fkey_command)}, - {0, 55340, 0, "project_fkey_command", 20, LINK_PROCS(project_fkey_command)}, - {0, 55341, 0, "project_fkey_command", 20, LINK_PROCS(project_fkey_command)}, - {0, 55321, 0, "mouse_wheel_scroll", 18, LINK_PROCS(mouse_wheel_scroll)}, - {0, 55321, 1, "mouse_wheel_change_face_size", 28, LINK_PROCS(mouse_wheel_change_face_size)}, -}; -static Meta_Key_Bind fcoder_binds_for_default_mapid_file[78] = { - {1, 0, 0, "write_text_input", 15, LINK_PROCS(write_text_input)}, - {0, 55317, 0, "click_set_cursor_and_mark", 25, LINK_PROCS(click_set_cursor_and_mark)}, - {0, 55324, 0, "click_set_cursor_and_mark", 25, LINK_PROCS(click_set_cursor_and_mark)}, - {0, 55319, 0, "click_set_cursor", 16, LINK_PROCS(click_set_cursor)}, - {0, 55322, 0, "click_set_cursor_if_lbutton", 27, LINK_PROCS(click_set_cursor_if_lbutton)}, - {0, 55301, 0, "delete_char", 11, LINK_PROCS(delete_char)}, - {0, 55301, 8, "delete_char", 11, LINK_PROCS(delete_char)}, - {0, 55296, 0, "backspace_char", 14, LINK_PROCS(backspace_char)}, - {0, 55296, 8, "backspace_char", 14, LINK_PROCS(backspace_char)}, - {0, 55297, 0, "move_up", 7, LINK_PROCS(move_up)}, - {0, 55298, 0, "move_down", 9, LINK_PROCS(move_down)}, - {0, 55299, 0, "move_left", 9, LINK_PROCS(move_left)}, - {0, 55300, 0, "move_right", 10, LINK_PROCS(move_right)}, - {0, 55297, 8, "move_up", 7, LINK_PROCS(move_up)}, - {0, 55298, 8, "move_down", 9, LINK_PROCS(move_down)}, - {0, 55299, 8, "move_left", 9, LINK_PROCS(move_left)}, - {0, 55300, 8, "move_right", 10, LINK_PROCS(move_right)}, - {0, 55304, 0, "seek_end_of_line", 16, LINK_PROCS(seek_end_of_line)}, - {0, 55303, 0, "seek_beginning_of_line", 22, LINK_PROCS(seek_beginning_of_line)}, - {0, 55305, 1, "goto_beginning_of_file", 22, LINK_PROCS(goto_beginning_of_file)}, - {0, 55306, 1, "goto_end_of_file", 16, LINK_PROCS(goto_end_of_file)}, - {0, 55305, 0, "page_up", 7, LINK_PROCS(page_up)}, - {0, 55306, 0, "page_down", 9, LINK_PROCS(page_down)}, - {0, 55304, 8, "seek_end_of_line", 16, LINK_PROCS(seek_end_of_line)}, - {0, 55303, 8, "seek_beginning_of_line", 22, LINK_PROCS(seek_beginning_of_line)}, - {0, 55305, 9, "goto_beginning_of_file", 22, LINK_PROCS(goto_beginning_of_file)}, - {0, 55306, 9, "goto_end_of_file", 16, LINK_PROCS(goto_end_of_file)}, - {0, 55305, 8, "page_up", 7, LINK_PROCS(page_up)}, - {0, 55306, 8, "page_down", 9, LINK_PROCS(page_down)}, - {0, 55297, 1, "move_up_to_blank_line_skip_whitespace", 37, LINK_PROCS(move_up_to_blank_line_skip_whitespace)}, - {0, 55298, 1, "move_down_to_blank_line_end", 27, LINK_PROCS(move_down_to_blank_line_end)}, - {0, 55299, 1, "move_left_whitespace_boundary", 29, LINK_PROCS(move_left_whitespace_boundary)}, - {0, 55300, 1, "move_right_whitespace_boundary", 30, LINK_PROCS(move_right_whitespace_boundary)}, - {0, 55297, 9, "move_up_to_blank_line_skip_whitespace", 37, LINK_PROCS(move_up_to_blank_line_skip_whitespace)}, - {0, 55298, 9, "move_down_to_blank_line_end", 27, LINK_PROCS(move_down_to_blank_line_end)}, - {0, 55299, 9, "move_left_whitespace_boundary", 29, LINK_PROCS(move_left_whitespace_boundary)}, - {0, 55300, 9, "move_right_whitespace_boundary", 30, LINK_PROCS(move_right_whitespace_boundary)}, - {0, 55297, 2, "move_line_up", 12, LINK_PROCS(move_line_up)}, - {0, 55298, 2, "move_line_down", 14, LINK_PROCS(move_line_down)}, - {0, 55296, 1, "backspace_alpha_numeric_boundary", 32, LINK_PROCS(backspace_alpha_numeric_boundary)}, - {0, 55301, 1, "delete_alpha_numeric_boundary", 29, LINK_PROCS(delete_alpha_numeric_boundary)}, - {0, 55296, 2, "snipe_backward_whitespace_or_token_boundary", 43, LINK_PROCS(snipe_backward_whitespace_or_token_boundary)}, - {0, 55301, 2, "snipe_forward_whitespace_or_token_boundary", 42, LINK_PROCS(snipe_forward_whitespace_or_token_boundary)}, - {0, 32, 1, "set_mark", 8, LINK_PROCS(set_mark)}, - {0, 97, 1, "replace_in_range", 16, LINK_PROCS(replace_in_range)}, - {0, 99, 1, "copy", 4, LINK_PROCS(copy)}, - {0, 100, 1, "delete_range", 12, LINK_PROCS(delete_range)}, - {0, 68, 1, "delete_line", 11, LINK_PROCS(delete_line)}, - {0, 101, 1, "center_view", 11, LINK_PROCS(center_view)}, - {0, 69, 1, "left_adjust_view", 16, LINK_PROCS(left_adjust_view)}, - {0, 102, 1, "search", 6, LINK_PROCS(search)}, - {0, 70, 1, "list_all_locations", 18, LINK_PROCS(list_all_locations)}, - {0, 70, 2, "list_all_substring_locations_case_insensitive", 45, LINK_PROCS(list_all_substring_locations_case_insensitive)}, - {0, 103, 1, "goto_line", 9, LINK_PROCS(goto_line)}, - {0, 71, 1, "list_all_locations_of_selection", 31, LINK_PROCS(list_all_locations_of_selection)}, - {0, 106, 1, "snippet_lister", 14, LINK_PROCS(snippet_lister)}, - {0, 75, 1, "kill_buffer", 11, LINK_PROCS(kill_buffer)}, - {0, 76, 1, "duplicate_line", 14, LINK_PROCS(duplicate_line)}, - {0, 109, 1, "cursor_mark_swap", 16, LINK_PROCS(cursor_mark_swap)}, - {0, 79, 1, "reopen", 6, LINK_PROCS(reopen)}, - {0, 113, 1, "query_replace", 13, LINK_PROCS(query_replace)}, - {0, 81, 1, "query_replace_identifier", 24, LINK_PROCS(query_replace_identifier)}, - {0, 113, 2, "query_replace_selection", 23, LINK_PROCS(query_replace_selection)}, - {0, 114, 1, "reverse_search", 14, LINK_PROCS(reverse_search)}, - {0, 115, 1, "save", 4, LINK_PROCS(save)}, - {0, 116, 1, "search_identifier", 17, LINK_PROCS(search_identifier)}, - {0, 84, 1, "list_all_locations_of_identifier", 32, LINK_PROCS(list_all_locations_of_identifier)}, - {0, 118, 1, "paste_and_indent", 16, LINK_PROCS(paste_and_indent)}, - {0, 86, 1, "paste_next_and_indent", 21, LINK_PROCS(paste_next_and_indent)}, - {0, 120, 1, "cut", 3, LINK_PROCS(cut)}, - {0, 121, 1, "redo", 4, LINK_PROCS(redo)}, - {0, 122, 1, "undo", 4, LINK_PROCS(undo)}, - {0, 49, 1, "view_buffer_other_panel", 23, LINK_PROCS(view_buffer_other_panel)}, - {0, 50, 1, "swap_buffers_between_panels", 27, LINK_PROCS(swap_buffers_between_panels)}, - {0, 10, 0, "newline_or_goto_position", 24, LINK_PROCS(if_read_only_goto_position)}, - {0, 10, 8, "newline_or_goto_position_same_panel", 35, LINK_PROCS(if_read_only_goto_position_same_panel)}, - {0, 62, 1, "view_jump_list_with_lister", 26, LINK_PROCS(view_jump_list_with_lister)}, - {0, 32, 8, "write_text_input", 15, LINK_PROCS(write_text_input)}, -}; -static Meta_Key_Bind fcoder_binds_for_default_default_code_map[33] = { - {0, 55299, 1, "move_left_alpha_numeric_or_camel_boundary", 41, LINK_PROCS(move_left_alpha_numeric_or_camel_boundary)}, - {0, 55300, 1, "move_right_alpha_numeric_or_camel_boundary", 42, LINK_PROCS(move_right_alpha_numeric_or_camel_boundary)}, - {0, 55299, 2, "move_left_alpha_numeric_boundary", 32, LINK_PROCS(move_left_alpha_numeric_boundary)}, - {0, 55300, 2, "move_right_alpha_numeric_boundary", 33, LINK_PROCS(move_right_alpha_numeric_boundary)}, - {0, 10, 0, "write_and_auto_tab", 18, LINK_PROCS(write_text_and_auto_indent)}, - {0, 10, 8, "write_and_auto_tab", 18, LINK_PROCS(write_text_and_auto_indent)}, - {0, 125, 0, "write_text_and_auto_indent", 18, LINK_PROCS(write_text_and_auto_indent)}, - {0, 41, 0, "write_text_and_auto_indent", 18, LINK_PROCS(write_text_and_auto_indent)}, - {0, 93, 0, "write_text_and_auto_indent", 18, LINK_PROCS(write_text_and_auto_indent)}, - {0, 59, 0, "write_text_and_auto_indent", 18, LINK_PROCS(write_text_and_auto_indent)}, - {0, 35, 0, "write_text_and_auto_indent", 18, LINK_PROCS(write_text_and_auto_indent)}, - {0, 59, 1, "comment_line_toggle", 19, LINK_PROCS(comment_line_toggle)}, - {0, 9, 0, "word_complete", 13, LINK_PROCS(word_complete)}, - {0, 9, 1, "auto_tab_range", 14, LINK_PROCS(auto_indent_range)}, - {0, 9, 8, "auto_tab_line_at_cursor", 23, LINK_PROCS(auto_indent_line_at_cursor)}, - {0, 114, 2, "write_block", 11, LINK_PROCS(write_block)}, - {0, 116, 2, "write_todo", 10, LINK_PROCS(write_todo)}, - {0, 121, 2, "write_note", 10, LINK_PROCS(write_note)}, - {0, 68, 2, "list_all_locations_of_type_definition", 37, LINK_PROCS(list_all_locations_of_type_definition)}, - {0, 84, 2, "list_all_locations_of_type_definition_of_identifier", 51, LINK_PROCS(list_all_locations_of_type_definition_of_identifier)}, - {0, 91, 1, "open_long_braces", 16, LINK_PROCS(open_long_braces)}, - {0, 123, 1, "open_long_braces_semicolon", 26, LINK_PROCS(open_long_braces_semicolon)}, - {0, 125, 1, "open_long_braces_break", 22, LINK_PROCS(open_long_braces_break)}, - {0, 91, 2, "select_surrounding_scope", 24, LINK_PROCS(select_surrounding_scope)}, - {0, 93, 2, "select_prev_scope_absolute", 26, LINK_PROCS(select_prev_scope_absolute)}, - {0, 39, 2, "select_next_scope_absolute", 26, LINK_PROCS(select_next_scope_absolute)}, - {0, 47, 2, "place_in_scope", 14, LINK_PROCS(place_in_scope)}, - {0, 45, 2, "delete_current_scope", 20, LINK_PROCS(delete_current_scope)}, - {0, 105, 2, "if0_off", 7, LINK_PROCS(if0_off)}, - {0, 49, 2, "open_file_in_quotes", 19, LINK_PROCS(open_file_in_quotes)}, - {0, 50, 2, "open_matching_file_cpp", 22, LINK_PROCS(open_matching_file_cpp)}, - {0, 48, 1, "write_zero_struct", 17, LINK_PROCS(write_zero_struct)}, -}; -static Meta_Key_Bind fcoder_binds_for_default_default_lister_ui_map[23] = { - {1, 0, 0, "lister__write_character", 23, LINK_PROCS(lister__write_character)}, - {0, 55307, 0, "lister__quit", 12, LINK_PROCS(lister__quit)}, - {0, 10, 0, "lister__activate", 16, LINK_PROCS(lister__activate)}, - {0, 9, 0, "lister__activate", 16, LINK_PROCS(lister__activate)}, - {0, 55296, 0, "lister__backspace_text_field", 28, LINK_PROCS(lister__backspace_text_field)}, - {0, 55296, 1, "lister__backspace_text_field", 28, LINK_PROCS(lister__backspace_text_field)}, - {0, 55296, 2, "lister__backspace_text_field", 28, LINK_PROCS(lister__backspace_text_field)}, - {0, 55296, 4, "lister__backspace_text_field", 28, LINK_PROCS(lister__backspace_text_field)}, - {0, 55296, 3, "lister__backspace_text_field", 28, LINK_PROCS(lister__backspace_text_field)}, - {0, 55296, 6, "lister__backspace_text_field", 28, LINK_PROCS(lister__backspace_text_field)}, - {0, 55296, 5, "lister__backspace_text_field", 28, LINK_PROCS(lister__backspace_text_field)}, - {0, 55296, 7, "lister__backspace_text_field", 28, LINK_PROCS(lister__backspace_text_field)}, - {0, 55297, 0, "lister__move_up", 15, LINK_PROCS(lister__move_up)}, - {0, 107, 2, "lister__move_up", 15, LINK_PROCS(lister__move_up)}, - {0, 55305, 0, "lister__move_up", 15, LINK_PROCS(lister__move_up)}, - {0, 55298, 0, "lister__move_down", 17, LINK_PROCS(lister__move_down)}, - {0, 106, 2, "lister__move_down", 17, LINK_PROCS(lister__move_down)}, - {0, 55306, 0, "lister__move_down", 17, LINK_PROCS(lister__move_down)}, - {0, 55321, 0, "lister__wheel_scroll", 20, LINK_PROCS(lister__wheel_scroll)}, - {0, 55317, 0, "lister__mouse_press", 19, LINK_PROCS(lister__mouse_press)}, - {0, 55319, 0, "lister__mouse_release", 21, LINK_PROCS(lister__mouse_release)}, - {0, 55322, 0, "lister__repaint", 15, LINK_PROCS(lister__repaint)}, - {0, 55323, 0, "lister__repaint", 15, LINK_PROCS(lister__repaint)}, -}; -static Meta_Sub_Map fcoder_submaps_for_default[4] = { - {"mapid_global", 12, "The following bindings apply in all situations.", 47, 0, 0, fcoder_binds_for_default_mapid_global, 43}, - {"mapid_file", 10, "The following bindings apply in general text files and most apply in code files, but some are overriden by other commands specific to code files.", 145, 0, 0, fcoder_binds_for_default_mapid_file, 78}, - {"default_code_map", 16, "The following commands only apply in files where the lexer (syntax highlighting) is turned on.", 94, "mapid_file", 10, fcoder_binds_for_default_default_code_map, 33}, - {"default_lister_ui_map", 21, "These commands apply in 'lister mode' such as when you open a file.", 67, 0, 0, fcoder_binds_for_default_default_lister_ui_map, 23}, -}; -static Meta_Mapping fcoder_meta_maps[2] = { - {"default", 7, "The default 4coder bindings - typically good for Windows and Linux", 66, fcoder_submaps_for_default, 4, LINK_PROCS(fill_keys_default)}, -}; + +// BOTTOM + diff --git a/platform_linux/linux_4ed.cpp b/platform_linux/linux_4ed.cpp index 8d616138..81ec6464 100644 --- a/platform_linux/linux_4ed.cpp +++ b/platform_linux/linux_4ed.cpp @@ -1950,7 +1950,7 @@ main(int argc, char **argv){ #if defined(FRED_SUPER) load_custom_code(); #else - custom_api.get_bindings = get_bindings; + DontCompile; #endif // diff --git a/platform_mac/mac_4ed.cpp b/platform_mac/mac_4ed.cpp index a70396eb..63e107c3 100644 --- a/platform_mac/mac_4ed.cpp +++ b/platform_mac/mac_4ed.cpp @@ -818,7 +818,7 @@ osx_init(){ #if defined(FRED_SUPER) load_custom_code(); #else - custom_api.get_bindings = get_bindings; + DontCompile; #endif // diff --git a/platform_win32/win32_4ed.cpp b/platform_win32/win32_4ed.cpp index ec7f4378..4e64bbd2 100644 --- a/platform_win32/win32_4ed.cpp +++ b/platform_win32/win32_4ed.cpp @@ -1534,7 +1534,6 @@ WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdS { char custom_not_found_msg[] = "Did not find a library for the custom layer."; char custom_fail_version_msg[] = "Failed to load custom code due to missing version information or a version mismatch. Try rebuilding with buildsuper."; - char custom_fail_missing_get_bindings_msg[] = "Failed to load custom code due to missing 'get_bindings' symbol. Try rebuilding with buildsuper."; char custom_fail_init_apis[] = "Failed to load custom code due to missing 'init_apis' symbol. Try rebuilding with buildsuper"; Scratch_Block scratch(win32vars.tctx, Scratch_Share); @@ -1571,15 +1570,11 @@ WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdS if (!has_library){ system_error_box(scratch, custom_not_found_msg); } - custom.get_version = (_Get_Version_Function*)system_get_proc(custom_library, "get_version"); + custom.get_version = (_Get_Version_Type*)system_get_proc(custom_library, "get_version"); if (custom.get_version == 0 || custom.get_version(MAJOR, MINOR, PATCH) == 0){ system_error_box(scratch, custom_fail_version_msg); } - custom.get_bindings = (Get_Binding_Data_Function*)system_get_proc(custom_library, "get_bindings"); - if (custom.get_bindings == 0){ - system_error_box(scratch, custom_fail_missing_get_bindings_msg); - } - custom.init_apis = (_Init_APIs*)system_get_proc(custom_library, "init_apis"); + custom.init_apis = (_Init_APIs_Type*)system_get_proc(custom_library, "init_apis"); if (custom.init_apis == 0){ system_error_box(scratch, custom_fail_init_apis); }