diff --git a/4coder_API/4coder_keycodes.h b/4coder_API/4coder_keycodes.h index 89b8ec8d..9b15fc89 100644 --- a/4coder_API/4coder_keycodes.h +++ b/4coder_API/4coder_keycodes.h @@ -1,41 +1,50 @@ +// 55296 enum{ - key_back = 55296, - key_up = 55297, - key_down = 55298, - key_left = 55299, - key_right = 55300, - key_del = 55301, - key_insert = 55302, - key_home = 55303, - key_end = 55304, - key_page_up = 55305, - key_page_down = 55306, - key_esc = 55307, - key_mouse_left = 55308, - key_mouse_right = 55309, - key_mouse_left_release = 55310, - key_mouse_right_release = 55311, - key_mouse_wheel = 55312, - key_mouse_move = 55313, - key_animate = 55314, - key_click_activate_view = 55315, - key_click_deactivate_view = 55316, - key_f1 = 55317, - key_f2 = 55318, - key_f3 = 55319, - key_f4 = 55320, - key_f5 = 55321, - key_f6 = 55322, - key_f7 = 55323, - key_f8 = 55324, - key_f9 = 55325, - key_f10 = 55326, - key_f11 = 55327, - key_f12 = 55328, - key_f13 = 55329, - key_f14 = 55330, - key_f15 = 55331, - key_f16 = 55332, + key_back = 55296 + 0, + key_up = 55296 + 1, + key_down = 55296 + 2, + key_left = 55296 + 3, + key_right = 55296 + 4, + key_del = 55296 + 5, + key_insert = 55296 + 6, + key_home = 55296 + 7, + key_end = 55296 + 8, + key_page_up = 55296 + 9, + key_page_down = 55296 + 10, + key_esc = 55296 + 11, + key_pause = 55296 + 12, + key_shift = 55296 + 13, + key_ctrl = 55296 + 14, + key_alt = 55296 + 15, + key_cmnd = 55296 + 16, + key_caps = 55296 + 17, + key_num_lock = 55296 + 18, + key_scroll_lock = 55296 + 19, + key_mouse_left = 55296 + 20, + key_mouse_right = 55296 + 21, + key_mouse_left_release = 55296 + 22, + key_mouse_right_release = 55296 + 23, + key_mouse_wheel = 55296 + 24, + key_mouse_move = 55296 + 25, + key_animate = 55296 + 26, + key_click_activate_view = 55296 + 27, + key_click_deactivate_view = 55296 + 28, + key_f1 = 55296 + 29, + key_f2 = 55296 + 30, + key_f3 = 55296 + 31, + key_f4 = 55296 + 32, + key_f5 = 55296 + 33, + key_f6 = 55296 + 34, + key_f7 = 55296 + 35, + key_f8 = 55296 + 36, + key_f9 = 55296 + 37, + key_f10 = 55296 + 38, + key_f11 = 55296 + 39, + key_f12 = 55296 + 40, + key_f13 = 55296 + 41, + key_f14 = 55296 + 42, + key_f15 = 55296 + 43, + key_f16 = 55296 + 44, }; static char* global_key_name(uint32_t key_code, int32_t *size){ @@ -53,6 +62,14 @@ global_key_name(uint32_t key_code, int32_t *size){ case key_page_up: result = "key_page_up"; *size = sizeof("key_page_up")-1; break; case key_page_down: result = "key_page_down"; *size = sizeof("key_page_down")-1; break; case key_esc: result = "key_esc"; *size = sizeof("key_esc")-1; break; + case key_pause: result = "key_pause"; *size = sizeof("key_pause")-1; break; + case key_shift: result = "key_shift"; *size = sizeof("key_shift")-1; break; + case key_ctrl: result = "key_ctrl"; *size = sizeof("key_ctrl")-1; break; + case key_alt: result = "key_alt"; *size = sizeof("key_alt")-1; break; + case key_cmnd: result = "key_cmnd"; *size = sizeof("key_cmnd")-1; break; + case key_caps: result = "key_caps"; *size = sizeof("key_caps")-1; break; + case key_num_lock: result = "key_num_lock"; *size = sizeof("key_num_lock")-1; break; + case key_scroll_lock: result = "key_scroll_lock"; *size = sizeof("key_scroll_lock")-1; break; case key_mouse_left: result = "key_mouse_left"; *size = sizeof("key_mouse_left")-1; break; case key_mouse_right: result = "key_mouse_right"; *size = sizeof("key_mouse_right")-1; break; case key_mouse_left_release: result = "key_mouse_left_release"; *size = sizeof("key_mouse_left_release")-1; break; diff --git a/4coder_api_transition_30_31.cpp b/4coder_api_transition_30_31.cpp new file mode 100644 index 00000000..7fa6a790 --- /dev/null +++ b/4coder_api_transition_30_31.cpp @@ -0,0 +1,579 @@ +/* + * Helpers for the API transition from 4.0.30 to 4.0.31 + * + * In order to keep your layer on the old API you don't have to do anything, this provides wrappers + * idential to the 4.0.30 API. + * In order to transition your entire layer over to the 4.0.31 API define 'REMOVE_TRANSITION_HELPER' and fix errors. + * Or you can do it step by step by removing a few wrappers at a time. + * This transition helper will be removed in a future version so it is recommended to get off sooner or laster. + * + * Tips on transitioning: +* +* Wrather than just try to inline this code everywhere, you can simplify things quite a lot by storing references +* to buffers and views and Buffer_ID and View_ID instead of Buffer_Summary and View_Summary. + * Just get the summaries when you need information in those structures. + * + * You will make your code simpler if you stick to String as much as possible, but whenever you want to you can switch + * to any string type you have to String by calling make_string(char_ptr, length) or make_string_slowly(null_terminated_c_str). + * To pull the char ptr and length out of a String named "string": string.str and str.size. + * If you need a null terminated string from a String use get_null_terminated in 4coder_helper.cpp + * + */ + +// TOP + +#if !defined(REMOVE_TRANSITION_HELPER) + +static bool32 +exec_system_command(Application_Links *app, View_Summary *view, Buffer_Identifier buffer_id, + char *path, int32_t path_len, char *command, int32_t command_len, Command_Line_Interface_Flag flags){ + bool32 result = false; + if (view != 0 && view->exists){ + result = exec_system_command(app, view->view_id, buffer_id, make_string(path, path_len), make_string(command, command_len), flags); + get_view_summary(app, view->view_id, AccessAll, view); + } + return(result); +} + +static bool32 +clipboard_post(Application_Links *app, int32_t clipboard_id, char *str, int32_t len){ + return(clipboard_post(app, clipboard_id, make_string(str, len))); +} + +static int32_t +clipboard_count(Application_Links *app, int32_t clipboard_id){ + int32_t count = 0; + clipboard_count(app, clipboard_id, &count); + return(count); +} + +static int32_t +clipboard_index(Application_Links *app, int32_t clipboard_id, int32_t item_index, char *out, int32_t len){ + int32_t required_size = 0; + String string = make_string_cap(out, 0, len); + clipboard_index(app, clipboard_id, item_index, &string, &required_size); + return(required_size); +} + +static Buffer_Summary +get_buffer_first(Application_Links *app, Access_Flag access){ + Buffer_ID buffer_id = 0; + Buffer_Summary buffer = {}; + if (get_buffer_first(app, access, &buffer_id)){ + get_buffer_summary(app, buffer_id, access, &buffer); + } + return(buffer); +} + +static void +get_buffer_next(Application_Links *app, Buffer_Summary *buffer, Access_Flag access){ + if (buffer != 0 && buffer->exists){ + Buffer_ID buffer_id = 0; + if (get_buffer_next(app, buffer->buffer_id, access, &buffer_id)){ + get_buffer_summary(app, buffer_id, access, buffer); + } + else{ + memset(buffer, 0, sizeof(*buffer)); + } + } +} + +static Buffer_Summary +get_buffer(Application_Links *app, Buffer_ID buffer_id, Access_Flag access){ + Buffer_Summary buffer = {}; + get_buffer_summary(app, buffer_id, access, &buffer); + return(buffer); +} + +static Buffer_Summary +get_buffer_by_name(Application_Links *app, char *name, int32_t len, Access_Flag access){ + Buffer_ID id = 0; + Buffer_Summary buffer = {}; + if (get_buffer_by_name(app, make_string(name, len), access, &id)){ + get_buffer_summary(app, id, access, &buffer); + } + return(buffer); +} + +static Buffer_Summary +get_buffer_by_file_name(Application_Links *app, char *name, int32_t len, Access_Flag access){ + Buffer_ID id = 0; + Buffer_Summary buffer = {}; + if (get_buffer_by_file_name(app, make_string(name, len), access, &id)){ + get_buffer_summary(app, id, access, &buffer); + } + return(buffer); +} + +static bool32 +buffer_read_range(Application_Links *app, Buffer_Summary *buffer, int32_t start, int32_t one_past_last, char *out){ + bool32 result = false; + if (buffer != 0 && buffer->exists){ + result = buffer_read_range(app, buffer->buffer_id, start, one_past_last, out); + get_buffer_summary(app, buffer->buffer_id, AccessAll, buffer); + } + return(result); +} + +static bool32 +buffer_replace_range(Application_Links *app, Buffer_Summary *buffer, int32_t start, int32_t one_past_last, char *str, int32_t len){ + bool32 result = false; + if (buffer != 0 && buffer->exists){ + result = buffer_replace_range(app, buffer->buffer_id, start, one_past_last, make_string(str, len)); + get_buffer_summary(app, buffer->buffer_id, AccessAll, buffer); + } + return(result); +} + +static bool32 +buffer_compute_cursor(Application_Links *app, Buffer_Summary *buffer, Buffer_Seek seek, Partial_Cursor *cursor_out){ + bool32 result = false; + if (buffer != 0 && buffer->exists){ + result = buffer_compute_cursor(app, buffer->buffer_id, seek, cursor_out); + get_buffer_summary(app, buffer->buffer_id, AccessAll, buffer); + } + return(result); +} + +static bool32 +buffer_batch_edit(Application_Links *app, Buffer_Summary *buffer, char *str, int32_t str_len, Buffer_Edit *edits, int32_t edit_count, Buffer_Batch_Edit_Type type){ + bool32 result = false; + if (buffer != 0 && buffer->exists){ + result = buffer_batch_edit(app, buffer->buffer_id, str, str_len, edits, edit_count, type); + get_buffer_summary(app, buffer->buffer_id, AccessAll, buffer); + } + return(result); +} + +static bool32 +buffer_get_setting(Application_Links *app, Buffer_Summary *buffer, Buffer_Setting_ID setting, int32_t *value_out){ + bool32 result = false; + if (buffer != 0 && buffer->exists){ + result = buffer_get_setting(app, buffer->buffer_id, setting, value_out); + get_buffer_summary(app, buffer->buffer_id, AccessAll, buffer); + } + return(result); +} + +static bool32 +buffer_set_setting(Application_Links *app, Buffer_Summary *buffer, Buffer_Setting_ID setting, int32_t value){ + bool32 result = false; + if (buffer != 0 && buffer->exists){ + result = buffer_set_setting(app, buffer->buffer_id, setting, value); + get_buffer_summary(app, buffer->buffer_id, AccessAll, buffer); + } + return(result); +} + +static Managed_Scope +buffer_get_managed_scope(Application_Links *app, Buffer_ID buffer_id){ + Managed_Scope scope = 0; + buffer_get_managed_scope(app, buffer_id, &scope); + return(scope); +} + +static int32_t +buffer_token_count(Application_Links *app, Buffer_Summary *buffer){ + int32_t count = 0; + if (buffer != 0 && buffer->exists){ + buffer_token_count(app, buffer->buffer_id, &count); + } + return(count); +} + +static bool32 +buffer_read_tokens(Application_Links *app, Buffer_Summary *buffer, int32_t start_token, int32_t end_token, Cpp_Token *tokens_out){ + bool32 result = false; + if (buffer != 0 && buffer->exists){ + result = buffer_read_tokens(app, buffer->buffer_id, start_token, end_token, tokens_out); + get_buffer_summary(app, buffer->buffer_id, AccessAll, buffer); + } + return(result); +} + +static bool32 +buffer_get_token_range(Application_Links *app, Buffer_Summary *buffer, Cpp_Token **first_token_out, Cpp_Token **one_past_last_token_out){ + bool32 result = false; + if (buffer != 0 && buffer->exists){ + result = buffer_get_token_range(app, buffer->buffer_id, first_token_out, one_past_last_token_out); + get_buffer_summary(app, buffer->buffer_id, AccessAll, buffer); + } + return(result); +} + +static bool32 +buffer_get_token_index(Application_Links *app, Buffer_Summary *buffer, int32_t pos, Cpp_Get_Token_Result *get_result){ + bool32 result = false; + if (buffer != 0 && buffer->exists){ + result = buffer_get_token_index(app, buffer->buffer_id, pos, get_result); + get_buffer_summary(app, buffer->buffer_id, AccessAll, buffer); + } + return(result); +} + +static bool32 +buffer_send_end_signal(Application_Links *app, Buffer_Summary *buffer){ + bool32 result = false; + if (buffer != 0 && buffer->exists){ + result = buffer_send_end_signal(app, buffer->buffer_id); + get_buffer_summary(app, buffer->buffer_id, AccessAll, buffer); + } + return(result); +} + +static Buffer_Summary +create_buffer(Application_Links *app, char *filename, int32_t filename_len, Buffer_Create_Flag flags){ + Buffer_Summary buffer = {}; + Buffer_ID buffer_id = 0; + if (create_buffer(app, make_string(filename, filename_len), flags, &buffer_id)){ + get_buffer_summary(app, buffer_id, AccessAll, &buffer); + } + return(buffer); +} + +static bool32 +save_buffer(Application_Links *app, Buffer_Summary *buffer, char *file_name, int32_t file_name_len, uint32_t flags){ + bool32 result = false; + if (buffer != 0 && buffer->exists){ + result = buffer_save(app, buffer->buffer_id, make_string(file_name, file_name_len), flags); + get_buffer_summary(app, buffer->buffer_id, AccessAll, buffer); + } + return(result); +} + +static Buffer_Kill_Result +kill_buffer(Application_Links *app, Buffer_Identifier buffer, Buffer_Kill_Flag flags){ + Buffer_Kill_Result result = 0; + if (buffer.id != 0){ + buffer_kill(app, buffer.id, flags, &result); + } + else if (buffer.name != 0){ + Buffer_ID id = 0; + if (get_buffer_by_name(app, make_string(buffer.name, buffer.name_len), AccessAll, &id)){ + buffer_kill(app, id, flags, &result); + } + } + return(result); +} + +static Buffer_Reopen_Result +reopen_buffer(Application_Links *app, Buffer_Summary *buffer, Buffer_Reopen_Flag flags){ + Buffer_Kill_Result result = 0; + if (buffer != 0 && buffer->exists){ + buffer_reopen(app, buffer->buffer_id, flags, &result); + } + return(result); +} + +static View_Summary +get_view_first(Application_Links *app, Access_Flag access){ + View_Summary view = {}; + View_ID view_id = 0; + if (get_view_first(app, access, &view_id)){ + get_view_summary(app, view_id, access, &view); + } + return(view); +} + +static void +get_view_next(Application_Links *app, View_Summary *view, Access_Flag access){ + if (view != 0 && view->exists){ + View_ID view_id = 0; + if (get_view_next(app, view->view_id, access, &view_id)){ + get_view_summary(app, view_id, access, view); + } + else{ + memset(view, 0, sizeof(*view)); + } + } +} + +static View_Summary +get_view(Application_Links *app, View_ID view_id, Access_Flag access){ + View_Summary view = {}; + get_view_summary(app, view_id, access, &view); + return(view); +} + +static View_Summary +get_active_view(Application_Links *app, Access_Flag access){ + View_Summary view = {}; + View_ID id = 0; + if (get_active_view(app, access, &id)){ + get_view_summary(app, id, access, &view); + } + return(view); +} + +static View_Summary +open_view(Application_Links *app, View_Summary *view_location, View_Split_Position position){ + View_Summary view = {}; + if (view_location != 0 && view_location->exists){ + View_ID id = 0; + if (open_view(app, view_location->view_id, position, &id)){ + get_view_summary(app, id, AccessAll, &view); + } + } + return(view); +} + +static bool32 +close_view(Application_Links *app, View_Summary *view){ + bool32 result = false; + if (view != 0 && view->exists){ + result = view_close(app, view->view_id); + } + return(result); +} + +static bool32 +set_active_view(Application_Links *app, View_Summary *view){ + bool32 result = false; + if (view != 0 && view->exists){ + result = view_set_active(app, view->view_id); + } + return(result); +} + +static bool32 +view_get_setting(Application_Links *app, View_Summary *view, View_Setting_ID setting, int32_t *value_out){ + bool32 result = false; + if (view != 0 && view->exists){ + result = view_get_setting(app, view->view_id, setting, value_out); + get_view_summary(app, view->view_id, AccessAll, view); + } + return(result); +} + +static bool32 +view_set_setting(Application_Links *app, View_Summary *view, View_Setting_ID setting, int32_t value){ + bool32 result = false; + if (view != 0 && view->exists){ + result = view_set_setting(app, view->view_id, setting, value); + get_view_summary(app, view->view_id, AccessAll, view); + } + return(result); +} + +static Managed_Scope +view_get_managed_scope(Application_Links *app, View_ID view_id){ + Managed_Scope scope = 0; + view_get_managed_scope(app, view_id, &scope); + return(scope); +} + +static bool32 +view_set_split(Application_Links *app, View_Summary *view, View_Split_Kind kind, float t){ + bool32 result = false; + if (view != 0 && view->exists){ + result = view_set_split(app, view->view_id, kind, t); + get_view_summary(app, view->view_id, AccessAll, view); + } + return(result); +} + +static i32_Rect +view_get_enclosure_rect(Application_Links *app, View_Summary *view){ + i32_Rect result = {}; + if (view != 0 && view->exists){ + view_get_enclosure_rect(app, view->view_id, &result); + get_view_summary(app, view->view_id, AccessAll, view); + } + return(result); +} + +static bool32 +view_compute_cursor(Application_Links *app, View_Summary *view, Buffer_Seek seek, Full_Cursor *cursor_out){ + bool32 result = false; + if (view != 0 && view->exists){ + result = view_compute_cursor(app, view->view_id, seek, cursor_out); + get_view_summary(app, view->view_id, AccessAll, view); + } + return(result); +} + +static bool32 +view_set_cursor(Application_Links *app, View_Summary *view, Buffer_Seek seek, bool32 set_preferred_x){ + bool32 result = false; + if (view != 0 && view->exists){ + result = view_set_cursor(app, view->view_id, seek, set_preferred_x); + get_view_summary(app, view->view_id, AccessAll, view); + } + return(result); +} + +static bool32 +view_set_scroll(Application_Links *app, View_Summary *view, GUI_Scroll_Vars scroll){ + bool32 result = false; + if (view != 0 && view->exists){ + result = view_set_scroll(app, view->view_id, scroll); + get_view_summary(app, view->view_id, AccessAll, view); + } + return(result); +} + +static bool32 +view_set_mark(Application_Links *app, View_Summary *view, Buffer_Seek seek){ + bool32 result = false; + if (view != 0 && view->exists){ + result = view_set_mark(app, view->view_id, seek); + get_view_summary(app, view->view_id, AccessAll, view); + } + return(result); +} + +static bool32 +view_set_buffer(Application_Links *app, View_Summary *view, Buffer_ID buffer_id, Set_Buffer_Flag flags){ + bool32 result = false; + if (view != 0 && view->exists){ + result = view_set_buffer(app, view->view_id, buffer_id, flags); + get_view_summary(app, view->view_id, AccessAll, view); + } + return(result); +} + +static bool32 +view_post_fade(Application_Links *app, View_Summary *view, float seconds, int32_t start, int32_t end, int_color color){ + bool32 result = false; + if (view != 0 && view->exists){ + result = view_post_fade(app, view->view_id, seconds, start, end, color); + get_view_summary(app, view->view_id, AccessAll, view); + } + return(result); +} + +static bool32 +view_begin_ui_mode(Application_Links *app, View_Summary *view){ + bool32 result = false; + if (view != 0 && view->exists){ + result = view_begin_ui_mode(app, view->view_id); + get_view_summary(app, view->view_id, AccessAll, view); + } + return(result); +} + +static bool32 +view_end_ui_mode(Application_Links *app, View_Summary *view){ + bool32 result = false; + if (view != 0 && view->exists){ + result = view_end_ui_mode(app, view->view_id); + get_view_summary(app, view->view_id, AccessAll, view); + } + return(result); +} + +static bool32 +view_set_ui(Application_Links *app, View_Summary *view, UI_Control *control, UI_Quit_Function_Type *quit_function){ + bool32 result = false; + if (view != 0 && view->exists){ + result = view_set_ui(app, view->view_id, control, quit_function); + get_view_summary(app, view->view_id, AccessAll, view); + } + return(result); +} + +static UI_Control +view_get_ui_copy(Application_Links *app, View_Summary *view, struct Partition *part){ + UI_Control result = {}; + if (view != 0 && view->exists){ + view_get_ui_copy(app, view->view_id, part, &result); + get_view_summary(app, view->view_id, AccessAll, view); + } + return(result); +} + +static bool32 +view_set_highlight(Application_Links *app, View_ID view_id, int32_t start, int32_t end, bool32 turn_on){ + // NOTE(allen): this feature is completely removed, transition to using highlighted markers instead + return(false); +} + +static bool32 +buffer_set_face(Application_Links *app, Buffer_Summary *buffer, Face_ID id){ + bool32 result = false; + if (buffer != 0 && buffer->exists){ + result = buffer_set_face(app, buffer->buffer_id, id); + get_buffer_summary(app, buffer->buffer_id, AccessAll, buffer); + } + return(result); +} + +static Face_ID +get_face_id(Application_Links *app, Buffer_Summary *buffer){ + Face_ID result = 0; + if (buffer != 0 && buffer->exists){ + get_face_id(app, buffer->buffer_id, &result); + } + else{ + get_face_id(app, 0, &result); + } + return(result); +} + +static void +print_message(Application_Links *app, char *str, int32_t len){ + print_message(app, make_string(str, len)); +} + +static void +create_theme(Application_Links *app, Theme *theme, char *name, int32_t len){ + create_theme(app, theme, make_string(name, len)); +} + +static void +change_theme(Application_Links *app, char *name, int32_t len){ + change_theme(app, make_string(name, len)); +} + +static int32_t +directory_get_hot(Application_Links *app, char *out, int32_t capacity){ + int32_t required_size = 0; + String string = make_string_cap(out, 0, capacity); + get_hot_directory(app, &string, &required_size); + return(required_size); +} + +static bool32 +directory_set_hot(Application_Links *app, char *str, int32_t len){ + return(set_hot_directory(app, make_string(str, len))); +} + +static File_List +get_file_list(Application_Links *app, char *dir, int32_t len){ + File_List list = {}; + get_file_list(app, make_string(dir, len), &list); + return(list); +} + +static bool32 +file_exists(Application_Links *app, char *file_name, int32_t len){ + return(file_exists(app, make_string(file_name, len))); +} + +static bool32 +directory_cd(Application_Links *app, char *dir, int32_t *len, int32_t capacity, char *rel_path, int32_t rel_len){ + String directory = make_string_cap(dir, *len, capacity); + String relative_path = make_string(rel_path, rel_len); + bool32 result = directory_cd(app, &directory, relative_path); + *len = directory.size; + return(result); +} + +static int32_t +get_4ed_path(Application_Links *app, char *out, int32_t capacity){ + int32_t required_size = 0; + String string = make_string_cap(out, 0, capacity); + get_4ed_path(app, &string, &required_size); + return(required_size); +} + +static void +set_window_title(Application_Links *app, char *title){ + String title_string = make_string_slowly(title); + set_window_title(app, title_string); +} + +#endif + +// BOTTOM + diff --git a/4coder_base_commands.cpp b/4coder_base_commands.cpp index 12175f6f..4de95e9f 100644 --- a/4coder_base_commands.cpp +++ b/4coder_base_commands.cpp @@ -23,7 +23,8 @@ write_character_parameter(Application_Links *app, uint8_t *character, uint32_t l managed_object_store_data(app, handle, 0, 1, &next_cursor_marker); // NOTE(allen): consecutive inserts merge logic - History_Record_Index first_index = buffer_history_get_current_state_index(app, &buffer); + History_Record_Index first_index = 0; + buffer_history_get_current_state_index(app, buffer.buffer_id, &first_index); bool32 do_merge = false; if (character[0] != '\n'){ Record_Info record = get_single_record(app, buffer.buffer_id, first_index); @@ -49,8 +50,9 @@ write_character_parameter(Application_Links *app, uint8_t *character, uint32_t l // NOTE(allen): finish merging records if necessary if (do_merge){ - History_Record_Index last_index = buffer_history_get_current_state_index(app, &buffer); - buffer_history_merge_record_range(app, &buffer, first_index, last_index, RecordMergeFlag_StateInRange_MoveStateForward); + History_Record_Index last_index = 0; + buffer_history_get_current_state_index(app, buffer.buffer_id, &last_index); + buffer_history_merge_record_range(app, buffer.buffer_id, first_index, last_index, RecordMergeFlag_StateInRange_MoveStateForward); } // NOTE(allen): finish updating the cursor @@ -1616,10 +1618,11 @@ CUSTOM_COMMAND_SIG(undo_this_buffer) CUSTOM_DOC("Advances backwards through the undo history of the current buffer.") { View_Summary view = get_active_view(app, AccessOpen); - Buffer_Summary buffer = get_buffer(app, view.buffer_id, AccessOpen); - History_Record_Index current = buffer_history_get_current_state_index(app, &buffer); + Buffer_ID buffer_id = view.buffer_id; + History_Record_Index current = 0; + buffer_history_get_current_state_index(app, buffer_id, ¤t); if (current > 0){ - buffer_history_set_current_state_index(app, &buffer, current - 1); + buffer_history_set_current_state_index(app, buffer_id, current - 1); } } @@ -1627,11 +1630,13 @@ CUSTOM_COMMAND_SIG(redo_this_buffer) CUSTOM_DOC("Advances forwards through the undo history of the current buffer.") { View_Summary view = get_active_view(app, AccessOpen); - Buffer_Summary buffer = get_buffer(app, view.buffer_id, AccessOpen); - History_Record_Index current = buffer_history_get_current_state_index(app, &buffer); - History_Record_Index max_index = buffer_history_get_max_record_index(app, &buffer); + Buffer_ID buffer_id = view.buffer_id; + History_Record_Index current = 0; + History_Record_Index max_index = 0; + buffer_history_get_current_state_index(app, buffer_id, ¤t); + buffer_history_get_max_record_index(app, buffer_id, &max_index); if (current < max_index){ - buffer_history_set_current_state_index(app, &buffer, current + 1); + buffer_history_set_current_state_index(app, buffer_id, current + 1); } } @@ -1647,9 +1652,11 @@ CUSTOM_DOC("Advances backward through the undo history in the buffer containing for (Buffer_Summary buffer = get_buffer_first(app, AccessAll); buffer.exists; get_buffer_next(app, &buffer, AccessAll)){ - History_Record_Index index = buffer_history_get_current_state_index(app, &buffer); + History_Record_Index index = 0; + buffer_history_get_current_state_index(app, buffer.buffer_id, &index); if (index > 0){ - Record_Info record = buffer_history_get_record_info(app, &buffer, index); + Record_Info record = {}; + buffer_history_get_record_info(app, buffer.buffer_id, index, &record); if (record.edit_number > highest_edit_number){ highest_edit_number = record.edit_number; first_buffer_match = buffer.buffer_id; @@ -1673,12 +1680,14 @@ CUSTOM_DOC("Advances backward through the undo history in the buffer containing get_buffer_next(app, &buffer, AccessAll)){ bool32 did_match = false; for (;;){ - History_Record_Index index = buffer_history_get_current_state_index(app, &buffer); + History_Record_Index index = 0; + buffer_history_get_current_state_index(app, buffer.buffer_id, &index); if (index > 0){ - Record_Info record = buffer_history_get_record_info(app, &buffer, index); + Record_Info record = {}; + buffer_history_get_record_info(app, buffer.buffer_id, index, &record); if (record.edit_number == highest_edit_number){ did_match = true; - buffer_history_set_current_state_index(app, &buffer, index - 1); + buffer_history_set_current_state_index(app, buffer.buffer_id, index - 1); } else{ break; @@ -1715,10 +1724,13 @@ CUSTOM_DOC("Advances forward through the undo history in the buffer containing t for (Buffer_Summary buffer = get_buffer_first(app, AccessAll); buffer.exists; get_buffer_next(app, &buffer, AccessAll)){ - History_Record_Index max_index = buffer_history_get_max_record_index(app, &buffer); - History_Record_Index index = buffer_history_get_current_state_index(app, &buffer); + History_Record_Index max_index = 0; + History_Record_Index index = 0; + buffer_history_get_max_record_index(app, buffer.buffer_id, &max_index); + buffer_history_get_current_state_index(app, buffer.buffer_id, &index); if (index < max_index){ - Record_Info record = buffer_history_get_record_info(app, &buffer, index + 1); + Record_Info record = {}; + buffer_history_get_record_info(app, buffer.buffer_id, index + 1, &record); if (record.edit_number < lowest_edit_number){ lowest_edit_number = record.edit_number; first_buffer_match = buffer.buffer_id; @@ -1741,14 +1753,17 @@ CUSTOM_DOC("Advances forward through the undo history in the buffer containing t buffer.exists; get_buffer_next(app, &buffer, AccessAll)){ bool32 did_match = false; - History_Record_Index max_index = buffer_history_get_max_record_index(app, &buffer); + History_Record_Index max_index = 0; + buffer_history_get_max_record_index(app, buffer.buffer_id, &max_index); for (;;){ - History_Record_Index index = buffer_history_get_current_state_index(app, &buffer); + History_Record_Index index = 0; + buffer_history_get_current_state_index(app, buffer.buffer_id, &index); if (index < max_index){ - Record_Info record = buffer_history_get_record_info(app, &buffer, index + 1); + Record_Info record = {}; + buffer_history_get_record_info(app, buffer.buffer_id, index + 1, &record); if (record.edit_number == lowest_edit_number){ did_match = true; - buffer_history_set_current_state_index(app, &buffer, index + 1); + buffer_history_set_current_state_index(app, buffer.buffer_id, index + 1); } else{ break; diff --git a/4coder_default_include.cpp b/4coder_default_include.cpp index b7383b4f..d3b7139f 100644 --- a/4coder_default_include.cpp +++ b/4coder_default_include.cpp @@ -40,6 +40,8 @@ #include "4coder_scope_commands.h" #include "4coder_combined_write_commands.h" +#include "4coder_api_transition_30_31.cpp" + #include "4coder_default_framework_variables.cpp" #include "4coder_buffer_seek_constructors.cpp" #include "4coder_helper.cpp" diff --git a/4coder_generated/app_functions.h b/4coder_generated/app_functions.h index ee556723..eba74871 100644 --- a/4coder_generated/app_functions.h +++ b/4coder_generated/app_functions.h @@ -1,57 +1,56 @@ struct Application_Links; #define GLOBAL_SET_SETTING_SIG(n) bool32 n(Application_Links *app, Global_Setting_ID setting, int32_t value) #define GLOBAL_SET_MAPPING_SIG(n) bool32 n(Application_Links *app, void *data, int32_t size) -#define EXEC_SYSTEM_COMMAND_SIG(n) bool32 n(Application_Links *app, View_Summary *view, Buffer_Identifier buffer_id, char *path, int32_t path_len, char *command, int32_t command_len, Command_Line_Interface_Flag flags) -#define CLIPBOARD_POST_SIG(n) void n(Application_Links *app, int32_t clipboard_id, char *str, int32_t len) -#define CLIPBOARD_COUNT_SIG(n) int32_t n(Application_Links *app, int32_t clipboard_id) -#define CLIPBOARD_INDEX_SIG(n) int32_t n(Application_Links *app, int32_t clipboard_id, int32_t item_index, char *out, int32_t len) +#define EXEC_SYSTEM_COMMAND_SIG(n) bool32 n(Application_Links *app, View_ID view_id, Buffer_Identifier buffer_id, String path, String command, Command_Line_Interface_Flag flags) +#define CLIPBOARD_POST_SIG(n) bool32 n(Application_Links *app, int32_t clipboard_id, String string) +#define CLIPBOARD_COUNT_SIG(n) bool32 n(Application_Links *app, int32_t clipboard_id, int32_t *count_out) +#define CLIPBOARD_INDEX_SIG(n) bool32 n(Application_Links *app, int32_t clipboard_id, int32_t item_index, String *string_out, int32_t *required_size_out) #define CREATE_PARSE_CONTEXT_SIG(n) Parse_Context_ID n(Application_Links *app, Parser_String_And_Type *kw, uint32_t kw_count, Parser_String_And_Type *pp, uint32_t pp_count) #define GET_BUFFER_COUNT_SIG(n) int32_t n(Application_Links *app) -#define GET_BUFFER_FIRST_SIG(n) Buffer_Summary n(Application_Links *app, Access_Flag access) -#define GET_BUFFER_NEXT_SIG(n) void n(Application_Links *app, Buffer_Summary *buffer, Access_Flag access) -#define GET_BUFFER_SIG(n) Buffer_Summary n(Application_Links *app, Buffer_ID buffer_id, Access_Flag access) -#define GET_BUFFER_BY_NAME_SIG(n) Buffer_Summary n(Application_Links *app, char *name, int32_t len, Access_Flag access) -#define GET_BUFFER_BY_FILE_NAME_SIG(n) Buffer_Summary n(Application_Links *app, char *name, int32_t len, Access_Flag access) -#define BUFFER_READ_RANGE_SIG(n) bool32 n(Application_Links *app, Buffer_Summary *buffer, int32_t start, int32_t end, char *out) -#define BUFFER_REPLACE_RANGE_SIG(n) bool32 n(Application_Links *app, Buffer_Summary *buffer, int32_t start, int32_t one_past_last, char *str, int32_t len) +#define GET_BUFFER_FIRST_SIG(n) bool32 n(Application_Links *app, Access_Flag access, Buffer_ID *buffer_id_out) +#define GET_BUFFER_NEXT_SIG(n) bool32 n(Application_Links *app, Buffer_ID buffer_id, Access_Flag access, Buffer_ID *buffer_id_out) +#define GET_BUFFER_SUMMARY_SIG(n) bool32 n(Application_Links *app, Buffer_ID buffer_id, Access_Flag access, Buffer_Summary *buffer_summary_out) +#define GET_BUFFER_BY_NAME_SIG(n) bool32 n(Application_Links *app, String name, Access_Flag access, Buffer_ID *buffer_id_out) +#define GET_BUFFER_BY_FILE_NAME_SIG(n) bool32 n(Application_Links *app, String file_name, Access_Flag access, Buffer_ID *buffer_id_out) +#define BUFFER_READ_RANGE_SIG(n) bool32 n(Application_Links *app, Buffer_ID buffer_id, int32_t start, int32_t one_past_last, char *out) +#define BUFFER_REPLACE_RANGE_SIG(n) bool32 n(Application_Links *app, Buffer_ID buffer_id, int32_t start, int32_t one_past_last, String string) #define BUFFER_SET_EDIT_HANDLER_SIG(n) bool32 n(Application_Links *app, Buffer_ID buffer_id, Buffer_Edit_Handler *handler) -#define BUFFER_COMPUTE_CURSOR_SIG(n) bool32 n(Application_Links *app, Buffer_Summary *buffer, Buffer_Seek seek, Partial_Cursor *cursor_out) -#define BUFFER_BATCH_EDIT_SIG(n) bool32 n(Application_Links *app, Buffer_Summary *buffer, char *str, int32_t str_len, Buffer_Edit *edits, int32_t edit_count, Buffer_Batch_Edit_Type type) -#define BUFFER_GET_SETTING_SIG(n) bool32 n(Application_Links *app, Buffer_Summary *buffer, Buffer_Setting_ID setting, int32_t *value_out) -#define BUFFER_SET_SETTING_SIG(n) bool32 n(Application_Links *app, Buffer_Summary *buffer, Buffer_Setting_ID setting, int32_t value) -#define BUFFER_GET_MANAGED_SCOPE_SIG(n) Managed_Scope n(Application_Links *app, Buffer_ID buffer_id) -#define BUFFER_TOKEN_COUNT_SIG(n) int32_t n(Application_Links *app, Buffer_Summary *buffer) -#define BUFFER_READ_TOKENS_SIG(n) bool32 n(Application_Links *app, Buffer_Summary *buffer, int32_t start_token, int32_t end_token, Cpp_Token *tokens_out) -#define BUFFER_GET_TOKEN_RANGE_SIG(n) bool32 n(Application_Links *app, Buffer_Summary *buffer, Cpp_Token **first_token_out, Cpp_Token **one_past_last_token_out) -#define BUFFER_GET_TOKEN_INDEX_SIG(n) bool32 n(Application_Links *app, Buffer_Summary *buffer, int32_t pos, Cpp_Get_Token_Result *get_result) -#define BUFFER_SEND_END_SIGNAL_SIG(n) bool32 n(Application_Links *app, Buffer_Summary *buffer) -#define CREATE_BUFFER_SIG(n) Buffer_Summary n(Application_Links *app, char *filename, int32_t filename_len, Buffer_Create_Flag flags) -#define SAVE_BUFFER_SIG(n) bool32 n(Application_Links *app, Buffer_Summary *buffer, char *file_name, int32_t file_name_len, uint32_t flags) -#define KILL_BUFFER_SIG(n) Buffer_Kill_Result n(Application_Links *app, Buffer_Identifier buffer, Buffer_Kill_Flag flags) -#define REOPEN_BUFFER_SIG(n) Buffer_Reopen_Result n(Application_Links *app, Buffer_Summary *buffer, Buffer_Reopen_Flag flags) -#define GET_VIEW_FIRST_SIG(n) View_Summary n(Application_Links *app, Access_Flag access) -#define GET_VIEW_NEXT_SIG(n) void n(Application_Links *app, View_Summary *view, Access_Flag access) -#define GET_VIEW_SIG(n) View_Summary n(Application_Links *app, View_ID view_id, Access_Flag access) -#define GET_ACTIVE_VIEW_SIG(n) View_Summary n(Application_Links *app, Access_Flag access) -#define OPEN_VIEW_SIG(n) View_Summary n(Application_Links *app, View_Summary *view_location, View_Split_Position position) -#define CLOSE_VIEW_SIG(n) bool32 n(Application_Links *app, View_Summary *view) -#define SET_ACTIVE_VIEW_SIG(n) bool32 n(Application_Links *app, View_Summary *view) -#define VIEW_GET_SETTING_SIG(n) bool32 n(Application_Links *app, View_Summary *view, View_Setting_ID setting, int32_t *value_out) -#define VIEW_SET_SETTING_SIG(n) bool32 n(Application_Links *app, View_Summary *view, View_Setting_ID setting, int32_t value) -#define VIEW_GET_MANAGED_SCOPE_SIG(n) Managed_Scope n(Application_Links *app, View_ID view_id) -#define VIEW_SET_SPLIT_SIG(n) bool32 n(Application_Links *app, View_Summary *view, View_Split_Kind kind, float t) -#define VIEW_GET_ENCLOSURE_RECT_SIG(n) i32_Rect n(Application_Links *app, View_Summary *view) -#define VIEW_COMPUTE_CURSOR_SIG(n) bool32 n(Application_Links *app, View_Summary *view, Buffer_Seek seek, Full_Cursor *cursor_out) -#define VIEW_SET_CURSOR_SIG(n) bool32 n(Application_Links *app, View_Summary *view, Buffer_Seek seek, bool32 set_preferred_x) -#define VIEW_SET_SCROLL_SIG(n) bool32 n(Application_Links *app, View_Summary *view, GUI_Scroll_Vars scroll) -#define VIEW_SET_MARK_SIG(n) bool32 n(Application_Links *app, View_Summary *view, Buffer_Seek seek) -#define VIEW_SET_HIGHLIGHT_SIG(n) bool32 n(Application_Links *app, View_Summary *view, int32_t start, int32_t end, bool32 turn_on) -#define VIEW_SET_BUFFER_SIG(n) bool32 n(Application_Links *app, View_Summary *view, Buffer_ID buffer_id, Set_Buffer_Flag flags) -#define VIEW_POST_FADE_SIG(n) bool32 n(Application_Links *app, View_Summary *view, float seconds, int32_t start, int32_t end, int_color color) -#define VIEW_BEGIN_UI_MODE_SIG(n) bool32 n(Application_Links *app, View_Summary *view) -#define VIEW_END_UI_MODE_SIG(n) bool32 n(Application_Links *app, View_Summary *view) -#define VIEW_SET_UI_SIG(n) bool32 n(Application_Links *app, View_Summary *view, UI_Control *control, UI_Quit_Function_Type *quit_function) -#define VIEW_GET_UI_COPY_SIG(n) UI_Control n(Application_Links *app, View_Summary *view, struct Partition *part) +#define BUFFER_COMPUTE_CURSOR_SIG(n) bool32 n(Application_Links *app, Buffer_ID buffer_id, Buffer_Seek seek, Partial_Cursor *cursor_out) +#define BUFFER_BATCH_EDIT_SIG(n) bool32 n(Application_Links *app, Buffer_ID buffer_id, char *str, int32_t str_len, Buffer_Edit *edits, int32_t edit_count, Buffer_Batch_Edit_Type type) +#define BUFFER_GET_SETTING_SIG(n) bool32 n(Application_Links *app, Buffer_ID buffer_id, Buffer_Setting_ID setting, int32_t *value_out) +#define BUFFER_SET_SETTING_SIG(n) bool32 n(Application_Links *app, Buffer_ID buffer_id, Buffer_Setting_ID setting, int32_t value) +#define BUFFER_GET_MANAGED_SCOPE_SIG(n) bool32 n(Application_Links *app, Buffer_ID buffer_id, Managed_Scope *scope_out) +#define BUFFER_TOKEN_COUNT_SIG(n) bool32 n(Application_Links *app, Buffer_ID buffer_id, int32_t *count_out) +#define BUFFER_READ_TOKENS_SIG(n) bool32 n(Application_Links *app, Buffer_ID buffer_id, int32_t start_token, int32_t end_token, Cpp_Token *tokens_out) +#define BUFFER_GET_TOKEN_RANGE_SIG(n) bool32 n(Application_Links *app, Buffer_ID buffer_id, Cpp_Token **first_token_out, Cpp_Token **one_past_last_token_out) +#define BUFFER_GET_TOKEN_INDEX_SIG(n) bool32 n(Application_Links *app, Buffer_ID buffer_id, int32_t pos, Cpp_Get_Token_Result *get_result) +#define BUFFER_SEND_END_SIGNAL_SIG(n) bool32 n(Application_Links *app, Buffer_ID buffer_id) +#define CREATE_BUFFER_SIG(n) bool32 n(Application_Links *app, String file_name, Buffer_Create_Flag flags, Buffer_ID *new_buffer_id_out) +#define BUFFER_SAVE_SIG(n) bool32 n(Application_Links *app, Buffer_ID buffer_id, String file_name, uint32_t flags) +#define BUFFER_KILL_SIG(n) bool32 n(Application_Links *app, Buffer_ID buffer_id, Buffer_Kill_Flag flags, Buffer_Kill_Result *result) +#define BUFFER_REOPEN_SIG(n) bool32 n(Application_Links *app, Buffer_ID buffer_id, Buffer_Reopen_Flag flags, Buffer_Reopen_Result *result) +#define GET_VIEW_FIRST_SIG(n) bool32 n(Application_Links *app, Access_Flag access, View_ID *view_id_out) +#define GET_VIEW_NEXT_SIG(n) bool32 n(Application_Links *app, View_ID view_id, Access_Flag access, View_ID *view_id_out) +#define GET_VIEW_SUMMARY_SIG(n) bool32 n(Application_Links *app, View_ID view_id, Access_Flag access, View_Summary *view_summary_out) +#define GET_ACTIVE_VIEW_SIG(n) bool32 n(Application_Links *app, Access_Flag access, View_ID *view_id_out) +#define OPEN_VIEW_SIG(n) bool32 n(Application_Links *app, View_ID location, View_Split_Position position, View_ID *view_id_out) +#define VIEW_CLOSE_SIG(n) bool32 n(Application_Links *app, View_ID view_id) +#define VIEW_SET_ACTIVE_SIG(n) bool32 n(Application_Links *app, View_ID view_id) +#define VIEW_GET_SETTING_SIG(n) bool32 n(Application_Links *app, View_ID view_id, View_Setting_ID setting, int32_t *value_out) +#define VIEW_SET_SETTING_SIG(n) bool32 n(Application_Links *app, View_ID view_id, View_Setting_ID setting, int32_t value) +#define VIEW_GET_MANAGED_SCOPE_SIG(n) bool32 n(Application_Links *app, View_ID view_id, Managed_Scope *scope) +#define VIEW_SET_SPLIT_SIG(n) bool32 n(Application_Links *app, View_ID view_id, View_Split_Kind kind, float t) +#define VIEW_GET_ENCLOSURE_RECT_SIG(n) bool32 n(Application_Links *app, View_ID view_id, i32_Rect *rect_out) +#define VIEW_COMPUTE_CURSOR_SIG(n) bool32 n(Application_Links *app, View_ID view_id, Buffer_Seek seek, Full_Cursor *cursor_out) +#define VIEW_SET_CURSOR_SIG(n) bool32 n(Application_Links *app, View_ID view_id, Buffer_Seek seek, bool32 set_preferred_x) +#define VIEW_SET_SCROLL_SIG(n) bool32 n(Application_Links *app, View_ID view_id, GUI_Scroll_Vars scroll) +#define VIEW_SET_MARK_SIG(n) bool32 n(Application_Links *app, View_ID view_id, Buffer_Seek seek) +#define VIEW_SET_BUFFER_SIG(n) bool32 n(Application_Links *app, View_ID view_id, Buffer_ID buffer_id, Set_Buffer_Flag flags) +#define VIEW_POST_FADE_SIG(n) bool32 n(Application_Links *app, View_ID view_id, float seconds, int32_t start, int32_t end, int_color color) +#define VIEW_BEGIN_UI_MODE_SIG(n) bool32 n(Application_Links *app, View_ID view_id) +#define VIEW_END_UI_MODE_SIG(n) bool32 n(Application_Links *app, View_ID view_id) +#define VIEW_SET_UI_SIG(n) bool32 n(Application_Links *app, View_ID view_id, UI_Control *control, UI_Quit_Function_Type *quit_function) +#define VIEW_GET_UI_COPY_SIG(n) bool32 n(Application_Links *app, View_ID view_id, struct Partition *part, UI_Control *ui_control_out) #define CREATE_USER_MANAGED_SCOPE_SIG(n) Managed_Scope n(Application_Links *app) #define DESTROY_USER_MANAGED_SCOPE_SIG(n) bool32 n(Application_Links *app, Managed_Scope scope) #define GET_GLOBAL_MANAGED_SCOPE_SIG(n) Managed_Scope n(Application_Links *app) @@ -87,26 +86,26 @@ struct Application_Links; #define GET_ACTIVE_QUERY_BARS_SIG(n) int32_t n(Application_Links *app, View_ID view_id, int32_t max_result_count, Query_Bar **result_array) #define START_QUERY_BAR_SIG(n) bool32 n(Application_Links *app, Query_Bar *bar, uint32_t flags) #define END_QUERY_BAR_SIG(n) void n(Application_Links *app, Query_Bar *bar, uint32_t flags) -#define PRINT_MESSAGE_SIG(n) void n(Application_Links *app, char *str, int32_t len) +#define PRINT_MESSAGE_SIG(n) bool32 n(Application_Links *app, String message) #define GET_THEME_COUNT_SIG(n) int32_t n(Application_Links *app) #define GET_THEME_NAME_SIG(n) String n(Application_Links *app, struct Partition *arena, int32_t index) -#define CREATE_THEME_SIG(n) void n(Application_Links *app, Theme *theme, char *name, int32_t len) -#define CHANGE_THEME_SIG(n) void n(Application_Links *app, char *name, int32_t len) +#define CREATE_THEME_SIG(n) bool32 n(Application_Links *app, Theme *theme, String theme_name) +#define CHANGE_THEME_SIG(n) bool32 n(Application_Links *app, String theme_name) #define CHANGE_THEME_BY_INDEX_SIG(n) bool32 n(Application_Links *app, int32_t index) #define GET_LARGEST_FACE_ID_SIG(n) Face_ID n(Application_Links *app) #define SET_GLOBAL_FACE_SIG(n) bool32 n(Application_Links *app, Face_ID id, bool32 apply_to_all_buffers) -#define BUFFER_SET_FACE_SIG(n) bool32 n(Application_Links *app, Buffer_Summary *buffer, Face_ID id) -#define BUFFER_HISTORY_GET_MAX_RECORD_INDEX_SIG(n) History_Record_Index n(Application_Links *app, Buffer_Summary *buffer) -#define BUFFER_HISTORY_GET_RECORD_INFO_SIG(n) Record_Info n(Application_Links *app, Buffer_Summary *buffer, History_Record_Index index) -#define BUFFER_HISTORY_GET_GROUP_SUB_RECORD_SIG(n) Record_Info n(Application_Links *app, Buffer_Summary *buffer, History_Record_Index index, int32_t sub_index) -#define BUFFER_HISTORY_GET_CURRENT_STATE_INDEX_SIG(n) History_Record_Index n(Application_Links *app, Buffer_Summary *buffer) -#define BUFFER_HISTORY_SET_CURRENT_STATE_INDEX_SIG(n) bool32 n(Application_Links *app, Buffer_Summary *buffer, History_Record_Index index) -#define BUFFER_HISTORY_MERGE_RECORD_RANGE_SIG(n) bool32 n(Application_Links *app, Buffer_Summary *buffer, History_Record_Index first_index, History_Record_Index last_index, Record_Merge_Flag flags) -#define BUFFER_HISTORY_CLEAR_AFTER_CURRENT_STATE_SIG(n) bool32 n(Application_Links *app, Buffer_Summary *buffer) +#define BUFFER_HISTORY_GET_MAX_RECORD_INDEX_SIG(n) bool32 n(Application_Links *app, Buffer_ID buffer_id, History_Record_Index *index_out) +#define BUFFER_HISTORY_GET_RECORD_INFO_SIG(n) bool32 n(Application_Links *app, Buffer_ID buffer_id, History_Record_Index index, Record_Info *record_out) +#define BUFFER_HISTORY_GET_GROUP_SUB_RECORD_SIG(n) bool32 n(Application_Links *app, Buffer_ID buffer_id, History_Record_Index index, int32_t sub_index, Record_Info *record_out) +#define BUFFER_HISTORY_GET_CURRENT_STATE_INDEX_SIG(n) bool32 n(Application_Links *app, Buffer_ID buffer_id, History_Record_Index *index_out) +#define BUFFER_HISTORY_SET_CURRENT_STATE_INDEX_SIG(n) bool32 n(Application_Links *app, Buffer_ID buffer_id, History_Record_Index index) +#define BUFFER_HISTORY_MERGE_RECORD_RANGE_SIG(n) bool32 n(Application_Links *app, Buffer_ID buffer_id, History_Record_Index first_index, History_Record_Index last_index, Record_Merge_Flag flags) +#define BUFFER_HISTORY_CLEAR_AFTER_CURRENT_STATE_SIG(n) bool32 n(Application_Links *app, Buffer_ID buffer_id) #define GLOBAL_HISTORY_EDIT_GROUP_BEGIN_SIG(n) void n(Application_Links *app) #define GLOBAL_HISTORY_EDIT_GROUP_END_SIG(n) void n(Application_Links *app) +#define BUFFER_SET_FACE_SIG(n) bool32 n(Application_Links *app, Buffer_ID buffer_id, Face_ID id) #define GET_FACE_DESCRIPTION_SIG(n) Face_Description n(Application_Links *app, Face_ID id) -#define GET_FACE_ID_SIG(n) Face_ID n(Application_Links *app, Buffer_Summary *buffer) +#define GET_FACE_ID_SIG(n) bool32 n(Application_Links *app, Buffer_ID buffer_id, Face_ID *face_id_out) #define TRY_CREATE_NEW_FACE_SIG(n) Face_ID n(Application_Links *app, Face_Description *description) #define TRY_MODIFY_FACE_SIG(n) bool32 n(Application_Links *app, Face_ID id, Face_Description *description) #define TRY_RELEASE_FACE_SIG(n) bool32 n(Application_Links *app, Face_ID id, Face_ID replacement_id) @@ -114,22 +113,22 @@ struct Application_Links; #define GET_AVAILABLE_FONT_SIG(n) Available_Font n(Application_Links *app, int32_t index) #define SET_THEME_COLORS_SIG(n) void n(Application_Links *app, Theme_Color *colors, int32_t count) #define GET_THEME_COLORS_SIG(n) void n(Application_Links *app, Theme_Color *colors, int32_t count) -#define DIRECTORY_GET_HOT_SIG(n) int32_t n(Application_Links *app, char *out, int32_t capacity) -#define DIRECTORY_SET_HOT_SIG(n) bool32 n(Application_Links *app, char *str, int32_t len) -#define GET_FILE_LIST_SIG(n) File_List n(Application_Links *app, char *dir, int32_t len) +#define GET_HOT_DIRECTORY_SIG(n) int32_t n(Application_Links *app, String *out, int32_t *required_size_out) +#define SET_HOT_DIRECTORY_SIG(n) bool32 n(Application_Links *app, String string) +#define GET_FILE_LIST_SIG(n) bool32 n(Application_Links *app, String directory, File_List *list_out) #define FREE_FILE_LIST_SIG(n) void n(Application_Links *app, File_List list) #define SET_GUI_UP_DOWN_KEYS_SIG(n) void n(Application_Links *app, Key_Code up_key, Key_Modifier up_key_modifier, Key_Code down_key, Key_Modifier down_key_modifier) #define MEMORY_ALLOCATE_SIG(n) void* n(Application_Links *app, int32_t size) #define MEMORY_SET_PROTECTION_SIG(n) bool32 n(Application_Links *app, void *ptr, int32_t size, Memory_Protect_Flags flags) #define MEMORY_FREE_SIG(n) void n(Application_Links *app, void *ptr, int32_t size) -#define FILE_EXISTS_SIG(n) bool32 n(Application_Links *app, char *filename, int32_t len) -#define DIRECTORY_CD_SIG(n) bool32 n(Application_Links *app, char *dir, int32_t *len, int32_t capacity, char *rel_path, int32_t rel_len) -#define GET_4ED_PATH_SIG(n) int32_t n(Application_Links *app, char *out, int32_t capacity) +#define FILE_EXISTS_SIG(n) bool32 n(Application_Links *app, String file_name) +#define DIRECTORY_CD_SIG(n) bool32 n(Application_Links *app, String *directory, String relative_path) +#define GET_4ED_PATH_SIG(n) bool32 n(Application_Links *app, String *path_out, int32_t *required_size_out) #define SHOW_MOUSE_CURSOR_SIG(n) void n(Application_Links *app, Mouse_Cursor_Show_Type show) #define SET_FULLSCREEN_SIG(n) bool32 n(Application_Links *app, bool32 full_screen) #define IS_FULLSCREEN_SIG(n) bool32 n(Application_Links *app) #define SEND_EXIT_SIGNAL_SIG(n) void n(Application_Links *app) -#define SET_WINDOW_TITLE_SIG(n) void n(Application_Links *app, char *title) +#define SET_WINDOW_TITLE_SIG(n) bool32 n(Application_Links *app, String title) #define GET_MICROSECONDS_TIMESTAMP_SIG(n) Microsecond_Time_Stamp n(Application_Links *app) #define DRAW_STRING_SIG(n) float n(Application_Links *app, Face_ID font_id, String str, int32_t x, int32_t y, int_color color, uint32_t flags, float dx, float dy) #define GET_STRING_ADVANCE_SIG(n) float n(Application_Links *app, Face_ID font_id, String str) @@ -146,7 +145,7 @@ typedef CREATE_PARSE_CONTEXT_SIG(Create_Parse_Context_Function); typedef GET_BUFFER_COUNT_SIG(Get_Buffer_Count_Function); typedef GET_BUFFER_FIRST_SIG(Get_Buffer_First_Function); typedef GET_BUFFER_NEXT_SIG(Get_Buffer_Next_Function); -typedef GET_BUFFER_SIG(Get_Buffer_Function); +typedef GET_BUFFER_SUMMARY_SIG(Get_Buffer_Summary_Function); typedef GET_BUFFER_BY_NAME_SIG(Get_Buffer_By_Name_Function); typedef GET_BUFFER_BY_FILE_NAME_SIG(Get_Buffer_By_File_Name_Function); typedef BUFFER_READ_RANGE_SIG(Buffer_Read_Range_Function); @@ -163,16 +162,16 @@ typedef BUFFER_GET_TOKEN_RANGE_SIG(Buffer_Get_Token_Range_Function); typedef BUFFER_GET_TOKEN_INDEX_SIG(Buffer_Get_Token_Index_Function); typedef BUFFER_SEND_END_SIGNAL_SIG(Buffer_Send_End_Signal_Function); typedef CREATE_BUFFER_SIG(Create_Buffer_Function); -typedef SAVE_BUFFER_SIG(Save_Buffer_Function); -typedef KILL_BUFFER_SIG(Kill_Buffer_Function); -typedef REOPEN_BUFFER_SIG(Reopen_Buffer_Function); +typedef BUFFER_SAVE_SIG(Buffer_Save_Function); +typedef BUFFER_KILL_SIG(Buffer_Kill_Function); +typedef BUFFER_REOPEN_SIG(Buffer_Reopen_Function); typedef GET_VIEW_FIRST_SIG(Get_View_First_Function); typedef GET_VIEW_NEXT_SIG(Get_View_Next_Function); -typedef GET_VIEW_SIG(Get_View_Function); +typedef GET_VIEW_SUMMARY_SIG(Get_View_Summary_Function); typedef GET_ACTIVE_VIEW_SIG(Get_Active_View_Function); typedef OPEN_VIEW_SIG(Open_View_Function); -typedef CLOSE_VIEW_SIG(Close_View_Function); -typedef SET_ACTIVE_VIEW_SIG(Set_Active_View_Function); +typedef VIEW_CLOSE_SIG(View_Close_Function); +typedef VIEW_SET_ACTIVE_SIG(View_Set_Active_Function); typedef VIEW_GET_SETTING_SIG(View_Get_Setting_Function); typedef VIEW_SET_SETTING_SIG(View_Set_Setting_Function); typedef VIEW_GET_MANAGED_SCOPE_SIG(View_Get_Managed_Scope_Function); @@ -182,7 +181,6 @@ typedef VIEW_COMPUTE_CURSOR_SIG(View_Compute_Cursor_Function); typedef VIEW_SET_CURSOR_SIG(View_Set_Cursor_Function); typedef VIEW_SET_SCROLL_SIG(View_Set_Scroll_Function); typedef VIEW_SET_MARK_SIG(View_Set_Mark_Function); -typedef VIEW_SET_HIGHLIGHT_SIG(View_Set_Highlight_Function); typedef VIEW_SET_BUFFER_SIG(View_Set_Buffer_Function); typedef VIEW_POST_FADE_SIG(View_Post_Fade_Function); typedef VIEW_BEGIN_UI_MODE_SIG(View_Begin_UI_Mode_Function); @@ -232,7 +230,6 @@ typedef CHANGE_THEME_SIG(Change_Theme_Function); typedef CHANGE_THEME_BY_INDEX_SIG(Change_Theme_By_Index_Function); typedef GET_LARGEST_FACE_ID_SIG(Get_Largest_Face_ID_Function); typedef SET_GLOBAL_FACE_SIG(Set_Global_Face_Function); -typedef BUFFER_SET_FACE_SIG(Buffer_Set_Face_Function); typedef BUFFER_HISTORY_GET_MAX_RECORD_INDEX_SIG(Buffer_History_Get_Max_Record_Index_Function); typedef BUFFER_HISTORY_GET_RECORD_INFO_SIG(Buffer_History_Get_Record_Info_Function); typedef BUFFER_HISTORY_GET_GROUP_SUB_RECORD_SIG(Buffer_History_Get_Group_Sub_Record_Function); @@ -242,6 +239,7 @@ typedef BUFFER_HISTORY_MERGE_RECORD_RANGE_SIG(Buffer_History_Merge_Record_Range_ typedef BUFFER_HISTORY_CLEAR_AFTER_CURRENT_STATE_SIG(Buffer_History_Clear_After_Current_State_Function); typedef GLOBAL_HISTORY_EDIT_GROUP_BEGIN_SIG(Global_History_Edit_Group_Begin_Function); typedef GLOBAL_HISTORY_EDIT_GROUP_END_SIG(Global_History_Edit_Group_End_Function); +typedef BUFFER_SET_FACE_SIG(Buffer_Set_Face_Function); typedef GET_FACE_DESCRIPTION_SIG(Get_Face_Description_Function); typedef GET_FACE_ID_SIG(Get_Face_ID_Function); typedef TRY_CREATE_NEW_FACE_SIG(Try_Create_New_Face_Function); @@ -251,8 +249,8 @@ typedef GET_AVAILABLE_FONT_COUNT_SIG(Get_Available_Font_Count_Function); typedef GET_AVAILABLE_FONT_SIG(Get_Available_Font_Function); typedef SET_THEME_COLORS_SIG(Set_Theme_Colors_Function); typedef GET_THEME_COLORS_SIG(Get_Theme_Colors_Function); -typedef DIRECTORY_GET_HOT_SIG(Directory_Get_Hot_Function); -typedef DIRECTORY_SET_HOT_SIG(Directory_Set_Hot_Function); +typedef GET_HOT_DIRECTORY_SIG(Get_Hot_Directory_Function); +typedef SET_HOT_DIRECTORY_SIG(Set_Hot_Directory_Function); typedef GET_FILE_LIST_SIG(Get_File_List_Function); typedef FREE_FILE_LIST_SIG(Free_File_List_Function); typedef SET_GUI_UP_DOWN_KEYS_SIG(Set_GUI_Up_Down_Keys_Function); @@ -285,7 +283,7 @@ Create_Parse_Context_Function *create_parse_context; Get_Buffer_Count_Function *get_buffer_count; Get_Buffer_First_Function *get_buffer_first; Get_Buffer_Next_Function *get_buffer_next; -Get_Buffer_Function *get_buffer; +Get_Buffer_Summary_Function *get_buffer_summary; Get_Buffer_By_Name_Function *get_buffer_by_name; Get_Buffer_By_File_Name_Function *get_buffer_by_file_name; Buffer_Read_Range_Function *buffer_read_range; @@ -302,16 +300,16 @@ Buffer_Get_Token_Range_Function *buffer_get_token_range; Buffer_Get_Token_Index_Function *buffer_get_token_index; Buffer_Send_End_Signal_Function *buffer_send_end_signal; Create_Buffer_Function *create_buffer; -Save_Buffer_Function *save_buffer; -Kill_Buffer_Function *kill_buffer; -Reopen_Buffer_Function *reopen_buffer; +Buffer_Save_Function *buffer_save; +Buffer_Kill_Function *buffer_kill; +Buffer_Reopen_Function *buffer_reopen; Get_View_First_Function *get_view_first; Get_View_Next_Function *get_view_next; -Get_View_Function *get_view; +Get_View_Summary_Function *get_view_summary; Get_Active_View_Function *get_active_view; Open_View_Function *open_view; -Close_View_Function *close_view; -Set_Active_View_Function *set_active_view; +View_Close_Function *view_close; +View_Set_Active_Function *view_set_active; View_Get_Setting_Function *view_get_setting; View_Set_Setting_Function *view_set_setting; View_Get_Managed_Scope_Function *view_get_managed_scope; @@ -321,7 +319,6 @@ View_Compute_Cursor_Function *view_compute_cursor; View_Set_Cursor_Function *view_set_cursor; View_Set_Scroll_Function *view_set_scroll; View_Set_Mark_Function *view_set_mark; -View_Set_Highlight_Function *view_set_highlight; View_Set_Buffer_Function *view_set_buffer; View_Post_Fade_Function *view_post_fade; View_Begin_UI_Mode_Function *view_begin_ui_mode; @@ -371,7 +368,6 @@ Change_Theme_Function *change_theme; Change_Theme_By_Index_Function *change_theme_by_index; Get_Largest_Face_ID_Function *get_largest_face_id; Set_Global_Face_Function *set_global_face; -Buffer_Set_Face_Function *buffer_set_face; Buffer_History_Get_Max_Record_Index_Function *buffer_history_get_max_record_index; Buffer_History_Get_Record_Info_Function *buffer_history_get_record_info; Buffer_History_Get_Group_Sub_Record_Function *buffer_history_get_group_sub_record; @@ -381,6 +377,7 @@ Buffer_History_Merge_Record_Range_Function *buffer_history_merge_record_range; Buffer_History_Clear_After_Current_State_Function *buffer_history_clear_after_current_state; Global_History_Edit_Group_Begin_Function *global_history_edit_group_begin; Global_History_Edit_Group_End_Function *global_history_edit_group_end; +Buffer_Set_Face_Function *buffer_set_face; Get_Face_Description_Function *get_face_description; Get_Face_ID_Function *get_face_id; Try_Create_New_Face_Function *try_create_new_face; @@ -390,8 +387,8 @@ Get_Available_Font_Count_Function *get_available_font_count; Get_Available_Font_Function *get_available_font; Set_Theme_Colors_Function *set_theme_colors; Get_Theme_Colors_Function *get_theme_colors; -Directory_Get_Hot_Function *directory_get_hot; -Directory_Set_Hot_Function *directory_set_hot; +Get_Hot_Directory_Function *get_hot_directory; +Set_Hot_Directory_Function *set_hot_directory; Get_File_List_Function *get_file_list; Free_File_List_Function *free_file_list; Set_GUI_Up_Down_Keys_Function *set_gui_up_down_keys; @@ -423,7 +420,7 @@ Create_Parse_Context_Function *create_parse_context_; Get_Buffer_Count_Function *get_buffer_count_; Get_Buffer_First_Function *get_buffer_first_; Get_Buffer_Next_Function *get_buffer_next_; -Get_Buffer_Function *get_buffer_; +Get_Buffer_Summary_Function *get_buffer_summary_; Get_Buffer_By_Name_Function *get_buffer_by_name_; Get_Buffer_By_File_Name_Function *get_buffer_by_file_name_; Buffer_Read_Range_Function *buffer_read_range_; @@ -440,16 +437,16 @@ Buffer_Get_Token_Range_Function *buffer_get_token_range_; Buffer_Get_Token_Index_Function *buffer_get_token_index_; Buffer_Send_End_Signal_Function *buffer_send_end_signal_; Create_Buffer_Function *create_buffer_; -Save_Buffer_Function *save_buffer_; -Kill_Buffer_Function *kill_buffer_; -Reopen_Buffer_Function *reopen_buffer_; +Buffer_Save_Function *buffer_save_; +Buffer_Kill_Function *buffer_kill_; +Buffer_Reopen_Function *buffer_reopen_; Get_View_First_Function *get_view_first_; Get_View_Next_Function *get_view_next_; -Get_View_Function *get_view_; +Get_View_Summary_Function *get_view_summary_; Get_Active_View_Function *get_active_view_; Open_View_Function *open_view_; -Close_View_Function *close_view_; -Set_Active_View_Function *set_active_view_; +View_Close_Function *view_close_; +View_Set_Active_Function *view_set_active_; View_Get_Setting_Function *view_get_setting_; View_Set_Setting_Function *view_set_setting_; View_Get_Managed_Scope_Function *view_get_managed_scope_; @@ -459,7 +456,6 @@ View_Compute_Cursor_Function *view_compute_cursor_; View_Set_Cursor_Function *view_set_cursor_; View_Set_Scroll_Function *view_set_scroll_; View_Set_Mark_Function *view_set_mark_; -View_Set_Highlight_Function *view_set_highlight_; View_Set_Buffer_Function *view_set_buffer_; View_Post_Fade_Function *view_post_fade_; View_Begin_UI_Mode_Function *view_begin_ui_mode_; @@ -509,7 +505,6 @@ Change_Theme_Function *change_theme_; Change_Theme_By_Index_Function *change_theme_by_index_; Get_Largest_Face_ID_Function *get_largest_face_id_; Set_Global_Face_Function *set_global_face_; -Buffer_Set_Face_Function *buffer_set_face_; Buffer_History_Get_Max_Record_Index_Function *buffer_history_get_max_record_index_; Buffer_History_Get_Record_Info_Function *buffer_history_get_record_info_; Buffer_History_Get_Group_Sub_Record_Function *buffer_history_get_group_sub_record_; @@ -519,6 +514,7 @@ Buffer_History_Merge_Record_Range_Function *buffer_history_merge_record_range_; Buffer_History_Clear_After_Current_State_Function *buffer_history_clear_after_current_state_; Global_History_Edit_Group_Begin_Function *global_history_edit_group_begin_; Global_History_Edit_Group_End_Function *global_history_edit_group_end_; +Buffer_Set_Face_Function *buffer_set_face_; Get_Face_Description_Function *get_face_description_; Get_Face_ID_Function *get_face_id_; Try_Create_New_Face_Function *try_create_new_face_; @@ -528,8 +524,8 @@ Get_Available_Font_Count_Function *get_available_font_count_; Get_Available_Font_Function *get_available_font_; Set_Theme_Colors_Function *set_theme_colors_; Get_Theme_Colors_Function *get_theme_colors_; -Directory_Get_Hot_Function *directory_get_hot_; -Directory_Set_Hot_Function *directory_set_hot_; +Get_Hot_Directory_Function *get_hot_directory_; +Set_Hot_Directory_Function *set_hot_directory_; Get_File_List_Function *get_file_list_; Free_File_List_Function *free_file_list_; Set_GUI_Up_Down_Keys_Function *set_gui_up_down_keys_; @@ -569,7 +565,7 @@ app_links->create_parse_context_ = Create_Parse_Context;\ app_links->get_buffer_count_ = Get_Buffer_Count;\ app_links->get_buffer_first_ = Get_Buffer_First;\ app_links->get_buffer_next_ = Get_Buffer_Next;\ -app_links->get_buffer_ = Get_Buffer;\ +app_links->get_buffer_summary_ = Get_Buffer_Summary;\ app_links->get_buffer_by_name_ = Get_Buffer_By_Name;\ app_links->get_buffer_by_file_name_ = Get_Buffer_By_File_Name;\ app_links->buffer_read_range_ = Buffer_Read_Range;\ @@ -586,16 +582,16 @@ app_links->buffer_get_token_range_ = Buffer_Get_Token_Range;\ app_links->buffer_get_token_index_ = Buffer_Get_Token_Index;\ app_links->buffer_send_end_signal_ = Buffer_Send_End_Signal;\ app_links->create_buffer_ = Create_Buffer;\ -app_links->save_buffer_ = Save_Buffer;\ -app_links->kill_buffer_ = Kill_Buffer;\ -app_links->reopen_buffer_ = Reopen_Buffer;\ +app_links->buffer_save_ = Buffer_Save;\ +app_links->buffer_kill_ = Buffer_Kill;\ +app_links->buffer_reopen_ = Buffer_Reopen;\ app_links->get_view_first_ = Get_View_First;\ app_links->get_view_next_ = Get_View_Next;\ -app_links->get_view_ = Get_View;\ +app_links->get_view_summary_ = Get_View_Summary;\ app_links->get_active_view_ = Get_Active_View;\ app_links->open_view_ = Open_View;\ -app_links->close_view_ = Close_View;\ -app_links->set_active_view_ = Set_Active_View;\ +app_links->view_close_ = View_Close;\ +app_links->view_set_active_ = View_Set_Active;\ app_links->view_get_setting_ = View_Get_Setting;\ app_links->view_set_setting_ = View_Set_Setting;\ app_links->view_get_managed_scope_ = View_Get_Managed_Scope;\ @@ -605,7 +601,6 @@ app_links->view_compute_cursor_ = View_Compute_Cursor;\ app_links->view_set_cursor_ = View_Set_Cursor;\ app_links->view_set_scroll_ = View_Set_Scroll;\ app_links->view_set_mark_ = View_Set_Mark;\ -app_links->view_set_highlight_ = View_Set_Highlight;\ app_links->view_set_buffer_ = View_Set_Buffer;\ app_links->view_post_fade_ = View_Post_Fade;\ app_links->view_begin_ui_mode_ = View_Begin_UI_Mode;\ @@ -655,7 +650,6 @@ app_links->change_theme_ = Change_Theme;\ app_links->change_theme_by_index_ = Change_Theme_By_Index;\ app_links->get_largest_face_id_ = Get_Largest_Face_ID;\ app_links->set_global_face_ = Set_Global_Face;\ -app_links->buffer_set_face_ = Buffer_Set_Face;\ app_links->buffer_history_get_max_record_index_ = Buffer_History_Get_Max_Record_Index;\ app_links->buffer_history_get_record_info_ = Buffer_History_Get_Record_Info;\ app_links->buffer_history_get_group_sub_record_ = Buffer_History_Get_Group_Sub_Record;\ @@ -665,6 +659,7 @@ app_links->buffer_history_merge_record_range_ = Buffer_History_Merge_Record_Rang app_links->buffer_history_clear_after_current_state_ = Buffer_History_Clear_After_Current_State;\ app_links->global_history_edit_group_begin_ = Global_History_Edit_Group_Begin;\ app_links->global_history_edit_group_end_ = Global_History_Edit_Group_End;\ +app_links->buffer_set_face_ = Buffer_Set_Face;\ app_links->get_face_description_ = Get_Face_Description;\ app_links->get_face_id_ = Get_Face_ID;\ app_links->try_create_new_face_ = Try_Create_New_Face;\ @@ -674,8 +669,8 @@ app_links->get_available_font_count_ = Get_Available_Font_Count;\ app_links->get_available_font_ = Get_Available_Font;\ app_links->set_theme_colors_ = Set_Theme_Colors;\ app_links->get_theme_colors_ = Get_Theme_Colors;\ -app_links->directory_get_hot_ = Directory_Get_Hot;\ -app_links->directory_set_hot_ = Directory_Set_Hot;\ +app_links->get_hot_directory_ = Get_Hot_Directory;\ +app_links->set_hot_directory_ = Set_Hot_Directory;\ app_links->get_file_list_ = Get_File_List;\ app_links->free_file_list_ = Free_File_List;\ app_links->set_gui_up_down_keys_ = Set_GUI_Up_Down_Keys;\ @@ -699,57 +694,56 @@ app_links->get_default_font_for_view_ = Get_Default_Font_For_View;} while(false) #if defined(ALLOW_DEP_4CODER) static bool32 global_set_setting(Application_Links *app, Global_Setting_ID setting, int32_t value){return(app->global_set_setting(app, setting, value));} static bool32 global_set_mapping(Application_Links *app, void *data, int32_t size){return(app->global_set_mapping(app, data, size));} -static bool32 exec_system_command(Application_Links *app, View_Summary *view, Buffer_Identifier buffer_id, char *path, int32_t path_len, char *command, int32_t command_len, Command_Line_Interface_Flag flags){return(app->exec_system_command(app, view, buffer_id, path, path_len, command, command_len, flags));} -static void clipboard_post(Application_Links *app, int32_t clipboard_id, char *str, int32_t len){(app->clipboard_post(app, clipboard_id, str, len));} -static int32_t clipboard_count(Application_Links *app, int32_t clipboard_id){return(app->clipboard_count(app, clipboard_id));} -static int32_t clipboard_index(Application_Links *app, int32_t clipboard_id, int32_t item_index, char *out, int32_t len){return(app->clipboard_index(app, clipboard_id, item_index, out, len));} +static bool32 exec_system_command(Application_Links *app, View_ID view_id, Buffer_Identifier buffer_id, String path, String command, Command_Line_Interface_Flag flags){return(app->exec_system_command(app, view_id, buffer_id, path, command, flags));} +static bool32 clipboard_post(Application_Links *app, int32_t clipboard_id, String string){return(app->clipboard_post(app, clipboard_id, string));} +static bool32 clipboard_count(Application_Links *app, int32_t clipboard_id, int32_t *count_out){return(app->clipboard_count(app, clipboard_id, count_out));} +static bool32 clipboard_index(Application_Links *app, int32_t clipboard_id, int32_t item_index, String *string_out, int32_t *required_size_out){return(app->clipboard_index(app, clipboard_id, item_index, string_out, required_size_out));} static Parse_Context_ID create_parse_context(Application_Links *app, Parser_String_And_Type *kw, uint32_t kw_count, Parser_String_And_Type *pp, uint32_t pp_count){return(app->create_parse_context(app, kw, kw_count, pp, pp_count));} static int32_t get_buffer_count(Application_Links *app){return(app->get_buffer_count(app));} -static Buffer_Summary get_buffer_first(Application_Links *app, Access_Flag access){return(app->get_buffer_first(app, access));} -static void get_buffer_next(Application_Links *app, Buffer_Summary *buffer, Access_Flag access){(app->get_buffer_next(app, buffer, access));} -static Buffer_Summary get_buffer(Application_Links *app, Buffer_ID buffer_id, Access_Flag access){return(app->get_buffer(app, buffer_id, access));} -static Buffer_Summary get_buffer_by_name(Application_Links *app, char *name, int32_t len, Access_Flag access){return(app->get_buffer_by_name(app, name, len, access));} -static Buffer_Summary get_buffer_by_file_name(Application_Links *app, char *name, int32_t len, Access_Flag access){return(app->get_buffer_by_file_name(app, name, len, access));} -static bool32 buffer_read_range(Application_Links *app, Buffer_Summary *buffer, int32_t start, int32_t end, char *out){return(app->buffer_read_range(app, buffer, start, end, out));} -static bool32 buffer_replace_range(Application_Links *app, Buffer_Summary *buffer, int32_t start, int32_t one_past_last, char *str, int32_t len){return(app->buffer_replace_range(app, buffer, start, one_past_last, str, len));} +static bool32 get_buffer_first(Application_Links *app, Access_Flag access, Buffer_ID *buffer_id_out){return(app->get_buffer_first(app, access, buffer_id_out));} +static bool32 get_buffer_next(Application_Links *app, Buffer_ID buffer_id, Access_Flag access, Buffer_ID *buffer_id_out){return(app->get_buffer_next(app, buffer_id, access, buffer_id_out));} +static bool32 get_buffer_summary(Application_Links *app, Buffer_ID buffer_id, Access_Flag access, Buffer_Summary *buffer_summary_out){return(app->get_buffer_summary(app, buffer_id, access, buffer_summary_out));} +static bool32 get_buffer_by_name(Application_Links *app, String name, Access_Flag access, Buffer_ID *buffer_id_out){return(app->get_buffer_by_name(app, name, access, buffer_id_out));} +static bool32 get_buffer_by_file_name(Application_Links *app, String file_name, Access_Flag access, Buffer_ID *buffer_id_out){return(app->get_buffer_by_file_name(app, file_name, access, buffer_id_out));} +static bool32 buffer_read_range(Application_Links *app, Buffer_ID buffer_id, int32_t start, int32_t one_past_last, char *out){return(app->buffer_read_range(app, buffer_id, start, one_past_last, out));} +static bool32 buffer_replace_range(Application_Links *app, Buffer_ID buffer_id, int32_t start, int32_t one_past_last, String string){return(app->buffer_replace_range(app, buffer_id, start, one_past_last, string));} static bool32 buffer_set_edit_handler(Application_Links *app, Buffer_ID buffer_id, Buffer_Edit_Handler *handler){return(app->buffer_set_edit_handler(app, buffer_id, handler));} -static bool32 buffer_compute_cursor(Application_Links *app, Buffer_Summary *buffer, Buffer_Seek seek, Partial_Cursor *cursor_out){return(app->buffer_compute_cursor(app, buffer, seek, cursor_out));} -static bool32 buffer_batch_edit(Application_Links *app, Buffer_Summary *buffer, char *str, int32_t str_len, Buffer_Edit *edits, int32_t edit_count, Buffer_Batch_Edit_Type type){return(app->buffer_batch_edit(app, buffer, str, str_len, edits, edit_count, type));} -static bool32 buffer_get_setting(Application_Links *app, Buffer_Summary *buffer, Buffer_Setting_ID setting, int32_t *value_out){return(app->buffer_get_setting(app, buffer, setting, value_out));} -static bool32 buffer_set_setting(Application_Links *app, Buffer_Summary *buffer, Buffer_Setting_ID setting, int32_t value){return(app->buffer_set_setting(app, buffer, setting, value));} -static Managed_Scope buffer_get_managed_scope(Application_Links *app, Buffer_ID buffer_id){return(app->buffer_get_managed_scope(app, buffer_id));} -static int32_t buffer_token_count(Application_Links *app, Buffer_Summary *buffer){return(app->buffer_token_count(app, buffer));} -static bool32 buffer_read_tokens(Application_Links *app, Buffer_Summary *buffer, int32_t start_token, int32_t end_token, Cpp_Token *tokens_out){return(app->buffer_read_tokens(app, buffer, start_token, end_token, tokens_out));} -static bool32 buffer_get_token_range(Application_Links *app, Buffer_Summary *buffer, Cpp_Token **first_token_out, Cpp_Token **one_past_last_token_out){return(app->buffer_get_token_range(app, buffer, first_token_out, one_past_last_token_out));} -static bool32 buffer_get_token_index(Application_Links *app, Buffer_Summary *buffer, int32_t pos, Cpp_Get_Token_Result *get_result){return(app->buffer_get_token_index(app, buffer, pos, get_result));} -static bool32 buffer_send_end_signal(Application_Links *app, Buffer_Summary *buffer){return(app->buffer_send_end_signal(app, buffer));} -static Buffer_Summary create_buffer(Application_Links *app, char *filename, int32_t filename_len, Buffer_Create_Flag flags){return(app->create_buffer(app, filename, filename_len, flags));} -static bool32 save_buffer(Application_Links *app, Buffer_Summary *buffer, char *file_name, int32_t file_name_len, uint32_t flags){return(app->save_buffer(app, buffer, file_name, file_name_len, flags));} -static Buffer_Kill_Result kill_buffer(Application_Links *app, Buffer_Identifier buffer, Buffer_Kill_Flag flags){return(app->kill_buffer(app, buffer, flags));} -static Buffer_Reopen_Result reopen_buffer(Application_Links *app, Buffer_Summary *buffer, Buffer_Reopen_Flag flags){return(app->reopen_buffer(app, buffer, flags));} -static View_Summary get_view_first(Application_Links *app, Access_Flag access){return(app->get_view_first(app, access));} -static void get_view_next(Application_Links *app, View_Summary *view, Access_Flag access){(app->get_view_next(app, view, access));} -static View_Summary get_view(Application_Links *app, View_ID view_id, Access_Flag access){return(app->get_view(app, view_id, access));} -static View_Summary get_active_view(Application_Links *app, Access_Flag access){return(app->get_active_view(app, access));} -static View_Summary open_view(Application_Links *app, View_Summary *view_location, View_Split_Position position){return(app->open_view(app, view_location, position));} -static bool32 close_view(Application_Links *app, View_Summary *view){return(app->close_view(app, view));} -static bool32 set_active_view(Application_Links *app, View_Summary *view){return(app->set_active_view(app, view));} -static bool32 view_get_setting(Application_Links *app, View_Summary *view, View_Setting_ID setting, int32_t *value_out){return(app->view_get_setting(app, view, setting, value_out));} -static bool32 view_set_setting(Application_Links *app, View_Summary *view, View_Setting_ID setting, int32_t value){return(app->view_set_setting(app, view, setting, value));} -static Managed_Scope view_get_managed_scope(Application_Links *app, View_ID view_id){return(app->view_get_managed_scope(app, view_id));} -static bool32 view_set_split(Application_Links *app, View_Summary *view, View_Split_Kind kind, float t){return(app->view_set_split(app, view, kind, t));} -static i32_Rect view_get_enclosure_rect(Application_Links *app, View_Summary *view){return(app->view_get_enclosure_rect(app, view));} -static bool32 view_compute_cursor(Application_Links *app, View_Summary *view, Buffer_Seek seek, Full_Cursor *cursor_out){return(app->view_compute_cursor(app, view, seek, cursor_out));} -static bool32 view_set_cursor(Application_Links *app, View_Summary *view, Buffer_Seek seek, bool32 set_preferred_x){return(app->view_set_cursor(app, view, seek, set_preferred_x));} -static bool32 view_set_scroll(Application_Links *app, View_Summary *view, GUI_Scroll_Vars scroll){return(app->view_set_scroll(app, view, scroll));} -static bool32 view_set_mark(Application_Links *app, View_Summary *view, Buffer_Seek seek){return(app->view_set_mark(app, view, seek));} -static bool32 view_set_highlight(Application_Links *app, View_Summary *view, int32_t start, int32_t end, bool32 turn_on){return(app->view_set_highlight(app, view, start, end, turn_on));} -static bool32 view_set_buffer(Application_Links *app, View_Summary *view, Buffer_ID buffer_id, Set_Buffer_Flag flags){return(app->view_set_buffer(app, view, buffer_id, flags));} -static bool32 view_post_fade(Application_Links *app, View_Summary *view, float seconds, int32_t start, int32_t end, int_color color){return(app->view_post_fade(app, view, seconds, start, end, color));} -static bool32 view_begin_ui_mode(Application_Links *app, View_Summary *view){return(app->view_begin_ui_mode(app, view));} -static bool32 view_end_ui_mode(Application_Links *app, View_Summary *view){return(app->view_end_ui_mode(app, view));} -static bool32 view_set_ui(Application_Links *app, View_Summary *view, UI_Control *control, UI_Quit_Function_Type *quit_function){return(app->view_set_ui(app, view, control, quit_function));} -static UI_Control view_get_ui_copy(Application_Links *app, View_Summary *view, struct Partition *part){return(app->view_get_ui_copy(app, view, part));} +static bool32 buffer_compute_cursor(Application_Links *app, Buffer_ID buffer_id, Buffer_Seek seek, Partial_Cursor *cursor_out){return(app->buffer_compute_cursor(app, buffer_id, seek, cursor_out));} +static bool32 buffer_batch_edit(Application_Links *app, Buffer_ID buffer_id, char *str, int32_t str_len, Buffer_Edit *edits, int32_t edit_count, Buffer_Batch_Edit_Type type){return(app->buffer_batch_edit(app, buffer_id, str, str_len, edits, edit_count, type));} +static bool32 buffer_get_setting(Application_Links *app, Buffer_ID buffer_id, Buffer_Setting_ID setting, int32_t *value_out){return(app->buffer_get_setting(app, buffer_id, setting, value_out));} +static bool32 buffer_set_setting(Application_Links *app, Buffer_ID buffer_id, Buffer_Setting_ID setting, int32_t value){return(app->buffer_set_setting(app, buffer_id, setting, value));} +static bool32 buffer_get_managed_scope(Application_Links *app, Buffer_ID buffer_id, Managed_Scope *scope_out){return(app->buffer_get_managed_scope(app, buffer_id, scope_out));} +static bool32 buffer_token_count(Application_Links *app, Buffer_ID buffer_id, int32_t *count_out){return(app->buffer_token_count(app, buffer_id, count_out));} +static bool32 buffer_read_tokens(Application_Links *app, Buffer_ID buffer_id, int32_t start_token, int32_t end_token, Cpp_Token *tokens_out){return(app->buffer_read_tokens(app, buffer_id, start_token, end_token, tokens_out));} +static bool32 buffer_get_token_range(Application_Links *app, Buffer_ID buffer_id, Cpp_Token **first_token_out, Cpp_Token **one_past_last_token_out){return(app->buffer_get_token_range(app, buffer_id, first_token_out, one_past_last_token_out));} +static bool32 buffer_get_token_index(Application_Links *app, Buffer_ID buffer_id, int32_t pos, Cpp_Get_Token_Result *get_result){return(app->buffer_get_token_index(app, buffer_id, pos, get_result));} +static bool32 buffer_send_end_signal(Application_Links *app, Buffer_ID buffer_id){return(app->buffer_send_end_signal(app, buffer_id));} +static bool32 create_buffer(Application_Links *app, String file_name, Buffer_Create_Flag flags, Buffer_ID *new_buffer_id_out){return(app->create_buffer(app, file_name, flags, new_buffer_id_out));} +static bool32 buffer_save(Application_Links *app, Buffer_ID buffer_id, String file_name, uint32_t flags){return(app->buffer_save(app, buffer_id, file_name, flags));} +static bool32 buffer_kill(Application_Links *app, Buffer_ID buffer_id, Buffer_Kill_Flag flags, Buffer_Kill_Result *result){return(app->buffer_kill(app, buffer_id, flags, result));} +static bool32 buffer_reopen(Application_Links *app, Buffer_ID buffer_id, Buffer_Reopen_Flag flags, Buffer_Reopen_Result *result){return(app->buffer_reopen(app, buffer_id, flags, result));} +static bool32 get_view_first(Application_Links *app, Access_Flag access, View_ID *view_id_out){return(app->get_view_first(app, access, view_id_out));} +static bool32 get_view_next(Application_Links *app, View_ID view_id, Access_Flag access, View_ID *view_id_out){return(app->get_view_next(app, view_id, access, view_id_out));} +static bool32 get_view_summary(Application_Links *app, View_ID view_id, Access_Flag access, View_Summary *view_summary_out){return(app->get_view_summary(app, view_id, access, view_summary_out));} +static bool32 get_active_view(Application_Links *app, Access_Flag access, View_ID *view_id_out){return(app->get_active_view(app, access, view_id_out));} +static bool32 open_view(Application_Links *app, View_ID location, View_Split_Position position, View_ID *view_id_out){return(app->open_view(app, location, position, view_id_out));} +static bool32 view_close(Application_Links *app, View_ID view_id){return(app->view_close(app, view_id));} +static bool32 view_set_active(Application_Links *app, View_ID view_id){return(app->view_set_active(app, view_id));} +static bool32 view_get_setting(Application_Links *app, View_ID view_id, View_Setting_ID setting, int32_t *value_out){return(app->view_get_setting(app, view_id, setting, value_out));} +static bool32 view_set_setting(Application_Links *app, View_ID view_id, View_Setting_ID setting, int32_t value){return(app->view_set_setting(app, view_id, setting, value));} +static bool32 view_get_managed_scope(Application_Links *app, View_ID view_id, Managed_Scope *scope){return(app->view_get_managed_scope(app, view_id, scope));} +static bool32 view_set_split(Application_Links *app, View_ID view_id, View_Split_Kind kind, float t){return(app->view_set_split(app, view_id, kind, t));} +static bool32 view_get_enclosure_rect(Application_Links *app, View_ID view_id, i32_Rect *rect_out){return(app->view_get_enclosure_rect(app, view_id, rect_out));} +static bool32 view_compute_cursor(Application_Links *app, View_ID view_id, Buffer_Seek seek, Full_Cursor *cursor_out){return(app->view_compute_cursor(app, view_id, seek, cursor_out));} +static bool32 view_set_cursor(Application_Links *app, View_ID view_id, Buffer_Seek seek, bool32 set_preferred_x){return(app->view_set_cursor(app, view_id, seek, set_preferred_x));} +static bool32 view_set_scroll(Application_Links *app, View_ID view_id, GUI_Scroll_Vars scroll){return(app->view_set_scroll(app, view_id, scroll));} +static bool32 view_set_mark(Application_Links *app, View_ID view_id, Buffer_Seek seek){return(app->view_set_mark(app, view_id, seek));} +static bool32 view_set_buffer(Application_Links *app, View_ID view_id, Buffer_ID buffer_id, Set_Buffer_Flag flags){return(app->view_set_buffer(app, view_id, buffer_id, flags));} +static bool32 view_post_fade(Application_Links *app, View_ID view_id, float seconds, int32_t start, int32_t end, int_color color){return(app->view_post_fade(app, view_id, seconds, start, end, color));} +static bool32 view_begin_ui_mode(Application_Links *app, View_ID view_id){return(app->view_begin_ui_mode(app, view_id));} +static bool32 view_end_ui_mode(Application_Links *app, View_ID view_id){return(app->view_end_ui_mode(app, view_id));} +static bool32 view_set_ui(Application_Links *app, View_ID view_id, UI_Control *control, UI_Quit_Function_Type *quit_function){return(app->view_set_ui(app, view_id, control, quit_function));} +static bool32 view_get_ui_copy(Application_Links *app, View_ID view_id, struct Partition *part, UI_Control *ui_control_out){return(app->view_get_ui_copy(app, view_id, part, ui_control_out));} static Managed_Scope create_user_managed_scope(Application_Links *app){return(app->create_user_managed_scope(app));} static bool32 destroy_user_managed_scope(Application_Links *app, Managed_Scope scope){return(app->destroy_user_managed_scope(app, scope));} static Managed_Scope get_global_managed_scope(Application_Links *app){return(app->get_global_managed_scope(app));} @@ -785,26 +779,26 @@ static Mouse_State get_mouse_state(Application_Links *app){return(app->get_mouse static int32_t get_active_query_bars(Application_Links *app, View_ID view_id, int32_t max_result_count, Query_Bar **result_array){return(app->get_active_query_bars(app, view_id, max_result_count, result_array));} static bool32 start_query_bar(Application_Links *app, Query_Bar *bar, uint32_t flags){return(app->start_query_bar(app, bar, flags));} static void end_query_bar(Application_Links *app, Query_Bar *bar, uint32_t flags){(app->end_query_bar(app, bar, flags));} -static void print_message(Application_Links *app, char *str, int32_t len){(app->print_message(app, str, len));} +static bool32 print_message(Application_Links *app, String message){return(app->print_message(app, message));} static int32_t get_theme_count(Application_Links *app){return(app->get_theme_count(app));} static String get_theme_name(Application_Links *app, struct Partition *arena, int32_t index){return(app->get_theme_name(app, arena, index));} -static void create_theme(Application_Links *app, Theme *theme, char *name, int32_t len){(app->create_theme(app, theme, name, len));} -static void change_theme(Application_Links *app, char *name, int32_t len){(app->change_theme(app, name, len));} +static bool32 create_theme(Application_Links *app, Theme *theme, String theme_name){return(app->create_theme(app, theme, theme_name));} +static bool32 change_theme(Application_Links *app, String theme_name){return(app->change_theme(app, theme_name));} static bool32 change_theme_by_index(Application_Links *app, int32_t index){return(app->change_theme_by_index(app, index));} static Face_ID get_largest_face_id(Application_Links *app){return(app->get_largest_face_id(app));} static bool32 set_global_face(Application_Links *app, Face_ID id, bool32 apply_to_all_buffers){return(app->set_global_face(app, id, apply_to_all_buffers));} -static bool32 buffer_set_face(Application_Links *app, Buffer_Summary *buffer, Face_ID id){return(app->buffer_set_face(app, buffer, id));} -static History_Record_Index buffer_history_get_max_record_index(Application_Links *app, Buffer_Summary *buffer){return(app->buffer_history_get_max_record_index(app, buffer));} -static Record_Info buffer_history_get_record_info(Application_Links *app, Buffer_Summary *buffer, History_Record_Index index){return(app->buffer_history_get_record_info(app, buffer, index));} -static Record_Info buffer_history_get_group_sub_record(Application_Links *app, Buffer_Summary *buffer, History_Record_Index index, int32_t sub_index){return(app->buffer_history_get_group_sub_record(app, buffer, index, sub_index));} -static History_Record_Index buffer_history_get_current_state_index(Application_Links *app, Buffer_Summary *buffer){return(app->buffer_history_get_current_state_index(app, buffer));} -static bool32 buffer_history_set_current_state_index(Application_Links *app, Buffer_Summary *buffer, History_Record_Index index){return(app->buffer_history_set_current_state_index(app, buffer, index));} -static bool32 buffer_history_merge_record_range(Application_Links *app, Buffer_Summary *buffer, History_Record_Index first_index, History_Record_Index last_index, Record_Merge_Flag flags){return(app->buffer_history_merge_record_range(app, buffer, first_index, last_index, flags));} -static bool32 buffer_history_clear_after_current_state(Application_Links *app, Buffer_Summary *buffer){return(app->buffer_history_clear_after_current_state(app, buffer));} +static bool32 buffer_history_get_max_record_index(Application_Links *app, Buffer_ID buffer_id, History_Record_Index *index_out){return(app->buffer_history_get_max_record_index(app, buffer_id, index_out));} +static bool32 buffer_history_get_record_info(Application_Links *app, Buffer_ID buffer_id, History_Record_Index index, Record_Info *record_out){return(app->buffer_history_get_record_info(app, buffer_id, index, record_out));} +static bool32 buffer_history_get_group_sub_record(Application_Links *app, Buffer_ID buffer_id, History_Record_Index index, int32_t sub_index, Record_Info *record_out){return(app->buffer_history_get_group_sub_record(app, buffer_id, index, sub_index, record_out));} +static bool32 buffer_history_get_current_state_index(Application_Links *app, Buffer_ID buffer_id, History_Record_Index *index_out){return(app->buffer_history_get_current_state_index(app, buffer_id, index_out));} +static bool32 buffer_history_set_current_state_index(Application_Links *app, Buffer_ID buffer_id, History_Record_Index index){return(app->buffer_history_set_current_state_index(app, buffer_id, index));} +static bool32 buffer_history_merge_record_range(Application_Links *app, Buffer_ID buffer_id, History_Record_Index first_index, History_Record_Index last_index, Record_Merge_Flag flags){return(app->buffer_history_merge_record_range(app, buffer_id, first_index, last_index, flags));} +static bool32 buffer_history_clear_after_current_state(Application_Links *app, Buffer_ID buffer_id){return(app->buffer_history_clear_after_current_state(app, buffer_id));} static void global_history_edit_group_begin(Application_Links *app){(app->global_history_edit_group_begin(app));} static void global_history_edit_group_end(Application_Links *app){(app->global_history_edit_group_end(app));} +static bool32 buffer_set_face(Application_Links *app, Buffer_ID buffer_id, Face_ID id){return(app->buffer_set_face(app, buffer_id, id));} static Face_Description get_face_description(Application_Links *app, Face_ID id){return(app->get_face_description(app, id));} -static Face_ID get_face_id(Application_Links *app, Buffer_Summary *buffer){return(app->get_face_id(app, buffer));} +static bool32 get_face_id(Application_Links *app, Buffer_ID buffer_id, Face_ID *face_id_out){return(app->get_face_id(app, buffer_id, face_id_out));} static Face_ID try_create_new_face(Application_Links *app, Face_Description *description){return(app->try_create_new_face(app, description));} static bool32 try_modify_face(Application_Links *app, Face_ID id, Face_Description *description){return(app->try_modify_face(app, id, description));} static bool32 try_release_face(Application_Links *app, Face_ID id, Face_ID replacement_id){return(app->try_release_face(app, id, replacement_id));} @@ -812,22 +806,22 @@ static int32_t get_available_font_count(Application_Links *app){return(app->get_ static Available_Font get_available_font(Application_Links *app, int32_t index){return(app->get_available_font(app, index));} static void set_theme_colors(Application_Links *app, Theme_Color *colors, int32_t count){(app->set_theme_colors(app, colors, count));} static void get_theme_colors(Application_Links *app, Theme_Color *colors, int32_t count){(app->get_theme_colors(app, colors, count));} -static int32_t directory_get_hot(Application_Links *app, char *out, int32_t capacity){return(app->directory_get_hot(app, out, capacity));} -static bool32 directory_set_hot(Application_Links *app, char *str, int32_t len){return(app->directory_set_hot(app, str, len));} -static File_List get_file_list(Application_Links *app, char *dir, int32_t len){return(app->get_file_list(app, dir, len));} +static int32_t get_hot_directory(Application_Links *app, String *out, int32_t *required_size_out){return(app->get_hot_directory(app, out, required_size_out));} +static bool32 set_hot_directory(Application_Links *app, String string){return(app->set_hot_directory(app, string));} +static bool32 get_file_list(Application_Links *app, String directory, File_List *list_out){return(app->get_file_list(app, directory, list_out));} static void free_file_list(Application_Links *app, File_List list){(app->free_file_list(app, list));} static 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){(app->set_gui_up_down_keys(app, up_key, up_key_modifier, down_key, down_key_modifier));} static void* memory_allocate(Application_Links *app, int32_t size){return(app->memory_allocate(app, size));} static bool32 memory_set_protection(Application_Links *app, void *ptr, int32_t size, Memory_Protect_Flags flags){return(app->memory_set_protection(app, ptr, size, flags));} static void memory_free(Application_Links *app, void *ptr, int32_t size){(app->memory_free(app, ptr, size));} -static bool32 file_exists(Application_Links *app, char *filename, int32_t len){return(app->file_exists(app, filename, len));} -static bool32 directory_cd(Application_Links *app, char *dir, int32_t *len, int32_t capacity, char *rel_path, int32_t rel_len){return(app->directory_cd(app, dir, len, capacity, rel_path, rel_len));} -static int32_t get_4ed_path(Application_Links *app, char *out, int32_t capacity){return(app->get_4ed_path(app, out, capacity));} +static bool32 file_exists(Application_Links *app, String file_name){return(app->file_exists(app, file_name));} +static bool32 directory_cd(Application_Links *app, String *directory, String relative_path){return(app->directory_cd(app, directory, relative_path));} +static bool32 get_4ed_path(Application_Links *app, String *path_out, int32_t *required_size_out){return(app->get_4ed_path(app, path_out, required_size_out));} static void show_mouse_cursor(Application_Links *app, Mouse_Cursor_Show_Type show){(app->show_mouse_cursor(app, show));} static bool32 set_fullscreen(Application_Links *app, bool32 full_screen){return(app->set_fullscreen(app, full_screen));} static bool32 is_fullscreen(Application_Links *app){return(app->is_fullscreen(app));} static void send_exit_signal(Application_Links *app){(app->send_exit_signal(app));} -static void set_window_title(Application_Links *app, char *title){(app->set_window_title(app, title));} +static bool32 set_window_title(Application_Links *app, String title){return(app->set_window_title(app, title));} static Microsecond_Time_Stamp get_microseconds_timestamp(Application_Links *app){return(app->get_microseconds_timestamp(app));} static float draw_string(Application_Links *app, Face_ID font_id, String str, int32_t x, int32_t y, int_color color, uint32_t flags, float dx, float dy){return(app->draw_string(app, font_id, str, x, y, color, flags, dx, dy));} static float get_string_advance(Application_Links *app, Face_ID font_id, String str){return(app->get_string_advance(app, font_id, str));} @@ -837,57 +831,56 @@ static Face_ID get_default_font_for_view(Application_Links *app, View_ID view_id #else static bool32 global_set_setting(Application_Links *app, Global_Setting_ID setting, int32_t value){return(app->global_set_setting_(app, setting, value));} static bool32 global_set_mapping(Application_Links *app, void *data, int32_t size){return(app->global_set_mapping_(app, data, size));} -static bool32 exec_system_command(Application_Links *app, View_Summary *view, Buffer_Identifier buffer_id, char *path, int32_t path_len, char *command, int32_t command_len, Command_Line_Interface_Flag flags){return(app->exec_system_command_(app, view, buffer_id, path, path_len, command, command_len, flags));} -static void clipboard_post(Application_Links *app, int32_t clipboard_id, char *str, int32_t len){(app->clipboard_post_(app, clipboard_id, str, len));} -static int32_t clipboard_count(Application_Links *app, int32_t clipboard_id){return(app->clipboard_count_(app, clipboard_id));} -static int32_t clipboard_index(Application_Links *app, int32_t clipboard_id, int32_t item_index, char *out, int32_t len){return(app->clipboard_index_(app, clipboard_id, item_index, out, len));} +static bool32 exec_system_command(Application_Links *app, View_ID view_id, Buffer_Identifier buffer_id, String path, String command, Command_Line_Interface_Flag flags){return(app->exec_system_command_(app, view_id, buffer_id, path, command, flags));} +static bool32 clipboard_post(Application_Links *app, int32_t clipboard_id, String string){return(app->clipboard_post_(app, clipboard_id, string));} +static bool32 clipboard_count(Application_Links *app, int32_t clipboard_id, int32_t *count_out){return(app->clipboard_count_(app, clipboard_id, count_out));} +static bool32 clipboard_index(Application_Links *app, int32_t clipboard_id, int32_t item_index, String *string_out, int32_t *required_size_out){return(app->clipboard_index_(app, clipboard_id, item_index, string_out, required_size_out));} static Parse_Context_ID create_parse_context(Application_Links *app, Parser_String_And_Type *kw, uint32_t kw_count, Parser_String_And_Type *pp, uint32_t pp_count){return(app->create_parse_context_(app, kw, kw_count, pp, pp_count));} static int32_t get_buffer_count(Application_Links *app){return(app->get_buffer_count_(app));} -static Buffer_Summary get_buffer_first(Application_Links *app, Access_Flag access){return(app->get_buffer_first_(app, access));} -static void get_buffer_next(Application_Links *app, Buffer_Summary *buffer, Access_Flag access){(app->get_buffer_next_(app, buffer, access));} -static Buffer_Summary get_buffer(Application_Links *app, Buffer_ID buffer_id, Access_Flag access){return(app->get_buffer_(app, buffer_id, access));} -static Buffer_Summary get_buffer_by_name(Application_Links *app, char *name, int32_t len, Access_Flag access){return(app->get_buffer_by_name_(app, name, len, access));} -static Buffer_Summary get_buffer_by_file_name(Application_Links *app, char *name, int32_t len, Access_Flag access){return(app->get_buffer_by_file_name_(app, name, len, access));} -static bool32 buffer_read_range(Application_Links *app, Buffer_Summary *buffer, int32_t start, int32_t end, char *out){return(app->buffer_read_range_(app, buffer, start, end, out));} -static bool32 buffer_replace_range(Application_Links *app, Buffer_Summary *buffer, int32_t start, int32_t one_past_last, char *str, int32_t len){return(app->buffer_replace_range_(app, buffer, start, one_past_last, str, len));} +static bool32 get_buffer_first(Application_Links *app, Access_Flag access, Buffer_ID *buffer_id_out){return(app->get_buffer_first_(app, access, buffer_id_out));} +static bool32 get_buffer_next(Application_Links *app, Buffer_ID buffer_id, Access_Flag access, Buffer_ID *buffer_id_out){return(app->get_buffer_next_(app, buffer_id, access, buffer_id_out));} +static bool32 get_buffer_summary(Application_Links *app, Buffer_ID buffer_id, Access_Flag access, Buffer_Summary *buffer_summary_out){return(app->get_buffer_summary_(app, buffer_id, access, buffer_summary_out));} +static bool32 get_buffer_by_name(Application_Links *app, String name, Access_Flag access, Buffer_ID *buffer_id_out){return(app->get_buffer_by_name_(app, name, access, buffer_id_out));} +static bool32 get_buffer_by_file_name(Application_Links *app, String file_name, Access_Flag access, Buffer_ID *buffer_id_out){return(app->get_buffer_by_file_name_(app, file_name, access, buffer_id_out));} +static bool32 buffer_read_range(Application_Links *app, Buffer_ID buffer_id, int32_t start, int32_t one_past_last, char *out){return(app->buffer_read_range_(app, buffer_id, start, one_past_last, out));} +static bool32 buffer_replace_range(Application_Links *app, Buffer_ID buffer_id, int32_t start, int32_t one_past_last, String string){return(app->buffer_replace_range_(app, buffer_id, start, one_past_last, string));} static bool32 buffer_set_edit_handler(Application_Links *app, Buffer_ID buffer_id, Buffer_Edit_Handler *handler){return(app->buffer_set_edit_handler_(app, buffer_id, handler));} -static bool32 buffer_compute_cursor(Application_Links *app, Buffer_Summary *buffer, Buffer_Seek seek, Partial_Cursor *cursor_out){return(app->buffer_compute_cursor_(app, buffer, seek, cursor_out));} -static bool32 buffer_batch_edit(Application_Links *app, Buffer_Summary *buffer, char *str, int32_t str_len, Buffer_Edit *edits, int32_t edit_count, Buffer_Batch_Edit_Type type){return(app->buffer_batch_edit_(app, buffer, str, str_len, edits, edit_count, type));} -static bool32 buffer_get_setting(Application_Links *app, Buffer_Summary *buffer, Buffer_Setting_ID setting, int32_t *value_out){return(app->buffer_get_setting_(app, buffer, setting, value_out));} -static bool32 buffer_set_setting(Application_Links *app, Buffer_Summary *buffer, Buffer_Setting_ID setting, int32_t value){return(app->buffer_set_setting_(app, buffer, setting, value));} -static Managed_Scope buffer_get_managed_scope(Application_Links *app, Buffer_ID buffer_id){return(app->buffer_get_managed_scope_(app, buffer_id));} -static int32_t buffer_token_count(Application_Links *app, Buffer_Summary *buffer){return(app->buffer_token_count_(app, buffer));} -static bool32 buffer_read_tokens(Application_Links *app, Buffer_Summary *buffer, int32_t start_token, int32_t end_token, Cpp_Token *tokens_out){return(app->buffer_read_tokens_(app, buffer, start_token, end_token, tokens_out));} -static bool32 buffer_get_token_range(Application_Links *app, Buffer_Summary *buffer, Cpp_Token **first_token_out, Cpp_Token **one_past_last_token_out){return(app->buffer_get_token_range_(app, buffer, first_token_out, one_past_last_token_out));} -static bool32 buffer_get_token_index(Application_Links *app, Buffer_Summary *buffer, int32_t pos, Cpp_Get_Token_Result *get_result){return(app->buffer_get_token_index_(app, buffer, pos, get_result));} -static bool32 buffer_send_end_signal(Application_Links *app, Buffer_Summary *buffer){return(app->buffer_send_end_signal_(app, buffer));} -static Buffer_Summary create_buffer(Application_Links *app, char *filename, int32_t filename_len, Buffer_Create_Flag flags){return(app->create_buffer_(app, filename, filename_len, flags));} -static bool32 save_buffer(Application_Links *app, Buffer_Summary *buffer, char *file_name, int32_t file_name_len, uint32_t flags){return(app->save_buffer_(app, buffer, file_name, file_name_len, flags));} -static Buffer_Kill_Result kill_buffer(Application_Links *app, Buffer_Identifier buffer, Buffer_Kill_Flag flags){return(app->kill_buffer_(app, buffer, flags));} -static Buffer_Reopen_Result reopen_buffer(Application_Links *app, Buffer_Summary *buffer, Buffer_Reopen_Flag flags){return(app->reopen_buffer_(app, buffer, flags));} -static View_Summary get_view_first(Application_Links *app, Access_Flag access){return(app->get_view_first_(app, access));} -static void get_view_next(Application_Links *app, View_Summary *view, Access_Flag access){(app->get_view_next_(app, view, access));} -static View_Summary get_view(Application_Links *app, View_ID view_id, Access_Flag access){return(app->get_view_(app, view_id, access));} -static View_Summary get_active_view(Application_Links *app, Access_Flag access){return(app->get_active_view_(app, access));} -static View_Summary open_view(Application_Links *app, View_Summary *view_location, View_Split_Position position){return(app->open_view_(app, view_location, position));} -static bool32 close_view(Application_Links *app, View_Summary *view){return(app->close_view_(app, view));} -static bool32 set_active_view(Application_Links *app, View_Summary *view){return(app->set_active_view_(app, view));} -static bool32 view_get_setting(Application_Links *app, View_Summary *view, View_Setting_ID setting, int32_t *value_out){return(app->view_get_setting_(app, view, setting, value_out));} -static bool32 view_set_setting(Application_Links *app, View_Summary *view, View_Setting_ID setting, int32_t value){return(app->view_set_setting_(app, view, setting, value));} -static Managed_Scope view_get_managed_scope(Application_Links *app, View_ID view_id){return(app->view_get_managed_scope_(app, view_id));} -static bool32 view_set_split(Application_Links *app, View_Summary *view, View_Split_Kind kind, float t){return(app->view_set_split_(app, view, kind, t));} -static i32_Rect view_get_enclosure_rect(Application_Links *app, View_Summary *view){return(app->view_get_enclosure_rect_(app, view));} -static bool32 view_compute_cursor(Application_Links *app, View_Summary *view, Buffer_Seek seek, Full_Cursor *cursor_out){return(app->view_compute_cursor_(app, view, seek, cursor_out));} -static bool32 view_set_cursor(Application_Links *app, View_Summary *view, Buffer_Seek seek, bool32 set_preferred_x){return(app->view_set_cursor_(app, view, seek, set_preferred_x));} -static bool32 view_set_scroll(Application_Links *app, View_Summary *view, GUI_Scroll_Vars scroll){return(app->view_set_scroll_(app, view, scroll));} -static bool32 view_set_mark(Application_Links *app, View_Summary *view, Buffer_Seek seek){return(app->view_set_mark_(app, view, seek));} -static bool32 view_set_highlight(Application_Links *app, View_Summary *view, int32_t start, int32_t end, bool32 turn_on){return(app->view_set_highlight_(app, view, start, end, turn_on));} -static bool32 view_set_buffer(Application_Links *app, View_Summary *view, Buffer_ID buffer_id, Set_Buffer_Flag flags){return(app->view_set_buffer_(app, view, buffer_id, flags));} -static bool32 view_post_fade(Application_Links *app, View_Summary *view, float seconds, int32_t start, int32_t end, int_color color){return(app->view_post_fade_(app, view, seconds, start, end, color));} -static bool32 view_begin_ui_mode(Application_Links *app, View_Summary *view){return(app->view_begin_ui_mode_(app, view));} -static bool32 view_end_ui_mode(Application_Links *app, View_Summary *view){return(app->view_end_ui_mode_(app, view));} -static bool32 view_set_ui(Application_Links *app, View_Summary *view, UI_Control *control, UI_Quit_Function_Type *quit_function){return(app->view_set_ui_(app, view, control, quit_function));} -static UI_Control view_get_ui_copy(Application_Links *app, View_Summary *view, struct Partition *part){return(app->view_get_ui_copy_(app, view, part));} +static bool32 buffer_compute_cursor(Application_Links *app, Buffer_ID buffer_id, Buffer_Seek seek, Partial_Cursor *cursor_out){return(app->buffer_compute_cursor_(app, buffer_id, seek, cursor_out));} +static bool32 buffer_batch_edit(Application_Links *app, Buffer_ID buffer_id, char *str, int32_t str_len, Buffer_Edit *edits, int32_t edit_count, Buffer_Batch_Edit_Type type){return(app->buffer_batch_edit_(app, buffer_id, str, str_len, edits, edit_count, type));} +static bool32 buffer_get_setting(Application_Links *app, Buffer_ID buffer_id, Buffer_Setting_ID setting, int32_t *value_out){return(app->buffer_get_setting_(app, buffer_id, setting, value_out));} +static bool32 buffer_set_setting(Application_Links *app, Buffer_ID buffer_id, Buffer_Setting_ID setting, int32_t value){return(app->buffer_set_setting_(app, buffer_id, setting, value));} +static bool32 buffer_get_managed_scope(Application_Links *app, Buffer_ID buffer_id, Managed_Scope *scope_out){return(app->buffer_get_managed_scope_(app, buffer_id, scope_out));} +static bool32 buffer_token_count(Application_Links *app, Buffer_ID buffer_id, int32_t *count_out){return(app->buffer_token_count_(app, buffer_id, count_out));} +static bool32 buffer_read_tokens(Application_Links *app, Buffer_ID buffer_id, int32_t start_token, int32_t end_token, Cpp_Token *tokens_out){return(app->buffer_read_tokens_(app, buffer_id, start_token, end_token, tokens_out));} +static bool32 buffer_get_token_range(Application_Links *app, Buffer_ID buffer_id, Cpp_Token **first_token_out, Cpp_Token **one_past_last_token_out){return(app->buffer_get_token_range_(app, buffer_id, first_token_out, one_past_last_token_out));} +static bool32 buffer_get_token_index(Application_Links *app, Buffer_ID buffer_id, int32_t pos, Cpp_Get_Token_Result *get_result){return(app->buffer_get_token_index_(app, buffer_id, pos, get_result));} +static bool32 buffer_send_end_signal(Application_Links *app, Buffer_ID buffer_id){return(app->buffer_send_end_signal_(app, buffer_id));} +static bool32 create_buffer(Application_Links *app, String file_name, Buffer_Create_Flag flags, Buffer_ID *new_buffer_id_out){return(app->create_buffer_(app, file_name, flags, new_buffer_id_out));} +static bool32 buffer_save(Application_Links *app, Buffer_ID buffer_id, String file_name, uint32_t flags){return(app->buffer_save_(app, buffer_id, file_name, flags));} +static bool32 buffer_kill(Application_Links *app, Buffer_ID buffer_id, Buffer_Kill_Flag flags, Buffer_Kill_Result *result){return(app->buffer_kill_(app, buffer_id, flags, result));} +static bool32 buffer_reopen(Application_Links *app, Buffer_ID buffer_id, Buffer_Reopen_Flag flags, Buffer_Reopen_Result *result){return(app->buffer_reopen_(app, buffer_id, flags, result));} +static bool32 get_view_first(Application_Links *app, Access_Flag access, View_ID *view_id_out){return(app->get_view_first_(app, access, view_id_out));} +static bool32 get_view_next(Application_Links *app, View_ID view_id, Access_Flag access, View_ID *view_id_out){return(app->get_view_next_(app, view_id, access, view_id_out));} +static bool32 get_view_summary(Application_Links *app, View_ID view_id, Access_Flag access, View_Summary *view_summary_out){return(app->get_view_summary_(app, view_id, access, view_summary_out));} +static bool32 get_active_view(Application_Links *app, Access_Flag access, View_ID *view_id_out){return(app->get_active_view_(app, access, view_id_out));} +static bool32 open_view(Application_Links *app, View_ID location, View_Split_Position position, View_ID *view_id_out){return(app->open_view_(app, location, position, view_id_out));} +static bool32 view_close(Application_Links *app, View_ID view_id){return(app->view_close_(app, view_id));} +static bool32 view_set_active(Application_Links *app, View_ID view_id){return(app->view_set_active_(app, view_id));} +static bool32 view_get_setting(Application_Links *app, View_ID view_id, View_Setting_ID setting, int32_t *value_out){return(app->view_get_setting_(app, view_id, setting, value_out));} +static bool32 view_set_setting(Application_Links *app, View_ID view_id, View_Setting_ID setting, int32_t value){return(app->view_set_setting_(app, view_id, setting, value));} +static bool32 view_get_managed_scope(Application_Links *app, View_ID view_id, Managed_Scope *scope){return(app->view_get_managed_scope_(app, view_id, scope));} +static bool32 view_set_split(Application_Links *app, View_ID view_id, View_Split_Kind kind, float t){return(app->view_set_split_(app, view_id, kind, t));} +static bool32 view_get_enclosure_rect(Application_Links *app, View_ID view_id, i32_Rect *rect_out){return(app->view_get_enclosure_rect_(app, view_id, rect_out));} +static bool32 view_compute_cursor(Application_Links *app, View_ID view_id, Buffer_Seek seek, Full_Cursor *cursor_out){return(app->view_compute_cursor_(app, view_id, seek, cursor_out));} +static bool32 view_set_cursor(Application_Links *app, View_ID view_id, Buffer_Seek seek, bool32 set_preferred_x){return(app->view_set_cursor_(app, view_id, seek, set_preferred_x));} +static bool32 view_set_scroll(Application_Links *app, View_ID view_id, GUI_Scroll_Vars scroll){return(app->view_set_scroll_(app, view_id, scroll));} +static bool32 view_set_mark(Application_Links *app, View_ID view_id, Buffer_Seek seek){return(app->view_set_mark_(app, view_id, seek));} +static bool32 view_set_buffer(Application_Links *app, View_ID view_id, Buffer_ID buffer_id, Set_Buffer_Flag flags){return(app->view_set_buffer_(app, view_id, buffer_id, flags));} +static bool32 view_post_fade(Application_Links *app, View_ID view_id, float seconds, int32_t start, int32_t end, int_color color){return(app->view_post_fade_(app, view_id, seconds, start, end, color));} +static bool32 view_begin_ui_mode(Application_Links *app, View_ID view_id){return(app->view_begin_ui_mode_(app, view_id));} +static bool32 view_end_ui_mode(Application_Links *app, View_ID view_id){return(app->view_end_ui_mode_(app, view_id));} +static bool32 view_set_ui(Application_Links *app, View_ID view_id, UI_Control *control, UI_Quit_Function_Type *quit_function){return(app->view_set_ui_(app, view_id, control, quit_function));} +static bool32 view_get_ui_copy(Application_Links *app, View_ID view_id, struct Partition *part, UI_Control *ui_control_out){return(app->view_get_ui_copy_(app, view_id, part, ui_control_out));} static Managed_Scope create_user_managed_scope(Application_Links *app){return(app->create_user_managed_scope_(app));} static bool32 destroy_user_managed_scope(Application_Links *app, Managed_Scope scope){return(app->destroy_user_managed_scope_(app, scope));} static Managed_Scope get_global_managed_scope(Application_Links *app){return(app->get_global_managed_scope_(app));} @@ -923,26 +916,26 @@ static Mouse_State get_mouse_state(Application_Links *app){return(app->get_mouse static int32_t get_active_query_bars(Application_Links *app, View_ID view_id, int32_t max_result_count, Query_Bar **result_array){return(app->get_active_query_bars_(app, view_id, max_result_count, result_array));} static bool32 start_query_bar(Application_Links *app, Query_Bar *bar, uint32_t flags){return(app->start_query_bar_(app, bar, flags));} static void end_query_bar(Application_Links *app, Query_Bar *bar, uint32_t flags){(app->end_query_bar_(app, bar, flags));} -static void print_message(Application_Links *app, char *str, int32_t len){(app->print_message_(app, str, len));} +static bool32 print_message(Application_Links *app, String message){return(app->print_message_(app, message));} static int32_t get_theme_count(Application_Links *app){return(app->get_theme_count_(app));} static String get_theme_name(Application_Links *app, struct Partition *arena, int32_t index){return(app->get_theme_name_(app, arena, index));} -static void create_theme(Application_Links *app, Theme *theme, char *name, int32_t len){(app->create_theme_(app, theme, name, len));} -static void change_theme(Application_Links *app, char *name, int32_t len){(app->change_theme_(app, name, len));} +static bool32 create_theme(Application_Links *app, Theme *theme, String theme_name){return(app->create_theme_(app, theme, theme_name));} +static bool32 change_theme(Application_Links *app, String theme_name){return(app->change_theme_(app, theme_name));} static bool32 change_theme_by_index(Application_Links *app, int32_t index){return(app->change_theme_by_index_(app, index));} static Face_ID get_largest_face_id(Application_Links *app){return(app->get_largest_face_id_(app));} static bool32 set_global_face(Application_Links *app, Face_ID id, bool32 apply_to_all_buffers){return(app->set_global_face_(app, id, apply_to_all_buffers));} -static bool32 buffer_set_face(Application_Links *app, Buffer_Summary *buffer, Face_ID id){return(app->buffer_set_face_(app, buffer, id));} -static History_Record_Index buffer_history_get_max_record_index(Application_Links *app, Buffer_Summary *buffer){return(app->buffer_history_get_max_record_index_(app, buffer));} -static Record_Info buffer_history_get_record_info(Application_Links *app, Buffer_Summary *buffer, History_Record_Index index){return(app->buffer_history_get_record_info_(app, buffer, index));} -static Record_Info buffer_history_get_group_sub_record(Application_Links *app, Buffer_Summary *buffer, History_Record_Index index, int32_t sub_index){return(app->buffer_history_get_group_sub_record_(app, buffer, index, sub_index));} -static History_Record_Index buffer_history_get_current_state_index(Application_Links *app, Buffer_Summary *buffer){return(app->buffer_history_get_current_state_index_(app, buffer));} -static bool32 buffer_history_set_current_state_index(Application_Links *app, Buffer_Summary *buffer, History_Record_Index index){return(app->buffer_history_set_current_state_index_(app, buffer, index));} -static bool32 buffer_history_merge_record_range(Application_Links *app, Buffer_Summary *buffer, History_Record_Index first_index, History_Record_Index last_index, Record_Merge_Flag flags){return(app->buffer_history_merge_record_range_(app, buffer, first_index, last_index, flags));} -static bool32 buffer_history_clear_after_current_state(Application_Links *app, Buffer_Summary *buffer){return(app->buffer_history_clear_after_current_state_(app, buffer));} +static bool32 buffer_history_get_max_record_index(Application_Links *app, Buffer_ID buffer_id, History_Record_Index *index_out){return(app->buffer_history_get_max_record_index_(app, buffer_id, index_out));} +static bool32 buffer_history_get_record_info(Application_Links *app, Buffer_ID buffer_id, History_Record_Index index, Record_Info *record_out){return(app->buffer_history_get_record_info_(app, buffer_id, index, record_out));} +static bool32 buffer_history_get_group_sub_record(Application_Links *app, Buffer_ID buffer_id, History_Record_Index index, int32_t sub_index, Record_Info *record_out){return(app->buffer_history_get_group_sub_record_(app, buffer_id, index, sub_index, record_out));} +static bool32 buffer_history_get_current_state_index(Application_Links *app, Buffer_ID buffer_id, History_Record_Index *index_out){return(app->buffer_history_get_current_state_index_(app, buffer_id, index_out));} +static bool32 buffer_history_set_current_state_index(Application_Links *app, Buffer_ID buffer_id, History_Record_Index index){return(app->buffer_history_set_current_state_index_(app, buffer_id, index));} +static bool32 buffer_history_merge_record_range(Application_Links *app, Buffer_ID buffer_id, History_Record_Index first_index, History_Record_Index last_index, Record_Merge_Flag flags){return(app->buffer_history_merge_record_range_(app, buffer_id, first_index, last_index, flags));} +static bool32 buffer_history_clear_after_current_state(Application_Links *app, Buffer_ID buffer_id){return(app->buffer_history_clear_after_current_state_(app, buffer_id));} static void global_history_edit_group_begin(Application_Links *app){(app->global_history_edit_group_begin_(app));} static void global_history_edit_group_end(Application_Links *app){(app->global_history_edit_group_end_(app));} +static bool32 buffer_set_face(Application_Links *app, Buffer_ID buffer_id, Face_ID id){return(app->buffer_set_face_(app, buffer_id, id));} static Face_Description get_face_description(Application_Links *app, Face_ID id){return(app->get_face_description_(app, id));} -static Face_ID get_face_id(Application_Links *app, Buffer_Summary *buffer){return(app->get_face_id_(app, buffer));} +static bool32 get_face_id(Application_Links *app, Buffer_ID buffer_id, Face_ID *face_id_out){return(app->get_face_id_(app, buffer_id, face_id_out));} static Face_ID try_create_new_face(Application_Links *app, Face_Description *description){return(app->try_create_new_face_(app, description));} static bool32 try_modify_face(Application_Links *app, Face_ID id, Face_Description *description){return(app->try_modify_face_(app, id, description));} static bool32 try_release_face(Application_Links *app, Face_ID id, Face_ID replacement_id){return(app->try_release_face_(app, id, replacement_id));} @@ -950,22 +943,22 @@ static int32_t get_available_font_count(Application_Links *app){return(app->get_ static Available_Font get_available_font(Application_Links *app, int32_t index){return(app->get_available_font_(app, index));} static void set_theme_colors(Application_Links *app, Theme_Color *colors, int32_t count){(app->set_theme_colors_(app, colors, count));} static void get_theme_colors(Application_Links *app, Theme_Color *colors, int32_t count){(app->get_theme_colors_(app, colors, count));} -static int32_t directory_get_hot(Application_Links *app, char *out, int32_t capacity){return(app->directory_get_hot_(app, out, capacity));} -static bool32 directory_set_hot(Application_Links *app, char *str, int32_t len){return(app->directory_set_hot_(app, str, len));} -static File_List get_file_list(Application_Links *app, char *dir, int32_t len){return(app->get_file_list_(app, dir, len));} +static int32_t get_hot_directory(Application_Links *app, String *out, int32_t *required_size_out){return(app->get_hot_directory_(app, out, required_size_out));} +static bool32 set_hot_directory(Application_Links *app, String string){return(app->set_hot_directory_(app, string));} +static bool32 get_file_list(Application_Links *app, String directory, File_List *list_out){return(app->get_file_list_(app, directory, list_out));} static void free_file_list(Application_Links *app, File_List list){(app->free_file_list_(app, list));} static 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){(app->set_gui_up_down_keys_(app, up_key, up_key_modifier, down_key, down_key_modifier));} static void* memory_allocate(Application_Links *app, int32_t size){return(app->memory_allocate_(app, size));} static bool32 memory_set_protection(Application_Links *app, void *ptr, int32_t size, Memory_Protect_Flags flags){return(app->memory_set_protection_(app, ptr, size, flags));} static void memory_free(Application_Links *app, void *ptr, int32_t size){(app->memory_free_(app, ptr, size));} -static bool32 file_exists(Application_Links *app, char *filename, int32_t len){return(app->file_exists_(app, filename, len));} -static bool32 directory_cd(Application_Links *app, char *dir, int32_t *len, int32_t capacity, char *rel_path, int32_t rel_len){return(app->directory_cd_(app, dir, len, capacity, rel_path, rel_len));} -static int32_t get_4ed_path(Application_Links *app, char *out, int32_t capacity){return(app->get_4ed_path_(app, out, capacity));} +static bool32 file_exists(Application_Links *app, String file_name){return(app->file_exists_(app, file_name));} +static bool32 directory_cd(Application_Links *app, String *directory, String relative_path){return(app->directory_cd_(app, directory, relative_path));} +static bool32 get_4ed_path(Application_Links *app, String *path_out, int32_t *required_size_out){return(app->get_4ed_path_(app, path_out, required_size_out));} static void show_mouse_cursor(Application_Links *app, Mouse_Cursor_Show_Type show){(app->show_mouse_cursor_(app, show));} static bool32 set_fullscreen(Application_Links *app, bool32 full_screen){return(app->set_fullscreen_(app, full_screen));} static bool32 is_fullscreen(Application_Links *app){return(app->is_fullscreen_(app));} static void send_exit_signal(Application_Links *app){(app->send_exit_signal_(app));} -static void set_window_title(Application_Links *app, char *title){(app->set_window_title_(app, title));} +static bool32 set_window_title(Application_Links *app, String title){return(app->set_window_title_(app, title));} static Microsecond_Time_Stamp get_microseconds_timestamp(Application_Links *app){return(app->get_microseconds_timestamp_(app));} static float draw_string(Application_Links *app, Face_ID font_id, String str, int32_t x, int32_t y, int_color color, uint32_t flags, float dx, float dy){return(app->draw_string_(app, font_id, str, x, y, color, flags, dx, dy));} static float get_string_advance(Application_Links *app, Face_ID font_id, String str){return(app->get_string_advance_(app, font_id, str));} diff --git a/4coder_generated/command_metadata.h b/4coder_generated/command_metadata.h index 7968e589..dcfb6d5a 100644 --- a/4coder_generated/command_metadata.h +++ b/4coder_generated/command_metadata.h @@ -243,228 +243,228 @@ int32_t source_name_len; int32_t line_number; }; static Command_Metadata fcoder_metacmd_table[222] = { -{ PROC_LINKS(allow_mouse, 0), "allow_mouse", 11, "Shows the mouse and causes all mouse input to be processed normally.", 68, "c:\\4ed\\code\\4coder_default_framework.cpp", 40, 242 }, -{ PROC_LINKS(auto_tab_line_at_cursor, 0), "auto_tab_line_at_cursor", 23, "Auto-indents the line on which the cursor sits.", 47, "c:\\4ed\\code\\4coder_auto_indent.cpp", 34, 721 }, -{ PROC_LINKS(auto_tab_range, 0), "auto_tab_range", 14, "Auto-indents the range between the cursor and the mark.", 55, "c:\\4ed\\code\\4coder_auto_indent.cpp", 34, 732 }, -{ PROC_LINKS(auto_tab_whole_file, 0), "auto_tab_whole_file", 19, "Audo-indents the entire current buffer.", 39, "c:\\4ed\\code\\4coder_auto_indent.cpp", 34, 711 }, -{ PROC_LINKS(backspace_char, 0), "backspace_char", 14, "Deletes the character to the left of the cursor.", 48, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 99 }, -{ PROC_LINKS(backspace_word, 0), "backspace_word", 14, "Delete characters between the cursor position and the first alphanumeric boundary to the left.", 94, "c:\\4ed\\code\\4coder_seek.cpp", 27, 1258 }, -{ PROC_LINKS(basic_change_active_panel, 0), "basic_change_active_panel", 25, "Change the currently active panel, moving to the panel with the next highest view_id. Will not skipe the build panel if it is open.", 132, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 507 }, -{ PROC_LINKS(build_in_build_panel, 0), "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, "c:\\4ed\\code\\4coder_build_commands.cpp", 37, 187 }, -{ PROC_LINKS(build_search, 0), "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, "c:\\4ed\\code\\4coder_build_commands.cpp", 37, 155 }, -{ PROC_LINKS(center_view, 0), "center_view", 11, "Centers the view vertically on the line on which the cursor sits.", 65, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 149 }, -{ 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, "c:\\4ed\\code\\4coder_default_framework.cpp", 40, 144 }, -{ 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, "c:\\4ed\\code\\4coder_default_framework.cpp", 40, 154 }, -{ PROC_LINKS(change_to_build_panel, 0), "change_to_build_panel", 21, "If the special build panel is open, makes the build panel the active panel.", 75, "c:\\4ed\\code\\4coder_build_commands.cpp", 37, 209 }, -{ PROC_LINKS(clean_all_lines, 0), "clean_all_lines", 15, "Removes trailing whitespace from all lines in the current buffer.", 65, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 442 }, -{ PROC_LINKS(click_set_cursor, 0), "click_set_cursor", 16, "Sets the cursor position to the mouse position.", 47, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 216 }, -{ PROC_LINKS(click_set_cursor_and_mark, 0), "click_set_cursor_and_mark", 25, "Sets the cursor position and mark to the mouse position.", 56, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 203 }, -{ PROC_LINKS(click_set_cursor_if_lbutton, 0), "click_set_cursor_if_lbutton", 27, "If the mouse left button is pressed, sets the cursor position to the mouse position.", 84, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 229 }, -{ PROC_LINKS(click_set_mark, 0), "click_set_mark", 14, "Sets the mark position to the mouse position.", 45, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 244 }, -{ PROC_LINKS(close_all_code, 0), "close_all_code", 14, "Closes any buffer with a filename ending with an extension configured to be recognized as a code file type.", 107, "c:\\4ed\\code\\4coder_project_commands.cpp", 39, 1060 }, -{ PROC_LINKS(close_build_panel, 0), "close_build_panel", 17, "If the special build panel is open, closes it.", 46, "c:\\4ed\\code\\4coder_build_commands.cpp", 37, 203 }, -{ PROC_LINKS(close_panel, 0), "close_panel", 11, "Closes the currently active panel if it is not the only panel open.", 67, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 515 }, -{ PROC_LINKS(command_lister, 0), "command_lister", 14, "Opens an interactive list of all registered commands.", 53, "c:\\4ed\\code\\4coder_lists.cpp", 28, 977 }, -{ PROC_LINKS(comment_line, 0), "comment_line", 12, "Insert '//' at the beginning of the line after leading whitespace.", 66, "c:\\4ed\\code\\4coder_combined_write_commands.cpp", 46, 135 }, -{ PROC_LINKS(comment_line_toggle, 0), "comment_line_toggle", 19, "Turns uncommented lines into commented lines and vice versa for comments starting with '//'.", 92, "c:\\4ed\\code\\4coder_combined_write_commands.cpp", 46, 159 }, -{ PROC_LINKS(copy, 0), "copy", 4, "Copy the text in the range from the cursor to the mark onto the clipboard.", 74, "c:\\4ed\\code\\4coder_clipboard.cpp", 32, 26 }, -{ PROC_LINKS(cursor_mark_swap, 0), "cursor_mark_swap", 16, "Swaps the position of the cursor and the mark.", 46, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 127 }, -{ PROC_LINKS(cut, 0), "cut", 3, "Cut the text in the range from the cursor to the mark onto the clipboard.", 73, "c:\\4ed\\code\\4coder_clipboard.cpp", 32, 35 }, -{ PROC_LINKS(decrease_face_size, 0), "decrease_face_size", 18, "Decrease the size of the face used by the current buffer.", 57, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 605 }, -{ PROC_LINKS(decrease_line_wrap, 0), "decrease_line_wrap", 18, "Decrases the current buffer's width for line wrapping.", 54, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 582 }, -{ PROC_LINKS(delete_char, 0), "delete_char", 11, "Deletes the character to the right of the cursor.", 49, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 81 }, -{ PROC_LINKS(delete_current_scope, 0), "delete_current_scope", 20, "Deletes the braces surrounding the currently selected scope. Leaves the contents within the scope.", 99, "c:\\4ed\\code\\4coder_scope_commands.cpp", 37, 512 }, -{ 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, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 1168 }, -{ PROC_LINKS(delete_line, 0), "delete_line", 11, "Delete the line the on which the cursor sits.", 45, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 1420 }, -{ PROC_LINKS(delete_range, 0), "delete_range", 12, "Deletes the text in the range between the cursor and the mark.", 62, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 137 }, -{ PROC_LINKS(delete_word, 0), "delete_word", 11, "Delete characters between the cursor position and the first alphanumeric boundary to the right.", 95, "c:\\4ed\\code\\4coder_seek.cpp", 27, 1264 }, -{ PROC_LINKS(duplicate_line, 0), "duplicate_line", 14, "Create a copy of the line on which the cursor sits.", 51, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 1398 }, -{ PROC_LINKS(eol_dosify, 0), "eol_dosify", 10, "Puts the buffer in DOS line ending mode.", 40, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 652 }, -{ PROC_LINKS(eol_nixify, 0), "eol_nixify", 10, "Puts the buffer in NIX line ending mode.", 40, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 660 }, -{ PROC_LINKS(execute_any_cli, 0), "execute_any_cli", 15, "Queries for an output buffer name and system command, runs the system command as a CLI and prints the output to the specified buffer.", 133, "c:\\4ed\\code\\4coder_system_command.cpp", 37, 23 }, -{ PROC_LINKS(execute_previous_cli, 0), "execute_previous_cli", 20, "If the command execute_any_cli has already been used, this will execute a CLI reusing the most recent buffer name and command.", 126, "c:\\4ed\\code\\4coder_system_command.cpp", 37, 7 }, -{ PROC_LINKS(exit_4coder, 0), "exit_4coder", 11, "Attempts to close 4coder.", 25, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 668 }, -{ PROC_LINKS(goto_beginning_of_file, 0), "goto_beginning_of_file", 22, "Sets the cursor to the beginning of the file.", 45, "c:\\4ed\\code\\4coder_seek.cpp", 27, 1177 }, -{ PROC_LINKS(goto_end_of_file, 0), "goto_end_of_file", 16, "Sets the cursor to the end of the file.", 39, "c:\\4ed\\code\\4coder_seek.cpp", 27, 1185 }, -{ PROC_LINKS(goto_first_jump_direct, 0), "goto_first_jump_direct", 22, "If a buffer containing jump locations has been locked in, goes to the first jump in the buffer.", 95, "c:\\4ed\\code\\4coder_jump_direct.cpp", 34, 84 }, -{ PROC_LINKS(goto_first_jump_same_panel_sticky, 0), "goto_first_jump_same_panel_sticky", 33, "If a buffer containing jump locations has been locked in, goes to the first jump in the buffer and views the buffer in the panel where the jump list was.", 153, "c:\\4ed\\code\\4coder_jump_sticky.cpp", 34, 551 }, -{ PROC_LINKS(goto_first_jump_sticky, 0), "goto_first_jump_sticky", 22, "If a buffer containing jump locations has been locked in, goes to the first jump in the buffer.", 95, "c:\\4ed\\code\\4coder_jump_sticky.cpp", 34, 533 }, -{ PROC_LINKS(goto_jump_at_cursor_direct, 0), "goto_jump_at_cursor_direct", 26, "If the cursor is found to be on a jump location, parses the jump location and brings up the file and position in another view and changes the active panel to the view containing the jump.", 187, "c:\\4ed\\code\\4coder_jump_direct.cpp", 34, 8 }, -{ PROC_LINKS(goto_jump_at_cursor_same_panel_direct, 0), "goto_jump_at_cursor_same_panel_direct", 37, "If the cursor is found to be on a jump location, parses the jump location and brings up the file and position in this view, losing the compilation output or jump list..", 168, "c:\\4ed\\code\\4coder_jump_direct.cpp", 34, 29 }, -{ PROC_LINKS(goto_jump_at_cursor_same_panel_sticky, 0), "goto_jump_at_cursor_same_panel_sticky", 37, "If the cursor is found to be on a jump location, parses the jump location and brings up the file and position in this view, losing the compilation output or jump list.", 167, "c:\\4ed\\code\\4coder_jump_sticky.cpp", 34, 377 }, -{ PROC_LINKS(goto_jump_at_cursor_sticky, 0), "goto_jump_at_cursor_sticky", 26, "If the cursor is found to be on a jump location, parses the jump location and brings up the file and position in another view and changes the active panel to the view containing the jump.", 187, "c:\\4ed\\code\\4coder_jump_sticky.cpp", 34, 349 }, -{ PROC_LINKS(goto_line, 0), "goto_line", 9, "Queries the user for a number, and jumps the cursor to the corresponding line.", 78, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 676 }, -{ PROC_LINKS(goto_next_jump_direct, 0), "goto_next_jump_direct", 21, "If a buffer containing jump locations has been locked in, goes to the next jump in the buffer, skipping sub jump locations.", 123, "c:\\4ed\\code\\4coder_jump_direct.cpp", 34, 48 }, -{ PROC_LINKS(goto_next_jump_no_skips_direct, 0), "goto_next_jump_no_skips_direct", 30, "If a buffer containing jump locations has been locked in, goes to the next jump in the buffer, and does not skip sub jump locations.", 132, "c:\\4ed\\code\\4coder_jump_direct.cpp", 34, 66 }, -{ PROC_LINKS(goto_next_jump_no_skips_sticky, 0), "goto_next_jump_no_skips_sticky", 30, "If a buffer containing jump locations has been locked in, goes to the next jump in the buffer, and does not skip sub jump locations.", 132, "c:\\4ed\\code\\4coder_jump_sticky.cpp", 34, 502 }, -{ PROC_LINKS(goto_next_jump_sticky, 0), "goto_next_jump_sticky", 21, "If a buffer containing jump locations has been locked in, goes to the next jump in the buffer, skipping sub jump locations.", 123, "c:\\4ed\\code\\4coder_jump_sticky.cpp", 34, 472 }, -{ PROC_LINKS(goto_prev_jump_direct, 0), "goto_prev_jump_direct", 21, "If a buffer containing jump locations has been locked in, goes to the previous jump in the buffer, skipping sub jump locations.", 127, "c:\\4ed\\code\\4coder_jump_direct.cpp", 34, 57 }, -{ PROC_LINKS(goto_prev_jump_no_skips_direct, 0), "goto_prev_jump_no_skips_direct", 30, "If a buffer containing jump locations has been locked in, goes to the previous jump in the buffer, and does not skip sub jump locations.", 136, "c:\\4ed\\code\\4coder_jump_direct.cpp", 34, 75 }, -{ PROC_LINKS(goto_prev_jump_no_skips_sticky, 0), "goto_prev_jump_no_skips_sticky", 30, "If a buffer containing jump locations has been locked in, goes to the previous jump in the buffer, and does not skip sub jump locations.", 136, "c:\\4ed\\code\\4coder_jump_sticky.cpp", 34, 518 }, -{ PROC_LINKS(goto_prev_jump_sticky, 0), "goto_prev_jump_sticky", 21, "If a buffer containing jump locations has been locked in, goes to the previous jump in the buffer, skipping sub jump locations.", 127, "c:\\4ed\\code\\4coder_jump_sticky.cpp", 34, 488 }, -{ PROC_LINKS(hide_filebar, 0), "hide_filebar", 12, "Sets the current view to hide it's filebar.", 43, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 545 }, -{ PROC_LINKS(hide_scrollbar, 0), "hide_scrollbar", 14, "Sets the current view to hide it's scrollbar.", 45, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 531 }, -{ PROC_LINKS(if0_off, 0), "if0_off", 7, "Surround the range between the cursor and mark with an '#if 0' and an '#endif'", 78, "c:\\4ed\\code\\4coder_combined_write_commands.cpp", 46, 79 }, -{ PROC_LINKS(increase_face_size, 0), "increase_face_size", 18, "Increase the size of the face used by the current buffer.", 57, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 593 }, -{ PROC_LINKS(increase_line_wrap, 0), "increase_line_wrap", 18, "Increases the current buffer's width for line wrapping.", 55, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 571 }, -{ PROC_LINKS(interactive_kill_buffer, 0), "interactive_kill_buffer", 23, "Interactively kill an open buffer.", 34, "c:\\4ed\\code\\4coder_lists.cpp", 28, 780 }, -{ PROC_LINKS(interactive_new, 0), "interactive_new", 15, "Interactively creates a new file.", 33, "c:\\4ed\\code\\4coder_lists.cpp", 28, 890 }, -{ PROC_LINKS(interactive_open, 0), "interactive_open", 16, "Interactively opens a file.", 27, "c:\\4ed\\code\\4coder_lists.cpp", 28, 922 }, -{ PROC_LINKS(interactive_open_or_new, 0), "interactive_open_or_new", 23, "Interactively open a file out of the file system.", 49, "c:\\4ed\\code\\4coder_lists.cpp", 28, 852 }, -{ PROC_LINKS(interactive_switch_buffer, 0), "interactive_switch_buffer", 25, "Interactively switch to an open buffer.", 39, "c:\\4ed\\code\\4coder_lists.cpp", 28, 761 }, -{ PROC_LINKS(kill_buffer, 0), "kill_buffer", 11, "Kills the current buffer.", 25, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 1590 }, -{ PROC_LINKS(left_adjust_view, 0), "left_adjust_view", 16, "Sets the left size of the view near the x position of the cursor.", 65, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 164 }, -{ PROC_LINKS(list_all_functions_all_buffers, 0), "list_all_functions_all_buffers", 30, "Creates a jump list of lines from all buffers that appear to define or declare functions.", 89, "c:\\4ed\\code\\4coder_function_list.cpp", 36, 332 }, -{ PROC_LINKS(list_all_functions_all_buffers_lister, 0), "list_all_functions_all_buffers_lister", 37, "Creates a lister of locations that look like function definitions and declarations all buffers.", 95, "c:\\4ed\\code\\4coder_function_list.cpp", 36, 338 }, -{ PROC_LINKS(list_all_functions_current_buffer, 0), "list_all_functions_current_buffer", 33, "Creates a jump list of lines of the current buffer that appear to define or declare functions.", 94, "c:\\4ed\\code\\4coder_function_list.cpp", 36, 309 }, -{ PROC_LINKS(list_all_functions_current_buffer_lister, 0), "list_all_functions_current_buffer_lister", 40, "Creates a lister of locations that look like function definitions and declarations in the buffer.", 97, "c:\\4ed\\code\\4coder_function_list.cpp", 36, 319 }, -{ PROC_LINKS(list_all_locations, 0), "list_all_locations", 18, "Queries the user for a string and lists all exact case-sensitive matches found in all open buffers.", 99, "c:\\4ed\\code\\4coder_search.cpp", 29, 780 }, -{ PROC_LINKS(list_all_locations_case_insensitive, 0), "list_all_locations_case_insensitive", 35, "Queries the user for a string and lists all exact case-insensitive matches found in all open buffers.", 101, "c:\\4ed\\code\\4coder_search.cpp", 29, 794 }, -{ PROC_LINKS(list_all_locations_of_identifier, 0), "list_all_locations_of_identifier", 32, "Reads a token or word under the cursor and lists all exact case-sensitive mathces in all open buffers.", 102, "c:\\4ed\\code\\4coder_search.cpp", 29, 808 }, -{ PROC_LINKS(list_all_locations_of_identifier_case_insensitive, 0), "list_all_locations_of_identifier_case_insensitive", 49, "Reads a token or word under the cursor and lists all exact case-insensitive mathces in all open buffers.", 104, "c:\\4ed\\code\\4coder_search.cpp", 29, 815 }, -{ PROC_LINKS(list_all_locations_of_selection, 0), "list_all_locations_of_selection", 31, "Reads the string in the selected range and lists all exact case-sensitive mathces in all open buffers.", 102, "c:\\4ed\\code\\4coder_search.cpp", 29, 822 }, -{ PROC_LINKS(list_all_locations_of_selection_case_insensitive, 0), "list_all_locations_of_selection_case_insensitive", 48, "Reads the string in the selected range and lists all exact case-insensitive mathces in all open buffers.", 104, "c:\\4ed\\code\\4coder_search.cpp", 29, 829 }, -{ PROC_LINKS(list_all_locations_of_type_definition, 0), "list_all_locations_of_type_definition", 37, "Queries user for string, lists all locations of strings that appear to define a type whose name matches the input string.", 121, "c:\\4ed\\code\\4coder_search.cpp", 29, 836 }, -{ PROC_LINKS(list_all_locations_of_type_definition_of_identifier, 0), "list_all_locations_of_type_definition_of_identifier", 51, "Reads a token or word under the cursor and lists all locations of strings that appear to define a type whose name matches it.", 125, "c:\\4ed\\code\\4coder_search.cpp", 29, 847 }, -{ PROC_LINKS(list_all_substring_locations, 0), "list_all_substring_locations", 28, "Queries the user for a string and lists all case-sensitive substring matches found in all open buffers.", 103, "c:\\4ed\\code\\4coder_search.cpp", 29, 787 }, -{ PROC_LINKS(list_all_substring_locations_case_insensitive, 0), "list_all_substring_locations_case_insensitive", 45, "Queries the user for a string and lists all case-insensitive substring matches found in all open buffers.", 105, "c:\\4ed\\code\\4coder_search.cpp", 29, 801 }, -{ PROC_LINKS(lister__activate, 0), "lister__activate", 16, "A lister mode command that activates the list's action on the highlighted item.", 79, "c:\\4ed\\code\\4coder_lists.cpp", 28, 15 }, -{ PROC_LINKS(lister__backspace_text_field, 0), "lister__backspace_text_field", 28, "A lister mode command that dispatches to the lister's backspace text field handler.", 83, "c:\\4ed\\code\\4coder_lists.cpp", 28, 41 }, -{ PROC_LINKS(lister__backspace_text_field__default, 0), "lister__backspace_text_field__default", 37, "A lister mode command that backspaces one character from the text field.", 72, "c:\\4ed\\code\\4coder_lists.cpp", 28, 146 }, -{ PROC_LINKS(lister__backspace_text_field__file_path, 0), "lister__backspace_text_field__file_path", 39, "A lister mode command that backspaces one character from the text field of a file system list.", 94, "c:\\4ed\\code\\4coder_lists.cpp", 28, 218 }, -{ PROC_LINKS(lister__mouse_press, 0), "lister__mouse_press", 19, "A lister mode command that beings a click interaction with a list item under the mouse.", 87, "c:\\4ed\\code\\4coder_lists.cpp", 28, 86 }, -{ PROC_LINKS(lister__mouse_release, 0), "lister__mouse_release", 21, "A lister mode command that ends a click interaction with a list item under the mouse, possibly activating it.", 109, "c:\\4ed\\code\\4coder_lists.cpp", 28, 98 }, -{ PROC_LINKS(lister__move_down, 0), "lister__move_down", 17, "A lister mode command that dispatches to the lister's navigate down handler.", 76, "c:\\4ed\\code\\4coder_lists.cpp", 28, 61 }, -{ PROC_LINKS(lister__move_down__default, 0), "lister__move_down__default", 26, "A lister mode command that moves the highlighted item one down in the list.", 75, "c:\\4ed\\code\\4coder_lists.cpp", 28, 177 }, -{ PROC_LINKS(lister__move_up, 0), "lister__move_up", 15, "A lister mode command that dispatches to the lister's navigate up handler.", 74, "c:\\4ed\\code\\4coder_lists.cpp", 28, 51 }, -{ PROC_LINKS(lister__move_up__default, 0), "lister__move_up__default", 24, "A lister mode command that moves the highlighted item one up in the list.", 73, "c:\\4ed\\code\\4coder_lists.cpp", 28, 161 }, -{ PROC_LINKS(lister__quit, 0), "lister__quit", 12, "A lister mode command that quits the list without executing any actions.", 72, "c:\\4ed\\code\\4coder_lists.cpp", 28, 8 }, -{ PROC_LINKS(lister__repaint, 0), "lister__repaint", 15, "A lister mode command that updates the lists UI data.", 53, "c:\\4ed\\code\\4coder_lists.cpp", 28, 115 }, -{ PROC_LINKS(lister__wheel_scroll, 0), "lister__wheel_scroll", 20, "A lister mode command that scrolls the list in response to the mouse wheel.", 75, "c:\\4ed\\code\\4coder_lists.cpp", 28, 71 }, -{ PROC_LINKS(lister__write_character, 0), "lister__write_character", 23, "A lister mode command that dispatches to the lister's write character handler.", 78, "c:\\4ed\\code\\4coder_lists.cpp", 28, 31 }, -{ PROC_LINKS(lister__write_character__default, 0), "lister__write_character__default", 32, "A lister mode command that inserts a new character to the text field.", 69, "c:\\4ed\\code\\4coder_lists.cpp", 28, 126 }, -{ PROC_LINKS(lister__write_character__file_path, 0), "lister__write_character__file_path", 34, "A lister mode command that inserts a character into the text field of a file system list.", 89, "c:\\4ed\\code\\4coder_lists.cpp", 28, 193 }, -{ PROC_LINKS(lister__write_character__fixed_list, 0), "lister__write_character__fixed_list", 35, "A lister mode command that handles input for the fixed sure to kill list.", 73, "c:\\4ed\\code\\4coder_lists.cpp", 28, 253 }, -{ PROC_LINKS(load_project, 0), "load_project", 12, "Looks for a project.4coder file in the current directory and tries to load it. Looks in parent directories until a project file is found or there are no more parents.", 167, "c:\\4ed\\code\\4coder_project_commands.cpp", 39, 1083 }, -{ 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, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 1278 }, -{ PROC_LINKS(mouse_wheel_change_face_size, 0), "mouse_wheel_change_face_size", 28, "Reads the state of the mouse wheel and uses it to either increase or decrease the face size.", 92, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 617 }, -{ PROC_LINKS(mouse_wheel_scroll, 0), "mouse_wheel_scroll", 18, "Reads the scroll wheel value from the mouse state and scrolls accordingly.", 74, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 257 }, -{ PROC_LINKS(move_down, 0), "move_down", 9, "Moves the cursor down one line.", 31, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 321 }, -{ PROC_LINKS(move_down_10, 0), "move_down_10", 12, "Moves the cursor down ten lines.", 32, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 333 }, -{ PROC_LINKS(move_down_textual, 0), "move_down_textual", 17, "Moves down to the next line of actual text, regardless of line wrapping.", 72, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 339 }, -{ PROC_LINKS(move_left, 0), "move_left", 9, "Moves the cursor one character to the left.", 43, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 370 }, -{ 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, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 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, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 1311 }, -{ PROC_LINKS(move_right, 0), "move_right", 10, "Moves the cursor one character to the right.", 44, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 380 }, -{ PROC_LINKS(move_up, 0), "move_up", 7, "Moves the cursor up one line.", 29, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 315 }, -{ PROC_LINKS(move_up_10, 0), "move_up_10", 10, "Moves the cursor up ten lines.", 30, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 327 }, -{ PROC_LINKS(newline_or_goto_position_direct, 0), "newline_or_goto_position_direct", 31, "If the buffer in the active view is writable, inserts a character, otherwise performs goto_jump_at_cursor.", 106, "c:\\4ed\\code\\4coder_jump_direct.cpp", 34, 101 }, -{ PROC_LINKS(newline_or_goto_position_same_panel_direct, 0), "newline_or_goto_position_same_panel_direct", 42, "If the buffer in the active view is writable, inserts a character, otherwise performs goto_jump_at_cursor_same_panel.", 117, "c:\\4ed\\code\\4coder_jump_direct.cpp", 34, 116 }, -{ PROC_LINKS(newline_or_goto_position_same_panel_sticky, 0), "newline_or_goto_position_same_panel_sticky", 42, "If the buffer in the active view is writable, inserts a character, otherwise performs goto_jump_at_cursor_same_panel.", 117, "c:\\4ed\\code\\4coder_jump_sticky.cpp", 34, 588 }, -{ PROC_LINKS(newline_or_goto_position_sticky, 0), "newline_or_goto_position_sticky", 31, "If the buffer in the active view is writable, inserts a character, otherwise performs goto_jump_at_cursor.", 106, "c:\\4ed\\code\\4coder_jump_sticky.cpp", 34, 574 }, -{ PROC_LINKS(open_all_code, 0), "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, "c:\\4ed\\code\\4coder_project_commands.cpp", 39, 1067 }, -{ PROC_LINKS(open_all_code_recursive, 0), "open_all_code_recursive", 23, "Works as open_all_code but also runs in all subdirectories.", 59, "c:\\4ed\\code\\4coder_project_commands.cpp", 39, 1074 }, -{ PROC_LINKS(open_color_tweaker, 0), "open_color_tweaker", 18, "Opens the 4coder theme selector list.", 37, "c:\\4ed\\code\\4coder_lists.cpp", 28, 938 }, -{ 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, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 1497 }, -{ PROC_LINKS(open_in_other, 0), "open_in_other", 13, "Interactively opens a file in the other panel.", 46, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 1801 }, -{ PROC_LINKS(open_long_braces, 0), "open_long_braces", 16, "At the cursor, insert a '{' and '}' separated by a blank line.", 62, "c:\\4ed\\code\\4coder_combined_write_commands.cpp", 46, 55 }, -{ PROC_LINKS(open_long_braces_break, 0), "open_long_braces_break", 22, "At the cursor, insert a '{' and '}break;' separated by a blank line.", 68, "c:\\4ed\\code\\4coder_combined_write_commands.cpp", 46, 71 }, -{ PROC_LINKS(open_long_braces_semicolon, 0), "open_long_braces_semicolon", 26, "At the cursor, insert a '{' and '};' separated by a blank line.", 63, "c:\\4ed\\code\\4coder_combined_write_commands.cpp", 46, 63 }, -{ 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, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 1533 }, -{ PROC_LINKS(open_panel_hsplit, 0), "open_panel_hsplit", 17, "Create a new panel by horizontally splitting the active panel.", 62, "c:\\4ed\\code\\4coder_default_framework.cpp", 40, 173 }, -{ PROC_LINKS(open_panel_vsplit, 0), "open_panel_vsplit", 17, "Create a new panel by vertically splitting the active panel.", 60, "c:\\4ed\\code\\4coder_default_framework.cpp", 40, 164 }, -{ PROC_LINKS(page_down, 0), "page_down", 9, "Scrolls the view down one view height and moves the cursor down one view height.", 80, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 359 }, -{ PROC_LINKS(page_up, 0), "page_up", 7, "Scrolls the view up one view height and moves the cursor up one view height.", 76, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 350 }, -{ PROC_LINKS(paste, 0), "paste", 5, "At the cursor, insert the text at the top of the clipboard.", 59, "c:\\4ed\\code\\4coder_clipboard.cpp", 32, 46 }, -{ PROC_LINKS(paste_and_indent, 0), "paste_and_indent", 16, "Paste from the top of clipboard and run auto-indent on the newly pasted text.", 77, "c:\\4ed\\code\\4coder_clipboard.cpp", 32, 134 }, -{ PROC_LINKS(paste_next, 0), "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, "c:\\4ed\\code\\4coder_clipboard.cpp", 32, 85 }, -{ PROC_LINKS(paste_next_and_indent, 0), "paste_next_and_indent", 21, "Paste the next item on the clipboard and run auto-indent on the newly pasted text.", 82, "c:\\4ed\\code\\4coder_clipboard.cpp", 32, 141 }, -{ PROC_LINKS(place_in_scope, 0), "place_in_scope", 14, "Wraps the code contained in the range between cursor and mark with a new curly brace scope.", 91, "c:\\4ed\\code\\4coder_scope_commands.cpp", 37, 506 }, -{ PROC_LINKS(project_command_lister, 0), "project_command_lister", 22, "Open a lister of all commands in the currently loaded project.", 62, "c:\\4ed\\code\\4coder_project_commands.cpp", 39, 1527 }, -{ PROC_LINKS(project_fkey_command, 0), "project_fkey_command", 20, "Run an 'fkey command' configured in a project.4coder file. Determines the index of the 'fkey command' by which function key or numeric key was pressed to trigger the command.", 175, "c:\\4ed\\code\\4coder_project_commands.cpp", 39, 1090 }, -{ PROC_LINKS(project_go_to_root_directory, 0), "project_go_to_root_directory", 28, "Changes 4coder's hot directory to the root directory of the currently loaded project. With no loaded project nothing hapepns.", 125, "c:\\4ed\\code\\4coder_project_commands.cpp", 39, 1113 }, -{ 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, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 1052 }, -{ 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, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 1076 }, -{ 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, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 1094 }, -{ PROC_LINKS(redo, 0), "redo", 4, "Advances forward through the undo history in the buffer containing the most recent regular edit.", 96, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 1706 }, -{ PROC_LINKS(redo_this_buffer, 0), "redo_this_buffer", 16, "Advances forwards through the undo history of the current buffer.", 65, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 1626 }, -{ PROC_LINKS(reload_themes, 0), "reload_themes", 13, "Loads all the theme files in the theme folder, replacing duplicates with the new theme data.", 92, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 1778 }, -{ PROC_LINKS(remap_interactive, 0), "remap_interactive", 17, "Switch to a named key binding map.", 34, "c:\\4ed\\code\\4coder_default_framework.cpp", 40, 292 }, -{ 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, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 1234 }, -{ PROC_LINKS(reopen, 0), "reopen", 6, "Reopen the current buffer from the hard drive.", 46, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 1605 }, -{ PROC_LINKS(replace_in_range, 0), "replace_in_range", 16, "Queries the user for two strings, and replaces all occurences of the first string in the range between the cursor and the mark with the second string.", 150, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 931 }, -{ PROC_LINKS(reverse_search, 0), "reverse_search", 14, "Begins an incremental search up through the current buffer for a user specified string.", 87, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 902 }, -{ 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, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 920 }, -{ PROC_LINKS(save, 0), "save", 4, "Saves the current buffer.", 25, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 1597 }, -{ PROC_LINKS(save_all_dirty_buffers, 0), "save_all_dirty_buffers", 22, "Saves all buffers marked dirty (showing the '*' indicator).", 59, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 1138 }, -{ 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, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 1194 }, -{ PROC_LINKS(scope_absorb_down, 0), "scope_absorb_down", 17, "If a scope is currently selected, and a statement or block statement is present below the current scope, the statement is moved into the scope.", 143, "c:\\4ed\\code\\4coder_scope_commands.cpp", 37, 747 }, -{ PROC_LINKS(search, 0), "search", 6, "Begins an incremental search down through the current buffer for a user specified string.", 89, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 895 }, -{ 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, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 909 }, -{ PROC_LINKS(seek_alphanumeric_left, 0), "seek_alphanumeric_left", 22, "Seek left for boundary between alphanumeric characters and non-alphanumeric characters.", 87, "c:\\4ed\\code\\4coder_seek.cpp", 27, 1238 }, -{ PROC_LINKS(seek_alphanumeric_or_camel_left, 0), "seek_alphanumeric_or_camel_left", 31, "Seek left for boundary between alphanumeric characters or camel case word and non-alphanumeric characters.", 106, "c:\\4ed\\code\\4coder_seek.cpp", 27, 1250 }, -{ PROC_LINKS(seek_alphanumeric_or_camel_right, 0), "seek_alphanumeric_or_camel_right", 32, "Seek right for boundary between alphanumeric characters or camel case word and non-alphanumeric characters.", 107, "c:\\4ed\\code\\4coder_seek.cpp", 27, 1244 }, -{ PROC_LINKS(seek_alphanumeric_right, 0), "seek_alphanumeric_right", 23, "Seek right for boundary between alphanumeric characters and non-alphanumeric characters.", 88, "c:\\4ed\\code\\4coder_seek.cpp", 27, 1232 }, -{ PROC_LINKS(seek_beginning_of_line, 0), "seek_beginning_of_line", 22, "Seeks the cursor to the beginning of the visual line.", 53, "c:\\4ed\\code\\4coder_seek.cpp", 27, 1131 }, -{ 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, "c:\\4ed\\code\\4coder_seek.cpp", 27, 1111 }, -{ PROC_LINKS(seek_end_of_line, 0), "seek_end_of_line", 16, "Seeks the cursor to the end of the visual line.", 47, "c:\\4ed\\code\\4coder_seek.cpp", 27, 1143 }, -{ 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, "c:\\4ed\\code\\4coder_seek.cpp", 27, 1121 }, -{ PROC_LINKS(seek_token_left, 0), "seek_token_left", 15, "Seek left for the next beginning of a token.", 44, "c:\\4ed\\code\\4coder_seek.cpp", 27, 1214 }, -{ PROC_LINKS(seek_token_right, 0), "seek_token_right", 16, "Seek right for the next end of a token.", 39, "c:\\4ed\\code\\4coder_seek.cpp", 27, 1208 }, -{ PROC_LINKS(seek_white_or_token_left, 0), "seek_white_or_token_left", 24, "Seek left for the next end of a token or boundary between whitespace and non-whitespace.", 88, "c:\\4ed\\code\\4coder_seek.cpp", 27, 1226 }, -{ PROC_LINKS(seek_white_or_token_right, 0), "seek_white_or_token_right", 25, "Seek right for the next end of a token or boundary between whitespace and non-whitespace.", 89, "c:\\4ed\\code\\4coder_seek.cpp", 27, 1220 }, -{ PROC_LINKS(seek_whitespace_down, 0), "seek_whitespace_down", 20, "Seeks the cursor down to the next blank line.", 45, "c:\\4ed\\code\\4coder_seek.cpp", 27, 1101 }, -{ PROC_LINKS(seek_whitespace_down_end_line, 0), "seek_whitespace_down_end_line", 29, "Seeks the cursor down to the next blank line and places it at the end of the line.", 82, "c:\\4ed\\code\\4coder_seek.cpp", 27, 1166 }, -{ PROC_LINKS(seek_whitespace_left, 0), "seek_whitespace_left", 20, "Seek left for the next boundary between whitespace and non-whitespace.", 70, "c:\\4ed\\code\\4coder_seek.cpp", 27, 1202 }, -{ PROC_LINKS(seek_whitespace_right, 0), "seek_whitespace_right", 21, "Seek right for the next boundary between whitespace and non-whitespace.", 71, "c:\\4ed\\code\\4coder_seek.cpp", 27, 1196 }, -{ PROC_LINKS(seek_whitespace_up, 0), "seek_whitespace_up", 18, "Seeks the cursor up to the next blank line.", 43, "c:\\4ed\\code\\4coder_seek.cpp", 27, 1091 }, -{ PROC_LINKS(seek_whitespace_up_end_line, 0), "seek_whitespace_up_end_line", 27, "Seeks the cursor up to the next blank line and places it at the end of the line.", 80, "c:\\4ed\\code\\4coder_seek.cpp", 27, 1155 }, -{ PROC_LINKS(select_all, 0), "select_all", 10, "Puts the cursor at the top of the file, and the mark at the bottom of the file.", 79, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 390 }, -{ PROC_LINKS(select_next_scope_absolute, 0), "select_next_scope_absolute", 26, "Finds the first scope started by '{' after the cursor and puts the cursor and mark on the '{' and '}'.", 102, "c:\\4ed\\code\\4coder_scope_commands.cpp", 37, 387 }, -{ PROC_LINKS(select_prev_scope_absolute, 0), "select_prev_scope_absolute", 26, "Finds the first scope started by '{' before the cursor and puts the cursor and mark on the '{' and '}'.", 103, "c:\\4ed\\code\\4coder_scope_commands.cpp", 37, 407 }, -{ PROC_LINKS(select_surrounding_scope, 0), "select_surrounding_scope", 24, "Finds the scope enclosed by '{' '}' surrounding the cursor and puts the cursor and mark on the '{' and '}'.", 107, "c:\\4ed\\code\\4coder_scope_commands.cpp", 37, 371 }, -{ PROC_LINKS(set_bindings_choose, 0), "set_bindings_choose", 19, "Remap keybindings using the 'choose' mapping rule.", 50, "c:\\4ed\\code\\4coder_remapping_commands.cpp", 41, 47 }, -{ PROC_LINKS(set_bindings_default, 0), "set_bindings_default", 20, "Remap keybindings using the 'default' mapping rule.", 51, "c:\\4ed\\code\\4coder_remapping_commands.cpp", 41, 61 }, -{ PROC_LINKS(set_bindings_mac_default, 0), "set_bindings_mac_default", 24, "Remap keybindings using the 'mac-default' mapping rule.", 55, "c:\\4ed\\code\\4coder_remapping_commands.cpp", 41, 75 }, -{ PROC_LINKS(set_mark, 0), "set_mark", 8, "Sets the mark to the current position of the cursor.", 52, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 119 }, -{ PROC_LINKS(set_mode_to_notepad_like, 0), "set_mode_to_notepad_like", 24, "Sets the edit mode to Notepad like.", 35, "c:\\4ed\\code\\4coder_default_framework.cpp", 40, 260 }, -{ PROC_LINKS(set_mode_to_original, 0), "set_mode_to_original", 20, "Sets the edit mode to 4coder original.", 38, "c:\\4ed\\code\\4coder_default_framework.cpp", 40, 254 }, -{ PROC_LINKS(setup_build_bat, 0), "setup_build_bat", 15, "Queries the user for several configuration options and initializes a new build batch script.", 92, "c:\\4ed\\code\\4coder_project_commands.cpp", 39, 1498 }, -{ PROC_LINKS(setup_build_bat_and_sh, 0), "setup_build_bat_and_sh", 22, "Queries the user for several configuration options and initializes a new build batch script.", 92, "c:\\4ed\\code\\4coder_project_commands.cpp", 39, 1510 }, -{ PROC_LINKS(setup_build_sh, 0), "setup_build_sh", 14, "Queries the user for several configuration options and initializes a new build shell script.", 92, "c:\\4ed\\code\\4coder_project_commands.cpp", 39, 1504 }, -{ PROC_LINKS(setup_new_project, 0), "setup_new_project", 17, "Queries the user for several configuration options and initializes a new 4coder project with build scripts for every OS.", 120, "c:\\4ed\\code\\4coder_project_commands.cpp", 39, 1491 }, -{ PROC_LINKS(show_filebar, 0), "show_filebar", 12, "Sets the current view to show it's filebar.", 43, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 538 }, -{ PROC_LINKS(show_scrollbar, 0), "show_scrollbar", 14, "Sets the current view to show it's scrollbar.", 45, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 524 }, -{ PROC_LINKS(snipe_token_or_word, 0), "snipe_token_or_word", 19, "Delete a single, whole token on or to the left of the cursor and post it to the clipboard.", 90, "c:\\4ed\\code\\4coder_seek.cpp", 27, 1270 }, -{ PROC_LINKS(snipe_token_or_word_right, 0), "snipe_token_or_word_right", 25, "Delete a single, whole token on or to the right of the cursor and post it to the clipboard.", 91, "c:\\4ed\\code\\4coder_seek.cpp", 27, 1276 }, -{ PROC_LINKS(snippet_lister, 0), "snippet_lister", 14, "Opens a snippet lister for inserting whole pre-written snippets of text.", 72, "c:\\4ed\\code\\4coder_combined_write_commands.cpp", 46, 248 }, -{ PROC_LINKS(suppress_mouse, 0), "suppress_mouse", 14, "Hides the mouse and causes all mosue input (clicks, position, wheel) to be ignored.", 83, "c:\\4ed\\code\\4coder_default_framework.cpp", 40, 236 }, -{ 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, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 1557 }, -{ PROC_LINKS(to_lowercase, 0), "to_lowercase", 12, "Converts all ascii text in the range between the cursor and the mark to lowercase.", 82, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 422 }, -{ PROC_LINKS(to_uppercase, 0), "to_uppercase", 12, "Converts all ascii text in the range between the cursor and the mark to uppercase.", 82, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 402 }, -{ PROC_LINKS(toggle_filebar, 0), "toggle_filebar", 14, "Toggles the visibility status of the current view's filebar.", 60, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 552 }, -{ 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, "c:\\4ed\\code\\4coder_default_framework.cpp", 40, 284 }, -{ 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, "c:\\4ed\\code\\4coder_default_framework.cpp", 40, 272 }, -{ PROC_LINKS(toggle_highlight_line_at_cursor, 0), "toggle_highlight_line_at_cursor", 31, "Toggles the line highlight at the cursor.", 41, "c:\\4ed\\code\\4coder_default_framework.cpp", 40, 266 }, -{ PROC_LINKS(toggle_line_wrap, 0), "toggle_line_wrap", 16, "Toggles the current buffer's line wrapping status.", 50, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 561 }, -{ PROC_LINKS(toggle_mouse, 0), "toggle_mouse", 12, "Toggles the mouse suppression mode, see suppress_mouse and allow_mouse.", 71, "c:\\4ed\\code\\4coder_default_framework.cpp", 40, 248 }, -{ PROC_LINKS(toggle_paren_matching_helper, 0), "toggle_paren_matching_helper", 28, "In code files matching parentheses pairs are colored with distinguishing colors.", 80, "c:\\4ed\\code\\4coder_default_framework.cpp", 40, 278 }, -{ PROC_LINKS(toggle_show_whitespace, 0), "toggle_show_whitespace", 22, "Toggles the current buffer's whitespace visibility status.", 58, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 645 }, -{ PROC_LINKS(toggle_virtual_whitespace, 0), "toggle_virtual_whitespace", 25, "Toggles the current buffer's virtual whitespace status.", 55, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 634 }, -{ PROC_LINKS(uncomment_line, 0), "uncomment_line", 14, "If present, delete '//' at the beginning of the line after leading whitespace.", 78, "c:\\4ed\\code\\4coder_combined_write_commands.cpp", 46, 147 }, -{ PROC_LINKS(undo, 0), "undo", 4, "Advances backward through the undo history in the buffer containing the most recent regular edit.", 97, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 1638 }, -{ PROC_LINKS(undo_this_buffer, 0), "undo_this_buffer", 16, "Advances backwards through the undo history of the current buffer.", 66, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 1615 }, -{ 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, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 1547 }, -{ PROC_LINKS(view_jump_list_with_lister, 0), "view_jump_list_with_lister", 26, "When executed on a buffer with jumps, creates a persistent lister for all the jumps", 83, "c:\\4ed\\code\\4coder_jump_lister.cpp", 34, 108 }, -{ PROC_LINKS(word_complete, 0), "word_complete", 13, "Iteratively tries completing the word to the left of the cursor with other words in open buffers that have the same prefix string.", 130, "c:\\4ed\\code\\4coder_search.cpp", 29, 867 }, -{ PROC_LINKS(write_and_auto_tab, 0), "write_and_auto_tab", 18, "Inserts a character and auto-indents the line on which the cursor sits.", 71, "c:\\4ed\\code\\4coder_auto_indent.cpp", 34, 744 }, -{ PROC_LINKS(write_block, 0), "write_block", 11, "At the cursor, insert a block comment.", 38, "c:\\4ed\\code\\4coder_combined_write_commands.cpp", 46, 103 }, -{ PROC_LINKS(write_character, 0), "write_character", 15, "Inserts whatever character was used to trigger this command.", 60, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 65 }, -{ PROC_LINKS(write_hack, 0), "write_hack", 10, "At the cursor, insert a '// HACK' comment, includes user name if it was specified in config.4coder.", 99, "c:\\4ed\\code\\4coder_combined_write_commands.cpp", 46, 91 }, -{ PROC_LINKS(write_note, 0), "write_note", 10, "At the cursor, insert a '// NOTE' comment, includes user name if it was specified in config.4coder.", 99, "c:\\4ed\\code\\4coder_combined_write_commands.cpp", 46, 97 }, -{ PROC_LINKS(write_todo, 0), "write_todo", 10, "At the cursor, insert a '// TODO' comment, includes user name if it was specified in config.4coder.", 99, "c:\\4ed\\code\\4coder_combined_write_commands.cpp", 46, 85 }, -{ PROC_LINKS(write_underscore, 0), "write_underscore", 16, "Inserts an underscore.", 22, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 74 }, -{ PROC_LINKS(write_zero_struct, 0), "write_zero_struct", 17, "At the cursor, insert a ' = {};'.", 33, "c:\\4ed\\code\\4coder_combined_write_commands.cpp", 46, 109 }, +{ PROC_LINKS(allow_mouse, 0), "allow_mouse", 11, "Shows the mouse and causes all mouse input to be processed normally.", 68, "w:\\4ed\\code\\4coder_default_framework.cpp", 40, 242 }, +{ PROC_LINKS(auto_tab_line_at_cursor, 0), "auto_tab_line_at_cursor", 23, "Auto-indents the line on which the cursor sits.", 47, "w:\\4ed\\code\\4coder_auto_indent.cpp", 34, 721 }, +{ PROC_LINKS(auto_tab_range, 0), "auto_tab_range", 14, "Auto-indents the range between the cursor and the mark.", 55, "w:\\4ed\\code\\4coder_auto_indent.cpp", 34, 732 }, +{ PROC_LINKS(auto_tab_whole_file, 0), "auto_tab_whole_file", 19, "Audo-indents the entire current buffer.", 39, "w:\\4ed\\code\\4coder_auto_indent.cpp", 34, 711 }, +{ PROC_LINKS(backspace_char, 0), "backspace_char", 14, "Deletes the character to the left of the cursor.", 48, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 101 }, +{ PROC_LINKS(backspace_word, 0), "backspace_word", 14, "Delete characters between the cursor position and the first alphanumeric boundary to the left.", 94, "w:\\4ed\\code\\4coder_seek.cpp", 27, 1258 }, +{ PROC_LINKS(basic_change_active_panel, 0), "basic_change_active_panel", 25, "Change the currently active panel, moving to the panel with the next highest view_id. Will not skipe the build panel if it is open.", 132, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 509 }, +{ PROC_LINKS(build_in_build_panel, 0), "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\\4coder_build_commands.cpp", 37, 187 }, +{ PROC_LINKS(build_search, 0), "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\\4coder_build_commands.cpp", 37, 155 }, +{ PROC_LINKS(center_view, 0), "center_view", 11, "Centers the view vertically on the line on which the cursor sits.", 65, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 151 }, +{ 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\\4coder_default_framework.cpp", 40, 144 }, +{ 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\\4coder_default_framework.cpp", 40, 154 }, +{ PROC_LINKS(change_to_build_panel, 0), "change_to_build_panel", 21, "If the special build panel is open, makes the build panel the active panel.", 75, "w:\\4ed\\code\\4coder_build_commands.cpp", 37, 209 }, +{ PROC_LINKS(clean_all_lines, 0), "clean_all_lines", 15, "Removes trailing whitespace from all lines in the current buffer.", 65, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 444 }, +{ PROC_LINKS(click_set_cursor, 0), "click_set_cursor", 16, "Sets the cursor position to the mouse position.", 47, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 218 }, +{ PROC_LINKS(click_set_cursor_and_mark, 0), "click_set_cursor_and_mark", 25, "Sets the cursor position and mark to the mouse position.", 56, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 205 }, +{ PROC_LINKS(click_set_cursor_if_lbutton, 0), "click_set_cursor_if_lbutton", 27, "If the mouse left button is pressed, sets the cursor position to the mouse position.", 84, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 231 }, +{ PROC_LINKS(click_set_mark, 0), "click_set_mark", 14, "Sets the mark position to the mouse position.", 45, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 246 }, +{ PROC_LINKS(close_all_code, 0), "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\\4coder_project_commands.cpp", 39, 1060 }, +{ PROC_LINKS(close_build_panel, 0), "close_build_panel", 17, "If the special build panel is open, closes it.", 46, "w:\\4ed\\code\\4coder_build_commands.cpp", 37, 203 }, +{ PROC_LINKS(close_panel, 0), "close_panel", 11, "Closes the currently active panel if it is not the only panel open.", 67, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 517 }, +{ PROC_LINKS(command_lister, 0), "command_lister", 14, "Opens an interactive list of all registered commands.", 53, "w:\\4ed\\code\\4coder_lists.cpp", 28, 977 }, +{ PROC_LINKS(comment_line, 0), "comment_line", 12, "Insert '//' at the beginning of the line after leading whitespace.", 66, "w:\\4ed\\code\\4coder_combined_write_commands.cpp", 46, 135 }, +{ PROC_LINKS(comment_line_toggle, 0), "comment_line_toggle", 19, "Turns uncommented lines into commented lines and vice versa for comments starting with '//'.", 92, "w:\\4ed\\code\\4coder_combined_write_commands.cpp", 46, 159 }, +{ 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\\4coder_clipboard.cpp", 32, 26 }, +{ PROC_LINKS(cursor_mark_swap, 0), "cursor_mark_swap", 16, "Swaps the position of the cursor and the mark.", 46, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 129 }, +{ 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\\4coder_clipboard.cpp", 32, 35 }, +{ PROC_LINKS(decrease_face_size, 0), "decrease_face_size", 18, "Decrease the size of the face used by the current buffer.", 57, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 607 }, +{ PROC_LINKS(decrease_line_wrap, 0), "decrease_line_wrap", 18, "Decrases the current buffer's width for line wrapping.", 54, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 584 }, +{ PROC_LINKS(delete_char, 0), "delete_char", 11, "Deletes the character to the right of the cursor.", 49, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 83 }, +{ PROC_LINKS(delete_current_scope, 0), "delete_current_scope", 20, "Deletes the braces surrounding the currently selected scope. Leaves the contents within the scope.", 99, "w:\\4ed\\code\\4coder_scope_commands.cpp", 37, 512 }, +{ 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\\4coder_base_commands.cpp", 36, 1170 }, +{ PROC_LINKS(delete_line, 0), "delete_line", 11, "Delete the line the on which the cursor sits.", 45, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1422 }, +{ PROC_LINKS(delete_range, 0), "delete_range", 12, "Deletes the text in the range between the cursor and the mark.", 62, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 139 }, +{ PROC_LINKS(delete_word, 0), "delete_word", 11, "Delete characters between the cursor position and the first alphanumeric boundary to the right.", 95, "w:\\4ed\\code\\4coder_seek.cpp", 27, 1264 }, +{ PROC_LINKS(duplicate_line, 0), "duplicate_line", 14, "Create a copy of the line on which the cursor sits.", 51, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1400 }, +{ PROC_LINKS(eol_dosify, 0), "eol_dosify", 10, "Puts the buffer in DOS line ending mode.", 40, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 654 }, +{ PROC_LINKS(eol_nixify, 0), "eol_nixify", 10, "Puts the buffer in NIX line ending mode.", 40, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 662 }, +{ PROC_LINKS(execute_any_cli, 0), "execute_any_cli", 15, "Queries for an output buffer name and system command, runs the system command as a CLI and prints the output to the specified buffer.", 133, "w:\\4ed\\code\\4coder_system_command.cpp", 37, 23 }, +{ PROC_LINKS(execute_previous_cli, 0), "execute_previous_cli", 20, "If the command execute_any_cli has already been used, this will execute a CLI reusing the most recent buffer name and command.", 126, "w:\\4ed\\code\\4coder_system_command.cpp", 37, 7 }, +{ PROC_LINKS(exit_4coder, 0), "exit_4coder", 11, "Attempts to close 4coder.", 25, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 670 }, +{ 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\\4coder_seek.cpp", 27, 1177 }, +{ 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\\4coder_seek.cpp", 27, 1185 }, +{ PROC_LINKS(goto_first_jump_direct, 0), "goto_first_jump_direct", 22, "If a buffer containing jump locations has been locked in, goes to the first jump in the buffer.", 95, "w:\\4ed\\code\\4coder_jump_direct.cpp", 34, 84 }, +{ PROC_LINKS(goto_first_jump_same_panel_sticky, 0), "goto_first_jump_same_panel_sticky", 33, "If a buffer containing jump locations has been locked in, goes to the first jump in the buffer and views the buffer in the panel where the jump list was.", 153, "w:\\4ed\\code\\4coder_jump_sticky.cpp", 34, 551 }, +{ PROC_LINKS(goto_first_jump_sticky, 0), "goto_first_jump_sticky", 22, "If a buffer containing jump locations has been locked in, goes to the first jump in the buffer.", 95, "w:\\4ed\\code\\4coder_jump_sticky.cpp", 34, 533 }, +{ PROC_LINKS(goto_jump_at_cursor_direct, 0), "goto_jump_at_cursor_direct", 26, "If the cursor is found to be on a jump location, parses the jump location and brings up the file and position in another view and changes the active panel to the view containing the jump.", 187, "w:\\4ed\\code\\4coder_jump_direct.cpp", 34, 8 }, +{ PROC_LINKS(goto_jump_at_cursor_same_panel_direct, 0), "goto_jump_at_cursor_same_panel_direct", 37, "If the cursor is found to be on a jump location, parses the jump location and brings up the file and position in this view, losing the compilation output or jump list..", 168, "w:\\4ed\\code\\4coder_jump_direct.cpp", 34, 29 }, +{ PROC_LINKS(goto_jump_at_cursor_same_panel_sticky, 0), "goto_jump_at_cursor_same_panel_sticky", 37, "If the cursor is found to be on a jump location, parses the jump location and brings up the file and position in this view, losing the compilation output or jump list.", 167, "w:\\4ed\\code\\4coder_jump_sticky.cpp", 34, 377 }, +{ PROC_LINKS(goto_jump_at_cursor_sticky, 0), "goto_jump_at_cursor_sticky", 26, "If the cursor is found to be on a jump location, parses the jump location and brings up the file and position in another view and changes the active panel to the view containing the jump.", 187, "w:\\4ed\\code\\4coder_jump_sticky.cpp", 34, 349 }, +{ 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\\4coder_base_commands.cpp", 36, 678 }, +{ PROC_LINKS(goto_next_jump_direct, 0), "goto_next_jump_direct", 21, "If a buffer containing jump locations has been locked in, goes to the next jump in the buffer, skipping sub jump locations.", 123, "w:\\4ed\\code\\4coder_jump_direct.cpp", 34, 48 }, +{ PROC_LINKS(goto_next_jump_no_skips_direct, 0), "goto_next_jump_no_skips_direct", 30, "If a buffer containing jump locations has been locked in, goes to the next jump in the buffer, and does not skip sub jump locations.", 132, "w:\\4ed\\code\\4coder_jump_direct.cpp", 34, 66 }, +{ PROC_LINKS(goto_next_jump_no_skips_sticky, 0), "goto_next_jump_no_skips_sticky", 30, "If a buffer containing jump locations has been locked in, goes to the next jump in the buffer, and does not skip sub jump locations.", 132, "w:\\4ed\\code\\4coder_jump_sticky.cpp", 34, 502 }, +{ PROC_LINKS(goto_next_jump_sticky, 0), "goto_next_jump_sticky", 21, "If a buffer containing jump locations has been locked in, goes to the next jump in the buffer, skipping sub jump locations.", 123, "w:\\4ed\\code\\4coder_jump_sticky.cpp", 34, 472 }, +{ PROC_LINKS(goto_prev_jump_direct, 0), "goto_prev_jump_direct", 21, "If a buffer containing jump locations has been locked in, goes to the previous jump in the buffer, skipping sub jump locations.", 127, "w:\\4ed\\code\\4coder_jump_direct.cpp", 34, 57 }, +{ PROC_LINKS(goto_prev_jump_no_skips_direct, 0), "goto_prev_jump_no_skips_direct", 30, "If a buffer containing jump locations has been locked in, goes to the previous jump in the buffer, and does not skip sub jump locations.", 136, "w:\\4ed\\code\\4coder_jump_direct.cpp", 34, 75 }, +{ PROC_LINKS(goto_prev_jump_no_skips_sticky, 0), "goto_prev_jump_no_skips_sticky", 30, "If a buffer containing jump locations has been locked in, goes to the previous jump in the buffer, and does not skip sub jump locations.", 136, "w:\\4ed\\code\\4coder_jump_sticky.cpp", 34, 518 }, +{ PROC_LINKS(goto_prev_jump_sticky, 0), "goto_prev_jump_sticky", 21, "If a buffer containing jump locations has been locked in, goes to the previous jump in the buffer, skipping sub jump locations.", 127, "w:\\4ed\\code\\4coder_jump_sticky.cpp", 34, 488 }, +{ PROC_LINKS(hide_filebar, 0), "hide_filebar", 12, "Sets the current view to hide it's filebar.", 43, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 547 }, +{ PROC_LINKS(hide_scrollbar, 0), "hide_scrollbar", 14, "Sets the current view to hide it's scrollbar.", 45, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 533 }, +{ PROC_LINKS(if0_off, 0), "if0_off", 7, "Surround the range between the cursor and mark with an '#if 0' and an '#endif'", 78, "w:\\4ed\\code\\4coder_combined_write_commands.cpp", 46, 79 }, +{ PROC_LINKS(increase_face_size, 0), "increase_face_size", 18, "Increase the size of the face used by the current buffer.", 57, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 595 }, +{ PROC_LINKS(increase_line_wrap, 0), "increase_line_wrap", 18, "Increases the current buffer's width for line wrapping.", 55, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 573 }, +{ PROC_LINKS(interactive_kill_buffer, 0), "interactive_kill_buffer", 23, "Interactively kill an open buffer.", 34, "w:\\4ed\\code\\4coder_lists.cpp", 28, 780 }, +{ PROC_LINKS(interactive_new, 0), "interactive_new", 15, "Interactively creates a new file.", 33, "w:\\4ed\\code\\4coder_lists.cpp", 28, 890 }, +{ PROC_LINKS(interactive_open, 0), "interactive_open", 16, "Interactively opens a file.", 27, "w:\\4ed\\code\\4coder_lists.cpp", 28, 922 }, +{ PROC_LINKS(interactive_open_or_new, 0), "interactive_open_or_new", 23, "Interactively open a file out of the file system.", 49, "w:\\4ed\\code\\4coder_lists.cpp", 28, 852 }, +{ PROC_LINKS(interactive_switch_buffer, 0), "interactive_switch_buffer", 25, "Interactively switch to an open buffer.", 39, "w:\\4ed\\code\\4coder_lists.cpp", 28, 761 }, +{ PROC_LINKS(kill_buffer, 0), "kill_buffer", 11, "Kills the current buffer.", 25, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1592 }, +{ PROC_LINKS(left_adjust_view, 0), "left_adjust_view", 16, "Sets the left size of the view near the x position of the cursor.", 65, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 166 }, +{ PROC_LINKS(list_all_functions_all_buffers, 0), "list_all_functions_all_buffers", 30, "Creates a jump list of lines from all buffers that appear to define or declare functions.", 89, "w:\\4ed\\code\\4coder_function_list.cpp", 36, 332 }, +{ PROC_LINKS(list_all_functions_all_buffers_lister, 0), "list_all_functions_all_buffers_lister", 37, "Creates a lister of locations that look like function definitions and declarations all buffers.", 95, "w:\\4ed\\code\\4coder_function_list.cpp", 36, 338 }, +{ PROC_LINKS(list_all_functions_current_buffer, 0), "list_all_functions_current_buffer", 33, "Creates a jump list of lines of the current buffer that appear to define or declare functions.", 94, "w:\\4ed\\code\\4coder_function_list.cpp", 36, 309 }, +{ PROC_LINKS(list_all_functions_current_buffer_lister, 0), "list_all_functions_current_buffer_lister", 40, "Creates a lister of locations that look like function definitions and declarations in the buffer.", 97, "w:\\4ed\\code\\4coder_function_list.cpp", 36, 319 }, +{ PROC_LINKS(list_all_locations, 0), "list_all_locations", 18, "Queries the user for a string and lists all exact case-sensitive matches found in all open buffers.", 99, "w:\\4ed\\code\\4coder_search.cpp", 29, 780 }, +{ PROC_LINKS(list_all_locations_case_insensitive, 0), "list_all_locations_case_insensitive", 35, "Queries the user for a string and lists all exact case-insensitive matches found in all open buffers.", 101, "w:\\4ed\\code\\4coder_search.cpp", 29, 794 }, +{ PROC_LINKS(list_all_locations_of_identifier, 0), "list_all_locations_of_identifier", 32, "Reads a token or word under the cursor and lists all exact case-sensitive mathces in all open buffers.", 102, "w:\\4ed\\code\\4coder_search.cpp", 29, 808 }, +{ PROC_LINKS(list_all_locations_of_identifier_case_insensitive, 0), "list_all_locations_of_identifier_case_insensitive", 49, "Reads a token or word under the cursor and lists all exact case-insensitive mathces in all open buffers.", 104, "w:\\4ed\\code\\4coder_search.cpp", 29, 815 }, +{ PROC_LINKS(list_all_locations_of_selection, 0), "list_all_locations_of_selection", 31, "Reads the string in the selected range and lists all exact case-sensitive mathces in all open buffers.", 102, "w:\\4ed\\code\\4coder_search.cpp", 29, 822 }, +{ PROC_LINKS(list_all_locations_of_selection_case_insensitive, 0), "list_all_locations_of_selection_case_insensitive", 48, "Reads the string in the selected range and lists all exact case-insensitive mathces in all open buffers.", 104, "w:\\4ed\\code\\4coder_search.cpp", 29, 829 }, +{ PROC_LINKS(list_all_locations_of_type_definition, 0), "list_all_locations_of_type_definition", 37, "Queries user for string, lists all locations of strings that appear to define a type whose name matches the input string.", 121, "w:\\4ed\\code\\4coder_search.cpp", 29, 836 }, +{ PROC_LINKS(list_all_locations_of_type_definition_of_identifier, 0), "list_all_locations_of_type_definition_of_identifier", 51, "Reads a token or word under the cursor and lists all locations of strings that appear to define a type whose name matches it.", 125, "w:\\4ed\\code\\4coder_search.cpp", 29, 847 }, +{ PROC_LINKS(list_all_substring_locations, 0), "list_all_substring_locations", 28, "Queries the user for a string and lists all case-sensitive substring matches found in all open buffers.", 103, "w:\\4ed\\code\\4coder_search.cpp", 29, 787 }, +{ PROC_LINKS(list_all_substring_locations_case_insensitive, 0), "list_all_substring_locations_case_insensitive", 45, "Queries the user for a string and lists all case-insensitive substring matches found in all open buffers.", 105, "w:\\4ed\\code\\4coder_search.cpp", 29, 801 }, +{ 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\\4coder_lists.cpp", 28, 15 }, +{ PROC_LINKS(lister__backspace_text_field, 0), "lister__backspace_text_field", 28, "A lister mode command that dispatches to the lister's backspace text field handler.", 83, "w:\\4ed\\code\\4coder_lists.cpp", 28, 41 }, +{ PROC_LINKS(lister__backspace_text_field__default, 0), "lister__backspace_text_field__default", 37, "A lister mode command that backspaces one character from the text field.", 72, "w:\\4ed\\code\\4coder_lists.cpp", 28, 146 }, +{ PROC_LINKS(lister__backspace_text_field__file_path, 0), "lister__backspace_text_field__file_path", 39, "A lister mode command that backspaces one character from the text field of a file system list.", 94, "w:\\4ed\\code\\4coder_lists.cpp", 28, 218 }, +{ PROC_LINKS(lister__mouse_press, 0), "lister__mouse_press", 19, "A lister mode command that beings a click interaction with a list item under the mouse.", 87, "w:\\4ed\\code\\4coder_lists.cpp", 28, 86 }, +{ PROC_LINKS(lister__mouse_release, 0), "lister__mouse_release", 21, "A lister mode command that ends a click interaction with a list item under the mouse, possibly activating it.", 109, "w:\\4ed\\code\\4coder_lists.cpp", 28, 98 }, +{ PROC_LINKS(lister__move_down, 0), "lister__move_down", 17, "A lister mode command that dispatches to the lister's navigate down handler.", 76, "w:\\4ed\\code\\4coder_lists.cpp", 28, 61 }, +{ PROC_LINKS(lister__move_down__default, 0), "lister__move_down__default", 26, "A lister mode command that moves the highlighted item one down in the list.", 75, "w:\\4ed\\code\\4coder_lists.cpp", 28, 177 }, +{ PROC_LINKS(lister__move_up, 0), "lister__move_up", 15, "A lister mode command that dispatches to the lister's navigate up handler.", 74, "w:\\4ed\\code\\4coder_lists.cpp", 28, 51 }, +{ PROC_LINKS(lister__move_up__default, 0), "lister__move_up__default", 24, "A lister mode command that moves the highlighted item one up in the list.", 73, "w:\\4ed\\code\\4coder_lists.cpp", 28, 161 }, +{ PROC_LINKS(lister__quit, 0), "lister__quit", 12, "A lister mode command that quits the list without executing any actions.", 72, "w:\\4ed\\code\\4coder_lists.cpp", 28, 8 }, +{ PROC_LINKS(lister__repaint, 0), "lister__repaint", 15, "A lister mode command that updates the lists UI data.", 53, "w:\\4ed\\code\\4coder_lists.cpp", 28, 115 }, +{ PROC_LINKS(lister__wheel_scroll, 0), "lister__wheel_scroll", 20, "A lister mode command that scrolls the list in response to the mouse wheel.", 75, "w:\\4ed\\code\\4coder_lists.cpp", 28, 71 }, +{ 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\\4coder_lists.cpp", 28, 31 }, +{ PROC_LINKS(lister__write_character__default, 0), "lister__write_character__default", 32, "A lister mode command that inserts a new character to the text field.", 69, "w:\\4ed\\code\\4coder_lists.cpp", 28, 126 }, +{ PROC_LINKS(lister__write_character__file_path, 0), "lister__write_character__file_path", 34, "A lister mode command that inserts a character into the text field of a file system list.", 89, "w:\\4ed\\code\\4coder_lists.cpp", 28, 193 }, +{ PROC_LINKS(lister__write_character__fixed_list, 0), "lister__write_character__fixed_list", 35, "A lister mode command that handles input for the fixed sure to kill list.", 73, "w:\\4ed\\code\\4coder_lists.cpp", 28, 253 }, +{ PROC_LINKS(load_project, 0), "load_project", 12, "Looks for a project.4coder file in the current directory and tries to load it. Looks in parent directories until a project file is found or there are no more parents.", 167, "w:\\4ed\\code\\4coder_project_commands.cpp", 39, 1083 }, +{ 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\\4coder_base_commands.cpp", 36, 1280 }, +{ PROC_LINKS(mouse_wheel_change_face_size, 0), "mouse_wheel_change_face_size", 28, "Reads the state of the mouse wheel and uses it to either increase or decrease the face size.", 92, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 619 }, +{ PROC_LINKS(mouse_wheel_scroll, 0), "mouse_wheel_scroll", 18, "Reads the scroll wheel value from the mouse state and scrolls accordingly.", 74, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 259 }, +{ PROC_LINKS(move_down, 0), "move_down", 9, "Moves the cursor down one line.", 31, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 323 }, +{ PROC_LINKS(move_down_10, 0), "move_down_10", 12, "Moves the cursor down ten lines.", 32, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 335 }, +{ PROC_LINKS(move_down_textual, 0), "move_down_textual", 17, "Moves down to the next line of actual text, regardless of line wrapping.", 72, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 341 }, +{ PROC_LINKS(move_left, 0), "move_left", 9, "Moves the cursor one character to the left.", 43, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 372 }, +{ 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\\4coder_base_commands.cpp", 36, 1377 }, +{ 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\\4coder_base_commands.cpp", 36, 1313 }, +{ PROC_LINKS(move_right, 0), "move_right", 10, "Moves the cursor one character to the right.", 44, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 382 }, +{ PROC_LINKS(move_up, 0), "move_up", 7, "Moves the cursor up one line.", 29, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 317 }, +{ PROC_LINKS(move_up_10, 0), "move_up_10", 10, "Moves the cursor up ten lines.", 30, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 329 }, +{ PROC_LINKS(newline_or_goto_position_direct, 0), "newline_or_goto_position_direct", 31, "If the buffer in the active view is writable, inserts a character, otherwise performs goto_jump_at_cursor.", 106, "w:\\4ed\\code\\4coder_jump_direct.cpp", 34, 101 }, +{ PROC_LINKS(newline_or_goto_position_same_panel_direct, 0), "newline_or_goto_position_same_panel_direct", 42, "If the buffer in the active view is writable, inserts a character, otherwise performs goto_jump_at_cursor_same_panel.", 117, "w:\\4ed\\code\\4coder_jump_direct.cpp", 34, 116 }, +{ PROC_LINKS(newline_or_goto_position_same_panel_sticky, 0), "newline_or_goto_position_same_panel_sticky", 42, "If the buffer in the active view is writable, inserts a character, otherwise performs goto_jump_at_cursor_same_panel.", 117, "w:\\4ed\\code\\4coder_jump_sticky.cpp", 34, 588 }, +{ PROC_LINKS(newline_or_goto_position_sticky, 0), "newline_or_goto_position_sticky", 31, "If the buffer in the active view is writable, inserts a character, otherwise performs goto_jump_at_cursor.", 106, "w:\\4ed\\code\\4coder_jump_sticky.cpp", 34, 574 }, +{ PROC_LINKS(open_all_code, 0), "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\\4coder_project_commands.cpp", 39, 1067 }, +{ PROC_LINKS(open_all_code_recursive, 0), "open_all_code_recursive", 23, "Works as open_all_code but also runs in all subdirectories.", 59, "w:\\4ed\\code\\4coder_project_commands.cpp", 39, 1074 }, +{ PROC_LINKS(open_color_tweaker, 0), "open_color_tweaker", 18, "Opens the 4coder theme selector list.", 37, "w:\\4ed\\code\\4coder_lists.cpp", 28, 938 }, +{ 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\\4coder_base_commands.cpp", 36, 1499 }, +{ PROC_LINKS(open_in_other, 0), "open_in_other", 13, "Interactively opens a file in the other panel.", 46, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1816 }, +{ PROC_LINKS(open_long_braces, 0), "open_long_braces", 16, "At the cursor, insert a '{' and '}' separated by a blank line.", 62, "w:\\4ed\\code\\4coder_combined_write_commands.cpp", 46, 55 }, +{ PROC_LINKS(open_long_braces_break, 0), "open_long_braces_break", 22, "At the cursor, insert a '{' and '}break;' separated by a blank line.", 68, "w:\\4ed\\code\\4coder_combined_write_commands.cpp", 46, 71 }, +{ PROC_LINKS(open_long_braces_semicolon, 0), "open_long_braces_semicolon", 26, "At the cursor, insert a '{' and '};' separated by a blank line.", 63, "w:\\4ed\\code\\4coder_combined_write_commands.cpp", 46, 63 }, +{ 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\\4coder_base_commands.cpp", 36, 1535 }, +{ PROC_LINKS(open_panel_hsplit, 0), "open_panel_hsplit", 17, "Create a new panel by horizontally splitting the active panel.", 62, "w:\\4ed\\code\\4coder_default_framework.cpp", 40, 173 }, +{ PROC_LINKS(open_panel_vsplit, 0), "open_panel_vsplit", 17, "Create a new panel by vertically splitting the active panel.", 60, "w:\\4ed\\code\\4coder_default_framework.cpp", 40, 164 }, +{ PROC_LINKS(page_down, 0), "page_down", 9, "Scrolls the view down one view height and moves the cursor down one view height.", 80, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 361 }, +{ PROC_LINKS(page_up, 0), "page_up", 7, "Scrolls the view up one view height and moves the cursor up one view height.", 76, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 352 }, +{ PROC_LINKS(paste, 0), "paste", 5, "At the cursor, insert the text at the top of the clipboard.", 59, "w:\\4ed\\code\\4coder_clipboard.cpp", 32, 46 }, +{ PROC_LINKS(paste_and_indent, 0), "paste_and_indent", 16, "Paste from the top of clipboard and run auto-indent on the newly pasted text.", 77, "w:\\4ed\\code\\4coder_clipboard.cpp", 32, 134 }, +{ PROC_LINKS(paste_next, 0), "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\\4coder_clipboard.cpp", 32, 85 }, +{ PROC_LINKS(paste_next_and_indent, 0), "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\\4coder_clipboard.cpp", 32, 141 }, +{ PROC_LINKS(place_in_scope, 0), "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\\4coder_scope_commands.cpp", 37, 506 }, +{ PROC_LINKS(project_command_lister, 0), "project_command_lister", 22, "Open a lister of all commands in the currently loaded project.", 62, "w:\\4ed\\code\\4coder_project_commands.cpp", 39, 1527 }, +{ PROC_LINKS(project_fkey_command, 0), "project_fkey_command", 20, "Run an 'fkey command' configured in a project.4coder file. Determines the index of the 'fkey command' by which function key or numeric key was pressed to trigger the command.", 175, "w:\\4ed\\code\\4coder_project_commands.cpp", 39, 1090 }, +{ PROC_LINKS(project_go_to_root_directory, 0), "project_go_to_root_directory", 28, "Changes 4coder's hot directory to the root directory of the currently loaded project. With no loaded project nothing hapepns.", 125, "w:\\4ed\\code\\4coder_project_commands.cpp", 39, 1113 }, +{ 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\\4coder_base_commands.cpp", 36, 1054 }, +{ 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\\4coder_base_commands.cpp", 36, 1078 }, +{ 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\\4coder_base_commands.cpp", 36, 1096 }, +{ PROC_LINKS(redo, 0), "redo", 4, "Advances forward through the undo history in the buffer containing the most recent regular edit.", 96, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1715 }, +{ PROC_LINKS(redo_this_buffer, 0), "redo_this_buffer", 16, "Advances forwards through the undo history of the current buffer.", 65, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1629 }, +{ PROC_LINKS(reload_themes, 0), "reload_themes", 13, "Loads all the theme files in the theme folder, replacing duplicates with the new theme data.", 92, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1793 }, +{ PROC_LINKS(remap_interactive, 0), "remap_interactive", 17, "Switch to a named key binding map.", 34, "w:\\4ed\\code\\4coder_default_framework.cpp", 40, 292 }, +{ 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\\4coder_base_commands.cpp", 36, 1236 }, +{ PROC_LINKS(reopen, 0), "reopen", 6, "Reopen the current buffer from the hard drive.", 46, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1607 }, +{ PROC_LINKS(replace_in_range, 0), "replace_in_range", 16, "Queries the user for two strings, and replaces all occurences of the first string in the range between the cursor and the mark with the second string.", 150, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 933 }, +{ 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\\4coder_base_commands.cpp", 36, 904 }, +{ 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\\4coder_base_commands.cpp", 36, 922 }, +{ PROC_LINKS(save, 0), "save", 4, "Saves the current buffer.", 25, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1599 }, +{ PROC_LINKS(save_all_dirty_buffers, 0), "save_all_dirty_buffers", 22, "Saves all buffers marked dirty (showing the '*' indicator).", 59, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1140 }, +{ 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\\4coder_base_commands.cpp", 36, 1196 }, +{ PROC_LINKS(scope_absorb_down, 0), "scope_absorb_down", 17, "If a scope is currently selected, and a statement or block statement is present below the current scope, the statement is moved into the scope.", 143, "w:\\4ed\\code\\4coder_scope_commands.cpp", 37, 747 }, +{ PROC_LINKS(search, 0), "search", 6, "Begins an incremental search down through the current buffer for a user specified string.", 89, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 897 }, +{ 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\\4coder_base_commands.cpp", 36, 911 }, +{ PROC_LINKS(seek_alphanumeric_left, 0), "seek_alphanumeric_left", 22, "Seek left for boundary between alphanumeric characters and non-alphanumeric characters.", 87, "w:\\4ed\\code\\4coder_seek.cpp", 27, 1238 }, +{ PROC_LINKS(seek_alphanumeric_or_camel_left, 0), "seek_alphanumeric_or_camel_left", 31, "Seek left for boundary between alphanumeric characters or camel case word and non-alphanumeric characters.", 106, "w:\\4ed\\code\\4coder_seek.cpp", 27, 1250 }, +{ PROC_LINKS(seek_alphanumeric_or_camel_right, 0), "seek_alphanumeric_or_camel_right", 32, "Seek right for boundary between alphanumeric characters or camel case word and non-alphanumeric characters.", 107, "w:\\4ed\\code\\4coder_seek.cpp", 27, 1244 }, +{ PROC_LINKS(seek_alphanumeric_right, 0), "seek_alphanumeric_right", 23, "Seek right for boundary between alphanumeric characters and non-alphanumeric characters.", 88, "w:\\4ed\\code\\4coder_seek.cpp", 27, 1232 }, +{ 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\\4coder_seek.cpp", 27, 1131 }, +{ 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\\4coder_seek.cpp", 27, 1111 }, +{ 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\\4coder_seek.cpp", 27, 1143 }, +{ 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\\4coder_seek.cpp", 27, 1121 }, +{ PROC_LINKS(seek_token_left, 0), "seek_token_left", 15, "Seek left for the next beginning of a token.", 44, "w:\\4ed\\code\\4coder_seek.cpp", 27, 1214 }, +{ PROC_LINKS(seek_token_right, 0), "seek_token_right", 16, "Seek right for the next end of a token.", 39, "w:\\4ed\\code\\4coder_seek.cpp", 27, 1208 }, +{ PROC_LINKS(seek_white_or_token_left, 0), "seek_white_or_token_left", 24, "Seek left for the next end of a token or boundary between whitespace and non-whitespace.", 88, "w:\\4ed\\code\\4coder_seek.cpp", 27, 1226 }, +{ PROC_LINKS(seek_white_or_token_right, 0), "seek_white_or_token_right", 25, "Seek right for the next end of a token or boundary between whitespace and non-whitespace.", 89, "w:\\4ed\\code\\4coder_seek.cpp", 27, 1220 }, +{ PROC_LINKS(seek_whitespace_down, 0), "seek_whitespace_down", 20, "Seeks the cursor down to the next blank line.", 45, "w:\\4ed\\code\\4coder_seek.cpp", 27, 1101 }, +{ PROC_LINKS(seek_whitespace_down_end_line, 0), "seek_whitespace_down_end_line", 29, "Seeks the cursor down to the next blank line and places it at the end of the line.", 82, "w:\\4ed\\code\\4coder_seek.cpp", 27, 1166 }, +{ PROC_LINKS(seek_whitespace_left, 0), "seek_whitespace_left", 20, "Seek left for the next boundary between whitespace and non-whitespace.", 70, "w:\\4ed\\code\\4coder_seek.cpp", 27, 1202 }, +{ PROC_LINKS(seek_whitespace_right, 0), "seek_whitespace_right", 21, "Seek right for the next boundary between whitespace and non-whitespace.", 71, "w:\\4ed\\code\\4coder_seek.cpp", 27, 1196 }, +{ PROC_LINKS(seek_whitespace_up, 0), "seek_whitespace_up", 18, "Seeks the cursor up to the next blank line.", 43, "w:\\4ed\\code\\4coder_seek.cpp", 27, 1091 }, +{ PROC_LINKS(seek_whitespace_up_end_line, 0), "seek_whitespace_up_end_line", 27, "Seeks the cursor up to the next blank line and places it at the end of the line.", 80, "w:\\4ed\\code\\4coder_seek.cpp", 27, 1155 }, +{ PROC_LINKS(select_all, 0), "select_all", 10, "Puts the cursor at the top of the file, and the mark at the bottom of the file.", 79, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 392 }, +{ PROC_LINKS(select_next_scope_absolute, 0), "select_next_scope_absolute", 26, "Finds the first scope started by '{' after the cursor and puts the cursor and mark on the '{' and '}'.", 102, "w:\\4ed\\code\\4coder_scope_commands.cpp", 37, 387 }, +{ PROC_LINKS(select_prev_scope_absolute, 0), "select_prev_scope_absolute", 26, "Finds the first scope started by '{' before the cursor and puts the cursor and mark on the '{' and '}'.", 103, "w:\\4ed\\code\\4coder_scope_commands.cpp", 37, 407 }, +{ PROC_LINKS(select_surrounding_scope, 0), "select_surrounding_scope", 24, "Finds the scope enclosed by '{' '}' surrounding the cursor and puts the cursor and mark on the '{' and '}'.", 107, "w:\\4ed\\code\\4coder_scope_commands.cpp", 37, 371 }, +{ PROC_LINKS(set_bindings_choose, 0), "set_bindings_choose", 19, "Remap keybindings using the 'choose' mapping rule.", 50, "w:\\4ed\\code\\4coder_remapping_commands.cpp", 41, 47 }, +{ PROC_LINKS(set_bindings_default, 0), "set_bindings_default", 20, "Remap keybindings using the 'default' mapping rule.", 51, "w:\\4ed\\code\\4coder_remapping_commands.cpp", 41, 61 }, +{ PROC_LINKS(set_bindings_mac_default, 0), "set_bindings_mac_default", 24, "Remap keybindings using the 'mac-default' mapping rule.", 55, "w:\\4ed\\code\\4coder_remapping_commands.cpp", 41, 75 }, +{ PROC_LINKS(set_mark, 0), "set_mark", 8, "Sets the mark to the current position of the cursor.", 52, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 121 }, +{ PROC_LINKS(set_mode_to_notepad_like, 0), "set_mode_to_notepad_like", 24, "Sets the edit mode to Notepad like.", 35, "w:\\4ed\\code\\4coder_default_framework.cpp", 40, 260 }, +{ PROC_LINKS(set_mode_to_original, 0), "set_mode_to_original", 20, "Sets the edit mode to 4coder original.", 38, "w:\\4ed\\code\\4coder_default_framework.cpp", 40, 254 }, +{ PROC_LINKS(setup_build_bat, 0), "setup_build_bat", 15, "Queries the user for several configuration options and initializes a new build batch script.", 92, "w:\\4ed\\code\\4coder_project_commands.cpp", 39, 1498 }, +{ PROC_LINKS(setup_build_bat_and_sh, 0), "setup_build_bat_and_sh", 22, "Queries the user for several configuration options and initializes a new build batch script.", 92, "w:\\4ed\\code\\4coder_project_commands.cpp", 39, 1510 }, +{ PROC_LINKS(setup_build_sh, 0), "setup_build_sh", 14, "Queries the user for several configuration options and initializes a new build shell script.", 92, "w:\\4ed\\code\\4coder_project_commands.cpp", 39, 1504 }, +{ PROC_LINKS(setup_new_project, 0), "setup_new_project", 17, "Queries the user for several configuration options and initializes a new 4coder project with build scripts for every OS.", 120, "w:\\4ed\\code\\4coder_project_commands.cpp", 39, 1491 }, +{ PROC_LINKS(show_filebar, 0), "show_filebar", 12, "Sets the current view to show it's filebar.", 43, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 540 }, +{ PROC_LINKS(show_scrollbar, 0), "show_scrollbar", 14, "Sets the current view to show it's scrollbar.", 45, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 526 }, +{ PROC_LINKS(snipe_token_or_word, 0), "snipe_token_or_word", 19, "Delete a single, whole token on or to the left of the cursor and post it to the clipboard.", 90, "w:\\4ed\\code\\4coder_seek.cpp", 27, 1270 }, +{ PROC_LINKS(snipe_token_or_word_right, 0), "snipe_token_or_word_right", 25, "Delete a single, whole token on or to the right of the cursor and post it to the clipboard.", 91, "w:\\4ed\\code\\4coder_seek.cpp", 27, 1276 }, +{ PROC_LINKS(snippet_lister, 0), "snippet_lister", 14, "Opens a snippet lister for inserting whole pre-written snippets of text.", 72, "w:\\4ed\\code\\4coder_combined_write_commands.cpp", 46, 248 }, +{ PROC_LINKS(suppress_mouse, 0), "suppress_mouse", 14, "Hides the mouse and causes all mosue input (clicks, position, wheel) to be ignored.", 83, "w:\\4ed\\code\\4coder_default_framework.cpp", 40, 236 }, +{ 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\\4coder_base_commands.cpp", 36, 1559 }, +{ PROC_LINKS(to_lowercase, 0), "to_lowercase", 12, "Converts all ascii text in the range between the cursor and the mark to lowercase.", 82, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 424 }, +{ PROC_LINKS(to_uppercase, 0), "to_uppercase", 12, "Converts all ascii text in the range between the cursor and the mark to uppercase.", 82, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 404 }, +{ PROC_LINKS(toggle_filebar, 0), "toggle_filebar", 14, "Toggles the visibility status of the current view's filebar.", 60, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 554 }, +{ 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\\4coder_default_framework.cpp", 40, 284 }, +{ 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\\4coder_default_framework.cpp", 40, 272 }, +{ PROC_LINKS(toggle_highlight_line_at_cursor, 0), "toggle_highlight_line_at_cursor", 31, "Toggles the line highlight at the cursor.", 41, "w:\\4ed\\code\\4coder_default_framework.cpp", 40, 266 }, +{ PROC_LINKS(toggle_line_wrap, 0), "toggle_line_wrap", 16, "Toggles the current buffer's line wrapping status.", 50, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 563 }, +{ PROC_LINKS(toggle_mouse, 0), "toggle_mouse", 12, "Toggles the mouse suppression mode, see suppress_mouse and allow_mouse.", 71, "w:\\4ed\\code\\4coder_default_framework.cpp", 40, 248 }, +{ 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\\4coder_default_framework.cpp", 40, 278 }, +{ PROC_LINKS(toggle_show_whitespace, 0), "toggle_show_whitespace", 22, "Toggles the current buffer's whitespace visibility status.", 58, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 647 }, +{ PROC_LINKS(toggle_virtual_whitespace, 0), "toggle_virtual_whitespace", 25, "Toggles the current buffer's virtual whitespace status.", 55, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 636 }, +{ PROC_LINKS(uncomment_line, 0), "uncomment_line", 14, "If present, delete '//' at the beginning of the line after leading whitespace.", 78, "w:\\4ed\\code\\4coder_combined_write_commands.cpp", 46, 147 }, +{ PROC_LINKS(undo, 0), "undo", 4, "Advances backward through the undo history in the buffer containing the most recent regular edit.", 97, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1643 }, +{ PROC_LINKS(undo_this_buffer, 0), "undo_this_buffer", 16, "Advances backwards through the undo history of the current buffer.", 66, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1617 }, +{ 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\\4coder_base_commands.cpp", 36, 1549 }, +{ PROC_LINKS(view_jump_list_with_lister, 0), "view_jump_list_with_lister", 26, "When executed on a buffer with jumps, creates a persistent lister for all the jumps", 83, "w:\\4ed\\code\\4coder_jump_lister.cpp", 34, 108 }, +{ PROC_LINKS(word_complete, 0), "word_complete", 13, "Iteratively tries completing the word to the left of the cursor with other words in open buffers that have the same prefix string.", 130, "w:\\4ed\\code\\4coder_search.cpp", 29, 867 }, +{ PROC_LINKS(write_and_auto_tab, 0), "write_and_auto_tab", 18, "Inserts a character and auto-indents the line on which the cursor sits.", 71, "w:\\4ed\\code\\4coder_auto_indent.cpp", 34, 744 }, +{ PROC_LINKS(write_block, 0), "write_block", 11, "At the cursor, insert a block comment.", 38, "w:\\4ed\\code\\4coder_combined_write_commands.cpp", 46, 103 }, +{ PROC_LINKS(write_character, 0), "write_character", 15, "Inserts whatever character was used to trigger this command.", 60, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 67 }, +{ PROC_LINKS(write_hack, 0), "write_hack", 10, "At the cursor, insert a '// HACK' comment, includes user name if it was specified in config.4coder.", 99, "w:\\4ed\\code\\4coder_combined_write_commands.cpp", 46, 91 }, +{ PROC_LINKS(write_note, 0), "write_note", 10, "At the cursor, insert a '// NOTE' comment, includes user name if it was specified in config.4coder.", 99, "w:\\4ed\\code\\4coder_combined_write_commands.cpp", 46, 97 }, +{ PROC_LINKS(write_todo, 0), "write_todo", 10, "At the cursor, insert a '// TODO' comment, includes user name if it was specified in config.4coder.", 99, "w:\\4ed\\code\\4coder_combined_write_commands.cpp", 46, 85 }, +{ PROC_LINKS(write_underscore, 0), "write_underscore", 16, "Inserts an underscore.", 22, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 76 }, +{ PROC_LINKS(write_zero_struct, 0), "write_zero_struct", 17, "At the cursor, insert a ' = {};'.", 33, "w:\\4ed\\code\\4coder_combined_write_commands.cpp", 46, 109 }, }; static int32_t fcoder_metacmd_ID_allow_mouse = 0; static int32_t fcoder_metacmd_ID_auto_tab_line_at_cursor = 1; diff --git a/4coder_generated/remapping.h b/4coder_generated/remapping.h index a8a58869..3e454814 100644 --- a/4coder_generated/remapping.h +++ b/4coder_generated/remapping.h @@ -10,6 +10,10 @@ bind(context, 'k', MDFR_CTRL, interactive_kill_buffer); bind(context, 'i', MDFR_CTRL, interactive_switch_buffer); bind(context, 'h', MDFR_CTRL, project_go_to_root_directory); bind(context, 'S', MDFR_CTRL, save_all_dirty_buffers); +bind(context, key_print_screen, MDFR_NONE, toggle_filebar); +bind(context, key_scroll_lock, MDFR_NONE, toggle_filebar); +bind(context, key_pause, MDFR_NONE, toggle_filebar); +bind(context, key_caps, MDFR_NONE, toggle_filebar); bind(context, '.', MDFR_ALT, change_to_build_panel); bind(context, ',', MDFR_ALT, close_build_panel); bind(context, 'n', MDFR_ALT, goto_next_jump_sticky); @@ -381,7 +385,7 @@ 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[40] = { +static Meta_Key_Bind fcoder_binds_for_default_mapid_global[44] = { {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)}, @@ -391,6 +395,10 @@ static Meta_Key_Bind fcoder_binds_for_default_mapid_global[40] = { {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, 55316, 0, "toggle_filebar", 14, LINK_PROCS(toggle_filebar)}, +{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_sticky", 21, LINK_PROCS(goto_next_jump_sticky)}, @@ -404,15 +412,6 @@ static Meta_Key_Bind fcoder_binds_for_default_mapid_global[40] = { {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, 55317, 0, "project_fkey_command", 20, LINK_PROCS(project_fkey_command)}, -{0, 55318, 0, "project_fkey_command", 20, LINK_PROCS(project_fkey_command)}, -{0, 55319, 0, "project_fkey_command", 20, LINK_PROCS(project_fkey_command)}, -{0, 55320, 0, "project_fkey_command", 20, LINK_PROCS(project_fkey_command)}, -{0, 55321, 0, "project_fkey_command", 20, LINK_PROCS(project_fkey_command)}, -{0, 55322, 0, "project_fkey_command", 20, LINK_PROCS(project_fkey_command)}, -{0, 55323, 0, "project_fkey_command", 20, LINK_PROCS(project_fkey_command)}, -{0, 55324, 0, "project_fkey_command", 20, LINK_PROCS(project_fkey_command)}, -{0, 55325, 0, "project_fkey_command", 20, LINK_PROCS(project_fkey_command)}, {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)}, @@ -420,15 +419,24 @@ static Meta_Key_Bind fcoder_binds_for_default_mapid_global[40] = { {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, 55312, 0, "mouse_wheel_scroll", 18, LINK_PROCS(mouse_wheel_scroll)}, -{0, 55312, 1, "mouse_wheel_change_face_size", 28, LINK_PROCS(mouse_wheel_change_face_size)}, +{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_character", 15, LINK_PROCS(write_character)}, -{0, 55308, 0, "click_set_cursor_and_mark", 25, LINK_PROCS(click_set_cursor_and_mark)}, -{0, 55315, 0, "click_set_cursor_and_mark", 25, LINK_PROCS(click_set_cursor_and_mark)}, -{0, 55310, 0, "click_set_cursor", 16, LINK_PROCS(click_set_cursor)}, -{0, 55313, 0, "click_set_cursor_if_lbutton", 27, LINK_PROCS(click_set_cursor_if_lbutton)}, +{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)}, @@ -548,14 +556,14 @@ static Meta_Key_Bind fcoder_binds_for_default_default_lister_ui_map[16] = { {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, 55312, 0, "lister__wheel_scroll", 20, LINK_PROCS(lister__wheel_scroll)}, -{0, 55308, 0, "lister__mouse_press", 19, LINK_PROCS(lister__mouse_press)}, -{0, 55310, 0, "lister__mouse_release", 21, LINK_PROCS(lister__mouse_release)}, -{0, 55313, 0, "lister__repaint", 15, LINK_PROCS(lister__repaint)}, -{0, 55314, 0, "lister__repaint", 15, LINK_PROCS(lister__repaint)}, +{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, 40}, +{"mapid_global", 12, "The following bindings apply in all situations.", 47, 0, 0, fcoder_binds_for_default_mapid_global, 44}, {"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, 31}, {"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, 16}, @@ -583,15 +591,6 @@ static Meta_Key_Bind fcoder_binds_for_mac_default_mapid_global[40] = { {0, 88, 1, "project_command_lister", 22, LINK_PROCS(project_command_lister)}, {0, 73, 4, "list_all_functions_all_buffers_lister", 37, LINK_PROCS(list_all_functions_all_buffers_lister)}, {0, 69, 1, "exit_4coder", 11, LINK_PROCS(exit_4coder)}, -{0, 55317, 0, "project_fkey_command", 20, LINK_PROCS(project_fkey_command)}, -{0, 55318, 0, "project_fkey_command", 20, LINK_PROCS(project_fkey_command)}, -{0, 55319, 0, "project_fkey_command", 20, LINK_PROCS(project_fkey_command)}, -{0, 55320, 0, "project_fkey_command", 20, LINK_PROCS(project_fkey_command)}, -{0, 55321, 0, "project_fkey_command", 20, LINK_PROCS(project_fkey_command)}, -{0, 55322, 0, "project_fkey_command", 20, LINK_PROCS(project_fkey_command)}, -{0, 55323, 0, "project_fkey_command", 20, LINK_PROCS(project_fkey_command)}, -{0, 55324, 0, "project_fkey_command", 20, LINK_PROCS(project_fkey_command)}, -{0, 55325, 0, "project_fkey_command", 20, LINK_PROCS(project_fkey_command)}, {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)}, @@ -599,16 +598,25 @@ static Meta_Key_Bind fcoder_binds_for_mac_default_mapid_global[40] = { {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, 55312, 0, "mouse_wheel_scroll", 18, LINK_PROCS(mouse_wheel_scroll)}, -{0, 55312, 4, "mouse_wheel_change_face_size", 28, LINK_PROCS(mouse_wheel_change_face_size)}, +{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, 4, "mouse_wheel_change_face_size", 28, LINK_PROCS(mouse_wheel_change_face_size)}, }; static Meta_Key_Bind fcoder_binds_for_mac_default_mapid_file[77] = { {1, 0, 0, "write_character", 15, LINK_PROCS(write_character)}, {1, 0, 2, "write_character", 15, LINK_PROCS(write_character)}, -{0, 55308, 0, "click_set_cursor_and_mark", 25, LINK_PROCS(click_set_cursor_and_mark)}, -{0, 55315, 0, "click_set_cursor_and_mark", 25, LINK_PROCS(click_set_cursor_and_mark)}, -{0, 55310, 0, "click_set_cursor", 16, LINK_PROCS(click_set_cursor)}, -{0, 55313, 0, "click_set_cursor_if_lbutton", 27, LINK_PROCS(click_set_cursor_if_lbutton)}, +{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)}, @@ -724,11 +732,11 @@ static Meta_Key_Bind fcoder_binds_for_mac_default_default_lister_ui_map[14] = { {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, 55306, 0, "lister__move_down", 17, LINK_PROCS(lister__move_down)}, -{0, 55312, 0, "lister__wheel_scroll", 20, LINK_PROCS(lister__wheel_scroll)}, -{0, 55308, 0, "lister__mouse_press", 19, LINK_PROCS(lister__mouse_press)}, -{0, 55310, 0, "lister__mouse_release", 21, LINK_PROCS(lister__mouse_release)}, -{0, 55313, 0, "lister__repaint", 15, LINK_PROCS(lister__repaint)}, -{0, 55314, 0, "lister__repaint", 15, LINK_PROCS(lister__repaint)}, +{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_mac_default[4] = { {"mapid_global", 12, "The following bindings apply in all situations.", 47, 0, 0, fcoder_binds_for_mac_default_mapid_global, 40}, diff --git a/4coder_helper.cpp b/4coder_helper.cpp index 1a2dda33..7eebd1e1 100644 --- a/4coder_helper.cpp +++ b/4coder_helper.cpp @@ -1584,10 +1584,10 @@ view_set_split_pixel_size(Application_Links *app, View_Summary *view, int32_t t) static Record_Info get_single_record(Application_Links *app, Buffer_ID buffer_id, History_Record_Index index){ - Buffer_Summary buffer = get_buffer(app, buffer_id, AccessOpen); - Record_Info record = buffer_history_get_record_info(app, &buffer, index); + Record_Info record = {}; + buffer_history_get_record_info(app, buffer_id, index, &record); if (record.error == RecordError_NoError && record.kind == RecordKind_Group){ - record = buffer_history_get_group_sub_record(app, &buffer, index, record.group.count); + buffer_history_get_group_sub_record(app, buffer_id, index, record.group.count, &record); } return(record); } diff --git a/4ed_api_implementation.cpp b/4ed_api_implementation.cpp index bc1442ee..e52009ba 100644 --- a/4ed_api_implementation.cpp +++ b/4ed_api_implementation.cpp @@ -13,13 +13,12 @@ internal b32 access_test(u32 lock_flags, u32 access_flags){ - b32 result = ((lock_flags & ~access_flags) == 0); - return(result); + return((lock_flags & ~access_flags) == 0); } internal void fill_buffer_summary(Buffer_Summary *buffer, Editing_File *file, Working_Set *working_set){ - memset(buffer, 0, sizeof(*buffer)); + block_zero_struct(buffer); if (!file->is_dummy){ buffer->exists = 1; buffer->ready = file_is_ready(file); @@ -42,10 +41,7 @@ fill_buffer_summary(Buffer_Summary *buffer, Editing_File *file, Working_Set *wor buffer->map_id = file->settings.base_map_id; buffer->unwrapped_lines = file->settings.unwrapped_lines; - buffer->lock_flags = 0; - if (file->settings.read_only){ - buffer->lock_flags |= AccessProtected; - } + buffer->lock_flags = file_get_access_flags(file); } } @@ -53,7 +49,7 @@ internal void fill_view_summary(System_Functions *system, View_Summary *view, View *vptr, Live_Views *live_set, Working_Set *working_set){ File_Viewing_Data *data = &vptr->file_data; - memset(view, 0, sizeof(*view)); + block_zero_struct(view); if (vptr->in_use){ view->exists = true; @@ -61,7 +57,7 @@ fill_view_summary(System_Functions *system, View_Summary *view, View *vptr, Live view->line_height = (f32)(vptr->line_height); view->unwrapped_lines = data->file->settings.unwrapped_lines; view->show_whitespace = data->show_whitespace; - view->lock_flags = view_lock_flags(vptr); + view->lock_flags = view_get_access_flags(vptr); view->buffer_id = vptr->file_data.file->id.id; @@ -103,7 +99,7 @@ view_quit_ui(System_Functions *system, Models *models, View *view){ internal Editing_File* get_file_from_identifier(System_Functions *system, Working_Set *working_set, Buffer_Identifier buffer){ Editing_File *file = 0; - if (buffer.id){ + if (buffer.id != 0){ file = working_set_get_active_file(working_set, buffer.id); } else if (buffer.name != 0){ @@ -123,36 +119,18 @@ imp_get_file(Models *models, Buffer_ID buffer_id){ return(file); } -internal Editing_File* -imp_get_file(Models *models, Buffer_Summary *buffer){ - Editing_File *file = 0; - if (buffer != 0 && buffer->exists){ - file = imp_get_file(models, buffer->buffer_id); - } - return(file); -} - internal View* imp_get_view(Models *models, View_ID view_id){ Live_Views *live_set = &models->live_set; - View *vptr = 0; + View *view = 0; view_id = view_id - 1; if (0 <= view_id && view_id < live_set->max){ - vptr = live_set->views + view_id; - if (!vptr->in_use){ - vptr = 0; + view = live_set->views + view_id; + if (!view->in_use){ + view = 0; } } - return(vptr); -} - -internal View* -imp_get_view(Models *models, View_Summary *view){ - View *vptr = 0; - if (view != 0 && view->exists){ - vptr = imp_get_view(models, view->view_id); - } - return(vptr); + return(view); } API_EXPORT bool32 @@ -193,8 +171,9 @@ DOC(Dumps away the previous mappings and instantiates the mappings described in return(result); } +// TODO(allen): redocument API_EXPORT bool32 -Exec_System_Command(Application_Links *app, View_Summary *view, Buffer_Identifier buffer_id, char *path, int32_t path_len, char *command, int32_t command_len, Command_Line_Interface_Flag flags) +Exec_System_Command(Application_Links *app, View_ID view_id, Buffer_Identifier buffer_id, String path, String command, Command_Line_Interface_Flag flags) /* DOC_PARAM(view, If the view parameter is non-null it specifies a view to display the command's output buffer, otherwise the command will still work but if there is a buffer capturing the output it will not automatically be displayed.) DOC_PARAM(buffer_id, The buffer the command will output to is specified by the buffer parameter. See Buffer_Identifier for information on how this type specifies a buffer. If output from the command should just be ignored, then buffer_identifier(0) can be specified to indicate no output buffer.) @@ -303,7 +282,7 @@ DOC_SEE(Command_Line_Interface_Flag) } if (bind_to_new_view){ - View *vptr = imp_get_view(models, view); + View *vptr = imp_get_view(models, view_id); if (vptr != 0){ view_set_file(system, models, vptr, file); view_quit_ui(system, models, vptr); @@ -313,21 +292,21 @@ DOC_SEE(Command_Line_Interface_Flag) // NOTE(allen): Figure out the root path for the command. String path_string = {}; - if (path == 0){ + if (path.size == 0){ terminate_with_null(&models->hot_directory.string); path_string = models->hot_directory.string; } else{ - path_string = push_string(part, path, path_len); + path_string = push_string(part, path); } // NOTE(allen): Figure out the command string. String command_string = {}; - if (command == 0){ + if (command.size){ command_string = make_lit_string(" echo no script specified"); } else{ - command_string = push_string(part, command, command_len); + command_string = push_string(part, command); } // NOTE(allen): Attept to execute the command. @@ -342,15 +321,16 @@ DOC_SEE(Command_Line_Interface_Flag) done:; if (!result){ - print_message(app, feedback_str.str, feedback_str.size); + print_message(app, feedback_str); } end_temp_memory(temp); return(result); } -API_EXPORT void -Clipboard_Post(Application_Links *app, int32_t clipboard_id, char *str, int32_t len) +// TODO(allen): redocument +API_EXPORT bool32 +Clipboard_Post(Application_Links *app, int32_t clipboard_id, String string) /* DOC_PARAM(clipboard_id, This parameter is set up to prepare for future features, it should always be 0 for now.) DOC_PARAM(str, The str parameter specifies the string to be posted to the clipboard, it need not be null terminated.) @@ -359,13 +339,14 @@ DOC(Stores the string str in the clipboard initially with index 0. Also reports DOC_SEE(The_4coder_Clipboard) */{ Models *models = (Models*)app->cmd_context; - String *dest = working_set_next_clipboard_string(&models->mem.heap, &models->working_set, len); - copy(dest, make_string(str, len)); + String *dest = working_set_next_clipboard_string(&models->mem.heap, &models->working_set, string.size); + copy(dest, string); models->system->post_clipboard(*dest); + return(true); } -API_EXPORT int32_t -Clipboard_Count(Application_Links *app, int32_t clipboard_id) +API_EXPORT bool32 +Clipboard_Count(Application_Links *app, int32_t clipboard_id, int32_t *count_out) /* DOC_PARAM(clipboard_id, This parameter is set up to prepare for future features, it should always be 0 for now.) DOC(This call returns the number of items in the clipboard.) @@ -373,12 +354,12 @@ DOC_SEE(The_4coder_Clipboard) */{ Models *models = (Models*)app->cmd_context; Working_Set *working = &models->working_set; - int32_t count = working->clipboard_size; - return(count); + *count_out = working->clipboard_size; + return(true); } -API_EXPORT int32_t -Clipboard_Index(Application_Links *app, int32_t clipboard_id, int32_t item_index, char *out, int32_t len) +API_EXPORT bool32 +Clipboard_Index(Application_Links *app, int32_t clipboard_id, int32_t item_index, String *string_out, int32_t *required_size_out) /* DOC_PARAM(clipboard_id, This parameter is set up to prepare for future features, it should always be 0 for now.) DOC_PARAM(item_index, This parameter specifies which item to read, 0 is the most recent copy, 1 is the second most recent copy, etc.) @@ -386,22 +367,21 @@ DOC_PARAM(out, This parameter provides a buffer where the clipboard contents are DOC_PARAM(len, This parameter specifies the length of the out buffer.) DOC_RETURN(This call returns the size of the item associated with item_index.) -DOC(This function always returns the size of the item even if the output buffer is NULL. If the output buffer is too small to contain the whole string, it is filled with the first len character of the clipboard contents. The output string is not null terminated.) +DOC(This function always returns the size of the item even if the output buffer is NULL. If the output buffer is too small to contain the whole string, +it is filled with the first len character of the clipboard contents. The output string is not null terminated.) DOC_SEE(The_4coder_Clipboard) */{ Models *models = (Models*)app->cmd_context; - Working_Set *working = &models->working_set; - int32_t size = 0; - String *str = working_set_clipboard_index(working, item_index); + *required_size_out = 0; + String *str = working_set_clipboard_index(&models->working_set, item_index); if (str != 0){ - size = str->size; - if (out != 0){ - String out_str = make_string_cap(out, 0, len); - copy(&out_str, *str); + *required_size_out = str->size; + if (append(string_out, *str)){ + return(true); } } - return(size); + return(false); } API_EXPORT Parse_Context_ID @@ -429,35 +409,26 @@ DOC(Gives the total number of buffers in the application.) return(result); } -internal void -internal_get_buffer_first(Working_Set *working_set, Buffer_Summary *buffer){ - if (working_set->file_count > 0){ - Node *node = working_set->used_sentinel.next; - Editing_File *file = CastFromMember(Editing_File, main_chain_node, node); - fill_buffer_summary(buffer, file, working_set); - } -} - -internal void -get_buffer_next__internal(Working_Set *working_set, Buffer_Summary *buffer){ - Editing_File *file = working_set_get_active_file(working_set, buffer->buffer_id); +internal Editing_File* +get_buffer_next__inner(Working_Set *working_set, Editing_File *file){ if (file != 0){ file = CastFromMember(Editing_File, main_chain_node, file->main_chain_node.next); - Editing_File *sentinel_file_ptr = CastFromMember(Editing_File, main_chain_node, &working_set->used_sentinel); - if (file != sentinel_file_ptr){ - fill_buffer_summary(buffer, file, working_set); - } - else{ - memset(buffer, 0, sizeof(*buffer)); + if (file == CastFromMember(Editing_File, main_chain_node, &working_set->used_sentinel)){ + file = 0; } } else{ - memset(buffer, 0, sizeof(*buffer)); + if (working_set->file_count > 0){ + Node *node = working_set->used_sentinel.next; + file = CastFromMember(Editing_File, main_chain_node, node); + } } + return(file); } -API_EXPORT Buffer_Summary -Get_Buffer_First(Application_Links *app, Access_Flag access) +// TODO(allen): redocument +API_EXPORT bool32 +Get_Buffer_First(Application_Links *app, Access_Flag access, Buffer_ID *buffer_id_out) /* DOC_PARAM(access, The access parameter determines what levels of protection this call can access.) DOC_RETURN(This call returns the summary of the first buffer in a buffer loop.) @@ -472,16 +443,21 @@ DOC_SEE(get_buffer_next) */{ Models *models = (Models*)app->cmd_context; Working_Set *working_set = &models->working_set; - Buffer_Summary buffer = {}; - internal_get_buffer_first(working_set, &buffer); - for (;buffer.exists && !access_test(buffer.lock_flags, access);){ - get_buffer_next__internal(working_set, &buffer); + Editing_File *file = get_buffer_next__inner(working_set, 0); + for (;file != 0 && !access_test(file_get_access_flags(file), access);){ + file = get_buffer_next__inner(working_set, file); } - return(buffer); + if (file != 0){ + *buffer_id_out = file->id.id; + return(true); + } + *buffer_id_out = 0; + return(false); } -API_EXPORT void -Get_Buffer_Next(Application_Links *app, Buffer_Summary *buffer, Access_Flag access) +// TODO(allen): redocument +API_EXPORT bool32 +Get_Buffer_Next(Application_Links *app, Buffer_ID buffer_id, Access_Flag access, Buffer_ID *buffer_id_out) /* DOC_PARAM(buffer, The Buffer_Summary pointed to by buffer is iterated to the next buffer or to a null summary if this is the last buffer.) DOC_PARAM(access, The access parameter determines what levels of protection this call can access. The buffer outputted will be the next buffer that is accessible.) @@ -498,14 +474,47 @@ DOC_SEE(get_buffer_first) */{ Models *models = (Models*)app->cmd_context; Working_Set *working_set = &models->working_set; - get_buffer_next__internal(working_set, buffer); - for (;buffer->exists && !access_test(buffer->lock_flags, access);){ - get_buffer_next__internal(working_set, buffer); + Editing_File *file = working_set_get_active_file(working_set, buffer_id); + file = get_buffer_next__inner(working_set, file); + for (;file != 0 && !access_test(file_get_access_flags(file), access);){ + file = get_buffer_next__inner(working_set, file); } + if (file != 0){ + *buffer_id_out = file->id.id; + return(true); + } + *buffer_id_out = 0; + return(false); } -API_EXPORT Buffer_Summary -Get_Buffer(Application_Links *app, Buffer_ID buffer_id, Access_Flag access) +internal b32 +buffer_api_check_file(Editing_File *file){ + return(file != 0 && !file->is_dummy); +} + +internal b32 +buffer_api_check_file_and_tokens(Editing_File *file){ + return(buffer_api_check_file(file) && file->state.token_array.tokens != 0 && file->state.tokens_complete); +} + +internal b32 +buffer_api_check_file(Editing_File *file, Access_Flag access){ + return(buffer_api_check_file(file) && access_test(file_get_access_flags(file), access)); +} + +internal b32 +view_api_check_view(View *view){ + return(view != 0 && view->in_use); +} + +internal b32 +view_api_check_view(View *view, Access_Flag access){ + return(view_api_check_view(view) && access_test(view_get_access_flags(view), access)); +} + +// TODO(allen): redocument +API_EXPORT bool32 +Get_Buffer_Summary(Application_Links *app, Buffer_ID buffer_id, Access_Flag access, Buffer_Summary *buffer_summary_out) /* DOC_PARAM(buffer_id, The parameter buffer_id specifies which buffer to try to get.) DOC_PARAM(access, The access parameter determines what levels of protection this call can access.) @@ -516,19 +525,18 @@ DOC_SEE(Buffer_ID) */{ Models *models = (Models*)app->cmd_context; Working_Set *working_set = &models->working_set; - Buffer_Summary buffer = {}; Editing_File *file = working_set_get_active_file(working_set, buffer_id); - if (file != 0 && !file->is_dummy){ - fill_buffer_summary(&buffer, file, working_set); - if (!access_test(buffer.lock_flags, access)){ - memset(&buffer, 0, sizeof(buffer)); - } + if (buffer_api_check_file(file, access)){ + fill_buffer_summary(buffer_summary_out, file, working_set); + return(true); } - return(buffer); + block_zero_struct(buffer_summary_out); + return(false); } -API_EXPORT Buffer_Summary -Get_Buffer_By_Name(Application_Links *app, char *name, int32_t len, Access_Flag access) +// TODO(allen): redocument +API_EXPORT bool32 +Get_Buffer_By_Name(Application_Links *app, String name, Access_Flag access, Buffer_ID *buffer_id_out) /* DOC_PARAM(name, The name parameter specifies the buffer name to try to get. The string need not be null terminated.) DOC_PARAM(len, The len parameter specifies the length of the name string.) @@ -543,19 +551,18 @@ DOC_SEE(Access_Flag) */{ Models *models = (Models*)app->cmd_context; Working_Set *working_set = &models->working_set; - Buffer_Summary buffer = {}; - Editing_File *file = working_set_contains_name(working_set, make_string(name, len)); - if (file != 0 && !file->is_dummy){ - fill_buffer_summary(&buffer, file, working_set); - if (!access_test(buffer.lock_flags, access)){ - memset(&buffer, 0, sizeof(buffer)); - } + Editing_File *file = working_set_contains_name(working_set, name); + if (buffer_api_check_file(file, access)){ + *buffer_id_out = file->id.id; + return(true); } - return(buffer); + *buffer_id_out = 0; + return(false); } -API_EXPORT Buffer_Summary -Get_Buffer_By_File_Name(Application_Links *app, char *name, int32_t len, Access_Flag access) +// TODO(allen): redocument +API_EXPORT bool32 +Get_Buffer_By_File_Name(Application_Links *app, String file_name, Access_Flag access, Buffer_ID *buffer_id_out) /* DOC_PARAM(name, The name parameter specifies the buffer name to try to get. The string need not be null terminated.) DOC_PARAM(len, The len parameter specifies the length of the name string.) @@ -572,32 +579,30 @@ DOC_SEE(Access_Flag) Models *models = (Models*)app->cmd_context; System_Functions *system = models->system; Working_Set *working_set = &models->working_set; - Buffer_Summary buffer = {}; - String fname = make_string(name, len); Editing_File_Name canon = {}; - if (get_canon_name(system, fname, &canon)){ + if (get_canon_name(system, file_name, &canon)){ Editing_File *file = working_set_contains_canon(working_set, canon.name); - if (file != 0){ - fill_buffer_summary(&buffer, file, working_set); - if (!access_test(buffer.lock_flags, access)){ - memset(&buffer, 0, sizeof(buffer)); - } + if (buffer_api_check_file(file, access)){ + *buffer_id_out = file->id.id; + return(true); } } - return(buffer); + *buffer_id_out = 0; + return(false); } +// TODO(allen): redocument API_EXPORT bool32 -Buffer_Read_Range(Application_Links *app, Buffer_Summary *buffer, int32_t start, int32_t end, char *out) +Buffer_Read_Range(Application_Links *app, Buffer_ID buffer_id, int32_t start, int32_t one_past_last, char *out) /* DOC_PARAM(buffer, This parameter specifies the buffer to read.) DOC_PARAM(start, This parameter specifies absolute position of the first character in the read range.) -DOC_PARAM(end, This parameter specifies the absolute position of the the character one past the end of the read range.) +DOC_PARAM(one_past_last, This parameter specifies the absolute position of the the character one past the end of the read range.) DOC_PARAM(out, This paramter provides the output character buffer to fill with the result of the read.) DOC_RETURN(This call returns non-zero if the read succeeds.) DOC ( -The output buffer must have a capacity of at least (end - start). +The output buffer must have a capacity of at least (one_past_last - start). The output is not null terminated. This call fails if the buffer does not exist, @@ -606,22 +611,21 @@ or if the read range is not within the bounds of the buffer. DOC_SEE(4coder_Buffer_Positioning_System) */{ Models *models = (Models*)app->cmd_context; - Editing_File *file = imp_get_file(models, buffer); + Editing_File *file = imp_get_file(models, buffer_id); bool32 result = false; - int32_t size = 0; - if (file != 0){ - size = buffer_size(&file->state.buffer); - if (0 <= start && start <= end && end <= size){ + if (buffer_api_check_file(file)){ + i32 size = buffer_size(&file->state.buffer); + if (0 <= start && start <= one_past_last && one_past_last <= size){ + buffer_stringify(&file->state.buffer, start, one_past_last, out); result = true; - buffer_stringify(&file->state.buffer, start, end, out); } - fill_buffer_summary(buffer, file, &models->working_set); } return(result); } +// TODO(allen): redocument API_EXPORT bool32 -Buffer_Replace_Range(Application_Links *app, Buffer_Summary *buffer, int32_t start, int32_t one_past_last, char *str, int32_t len) +Buffer_Replace_Range(Application_Links *app, Buffer_ID buffer_id, int32_t start, int32_t one_past_last, String string) /* DOC_PARAM(buffer, This parameter specifies the buffer to edit.) DOC_PARAM(start, This parameter specifies absolute position of the first character in the replace range.) @@ -643,17 +647,17 @@ range is not within the bounds of the buffer. DOC_SEE(4coder_Buffer_Positioning_System) */{ Models *models = (Models*)app->cmd_context; - Editing_File *file = imp_get_file(models, buffer); + Editing_File *file = imp_get_file(models, buffer_id); bool32 result = false; int32_t size = 0; - if (file != 0){ + if (buffer_api_check_file(file)){ size = buffer_size(&file->state.buffer); if (0 <= start && start <= one_past_last && one_past_last <= size){ b32 do_low_level_edit = (file->settings.edit_handler == 0 || file->state.in_edit_handler); if (do_low_level_edit){ Edit edit = {}; - edit.str = str; - edit.length = len; + edit.str = string.str; + edit.length = string.size; edit.range.first = start; edit.range.one_past_last = one_past_last; Edit_Behaviors behaviors = {}; @@ -662,11 +666,10 @@ DOC_SEE(4coder_Buffer_Positioning_System) } else{ file->state.in_edit_handler = true; - result = file->settings.edit_handler(app, buffer->buffer_id, start, one_past_last, make_string(str, len)); + result = file->settings.edit_handler(app, buffer_id, start, one_past_last, string); file->state.in_edit_handler = false; } } - fill_buffer_summary(buffer, file, &models->working_set); } return(result); } @@ -675,15 +678,16 @@ API_EXPORT bool32 Buffer_Set_Edit_Handler(Application_Links *app, Buffer_ID buffer_id, Buffer_Edit_Handler *handler){ Models *models = (Models*)app->cmd_context; Editing_File *file = imp_get_file(models, buffer_id); - bool32 result = (file != 0); + bool32 result = (buffer_api_check_file(file)); if (result){ file->settings.edit_handler = handler; } return(result); } +// TODO(allen): redocument API_EXPORT bool32 -Buffer_Compute_Cursor(Application_Links *app, Buffer_Summary *buffer, Buffer_Seek seek, Partial_Cursor *cursor_out) +Buffer_Compute_Cursor(Application_Links *app, Buffer_ID buffer_id, Buffer_Seek seek, Partial_Cursor *cursor_out) /* DOC_PARAM(buffer, The buffer parameter specifies the buffer on which to run the cursor computation.) DOC_PARAM(seek, The seek parameter specifies the target position for the seek.) @@ -698,19 +702,20 @@ DOC_SEE(Buffer_Seek) DOC_SEE(Partial_Cursor) */{ Models *models = (Models*)app->cmd_context; - Editing_File *file = imp_get_file(models, buffer); + Editing_File *file = imp_get_file(models, buffer_id); bool32 result = false; - if (file != 0){ + if (buffer_api_check_file(file)){ if (file_compute_partial_cursor(file, seek, cursor_out)){ - fill_buffer_summary(buffer, file, &models->working_set); result = true; } } return(result); } +// TODO(allen): work with edit handler +// TODO(allen): redocument API_EXPORT bool32 -Buffer_Batch_Edit(Application_Links *app, Buffer_Summary *buffer, char *str, int32_t str_len, Buffer_Edit *edits, int32_t edit_count, Buffer_Batch_Edit_Type type) +Buffer_Batch_Edit(Application_Links *app, Buffer_ID buffer_id, char *str, int32_t str_len, Buffer_Edit *edits, int32_t edit_count, Buffer_Batch_Edit_Type type) /* DOC_PARAM(buffer, The buffer on which to apply the batch of edits.) DOC_PARAM(str, This parameter provides all of the source string for the edits in the batch.) @@ -727,9 +732,9 @@ DOC_SEE(Buffer_Batch_Edit_Type) Mem_Options *mem = &models->mem; Partition *part = &mem->part; System_Functions *system = models->system; - Editing_File *file = imp_get_file(models, buffer); + Editing_File *file = imp_get_file(models, buffer_id); bool32 result = false; - if (file != 0){ + if (buffer_api_check_file(file)){ if (edit_count > 0){ Temp_Memory temp = begin_temp_memory(part); Edit_Array real_edits = {}; @@ -755,8 +760,9 @@ DOC_SEE(Buffer_Batch_Edit_Type) return(result); } +// TODO(allen): redocument API_EXPORT bool32 -Buffer_Get_Setting(Application_Links *app, Buffer_Summary *buffer, Buffer_Setting_ID setting, int32_t *value_out) +Buffer_Get_Setting(Application_Links *app, Buffer_ID buffer_id, Buffer_Setting_ID setting, int32_t *value_out) /* DOC_PARAM(buffer, the buffer from which to read a setting) DOC_PARAM(setting, the setting to read from the buffer) @@ -764,9 +770,9 @@ DOC_PARAM(value_out, address to write the setting value on success) DOC_RETURN(returns non-zero on success) */{ Models *models = (Models*)app->cmd_context; - Editing_File *file = imp_get_file(models, buffer); + Editing_File *file = imp_get_file(models, buffer_id); bool32 result = false; - if (file != 0){ + if (buffer_api_check_file(file)){ result = true; switch (setting){ case BufferSetting_Lex: @@ -838,8 +844,9 @@ DOC_RETURN(returns non-zero on success) return(result); } +// TODO(allen): redocument API_EXPORT bool32 -Buffer_Set_Setting(Application_Links *app, Buffer_Summary *buffer, Buffer_Setting_ID setting, int32_t value) +Buffer_Set_Setting(Application_Links *app, Buffer_ID buffer_id, Buffer_Setting_ID setting, int32_t value) /* DOC_PARAM(buffer, The buffer parameter specifies the buffer on which to set a setting.) DOC_PARAM(setting, The setting parameter identifies the setting that shall be changed.) @@ -848,12 +855,10 @@ DOC_SEE(Buffer_Setting_ID) */{ Models *models = (Models*)app->cmd_context; System_Functions *system = models->system; - Editing_File *file = imp_get_file(models, buffer); + Editing_File *file = imp_get_file(models, buffer_id); + bool32 result = false; - bool32 result = false; - i32 new_mapid = 0; - - if (file != 0){ + if (buffer_api_check_file(file)){ result = true; switch (setting){ case BufferSetting_Lex: @@ -941,7 +946,7 @@ DOC_SEE(Buffer_Setting_ID) case BufferSetting_MapID: { if (value < mapid_global){ - new_mapid = get_map_index(&models->mapping, value); + i32 new_mapid = get_map_index(&models->mapping, value); if (new_mapid < models->mapping.user_map_count){ file->settings.base_map_id = value; } @@ -1032,7 +1037,6 @@ DOC_SEE(Buffer_Setting_ID) result = 0; }break; } - fill_buffer_summary(buffer, file, &models->working_set); } return(result); @@ -1048,8 +1052,9 @@ buffer_get_managed_scope__inner(Editing_File *file){ return(lifetime); } -API_EXPORT Managed_Scope -Buffer_Get_Managed_Scope(Application_Links *app, Buffer_ID buffer_id) +// TODO(allen): redocument +API_EXPORT bool32 +Buffer_Get_Managed_Scope(Application_Links *app, Buffer_ID buffer_id, Managed_Scope *scope_out) /* DOC_PARAM(buffer_id, The id of the buffer from which to get a managed scope.) DOC_RETURN(If the buffer_id specifies a valid buffer, the scope returned is the scope tied to the @@ -1059,27 +1064,35 @@ If the buffer_id does not specify a valid buffer, the returned scope is null.) { Models *models = (Models*)app->cmd_context; Editing_File *file = imp_get_file(models, buffer_id); - return(buffer_get_managed_scope__inner(file)); + if (buffer_api_check_file(file)){ + *scope_out = buffer_get_managed_scope__inner(file); + return(true); + } + *scope_out = 0; + return(false); } -API_EXPORT int32_t -Buffer_Token_Count(Application_Links *app, Buffer_Summary *buffer) +// TODO(allen): redocument +API_EXPORT bool32 +Buffer_Token_Count(Application_Links *app, Buffer_ID buffer_id, int32_t *count_out) /* DOC_PARAM(buffer, Specifies the buffer from which to read the token count.) DOC_RETURN(If tokens are available for the buffer, the number of tokens on the buffer is returned. If the buffer does not exist or if it is not a lexed buffer, the return is zero.) */{ Models *models = (Models*)app->cmd_context; - Editing_File *file = imp_get_file(models, buffer); - int32_t count = 0; - if (file != 0 && file->state.token_array.tokens && file->state.tokens_complete){ - count = file->state.token_array.count; + Editing_File *file = imp_get_file(models, buffer_id); + if (buffer_api_check_file_and_tokens(file)){ + *count_out = file->state.token_array.count; + return(true); } - return(count); + *count_out = 0; + return(false); } +// TODO(allen): redocument API_EXPORT bool32 -Buffer_Read_Tokens(Application_Links *app, Buffer_Summary *buffer, int32_t start_token, int32_t end_token, Cpp_Token *tokens_out) +Buffer_Read_Tokens(Application_Links *app, Buffer_ID buffer_id, int32_t start_token, int32_t end_token, Cpp_Token *tokens_out) /* DOC_PARAM(buffer, Specifies the buffer from which to read tokens.) DOC_PARAM(first_token, Specifies the index of the first token to read.) @@ -1091,36 +1104,39 @@ DOC(Puts the data for the tokens with the indices [first_token,last_token) into The number of output tokens will be end_token - start_token.) */{ Models *models = (Models*)app->cmd_context; - Editing_File *file = imp_get_file(models, buffer); - Cpp_Token_Array token_array = file->state.token_array; + Editing_File *file = imp_get_file(models, buffer_id); bool32 result = false; - if (file != 0 && token_array.tokens != 0 && file->state.tokens_complete){ + if (buffer_api_check_file_and_tokens(file)){ + Cpp_Token_Array token_array = file->state.token_array; if (0 <= start_token && start_token <= end_token && end_token <= token_array.count){ + block_copy(tokens_out, token_array.tokens + start_token, sizeof(Cpp_Token)*(end_token - start_token)); result = true; - memcpy(tokens_out, token_array.tokens + start_token, sizeof(Cpp_Token)*(end_token - start_token)); } } return(result); } +// TODO(allen): redocument // TODO(allen): Include warning note about pointers and editing buffers. API_EXPORT bool32 -Buffer_Get_Token_Range(Application_Links *app, Buffer_Summary *buffer, Cpp_Token **first_token_out, Cpp_Token **one_past_last_token_out) +Buffer_Get_Token_Range(Application_Links *app, Buffer_ID buffer_id, Cpp_Token **first_token_out, Cpp_Token **one_past_last_token_out) { Models *models = (Models*)app->cmd_context; - Editing_File *file = imp_get_file(models, buffer); + Editing_File *file = imp_get_file(models, buffer_id); Cpp_Token_Array token_array = file->state.token_array; - bool32 result = false; if (file != 0 && token_array.tokens != 0 && file->state.tokens_complete){ - result = true; *first_token_out = token_array.tokens; *one_past_last_token_out = token_array.tokens + token_array.count; + return(true); } - return(result); + *first_token_out = 0; + *one_past_last_token_out = 0; + return(false); } +// TODO(allen): redocument API_EXPORT bool32 -Buffer_Get_Token_Index(Application_Links *app, Buffer_Summary *buffer, int32_t pos, Cpp_Get_Token_Result *get_result) +Buffer_Get_Token_Index(Application_Links *app, Buffer_ID buffer_id, int32_t pos, Cpp_Get_Token_Result *get_result) /* DOC_PARAM(buffer, The buffer from which to get a token.) DOC_PARAM(pos, The position in the buffer in absolute coordinates.) @@ -1131,45 +1147,48 @@ DOC_SEE(Cpp_Get_Token_Result) DOC_SEE(cpp_get_token) */{ Models *models = (Models*)app->cmd_context; - Editing_File *file = imp_get_file(models, buffer); + Editing_File *file = imp_get_file(models, buffer_id); Cpp_Token_Array token_array = file->state.token_array; - - bool32 result = false; - if (file != 0 && token_array.tokens != 0 && file->state.tokens_complete){ - result = true; + if (buffer_api_check_file_and_tokens(file)){ *get_result = cpp_get_token(token_array, pos); + return(true); } - - return(result); + block_zero_struct(get_result); + return(false); } +// TODO(allen): redocument API_EXPORT bool32 -Buffer_Send_End_Signal(Application_Links *app, Buffer_Summary *buffer) +Buffer_Send_End_Signal(Application_Links *app, Buffer_ID buffer_id) /* DOC_PARAM(buffer, The buffer to which to send the end signal.) DOC_RETURN(Returns non-zero on success. This call can fail if the buffer doesn't exist.) -DOC(Whenever a buffer is killed an end signal is sent which triggers the end file hook. This call sends the end signal to the buffer without killing the buffer. This is useful in cases such as clearing a buffer and refilling it with new contents.) +DOC(Whenever a buffer is killed an end signal is sent which triggers the end file hook. This call sends the end signal to the buffer without killing the buffer. +This is useful in cases such as clearing a buffer and refilling it with new contents.) */{ Models *models = (Models*)app->cmd_context; - Editing_File *file = imp_get_file(models, buffer); - bool32 result = false; - if (file != 0){ - result = true; + Editing_File *file = imp_get_file(models, buffer_id); + if (buffer_api_check_file(file)){ file_end_file(models, file); + return(true); } - return(result); + return(false); } -API_EXPORT Buffer_Summary -Create_Buffer(Application_Links *app, char *filename, int32_t filename_len, Buffer_Create_Flag flags) +// TODO(allen): redocument +API_EXPORT bool32 +Create_Buffer(Application_Links *app, String file_name, Buffer_Create_Flag flags, Buffer_ID *new_buffer_id_out) /* DOC_PARAM(filename, The name of the file to associate to the new buffer.) DOC_PARAM(filename_len, The length of the filename string.) DOC_PARAM(flags, Flags controlling the buffer creation behavior.) DOC_RETURN(Returns the newly created buffer or an already existing buffer with the given name.) -DOC(Try to create a new buffer. This call first checks to see if a buffer already exists that goes by the given name, if so, that buffer is returned. +DOC( +Try to create a new buffer. This call first checks to see if a buffer already exists that goes by the given name, if so, that buffer is returned. -If no buffer exists with the given name, then a new buffer is created. If a file that matches the given filename exists, the file is loaded as the contents of the new buffer. Otherwise a buffer is created without a matching file until the buffer is saved and the buffer is left blank.) +If no buffer exists with the given name, then a new buffer is created. If a file that matches the given filename exists, the file is loaded as the contents of the new buffer. +Otherwise a buffer is created without a matching file until the buffer is saved and the buffer is left blank. +) DOC_SEE(Buffer_Create_Flag) */{ Models *models = (Models*)app->cmd_context; @@ -1178,21 +1197,22 @@ DOC_SEE(Buffer_Create_Flag) Heap *heap = &models->mem.heap; Partition *part = &models->mem.part; - Buffer_Summary result = {}; - b32 buffer_is_for_new_file = false; + bool32 result = false; + + *new_buffer_id_out = 0; - if (filename_len > 0){ + if (file_name.size > 0){ Temp_Memory temp = begin_temp_memory(part); - String fname = make_string(filename, filename_len); Editing_File *file = 0; b32 do_empty_buffer = false; Editing_File_Name canon = {}; b32 has_canon_name = false; + b32 buffer_is_for_new_file = false; // NOTE(allen): Try to get the file by canon name. if ((flags & BufferCreate_NeverAttachToFile) == 0){ - if (get_canon_name(system, fname, &canon)){ + if (get_canon_name(system, file_name, &canon)){ has_canon_name = true; file = working_set_contains_canon(working_set, canon.name); } @@ -1204,7 +1224,7 @@ DOC_SEE(Buffer_Create_Flag) // NOTE(allen): Try to get the file by buffer name. if ((flags & BufferCreate_MustAttachToFile) == 0){ if (file == 0){ - file = working_set_contains_name(working_set, fname); + file = working_set_contains_name(working_set, file_name); } } @@ -1232,11 +1252,12 @@ DOC_SEE(Buffer_Create_Flag) file = working_set_alloc_always(working_set, heap, &models->lifetime_allocator); if (file != 0){ if (has_canon_name){ - file_bind_filename(system, heap, working_set, file, canon.name); + file_bind_file_name(system, heap, working_set, file, canon.name); } - buffer_bind_name(models, heap, part, working_set, file, front_of_directory(fname)); + buffer_bind_name(models, heap, part, working_set, file, front_of_directory(file_name)); init_normal_file(system, models, 0, 0, file); - fill_buffer_summary(&result, file, &models->working_set); + *new_buffer_id_out = file->id.id; + result = true; } } } @@ -1257,10 +1278,11 @@ DOC_SEE(Buffer_Create_Flag) system->load_close(handle); file = working_set_alloc_always(working_set, heap, &models->lifetime_allocator); if (file != 0){ - file_bind_filename(system, heap, working_set, file, canon.name); - buffer_bind_name(models, heap, part, working_set, file, front_of_directory(fname)); + file_bind_file_name(system, heap, working_set, file, canon.name); + buffer_bind_name(models, heap, part, working_set, file, front_of_directory(file_name)); init_normal_file(system, models, buffer, size, file); - fill_buffer_summary(&result, file, &models->working_set); + *new_buffer_id_out = file->id.id; + result = true; } } else{ @@ -1273,7 +1295,8 @@ DOC_SEE(Buffer_Create_Flag) } } else{ - fill_buffer_summary(&result, file, &models->working_set); + *new_buffer_id_out = file->id.id; + result = true; } if (file != 0 && (flags & BufferCreate_JustChangedFile) != 0){ @@ -1306,8 +1329,9 @@ DOC_SEE(Buffer_Create_Flag) return(result); } +// TODO(allen): redocument API_EXPORT bool32 -Save_Buffer(Application_Links *app, Buffer_Summary *buffer, char *file_name, int32_t file_name_len, uint32_t flags) +Buffer_Save(Application_Links *app, Buffer_ID buffer_id, String file_name, uint32_t flags) /* DOC_PARAM(buffer, The buffer parameter specifies the buffer to save to a file.) DOC_PARAM(file_name, The file_name parameter specifies the name of the file to write with the contents of the buffer; it need not be null terminated.) @@ -1319,10 +1343,10 @@ DOC_SEE(Buffer_Save_Flag) */{ Models *models = (Models*)app->cmd_context; System_Functions *system = models->system; - Editing_File *file = imp_get_file(models, buffer); + Editing_File *file = imp_get_file(models, buffer_id); bool32 result = false; - if (file != 0){ + if (buffer_api_check_file(file)){ b32 skip_save = false; if (!(flags & BufferSave_IgnoreDirtyFlag)){ if (file->state.dirty == DirtyState_UpToDate){ @@ -1331,21 +1355,21 @@ DOC_SEE(Buffer_Save_Flag) } if (!skip_save){ - result = true; - Partition *part = &models->mem.part; Temp_Memory temp = begin_temp_memory(part); - String name = push_string(part, file_name, file_name_len); + String name = push_string(part, file_name); save_file_to_name(system, models, file, name.str); end_temp_memory(temp); + result = true; } } return(result); } -API_EXPORT Buffer_Kill_Result -Kill_Buffer(Application_Links *app, Buffer_Identifier buffer, Buffer_Kill_Flag flags) +// TODO(allen): redocument +API_EXPORT bool32 +Buffer_Kill(Application_Links *app, Buffer_ID buffer_id, Buffer_Kill_Flag flags, Buffer_Kill_Result *result) /* DOC_PARAM(buffer, The buffer parameter specifies the buffer to try to kill.) DOC_PARAM(flags, The flags parameter specifies behaviors for the buffer kill.) @@ -1361,11 +1385,10 @@ DOC_SEE(Buffer_Identifier) */{ Models *models = (Models*)app->cmd_context; System_Functions *system = models->system; - Buffer_Kill_Result result = BufferKillResult_DoesNotExist; Working_Set *working_set = &models->working_set; - Editing_File *file = get_file_from_identifier(system, working_set, buffer); - if (file != 0){ - result = BufferKillResult_Unkillable; + Editing_File *file = imp_get_file(models, buffer_id); + *result = BufferKillResult_DoesNotExist; + if (buffer_api_check_file(file)){ if (!file->settings.never_kill){ b32 needs_to_save = file_needs_save(file); if (!needs_to_save || (flags & BufferKill_AlwaysKill) != 0){ @@ -1403,124 +1426,117 @@ DOC_SEE(Buffer_Identifier) } } - result = BufferKillResult_Killed; + *result = BufferKillResult_Killed; } else{ - result = BufferKillResult_Dirty; + *result = BufferKillResult_Dirty; } } + else{ + *result = BufferKillResult_Unkillable; + } } - return(result); + return(*result == BufferKillResult_Killed); } -API_EXPORT Buffer_Reopen_Result -Reopen_Buffer(Application_Links *app, Buffer_Summary *buffer, Buffer_Reopen_Flag flags) +API_EXPORT bool32 +Buffer_Reopen(Application_Links *app, Buffer_ID buffer_id, Buffer_Reopen_Flag flags, Buffer_Reopen_Result *result) { Models *models = (Models*)app->cmd_context; System_Functions *system = models->system; - Editing_File *file = imp_get_file(models, buffer); - - Buffer_Reopen_Result result = BufferReopenResult_Failed; - - if (file->canon.name.str != 0 && file->canon.name.size != 0){ - Plat_Handle handle = {}; - if (system->load_handle(file->canon.name.str, &handle)){ - i32 size = system->load_size(handle); - - Partition *part = &models->mem.part; - Temp_Memory temp = begin_temp_memory(part); - char *file_memory = push_array(part, char, size); - - if (file_memory != 0){ - if (system->load_file(handle, file_memory, size)){ - system->load_close(handle); - - // TODO(allen): try(perform a diff maybe apply edits in reopen) - - int32_t line_numbers[16]; - int32_t column_numbers[16]; - View *vptrs[16]; - i32 vptr_count = 0; - - Layout *layout = &models->layout; - for (Panel *panel = layout_get_first_open_panel(layout); - panel != 0; - panel = layout_get_next_open_panel(layout, panel)){ - View *view_it = panel->view; - if (view_it->file_data.file != file){ - continue; + Editing_File *file = imp_get_file(models, buffer_id); + *result = BufferReopenResult_Failed; + if (buffer_api_check_file(file)){ + if (file->canon.name.str != 0 && file->canon.name.size != 0){ + Plat_Handle handle = {}; + if (system->load_handle(file->canon.name.str, &handle)){ + i32 size = system->load_size(handle); + + Partition *part = &models->mem.part; + Temp_Memory temp = begin_temp_memory(part); + char *file_memory = push_array(part, char, size); + + if (file_memory != 0){ + if (system->load_file(handle, file_memory, size)){ + system->load_close(handle); + + // TODO(allen): try(perform a diff maybe apply edits in reopen) + + int32_t line_numbers[16]; + int32_t column_numbers[16]; + View *vptrs[16]; + i32 vptr_count = 0; + + Layout *layout = &models->layout; + for (Panel *panel = layout_get_first_open_panel(layout); + panel != 0; + panel = layout_get_next_open_panel(layout, panel)){ + View *view_it = panel->view; + if (view_it->file_data.file != file){ + continue; + } + vptrs[vptr_count] = view_it; + File_Edit_Positions edit_pos = view_get_edit_pos(view_it); + Full_Cursor cursor = file_compute_cursor(system, view_it->file_data.file, seek_pos(edit_pos.cursor_pos)); + line_numbers[vptr_count] = cursor.line; + column_numbers[vptr_count] = cursor.character; + view_it->file_data.file = models->scratch_buffer; + ++vptr_count; } - vptrs[vptr_count] = view_it; - File_Edit_Positions edit_pos = view_get_edit_pos(view_it); - Full_Cursor cursor = file_compute_cursor(system, view_it->file_data.file, seek_pos(edit_pos.cursor_pos)); - line_numbers[vptr_count] = cursor.line; - column_numbers[vptr_count] = cursor.character; - view_it->file_data.file = models->scratch_buffer; - ++vptr_count; - } - - file_free(system, &models->mem.heap, &models->lifetime_allocator, file); - working_set_file_default_settings(&models->working_set, file); - init_normal_file(system, models, file_memory, size, file); - - for (i32 i = 0; i < vptr_count; ++i){ - view_set_file(system, models, vptrs[i], file); - vptrs[i]->file_data.file = file; - Full_Cursor cursor = file_compute_cursor(system, file, seek_line_char(line_numbers[i], column_numbers[i])); + file_free(system, &models->mem.heap, &models->lifetime_allocator, file); + working_set_file_default_settings(&models->working_set, file); + init_normal_file(system, models, file_memory, size, file); - view_set_cursor(system, vptrs[i], cursor, true); + for (i32 i = 0; i < vptr_count; ++i){ + view_set_file(system, models, vptrs[i], file); + + vptrs[i]->file_data.file = file; + Full_Cursor cursor = file_compute_cursor(system, file, seek_line_char(line_numbers[i], column_numbers[i])); + + view_set_cursor(system, vptrs[i], cursor, true); + } + + *result = BufferReopenResult_Reopened; + } + else{ + system->load_close(handle); } - - result = BufferReopenResult_Reopened; } else{ system->load_close(handle); } + + end_temp_memory(temp); } - else{ - system->load_close(handle); - } - - end_temp_memory(temp); } } - return(result); + return(*result == BufferReopenResult_Reopened); } -internal void -get_view_first__internal(Models *models, View_Summary *view){ - Panel *panel = layout_get_first_open_panel(&models->layout); - fill_view_summary(models->system, view, panel->view, models); -} - -internal void -get_view_next__internal(Models *models, View_Summary *view){ - System_Functions *system = models->system; - Layout *layout = &models->layout; - Live_Views *live_set = &models->live_set; - i32 index = view->view_id - 1; - if (index >= 0 && index < live_set->max){ - View *vptr = live_set->views + index; - Panel *panel = vptr->panel; +internal View* +get_view_next__inner(Layout *layout, View *view){ + if (view != 0){ + Panel *panel = view->panel; + panel = layout_get_next_open_panel(layout, panel); if (panel != 0){ - panel = layout_get_next_open_panel(layout, panel); - } - if (panel != 0){ - fill_view_summary(system, view, panel->view, models); + view = panel->view; } else{ - block_zero_struct(view); + view = 0; } } else{ - block_zero_struct(view); + Panel *panel = layout_get_first_open_panel(layout); + view = panel->view; } + return(view); } -API_EXPORT View_Summary -Get_View_First(Application_Links *app, Access_Flag access) +// TODO(allen): redocument +API_EXPORT bool32 +Get_View_First(Application_Links *app, Access_Flag access, View_ID *view_id_out) /* DOC_PARAM(access, The access parameter determines what levels of protection this call can access.) DOC_RETURN(This call returns the summary of the first view in a view loop.) @@ -1534,16 +1550,22 @@ DOC_SEE(Access_Flag) DOC_SEE(get_view_next) */{ Models *models = (Models*)app->cmd_context; - View_Summary view = {}; - get_view_first__internal(models, &view); - while (view.exists && !access_test(view.lock_flags, access)){ - get_view_next__internal(models, &view); + Layout *layout = &models->layout; + View *view = get_view_next__inner(layout, 0); + for (;view != 0 && !access_test(view_get_access_flags(view), access);){ + view = get_view_next__inner(layout, view); } - return(view); + if (view != 0){ + *view_id_out = view_get_id(&models->live_set, view); + return(true); + } + *view_id_out = 0; + return(false); } -API_EXPORT void -Get_View_Next(Application_Links *app, View_Summary *view, Access_Flag access) +// TODO(allen): redocument +API_EXPORT bool32 +Get_View_Next(Application_Links *app, View_ID view_id, Access_Flag access, View_ID *view_id_out) /* DOC_PARAM(view, The View_Summary pointed to by view is iterated to the next view or to a null summary if this is the last view.) DOC_PARAM(access, The access parameter determines what levels of protection this call can access. The view outputted will be the next view that is accessible.) @@ -1558,14 +1580,23 @@ DOC_SEE(Access_Flag) DOC_SEE(get_view_first) */{ Models *models = (Models*)app->cmd_context; - get_view_next__internal(models, view); - while (view->exists && !access_test(view->lock_flags, access)){ - get_view_next__internal(models, view); + Layout *layout = &models->layout; + View *view = imp_get_view(models, view_id); + view = get_view_next__inner(layout, view); + for (;view != 0 && !access_test(view_get_access_flags(view), access);){ + view = get_view_next__inner(layout, view); } + if (view != 0){ + *view_id_out = view_get_id(&models->live_set, view); + return(true); + } + *view_id_out = 0; + return(false); } -API_EXPORT View_Summary -Get_View(Application_Links *app, View_ID view_id, Access_Flag access) +// TODO(allen): redocument +API_EXPORT bool32 +Get_View_Summary(Application_Links *app, View_ID view_id, Access_Flag access, View_Summary *view_summary_out) /* DOC_PARAM(view_id, The view_id specifies the view to try to get.) DOC_PARAM(access, The access parameter determines what levels of protection this call can access.) @@ -1574,22 +1605,18 @@ DOC_SEE(Access_Flag) */{ Models *models = (Models*)app->cmd_context; System_Functions *system = models->system; - Live_Views *live_set = &models->live_set; - View_Summary view = {}; - i32 max = live_set->max; - view_id -= 1; - if (view_id >= 0 && view_id < max){ - View *vptr = live_set->views + view_id; - fill_view_summary(system, &view, vptr, models); - if (!access_test(view.lock_flags, access)){ - memset(&view, 0, sizeof(view)); - } + View *view = imp_get_view(models, view_id); + if (view_api_check_view(view, access)){ + fill_view_summary(system, view_summary_out, view, models); + return(true); } - return(view); + block_zero_struct(view_summary_out); + return(false); } -API_EXPORT View_Summary -Get_Active_View(Application_Links *app, Access_Flag access) +// TODO(allen): redocument +API_EXPORT bool32 +Get_Active_View(Application_Links *app, Access_Flag access, View_ID *view_id_out) /* DOC_PARAM(access, The access parameter determines what levels of protection this call can access.) DOC_RETURN(This call returns a summary that describes the active view.) @@ -1597,19 +1624,21 @@ DOC_SEE(set_active_view) DOC_SEE(Access_Flag) */{ Models *models = (Models*)app->cmd_context; - System_Functions *system = models->system; Panel *panel = layout_get_active_panel(&models->layout); - Assert(panel->view != 0); - View_Summary view = {}; - fill_view_summary(system, &view, panel->view, &models->live_set, &models->working_set); - if (!access_test(view.lock_flags, access)){ - block_zero_struct(&view); + Assert(panel != 0); + View *view = panel->view; + Assert(view != 0); + if (view_api_check_view(view, access)){ + *view_id_out = view_get_id(&models->live_set, view); + return(true); } - return(view); + *view_id_out = 0; + return(false); } -API_EXPORT View_Summary -Open_View(Application_Links *app, View_Summary *view_location, View_Split_Position position) +// TODO(allen): redocument +API_EXPORT bool32 +Open_View(Application_Links *app, View_ID location, View_Split_Position position, View_ID *view_id_out) /* DOC_PARAM(view_location, The view_location parameter specifies the view to split to open the new view.) DOC_PARAM(position, The position parameter specifies how to split the view and where to place the new view.) @@ -1619,26 +1648,30 @@ DOC(4coder is built with a limit of 16 views. If 16 views are already open when DOC_SEE(View_Split_Position) */{ Models *models = (Models*)app->cmd_context; - System_Functions *system = models->system; Layout *layout = &models->layout; - View *vptr = imp_get_view(models, view_location); - Panel *panel = vptr->panel; - View_Summary result = {}; - b32 vertical_split = ((position == ViewSplit_Left) || (position == ViewSplit_Right)); - b32 br_split = ((position == ViewSplit_Bottom) || (position == ViewSplit_Right)); - Panel *new_panel = layout_split_panel(layout, panel, vertical_split, br_split); - if (new_panel != 0){ - View *new_view = live_set_alloc_view(&models->mem.heap, &models->lifetime_allocator, &models->live_set); - new_panel->view = new_view; - new_view->panel = new_panel; - view_set_file(system, models, new_view, models->scratch_buffer); - fill_view_summary(system, &result, new_view, models); + View *view = imp_get_view(models, location); + if (view_api_check_view(view)){ + Panel *panel = view->panel; + b32 vertical_split = ((position == ViewSplit_Left) || (position == ViewSplit_Right)); + b32 br_split = ((position == ViewSplit_Bottom) || (position == ViewSplit_Right)); + Panel *new_panel = layout_split_panel(layout, panel, vertical_split, br_split); + if (new_panel != 0){ + Live_Views *live_set = &models->live_set; + View *new_view = live_set_alloc_view(&models->mem.heap, &models->lifetime_allocator, live_set); + new_panel->view = new_view; + new_view->panel = new_panel; + view_set_file(models->system, models, new_view, models->scratch_buffer); + *view_id_out = view_get_id(live_set, new_view); + return(true); + } } - return(result); + *view_id_out = 0; + return(false); } +// TODO(allen): redocument API_EXPORT bool32 -Close_View(Application_Links *app, View_Summary *view) +View_Close(Application_Links *app, View_ID view_id) /* DOC_PARAM(view, The view parameter specifies which view to close.) DOC_RETURN(This call returns non-zero on success.) @@ -1651,21 +1684,20 @@ in the system, the call will fail.) */{ Models *models = (Models*)app->cmd_context; Layout *layout = &models->layout; - View *vptr = imp_get_view(models, view); - + View *view = imp_get_view(models, view_id); bool32 result = false; - if (vptr != 0){ - if (layout_close_panel(layout, vptr->panel)){ - live_set_free_view(&models->mem.heap, &models->lifetime_allocator, &models->live_set, vptr); + if (view_api_check_view(view)){ + if (layout_close_panel(layout, view->panel)){ + live_set_free_view(&models->mem.heap, &models->lifetime_allocator, &models->live_set, view); result = true; } } - return(result); } +// TODO(allen): redocument API_EXPORT bool32 -Set_Active_View(Application_Links *app, View_Summary *view) +View_Set_Active(Application_Links *app, View_ID view_id) /* DOC_PARAM(view, The view parameter specifies which view to make active.) DOC_RETURN(This call returns non-zero on success.) @@ -1675,17 +1707,18 @@ from get_active_view.) DOC_SEE(get_active_view) */{ Models *models = (Models*)app->cmd_context; - View *vptr = imp_get_view(models, view); + View *view = imp_get_view(models, view_id); bool32 result = false; - if (vptr != 0){ - models->layout.active_panel = vptr->panel; + if (view_api_check_view(view)){ + models->layout.active_panel = view->panel; result = true; } return(result); } +// TODO(allen): redocument API_EXPORT bool32 -View_Get_Setting(Application_Links *app, View_Summary *view, View_Setting_ID setting, int32_t *value_out) +View_Get_Setting(Application_Links *app, View_ID view_id, View_Setting_ID setting, int32_t *value_out) /* DOC_PARAM(view, the view from which to read a setting) DOC_PARAM(setting, the view setting to read) @@ -1693,44 +1726,44 @@ DOC_PARAM(value_out, address to write the setting value on success) DOC_RETURN(returns non-zero on success) */{ Models *models = (Models*)app->cmd_context; - View *vptr = imp_get_view(models, view); - int32_t result = 0; + View *view = imp_get_view(models, view_id); - if (vptr != 0){ - result = 1; + bool32 result = false; + if (view_api_check_view(view)){ + result = true; switch (setting){ case ViewSetting_ShowWhitespace: { - *value_out = vptr->file_data.show_whitespace; + *value_out = view->file_data.show_whitespace; }break; case ViewSetting_ShowScrollbar: { - *value_out = !vptr->hide_scrollbar; + *value_out = !view->hide_scrollbar; }break; case ViewSetting_ShowFileBar: { - *value_out = !vptr->hide_file_bar; + *value_out = !view->hide_file_bar; }break; case ViewSetting_UICommandMap: { - *value_out = vptr->ui_map_id; + *value_out = view->ui_map_id; }break; default: { - result = 0; + result = false; }break; } } - return(result); } +// TODO(allen): redocument API_EXPORT bool32 -View_Set_Setting(Application_Links *app, View_Summary *view, View_Setting_ID setting, int32_t value) +View_Set_Setting(Application_Links *app, View_ID view_id, View_Setting_ID setting, int32_t value) /* DOC_PARAM(view, The view parameter specifies the view on which to set a setting.) DOC_PARAM(setting, The setting parameter identifies the setting that shall be changed.) @@ -1739,31 +1772,30 @@ DOC_RETURN(This call returns non-zero on success.) DOC_SEE(View_Setting_ID) */{ Models *models = (Models*)app->cmd_context; - System_Functions *system = models->system; - View *vptr = imp_get_view(models, view); - bool32 result = false; + View *view = imp_get_view(models, view_id); - if (vptr != 0){ + bool32 result = false; + if (view_api_check_view(view)){ result = true; switch (setting){ case ViewSetting_ShowWhitespace: { - vptr->file_data.show_whitespace = value; + view->file_data.show_whitespace = value; }break; case ViewSetting_ShowScrollbar: { - vptr->hide_scrollbar = !value; + view->hide_scrollbar = !value; }break; case ViewSetting_ShowFileBar: { - vptr->hide_file_bar = !value; + view->hide_file_bar = !value; }break; case ViewSetting_UICommandMap: { - vptr->ui_map_id = value; + view->ui_map_id = value; }break; default: @@ -1771,15 +1803,13 @@ DOC_SEE(View_Setting_ID) result = false; }break; } - - fill_view_summary(system, view, vptr, models); } - return(result); } -API_EXPORT Managed_Scope -View_Get_Managed_Scope(Application_Links *app, View_ID view_id) +// TODO(allen): redocument +API_EXPORT bool32 +View_Get_Managed_Scope(Application_Links *app, View_ID view_id, Managed_Scope *scope) /* DOC_PARAM(view_id, The id of the view from which to get a managed scope.) DOC_RETURN(If the view_id specifies a valid view, the scope returned is the scope tied to the @@ -1789,16 +1819,18 @@ If the view_id does not specify a valid view, the returned scope is null.) { Models *models = (Models*)app->cmd_context; View *view = imp_get_view(models, view_id); - Managed_Scope lifetime = 0; - if (view != 0){ + if (view_api_check_view(view)){ Assert(view->lifetime_object != 0); - lifetime = (Managed_Scope)(view->lifetime_object->workspace.scope_id); + *scope = (Managed_Scope)(view->lifetime_object->workspace.scope_id); + return(true); } - return(lifetime); + *scope = 0; + return(false); } +// TODO(allen): redocument API_EXPORT bool32 -View_Set_Split(Application_Links *app, View_Summary *view, View_Split_Kind kind, float t) +View_Set_Split(Application_Links *app, View_ID view_id, View_Split_Kind kind, float t) /* DOC_PARAM(view, The view parameter specifies which view shall have it's size adjusted.) DOC_PARAM(kind, There are different kinds of split, see View_Split_Kind documentation for more information.) @@ -1813,11 +1845,11 @@ DOC_RETURN(This call returns non-zero on success.) */{ Models *models = (Models*)app->cmd_context; Layout *layout = &models->layout; + View *view = imp_get_view(models, view_id); - View *vptr = imp_get_view(models, view); bool32 result = false; - if (vptr != 0){ - Panel *panel = vptr->panel; + if (view_api_check_view(view)){ + Panel *panel = view->panel; Panel *intermediate = panel->parent; if (intermediate != 0){ Assert(intermediate->kind == PanelKind_Intermediate); @@ -1846,7 +1878,7 @@ DOC_RETURN(This call returns non-zero on success.) default: { - print_message(app, literal("Invalid split kind passed to view_set_split, no change made to view layout")); + print_message(app, make_lit_string("Invalid split kind passed to view_set_split, no change made to view layout")); }break; } layout_propogate_sizes_down_from_node(layout, intermediate); @@ -1857,8 +1889,9 @@ DOC_RETURN(This call returns non-zero on success.) return(result); } -API_EXPORT i32_Rect -View_Get_Enclosure_Rect(Application_Links *app, View_Summary *view) +// TODO(allen): redocument +API_EXPORT bool32 +View_Get_Enclosure_Rect(Application_Links *app, View_ID view_id, i32_Rect *rect_out) /* DOC_PARAM(view, The view whose parent rent will be returned.) DOC_RETURN(The rectangle of the panel containing this view.) @@ -1866,24 +1899,26 @@ DOC_RETURN(The rectangle of the panel containing this view.) // TODO(allen): do(remove this from the API and put it in the custom helpers) // we should just have full tree traversal API for the splits between views. Models *models = (Models*)app->cmd_context; - View *vptr = imp_get_view(models, view); - i32_Rect result = {}; - if (vptr != 0){ - Panel *panel = vptr->panel; + View *view = imp_get_view(models, view_id); + if (view_api_check_view(view)){ + Panel *panel = view->panel; Assert(panel != 0); Panel *parent = panel->parent; if (parent != 0){ - result = parent->rect_full; + *rect_out = parent->rect_full; } else{ - result = panel->rect_full; + *rect_out = panel->rect_full; } + return(true); } - return(result); + block_zero_struct(rect_out); + return(false); } +// TODO(allen): redocument API_EXPORT bool32 -View_Compute_Cursor(Application_Links *app, View_Summary *view, Buffer_Seek seek, Full_Cursor *cursor_out) +View_Compute_Cursor(Application_Links *app, View_ID view_id, Buffer_Seek seek, Full_Cursor *cursor_out) /* DOC_PARAM(view, The view parameter specifies the view on which to run the cursor computation.) DOC_PARAM(seek, The seek parameter specifies the target position for the seek.) @@ -1894,25 +1929,23 @@ DOC_SEE(Buffer_Seek) DOC_SEE(Full_Cursor) */{ Models *models = (Models*)app->cmd_context; - System_Functions *system = models->system; - View *vptr = imp_get_view(models, view); + View *view = imp_get_view(models, view_id); + bool32 result = false; - - if (vptr != 0){ - Editing_File *file = vptr->file_data.file; + if (view_api_check_view(view)){ + Editing_File *file = view->file_data.file; Assert(file != 0); - if (!file->is_loading){ + if (buffer_api_check_file(file)){ + *cursor_out = file_compute_cursor(models->system, file, seek); result = true; - *cursor_out = file_compute_cursor(system, file, seek); - fill_view_summary(system, view, vptr, models); } } - return(result); } +// TODO(allen): redocument API_EXPORT bool32 -View_Set_Cursor(Application_Links *app, View_Summary *view, Buffer_Seek seek, bool32 set_preferred_x) +View_Set_Cursor(Application_Links *app, View_ID view_id, Buffer_Seek seek, bool32 set_preferred_x) /* DOC_PARAM(view, The view parameter specifies the view in which to set the cursor.) DOC_PARAM(seek, The seek parameter specifies the target position for the seek.) @@ -1922,25 +1955,24 @@ DOC(This call sets the the view's cursor position. set_preferred_x should usual DOC_SEE(Buffer_Seek) */{ Models *models = (Models*)app->cmd_context; - System_Functions *system = models->system; - View *vptr = imp_get_view(models, view); + View *view = imp_get_view(models, view_id); + bool32 result = false; - - if (vptr != 0){ - Editing_File *file = vptr->file_data.file; - if (!file->is_loading){ - Full_Cursor cursor = file_compute_cursor(system, file, seek); - view_set_cursor(system, vptr, cursor, set_preferred_x); - fill_view_summary(system, view, vptr, models); + if (view_api_check_view(view)){ + Editing_File *file = view->file_data.file; + Assert(file != 0); + if (buffer_api_check_file(file)){ + Full_Cursor cursor = file_compute_cursor(models->system, file, seek); + view_set_cursor(models->system, view, cursor, set_preferred_x); result = true; } } - return(result); } +// TODO(allen): redocument API_EXPORT bool32 -View_Set_Scroll(Application_Links *app, View_Summary *view, GUI_Scroll_Vars scroll) +View_Set_Scroll(Application_Links *app, View_ID view_id, GUI_Scroll_Vars scroll) /* DOC_PARAM(view, The view on which to change the scroll state.) DOC_PARAM(scroll, The new scroll position for the view.) @@ -1948,29 +1980,28 @@ DOC(Set the scrolling state of the view.) DOC_SEE(GUI_Scroll_Vars) */{ Models *models = (Models*)app->cmd_context; - System_Functions *system = models->system; - View *vptr = imp_get_view(models, view); + View *view = imp_get_view(models, view_id); + bool32 result = false; - - if (vptr != 0){ - Editing_File *file = vptr->file_data.file; - if (!file->is_loading){ - result = true; - if (!vptr->ui_mode){ - view_set_scroll(system, vptr, scroll); + if (view_api_check_view(view)){ + Editing_File *file = view->file_data.file; + Assert(file != 0); + if (buffer_api_check_file(file)){ + if (!view->ui_mode){ + view_set_scroll(models->system, view, scroll); } else{ - vptr->ui_scroll = scroll; + view->ui_scroll = scroll; } - fill_view_summary(system, view, vptr, models); + result = true; } } - return(result); } +// TODO(allen): redocument API_EXPORT bool32 -View_Set_Mark(Application_Links *app, View_Summary *view, Buffer_Seek seek) +View_Set_Mark(Application_Links *app, View_ID view_id, Buffer_Seek seek) /* DOC_PARAM(view, The view parameter specifies the view in which to set the mark.) DOC_PARAM(seek, The seek parameter specifies the target position for the seek.) @@ -1979,40 +2010,29 @@ DOC(This call sets the the view's mark position.) DOC_SEE(Buffer_Seek) */{ Models *models = (Models*)app->cmd_context; - System_Functions *system = models->system; - View *vptr = imp_get_view(models, view); + View *view = imp_get_view(models, view_id); + bool32 result = false; - - if (vptr != 0){ - Editing_File *file = vptr->file_data.file; + if (view_api_check_view(view)){ + Editing_File *file = view->file_data.file; Assert(file != 0); - if (!file->is_loading){ + if (buffer_api_check_file(file)){ if (seek.type != buffer_seek_pos){ - result = true; - Full_Cursor cursor = file_compute_cursor(system, file, seek); - vptr->mark = cursor.pos; + Full_Cursor cursor = file_compute_cursor(models->system, file, seek); + view->mark = cursor.pos; } else{ - result = true; - vptr->mark = seek.pos; + view->mark = seek.pos; } - fill_view_summary(system, view, vptr, models); + result = true; } } - return(result); } +// TODO(allen): redocument API_EXPORT bool32 -View_Set_Highlight(Application_Links *app, View_Summary *view, int32_t start, int32_t end, bool32 turn_on)/* -DOC(This feature has been removed. Transition to the new highlighting system view markers which allow for -arbitrarily many highlights, and cursors, at the same time.) -*/{ - return(false); -} - -API_EXPORT bool32 -View_Set_Buffer(Application_Links *app, View_Summary *view, Buffer_ID buffer_id, Set_Buffer_Flag flags) +View_Set_Buffer(Application_Links *app, View_ID view_id, Buffer_ID buffer_id, Set_Buffer_Flag flags) /* DOC_PARAM(view, The view parameter specifies the view in which to display the buffer.) DOC_PARAM(buffer_id, The buffer_id parameter specifies which buffer to show in the view.) @@ -2022,30 +2042,28 @@ DOC(On success view_set_buffer sets the specified view's current buffer and canc DOC_SEE(Set_Buffer_Flag) */{ Models *models = (Models*)app->cmd_context; - System_Functions *system = models->system; - View *vptr = imp_get_view(models, view); + View *view = imp_get_view(models, view_id); + bool32 result = false; - - if (vptr != 0){ + if (view_api_check_view(view)){ Editing_File *file = working_set_get_active_file(&models->working_set, buffer_id); - if (file != 0){ - result = true; - if (file != vptr->file_data.file){ - view_set_file(system, models, vptr, file); + Assert(file != 0); + if (buffer_api_check_file(file)){ + if (file != view->file_data.file){ + view_set_file(models->system, models, view, file); if (!(flags & SetBuffer_KeepOriginalGUI)){ - view_quit_ui(system, models, vptr); + view_quit_ui(models->system, models, view); } } + result = true; } - - fill_view_summary(system, view, vptr, models); } - return(result); } +// TODO(allen): redocument API_EXPORT bool32 -View_Post_Fade(Application_Links *app, View_Summary *view, float seconds, int32_t start, int32_t end, int_color color) +View_Post_Fade(Application_Links *app, View_ID view_id, float seconds, int32_t start, int32_t end, int_color color) /* DOC_PARAM(view, The view parameter specifies the view onto which the fade effect shall be posted.) DOC_PARAM(seconds, This parameter specifies the number of seconds the fade effect should last.) @@ -2056,20 +2074,21 @@ DOC_RETURN(This call returns non-zero on success.) DOC_SEE(int_color) */{ Models *models = (Models*)app->cmd_context; - View *vptr = imp_get_view(models, view); + View *view = imp_get_view(models, view_id); bool32 result = false; - int32_t size = end - start; - if (vptr){ + if (view_api_check_view(view)){ + int32_t size = end - start; if (size > 0){ + view_post_paste_effect(view, seconds, start, size, color|0xFF000000); result = true; - view_post_paste_effect(vptr, seconds, start, size, color|0xFF000000); } } return(result); } +// TODO(allen): redocument API_EXPORT bool32 -View_Begin_UI_Mode(Application_Links *app, View_Summary *view) +View_Begin_UI_Mode(Application_Links *app, View_ID view_id) /* DOC_PARAM(view, A summary for the view which is to be placed into UI mode.) DOC_RETURN(This call returns non-zero on success. It can fail if view is invalid, or if the view is already in UI mode.) @@ -2079,13 +2098,13 @@ DOC_SEE(view_set_ui) */ { Models *models = (Models*)app->cmd_context; - View *vptr = imp_get_view(models, view); - if (vptr != 0){ - if (vptr->ui_mode){ + View *view = imp_get_view(models, view_id); + if (view_api_check_view(view)){ + if (view->ui_mode){ return(false); } else{ - vptr->ui_mode = true; + view->ui_mode = true; return(true); } } @@ -2094,8 +2113,9 @@ DOC_SEE(view_set_ui) } } +// TODO(allen): redocument API_EXPORT bool32 -View_End_UI_Mode(Application_Links *app, View_Summary *view) +View_End_UI_Mode(Application_Links *app, View_ID view_id) /* DOC_PARAM(view, A summary for the view which is to be taken out of UI mode.) DOC_RETURN(This call returns non-zero on success. It can fail if view is invalid, or if the view is not in UI mode.) @@ -2105,19 +2125,19 @@ DOC_SEE(view_begin_ui_mode) DOC_SEE(view_set_ui) */ { - bool32 result = false; Models *models = (Models*)app->cmd_context; - View *vptr = imp_get_view(models, view); - if (vptr != 0 && vptr->ui_mode){ - view_quit_ui(models->system, models, vptr); - vptr->ui_mode = false; + View *view = imp_get_view(models, view_id); + bool32 result = false; + if (view_api_check_view(view) && view->ui_mode){ + view_quit_ui(models->system, models, view); + view->ui_mode = false; result = true; } return(result); } API_EXPORT bool32 -View_Set_UI(Application_Links *app, View_Summary *view, UI_Control *control, UI_Quit_Function_Type *quit_function) +View_Set_UI(Application_Links *app, View_ID view_id, UI_Control *control, UI_Quit_Function_Type *quit_function) /* DOC_PARAM(view, A summary for the view which is to get the new UI widget data.) DOC_PARAM(control, A pointer to the baked UI widget data. To get data in the UI_Control format see the helper called ui_list_to_ui_control. More information about specifying widget data can be found in a comment in '4coder_ui_helper.cpp'. If this pointer is null the view's widget data is cleared to zero. The core maintains it's own copy of the widget data, so after this call the memory used to specify widget data may be freed.) @@ -2132,13 +2152,14 @@ DOC_SEE(UI_Quit_Function_Type) { Models *models = (Models*)app->cmd_context; Heap *heap = &models->mem.heap; - View *vptr = imp_get_view(models, view); - if (vptr != 0){ - if (vptr->ui_control.items != 0){ - heap_free(heap, vptr->ui_control.items); + View *view = imp_get_view(models, view_id); + + if (view_api_check_view(view)){ + if (view->ui_control.items != 0){ + heap_free(heap, view->ui_control.items); } - memset(&vptr->ui_control, 0, sizeof(vptr->ui_control)); - vptr->ui_quit = quit_function; + memset(&view->ui_control, 0, sizeof(view->ui_control)); + view->ui_quit = quit_function; if (control != 0){ if (control->count > 0){ i32 string_size = 0; @@ -2209,23 +2230,23 @@ DOC_SEE(UI_Quit_Function_Type) memcpy(new_str, old.str, old.size); } } - vptr->ui_control.items = new_items; - vptr->ui_control.count = count; + view->ui_control.items = new_items; + view->ui_control.count = count; } else{ return(false); } } - memcpy(vptr->ui_control.bounding_box, control->bounding_box, - sizeof(control->bounding_box)); + memcpy(view->ui_control.bounding_box, control->bounding_box, sizeof(control->bounding_box)); } return(true); } return(false); } -API_EXPORT UI_Control -View_Get_UI_Copy(Application_Links *app, View_Summary *view, struct Partition *part) +// TODO(allen): redocument +API_EXPORT bool32 +View_Get_UI_Copy(Application_Links *app, View_ID view_id, struct Partition *part, UI_Control *ui_control_out) /* DOC_PARAM(view, A summary for the view which is to get the new UI widget data.) DOC_PARAM(part, A memory arena onto which the UI widget data will be allocated.) @@ -2234,22 +2255,23 @@ DOC_SEE(view_set_ui) */ { Models *models = (Models*)app->cmd_context; - View *vptr = imp_get_view(models, view); - UI_Control result = {}; - if (vptr != 0 && part != 0){ - UI_Control *control = &vptr->ui_control; - result.items = push_array(part, UI_Item, control->count); - if (result.items != 0){ - result.count = control->count; + View *view = imp_get_view(models, view_id); + if (part != 0 && view_api_check_view(view)){ + UI_Control *control = &view->ui_control; + ui_control_out->items = push_array(part, UI_Item, control->count); + if (ui_control_out->items != 0){ + ui_control_out->count = control->count; // TODO(allen): do(fixup the pointers) - memcpy(result.items, control->items, sizeof(*result.items)*result.count); + block_copy(ui_control_out->items, control->items, sizeof(*ui_control_out->items)*ui_control_out->count); } else{ - return(result); + block_zero_struct(ui_control_out); + return(false); } - memcpy(result.bounding_box, control->bounding_box, sizeof(result.bounding_box)); + block_copy(ui_control_out->bounding_box, control->bounding_box, sizeof(ui_control_out->bounding_box)); + return(true); } - return(result); + return(false); } internal Dynamic_Workspace* @@ -3137,20 +3159,21 @@ DOC(Stops showing the particular query bar specified by the bar parameter.) free_query_slot(&active_view->query_set, bar); } -API_EXPORT void -Print_Message(Application_Links *app, char *str, int32_t len) +API_EXPORT bool32 +Print_Message(Application_Links *app, String message) /* DOC_PARAM(str, The str parameter specifies the string to post to *messages*; it need not be null terminated.) DOC_PARAM(len, The len parameter specifies the length of the str string.) DOC(This call posts a string to the *messages* buffer.) */{ Models *models = (Models*)app->cmd_context; - System_Functions *system = models->system; Editing_File *file = models->message_buffer; if (file != 0){ - output_file_append(system, models, file, make_string(str, len)); - file_cursor_to_end(system, models, file); + output_file_append(models->system, models, file, message); + file_cursor_to_end(models->system, models, file); + return(true); } + return(false); } API_EXPORT int32_t @@ -3188,8 +3211,9 @@ DOC_RETURN(On success this call returns a string allocated on arena that is the return(str); } -API_EXPORT void -Create_Theme(Application_Links *app, Theme *theme, char *name, int32_t len) +// TODO(allen): redocument +API_EXPORT bool32 +Create_Theme(Application_Links *app, Theme *theme, String theme_name) /* DOC_PARAM(theme, The color data of the new theme.) DOC_PARAM(name, The name of the new theme. This string need not be null terminated.) @@ -3198,7 +3222,6 @@ DOC(This call creates a new theme. If the given name is already the name of a s */{ Models *models = (Models*)app->cmd_context; Style_Library *library = &models->styles; - String theme_name = make_string(name, len); i32 count = library->count; Style *destination_style = 0; @@ -3213,15 +3236,20 @@ DOC(This call creates a new theme. If the given name is already the name of a s if (destination_style == 0 && library->count < library->max){ destination_style = &library->styles[library->count++]; destination_style->name = make_fixed_width_string(destination_style->name_); - copy(&destination_style->name, make_string(name, len)); + copy(&destination_style->name, theme_name); terminate_with_null(&destination_style->name); } - memcpy(&destination_style->theme, theme, sizeof(*theme)); + if (destination_style != 0){ + block_copy(&destination_style->theme, theme, sizeof(*theme)); + return(true); + } + return(false); } -API_EXPORT void -Change_Theme(Application_Links *app, char *name, int32_t len) +// TODO(allen): redocument +API_EXPORT bool32 +Change_Theme(Application_Links *app, String theme_name) /* DOC_PARAM(name, The name parameter specifies the name of the theme to begin using; it need not be null terminated.) DOC_PARAM(len, The len parameter specifies the length of the name string.) @@ -3229,17 +3257,18 @@ DOC(This call changes 4coder's color pallet to one of the built in themes.) */{ Models *models = (Models*)app->cmd_context; Style_Library *styles = &models->styles; - String theme_name = make_string(name, len); - i32 count = styles->count; + bool32 result = false; Style *s = styles->styles + 1; for (i32 i = 1; i < count; ++i, ++s){ if (match(s->name, theme_name)){ styles->styles[0] = *s; styles->styles[0].name.str = styles->styles[0].name_; + result = true; break; } } + return(result); } API_EXPORT bool32 @@ -3301,40 +3330,15 @@ DOC_RETURN(Returns true if the given id was a valid face and the change was made } API_EXPORT bool32 -Buffer_Set_Face(Application_Links *app, Buffer_Summary *buffer, Face_ID id) -/* -DOC_PARAM(buffer, The buffer on which to change the face.) -DOC_PARAM(id, The id of the face to try to set the buffer to use.) -DOC(Tries to set the buffer's face.) -DOC_RETURN(Returns true if the given id was a valid face and the change was made successfully.) -*/ -{ +Buffer_History_Get_Max_Record_Index(Application_Links *app, Buffer_ID buffer_id, History_Record_Index *index_out){ Models *models = (Models*)app->cmd_context; - Editing_File *file = imp_get_file(models, buffer); - - bool32 did_change = false; - - if (file != 0){ - System_Functions *system = models->system; - Font_Pointers font = system->font.get_pointers_by_id(id); - if (font.valid){ - did_change = true; - file_set_font(system, models, file, id); - } + Editing_File *file = imp_get_file(models, buffer_id); + if (buffer_api_check_file(file) && history_is_activated(&file->state.history)){ + *index_out = history_get_record_count(&file->state.history); + return(true); } - - return(did_change); -} - -API_EXPORT History_Record_Index -Buffer_History_Get_Max_Record_Index(Application_Links *app, Buffer_Summary *buffer){ - Models *models = (Models*)app->cmd_context; - Editing_File *file = imp_get_file(models, buffer); - History_Record_Index result = 0; - if (file != 0 && history_is_activated(&file->state.history)){ - result = history_get_record_count(&file->state.history); - } - return(result); + *index_out = 0; + return(false); } internal void @@ -3364,44 +3368,45 @@ buffer_history__fill_record_info(Record *record, Record_Info *out){ } } -API_EXPORT Record_Info -Buffer_History_Get_Record_Info(Application_Links *app, Buffer_Summary *buffer, History_Record_Index index){ +API_EXPORT bool32 +Buffer_History_Get_Record_Info(Application_Links *app, Buffer_ID buffer_id, History_Record_Index index, Record_Info *record_out){ Models *models = (Models*)app->cmd_context; - Editing_File *file = imp_get_file(models, buffer); - Record_Info result = {}; - if (file != 0){ + Editing_File *file = imp_get_file(models, buffer_id); + block_zero_struct(record_out); + if (buffer_api_check_file(file)){ History *history = &file->state.history; if (history_is_activated(history)){ i32 max_index = history_get_record_count(history); if (0 <= index && index <= max_index){ if (0 < index){ Record *record = history_get_record(history, index); - buffer_history__fill_record_info(record, &result); + buffer_history__fill_record_info(record, record_out); + return(true); } else{ - result.error = RecordError_InitialStateDummyRecord; + record_out->error = RecordError_InitialStateDummyRecord; } } else{ - result.error = RecordError_IndexOutOfBounds; + record_out->error = RecordError_IndexOutOfBounds; } } else{ - result.error = RecordError_NoHistoryAttached; + record_out->error = RecordError_NoHistoryAttached; } } else{ - result.error = RecordError_InvalidBuffer; + record_out->error = RecordError_InvalidBuffer; } - return(result); + return(false); } -API_EXPORT Record_Info -Buffer_History_Get_Group_Sub_Record(Application_Links *app, Buffer_Summary *buffer, History_Record_Index index, int32_t sub_index){ +API_EXPORT bool32 +Buffer_History_Get_Group_Sub_Record(Application_Links *app, Buffer_ID buffer_id, History_Record_Index index, int32_t sub_index, Record_Info *record_out){ Models *models = (Models*)app->cmd_context; - Editing_File *file = imp_get_file(models, buffer); - Record_Info result = {}; - if (file != 0){ + Editing_File *file = imp_get_file(models, buffer_id); + block_zero_struct(record_out); + if (buffer_api_check_file(file)){ History *history = &file->state.history; if (history_is_activated(history)){ i32 max_index = history_get_record_count(history); @@ -3410,47 +3415,49 @@ Buffer_History_Get_Group_Sub_Record(Application_Links *app, Buffer_Summary *buff Record *record = history_get_record(history, index); if (record->kind == RecordKind_Group){ record = history_get_sub_record(record, sub_index); - buffer_history__fill_record_info(record, &result); + buffer_history__fill_record_info(record, record_out); + return(true); } else{ - result.error = RecordError_WrongRecordTypeAtIndex; + record_out->error = RecordError_WrongRecordTypeAtIndex; } } else{ - result.error = RecordError_InitialStateDummyRecord; + record_out->error = RecordError_InitialStateDummyRecord; } } else{ - result.error = RecordError_IndexOutOfBounds; + record_out->error = RecordError_IndexOutOfBounds; } } else{ - result.error = RecordError_NoHistoryAttached; + record_out->error = RecordError_NoHistoryAttached; } } else{ - result.error = RecordError_InvalidBuffer; + record_out->error = RecordError_InvalidBuffer; } - return(result); -} - -API_EXPORT History_Record_Index -Buffer_History_Get_Current_State_Index(Application_Links *app, Buffer_Summary *buffer){ - Models *models = (Models*)app->cmd_context; - Editing_File *file = imp_get_file(models, buffer); - History_Record_Index result = 0; - if (file != 0 && history_is_activated(&file->state.history)){ - result = file_get_current_record_index(file); - } - return(result); + return(false); } API_EXPORT bool32 -Buffer_History_Set_Current_State_Index(Application_Links *app, Buffer_Summary *buffer, History_Record_Index index){ +Buffer_History_Get_Current_State_Index(Application_Links *app, Buffer_ID buffer_id, History_Record_Index *index_out){ Models *models = (Models*)app->cmd_context; - Editing_File *file = imp_get_file(models, buffer); + Editing_File *file = imp_get_file(models, buffer_id); + if (buffer_api_check_file(file) && history_is_activated(&file->state.history)){ + *index_out = file_get_current_record_index(file); + return(true); + } + *index_out = 0; + return(false); +} + +API_EXPORT bool32 +Buffer_History_Set_Current_State_Index(Application_Links *app, Buffer_ID buffer_id, History_Record_Index index){ + Models *models = (Models*)app->cmd_context; + Editing_File *file = imp_get_file(models, buffer_id); bool32 result = false; - if (file != 0 && history_is_activated(&file->state.history)){ + if (buffer_api_check_file(file) && history_is_activated(&file->state.history)){ i32 max_index = history_get_record_count(&file->state.history); if (0 <= index && index <= max_index){ System_Functions *system = models->system; @@ -3462,9 +3469,9 @@ Buffer_History_Set_Current_State_Index(Application_Links *app, Buffer_Summary *b } API_EXPORT bool32 -Buffer_History_Merge_Record_Range(Application_Links *app, Buffer_Summary *buffer, History_Record_Index first_index, History_Record_Index last_index, Record_Merge_Flag flags){ +Buffer_History_Merge_Record_Range(Application_Links *app, Buffer_ID buffer_id, History_Record_Index first_index, History_Record_Index last_index, Record_Merge_Flag flags){ Models *models = (Models*)app->cmd_context; - Editing_File *file = imp_get_file(models, buffer); + Editing_File *file = imp_get_file(models, buffer_id); bool32 result = false; if (file != 0 && history_is_activated(&file->state.history)){ History *history = &file->state.history; @@ -3509,11 +3516,11 @@ Buffer_History_Merge_Record_Range(Application_Links *app, Buffer_Summary *buffer } API_EXPORT bool32 -Buffer_History_Clear_After_Current_State(Application_Links *app, Buffer_Summary *buffer){ +Buffer_History_Clear_After_Current_State(Application_Links *app, Buffer_ID buffer_id){ Models *models = (Models*)app->cmd_context; - Editing_File *file = imp_get_file(models, buffer); + Editing_File *file = imp_get_file(models, buffer_id); bool32 result = false; - if (file != 0 && history_is_activated(&file->state.history)){ + if (buffer_api_check_file(file) && history_is_activated(&file->state.history)){ history_dump_records_after_index(&file->state.history, file->state.current_record_index); result = true; } @@ -3590,6 +3597,30 @@ face_description_to_settings(System_Functions *system, Face_Description descript return(success); } +API_EXPORT bool32 +Buffer_Set_Face(Application_Links *app, Buffer_ID buffer_id, Face_ID id) +/* +DOC_PARAM(buffer, The buffer on which to change the face.) +DOC_PARAM(id, The id of the face to try to set the buffer to use.) +DOC(Tries to set the buffer's face.) +DOC_RETURN(Returns true if the given id was a valid face and the change was made successfully.) +*/ +{ + Models *models = (Models*)app->cmd_context; + Editing_File *file = imp_get_file(models, buffer_id); + + bool32 did_change = false; + if (buffer_api_check_file(file)){ + System_Functions *system = models->system; + Font_Pointers font = system->font.get_pointers_by_id(id); + if (font.valid){ + did_change = true; + file_set_font(system, models, file, id); + } + } + return(did_change); +} + API_EXPORT Face_Description Get_Face_Description(Application_Links *app, Face_ID id) /* @@ -3620,8 +3651,9 @@ DOC_SEE(Face_Description) return(description); } -API_EXPORT Face_ID -Get_Face_ID(Application_Links *app, Buffer_Summary *buffer) +// TODO(allen): redocument +API_EXPORT bool32 +Get_Face_ID(Application_Links *app, Buffer_ID buffer_id, Face_ID *face_id_out) /* DOC_PARAM(buffer, The buffer from which to get a face id. If NULL gets global face id.) DOC(Retrieves a face id if buffer is a valid Buffer_Summary. If buffer is set to NULL, the parameter is ignored and the global default face is returned.) @@ -3630,9 +3662,9 @@ DOC_RETURN(On success a valid Face_ID, otherwise returns zero.) { Models *models = (Models*)app->cmd_context; Face_ID id = 0; - if (buffer != 0){ - Editing_File *file = imp_get_file(models, buffer); - if (file != 0){ + if (buffer_id != 0){ + Editing_File *file = imp_get_file(models, buffer_id); + if (buffer_api_check_file(file)){ id = file->settings.font_id; } } @@ -3783,8 +3815,9 @@ DOC_SEE(Theme_Color) } } +// TODO(allen): redocument API_EXPORT int32_t -Directory_Get_Hot(Application_Links *app, char *out, int32_t capacity) +Get_Hot_Directory(Application_Links *app, String *out, int32_t *required_size_out) /* DOC_PARAM(out, On success this character buffer is filled with the 4coder 'hot directory'.) DOC_PARAM(capacity, Specifies the capacity in bytes of the of the out buffer.) @@ -3795,17 +3828,18 @@ DOC_SEE(directory_set_hot) Models *models = (Models*)app->cmd_context; Hot_Directory *hot = &models->hot_directory; hot_directory_clean_end(hot); - if (capacity >= hot->string.size){ - memcpy(out, hot->string.str, hot->string.size); - if (capacity > hot->string.size){ - out[hot->string.size] = 0; - } + *required_size_out = hot->string.size; + bool32 result = false; + if (append(out, hot->string)){ + terminate_with_null(out); + result = true; } - return(hot->string.size); + return(result); } +// TODO(allen): redocument API_EXPORT bool32 -Directory_Set_Hot(Application_Links *app, char *str, int32_t len) +Set_Hot_Directory(Application_Links *app, String string) /* DOC_PARAM(str, The new value of the hot directory. This does not need to be a null terminated string.) DOC_PARAM(len, The length of str in bytes.) @@ -3816,15 +3850,16 @@ DOC_SEE(directory_get_hot) Models *models = (Models*)app->cmd_context; Hot_Directory *hot = &models->hot_directory; b32 success = false; - if (len < hot->string.memory_size){ - hot_directory_set(models->system, hot, make_string(str, len)); + if (string.size < hot->string.memory_size){ + hot_directory_set(models->system, hot, string); success = true; } return(success); } -API_EXPORT File_List -Get_File_List(Application_Links *app, char *dir, int32_t len) +// TODO(allen): redocument +API_EXPORT bool32 +Get_File_List(Application_Links *app, String directory, File_List *list_out) /* DOC_PARAM(dir, This parameter specifies the directory whose files will be enumerated in the returned list; it need not be null terminated.) DOC_PARAM(len, This parameter the length of the dir string.) @@ -3834,15 +3869,16 @@ DOC_SEE(File_List) Models *models = (Models*)app->cmd_context; System_Functions *system = models->system; Partition *part = &models->mem.part; - File_List result = {}; + block_zero_struct(list_out); Editing_File_Name canon = {}; - if (get_canon_name(system, make_string(dir, len), &canon)){ + if (get_canon_name(system, directory, &canon)){ Temp_Memory temp = begin_temp_memory(part); String str = push_string(part, canon.name.str, canon.name.size); - system->set_file_list(&result, str.str, 0, 0, 0); + system->set_file_list(list_out, str.str, 0, 0, 0); end_temp_memory(temp); + return(true); } - return(result); + return(false); } API_EXPORT void @@ -3912,20 +3948,21 @@ DOC_SEE(memory_allocate) models->system->memory_free(ptr, size); } +// TODO(allen): redocument API_EXPORT bool32 -File_Exists(Application_Links *app, char *filename, int32_t len) +File_Exists(Application_Links *app, String file_name) /* DOC_PARAM(filename, This parameter specifies the full path to a file; it need not be null terminated.) DOC_PARAM(len, This parameter specifies the length of the filename string.) DOC_RETURN(This call returns non-zero if and only if the file exists.) */{ Models *models = (Models*)app->cmd_context; - bool32 result = models->system->file_exists(filename, len); - return(result); + return(models->system->file_exists(file_name.str, file_name.size)); } +// TODO(allen): redocument API_EXPORT bool32 -Directory_CD(Application_Links *app, char *dir, int32_t *len, int32_t capacity, char *rel_path, int32_t rel_len) +Directory_CD(Application_Links *app, String *directory, String relative_path) /* DOC_PARAM(dir, This parameter provides a character buffer that stores a directory; it need not be null terminated.) DOC_PARAM(len, This parameter specifies the length of the dir string.) @@ -3939,20 +3976,29 @@ This call succeeds if the new directory exists and it fits inside the dir buffer For instance if dir contains "C:/Users/MySelf" and rel is "Documents" the buffer will contain "C:/Users/MySelf/Documents" and len will contain the length of that string. This call can also be used with rel set to ".." to traverse to parent folders. )*/{ Models *models = (Models*)app->cmd_context; - bool32 result = models->system->directory_cd(dir, len, capacity, rel_path, rel_len); - return(result); + return(models->system->directory_cd(directory->str, &directory->size, directory->memory_size, + relative_path.str,relative_path.size)); } -API_EXPORT int32_t -Get_4ed_Path(Application_Links *app, char *out, int32_t capacity) +// TODO(allen): redocument +API_EXPORT bool32 +Get_4ed_Path(Application_Links *app, String *path_out, int32_t *required_size_out) /* DOC_PARAM(out, This parameter provides a character buffer that receives the path to the 4ed executable file.) DOC_PARAM(capacity, This parameter specifies the maximum capacity of the out buffer.) DOC_RETURN(This call returns non-zero on success.) */{ Models *models = (Models*)app->cmd_context; - int32_t result = models->system->get_4ed_path(out, capacity); - return(result); + System_Functions *system = models->system; + i32 required_size = system->get_4ed_path(0, 0); + *required_size_out = required_size; + i32 remaining_size = path_out->memory_size - path_out->size; + if (required_size <= remaining_size){ + system->get_4ed_path(path_out->str + path_out->size, remaining_size); + path_out->size += required_size; + return(true); + } + return(false); } // TODO(allen): do(add a "shown but auto-hides on timer" setting for cursor show type) @@ -3975,7 +4021,7 @@ DOC(This call tells 4coder to set the full_screen mode. The change to full scre Models *models = (Models*)app->cmd_context; bool32 success = models->system->set_fullscreen(full_screen); if (!success){ - print_message(app, literal("ERROR: Failed to go fullscreen.\n")); + print_message(app, make_lit_string("ERROR: Failed to go fullscreen.\n")); } return(success); } @@ -4003,8 +4049,9 @@ To make send_exit_signal exit no matter what, setup your hook in such a way that models->keep_playing = false; } -API_EXPORT void -Set_Window_Title(Application_Links *app, char *title) +// TODO(allen): redocument +API_EXPORT bool32 +Set_Window_Title(Application_Links *app, String title) /* DOC_PARAM(title, A null terminated string indicating the new title for the 4coder window.) DOC(Sets 4coder's window title to the specified title string.) @@ -4012,8 +4059,11 @@ DOC(Sets 4coder's window title to the specified title string.) Models *models = (Models*)app->cmd_context; models->has_new_title = true; String dst = make_string_cap(models->title_space, 0, models->title_capacity); - append(&dst, title); - terminate_with_null(&dst); + if (append(&dst, title)){ + terminate_with_null(&dst); + return(true); + } + return(false); } API_EXPORT Microsecond_Time_Stamp @@ -4046,8 +4096,6 @@ draw_helper__view_space_to_screen_space(Models *models, f32_Rect *rect){ rect->y1 += y_corner; } -// TODO(allen): do(Documentation for draw_* related calls) - API_EXPORT float Draw_String(Application_Links *app, Face_ID font_id, String str, int32_t x, int32_t y, int_color color, uint32_t flags, float dx, float dy) { diff --git a/4ed_file.cpp b/4ed_file.cpp index c1e9a9e8..c4500b75 100644 --- a/4ed_file.cpp +++ b/4ed_file.cpp @@ -53,6 +53,15 @@ file_edit_positions_pop(Editing_File *file){ //////////////////////////////// +internal u32 +file_get_access_flags(Editing_File *file){ + u32 flags = 0; + if (file->settings.read_only){ + flags |= AccessProtected; + } + return(flags); +} + internal b32 file_needs_save(Editing_File *file){ b32 result = false; @@ -109,17 +118,17 @@ file_set_dirty_flag(Editing_File *file, Dirty_State state){ //////////////////////////////// internal b32 -save_file_to_name(System_Functions *system, Models *models, Editing_File *file, char *filename){ +save_file_to_name(System_Functions *system, Models *models, Editing_File *file, char *file_name){ b32 result = false; - b32 using_actual_filename = false; + b32 using_actual_file_name = false; - if (filename == 0){ + if (file_name == 0){ terminate_with_null(&file->canon.name); - filename = file->canon.name.str; - using_actual_filename = true; + file_name = file->canon.name.str; + using_actual_file_name = true; } - if (filename != 0){ + if (file_name != 0){ Mem_Options *mem = &models->mem; if (models->hook_save_file != 0){ models->hook_save_file(&models->app_links, file->id.id); @@ -161,20 +170,20 @@ save_file_to_name(System_Functions *system, Models *models, Editing_File *file, buffer_stringify(buffer, 0, size, data); } - if (!using_actual_filename && file->canon.name.str != 0){ + if (!using_actual_file_name && file->canon.name.str != 0){ char space[512]; - u32 length = str_size(filename); - system->get_canonical(filename, length, space, sizeof(space)); + u32 length = str_size(file_name); + system->get_canonical(file_name, length, space, sizeof(space)); char *source_path = file->canon.name.str; if (match(space, source_path)){ - using_actual_filename = true; + using_actual_file_name = true; } } - result = system->save_file(filename, data, size); + result = system->save_file(file_name, data, size); - if (result && using_actual_filename){ + if (result && using_actual_file_name){ file->state.ignore_behind_os = 1; } diff --git a/4ed_view.cpp b/4ed_view.cpp index 49d46ad0..f650aff4 100644 --- a/4ed_view.cpp +++ b/4ed_view.cpp @@ -19,6 +19,19 @@ view_get_map(View *view){ } } +internal u32 +view_get_access_flags(View *view){ + u32 result = AccessOpen; + if (view->ui_mode){ + result |= AccessHidden; + } + if (view->file_data.file_locked){ + result |= AccessProtected; + } + result |= file_get_access_flags(view->file_data.file); + return(result); +} + internal i32 view_get_index(Live_Views *live_set, View *view){ return((i32)(view - live_set->views)); @@ -145,19 +158,6 @@ view_compute_max_target_y(View *view){ return(view_compute_max_target_y_from_bottom_y(view, (lowest_line + 0.5f)*(f32)line_height)); } -internal u32 -view_lock_flags(View *view){ - u32 result = AccessOpen; - File_Viewing_Data *data = &view->file_data; - if (view->ui_mode){ - result |= AccessHidden; - } - if (data->file_locked || (data->file && data->file->settings.read_only)){ - result |= AccessProtected; - } - return(result); -} - //////////////////////////////// internal b32 diff --git a/4ed_working_set.cpp b/4ed_working_set.cpp index 2c03c845..87b8c6c0 100644 --- a/4ed_working_set.cpp +++ b/4ed_working_set.cpp @@ -394,20 +394,20 @@ working_set_clipboard_roll_down(Working_Set *working){ //////////////////////////////// internal b32 -get_canon_name(System_Functions *system, String filename, Editing_File_Name *canon_name){ +get_canon_name(System_Functions *system, String file_name, Editing_File_Name *canon_name){ canon_name->name = make_fixed_width_string(canon_name->name_); - canon_name->name.size = system->get_canonical(filename.str, filename.size, canon_name->name.str, canon_name->name.memory_size); + canon_name->name.size = system->get_canonical(file_name.str, file_name.size, canon_name->name.str, canon_name->name.memory_size); terminate_with_null(&canon_name->name); b32 result = (canon_name->name.size != 0); return(result); } internal void -file_bind_filename(System_Functions *system, Heap *heap, Working_Set *working_set, Editing_File *file, String canon_filename){ +file_bind_file_name(System_Functions *system, Heap *heap, Working_Set *working_set, Editing_File *file, String canon_file_name){ Assert(file->unique_name.name.size == 0); Assert(file->canon.name.size == 0); file->canon.name = make_fixed_width_string(file->canon.name_); - copy(&file->canon.name, canon_filename); + copy(&file->canon.name, canon_file_name); terminate_with_null(&file->canon.name); system->add_listener(file->canon.name.str); if (!working_set_canon_add(heap, working_set, file, file->canon.name)){ @@ -568,12 +568,12 @@ buffer_bind_name(Models *models, Heap *heap, Partition *scratch, //////////////////////////////// internal Editing_File* -open_file(System_Functions *system, Models *models, String filename){ +open_file(System_Functions *system, Models *models, String file_name){ Editing_File *file = 0; Editing_File_Name canon_name = {}; - if (terminate_with_null(&filename) && - get_canon_name(system, filename, &canon_name)){ + if (terminate_with_null(&file_name) && + get_canon_name(system, file_name, &canon_name)){ Working_Set *working_set = &models->working_set; file = working_set_contains_canon(working_set, canon_name.name); if (file == 0){ @@ -584,8 +584,8 @@ open_file(System_Functions *system, Models *models, String filename){ Partition *part = &mem->part; file = working_set_alloc_always(working_set, heap, &models->lifetime_allocator); - file_bind_filename(system, heap, working_set, file, canon_name.name); - buffer_bind_name(models, heap, part, working_set, file, front_of_directory(filename)); + file_bind_file_name(system, heap, working_set, file, canon_name.name); + buffer_bind_name(models, heap, part, working_set, file, front_of_directory(file_name)); Temp_Memory temp = begin_temp_memory(part); diff --git a/meta/4ed_metagen.cpp b/meta/4ed_metagen.cpp index 697bae7a..fb066db2 100644 --- a/meta/4ed_metagen.cpp +++ b/meta/4ed_metagen.cpp @@ -418,6 +418,10 @@ generate_remapping_code_and_data(Partition *part){ bind(part, mappings, 'h', MDFR_CTRL, project_go_to_root_directory); bind(part, mappings, 'S', MDFR_CTRL, save_all_dirty_buffers); + bind(part, mappings, key_scroll_lock, MDFR_NONE, toggle_filebar); + bind(part, mappings, key_pause, MDFR_NONE, toggle_filebar); + bind(part, mappings, key_caps, MDFR_NONE, toggle_filebar); + bind(part, mappings, '.', MDFR_ALT, change_to_build_panel); bind(part, mappings, ',', MDFR_ALT, close_build_panel); bind(part, mappings, 'n', MDFR_ALT, goto_next_jump_sticky); diff --git a/platform_win32/win32_4ed.cpp b/platform_win32/win32_4ed.cpp index 8b710359..dc67dd6b 100644 --- a/platform_win32/win32_4ed.cpp +++ b/platform_win32/win32_4ed.cpp @@ -1408,6 +1408,23 @@ Win32KeycodeInit(void){ keycode_lookup_table[VK_NEXT] = key_page_down; keycode_lookup_table[VK_ESCAPE] = key_esc; + keycode_lookup_table[VK_CONTROL] = key_ctrl; + keycode_lookup_table[VK_LCONTROL] = key_ctrl; + keycode_lookup_table[VK_RCONTROL] = key_ctrl; + + keycode_lookup_table[VK_MENU] = key_alt; + keycode_lookup_table[VK_LMENU] = key_alt; + keycode_lookup_table[VK_RMENU] = key_alt; + + keycode_lookup_table[VK_SHIFT] = key_shift; + keycode_lookup_table[VK_LSHIFT] = key_shift; + keycode_lookup_table[VK_RSHIFT] = key_shift; + + keycode_lookup_table[VK_PAUSE] = key_pause; + keycode_lookup_table[VK_CAPITAL] = key_caps; + keycode_lookup_table[VK_NUMLOCK] = key_num_lock; + keycode_lookup_table[VK_SCROLL] = key_scroll_lock; + keycode_lookup_table[VK_F1] = key_f1; keycode_lookup_table[VK_F2] = key_f2; keycode_lookup_table[VK_F3] = key_f3; @@ -1719,32 +1736,28 @@ win32_proc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam){ control_keys[MDFR_ALT_INDEX] = alt; } }break; + } + + b8 current_state = ((lParam & bit_31)?(0):(1)); + if (current_state){ + Key_Code key = keycode_lookup_table[(u8)wParam]; - default: - { - b8 current_state = ((lParam & bit_31)?(0):(1)); + if (key != 0){ + i32 *count = &win32vars.input_chunk.trans.key_data.count; + Key_Event_Data *data = win32vars.input_chunk.trans.key_data.keys; + b8 *control_keys = win32vars.input_chunk.pers.control_keys; + i32 control_keys_size = sizeof(win32vars.input_chunk.pers.control_keys); - if (current_state){ - Key_Code key = keycode_lookup_table[(u8)wParam]; - - if (key != 0){ - i32 *count = &win32vars.input_chunk.trans.key_data.count; - Key_Event_Data *data = win32vars.input_chunk.trans.key_data.keys; - b8 *control_keys = win32vars.input_chunk.pers.control_keys; - i32 control_keys_size = sizeof(win32vars.input_chunk.pers.control_keys); - - Assert(*count < KEY_INPUT_BUFFER_SIZE); - data[*count].character = 0; - data[*count].character_no_caps_lock = 0; - data[*count].keycode = key; - memcpy(data[*count].modifiers, control_keys, control_keys_size); - ++(*count); - - win32vars.got_useful_event = true; - } - } - }break; - }/* switch */ + Assert(*count < KEY_INPUT_BUFFER_SIZE); + data[*count].character = 0; + data[*count].character_no_caps_lock = 0; + data[*count].keycode = key; + memcpy(data[*count].modifiers, control_keys, control_keys_size); + ++(*count); + + win32vars.got_useful_event = true; + } + } }break; case WM_CHAR: case WM_SYSCHAR: case WM_UNICHAR: