diff --git a/4ed.cpp b/4ed.cpp index 563b05e0..c0db72c4 100644 --- a/4ed.cpp +++ b/4ed.cpp @@ -256,11 +256,6 @@ App_Init_Sig(app_init){ global_history_init(&models->global_history); text_layout_init(tctx, &models->text_layouts); - // NOTE(allen): clipboard setup - models->working_set.clipboard_max_size = ArrayCount(models->working_set.clipboards); - models->working_set.clipboard_size = 0; - models->working_set.clipboard_current = 0; - // NOTE(allen): style setup { Scratch_Block scratch(tctx); @@ -328,7 +323,7 @@ App_Step_Sig(app_step){ Models *models = (Models*)base_ptr; Mutex_Lock file_order_lock(models->working_set.mutex); - Scratch_Block scratch(tctx, Scratch_Share); + Scratch_Block scratch(tctx); models->next_animate_delay = max_u32; models->animate_next_frame = false; @@ -339,11 +334,8 @@ App_Step_Sig(app_step){ models->input = input; // NOTE(allen): OS clipboard event handling - String_Const_u8 clipboard = input->clipboard; - if (clipboard.str != 0){ - String_Const_u8 *dest = working_set_next_clipboard_string(&models->heap, &models->working_set, clipboard.size); - dest->size = eol_convert_in((char*)dest->str, (char*)clipboard.str, (i32)clipboard.size); - co_send_core_event(tctx, models, CoreCode_NewClipboardContents, *dest); + if (input->clipboard.str != 0){ + co_send_core_event(tctx, models, CoreCode_NewClipboardContents, input->clipboard); } // NOTE(allen): reorganizing panels on screen @@ -378,7 +370,6 @@ App_Step_Sig(app_step){ system_cli_begin_update(cli); if (system_cli_update_step(cli, dest, max, &amount)){ if (file != 0 && amount > 0){ - amount = eol_in_place_convert_in(dest, amount); output_file_append(tctx, models, file, SCu8(dest, amount)); edited_file = true; } diff --git a/4ed_api_implementation.cpp b/4ed_api_implementation.cpp index 3d26c5d8..c082dd47 100644 --- a/4ed_api_implementation.cpp +++ b/4ed_api_implementation.cpp @@ -206,41 +206,6 @@ child_process_get_state(Application_Links *app, Child_Process_ID child_process_i return(child_process_get_state(&models->child_processes, child_process_id)); } -api(custom) function b32 -clipboard_clear(Application_Links *app, i32 clipboard_id){ - Models *models = (Models*)app->cmd_context; - working_set_clipboard_clear(&models->heap, &models->working_set); - return(true); -} - -api(custom) function b32 -clipboard_post_internal_only(Application_Links *app, i32 clipboard_id, String_Const_u8 string) -{ - Models *models = (Models*)app->cmd_context; - String_Const_u8 *dest = working_set_next_clipboard_string(&models->heap, &models->working_set, (i32)string.size); - block_copy(dest->str, string.str, string.size); - return(true); -} - -api(custom) function i32 -clipboard_count(Application_Links *app, i32 clipboard_id) -{ - Models *models = (Models*)app->cmd_context; - return(models->working_set.clipboard_size); -} - -api(custom) function String_Const_u8 -push_clipboard_index(Application_Links *app, Arena *arena, i32 clipboard_id, i32 item_index) -{ - Models *models = (Models*)app->cmd_context; - String_Const_u8 *str = working_set_clipboard_index(&models->working_set, item_index); - String_Const_u8 result = {}; - if (str != 0){ - result = push_string_copy(arena, *str); - } - return(result); -} - api(custom) function b32 enqueue_virtual_event(Application_Links *app, Input_Event *event){ Models *models = (Models*)app->cmd_context; @@ -2013,8 +1978,8 @@ managed_scope_get_attachment(Application_Links *app, Managed_Scope scope, Manage } else{ #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)); +"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 } } diff --git a/4ed_buffer.cpp b/4ed_buffer.cpp index 1e526935..ec9a8649 100644 --- a/4ed_buffer.cpp +++ b/4ed_buffer.cpp @@ -172,96 +172,6 @@ buffer_update_cursors_lean_r(Cursor_With_Index *sorted_positions, i32 count, ////////////////////////////////////// -internal i32 -eol_convert_in(char *dest, char *src, i32 size){ - i32 i = 0; - i32 j = 0; - i32 k = 0; - - for (; j < size && src[j] != '\r'; ++j); - block_copy(dest, src, j); - - if (j < size){ - k = 1; - ++j; - for (i = j; i < size; ++i){ - if (src[i] == '\r'){ - block_copy(dest + j - k, src + j, i - j); - ++k; - j = i+1; - } - } - block_copy(dest + j - k, src + j, i - j); - j = i - k; - } - - return(j); -} - -internal i32 -eol_in_place_convert_in(char *data, i32 size){ - i32 i = 0; - i32 j = 0; - i32 k = 0; - - for (; j < size && data[j] != '\r'; ++j); - - if (j < size){ - k = 1; - ++j; - for (i = j; i < size; ++i){ - if (data[i] == '\r'){ - block_copy(data + j - k, data + j, i - j); - ++k; - j = i+1; - } - } - block_copy(data + j - k, data + j, i - j); - j = i - k; - } - - return(j); -} - -// TODO(allen): iterative memory check? -internal b32 -eol_convert_out(char *dest, i64 max, char *src, i64 size, i64 *size_out){ - i64 j = 0; - for (i64 i = 0; i < size; ++i, ++j){ - if (src[i] == '\n'){ - dest[j] = '\r'; - ++j; - dest[j] = '\n'; - } - else{ - dest[j] = src[i]; - } - } - *size_out = j; - return(true); -} - -// TODO(allen): iterative memory check? -internal i32 -eol_in_place_convert_out(char *data, i32 size, i32 max, i32 *size_out){ - i32 result = 1; - i32 i = 0; - - for (; i < size; ++i){ - if (data[i] == '\n'){ - block_copy(data + i + 1, data + i, size - i); - data[i] = '\r'; - ++i; - ++size; - } - } - - *size_out = size; - return(result); -} - -////////////////////////////////////// - internal b32 buffer_good(Gap_Buffer *buffer){ return(buffer->data != 0); diff --git a/4ed_system_api.cpp b/4ed_system_api.cpp index 83ed621b..e55ef3bc 100644 --- a/4ed_system_api.cpp +++ b/4ed_system_api.cpp @@ -120,10 +120,12 @@ define_api(Arena *arena){ { API_Call *call = api_call(arena, api, "get_clipboard", "String_Const_u8"); api_param(arena, call, "Arena*", "arena"); + api_param(arena, call, "i32", "index"); } { API_Call *call = api_call(arena, api, "post_clipboard", "void"); api_param(arena, call, "String_Const_u8", "str"); + api_param(arena, call, "i32", "index"); } { diff --git a/4ed_working_set.cpp b/4ed_working_set.cpp index 21513eb9..6aff179e 100644 --- a/4ed_working_set.cpp +++ b/4ed_working_set.cpp @@ -206,6 +206,7 @@ get_file_from_identifier(Working_Set *working_set, Buffer_Identifier buffer){ //////////////////////////////// +#if 0 // TODO(allen): Bring the clipboard fully to the custom side. internal void working_set_clipboard_clear(Heap *heap, Working_Set *working){ @@ -257,6 +258,7 @@ working_set_clipboard_index(Working_Set *working, i32 index){ } return(result); } +#endif //////////////////////////////// diff --git a/4ed_working_set.h b/4ed_working_set.h index 9f73ac3c..49f53bb9 100644 --- a/4ed_working_set.h +++ b/4ed_working_set.h @@ -34,14 +34,6 @@ struct Working_Set{ Node has_external_mod_sentinel; System_Mutex mutex; System_Thread file_change_thread; - - // TODO(allen): do(update clipboard system to exist fully in the custom layer) - // NOTE(allen): These members have nothing to do with the working set or - // the mutex that gaurds the other members. - String_Const_u8 clipboards[64]; - i32 clipboard_size; - i32 clipboard_max_size; - i32 clipboard_current; }; #endif diff --git a/custom/4coder_clipboard.cpp b/custom/4coder_clipboard.cpp index 76ac3eb6..e243e7f9 100644 --- a/custom/4coder_clipboard.cpp +++ b/custom/4coder_clipboard.cpp @@ -4,13 +4,129 @@ // TOP +global Clipboard clipboard0 = {}; + +function void +clipboard_init_empty(Clipboard *clipboard, u32 history_depth){ + history_depth = clamp_bot(1, history_depth); + heap_init(&clipboard->heap, &clipboard->arena); + clipboard->clip_index = 0; + clipboard->clip_capacity = history_depth; + clipboard->clips = push_array_zero(&clipboard->arena, String_Const_u8, history_depth); +} + +function void +clipboard_init(Base_Allocator *allocator, u32 history_depth, Clipboard *clipboard_out){ + u64 memsize = sizeof(String_Const_u8)*history_depth; + memsize = round_up_u64(memsize, KB(4)); + clipboard_out->arena = make_arena(allocator, memsize, 8); + clipboard_init_empty(clipboard_out, history_depth); +} + +function void +clipboard_clear(Clipboard *clipboard){ + linalloc_clear(&clipboard->arena); + clipboard_init_empty(clipboard, clipboard->clip_capacity); +} + +function String_Const_u8 +clipboard_post_internal_only(Clipboard *clipboard, String_Const_u8 string){ + u32 rolled_index = clipboard->clip_index%clipboard->clip_capacity; + clipboard->clip_index += 1; + String_Const_u8 *slot = &clipboard->clips[rolled_index]; + if (slot->str != 0){ + if (slot->size < string.size || + (slot->size - string.size) > KB(1)){ + heap_free(&clipboard->heap, slot->str); + goto alloc_new; + } + } + else{ + alloc_new:; + u8 *new_buf = (u8*)heap_allocate(&clipboard->heap, string.size); + slot->str = new_buf; + } + block_copy(slot->str, string.str, string.size); + slot->size = string.size; + return(*slot); +} + +function u32 +clipboard_count(Clipboard *clipboard){ + u32 result = clipboard->clip_index; + result = clamp_top(result, clipboard->clip_capacity); + return(result); +} + +function String_Const_u8 +get_clipboard_index(Clipboard *clipboard, u32 item_index){ + String_Const_u8 result = {}; + u32 top = Min(clipboard->clip_index, clipboard->clip_capacity); + if (top > 0){ + item_index = item_index%top; + i32 array_index = ((clipboard->clip_index - 1) - item_index)%top; + result = clipboard->clips[array_index]; + } + return(result); +} + +function String_Const_u8 +push_clipboard_index(Arena *arena, Clipboard *clipboard, i32 item_index){ + String_Const_u8 result = get_clipboard_index(clipboard, item_index); + result = push_string_copy(arena, result); + return(result); +} + +//////////////////////////////// + +function void +clipboard_clear(i32 clipboard_id){ + clipboard_clear(&clipboard0); +} + +function String_Const_u8 +clipboard_post_internal_only(i32 clipboard_id, String_Const_u8 string){ + return(clipboard_post_internal_only(&clipboard0, string)); +} + +function b32 +clipboard_post(i32 clipboard_id, String_Const_u8 string){ + clipboard_post_internal_only(clipboard_id, string); + system_post_clipboard(string, clipboard_id); + return(true); +} + +function i32 +clipboard_count(i32 clipboard_id){ + return(clipboard_count(&clipboard0)); +} + +function String_Const_u8 +push_clipboard_index(Arena *arena, i32 clipboard_id, i32 item_index){ + return(push_clipboard_index(arena, &clipboard0, item_index)); +} + +//////////////////////////////// + +CUSTOM_COMMAND_SIG(clipboard_record_clip) +CUSTOM_DOC("In response to a new clipboard contents events, saves the new clip onto the clipboard history") +{ + User_Input in = get_current_input(app); + if (in.event.kind == InputEventKind_Core && + in.event.core.code == CoreCode_NewClipboardContents){ + clipboard_post_internal_only(0, in.event.core.string); + } +} + +//////////////////////////////// + function b32 clipboard_post_buffer_range(Application_Links *app, i32 clipboard_index, Buffer_ID buffer, Range_i64 range){ b32 success = false; Scratch_Block scratch(app); String_Const_u8 string = push_buffer_range(app, scratch, buffer, range); if (string.size > 0){ - clipboard_post(app, clipboard_index, string); + clipboard_post(clipboard_index, string); success = true; } return(success); @@ -19,30 +135,38 @@ clipboard_post_buffer_range(Application_Links *app, i32 clipboard_index, Buffer_ function void clipboard_update_history_from_system(Application_Links *app, i32 clipboard_id){ Scratch_Block scratch(app); - String_Const_u8 string = system_get_clipboard(scratch); + String_Const_u8 string = system_get_clipboard(scratch, clipboard_id); if (string.str != 0){ - clipboard_post_internal_only(app, clipboard_id, string); + clipboard_post_internal_only(clipboard_id, string); } } +global List_String_Const_u8 clipboard_collection_list = {}; + function void clipboard_collection_render(Application_Links *app, Frame_Info frame_info, View_ID view){ Scratch_Block scratch(app); Rect_f32 region = draw_background_and_margin(app, view); Vec2_f32 mid_p = (region.p1 + region.p0)*0.5f; - Fancy_Line message = {}; - push_fancy_string(scratch, &message, fcolor_id(defcolor_pop2), + Fancy_Block message = {}; + Fancy_Line *line = push_fancy_line(scratch, &message); + push_fancy_string(scratch, line, fcolor_id(defcolor_pop2), string_u8_litexpr("Collecting all clipboard events ")); - push_fancy_string(scratch, &message, fcolor_id(defcolor_pop1), + push_fancy_string(scratch, line, fcolor_id(defcolor_pop1), string_u8_litexpr("press [escape] to stop")); + for (Node_String_Const_u8 *node = clipboard_collection_list.first; + node != 0; + node = node->next){ + line = push_fancy_line(scratch, &message); + push_fancy_string(scratch, line, fcolor_id(defcolor_text_default), node->string); + } + Face_ID face_id = get_face_id(app, 0); - - Vec2_f32 dim = get_fancy_line_dim(app, face_id, &message); + Vec2_f32 dim = get_fancy_block_dim(app, face_id, &message); Vec2_f32 half_dim = dim*0.5f; - - draw_fancy_line(app, face_id, fcolor_zero(), &message, mid_p - half_dim); + draw_fancy_block(app, face_id, fcolor_zero(), &message, mid_p - half_dim); } CUSTOM_UI_COMMAND_SIG(begin_clipboard_collection_mode) @@ -53,6 +177,9 @@ CUSTOM_DOC("Allows the user to copy multiple strings from other applications bef in_clipboard_collection_mode = true; system_set_clipboard_catch_all(true); + Scratch_Block scratch(app); + block_zero_struct(&clipboard_collection_list); + View_ID view = get_this_ctx_view(app, Access_Always); View_Context ctx = view_current_context(app, view); ctx.render_caller = clipboard_collection_render; @@ -67,8 +194,15 @@ CUSTOM_DOC("Allows the user to copy multiple strings from other applications bef if (in.event.kind == InputEventKind_KeyStroke && in.event.key.code == KeyCode_Escape){ break; } + if (in.event.kind == InputEventKind_Core && + in.event.core.code == CoreCode_NewClipboardContents){ + String_Const_u8 stable_clip = clipboard_post_internal_only(0, in.event.core.string); + string_list_push(scratch, &clipboard_collection_list, stable_clip); + } } + block_zero_struct(&clipboard_collection_list); + system_set_clipboard_catch_all(false); in_clipboard_collection_mode = false; } @@ -98,7 +232,7 @@ CUSTOM_COMMAND_SIG(paste) CUSTOM_DOC("At the cursor, insert the text at the top of the clipboard.") { clipboard_update_history_from_system(app, 0); - i32 count = clipboard_count(app, 0); + i32 count = clipboard_count(0); if (count > 0){ View_ID view = get_active_view(app, Access_ReadWriteVisible); if_view_has_highlighted_range_delete_range(app, view); @@ -112,7 +246,7 @@ CUSTOM_DOC("At the cursor, insert the text at the top of the clipboard.") Scratch_Block scratch(app); - String_Const_u8 string = push_clipboard_index(app, scratch, 0, *paste_index); + String_Const_u8 string = push_clipboard_index(scratch, 0, *paste_index); if (string.size > 0){ Buffer_ID buffer = view_get_buffer(app, view, Access_ReadWriteVisible); @@ -133,7 +267,7 @@ CUSTOM_DOC("If the previous command was paste or paste_next, replaces the paste { Scratch_Block scratch(app); - i32 count = clipboard_count(app, 0); + i32 count = clipboard_count(0); if (count > 0){ View_ID view = get_active_view(app, Access_ReadWriteVisible); Managed_Scope scope = view_get_managed_scope(app, view); @@ -149,7 +283,7 @@ CUSTOM_DOC("If the previous command was paste or paste_next, replaces the paste i32 paste_index = (*paste_index_ptr) + 1; *paste_index_ptr = paste_index; - String_Const_u8 string = push_clipboard_index(app, scratch, 0, paste_index); + String_Const_u8 string = push_clipboard_index(scratch, 0, paste_index); Buffer_ID buffer = view_get_buffer(app, view, Access_ReadWriteVisible); @@ -186,7 +320,7 @@ CUSTOM_DOC("Paste the next item on the clipboard and run auto-indent on the newl CUSTOM_COMMAND_SIG(clear_clipboard) CUSTOM_DOC("Clears the history of the clipboard") { - clipboard_clear(app, 0); + clipboard_clear(0); } //////////////////////////////// @@ -194,7 +328,7 @@ CUSTOM_DOC("Clears the history of the clipboard") CUSTOM_COMMAND_SIG(multi_paste){ Scratch_Block scratch(app); - i32 count = clipboard_count(app, 0); + i32 count = clipboard_count(0); if (count > 0){ View_ID view = get_active_view(app, Access_ReadWriteVisible); Managed_Scope scope = view_get_managed_scope(app, view); @@ -208,7 +342,7 @@ CUSTOM_COMMAND_SIG(multi_paste){ i32 paste_index = (*paste_index_ptr) + 1; *paste_index_ptr = paste_index; - String_Const_u8 string = push_clipboard_index(app, scratch, 0, paste_index); + String_Const_u8 string = push_clipboard_index(scratch, 0, paste_index); String_Const_u8 insert_string = push_u8_stringf(scratch, "\n%.*s", string_expand(string)); @@ -239,7 +373,7 @@ multi_paste_range(Application_Links *app, View_ID view, Range_i64 range, i32 pas i64 total_size = 0; for (i32 paste_index = 0; paste_index < paste_count; ++paste_index){ Temp_Memory temp = begin_temp(scratch); - String_Const_u8 string = push_clipboard_index(app, scratch, 0, paste_index); + String_Const_u8 string = push_clipboard_index(scratch, 0, paste_index); total_size += string.size + 1; end_temp(temp); } @@ -260,7 +394,7 @@ multi_paste_range(Application_Links *app, View_ID view, Range_i64 range, i32 pas if (paste_index != first){ string_list_push(scratch, &list, SCu8("\n", 1)); } - String_Const_u8 string = push_clipboard_index(app, scratch, 0, paste_index); + String_Const_u8 string = push_clipboard_index(scratch, 0, paste_index); if (string.size > 0){ string_list_push(scratch, &list, string); } @@ -334,7 +468,7 @@ multi_paste_interactive_up_down(Application_Links *app, i32 paste_count, i32 cli CUSTOM_COMMAND_SIG(multi_paste_interactive) CUSTOM_DOC("Paste multiple lines from the clipboard history, controlled with arrow keys") { - i32 clip_count = clipboard_count(app, 0); + i32 clip_count = clipboard_count(0); if (clip_count > 0){ multi_paste_interactive_up_down(app, 1, clip_count); } @@ -343,7 +477,7 @@ CUSTOM_DOC("Paste multiple lines from the clipboard history, controlled with arr CUSTOM_COMMAND_SIG(multi_paste_interactive_quick) CUSTOM_DOC("Paste multiple lines from the clipboard history, controlled by inputing the number of lines to paste") { - i32 clip_count = clipboard_count(app, 0); + i32 clip_count = clipboard_count(0); if (clip_count > 0){ u8 string_space[256]; Query_Bar_Group group(app); @@ -361,5 +495,26 @@ CUSTOM_DOC("Paste multiple lines from the clipboard history, controlled by input } } +//////////////////////////////// + +#if FCODER_TRANSITION_TO < 4001004 +function void +clipboard_clear(Application_Links *app, i32 clipboard_id){ + clipboard_clear(clipboard_id); +} +function b32 +clipboard_post(Application_Links *app, i32 clipboard_id, String_Const_u8 string){ + return(clipboard_post(clipboard_id, string)); +} +function i32 +clipboard_count(Application_Links *app, i32 clipboard_id){ + return(clipboard_count(clipboard_id)); +} +function String_Const_u8 +push_clipboard_index(Application_Links *app, Arena *arena, i32 clipboard_id, i32 item_index){ + return(push_clipboard_index(arena, clipboard_id, item_index)); +} +#endif + // BOTTOM diff --git a/custom/4coder_clipboard.h b/custom/4coder_clipboard.h new file mode 100644 index 00000000..d6301354 --- /dev/null +++ b/custom/4coder_clipboard.h @@ -0,0 +1,21 @@ +/* +4coder_clipboard.cpp - Copy paste commands and clipboard related setup. +*/ + +// TOP + +#ifndef FCODER_CLIPBOARD_H +#define FCODER_CLIPBOARD_H + +struct Clipboard{ + Arena arena; + Heap heap; + String_Const_u8 *clips; + u32 clip_index; + u32 clip_capacity; +}; + +#endif //4CODER_CLIPBOARD_H + +// BOTTOM + diff --git a/custom/4coder_default_bindings.cpp b/custom/4coder_default_bindings.cpp index a2c2866c..3a79b39a 100644 --- a/custom/4coder_default_bindings.cpp +++ b/custom/4coder_default_bindings.cpp @@ -19,6 +19,7 @@ custom_layer_init(Application_Links *app){ // NOTE(allen): setup for default framework async_task_handler_init(app, &global_async_system); + clipboard_init(get_base_allocator_system(), /*history_depth*/ 64, &clipboard0); code_index_init(); buffer_modified_set_init(); Profile_Global_List *list = get_core_profile_list(app); diff --git a/custom/4coder_default_include.cpp b/custom/4coder_default_include.cpp index 063567c6..9d6f1435 100644 --- a/custom/4coder_default_include.cpp +++ b/custom/4coder_default_include.cpp @@ -7,6 +7,10 @@ #if !defined(FCODER_DEFAULT_INCLUDE_CPP) #define FCODER_DEFAULT_INCLUDE_CPP +#if !defined(FCODER_TRANSITION_TO) +#define FCODER_TRANSITION_TO 0 +#endif + #include "4coder_base_types.h" #include "4coder_version.h" #include "4coder_table.h" @@ -33,6 +37,7 @@ #include "4coder_insertion.h" #include "4coder_command_map.h" #include "4coder_lister_base.h" +#include "4coder_clipboard.h" #include "4coder_default_framework.h" #include "4coder_config.h" #include "4coder_auto_indent.h" @@ -91,6 +96,7 @@ #include "4coder_font_helper.cpp" #include "4coder_config.cpp" #include "4coder_default_framework.cpp" +#include "4coder_clipboard.cpp" #include "4coder_lister_base.cpp" #include "4coder_base_commands.cpp" #include "4coder_insertion.cpp" @@ -103,7 +109,6 @@ #include "4coder_jump_lister.cpp" #include "4coder_code_index_listers.cpp" #include "4coder_log_parser.cpp" -#include "4coder_clipboard.cpp" #include "4coder_keyboard_macro.cpp" #include "4coder_cli_command.cpp" #include "4coder_build_commands.cpp" diff --git a/custom/4coder_default_map.cpp b/custom/4coder_default_map.cpp index c9aa2078..e39b732a 100644 --- a/custom/4coder_default_map.cpp +++ b/custom/4coder_default_map.cpp @@ -12,6 +12,7 @@ setup_default_mapping(Mapping *mapping, i64 global_id, i64 file_id, i64 code_id) SelectMap(global_id); BindCore(default_startup, CoreCode_Startup); BindCore(default_try_exit, CoreCode_TryExit); + BindCore(clipboard_record_clip, CoreCode_NewClipboardContents); Bind(keyboard_macro_start_recording , KeyCode_U, KeyCode_Control); Bind(keyboard_macro_finish_recording, KeyCode_U, KeyCode_Control, KeyCode_Shift); Bind(keyboard_macro_replay, KeyCode_U, KeyCode_Alt); diff --git a/custom/4coder_helper.cpp b/custom/4coder_helper.cpp index fd4e96e9..38edd9f6 100644 --- a/custom/4coder_helper.cpp +++ b/custom/4coder_helper.cpp @@ -2418,15 +2418,6 @@ get_command_metadata(Custom_Command_Function *func){ //////////////////////////////// -function b32 -clipboard_post(Application_Links *app, i32 clipboard_id, String_Const_u8 string){ - clipboard_post_internal_only(app, clipboard_id, string); - system_post_clipboard(string); - return(true); -} - -//////////////////////////////// - // TODO(allen): REWRITE THIS EXACTLY HOW YOU WANT IT --- start --- internal Child_Process_Set_Target_Flags diff --git a/custom/4coder_mac_map.cpp b/custom/4coder_mac_map.cpp index f21d5dd2..171b22a6 100644 --- a/custom/4coder_mac_map.cpp +++ b/custom/4coder_mac_map.cpp @@ -12,6 +12,7 @@ setup_mac_mapping(Mapping *mapping, i64 global_id, i64 file_id, i64 code_id){ SelectMap(global_id); BindCore(default_startup, CoreCode_Startup); BindCore(default_try_exit, CoreCode_TryExit); + BindCore(clipboard_record_clip, CoreCode_NewClipboardContents); Bind(keyboard_macro_start_recording , KeyCode_U, KeyCode_Command); Bind(keyboard_macro_finish_recording, KeyCode_U, KeyCode_Command, KeyCode_Shift); Bind(keyboard_macro_replay, KeyCode_U, KeyCode_Control); diff --git a/custom/generated/command_metadata.h b/custom/generated/command_metadata.h index 2ae8a1f0..9e4fabab 100644 --- a/custom/generated/command_metadata.h +++ b/custom/generated/command_metadata.h @@ -2,7 +2,7 @@ #define command_id(c) (fcoder_metacmd_ID_##c) #define command_metadata(c) (&fcoder_metacmd_table[command_id(c)]) #define command_metadata_by_id(id) (&fcoder_metacmd_table[id]) -#define command_one_past_last_id 237 +#define command_one_past_last_id 238 #if defined(CUSTOM_COMMAND_SIG) #define PROC_LINKS(x,y) x #else @@ -30,6 +30,7 @@ CUSTOM_COMMAND_SIG(click_set_cursor); CUSTOM_COMMAND_SIG(click_set_cursor_and_mark); CUSTOM_COMMAND_SIG(click_set_cursor_if_lbutton); CUSTOM_COMMAND_SIG(click_set_mark); +CUSTOM_COMMAND_SIG(clipboard_record_clip); CUSTOM_COMMAND_SIG(close_all_code); CUSTOM_COMMAND_SIG(close_build_panel); CUSTOM_COMMAND_SIG(close_panel); @@ -258,7 +259,7 @@ char *source_name; i32 source_name_len; i32 line_number; }; -static Command_Metadata fcoder_metacmd_table[237] = { +static Command_Metadata fcoder_metacmd_table[238] = { { PROC_LINKS(allow_mouse, 0), false, "allow_mouse", 11, "Shows the mouse and causes all mouse input to be processed normally.", 68, "w:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 409 }, { PROC_LINKS(auto_indent_line_at_cursor, 0), false, "auto_indent_line_at_cursor", 26, "Auto-indents the line on which the cursor sits.", 47, "w:\\4ed\\code\\custom\\4coder_auto_indent.cpp", 41, 407 }, { PROC_LINKS(auto_indent_range, 0), false, "auto_indent_range", 17, "Auto-indents the range between the cursor and the mark.", 55, "w:\\4ed\\code\\custom\\4coder_auto_indent.cpp", 41, 417 }, @@ -266,7 +267,7 @@ static Command_Metadata fcoder_metacmd_table[237] = { { PROC_LINKS(backspace_alpha_numeric_boundary, 0), false, "backspace_alpha_numeric_boundary", 32, "Delete characters between the cursor position and the first alphanumeric boundary to the left.", 94, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 165 }, { PROC_LINKS(backspace_char, 0), false, "backspace_char", 14, "Deletes the character to the left of the cursor.", 48, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 96 }, { PROC_LINKS(basic_change_active_panel, 0), false, "basic_change_active_panel", 25, "Change the currently active panel, moving to the panel with the next highest view_id. Will not skipe the build panel if it is open.", 132, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 651 }, -{ PROC_LINKS(begin_clipboard_collection_mode, 0), true, "begin_clipboard_collection_mode", 31, "Allows the user to copy multiple strings from other applications before switching to 4coder and pasting them all.", 113, "w:\\4ed\\code\\custom\\4coder_clipboard.cpp", 39, 48 }, +{ PROC_LINKS(begin_clipboard_collection_mode, 0), true, "begin_clipboard_collection_mode", 31, "Allows the user to copy multiple strings from other applications before switching to 4coder and pasting them all.", 113, "w:\\4ed\\code\\custom\\4coder_clipboard.cpp", 39, 172 }, { PROC_LINKS(build_in_build_panel, 0), false, "build_in_build_panel", 20, "Looks for a build.bat, build.sh, or makefile in the current and parent directories. Runs the first that it finds and prints the output to *compilation*. Puts the *compilation* buffer in a panel at the footer of the current view.", 230, "w:\\4ed\\code\\custom\\4coder_build_commands.cpp", 44, 159 }, { PROC_LINKS(build_search, 0), false, "build_search", 12, "Looks for a build.bat, build.sh, or makefile in the current and parent directories. Runs the first that it finds and prints the output to *compilation*.", 153, "w:\\4ed\\code\\custom\\4coder_build_commands.cpp", 44, 122 }, { PROC_LINKS(center_view, 0), false, "center_view", 11, "Centers the view vertically on the line on which the cursor sits.", 65, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 208 }, @@ -275,11 +276,12 @@ static Command_Metadata fcoder_metacmd_table[237] = { { PROC_LINKS(change_to_build_panel, 0), false, "change_to_build_panel", 21, "If the special build panel is open, makes the build panel the active panel.", 75, "w:\\4ed\\code\\custom\\4coder_build_commands.cpp", 44, 180 }, { PROC_LINKS(clean_all_lines, 0), false, "clean_all_lines", 15, "Removes trailing whitespace from all lines in the current buffer.", 65, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 587 }, { PROC_LINKS(clear_all_themes, 0), false, "clear_all_themes", 16, "Clear the theme list", 20, "w:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 480 }, -{ PROC_LINKS(clear_clipboard, 0), false, "clear_clipboard", 15, "Clears the history of the clipboard", 35, "w:\\4ed\\code\\custom\\4coder_clipboard.cpp", 39, 186 }, +{ PROC_LINKS(clear_clipboard, 0), false, "clear_clipboard", 15, "Clears the history of the clipboard", 35, "w:\\4ed\\code\\custom\\4coder_clipboard.cpp", 39, 320 }, { PROC_LINKS(click_set_cursor, 0), false, "click_set_cursor", 16, "Sets the cursor position to the mouse position.", 47, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 244 }, { PROC_LINKS(click_set_cursor_and_mark, 0), false, "click_set_cursor_and_mark", 25, "Sets the cursor position and mark to the mouse position.", 56, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 234 }, { PROC_LINKS(click_set_cursor_if_lbutton, 0), false, "click_set_cursor_if_lbutton", 27, "If the mouse left button is pressed, sets the cursor position to the mouse position.", 84, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 254 }, { PROC_LINKS(click_set_mark, 0), false, "click_set_mark", 14, "Sets the mark position to the mouse position.", 45, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 266 }, +{ PROC_LINKS(clipboard_record_clip, 0), false, "clipboard_record_clip", 21, "In response to a new clipboard contents events, saves the new clip onto the clipboard history", 93, "w:\\4ed\\code\\custom\\4coder_clipboard.cpp", 39, 111 }, { PROC_LINKS(close_all_code, 0), false, "close_all_code", 14, "Closes any buffer with a filename ending with an extension configured to be recognized as a code file type.", 107, "w:\\4ed\\code\\custom\\4coder_project_commands.cpp", 46, 843 }, { PROC_LINKS(close_build_panel, 0), false, "close_build_panel", 17, "If the special build panel is open, closes it.", 46, "w:\\4ed\\code\\custom\\4coder_build_commands.cpp", 44, 174 }, { PROC_LINKS(close_panel, 0), false, "close_panel", 11, "Closes the currently active panel if it is not the only panel open.", 67, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 659 }, @@ -287,10 +289,10 @@ static Command_Metadata fcoder_metacmd_table[237] = { { PROC_LINKS(command_lister, 0), true, "command_lister", 14, "Opens an interactive list of all registered commands.", 53, "w:\\4ed\\code\\custom\\4coder_lists.cpp", 35, 761 }, { PROC_LINKS(comment_line, 0), false, "comment_line", 12, "Insert '//' at the beginning of the line after leading whitespace.", 66, "w:\\4ed\\code\\custom\\4coder_combined_write_commands.cpp", 53, 125 }, { PROC_LINKS(comment_line_toggle, 0), false, "comment_line_toggle", 19, "Turns uncommented lines into commented lines and vice versa for comments starting with '//'.", 92, "w:\\4ed\\code\\custom\\4coder_combined_write_commands.cpp", 53, 149 }, -{ PROC_LINKS(copy, 0), false, "copy", 4, "Copy the text in the range from the cursor to the mark onto the clipboard.", 74, "w:\\4ed\\code\\custom\\4coder_clipboard.cpp", 39, 77 }, +{ PROC_LINKS(copy, 0), false, "copy", 4, "Copy the text in the range from the cursor to the mark onto the clipboard.", 74, "w:\\4ed\\code\\custom\\4coder_clipboard.cpp", 39, 211 }, { PROC_LINKS(cursor_mark_swap, 0), false, "cursor_mark_swap", 16, "Swaps the position of the cursor and the mark.", 46, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 135 }, { PROC_LINKS(custom_api_documentation, 0), true, "custom_api_documentation", 24, "Prompts the user to select a Custom API item then loads a doc buffer for that item", 82, "w:\\4ed\\code\\custom\\4coder_docs.cpp", 34, 175 }, -{ PROC_LINKS(cut, 0), false, "cut", 3, "Cut the text in the range from the cursor to the mark onto the clipboard.", 73, "w:\\4ed\\code\\custom\\4coder_clipboard.cpp", 39, 86 }, +{ PROC_LINKS(cut, 0), false, "cut", 3, "Cut the text in the range from the cursor to the mark onto the clipboard.", 73, "w:\\4ed\\code\\custom\\4coder_clipboard.cpp", 39, 220 }, { PROC_LINKS(decrease_face_size, 0), false, "decrease_face_size", 18, "Decrease the size of the face used by the current buffer.", 57, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 742 }, { PROC_LINKS(default_file_externally_modified, 0), false, "default_file_externally_modified", 32, "Notes the external modification of attached files by printing a message.", 72, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1884 }, { PROC_LINKS(default_startup, 0), false, "default_startup", 15, "Default command for responding to a startup event", 49, "w:\\4ed\\code\\custom\\4coder_default_hooks.cpp", 43, 7 }, @@ -388,8 +390,8 @@ static Command_Metadata fcoder_metacmd_table[237] = { { PROC_LINKS(move_up_to_blank_line, 0), false, "move_up_to_blank_line", 21, "Seeks the cursor up to the next blank line.", 43, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 412 }, { PROC_LINKS(move_up_to_blank_line_end, 0), false, "move_up_to_blank_line_end", 25, "Seeks the cursor up to the next blank line and places it at the end of the line.", 80, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 436 }, { PROC_LINKS(move_up_to_blank_line_skip_whitespace, 0), false, "move_up_to_blank_line_skip_whitespace", 37, "Seeks the cursor up to the next blank line and places it at the end of the line.", 80, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 424 }, -{ PROC_LINKS(multi_paste_interactive, 0), false, "multi_paste_interactive", 23, "Paste multiple lines from the clipboard history, controlled with arrow keys", 75, "w:\\4ed\\code\\custom\\4coder_clipboard.cpp", 39, 334 }, -{ PROC_LINKS(multi_paste_interactive_quick, 0), false, "multi_paste_interactive_quick", 29, "Paste multiple lines from the clipboard history, controlled by inputing the number of lines to paste", 100, "w:\\4ed\\code\\custom\\4coder_clipboard.cpp", 39, 343 }, +{ PROC_LINKS(multi_paste_interactive, 0), false, "multi_paste_interactive", 23, "Paste multiple lines from the clipboard history, controlled with arrow keys", 75, "w:\\4ed\\code\\custom\\4coder_clipboard.cpp", 39, 468 }, +{ PROC_LINKS(multi_paste_interactive_quick, 0), false, "multi_paste_interactive_quick", 29, "Paste multiple lines from the clipboard history, controlled by inputing the number of lines to paste", 100, "w:\\4ed\\code\\custom\\4coder_clipboard.cpp", 39, 477 }, { PROC_LINKS(open_all_code, 0), false, "open_all_code", 13, "Open all code in the current directory. File types are determined by extensions. An extension is considered code based on the extensions specified in 4coder.config.", 164, "w:\\4ed\\code\\custom\\4coder_project_commands.cpp", 46, 849 }, { PROC_LINKS(open_all_code_recursive, 0), false, "open_all_code_recursive", 23, "Works as open_all_code but also runs in all subdirectories.", 59, "w:\\4ed\\code\\custom\\4coder_project_commands.cpp", 46, 855 }, { PROC_LINKS(open_file_in_quotes, 0), false, "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, 1547 }, @@ -402,10 +404,10 @@ static Command_Metadata fcoder_metacmd_table[237] = { { PROC_LINKS(open_panel_vsplit, 0), false, "open_panel_vsplit", 17, "Create a new panel by vertically splitting the active panel.", 60, "w:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 300 }, { PROC_LINKS(page_down, 0), false, "page_down", 9, "Scrolls the view down one view height and moves the cursor down one view height.", 80, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 383 }, { PROC_LINKS(page_up, 0), false, "page_up", 7, "Scrolls the view up one view height and moves the cursor up one view height.", 76, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 375 }, -{ PROC_LINKS(paste, 0), false, "paste", 5, "At the cursor, insert the text at the top of the clipboard.", 59, "w:\\4ed\\code\\custom\\4coder_clipboard.cpp", 39, 97 }, -{ PROC_LINKS(paste_and_indent, 0), false, "paste_and_indent", 16, "Paste from the top of clipboard and run auto-indent on the newly pasted text.", 77, "w:\\4ed\\code\\custom\\4coder_clipboard.cpp", 39, 172 }, -{ PROC_LINKS(paste_next, 0), false, "paste_next", 10, "If the previous command was paste or paste_next, replaces the paste range with the next text down on the clipboard, otherwise operates as the paste command.", 156, "w:\\4ed\\code\\custom\\4coder_clipboard.cpp", 39, 131 }, -{ PROC_LINKS(paste_next_and_indent, 0), false, "paste_next_and_indent", 21, "Paste the next item on the clipboard and run auto-indent on the newly pasted text.", 82, "w:\\4ed\\code\\custom\\4coder_clipboard.cpp", 39, 179 }, +{ PROC_LINKS(paste, 0), false, "paste", 5, "At the cursor, insert the text at the top of the clipboard.", 59, "w:\\4ed\\code\\custom\\4coder_clipboard.cpp", 39, 231 }, +{ PROC_LINKS(paste_and_indent, 0), false, "paste_and_indent", 16, "Paste from the top of clipboard and run auto-indent on the newly pasted text.", 77, "w:\\4ed\\code\\custom\\4coder_clipboard.cpp", 39, 306 }, +{ PROC_LINKS(paste_next, 0), false, "paste_next", 10, "If the previous command was paste or paste_next, replaces the paste range with the next text down on the clipboard, otherwise operates as the paste command.", 156, "w:\\4ed\\code\\custom\\4coder_clipboard.cpp", 39, 265 }, +{ PROC_LINKS(paste_next_and_indent, 0), false, "paste_next_and_indent", 21, "Paste the next item on the clipboard and run auto-indent on the newly pasted text.", 82, "w:\\4ed\\code\\custom\\4coder_clipboard.cpp", 39, 313 }, { PROC_LINKS(place_in_scope, 0), false, "place_in_scope", 14, "Wraps the code contained in the range between cursor and mark with a new curly brace scope.", 91, "w:\\4ed\\code\\custom\\4coder_scope_commands.cpp", 44, 106 }, { PROC_LINKS(profile_clear, 0), false, "profile_clear", 13, "Clear all profiling information from 4coder's self profiler.", 60, "w:\\4ed\\code\\custom\\4coder_profile.cpp", 37, 226 }, { PROC_LINKS(profile_disable, 0), false, "profile_disable", 15, "Prevent 4coder's self profiler from gathering new profiling information.", 72, "w:\\4ed\\code\\custom\\4coder_profile.cpp", 37, 219 }, @@ -518,220 +520,221 @@ static i32 fcoder_metacmd_ID_click_set_cursor = 17; static i32 fcoder_metacmd_ID_click_set_cursor_and_mark = 18; static i32 fcoder_metacmd_ID_click_set_cursor_if_lbutton = 19; static i32 fcoder_metacmd_ID_click_set_mark = 20; -static i32 fcoder_metacmd_ID_close_all_code = 21; -static i32 fcoder_metacmd_ID_close_build_panel = 22; -static i32 fcoder_metacmd_ID_close_panel = 23; -static i32 fcoder_metacmd_ID_command_documentation = 24; -static i32 fcoder_metacmd_ID_command_lister = 25; -static i32 fcoder_metacmd_ID_comment_line = 26; -static i32 fcoder_metacmd_ID_comment_line_toggle = 27; -static i32 fcoder_metacmd_ID_copy = 28; -static i32 fcoder_metacmd_ID_cursor_mark_swap = 29; -static i32 fcoder_metacmd_ID_custom_api_documentation = 30; -static i32 fcoder_metacmd_ID_cut = 31; -static i32 fcoder_metacmd_ID_decrease_face_size = 32; -static i32 fcoder_metacmd_ID_default_file_externally_modified = 33; -static i32 fcoder_metacmd_ID_default_startup = 34; -static i32 fcoder_metacmd_ID_default_try_exit = 35; -static i32 fcoder_metacmd_ID_default_view_input_handler = 36; -static i32 fcoder_metacmd_ID_delete_alpha_numeric_boundary = 37; -static i32 fcoder_metacmd_ID_delete_char = 38; -static i32 fcoder_metacmd_ID_delete_current_scope = 39; -static i32 fcoder_metacmd_ID_delete_file_query = 40; -static i32 fcoder_metacmd_ID_delete_line = 41; -static i32 fcoder_metacmd_ID_delete_range = 42; -static i32 fcoder_metacmd_ID_duplicate_line = 43; -static i32 fcoder_metacmd_ID_execute_any_cli = 44; -static i32 fcoder_metacmd_ID_execute_previous_cli = 45; -static i32 fcoder_metacmd_ID_exit_4coder = 46; -static i32 fcoder_metacmd_ID_goto_beginning_of_file = 47; -static i32 fcoder_metacmd_ID_goto_end_of_file = 48; -static i32 fcoder_metacmd_ID_goto_first_jump = 49; -static i32 fcoder_metacmd_ID_goto_first_jump_same_panel_sticky = 50; -static i32 fcoder_metacmd_ID_goto_jump_at_cursor = 51; -static i32 fcoder_metacmd_ID_goto_jump_at_cursor_same_panel = 52; -static i32 fcoder_metacmd_ID_goto_line = 53; -static i32 fcoder_metacmd_ID_goto_next_jump = 54; -static i32 fcoder_metacmd_ID_goto_next_jump_no_skips = 55; -static i32 fcoder_metacmd_ID_goto_prev_jump = 56; -static i32 fcoder_metacmd_ID_goto_prev_jump_no_skips = 57; -static i32 fcoder_metacmd_ID_hide_filebar = 58; -static i32 fcoder_metacmd_ID_hide_scrollbar = 59; -static i32 fcoder_metacmd_ID_hms_demo_tutorial = 60; -static i32 fcoder_metacmd_ID_if0_off = 61; -static i32 fcoder_metacmd_ID_if_read_only_goto_position = 62; -static i32 fcoder_metacmd_ID_if_read_only_goto_position_same_panel = 63; -static i32 fcoder_metacmd_ID_increase_face_size = 64; -static i32 fcoder_metacmd_ID_interactive_kill_buffer = 65; -static i32 fcoder_metacmd_ID_interactive_new = 66; -static i32 fcoder_metacmd_ID_interactive_open = 67; -static i32 fcoder_metacmd_ID_interactive_open_or_new = 68; -static i32 fcoder_metacmd_ID_interactive_switch_buffer = 69; -static i32 fcoder_metacmd_ID_jump_to_definition = 70; -static i32 fcoder_metacmd_ID_keyboard_macro_finish_recording = 71; -static i32 fcoder_metacmd_ID_keyboard_macro_replay = 72; -static i32 fcoder_metacmd_ID_keyboard_macro_start_recording = 73; -static i32 fcoder_metacmd_ID_kill_buffer = 74; -static i32 fcoder_metacmd_ID_kill_tutorial = 75; -static i32 fcoder_metacmd_ID_left_adjust_view = 76; -static i32 fcoder_metacmd_ID_list_all_functions_all_buffers = 77; -static i32 fcoder_metacmd_ID_list_all_functions_all_buffers_lister = 78; -static i32 fcoder_metacmd_ID_list_all_functions_current_buffer = 79; -static i32 fcoder_metacmd_ID_list_all_functions_current_buffer_lister = 80; -static i32 fcoder_metacmd_ID_list_all_locations = 81; -static i32 fcoder_metacmd_ID_list_all_locations_case_insensitive = 82; -static i32 fcoder_metacmd_ID_list_all_locations_of_identifier = 83; -static i32 fcoder_metacmd_ID_list_all_locations_of_identifier_case_insensitive = 84; -static i32 fcoder_metacmd_ID_list_all_locations_of_selection = 85; -static i32 fcoder_metacmd_ID_list_all_locations_of_selection_case_insensitive = 86; -static i32 fcoder_metacmd_ID_list_all_locations_of_type_definition = 87; -static i32 fcoder_metacmd_ID_list_all_locations_of_type_definition_of_identifier = 88; -static i32 fcoder_metacmd_ID_list_all_substring_locations = 89; -static i32 fcoder_metacmd_ID_list_all_substring_locations_case_insensitive = 90; -static i32 fcoder_metacmd_ID_load_project = 91; -static i32 fcoder_metacmd_ID_load_theme_current_buffer = 92; -static i32 fcoder_metacmd_ID_load_themes_default_folder = 93; -static i32 fcoder_metacmd_ID_load_themes_hot_directory = 94; -static i32 fcoder_metacmd_ID_make_directory_query = 95; -static i32 fcoder_metacmd_ID_miblo_decrement_basic = 96; -static i32 fcoder_metacmd_ID_miblo_decrement_time_stamp = 97; -static i32 fcoder_metacmd_ID_miblo_decrement_time_stamp_minute = 98; -static i32 fcoder_metacmd_ID_miblo_increment_basic = 99; -static i32 fcoder_metacmd_ID_miblo_increment_time_stamp = 100; -static i32 fcoder_metacmd_ID_miblo_increment_time_stamp_minute = 101; -static i32 fcoder_metacmd_ID_mouse_wheel_change_face_size = 102; -static i32 fcoder_metacmd_ID_mouse_wheel_scroll = 103; -static i32 fcoder_metacmd_ID_move_down = 104; -static i32 fcoder_metacmd_ID_move_down_10 = 105; -static i32 fcoder_metacmd_ID_move_down_textual = 106; -static i32 fcoder_metacmd_ID_move_down_to_blank_line = 107; -static i32 fcoder_metacmd_ID_move_down_to_blank_line_end = 108; -static i32 fcoder_metacmd_ID_move_down_to_blank_line_skip_whitespace = 109; -static i32 fcoder_metacmd_ID_move_left = 110; -static i32 fcoder_metacmd_ID_move_left_alpha_numeric_boundary = 111; -static i32 fcoder_metacmd_ID_move_left_alpha_numeric_or_camel_boundary = 112; -static i32 fcoder_metacmd_ID_move_left_token_boundary = 113; -static i32 fcoder_metacmd_ID_move_left_whitespace_boundary = 114; -static i32 fcoder_metacmd_ID_move_left_whitespace_or_token_boundary = 115; -static i32 fcoder_metacmd_ID_move_line_down = 116; -static i32 fcoder_metacmd_ID_move_line_up = 117; -static i32 fcoder_metacmd_ID_move_right = 118; -static i32 fcoder_metacmd_ID_move_right_alpha_numeric_boundary = 119; -static i32 fcoder_metacmd_ID_move_right_alpha_numeric_or_camel_boundary = 120; -static i32 fcoder_metacmd_ID_move_right_token_boundary = 121; -static i32 fcoder_metacmd_ID_move_right_whitespace_boundary = 122; -static i32 fcoder_metacmd_ID_move_right_whitespace_or_token_boundary = 123; -static i32 fcoder_metacmd_ID_move_up = 124; -static i32 fcoder_metacmd_ID_move_up_10 = 125; -static i32 fcoder_metacmd_ID_move_up_to_blank_line = 126; -static i32 fcoder_metacmd_ID_move_up_to_blank_line_end = 127; -static i32 fcoder_metacmd_ID_move_up_to_blank_line_skip_whitespace = 128; -static i32 fcoder_metacmd_ID_multi_paste_interactive = 129; -static i32 fcoder_metacmd_ID_multi_paste_interactive_quick = 130; -static i32 fcoder_metacmd_ID_open_all_code = 131; -static i32 fcoder_metacmd_ID_open_all_code_recursive = 132; -static i32 fcoder_metacmd_ID_open_file_in_quotes = 133; -static i32 fcoder_metacmd_ID_open_in_other = 134; -static i32 fcoder_metacmd_ID_open_long_braces = 135; -static i32 fcoder_metacmd_ID_open_long_braces_break = 136; -static i32 fcoder_metacmd_ID_open_long_braces_semicolon = 137; -static i32 fcoder_metacmd_ID_open_matching_file_cpp = 138; -static i32 fcoder_metacmd_ID_open_panel_hsplit = 139; -static i32 fcoder_metacmd_ID_open_panel_vsplit = 140; -static i32 fcoder_metacmd_ID_page_down = 141; -static i32 fcoder_metacmd_ID_page_up = 142; -static i32 fcoder_metacmd_ID_paste = 143; -static i32 fcoder_metacmd_ID_paste_and_indent = 144; -static i32 fcoder_metacmd_ID_paste_next = 145; -static i32 fcoder_metacmd_ID_paste_next_and_indent = 146; -static i32 fcoder_metacmd_ID_place_in_scope = 147; -static i32 fcoder_metacmd_ID_profile_clear = 148; -static i32 fcoder_metacmd_ID_profile_disable = 149; -static i32 fcoder_metacmd_ID_profile_enable = 150; -static i32 fcoder_metacmd_ID_profile_inspect = 151; -static i32 fcoder_metacmd_ID_project_command_lister = 152; -static i32 fcoder_metacmd_ID_project_fkey_command = 153; -static i32 fcoder_metacmd_ID_project_go_to_root_directory = 154; -static i32 fcoder_metacmd_ID_query_replace = 155; -static i32 fcoder_metacmd_ID_query_replace_identifier = 156; -static i32 fcoder_metacmd_ID_query_replace_selection = 157; -static i32 fcoder_metacmd_ID_redo = 158; -static i32 fcoder_metacmd_ID_redo_all_buffers = 159; -static i32 fcoder_metacmd_ID_rename_file_query = 160; -static i32 fcoder_metacmd_ID_reopen = 161; -static i32 fcoder_metacmd_ID_replace_in_all_buffers = 162; -static i32 fcoder_metacmd_ID_replace_in_buffer = 163; -static i32 fcoder_metacmd_ID_replace_in_range = 164; -static i32 fcoder_metacmd_ID_reverse_search = 165; -static i32 fcoder_metacmd_ID_reverse_search_identifier = 166; -static i32 fcoder_metacmd_ID_save = 167; -static i32 fcoder_metacmd_ID_save_all_dirty_buffers = 168; -static i32 fcoder_metacmd_ID_save_to_query = 169; -static i32 fcoder_metacmd_ID_search = 170; -static i32 fcoder_metacmd_ID_search_identifier = 171; -static i32 fcoder_metacmd_ID_seek_beginning_of_line = 172; -static i32 fcoder_metacmd_ID_seek_beginning_of_textual_line = 173; -static i32 fcoder_metacmd_ID_seek_end_of_line = 174; -static i32 fcoder_metacmd_ID_seek_end_of_textual_line = 175; -static i32 fcoder_metacmd_ID_select_all = 176; -static i32 fcoder_metacmd_ID_select_next_scope_absolute = 177; -static i32 fcoder_metacmd_ID_select_next_scope_after_current = 178; -static i32 fcoder_metacmd_ID_select_prev_scope_absolute = 179; -static i32 fcoder_metacmd_ID_select_prev_top_most_scope = 180; -static i32 fcoder_metacmd_ID_select_surrounding_scope = 181; -static i32 fcoder_metacmd_ID_select_surrounding_scope_maximal = 182; -static i32 fcoder_metacmd_ID_set_eol_mode_from_contents = 183; -static i32 fcoder_metacmd_ID_set_eol_mode_to_binary = 184; -static i32 fcoder_metacmd_ID_set_eol_mode_to_crlf = 185; -static i32 fcoder_metacmd_ID_set_eol_mode_to_lf = 186; -static i32 fcoder_metacmd_ID_set_face_size = 187; -static i32 fcoder_metacmd_ID_set_face_size_this_buffer = 188; -static i32 fcoder_metacmd_ID_set_mark = 189; -static i32 fcoder_metacmd_ID_set_mode_to_notepad_like = 190; -static i32 fcoder_metacmd_ID_set_mode_to_original = 191; -static i32 fcoder_metacmd_ID_setup_build_bat = 192; -static i32 fcoder_metacmd_ID_setup_build_bat_and_sh = 193; -static i32 fcoder_metacmd_ID_setup_build_sh = 194; -static i32 fcoder_metacmd_ID_setup_new_project = 195; -static i32 fcoder_metacmd_ID_show_filebar = 196; -static i32 fcoder_metacmd_ID_show_scrollbar = 197; -static i32 fcoder_metacmd_ID_show_the_log_graph = 198; -static i32 fcoder_metacmd_ID_snipe_backward_whitespace_or_token_boundary = 199; -static i32 fcoder_metacmd_ID_snipe_forward_whitespace_or_token_boundary = 200; -static i32 fcoder_metacmd_ID_snippet_lister = 201; -static i32 fcoder_metacmd_ID_suppress_mouse = 202; -static i32 fcoder_metacmd_ID_swap_panels = 203; -static i32 fcoder_metacmd_ID_test_double_backspace = 204; -static i32 fcoder_metacmd_ID_theme_lister = 205; -static i32 fcoder_metacmd_ID_to_lowercase = 206; -static i32 fcoder_metacmd_ID_to_uppercase = 207; -static i32 fcoder_metacmd_ID_toggle_filebar = 208; -static i32 fcoder_metacmd_ID_toggle_fps_meter = 209; -static i32 fcoder_metacmd_ID_toggle_fullscreen = 210; -static i32 fcoder_metacmd_ID_toggle_highlight_enclosing_scopes = 211; -static i32 fcoder_metacmd_ID_toggle_highlight_line_at_cursor = 212; -static i32 fcoder_metacmd_ID_toggle_line_numbers = 213; -static i32 fcoder_metacmd_ID_toggle_line_wrap = 214; -static i32 fcoder_metacmd_ID_toggle_mouse = 215; -static i32 fcoder_metacmd_ID_toggle_paren_matching_helper = 216; -static i32 fcoder_metacmd_ID_toggle_show_whitespace = 217; -static i32 fcoder_metacmd_ID_toggle_virtual_whitespace = 218; -static i32 fcoder_metacmd_ID_tutorial_maximize = 219; -static i32 fcoder_metacmd_ID_tutorial_minimize = 220; -static i32 fcoder_metacmd_ID_uncomment_line = 221; -static i32 fcoder_metacmd_ID_undo = 222; -static i32 fcoder_metacmd_ID_undo_all_buffers = 223; -static i32 fcoder_metacmd_ID_view_buffer_other_panel = 224; -static i32 fcoder_metacmd_ID_view_jump_list_with_lister = 225; -static i32 fcoder_metacmd_ID_word_complete = 226; -static i32 fcoder_metacmd_ID_word_complete_drop_down = 227; -static i32 fcoder_metacmd_ID_write_block = 228; -static i32 fcoder_metacmd_ID_write_hack = 229; -static i32 fcoder_metacmd_ID_write_note = 230; -static i32 fcoder_metacmd_ID_write_space = 231; -static i32 fcoder_metacmd_ID_write_text_and_auto_indent = 232; -static i32 fcoder_metacmd_ID_write_text_input = 233; -static i32 fcoder_metacmd_ID_write_todo = 234; -static i32 fcoder_metacmd_ID_write_underscore = 235; -static i32 fcoder_metacmd_ID_write_zero_struct = 236; +static i32 fcoder_metacmd_ID_clipboard_record_clip = 21; +static i32 fcoder_metacmd_ID_close_all_code = 22; +static i32 fcoder_metacmd_ID_close_build_panel = 23; +static i32 fcoder_metacmd_ID_close_panel = 24; +static i32 fcoder_metacmd_ID_command_documentation = 25; +static i32 fcoder_metacmd_ID_command_lister = 26; +static i32 fcoder_metacmd_ID_comment_line = 27; +static i32 fcoder_metacmd_ID_comment_line_toggle = 28; +static i32 fcoder_metacmd_ID_copy = 29; +static i32 fcoder_metacmd_ID_cursor_mark_swap = 30; +static i32 fcoder_metacmd_ID_custom_api_documentation = 31; +static i32 fcoder_metacmd_ID_cut = 32; +static i32 fcoder_metacmd_ID_decrease_face_size = 33; +static i32 fcoder_metacmd_ID_default_file_externally_modified = 34; +static i32 fcoder_metacmd_ID_default_startup = 35; +static i32 fcoder_metacmd_ID_default_try_exit = 36; +static i32 fcoder_metacmd_ID_default_view_input_handler = 37; +static i32 fcoder_metacmd_ID_delete_alpha_numeric_boundary = 38; +static i32 fcoder_metacmd_ID_delete_char = 39; +static i32 fcoder_metacmd_ID_delete_current_scope = 40; +static i32 fcoder_metacmd_ID_delete_file_query = 41; +static i32 fcoder_metacmd_ID_delete_line = 42; +static i32 fcoder_metacmd_ID_delete_range = 43; +static i32 fcoder_metacmd_ID_duplicate_line = 44; +static i32 fcoder_metacmd_ID_execute_any_cli = 45; +static i32 fcoder_metacmd_ID_execute_previous_cli = 46; +static i32 fcoder_metacmd_ID_exit_4coder = 47; +static i32 fcoder_metacmd_ID_goto_beginning_of_file = 48; +static i32 fcoder_metacmd_ID_goto_end_of_file = 49; +static i32 fcoder_metacmd_ID_goto_first_jump = 50; +static i32 fcoder_metacmd_ID_goto_first_jump_same_panel_sticky = 51; +static i32 fcoder_metacmd_ID_goto_jump_at_cursor = 52; +static i32 fcoder_metacmd_ID_goto_jump_at_cursor_same_panel = 53; +static i32 fcoder_metacmd_ID_goto_line = 54; +static i32 fcoder_metacmd_ID_goto_next_jump = 55; +static i32 fcoder_metacmd_ID_goto_next_jump_no_skips = 56; +static i32 fcoder_metacmd_ID_goto_prev_jump = 57; +static i32 fcoder_metacmd_ID_goto_prev_jump_no_skips = 58; +static i32 fcoder_metacmd_ID_hide_filebar = 59; +static i32 fcoder_metacmd_ID_hide_scrollbar = 60; +static i32 fcoder_metacmd_ID_hms_demo_tutorial = 61; +static i32 fcoder_metacmd_ID_if0_off = 62; +static i32 fcoder_metacmd_ID_if_read_only_goto_position = 63; +static i32 fcoder_metacmd_ID_if_read_only_goto_position_same_panel = 64; +static i32 fcoder_metacmd_ID_increase_face_size = 65; +static i32 fcoder_metacmd_ID_interactive_kill_buffer = 66; +static i32 fcoder_metacmd_ID_interactive_new = 67; +static i32 fcoder_metacmd_ID_interactive_open = 68; +static i32 fcoder_metacmd_ID_interactive_open_or_new = 69; +static i32 fcoder_metacmd_ID_interactive_switch_buffer = 70; +static i32 fcoder_metacmd_ID_jump_to_definition = 71; +static i32 fcoder_metacmd_ID_keyboard_macro_finish_recording = 72; +static i32 fcoder_metacmd_ID_keyboard_macro_replay = 73; +static i32 fcoder_metacmd_ID_keyboard_macro_start_recording = 74; +static i32 fcoder_metacmd_ID_kill_buffer = 75; +static i32 fcoder_metacmd_ID_kill_tutorial = 76; +static i32 fcoder_metacmd_ID_left_adjust_view = 77; +static i32 fcoder_metacmd_ID_list_all_functions_all_buffers = 78; +static i32 fcoder_metacmd_ID_list_all_functions_all_buffers_lister = 79; +static i32 fcoder_metacmd_ID_list_all_functions_current_buffer = 80; +static i32 fcoder_metacmd_ID_list_all_functions_current_buffer_lister = 81; +static i32 fcoder_metacmd_ID_list_all_locations = 82; +static i32 fcoder_metacmd_ID_list_all_locations_case_insensitive = 83; +static i32 fcoder_metacmd_ID_list_all_locations_of_identifier = 84; +static i32 fcoder_metacmd_ID_list_all_locations_of_identifier_case_insensitive = 85; +static i32 fcoder_metacmd_ID_list_all_locations_of_selection = 86; +static i32 fcoder_metacmd_ID_list_all_locations_of_selection_case_insensitive = 87; +static i32 fcoder_metacmd_ID_list_all_locations_of_type_definition = 88; +static i32 fcoder_metacmd_ID_list_all_locations_of_type_definition_of_identifier = 89; +static i32 fcoder_metacmd_ID_list_all_substring_locations = 90; +static i32 fcoder_metacmd_ID_list_all_substring_locations_case_insensitive = 91; +static i32 fcoder_metacmd_ID_load_project = 92; +static i32 fcoder_metacmd_ID_load_theme_current_buffer = 93; +static i32 fcoder_metacmd_ID_load_themes_default_folder = 94; +static i32 fcoder_metacmd_ID_load_themes_hot_directory = 95; +static i32 fcoder_metacmd_ID_make_directory_query = 96; +static i32 fcoder_metacmd_ID_miblo_decrement_basic = 97; +static i32 fcoder_metacmd_ID_miblo_decrement_time_stamp = 98; +static i32 fcoder_metacmd_ID_miblo_decrement_time_stamp_minute = 99; +static i32 fcoder_metacmd_ID_miblo_increment_basic = 100; +static i32 fcoder_metacmd_ID_miblo_increment_time_stamp = 101; +static i32 fcoder_metacmd_ID_miblo_increment_time_stamp_minute = 102; +static i32 fcoder_metacmd_ID_mouse_wheel_change_face_size = 103; +static i32 fcoder_metacmd_ID_mouse_wheel_scroll = 104; +static i32 fcoder_metacmd_ID_move_down = 105; +static i32 fcoder_metacmd_ID_move_down_10 = 106; +static i32 fcoder_metacmd_ID_move_down_textual = 107; +static i32 fcoder_metacmd_ID_move_down_to_blank_line = 108; +static i32 fcoder_metacmd_ID_move_down_to_blank_line_end = 109; +static i32 fcoder_metacmd_ID_move_down_to_blank_line_skip_whitespace = 110; +static i32 fcoder_metacmd_ID_move_left = 111; +static i32 fcoder_metacmd_ID_move_left_alpha_numeric_boundary = 112; +static i32 fcoder_metacmd_ID_move_left_alpha_numeric_or_camel_boundary = 113; +static i32 fcoder_metacmd_ID_move_left_token_boundary = 114; +static i32 fcoder_metacmd_ID_move_left_whitespace_boundary = 115; +static i32 fcoder_metacmd_ID_move_left_whitespace_or_token_boundary = 116; +static i32 fcoder_metacmd_ID_move_line_down = 117; +static i32 fcoder_metacmd_ID_move_line_up = 118; +static i32 fcoder_metacmd_ID_move_right = 119; +static i32 fcoder_metacmd_ID_move_right_alpha_numeric_boundary = 120; +static i32 fcoder_metacmd_ID_move_right_alpha_numeric_or_camel_boundary = 121; +static i32 fcoder_metacmd_ID_move_right_token_boundary = 122; +static i32 fcoder_metacmd_ID_move_right_whitespace_boundary = 123; +static i32 fcoder_metacmd_ID_move_right_whitespace_or_token_boundary = 124; +static i32 fcoder_metacmd_ID_move_up = 125; +static i32 fcoder_metacmd_ID_move_up_10 = 126; +static i32 fcoder_metacmd_ID_move_up_to_blank_line = 127; +static i32 fcoder_metacmd_ID_move_up_to_blank_line_end = 128; +static i32 fcoder_metacmd_ID_move_up_to_blank_line_skip_whitespace = 129; +static i32 fcoder_metacmd_ID_multi_paste_interactive = 130; +static i32 fcoder_metacmd_ID_multi_paste_interactive_quick = 131; +static i32 fcoder_metacmd_ID_open_all_code = 132; +static i32 fcoder_metacmd_ID_open_all_code_recursive = 133; +static i32 fcoder_metacmd_ID_open_file_in_quotes = 134; +static i32 fcoder_metacmd_ID_open_in_other = 135; +static i32 fcoder_metacmd_ID_open_long_braces = 136; +static i32 fcoder_metacmd_ID_open_long_braces_break = 137; +static i32 fcoder_metacmd_ID_open_long_braces_semicolon = 138; +static i32 fcoder_metacmd_ID_open_matching_file_cpp = 139; +static i32 fcoder_metacmd_ID_open_panel_hsplit = 140; +static i32 fcoder_metacmd_ID_open_panel_vsplit = 141; +static i32 fcoder_metacmd_ID_page_down = 142; +static i32 fcoder_metacmd_ID_page_up = 143; +static i32 fcoder_metacmd_ID_paste = 144; +static i32 fcoder_metacmd_ID_paste_and_indent = 145; +static i32 fcoder_metacmd_ID_paste_next = 146; +static i32 fcoder_metacmd_ID_paste_next_and_indent = 147; +static i32 fcoder_metacmd_ID_place_in_scope = 148; +static i32 fcoder_metacmd_ID_profile_clear = 149; +static i32 fcoder_metacmd_ID_profile_disable = 150; +static i32 fcoder_metacmd_ID_profile_enable = 151; +static i32 fcoder_metacmd_ID_profile_inspect = 152; +static i32 fcoder_metacmd_ID_project_command_lister = 153; +static i32 fcoder_metacmd_ID_project_fkey_command = 154; +static i32 fcoder_metacmd_ID_project_go_to_root_directory = 155; +static i32 fcoder_metacmd_ID_query_replace = 156; +static i32 fcoder_metacmd_ID_query_replace_identifier = 157; +static i32 fcoder_metacmd_ID_query_replace_selection = 158; +static i32 fcoder_metacmd_ID_redo = 159; +static i32 fcoder_metacmd_ID_redo_all_buffers = 160; +static i32 fcoder_metacmd_ID_rename_file_query = 161; +static i32 fcoder_metacmd_ID_reopen = 162; +static i32 fcoder_metacmd_ID_replace_in_all_buffers = 163; +static i32 fcoder_metacmd_ID_replace_in_buffer = 164; +static i32 fcoder_metacmd_ID_replace_in_range = 165; +static i32 fcoder_metacmd_ID_reverse_search = 166; +static i32 fcoder_metacmd_ID_reverse_search_identifier = 167; +static i32 fcoder_metacmd_ID_save = 168; +static i32 fcoder_metacmd_ID_save_all_dirty_buffers = 169; +static i32 fcoder_metacmd_ID_save_to_query = 170; +static i32 fcoder_metacmd_ID_search = 171; +static i32 fcoder_metacmd_ID_search_identifier = 172; +static i32 fcoder_metacmd_ID_seek_beginning_of_line = 173; +static i32 fcoder_metacmd_ID_seek_beginning_of_textual_line = 174; +static i32 fcoder_metacmd_ID_seek_end_of_line = 175; +static i32 fcoder_metacmd_ID_seek_end_of_textual_line = 176; +static i32 fcoder_metacmd_ID_select_all = 177; +static i32 fcoder_metacmd_ID_select_next_scope_absolute = 178; +static i32 fcoder_metacmd_ID_select_next_scope_after_current = 179; +static i32 fcoder_metacmd_ID_select_prev_scope_absolute = 180; +static i32 fcoder_metacmd_ID_select_prev_top_most_scope = 181; +static i32 fcoder_metacmd_ID_select_surrounding_scope = 182; +static i32 fcoder_metacmd_ID_select_surrounding_scope_maximal = 183; +static i32 fcoder_metacmd_ID_set_eol_mode_from_contents = 184; +static i32 fcoder_metacmd_ID_set_eol_mode_to_binary = 185; +static i32 fcoder_metacmd_ID_set_eol_mode_to_crlf = 186; +static i32 fcoder_metacmd_ID_set_eol_mode_to_lf = 187; +static i32 fcoder_metacmd_ID_set_face_size = 188; +static i32 fcoder_metacmd_ID_set_face_size_this_buffer = 189; +static i32 fcoder_metacmd_ID_set_mark = 190; +static i32 fcoder_metacmd_ID_set_mode_to_notepad_like = 191; +static i32 fcoder_metacmd_ID_set_mode_to_original = 192; +static i32 fcoder_metacmd_ID_setup_build_bat = 193; +static i32 fcoder_metacmd_ID_setup_build_bat_and_sh = 194; +static i32 fcoder_metacmd_ID_setup_build_sh = 195; +static i32 fcoder_metacmd_ID_setup_new_project = 196; +static i32 fcoder_metacmd_ID_show_filebar = 197; +static i32 fcoder_metacmd_ID_show_scrollbar = 198; +static i32 fcoder_metacmd_ID_show_the_log_graph = 199; +static i32 fcoder_metacmd_ID_snipe_backward_whitespace_or_token_boundary = 200; +static i32 fcoder_metacmd_ID_snipe_forward_whitespace_or_token_boundary = 201; +static i32 fcoder_metacmd_ID_snippet_lister = 202; +static i32 fcoder_metacmd_ID_suppress_mouse = 203; +static i32 fcoder_metacmd_ID_swap_panels = 204; +static i32 fcoder_metacmd_ID_test_double_backspace = 205; +static i32 fcoder_metacmd_ID_theme_lister = 206; +static i32 fcoder_metacmd_ID_to_lowercase = 207; +static i32 fcoder_metacmd_ID_to_uppercase = 208; +static i32 fcoder_metacmd_ID_toggle_filebar = 209; +static i32 fcoder_metacmd_ID_toggle_fps_meter = 210; +static i32 fcoder_metacmd_ID_toggle_fullscreen = 211; +static i32 fcoder_metacmd_ID_toggle_highlight_enclosing_scopes = 212; +static i32 fcoder_metacmd_ID_toggle_highlight_line_at_cursor = 213; +static i32 fcoder_metacmd_ID_toggle_line_numbers = 214; +static i32 fcoder_metacmd_ID_toggle_line_wrap = 215; +static i32 fcoder_metacmd_ID_toggle_mouse = 216; +static i32 fcoder_metacmd_ID_toggle_paren_matching_helper = 217; +static i32 fcoder_metacmd_ID_toggle_show_whitespace = 218; +static i32 fcoder_metacmd_ID_toggle_virtual_whitespace = 219; +static i32 fcoder_metacmd_ID_tutorial_maximize = 220; +static i32 fcoder_metacmd_ID_tutorial_minimize = 221; +static i32 fcoder_metacmd_ID_uncomment_line = 222; +static i32 fcoder_metacmd_ID_undo = 223; +static i32 fcoder_metacmd_ID_undo_all_buffers = 224; +static i32 fcoder_metacmd_ID_view_buffer_other_panel = 225; +static i32 fcoder_metacmd_ID_view_jump_list_with_lister = 226; +static i32 fcoder_metacmd_ID_word_complete = 227; +static i32 fcoder_metacmd_ID_word_complete_drop_down = 228; +static i32 fcoder_metacmd_ID_write_block = 229; +static i32 fcoder_metacmd_ID_write_hack = 230; +static i32 fcoder_metacmd_ID_write_note = 231; +static i32 fcoder_metacmd_ID_write_space = 232; +static i32 fcoder_metacmd_ID_write_text_and_auto_indent = 233; +static i32 fcoder_metacmd_ID_write_text_input = 234; +static i32 fcoder_metacmd_ID_write_todo = 235; +static i32 fcoder_metacmd_ID_write_underscore = 236; +static i32 fcoder_metacmd_ID_write_zero_struct = 237; #endif diff --git a/custom/generated/custom_api.cpp b/custom/generated/custom_api.cpp index b092dc53..b8e5f6b3 100644 --- a/custom/generated/custom_api.cpp +++ b/custom/generated/custom_api.cpp @@ -8,10 +8,6 @@ vtable->child_process_set_target_buffer = child_process_set_target_buffer; vtable->buffer_get_attached_child_process = buffer_get_attached_child_process; vtable->child_process_get_attached_buffer = child_process_get_attached_buffer; vtable->child_process_get_state = child_process_get_state; -vtable->clipboard_clear = clipboard_clear; -vtable->clipboard_post_internal_only = clipboard_post_internal_only; -vtable->clipboard_count = clipboard_count; -vtable->push_clipboard_index = push_clipboard_index; vtable->enqueue_virtual_event = enqueue_virtual_event; vtable->get_buffer_count = get_buffer_count; vtable->get_buffer_next = get_buffer_next; @@ -190,10 +186,6 @@ child_process_set_target_buffer = vtable->child_process_set_target_buffer; buffer_get_attached_child_process = vtable->buffer_get_attached_child_process; child_process_get_attached_buffer = vtable->child_process_get_attached_buffer; child_process_get_state = vtable->child_process_get_state; -clipboard_clear = vtable->clipboard_clear; -clipboard_post_internal_only = vtable->clipboard_post_internal_only; -clipboard_count = vtable->clipboard_count; -push_clipboard_index = vtable->push_clipboard_index; enqueue_virtual_event = vtable->enqueue_virtual_event; get_buffer_count = vtable->get_buffer_count; get_buffer_next = vtable->get_buffer_next; diff --git a/custom/generated/custom_api.h b/custom/generated/custom_api.h index 8a9563a0..f89bcad5 100644 --- a/custom/generated/custom_api.h +++ b/custom/generated/custom_api.h @@ -6,10 +6,6 @@ #define custom_buffer_get_attached_child_process_sig() Child_Process_ID custom_buffer_get_attached_child_process(Application_Links* app, Buffer_ID buffer_id) #define custom_child_process_get_attached_buffer_sig() Buffer_ID custom_child_process_get_attached_buffer(Application_Links* app, Child_Process_ID child_process_id) #define custom_child_process_get_state_sig() Process_State custom_child_process_get_state(Application_Links* app, Child_Process_ID child_process_id) -#define custom_clipboard_clear_sig() b32 custom_clipboard_clear(Application_Links* app, i32 clipboard_id) -#define custom_clipboard_post_internal_only_sig() b32 custom_clipboard_post_internal_only(Application_Links* app, i32 clipboard_id, String_Const_u8 string) -#define custom_clipboard_count_sig() i32 custom_clipboard_count(Application_Links* app, i32 clipboard_id) -#define custom_push_clipboard_index_sig() String_Const_u8 custom_push_clipboard_index(Application_Links* app, Arena* arena, i32 clipboard_id, i32 item_index) #define custom_enqueue_virtual_event_sig() b32 custom_enqueue_virtual_event(Application_Links* app, Input_Event* event) #define custom_get_buffer_count_sig() i32 custom_get_buffer_count(Application_Links* app) #define custom_get_buffer_next_sig() Buffer_ID custom_get_buffer_next(Application_Links* app, Buffer_ID buffer_id, Access_Flag access) @@ -184,10 +180,6 @@ typedef b32 custom_child_process_set_target_buffer_type(Application_Links* app, typedef Child_Process_ID custom_buffer_get_attached_child_process_type(Application_Links* app, Buffer_ID buffer_id); typedef Buffer_ID custom_child_process_get_attached_buffer_type(Application_Links* app, Child_Process_ID child_process_id); typedef Process_State custom_child_process_get_state_type(Application_Links* app, Child_Process_ID child_process_id); -typedef b32 custom_clipboard_clear_type(Application_Links* app, i32 clipboard_id); -typedef b32 custom_clipboard_post_internal_only_type(Application_Links* app, i32 clipboard_id, String_Const_u8 string); -typedef i32 custom_clipboard_count_type(Application_Links* app, i32 clipboard_id); -typedef String_Const_u8 custom_push_clipboard_index_type(Application_Links* app, Arena* arena, i32 clipboard_id, i32 item_index); typedef b32 custom_enqueue_virtual_event_type(Application_Links* app, Input_Event* event); typedef i32 custom_get_buffer_count_type(Application_Links* app); typedef Buffer_ID custom_get_buffer_next_type(Application_Links* app, Buffer_ID buffer_id, Access_Flag access); @@ -363,10 +355,6 @@ custom_child_process_set_target_buffer_type *child_process_set_target_buffer; custom_buffer_get_attached_child_process_type *buffer_get_attached_child_process; custom_child_process_get_attached_buffer_type *child_process_get_attached_buffer; custom_child_process_get_state_type *child_process_get_state; -custom_clipboard_clear_type *clipboard_clear; -custom_clipboard_post_internal_only_type *clipboard_post_internal_only; -custom_clipboard_count_type *clipboard_count; -custom_push_clipboard_index_type *push_clipboard_index; custom_enqueue_virtual_event_type *enqueue_virtual_event; custom_get_buffer_count_type *get_buffer_count; custom_get_buffer_next_type *get_buffer_next; @@ -543,10 +531,6 @@ internal b32 child_process_set_target_buffer(Application_Links* app, Child_Proce internal Child_Process_ID buffer_get_attached_child_process(Application_Links* app, Buffer_ID buffer_id); internal Buffer_ID child_process_get_attached_buffer(Application_Links* app, Child_Process_ID child_process_id); internal Process_State child_process_get_state(Application_Links* app, Child_Process_ID child_process_id); -internal b32 clipboard_clear(Application_Links* app, i32 clipboard_id); -internal b32 clipboard_post_internal_only(Application_Links* app, i32 clipboard_id, String_Const_u8 string); -internal i32 clipboard_count(Application_Links* app, i32 clipboard_id); -internal String_Const_u8 push_clipboard_index(Application_Links* app, Arena* arena, i32 clipboard_id, i32 item_index); internal b32 enqueue_virtual_event(Application_Links* app, Input_Event* event); internal i32 get_buffer_count(Application_Links* app); internal Buffer_ID get_buffer_next(Application_Links* app, Buffer_ID buffer_id, Access_Flag access); @@ -723,10 +707,6 @@ global custom_child_process_set_target_buffer_type *child_process_set_target_buf global custom_buffer_get_attached_child_process_type *buffer_get_attached_child_process = 0; global custom_child_process_get_attached_buffer_type *child_process_get_attached_buffer = 0; global custom_child_process_get_state_type *child_process_get_state = 0; -global custom_clipboard_clear_type *clipboard_clear = 0; -global custom_clipboard_post_internal_only_type *clipboard_post_internal_only = 0; -global custom_clipboard_count_type *clipboard_count = 0; -global custom_push_clipboard_index_type *push_clipboard_index = 0; global custom_enqueue_virtual_event_type *enqueue_virtual_event = 0; global custom_get_buffer_count_type *get_buffer_count = 0; global custom_get_buffer_next_type *get_buffer_next = 0; diff --git a/custom/generated/custom_api_master_list.h b/custom/generated/custom_api_master_list.h index a8eb6f63..d65db2f1 100644 --- a/custom/generated/custom_api_master_list.h +++ b/custom/generated/custom_api_master_list.h @@ -6,10 +6,6 @@ api(custom) function b32 child_process_set_target_buffer(Application_Links* app, api(custom) function Child_Process_ID buffer_get_attached_child_process(Application_Links* app, Buffer_ID buffer_id); api(custom) function Buffer_ID child_process_get_attached_buffer(Application_Links* app, Child_Process_ID child_process_id); api(custom) function Process_State child_process_get_state(Application_Links* app, Child_Process_ID child_process_id); -api(custom) function b32 clipboard_clear(Application_Links* app, i32 clipboard_id); -api(custom) function b32 clipboard_post_internal_only(Application_Links* app, i32 clipboard_id, String_Const_u8 string); -api(custom) function i32 clipboard_count(Application_Links* app, i32 clipboard_id); -api(custom) function String_Const_u8 push_clipboard_index(Application_Links* app, Arena* arena, i32 clipboard_id, i32 item_index); api(custom) function b32 enqueue_virtual_event(Application_Links* app, Input_Event* event); api(custom) function i32 get_buffer_count(Application_Links* app); api(custom) function Buffer_ID get_buffer_next(Application_Links* app, Buffer_ID buffer_id, Access_Flag access); diff --git a/custom/generated/system_api.h b/custom/generated/system_api.h index e7159282..c01eabd1 100644 --- a/custom/generated/system_api.h +++ b/custom/generated/system_api.h @@ -16,8 +16,8 @@ #define system_wake_up_timer_set_sig() void system_wake_up_timer_set(Plat_Handle handle, u32 time_milliseconds) #define system_signal_step_sig() void system_signal_step(u32 code) #define system_sleep_sig() void system_sleep(u64 microseconds) -#define system_get_clipboard_sig() String_Const_u8 system_get_clipboard(Arena* arena) -#define system_post_clipboard_sig() void system_post_clipboard(String_Const_u8 str) +#define system_get_clipboard_sig() String_Const_u8 system_get_clipboard(Arena* arena, i32 index) +#define system_post_clipboard_sig() void system_post_clipboard(String_Const_u8 str, i32 index) #define system_set_clipboard_catch_all_sig() void system_set_clipboard_catch_all(b32 enabled) #define system_get_clipboard_catch_all_sig() b32 system_get_clipboard_catch_all(void) #define system_cli_call_sig() b32 system_cli_call(Arena* scratch, char* path, char* script, CLI_Handles* cli_out) @@ -66,8 +66,8 @@ typedef void system_wake_up_timer_release_type(Plat_Handle handle); typedef void system_wake_up_timer_set_type(Plat_Handle handle, u32 time_milliseconds); typedef void system_signal_step_type(u32 code); typedef void system_sleep_type(u64 microseconds); -typedef String_Const_u8 system_get_clipboard_type(Arena* arena); -typedef void system_post_clipboard_type(String_Const_u8 str); +typedef String_Const_u8 system_get_clipboard_type(Arena* arena, i32 index); +typedef void system_post_clipboard_type(String_Const_u8 str, i32 index); typedef void system_set_clipboard_catch_all_type(b32 enabled); typedef b32 system_get_clipboard_catch_all_type(void); typedef b32 system_cli_call_type(Arena* scratch, char* path, char* script, CLI_Handles* cli_out); @@ -169,8 +169,8 @@ internal void system_wake_up_timer_release(Plat_Handle handle); internal void system_wake_up_timer_set(Plat_Handle handle, u32 time_milliseconds); internal void system_signal_step(u32 code); internal void system_sleep(u64 microseconds); -internal String_Const_u8 system_get_clipboard(Arena* arena); -internal void system_post_clipboard(String_Const_u8 str); +internal String_Const_u8 system_get_clipboard(Arena* arena, i32 index); +internal void system_post_clipboard(String_Const_u8 str, i32 index); internal void system_set_clipboard_catch_all(b32 enabled); internal b32 system_get_clipboard_catch_all(void); internal b32 system_cli_call(Arena* scratch, char* path, char* script, CLI_Handles* cli_out); diff --git a/custom/generated/system_api_constructor.cpp b/custom/generated/system_api_constructor.cpp index 99b42173..9f6c558f 100644 --- a/custom/generated/system_api_constructor.cpp +++ b/custom/generated/system_api_constructor.cpp @@ -90,10 +90,12 @@ api_param(arena, call, "u64", "microseconds"); { API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("get_clipboard"), string_u8_litexpr("String_Const_u8"), string_u8_litexpr("")); api_param(arena, call, "Arena*", "arena"); +api_param(arena, call, "i32", "index"); } { API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("post_clipboard"), string_u8_litexpr("void"), string_u8_litexpr("")); api_param(arena, call, "String_Const_u8", "str"); +api_param(arena, call, "i32", "index"); } { API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("set_clipboard_catch_all"), string_u8_litexpr("void"), string_u8_litexpr("")); diff --git a/custom/generated/system_api_master_list.h b/custom/generated/system_api_master_list.h index c734dc81..997234f4 100644 --- a/custom/generated/system_api_master_list.h +++ b/custom/generated/system_api_master_list.h @@ -16,8 +16,8 @@ api(system) function void wake_up_timer_release(Plat_Handle handle); api(system) function void wake_up_timer_set(Plat_Handle handle, u32 time_milliseconds); api(system) function void signal_step(u32 code); api(system) function void sleep(u64 microseconds); -api(system) function String_Const_u8 get_clipboard(Arena* arena); -api(system) function void post_clipboard(String_Const_u8 str); +api(system) function String_Const_u8 get_clipboard(Arena* arena, i32 index); +api(system) function void post_clipboard(String_Const_u8 str, i32 index); api(system) function void set_clipboard_catch_all(b32 enabled); api(system) function b32 get_clipboard_catch_all(void); api(system) function b32 cli_call(Arena* scratch, char* path, char* script, CLI_Handles* cli_out); diff --git a/platform_win32/win32_4ed.cpp b/platform_win32/win32_4ed.cpp index aa72d6cb..f4e5dd9c 100644 --- a/platform_win32/win32_4ed.cpp +++ b/platform_win32/win32_4ed.cpp @@ -1335,9 +1335,9 @@ win32_gl_create_window(HWND *wnd_out, HGLRC *context_out, DWORD style, RECT rect // NOTE(allen): Load wgl extensions #define LoadWGL(f,l) Stmnt((f) = (f##_Function*)wglGetProcAddress(#f); \ - (l) = (l) && win32_wgl_good((Void_Func*)(f));) - - b32 load_success = true; +(l) = (l) && win32_wgl_good((Void_Func*)(f));) + + b32 load_success = true; LoadWGL(wglCreateContextAttribsARB, load_success); LoadWGL(wglChoosePixelFormatARB, load_success); LoadWGL(wglGetExtensionsStringEXT, load_success); @@ -1882,7 +1882,7 @@ WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdS // NOTE(allen): Frame Clipboard Input if (win32vars.clip_catch_all){ - input.clipboard = system_get_clipboard(scratch); + input.clipboard = system_get_clipboard(scratch, 0); } win32vars.clip_post.size = 0; diff --git a/ship_files/changes.txt b/ship_files/changes.txt index 589939f3..18c6edad 100644 --- a/ship_files/changes.txt +++ b/ship_files/changes.txt @@ -1,5 +1,6 @@ 4.1.4 + + MAJOR: The clipboard history is now a fully custom layer implemented system. Users maintaining a customization layer should try to update their call sites to the old clipboard API. #define FCODER_TRANSITION_TO 4001004 to disable the transitional function wrappers when you are ready to make the transition. + buildsuper scripts now all come with '-win' '-linux' '-mac' postfixes and pass their OS identifier macro on the build line + clipboard is only read when the requests to, or when the collect-all mode is started via the command 'begin_clipboard_collection_mode' + 'clear_clipboard' command