diff --git a/4ed.cpp b/4ed.cpp index 00200a81..3374cf51 100644 --- a/4ed.cpp +++ b/4ed.cpp @@ -470,12 +470,6 @@ command_caller(Coroutine *coroutine){ } } -internal void -app_links_init(Application_Links *app_links){ - FillAppLinksAPI(app_links); - app_links->current_coroutine = 0; -} - // App Functions internal void @@ -826,12 +820,12 @@ App_Init_Sig(app_init){ Models *models = (Models*)base_ptr; models->keep_playing = true; - app_links_init(&models->app_links); - models->config_api = api; models->app_links.cmd_context = models; - Arena *arena = models->arena; + API_VTable_custom custom_vtable = {}; + custom_api_fill_vtable(&custom_vtable); + api.init_apis(&custom_vtable); // NOTE(allen): coroutines coroutine_system_init(&models->coroutines); @@ -840,6 +834,7 @@ App_Init_Sig(app_init){ font_set_init(&models->font_set); // NOTE(allen): live set + Arena *arena = models->arena; { models->live_set.count = 0; models->live_set.max = MAX_VIEWS; diff --git a/4ed.h b/4ed.h index 8587a7a9..e5532c68 100644 --- a/4ed.h +++ b/4ed.h @@ -55,29 +55,30 @@ struct Plat_Settings{ b8 use_hinting; }; -#define App_Read_Command_Line_Sig(name) \ -void *name(Thread_Context *tctx, \ -String_Const_u8 current_directory,\ -Plat_Settings *plat_settings,\ -char ***files, \ -i32 **file_count,\ -i32 argc, \ -char **argv) - +#define App_Read_Command_Line_Sig(name) \ +void *name(Thread_Context *tctx,\ + String_Const_u8 current_directory,\ + Plat_Settings *plat_settings,\ + char ***files, \ + i32 **file_count,\ + i32 argc, \ + char **argv) + typedef App_Read_Command_Line_Sig(App_Read_Command_Line); struct Custom_API{ Get_Binding_Data_Function *get_bindings; - _Get_Version_Function *get_alpha_4coder_version; + _Get_Version_Function *get_version; + _Init_APIs *init_apis; }; #define App_Init_Sig(name) \ void name(Render_Target *target, \ -void *base_ptr, \ -String_Const_u8 clipboard,\ -String_Const_u8 current_directory,\ -Custom_API api) - + void *base_ptr, \ + String_Const_u8 clipboard,\ + String_Const_u8 current_directory,\ + Custom_API api) + typedef App_Init_Sig(App_Init); #include "4ed_cursor_codes.h" diff --git a/4ed_api_definition.cpp b/4ed_api_definition.cpp index defb58b9..43e6e1b0 100644 --- a/4ed_api_definition.cpp +++ b/4ed_api_definition.cpp @@ -70,9 +70,26 @@ api_get_api(Arena *arena, API_Definition_List *list, String_Const_u8 name){ #if !defined(SKIP_STDIO) #include +#include "4coder_stringf.cpp" + +function String_Const_u8 +api_get_callable_name(Arena *arena, String_Const_u8 api_name, String_Const_u8 name, API_Generation_Flag flags){ + String_Const_u8 result = {}; + if (HasFlag(flags, APIGeneration_NoAPINameOnCallables)){ + result = push_u8_stringf(arena, "%.*s", string_expand(name)); + } + else{ + result = push_u8_stringf(arena, "%.*s_%.*s", + string_expand(api_name), + string_expand(name)); + } + return(result); +} + +//////////////////////////////// function void -generate_api_master_list(Arena *scratch, API_Definition *api, FILE *out){ +generate_api_master_list(Arena *scratch, API_Definition *api, API_Generation_Flag flags, FILE *out){ for (API_Call *call = api->first; call != 0; call = call->next){ @@ -100,7 +117,7 @@ generate_api_master_list(Arena *scratch, API_Definition *api, FILE *out){ } function void -generate_header(Arena *scratch, API_Definition *api, FILE *out){ +generate_header(Arena *scratch, API_Definition *api, API_Generation_Flag flags, FILE *out){ for (API_Call *call = api->first; call != 0; call = call->next){ @@ -170,10 +187,10 @@ generate_header(Arena *scratch, API_Definition *api, FILE *out){ for (API_Call *call = api->first; call != 0; call = call->next){ - fprintf(out, "internal %.*s %.*s_%.*s(", + String_Const_u8 callable_name = api_get_callable_name(scratch, api->name, call->name, flags); + fprintf(out, "internal %.*s %.*s(", string_expand(call->return_type), - string_expand(api->name), - string_expand(call->name)); + string_expand(callable_name)); if (call->params.count == 0){ fprintf(out, "void"); } @@ -196,18 +213,18 @@ generate_header(Arena *scratch, API_Definition *api, FILE *out){ for (API_Call *call = api->first; call != 0; call = call->next){ - fprintf(out, "global %.*s_%.*s_type *%.*s_%.*s = 0;\n", + String_Const_u8 callable_name = api_get_callable_name(scratch, api->name, call->name, flags); + fprintf(out, "global %.*s_%.*s_type *%.*s = 0;\n", string_expand(api->name), string_expand(call->name), - string_expand(api->name), - string_expand(call->name)); + string_expand(callable_name)); } fprintf(out, "#undef DYNAMIC_LINK_API\n"); fprintf(out, "#endif\n"); } function void -generate_cpp(Arena *scratch, API_Definition *api, FILE *out){ +generate_cpp(Arena *scratch, API_Definition *api, API_Generation_Flag flags, FILE *out){ fprintf(out, "function void\n"); fprintf(out, "%.*s_api_fill_vtable(API_VTable_%.*s *vtable){\n", string_expand(api->name), @@ -215,10 +232,10 @@ generate_cpp(Arena *scratch, API_Definition *api, FILE *out){ for (API_Call *call = api->first; call != 0; call = call->next){ - fprintf(out, "vtable->%.*s = %.*s_%.*s;\n", + String_Const_u8 callable_name = api_get_callable_name(scratch, api->name, call->name, flags); + fprintf(out, "vtable->%.*s = %.*s;\n", string_expand(call->name), - string_expand(api->name), - string_expand(call->name)); + string_expand(callable_name)); } fprintf(out, "}\n"); @@ -230,9 +247,9 @@ generate_cpp(Arena *scratch, API_Definition *api, FILE *out){ for (API_Call *call = api->first; call != 0; call = call->next){ - fprintf(out, "%.*s_%.*s = vtable->%.*s;\n", - string_expand(api->name), - string_expand(call->name), + String_Const_u8 callable_name = api_get_callable_name(scratch, api->name, call->name, flags); + fprintf(out, "%.*s = vtable->%.*s;\n", + string_expand(callable_name), string_expand(call->name)); } fprintf(out, "}\n"); @@ -240,6 +257,84 @@ generate_cpp(Arena *scratch, API_Definition *api, FILE *out){ fprintf(out, "#endif\n"); } +//////////////////////////////// + +function b32 +api_definition_generate_api_includes(Arena *arena, API_Definition *api, Generated_Group group, API_Generation_Flag flags){ + // NOTE(allen): Arrange output files + + String_Const_u8 path_to_self = string_u8_litexpr(__FILE__); + path_to_self = string_remove_last_folder(path_to_self); + + String_Const_u8 fname_ml = {}; + String_Const_u8 fname_h = {}; + String_Const_u8 fname_cpp = {}; + + String_Const_u8 root = {}; + switch (group){ + case GeneratedGroup_Core: + { + root = string_u8_litexpr("generated/"); + }break; + case GeneratedGroup_Custom: + { + root = string_u8_litexpr("custom/generated/"); + }break; + } + + fname_ml = push_u8_stringf(arena, "%.*s%.*s%.*s_api_master_list.h", + string_expand(path_to_self), + string_expand(root), + string_expand(api->name)); + + fname_h = push_u8_stringf(arena, "%.*s%.*s%.*s_api.h", + string_expand(path_to_self), + string_expand(root), + string_expand(api->name)); + + fname_cpp = push_u8_stringf(arena, "%.*s%.*s%.*s_api.cpp", + string_expand(path_to_self), + string_expand(root), + string_expand(api->name)); + + FILE *out_file_ml = fopen((char*)fname_ml.str, "wb"); + if (out_file_ml == 0){ + printf("could not open output file: '%s'\n", fname_ml.str); + return(false); + } + + FILE *out_file_h = fopen((char*)fname_h.str, "wb"); + if (out_file_h == 0){ + printf("could not open output file: '%s'\n", fname_h.str); + return(false); + } + + FILE *out_file_cpp = fopen((char*)fname_cpp.str, "wb"); + if (out_file_cpp == 0){ + printf("could not open output file: '%s'\n", fname_cpp.str); + return(false); + } + + printf("%s:1:\n", fname_ml.str); + printf("%s:1:\n", fname_h.str); + printf("%s:1:\n", fname_cpp.str); + + //////////////////////////////// + + // NOTE(allen): Generate output + + generate_api_master_list(arena, api, flags, out_file_ml); + generate_header(arena, api, flags, out_file_h); + generate_cpp(arena, api, flags, out_file_cpp); + + //////////////////////////////// + + fclose(out_file_ml); + fclose(out_file_h); + fclose(out_file_cpp); + return(true); +} + #endif // BOTTOM diff --git a/4ed_api_definition.h b/4ed_api_definition.h index 29a100e7..2f96a0d5 100644 --- a/4ed_api_definition.h +++ b/4ed_api_definition.h @@ -47,6 +47,11 @@ struct API_Definition_List{ i32 count; }; +typedef u32 API_Generation_Flag; +enum{ + APIGeneration_NoAPINameOnCallables = 1, +}; + #endif // BOTTOM diff --git a/4ed_api_definition_main.cpp b/4ed_api_definition_main.cpp index ecf10a4f..757c4c41 100644 --- a/4ed_api_definition_main.cpp +++ b/4ed_api_definition_main.cpp @@ -23,54 +23,13 @@ function API_Definition* define_api(Arena *arena); - int main(void){ Arena arena = make_arena_malloc(); API_Definition *api = define_api(&arena); - - //////////////////////////////// - - // NOTE(allen): Arrange output files - - String_Const_u8 path_to_self = string_u8_litexpr(__FILE__); - path_to_self = string_remove_last_folder(path_to_self); - - String_Const_u8 fname_h = push_u8_stringf(&arena, "%.*sgenerated/%.*s_api.h", - string_expand(path_to_self), - string_expand(api->name)); - - String_Const_u8 fname_cpp = push_u8_stringf(&arena, "%.*sgenerated/%.*s_api.cpp", - string_expand(path_to_self), - string_expand(api->name)); - - FILE *out_file_h = fopen((char*)fname_h.str, "wb"); - if (out_file_h == 0){ - printf("could not open output file: '%s'\n", fname_h.str); - exit(1); + if (!api_definition_generate_api_includes(&arena, api, GeneratedGroup_Core, 0)){ + return(1); } - - FILE *out_file_cpp = fopen((char*)fname_cpp.str, "wb"); - if (out_file_cpp == 0){ - printf("could not open output file: '%s'\n", fname_cpp.str); - exit(1); - } - - printf("%s:1:\n", fname_h.str); - printf("%s:1:\n", fname_cpp.str); - - //////////////////////////////// - - // NOTE(allen): Generate output - - generate_header(&arena, api, out_file_h); - generate_cpp(&arena, api, out_file_cpp); - - //////////////////////////////// - - fclose(out_file_h); - fclose(out_file_cpp); - return(0); } diff --git a/4ed_api_implementation.cpp b/4ed_api_implementation.cpp index 78b8fd20..331464f3 100644 --- a/4ed_api_implementation.cpp +++ b/4ed_api_implementation.cpp @@ -49,7 +49,7 @@ is_running_coroutine(Application_Links *app){ } api(custom) function b32 -Global_Set_Setting(Application_Links *app, Global_Setting_ID setting, i32 value) +global_set_setting(Application_Links *app, Global_Setting_ID setting, i32 value) { Models *models = (Models*)app->cmd_context; b32 result = true; @@ -67,7 +67,7 @@ Global_Set_Setting(Application_Links *app, Global_Setting_ID setting, i32 value) } api(custom) function b32 -Global_Set_Mapping(Application_Links *app, void *data, i32 size) +global_set_mapping(Application_Links *app, void *data, i32 size) { Models *models = (Models*)app->cmd_context; b32 result = interpret_binding_buffer(models, data, size); @@ -75,25 +75,25 @@ Global_Set_Mapping(Application_Links *app, void *data, i32 size) } api(custom) function Rect_f32 -Global_Get_Screen_Rectangle(Application_Links *app){ +global_get_screen_rectangle(Application_Links *app){ Models *models = (Models*)app->cmd_context; return(Rf32(V2(0, 0), V2(layout_get_root_size(&models->layout)))); } api(custom) function Thread_Context* -Get_Thread_Context(Application_Links *app){ +get_thread_context(Application_Links *app){ Models *models = (Models*)app->cmd_context; return(models->tctx); } api(custom) function b32 -Create_Child_Process(Application_Links *app, String_Const_u8 path, String_Const_u8 command, Child_Process_ID *child_process_id_out){ +create_child_process(Application_Links *app, String_Const_u8 path, String_Const_u8 command, Child_Process_ID *child_process_id_out){ Models *models = (Models*)app->cmd_context; return(child_process_call(models, path, command, child_process_id_out)); } api(custom) function b32 -Child_Process_Set_Target_Buffer(Application_Links *app, Child_Process_ID child_process_id, Buffer_ID buffer_id, Child_Process_Set_Target_Flags flags){ +child_process_set_target_buffer(Application_Links *app, Child_Process_ID child_process_id, Buffer_ID buffer_id, Child_Process_Set_Target_Flags flags){ Models *models = (Models*)app->cmd_context; Child_Process *child_process = child_process_from_id(&models->child_processes, child_process_id); Editing_File *file = imp_get_file(models, buffer_id); @@ -105,7 +105,7 @@ Child_Process_Set_Target_Buffer(Application_Links *app, Child_Process_ID child_p } api(custom) function Child_Process_ID -Buffer_Get_Attached_Child_Process(Application_Links *app, Buffer_ID buffer_id){ +buffer_get_attached_child_process(Application_Links *app, Buffer_ID buffer_id){ Models *models = (Models*)app->cmd_context; Editing_File *file = imp_get_file(models, buffer_id); Child_Process_ID result = 0; @@ -116,7 +116,7 @@ Buffer_Get_Attached_Child_Process(Application_Links *app, Buffer_ID buffer_id){ } api(custom) function Buffer_ID -Child_Process_Get_Attached_Buffer(Application_Links *app, Child_Process_ID child_process_id){ +child_process_get_attached_buffer(Application_Links *app, Child_Process_ID child_process_id){ Models *models = (Models*)app->cmd_context; Child_Process *child_process = child_process_from_id(&models->child_processes, child_process_id); Buffer_ID result = 0; @@ -127,13 +127,13 @@ Child_Process_Get_Attached_Buffer(Application_Links *app, Child_Process_ID child } api(custom) function Process_State -Child_Process_Get_State(Application_Links *app, Child_Process_ID child_process_id){ +child_process_get_state(Application_Links *app, Child_Process_ID child_process_id){ Models *models = (Models*)app->cmd_context; return(child_process_get_state(&models->child_processes, child_process_id)); } api(custom) function b32 -Clipboard_Post(Application_Links *app, i32 clipboard_id, String_Const_u8 string) +clipboard_post(Application_Links *app, i32 clipboard_id, String_Const_u8 string) { Models *models = (Models*)app->cmd_context; String_Const_u8 *dest = working_set_next_clipboard_string(&models->heap, &models->working_set, (i32)string.size); @@ -143,14 +143,14 @@ Clipboard_Post(Application_Links *app, i32 clipboard_id, String_Const_u8 string) } api(custom) function i32 -Clipboard_Count(Application_Links *app, i32 clipboard_id) +clipboard_count(Application_Links *app, i32 clipboard_id) { Models *models = (Models*)app->cmd_context; return(models->working_set.clipboard_size); } api(custom) function String_Const_u8 -Push_Clipboard_Index(Application_Links *app, Arena *arena, i32 clipboard_id, i32 item_index) +push_clipboard_index(Application_Links *app, Arena *arena, i32 clipboard_id, i32 item_index) { Models *models = (Models*)app->cmd_context; String_Const_u8 *str = working_set_clipboard_index(&models->working_set, item_index); @@ -162,7 +162,7 @@ Push_Clipboard_Index(Application_Links *app, Arena *arena, i32 clipboard_id, i32 } api(custom) function i32 -Get_Buffer_Count(Application_Links *app) +get_buffer_count(Application_Links *app) { Models *models = (Models*)app->cmd_context; Working_Set *working_set = &models->working_set; @@ -170,7 +170,7 @@ Get_Buffer_Count(Application_Links *app) } api(custom) function Buffer_ID -Get_Buffer_Next(Application_Links *app, Buffer_ID buffer_id, Access_Flag access) +get_buffer_next(Application_Links *app, Buffer_ID buffer_id, Access_Flag access) { Models *models = (Models*)app->cmd_context; Working_Set *working_set = &models->working_set; @@ -187,7 +187,7 @@ Get_Buffer_Next(Application_Links *app, Buffer_ID buffer_id, Access_Flag access) } api(custom) function Buffer_ID -Get_Buffer_By_Name(Application_Links *app, String_Const_u8 name, Access_Flag access) +get_buffer_by_name(Application_Links *app, String_Const_u8 name, Access_Flag access) { Models *models = (Models*)app->cmd_context; Working_Set *working_set = &models->working_set; @@ -200,7 +200,7 @@ Get_Buffer_By_Name(Application_Links *app, String_Const_u8 name, Access_Flag acc } api(custom) function Buffer_ID -Get_Buffer_By_File_Name(Application_Links *app, String_Const_u8 file_name, Access_Flag access) +get_buffer_by_file_name(Application_Links *app, String_Const_u8 file_name, Access_Flag access) { Models *models = (Models*)app->cmd_context; Editing_File_Name canon = {}; @@ -217,7 +217,7 @@ Get_Buffer_By_File_Name(Application_Links *app, String_Const_u8 file_name, Acces } api(custom) function b32 -Buffer_Read_Range(Application_Links *app, Buffer_ID buffer_id, Range_i64 range, char *out) +buffer_read_range(Application_Links *app, Buffer_ID buffer_id, Range_i64 range, char *out) { Models *models = (Models*)app->cmd_context; Editing_File *file = imp_get_file(models, buffer_id); @@ -235,7 +235,7 @@ Buffer_Read_Range(Application_Links *app, Buffer_ID buffer_id, Range_i64 range, } api(custom) function b32 -Buffer_Replace_Range(Application_Links *app, Buffer_ID buffer_id, Range_i64 range, String_Const_u8 string) +buffer_replace_range(Application_Links *app, Buffer_ID buffer_id, Range_i64 range, String_Const_u8 string) { Models *models = (Models*)app->cmd_context; Editing_File *file = imp_get_file(models, buffer_id); @@ -252,7 +252,7 @@ Buffer_Replace_Range(Application_Links *app, Buffer_ID buffer_id, Range_i64 rang } api(custom) function b32 -Buffer_Batch_Edit(Application_Links *app, Buffer_ID buffer_id, Batch_Edit *batch) +buffer_batch_edit(Application_Links *app, Buffer_ID buffer_id, Batch_Edit *batch) { Models *models = (Models*)app->cmd_context; Editing_File *file = imp_get_file(models, buffer_id); @@ -265,7 +265,7 @@ Buffer_Batch_Edit(Application_Links *app, Buffer_ID buffer_id, Batch_Edit *batch } api(custom) function String_Match -Buffer_Seek_String(Application_Links *app, Buffer_ID buffer, String_Const_u8 needle, Scan_Direction direction, i64 start_pos){ +buffer_seek_string(Application_Links *app, Buffer_ID buffer, String_Const_u8 needle, Scan_Direction direction, i64 start_pos){ Models *models = (Models*)app->cmd_context; Editing_File *file = imp_get_file(models, buffer); String_Match result = {}; @@ -310,7 +310,7 @@ Buffer_Seek_String(Application_Links *app, Buffer_ID buffer, String_Const_u8 nee } api(custom) function String_Match -Buffer_Seek_Character_Class(Application_Links *app, Buffer_ID buffer, Character_Predicate *predicate, Scan_Direction direction, i64 start_pos){ +buffer_seek_character_class(Application_Links *app, Buffer_ID buffer, Character_Predicate *predicate, Scan_Direction direction, i64 start_pos){ Models *models = (Models*)app->cmd_context; Editing_File *file = imp_get_file(models, buffer); String_Match result = {}; @@ -364,7 +364,7 @@ Buffer_Seek_Character_Class(Application_Links *app, Buffer_ID buffer, Character_ } api(custom) function f32 -Buffer_Line_Y_Difference(Application_Links *app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 line_a, i64 line_b){ +buffer_line_y_difference(Application_Links *app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 line_a, i64 line_b){ Models *models = (Models*)app->cmd_context; Editing_File *file = imp_get_file(models, buffer_id); f32 result = {}; @@ -378,7 +378,7 @@ Buffer_Line_Y_Difference(Application_Links *app, Buffer_ID buffer_id, f32 width, } api(custom) function Line_Shift_Vertical -Buffer_Line_Shift_Y(Application_Links *app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 line, f32 y_shift){ +buffer_line_shift_y(Application_Links *app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 line, f32 y_shift){ Models *models = (Models*)app->cmd_context; Editing_File *file = imp_get_file(models, buffer_id); Line_Shift_Vertical result = {}; @@ -392,7 +392,7 @@ Buffer_Line_Shift_Y(Application_Links *app, Buffer_ID buffer_id, f32 width, Face } api(custom) function i64 -Buffer_Pos_At_Relative_XY(Application_Links *app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, Vec2_f32 relative_xy){ +buffer_pos_at_relative_xy(Application_Links *app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, Vec2_f32 relative_xy){ Models *models = (Models*)app->cmd_context; Editing_File *file = imp_get_file(models, buffer_id); i64 result = -1; @@ -406,7 +406,7 @@ Buffer_Pos_At_Relative_XY(Application_Links *app, Buffer_ID buffer_id, f32 width } api(custom) function Vec2_f32 -Buffer_Relative_XY_Of_Pos(Application_Links *app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 pos) +buffer_relative_xy_of_pos(Application_Links *app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 pos) { Models *models = (Models*)app->cmd_context; Editing_File *file = imp_get_file(models, buffer_id); @@ -421,7 +421,7 @@ Buffer_Relative_XY_Of_Pos(Application_Links *app, Buffer_ID buffer_id, f32 width } api(custom) function i64 -Buffer_Relative_Character_From_Pos(Application_Links *app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 pos) +buffer_relative_character_from_pos(Application_Links *app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 pos) { Models *models = (Models*)app->cmd_context; Editing_File *file = imp_get_file(models, buffer_id); @@ -436,7 +436,7 @@ Buffer_Relative_Character_From_Pos(Application_Links *app, Buffer_ID buffer_id, } api(custom) function i64 -Buffer_Pos_From_Relative_Character(Application_Links *app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 relative_character) +buffer_pos_from_relative_character(Application_Links *app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 relative_character) { Models *models = (Models*)app->cmd_context; Editing_File *file = imp_get_file(models, buffer_id); @@ -451,7 +451,7 @@ Buffer_Pos_From_Relative_Character(Application_Links *app, Buffer_ID buffer_id, } api(custom) function f32 -View_Line_Y_Difference(Application_Links *app, View_ID view_id, i64 line_a, i64 line_b){ +view_line_y_difference(Application_Links *app, View_ID view_id, i64 line_a, i64 line_b){ Models *models = (Models*)app->cmd_context; View *view = imp_get_view(models, view_id); f32 result = {}; @@ -462,7 +462,7 @@ View_Line_Y_Difference(Application_Links *app, View_ID view_id, i64 line_a, i64 } api(custom) function Line_Shift_Vertical -View_Line_Shift_Y(Application_Links *app, View_ID view_id, i64 line, f32 y_shift){ +view_line_shift_y(Application_Links *app, View_ID view_id, i64 line, f32 y_shift){ Models *models = (Models*)app->cmd_context; View *view = imp_get_view(models, view_id); Line_Shift_Vertical result = {}; @@ -473,7 +473,7 @@ View_Line_Shift_Y(Application_Links *app, View_ID view_id, i64 line, f32 y_shift } api(custom) function i64 -View_Pos_At_Relative_XY(Application_Links *app, View_ID view_id, i64 base_line, Vec2_f32 relative_xy){ +view_pos_at_relative_xy(Application_Links *app, View_ID view_id, i64 base_line, Vec2_f32 relative_xy){ Models *models = (Models*)app->cmd_context; View *view = imp_get_view(models, view_id); i64 result = -1; @@ -484,7 +484,7 @@ View_Pos_At_Relative_XY(Application_Links *app, View_ID view_id, i64 base_line, } api(custom) function Vec2_f32 -View_Relative_XY_Of_Pos(Application_Links *app, View_ID view_id, i64 base_line, i64 pos){ +view_relative_xy_of_pos(Application_Links *app, View_ID view_id, i64 base_line, i64 pos){ Models *models = (Models*)app->cmd_context; View *view = imp_get_view(models, view_id); Vec2_f32 result = {}; @@ -495,7 +495,7 @@ View_Relative_XY_Of_Pos(Application_Links *app, View_ID view_id, i64 base_line, } api(custom) function i64 -View_Relative_Character_From_Pos(Application_Links *app, View_ID view_id, i64 base_line, i64 pos){ +view_relative_character_from_pos(Application_Links *app, View_ID view_id, i64 base_line, i64 pos){ Models *models = (Models*)app->cmd_context; View *view = imp_get_view(models, view_id); i64 result = {}; @@ -506,7 +506,7 @@ View_Relative_Character_From_Pos(Application_Links *app, View_ID view_id, i64 b } api(custom) function i64 -View_Pos_From_Relative_Character(Application_Links *app, View_ID view_id, i64 base_line, i64 character){ +view_pos_from_relative_character(Application_Links *app, View_ID view_id, i64 base_line, i64 character){ Models *models = (Models*)app->cmd_context; View *view = imp_get_view(models, view_id); i64 result = {}; @@ -517,14 +517,14 @@ View_Pos_From_Relative_Character(Application_Links *app, View_ID view_id, i64 b } api(custom) function b32 -Buffer_Exists(Application_Links *app, Buffer_ID buffer_id){ +buffer_exists(Application_Links *app, Buffer_ID buffer_id){ Models *models = (Models*)app->cmd_context; Editing_File *file = imp_get_file(models, buffer_id); return(api_check_buffer(file)); } api(custom) function b32 -Buffer_Ready(Application_Links *app, Buffer_ID buffer_id){ +buffer_ready(Application_Links *app, Buffer_ID buffer_id){ Models *models = (Models*)app->cmd_context; Editing_File *file = imp_get_file(models, buffer_id); b32 result = false; @@ -535,7 +535,7 @@ Buffer_Ready(Application_Links *app, Buffer_ID buffer_id){ } api(custom) function Access_Flag -Buffer_Get_Access_Flags(Application_Links *app, Buffer_ID buffer_id){ +buffer_get_access_flags(Application_Links *app, Buffer_ID buffer_id){ Models *models = (Models*)app->cmd_context; Editing_File *file = imp_get_file(models, buffer_id); Access_Flag result = 0; @@ -546,7 +546,7 @@ Buffer_Get_Access_Flags(Application_Links *app, Buffer_ID buffer_id){ } api(custom) function i64 -Buffer_Get_Size(Application_Links *app, Buffer_ID buffer_id){ +buffer_get_size(Application_Links *app, Buffer_ID buffer_id){ Models *models = (Models*)app->cmd_context; Editing_File *file = imp_get_file(models, buffer_id); i64 result = 0; @@ -557,7 +557,7 @@ Buffer_Get_Size(Application_Links *app, Buffer_ID buffer_id){ } api(custom) function i64 -Buffer_Get_Line_Count(Application_Links *app, Buffer_ID buffer_id){ +buffer_get_line_count(Application_Links *app, Buffer_ID buffer_id){ Models *models = (Models*)app->cmd_context; Editing_File *file = imp_get_file(models, buffer_id); u64 result = 0; @@ -568,7 +568,7 @@ Buffer_Get_Line_Count(Application_Links *app, Buffer_ID buffer_id){ } api(custom) function String_Const_u8 -Push_Buffer_Base_Name(Application_Links *app, Arena *arena, Buffer_ID buffer_id){ +push_buffer_base_name(Application_Links *app, Arena *arena, Buffer_ID buffer_id){ Models *models = (Models*)app->cmd_context; Editing_File *file = imp_get_file(models, buffer_id); String_Const_u8 result = {}; @@ -579,7 +579,7 @@ Push_Buffer_Base_Name(Application_Links *app, Arena *arena, Buffer_ID buffer_id) } api(custom) function String_Const_u8 -Push_Buffer_Unique_Name(Application_Links *app, Arena *out, Buffer_ID buffer_id){ +push_buffer_unique_name(Application_Links *app, Arena *out, Buffer_ID buffer_id){ Models *models = (Models*)app->cmd_context; Editing_File *file = imp_get_file(models, buffer_id); String_Const_u8 result = {}; @@ -590,7 +590,7 @@ Push_Buffer_Unique_Name(Application_Links *app, Arena *out, Buffer_ID buffer_id) } api(custom) function String_Const_u8 -Push_Buffer_File_Name(Application_Links *app, Arena *arena, Buffer_ID buffer_id){ +push_buffer_file_name(Application_Links *app, Arena *arena, Buffer_ID buffer_id){ Models *models = (Models*)app->cmd_context; Editing_File *file = imp_get_file(models, buffer_id); String_Const_u8 result = {}; @@ -601,7 +601,7 @@ Push_Buffer_File_Name(Application_Links *app, Arena *arena, Buffer_ID buffer_id) } api(custom) function Dirty_State -Buffer_Get_Dirty_State(Application_Links *app, Buffer_ID buffer_id){ +buffer_get_dirty_state(Application_Links *app, Buffer_ID buffer_id){ Models *models = (Models*)app->cmd_context; Editing_File *file = imp_get_file(models, buffer_id); Dirty_State result = {}; @@ -612,7 +612,7 @@ Buffer_Get_Dirty_State(Application_Links *app, Buffer_ID buffer_id){ } api(custom) function b32 -Buffer_Set_Dirty_State(Application_Links *app, Buffer_ID buffer_id, Dirty_State dirty_state){ +buffer_set_dirty_state(Application_Links *app, Buffer_ID buffer_id, Dirty_State dirty_state){ Models *models = (Models*)app->cmd_context; Editing_File *file = imp_get_file(models, buffer_id); b32 result = false; @@ -624,7 +624,7 @@ Buffer_Set_Dirty_State(Application_Links *app, Buffer_ID buffer_id, Dirty_State } api(custom) function b32 -Buffer_Get_Setting(Application_Links *app, Buffer_ID buffer_id, Buffer_Setting_ID setting, i32 *value_out) +buffer_get_setting(Application_Links *app, Buffer_ID buffer_id, Buffer_Setting_ID setting, i32 *value_out) { Models *models = (Models*)app->cmd_context; Editing_File *file = imp_get_file(models, buffer_id); @@ -667,7 +667,7 @@ Buffer_Get_Setting(Application_Links *app, Buffer_ID buffer_id, Buffer_Setting_I } api(custom) function b32 -Buffer_Set_Setting(Application_Links *app, Buffer_ID buffer_id, Buffer_Setting_ID setting, i32 value) +buffer_set_setting(Application_Links *app, Buffer_ID buffer_id, Buffer_Setting_ID setting, i32 value) { Models *models = (Models*)app->cmd_context; Editing_File *file = imp_get_file(models, buffer_id); @@ -771,7 +771,7 @@ Buffer_Set_Setting(Application_Links *app, Buffer_ID buffer_id, Buffer_Setting_I } api(custom) function Managed_Scope -Buffer_Get_Managed_Scope(Application_Links *app, Buffer_ID buffer_id) +buffer_get_managed_scope(Application_Links *app, Buffer_ID buffer_id) { Models *models = (Models*)app->cmd_context; Editing_File *file = imp_get_file(models, buffer_id); @@ -783,7 +783,7 @@ Buffer_Get_Managed_Scope(Application_Links *app, Buffer_ID buffer_id) } api(custom) function b32 -Buffer_Send_End_Signal(Application_Links *app, Buffer_ID buffer_id) +buffer_send_end_signal(Application_Links *app, Buffer_ID buffer_id) { Models *models = (Models*)app->cmd_context; Editing_File *file = imp_get_file(models, buffer_id); @@ -796,7 +796,7 @@ Buffer_Send_End_Signal(Application_Links *app, Buffer_ID buffer_id) } api(custom) function Buffer_ID -Create_Buffer(Application_Links *app, String_Const_u8 file_name, Buffer_Create_Flag flags) +create_buffer(Application_Links *app, String_Const_u8 file_name, Buffer_Create_Flag flags) { Models *models = (Models*)app->cmd_context; Editing_File *new_file = create_file(models, file_name, flags); @@ -808,7 +808,7 @@ Create_Buffer(Application_Links *app, String_Const_u8 file_name, Buffer_Create_F } api(custom) function b32 -Buffer_Save(Application_Links *app, Buffer_ID buffer_id, String_Const_u8 file_name, Buffer_Save_Flag flags) +buffer_save(Application_Links *app, Buffer_ID buffer_id, String_Const_u8 file_name, Buffer_Save_Flag flags) { Models *models = (Models*)app->cmd_context; Editing_File *file = imp_get_file(models, buffer_id); @@ -834,7 +834,7 @@ Buffer_Save(Application_Links *app, Buffer_ID buffer_id, String_Const_u8 file_na } api(custom) function Buffer_Kill_Result -Buffer_Kill(Application_Links *app, Buffer_ID buffer_id, Buffer_Kill_Flag flags) +buffer_kill(Application_Links *app, Buffer_ID buffer_id, Buffer_Kill_Flag flags) { Models *models = (Models*)app->cmd_context; Working_Set *working_set = &models->working_set; @@ -890,7 +890,7 @@ Buffer_Kill(Application_Links *app, Buffer_ID buffer_id, Buffer_Kill_Flag flags) } api(custom) function Buffer_Reopen_Result -Buffer_Reopen(Application_Links *app, Buffer_ID buffer_id, Buffer_Reopen_Flag flags) +buffer_reopen(Application_Links *app, Buffer_ID buffer_id, Buffer_Reopen_Flag flags) { Models *models = (Models*)app->cmd_context; Scratch_Block scratch(models->tctx, Scratch_Share); @@ -961,7 +961,7 @@ Buffer_Reopen(Application_Links *app, Buffer_ID buffer_id, Buffer_Reopen_Flag fl } api(custom) function File_Attributes -Buffer_Get_File_Attributes(Application_Links *app, Buffer_ID buffer_id) +buffer_get_file_attributes(Application_Links *app, Buffer_ID buffer_id) { Models *models = (Models*)app->cmd_context; Editing_File *file = imp_get_file(models, buffer_id); @@ -973,7 +973,7 @@ Buffer_Get_File_Attributes(Application_Links *app, Buffer_ID buffer_id) } api(custom) function File_Attributes -Get_File_Attributes(Application_Links *app, String_Const_u8 file_name) +get_file_attributes(Application_Links *app, String_Const_u8 file_name) { Models *models = (Models*)app->cmd_context; Scratch_Block scratch(models->tctx, Scratch_Share); @@ -1019,7 +1019,7 @@ get_view_prev__inner(Layout *layout, View *view){ } api(custom) function View_ID -Get_View_Next(Application_Links *app, View_ID view_id, Access_Flag access) +get_view_next(Application_Links *app, View_ID view_id, Access_Flag access) { Models *models = (Models*)app->cmd_context; Layout *layout = &models->layout; @@ -1036,7 +1036,7 @@ Get_View_Next(Application_Links *app, View_ID view_id, Access_Flag access) } api(custom) function View_ID -Get_View_Prev(Application_Links *app, View_ID view_id, Access_Flag access) +get_view_prev(Application_Links *app, View_ID view_id, Access_Flag access) { Models *models = (Models*)app->cmd_context; Layout *layout = &models->layout; @@ -1053,7 +1053,7 @@ Get_View_Prev(Application_Links *app, View_ID view_id, Access_Flag access) } api(custom) function View_ID -Get_Active_View(Application_Links *app, Access_Flag access) +get_active_view(Application_Links *app, Access_Flag access) { Models *models = (Models*)app->cmd_context; Panel *panel = layout_get_active_panel(&models->layout); @@ -1068,7 +1068,7 @@ Get_Active_View(Application_Links *app, Access_Flag access) } api(custom) function Panel_ID -Get_Active_Panel(Application_Links *app){ +get_active_panel(Application_Links *app){ Models *models = (Models*)app->cmd_context; Panel *panel = layout_get_active_panel(&models->layout); Assert(panel != 0); @@ -1080,7 +1080,7 @@ Get_Active_Panel(Application_Links *app){ } api(custom) function b32 -View_Exists(Application_Links *app, View_ID view_id){ +view_exists(Application_Links *app, View_ID view_id){ Models *models = (Models*)app->cmd_context; View *view = imp_get_view(models, view_id); b32 result = false; @@ -1091,7 +1091,7 @@ View_Exists(Application_Links *app, View_ID view_id){ } api(custom) function Buffer_ID -View_Get_Buffer(Application_Links *app, View_ID view_id, Access_Flag access){ +view_get_buffer(Application_Links *app, View_ID view_id, Access_Flag access){ Models *models = (Models*)app->cmd_context; View *view = imp_get_view(models, view_id); Buffer_ID result = 0; @@ -1105,7 +1105,7 @@ View_Get_Buffer(Application_Links *app, View_ID view_id, Access_Flag access){ } api(custom) function i64 -View_Get_Cursor_Pos(Application_Links *app, View_ID view_id){ +view_get_cursor_pos(Application_Links *app, View_ID view_id){ Models *models = (Models*)app->cmd_context; View *view = imp_get_view(models, view_id); i64 result = 0; @@ -1117,7 +1117,7 @@ View_Get_Cursor_Pos(Application_Links *app, View_ID view_id){ } api(custom) function i64 -View_Get_Mark_Pos(Application_Links *app, View_ID view_id){ +view_get_mark_pos(Application_Links *app, View_ID view_id){ Models *models = (Models*)app->cmd_context; View *view = imp_get_view(models, view_id); i64 result = 0;; @@ -1128,7 +1128,7 @@ View_Get_Mark_Pos(Application_Links *app, View_ID view_id){ } api(custom) function f32 -View_Get_Preferred_X(Application_Links *app, View_ID view_id){ +view_get_preferred_x(Application_Links *app, View_ID view_id){ Models *models = (Models*)app->cmd_context; View *view = imp_get_view(models, view_id); f32 result = 0.f;; @@ -1139,7 +1139,7 @@ View_Get_Preferred_X(Application_Links *app, View_ID view_id){ } api(custom) function b32 -View_Set_Preferred_X(Application_Links *app, View_ID view_id, f32 x){ +view_set_preferred_x(Application_Links *app, View_ID view_id, f32 x){ Models *models = (Models*)app->cmd_context; View *view = imp_get_view(models, view_id); b32 result = false; @@ -1151,7 +1151,7 @@ View_Set_Preferred_X(Application_Links *app, View_ID view_id, f32 x){ } api(custom) function Rect_f32 -View_Get_Screen_Rect(Application_Links *app, View_ID view_id){ +view_get_screen_rect(Application_Links *app, View_ID view_id){ Models *models = (Models*)app->cmd_context; Rect_f32 result = {}; View *view = imp_get_view(models, view_id); @@ -1162,7 +1162,7 @@ View_Get_Screen_Rect(Application_Links *app, View_ID view_id){ } api(custom) function Panel_ID -View_Get_Panel(Application_Links *app, View_ID view_id){ +view_get_panel(Application_Links *app, View_ID view_id){ Models *models = (Models*)app->cmd_context; Layout *layout = &models->layout; View *view = imp_get_view(models, view_id); @@ -1175,7 +1175,7 @@ View_Get_Panel(Application_Links *app, View_ID view_id){ } api(custom) function View_ID -Panel_Get_View(Application_Links *app, Panel_ID panel_id){ +panel_get_view(Application_Links *app, Panel_ID panel_id){ Models *models = (Models*)app->cmd_context; Panel *panel = imp_get_panel(models, panel_id); View_ID result = 0; @@ -1190,7 +1190,7 @@ Panel_Get_View(Application_Links *app, Panel_ID panel_id){ } api(custom) function b32 -Panel_Is_Split(Application_Links *app, Panel_ID panel_id){ +panel_is_split(Application_Links *app, Panel_ID panel_id){ Models *models = (Models*)app->cmd_context; b32 result = false; Panel *panel = imp_get_panel(models, panel_id); @@ -1203,7 +1203,7 @@ Panel_Is_Split(Application_Links *app, Panel_ID panel_id){ } api(custom) function b32 -Panel_Is_Leaf(Application_Links *app, Panel_ID panel_id){ +panel_is_leaf(Application_Links *app, Panel_ID panel_id){ Models *models = (Models*)app->cmd_context; b32 result = false; Panel *panel = imp_get_panel(models, panel_id); @@ -1216,7 +1216,7 @@ Panel_Is_Leaf(Application_Links *app, Panel_ID panel_id){ } api(custom) function b32 -Panel_Split(Application_Links *app, Panel_ID panel_id, Panel_Split_Orientation orientation){ +panel_split(Application_Links *app, Panel_ID panel_id, Panel_Split_Orientation orientation){ Models *models = (Models*)app->cmd_context; Layout *layout = &models->layout; b32 result = false; @@ -1234,7 +1234,7 @@ Panel_Split(Application_Links *app, Panel_ID panel_id, Panel_Split_Orientation o } api(custom) function b32 -Panel_Set_Split(Application_Links *app, Panel_ID panel_id, Panel_Split_Kind kind, float t){ +panel_set_split(Application_Links *app, Panel_ID panel_id, Panel_Split_Kind kind, float t){ Models *models = (Models*)app->cmd_context; Layout *layout = &models->layout; b32 result = false; @@ -1268,7 +1268,7 @@ Panel_Set_Split(Application_Links *app, Panel_ID panel_id, Panel_Split_Kind kind } api(custom) function b32 -Panel_Swap_Children(Application_Links *app, Panel_ID panel_id, Panel_Split_Kind kind, float t){ +panel_swap_children(Application_Links *app, Panel_ID panel_id, Panel_Split_Kind kind, float t){ Models *models = (Models*)app->cmd_context; Layout *layout = &models->layout; b32 result = false; @@ -1283,7 +1283,7 @@ Panel_Swap_Children(Application_Links *app, Panel_ID panel_id, Panel_Split_Kind } api(custom) function Panel_ID -Panel_Get_Parent(Application_Links *app, Panel_ID panel_id){ +panel_get_parent(Application_Links *app, Panel_ID panel_id){ Models *models = (Models*)app->cmd_context; Layout *layout = &models->layout; Panel *panel = imp_get_panel(models, panel_id); @@ -1295,7 +1295,7 @@ Panel_Get_Parent(Application_Links *app, Panel_ID panel_id){ } api(custom) function Panel_ID -Panel_Get_Child(Application_Links *app, Panel_ID panel_id, Panel_Child which_child){ +panel_get_child(Application_Links *app, Panel_ID panel_id, Panel_Child which_child){ Models *models = (Models*)app->cmd_context; Layout *layout = &models->layout; Panel *panel = imp_get_panel(models, panel_id); @@ -1322,7 +1322,7 @@ Panel_Get_Child(Application_Links *app, Panel_ID panel_id, Panel_Child which_chi } api(custom) function Panel_ID -Panel_Get_Max(Application_Links *app, Panel_ID panel_id){ +panel_get_max(Application_Links *app, Panel_ID panel_id){ Models *models = (Models*)app->cmd_context; Layout *layout = &models->layout; Panel *panel = imp_get_panel(models, panel_id); @@ -1337,7 +1337,7 @@ Panel_Get_Max(Application_Links *app, Panel_ID panel_id){ } api(custom) function Rect_i32 -Panel_Get_Margin(Application_Links *app, Panel_ID panel_id){ +panel_get_margin(Application_Links *app, Panel_ID panel_id){ Models *models = (Models*)app->cmd_context; Layout *layout = &models->layout; Panel *panel = imp_get_panel(models, panel_id); @@ -1355,7 +1355,7 @@ Panel_Get_Margin(Application_Links *app, Panel_ID panel_id){ } api(custom) function b32 -View_Close(Application_Links *app, View_ID view_id) +view_close(Application_Links *app, View_ID view_id) { Models *models = (Models*)app->cmd_context; Layout *layout = &models->layout; @@ -1371,7 +1371,7 @@ View_Close(Application_Links *app, View_ID view_id) } api(custom) function Rect_f32 -View_Get_Buffer_Region(Application_Links *app, View_ID view_id){ +view_get_buffer_region(Application_Links *app, View_ID view_id){ Models *models = (Models*)app->cmd_context; View *view = imp_get_view(models, view_id); Rect_f32 result = {}; @@ -1382,7 +1382,7 @@ View_Get_Buffer_Region(Application_Links *app, View_ID view_id){ } api(custom) function Buffer_Scroll -View_Get_Buffer_Scroll(Application_Links *app, View_ID view_id){ +view_get_buffer_scroll(Application_Links *app, View_ID view_id){ Models *models = (Models*)app->cmd_context; Buffer_Scroll result = {}; View *view = imp_get_view(models, view_id); @@ -1396,7 +1396,7 @@ View_Get_Buffer_Scroll(Application_Links *app, View_ID view_id){ } api(custom) function Basic_Scroll -View_Get_Basic_Scroll(Application_Links *app, View_ID view_id){ +view_get_basic_scroll(Application_Links *app, View_ID view_id){ Models *models = (Models*)app->cmd_context; Basic_Scroll result = {}; View *view = imp_get_view(models, view_id); @@ -1409,7 +1409,7 @@ View_Get_Basic_Scroll(Application_Links *app, View_ID view_id){ } api(custom) function b32 -View_Set_Active(Application_Links *app, View_ID view_id) +view_set_active(Application_Links *app, View_ID view_id) { Models *models = (Models*)app->cmd_context; View *view = imp_get_view(models, view_id); @@ -1422,7 +1422,7 @@ View_Set_Active(Application_Links *app, View_ID view_id) } api(custom) function b32 -View_Get_Setting(Application_Links *app, View_ID view_id, View_Setting_ID setting, i32 *value_out) +view_get_setting(Application_Links *app, View_ID view_id, View_Setting_ID setting, i32 *value_out) { Models *models = (Models*)app->cmd_context; View *view = imp_get_view(models, view_id); @@ -1461,7 +1461,7 @@ View_Get_Setting(Application_Links *app, View_ID view_id, View_Setting_ID settin } api(custom) function b32 -View_Set_Setting(Application_Links *app, View_ID view_id, View_Setting_ID setting, i32 value) +view_set_setting(Application_Links *app, View_ID view_id, View_Setting_ID setting, i32 value) { Models *models = (Models*)app->cmd_context; View *view = imp_get_view(models, view_id); @@ -1500,7 +1500,7 @@ View_Set_Setting(Application_Links *app, View_ID view_id, View_Setting_ID settin } api(custom) function Managed_Scope -View_Get_Managed_Scope(Application_Links *app, View_ID view_id) +view_get_managed_scope(Application_Links *app, View_ID view_id) { Models *models = (Models*)app->cmd_context; View *view = imp_get_view(models, view_id); @@ -1513,7 +1513,7 @@ View_Get_Managed_Scope(Application_Links *app, View_ID view_id) } api(custom) function Buffer_Cursor -Buffer_Compute_Cursor(Application_Links *app, Buffer_ID buffer, Buffer_Seek seek) +buffer_compute_cursor(Application_Links *app, Buffer_ID buffer, Buffer_Seek seek) { Models *models = (Models*)app->cmd_context; Editing_File *file = imp_get_file(models, buffer); @@ -1525,7 +1525,7 @@ Buffer_Compute_Cursor(Application_Links *app, Buffer_ID buffer, Buffer_Seek seek } api(custom) function Buffer_Cursor -View_Compute_Cursor(Application_Links *app, View_ID view_id, Buffer_Seek seek){ +view_compute_cursor(Application_Links *app, View_ID view_id, Buffer_Seek seek){ Models *models = (Models*)app->cmd_context; View *view = imp_get_view(models, view_id); Buffer_Cursor result = {}; @@ -1536,7 +1536,7 @@ View_Compute_Cursor(Application_Links *app, View_ID view_id, Buffer_Seek seek){ } api(custom) function b32 -View_Set_Cursor(Application_Links *app, View_ID view_id, Buffer_Seek seek) +view_set_cursor(Application_Links *app, View_ID view_id, Buffer_Seek seek) { Models *models = (Models*)app->cmd_context; View *view = imp_get_view(models, view_id); @@ -1554,7 +1554,7 @@ View_Set_Cursor(Application_Links *app, View_ID view_id, Buffer_Seek seek) } api(custom) function b32 -View_Set_Buffer_Scroll(Application_Links *app, View_ID view_id, Buffer_Scroll scroll) +view_set_buffer_scroll(Application_Links *app, View_ID view_id, Buffer_Scroll scroll) { Models *models = (Models*)app->cmd_context; b32 result = false; @@ -1577,7 +1577,7 @@ View_Set_Buffer_Scroll(Application_Links *app, View_ID view_id, Buffer_Scroll sc } api(custom) function b32 -View_Set_Basic_Scroll(Application_Links *app, View_ID view_id, Basic_Scroll scroll) +view_set_basic_scroll(Application_Links *app, View_ID view_id, Basic_Scroll scroll) { Models *models = (Models*)app->cmd_context; b32 result = false; @@ -1595,7 +1595,7 @@ View_Set_Basic_Scroll(Application_Links *app, View_ID view_id, Basic_Scroll scro } api(custom) function b32 -View_Set_Mark(Application_Links *app, View_ID view_id, Buffer_Seek seek) +view_set_mark(Application_Links *app, View_ID view_id, Buffer_Seek seek) { Models *models = (Models*)app->cmd_context; View *view = imp_get_view(models, view_id); @@ -1619,7 +1619,7 @@ View_Set_Mark(Application_Links *app, View_ID view_id, Buffer_Seek seek) } api(custom) function b32 -View_Set_Buffer(Application_Links *app, View_ID view_id, Buffer_ID buffer_id, Set_Buffer_Flag flags) +view_set_buffer(Application_Links *app, View_ID view_id, Buffer_ID buffer_id, Set_Buffer_Flag flags) { Models *models = (Models*)app->cmd_context; View *view = imp_get_view(models, view_id); @@ -1640,7 +1640,7 @@ View_Set_Buffer(Application_Links *app, View_ID view_id, Buffer_ID buffer_id, Se } api(custom) function b32 -View_Post_Fade(Application_Links *app, View_ID view_id, f32 seconds, Range_i64 range, int_color color) +view_post_fade(Application_Links *app, View_ID view_id, f32 seconds, Range_i64 range, int_color color) { Models *models = (Models*)app->cmd_context; View *view = imp_get_view(models, view_id); @@ -1656,7 +1656,7 @@ View_Post_Fade(Application_Links *app, View_ID view_id, f32 seconds, Range_i64 r } api(custom) function b32 -View_Begin_UI_Mode(Application_Links *app, View_ID view_id) +view_begin_ui_mode(Application_Links *app, View_ID view_id) { Models *models = (Models*)app->cmd_context; View *view = imp_get_view(models, view_id); @@ -1671,7 +1671,7 @@ View_Begin_UI_Mode(Application_Links *app, View_ID view_id) } api(custom) function b32 -View_End_UI_Mode(Application_Links *app, View_ID view_id) +view_end_ui_mode(Application_Links *app, View_ID view_id) { Models *models = (Models*)app->cmd_context; View *view = imp_get_view(models, view_id); @@ -1685,7 +1685,7 @@ View_End_UI_Mode(Application_Links *app, View_ID view_id) } api(custom) function b32 -View_Is_In_UI_Mode(Application_Links *app, View_ID view_id){ +view_is_in_ui_mode(Application_Links *app, View_ID view_id){ Models *models = (Models*)app->cmd_context; View *view = imp_get_view(models, view_id); b32 result = false; @@ -1696,7 +1696,7 @@ View_Is_In_UI_Mode(Application_Links *app, View_ID view_id){ } api(custom) function b32 -View_Set_Quit_UI_Handler(Application_Links *app, View_ID view_id, UI_Quit_Function_Type *quit_function) +view_set_quit_ui_handler(Application_Links *app, View_ID view_id, UI_Quit_Function_Type *quit_function) { Models *models = (Models*)app->cmd_context; View *view = imp_get_view(models, view_id); @@ -1709,7 +1709,7 @@ View_Set_Quit_UI_Handler(Application_Links *app, View_ID view_id, UI_Quit_Functi } api(custom) function b32 -View_Get_Quit_UI_Handler(Application_Links *app, View_ID view_id, UI_Quit_Function_Type **quit_function_out) +view_get_quit_ui_handler(Application_Links *app, View_ID view_id, UI_Quit_Function_Type **quit_function_out) { Models *models = (Models*)app->cmd_context; View *view = imp_get_view(models, view_id); @@ -1734,7 +1734,7 @@ get_dynamic_workspace(Models *models, Managed_Scope handle){ } api(custom) function Managed_Scope -Create_User_Managed_Scope(Application_Links *app) +create_user_managed_scope(Application_Links *app) { Models *models = (Models*)app->cmd_context; Lifetime_Object *object = lifetime_alloc_object(&models->lifetime_allocator, DynamicWorkspace_Unassociated, 0); @@ -1744,7 +1744,7 @@ Create_User_Managed_Scope(Application_Links *app) } api(custom) function b32 -Destroy_User_Managed_Scope(Application_Links *app, Managed_Scope scope) +destroy_user_managed_scope(Application_Links *app, Managed_Scope scope) { Models *models = (Models*)app->cmd_context; Dynamic_Workspace *workspace = get_dynamic_workspace(models, scope); @@ -1758,7 +1758,7 @@ Destroy_User_Managed_Scope(Application_Links *app, Managed_Scope scope) } api(custom) function Managed_Scope -Get_Global_Managed_Scope(Application_Links *app) +get_global_managed_scope(Application_Links *app) { Models *models = (Models*)app->cmd_context; return((Managed_Scope)models->dynamic_workspace.scope_id); @@ -1791,7 +1791,7 @@ get_lifetime_object_from_workspace(Dynamic_Workspace *workspace){ } api(custom) function Managed_Scope -Get_Managed_Scope_With_Multiple_Dependencies(Application_Links *app, Managed_Scope *scopes, i32 count) +get_managed_scope_with_multiple_dependencies(Application_Links *app, Managed_Scope *scopes, i32 count) { Models *models = (Models*)app->cmd_context; Lifetime_Allocator *lifetime_allocator = &models->lifetime_allocator; @@ -1875,7 +1875,7 @@ Get_Managed_Scope_With_Multiple_Dependencies(Application_Links *app, Managed_Sco } api(custom) function b32 -Managed_Scope_Clear_Contents(Application_Links *app, Managed_Scope scope) +managed_scope_clear_contents(Application_Links *app, Managed_Scope scope) { Models *models = (Models*)app->cmd_context; Dynamic_Workspace *workspace = get_dynamic_workspace(models, scope); @@ -1888,7 +1888,7 @@ Managed_Scope_Clear_Contents(Application_Links *app, Managed_Scope scope) } api(custom) function b32 -Managed_Scope_Clear_Self_All_Dependent_Scopes(Application_Links *app, Managed_Scope scope) +managed_scope_clear_self_all_dependent_scopes(Application_Links *app, Managed_Scope scope) { Models *models = (Models*)app->cmd_context; Dynamic_Workspace *workspace = get_dynamic_workspace(models, scope); @@ -1903,7 +1903,7 @@ Managed_Scope_Clear_Self_All_Dependent_Scopes(Application_Links *app, Managed_Sc } api(custom) function Base_Allocator* -Managed_Scope_Allocator(Application_Links *app, Managed_Scope scope) +managed_scope_allocator(Application_Links *app, Managed_Scope scope) { Models *models = (Models*)app->cmd_context; Dynamic_Workspace *workspace = get_dynamic_workspace(models, scope); @@ -1915,7 +1915,7 @@ Managed_Scope_Allocator(Application_Links *app, Managed_Scope scope) } api(custom) function Managed_ID -Managed_Id_Declare(Application_Links *app, String_Const_u8 name) +managed_id_declare(Application_Links *app, String_Const_u8 name) { Models *models = (Models*)app->cmd_context; Managed_ID_Set *set = &models->managed_id_set; @@ -1923,7 +1923,7 @@ Managed_Id_Declare(Application_Links *app, String_Const_u8 name) } api(custom) function void* -Managed_Scope_Get_Attachment(Application_Links *app, Managed_Scope scope, Managed_ID id, umem size){ +managed_scope_get_attachment(Application_Links *app, Managed_Scope scope, Managed_ID id, umem size){ Models *models = (Models*)app->cmd_context; Dynamic_Workspace *workspace = get_dynamic_workspace(models, scope); void *result = 0; @@ -1943,7 +1943,7 @@ Managed_Scope_Get_Attachment(Application_Links *app, Managed_Scope scope, Manage } api(custom) function void* -Managed_Scope_Attachment_Erase(Application_Links *app, Managed_Scope scope, Managed_ID id){ +managed_scope_attachment_erase(Application_Links *app, Managed_Scope scope, Managed_ID id){ Models *models = (Models*)app->cmd_context; Dynamic_Workspace *workspace = get_dynamic_workspace(models, scope); void *result = 0; @@ -1955,7 +1955,7 @@ Managed_Scope_Attachment_Erase(Application_Links *app, Managed_Scope scope, Mana } api(custom) function Managed_Object -Alloc_Managed_Memory_In_Scope(Application_Links *app, Managed_Scope scope, i32 item_size, i32 count) +alloc_managed_memory_in_scope(Application_Links *app, Managed_Scope scope, i32 item_size, i32 count) { Models *models = (Models*)app->cmd_context; Dynamic_Workspace *workspace = get_dynamic_workspace(models, scope); @@ -1967,7 +1967,7 @@ Alloc_Managed_Memory_In_Scope(Application_Links *app, Managed_Scope scope, i32 i } api(custom) function Managed_Object -Alloc_Buffer_Markers_On_Buffer(Application_Links *app, Buffer_ID buffer_id, i32 count, Managed_Scope *optional_extra_scope) +alloc_buffer_markers_on_buffer(Application_Links *app, Buffer_ID buffer_id, i32 count, Managed_Scope *optional_extra_scope) { Models *models = (Models*)app->cmd_context; Editing_File *file = imp_get_file(models, buffer_id); @@ -1976,7 +1976,7 @@ Alloc_Buffer_Markers_On_Buffer(Application_Links *app, Buffer_ID buffer_id, i32 Managed_Object scope_array[2]; scope_array[0] = markers_scope; scope_array[1] = *optional_extra_scope; - markers_scope = Get_Managed_Scope_With_Multiple_Dependencies(app, scope_array, 2); + markers_scope = get_managed_scope_with_multiple_dependencies(app, scope_array, 2); } Dynamic_Workspace *workspace = get_dynamic_workspace(models, markers_scope); Managed_Object result = 0; @@ -2003,7 +2003,7 @@ get_dynamic_object_ptrs(Models *models, Managed_Object object){ } api(custom) function u32 -Managed_Object_Get_Item_Size(Application_Links *app, Managed_Object object) +managed_object_get_item_size(Application_Links *app, Managed_Object object) { Models *models = (Models*)app->cmd_context; Managed_Object_Ptr_And_Workspace object_ptrs = get_dynamic_object_ptrs(models, object); @@ -2015,7 +2015,7 @@ Managed_Object_Get_Item_Size(Application_Links *app, Managed_Object object) } api(custom) function u32 -Managed_Object_Get_Item_Count(Application_Links *app, Managed_Object object) +managed_object_get_item_count(Application_Links *app, Managed_Object object) { Models *models = (Models*)app->cmd_context; Managed_Object_Ptr_And_Workspace object_ptrs = get_dynamic_object_ptrs(models, object); @@ -2027,7 +2027,7 @@ Managed_Object_Get_Item_Count(Application_Links *app, Managed_Object object) } api(custom) function void* -Managed_Object_Get_Pointer(Application_Links *app, Managed_Object object) +managed_object_get_pointer(Application_Links *app, Managed_Object object) { Models *models = (Models*)app->cmd_context; Managed_Object_Ptr_And_Workspace object_ptrs = get_dynamic_object_ptrs(models, object); @@ -2035,7 +2035,7 @@ Managed_Object_Get_Pointer(Application_Links *app, Managed_Object object) } api(custom) function Managed_Object_Type -Managed_Object_Get_Type(Application_Links *app, Managed_Object object) +managed_object_get_type(Application_Links *app, Managed_Object object) { Models *models = (Models*)app->cmd_context; Managed_Object_Ptr_And_Workspace object_ptrs = get_dynamic_object_ptrs(models, object); @@ -2050,7 +2050,7 @@ Managed_Object_Get_Type(Application_Links *app, Managed_Object object) } api(custom) function Managed_Scope -Managed_Object_Get_Containing_Scope(Application_Links *app, Managed_Object object) +managed_object_get_containing_scope(Application_Links *app, Managed_Object object) { Models *models = (Models*)app->cmd_context; u32 hi_id = (object >> 32)&max_u32; @@ -2062,7 +2062,7 @@ Managed_Object_Get_Containing_Scope(Application_Links *app, Managed_Object objec } api(custom) function b32 -Managed_Object_Free(Application_Links *app, Managed_Object object) +managed_object_free(Application_Links *app, Managed_Object object) { Models *models = (Models*)app->cmd_context; u32 hi_id = (object >> 32)&max_u32; @@ -2076,7 +2076,7 @@ Managed_Object_Free(Application_Links *app, Managed_Object object) // TODO(allen): ELIMINATE STORE & LOAD api(custom) function b32 -Managed_Object_Store_Data(Application_Links *app, Managed_Object object, u32 first_index, u32 count, void *mem) +managed_object_store_data(Application_Links *app, Managed_Object object, u32 first_index, u32 count, void *mem) { Models *models = (Models*)app->cmd_context; Managed_Object_Ptr_And_Workspace object_ptrs = get_dynamic_object_ptrs(models, object); @@ -2095,7 +2095,7 @@ Managed_Object_Store_Data(Application_Links *app, Managed_Object object, u32 fir } api(custom) function b32 -Managed_Object_Load_Data(Application_Links *app, Managed_Object object, u32 first_index, u32 count, void *mem_out) +managed_object_load_data(Application_Links *app, Managed_Object object, u32 first_index, u32 count, void *mem_out) { Models *models = (Models*)app->cmd_context; Managed_Object_Ptr_And_Workspace object_ptrs = get_dynamic_object_ptrs(models, object); @@ -2114,7 +2114,7 @@ Managed_Object_Load_Data(Application_Links *app, Managed_Object object, u32 firs } api(custom) function User_Input -Get_User_Input(Application_Links *app, Input_Type_Flag get_type, Input_Type_Flag abort_type) +get_user_input(Application_Links *app, Input_Type_Flag get_type, Input_Type_Flag abort_type) { Models *models = (Models*)app->cmd_context; User_Input result = {}; @@ -2130,7 +2130,7 @@ Get_User_Input(Application_Links *app, Input_Type_Flag get_type, Input_Type_Flag } api(custom) function User_Input -Get_Command_Input(Application_Links *app) +get_command_input(Application_Links *app) { Models *models = (Models*)app->cmd_context; User_Input result = {}; @@ -2139,21 +2139,21 @@ Get_Command_Input(Application_Links *app) } api(custom) function void -Set_Command_Input(Application_Links *app, Key_Event_Data key_data) +set_command_input(Application_Links *app, Key_Event_Data key_data) { Models *models = (Models*)app->cmd_context; models->key = key_data; } api(custom) function Mouse_State -Get_Mouse_State(Application_Links *app) +get_mouse_state(Application_Links *app) { Models *models = (Models*)app->cmd_context; return(models->input->mouse); } api(custom) function b32 -Get_Active_Query_Bars(Application_Links *app, View_ID view_id, i32 max_result_count, Query_Bar_Ptr_Array *array_out) +get_active_query_bars(Application_Links *app, View_ID view_id, i32 max_result_count, Query_Bar_Ptr_Array *array_out) { Models *models = (Models*)app->cmd_context; View *view = imp_get_view(models, view_id); @@ -2175,7 +2175,7 @@ Get_Active_Query_Bars(Application_Links *app, View_ID view_id, i32 max_result_co } api(custom) function b32 -Start_Query_Bar(Application_Links *app, Query_Bar *bar, u32 flags) +start_query_bar(Application_Links *app, Query_Bar *bar, u32 flags) { Models *models = (Models*)app->cmd_context; Panel *active_panel = layout_get_active_panel(&models->layout); @@ -2189,7 +2189,7 @@ Start_Query_Bar(Application_Links *app, Query_Bar *bar, u32 flags) } api(custom) function void -End_Query_Bar(Application_Links *app, Query_Bar *bar, u32 flags) +end_query_bar(Application_Links *app, Query_Bar *bar, u32 flags) { Models *models = (Models*)app->cmd_context; Panel *active_panel = layout_get_active_panel(&models->layout); @@ -2198,7 +2198,7 @@ End_Query_Bar(Application_Links *app, Query_Bar *bar, u32 flags) } api(custom) function b32 -Print_Message(Application_Links *app, String_Const_u8 message) +print_message(Application_Links *app, String_Const_u8 message) { Models *models = (Models*)app->cmd_context; Editing_File *file = models->message_buffer; @@ -2212,25 +2212,25 @@ Print_Message(Application_Links *app, String_Const_u8 message) } api(custom) function b32 -Log_String(Application_Links *app, String_Const_u8 str){ +log_string(Application_Links *app, String_Const_u8 str){ return(log_string(str)); } api(custom) function i32 -Thread_Get_ID(Application_Links *app){ +thread_get_id(Application_Links *app){ Models *models = (Models*)app->cmd_context; return(system_thread_get_id()); } api(custom) function Face_ID -Get_Largest_Face_ID(Application_Links *app) +get_largest_face_id(Application_Links *app) { Models *models = (Models*)app->cmd_context; return(font_set_get_largest_id(&models->font_set)); } api(custom) function b32 -Set_Global_Face(Application_Links *app, Face_ID id, b32 apply_to_all_buffers) +set_global_face(Application_Links *app, Face_ID id, b32 apply_to_all_buffers) { Models *models = (Models*)app->cmd_context; @@ -2250,7 +2250,7 @@ Set_Global_Face(Application_Links *app, Face_ID id, b32 apply_to_all_buffers) } api(custom) function History_Record_Index -Buffer_History_Get_Max_Record_Index(Application_Links *app, Buffer_ID buffer_id){ +buffer_history_get_max_record_index(Application_Links *app, Buffer_ID buffer_id){ Models *models = (Models*)app->cmd_context; Editing_File *file = imp_get_file(models, buffer_id); History_Record_Index result = 0; @@ -2283,7 +2283,7 @@ buffer_history__fill_record_info(Record *record, Record_Info *out){ } api(custom) function Record_Info -Buffer_History_Get_Record_Info(Application_Links *app, Buffer_ID buffer_id, History_Record_Index index){ +buffer_history_get_record_info(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); Record_Info result = {}; @@ -2315,7 +2315,7 @@ Buffer_History_Get_Record_Info(Application_Links *app, Buffer_ID buffer_id, Hist } api(custom) function Record_Info -Buffer_History_Get_Group_Sub_Record(Application_Links *app, Buffer_ID buffer_id, History_Record_Index index, i32 sub_index){ +buffer_history_get_group_sub_record(Application_Links *app, Buffer_ID buffer_id, History_Record_Index index, i32 sub_index){ Models *models = (Models*)app->cmd_context; Editing_File *file = imp_get_file(models, buffer_id); Record_Info result = {}; @@ -2358,7 +2358,7 @@ Buffer_History_Get_Group_Sub_Record(Application_Links *app, Buffer_ID buffer_id, } api(custom) function History_Record_Index -Buffer_History_Get_Current_State_Index(Application_Links *app, Buffer_ID buffer_id){ +buffer_history_get_current_state_index(Application_Links *app, Buffer_ID buffer_id){ Models *models = (Models*)app->cmd_context; Editing_File *file = imp_get_file(models, buffer_id); History_Record_Index result = 0; @@ -2369,7 +2369,7 @@ Buffer_History_Get_Current_State_Index(Application_Links *app, Buffer_ID buffer_ } api(custom) function b32 -Buffer_History_Set_Current_State_Index(Application_Links *app, Buffer_ID buffer_id, History_Record_Index index){ +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); b32 result = false; @@ -2384,7 +2384,7 @@ Buffer_History_Set_Current_State_Index(Application_Links *app, Buffer_ID buffer_ } api(custom) function b32 -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){ +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_id); b32 result = false; @@ -2395,7 +2395,7 @@ Buffer_History_Merge_Record_Range(Application_Links *app, Buffer_ID buffer_id, H } api(custom) function b32 -Buffer_History_Clear_After_Current_State(Application_Links *app, Buffer_ID buffer_id){ +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_id); b32 result = false; @@ -2407,19 +2407,19 @@ Buffer_History_Clear_After_Current_State(Application_Links *app, Buffer_ID buffe } api(custom) function void -Global_History_Edit_Group_Begin(Application_Links *app){ +global_history_edit_group_begin(Application_Links *app){ Models *models = (Models*)app->cmd_context; global_history_adjust_edit_grouping_counter(&models->global_history, 1); } api(custom) function void -Global_History_Edit_Group_End(Application_Links *app){ +global_history_edit_group_end(Application_Links *app){ Models *models = (Models*)app->cmd_context; global_history_adjust_edit_grouping_counter(&models->global_history, -1); } api(custom) function b32 -Buffer_Set_Face(Application_Links *app, Buffer_ID buffer_id, Face_ID id) +buffer_set_face(Application_Links *app, Buffer_ID buffer_id, Face_ID id) { Models *models = (Models*)app->cmd_context; Editing_File *file = imp_get_file(models, buffer_id); @@ -2436,7 +2436,7 @@ Buffer_Set_Face(Application_Links *app, Buffer_ID buffer_id, Face_ID id) } api(custom) function Face_Description -Get_Face_Description(Application_Links *app, Face_ID face_id) +get_face_description(Application_Links *app, Face_ID face_id) { Models *models = (Models*)app->cmd_context; Face_Description description = {}; @@ -2454,7 +2454,7 @@ Get_Face_Description(Application_Links *app, Face_ID face_id) } api(custom) function Face_Metrics -Get_Face_Metrics(Application_Links *app, Face_ID face_id){ +get_face_metrics(Application_Links *app, Face_ID face_id){ Models *models = (Models*)app->cmd_context; Face_Metrics result = {}; if (face_id != 0){ @@ -2468,7 +2468,7 @@ Get_Face_Metrics(Application_Links *app, Face_ID face_id){ } api(custom) function Face_ID -Get_Face_ID(Application_Links *app, Buffer_ID buffer_id) +get_face_id(Application_Links *app, Buffer_ID buffer_id) { Models *models = (Models*)app->cmd_context; Face_ID result = 0; @@ -2485,7 +2485,7 @@ Get_Face_ID(Application_Links *app, Buffer_ID buffer_id) } api(custom) function Face_ID -Try_Create_New_Face(Application_Links *app, Face_Description *description) +try_create_new_face(Application_Links *app, Face_Description *description) { Models *models = (Models*)app->cmd_context; Face_ID result = 0; @@ -2505,7 +2505,7 @@ Try_Create_New_Face(Application_Links *app, Face_Description *description) } api(custom) function b32 -Try_Modify_Face(Application_Links *app, Face_ID id, Face_Description *description) +try_modify_face(Application_Links *app, Face_ID id, Face_Description *description) { Models *models = (Models*)app->cmd_context; b32 result = false; @@ -2525,7 +2525,7 @@ Try_Modify_Face(Application_Links *app, Face_ID id, Face_Description *descriptio } api(custom) function b32 -Try_Release_Face(Application_Links *app, Face_ID id, Face_ID replacement_id) +try_release_face(Application_Links *app, Face_ID id, Face_ID replacement_id) { Models *models = (Models*)app->cmd_context; Font_Set *font_set = &models->font_set; @@ -2535,7 +2535,7 @@ Try_Release_Face(Application_Links *app, Face_ID id, Face_ID replacement_id) } api(custom) function void -Set_Theme_Colors(Application_Links *app, Theme_Color *colors, i32 count) +set_theme_colors(Application_Links *app, Theme_Color *colors, i32 count) { Models *models = (Models*)app->cmd_context; Color_Table color_table = models->color_table; @@ -2548,7 +2548,7 @@ Set_Theme_Colors(Application_Links *app, Theme_Color *colors, i32 count) } api(custom) function void -Get_Theme_Colors(Application_Links *app, Theme_Color *colors, i32 count) +get_theme_colors(Application_Links *app, Theme_Color *colors, i32 count) { Models *models = (Models*)app->cmd_context; Color_Table color_table = models->color_table; @@ -2559,7 +2559,7 @@ Get_Theme_Colors(Application_Links *app, Theme_Color *colors, i32 count) } api(custom) function argb_color -Finalize_Color(Application_Links *app, int_color color){ +finalize_color(Application_Links *app, int_color color){ Models *models = (Models*)app->cmd_context; Color_Table color_table = models->color_table; u32 color_rgb = color; @@ -2570,7 +2570,7 @@ Finalize_Color(Application_Links *app, int_color color){ } api(custom) function String_Const_u8 -Push_Hot_Directory(Application_Links *app, Arena *arena) +push_hot_directory(Application_Links *app, Arena *arena) { Models *models = (Models*)app->cmd_context; Hot_Directory *hot = &models->hot_directory; @@ -2579,7 +2579,7 @@ Push_Hot_Directory(Application_Links *app, Arena *arena) } api(custom) function b32 -Set_Hot_Directory(Application_Links *app, String_Const_u8 string) +set_hot_directory(Application_Links *app, String_Const_u8 string) { Models *models = (Models*)app->cmd_context; Hot_Directory *hot = &models->hot_directory; @@ -2588,7 +2588,7 @@ Set_Hot_Directory(Application_Links *app, String_Const_u8 string) } api(custom) function File_List -Get_File_List(Application_Links *app, Arena *arena, String_Const_u8 directory){ +get_file_list(Application_Links *app, Arena *arena, String_Const_u8 directory){ Models *models = (Models*)app->cmd_context; String_Const_u8 canonical_directory = system_get_canonical(arena, directory); File_List list = {}; @@ -2599,7 +2599,7 @@ Get_File_List(Application_Links *app, Arena *arena, String_Const_u8 directory){ } api(custom) function void -Set_GUI_Up_Down_Keys(Application_Links *app, Key_Code up_key, Key_Modifier up_key_modifier, Key_Code down_key, Key_Modifier down_key_modifier) +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) { Models *models = (Models*)app->cmd_context; models->user_up_key = up_key; @@ -2609,7 +2609,7 @@ Set_GUI_Up_Down_Keys(Application_Links *app, Key_Code up_key, Key_Modifier up_ke } api(custom) function void* -Memory_Allocate(Application_Links *app, i32 size) +memory_allocate(Application_Links *app, i32 size) { Models *models = (Models*)app->cmd_context; void *result = system_memory_allocate(size); @@ -2617,21 +2617,21 @@ Memory_Allocate(Application_Links *app, i32 size) } api(custom) function b32 -Memory_Set_Protection(Application_Links *app, void *ptr, i32 size, Memory_Protect_Flags flags) +memory_set_protection(Application_Links *app, void *ptr, i32 size, Memory_Protect_Flags flags) { Models *models = (Models*)app->cmd_context; return(system_memory_set_protection(ptr, size, flags)); } api(custom) function void -Memory_Free(Application_Links *app, void *ptr, i32 size) +memory_free(Application_Links *app, void *ptr, i32 size) { Models *models = (Models*)app->cmd_context; system_memory_free(ptr, size); } api(custom) function String_Const_u8 -Push_4ed_Path(Application_Links *app, Arena *arena) +push_4ed_path(Application_Links *app, Arena *arena) { Models *models = (Models*)app->cmd_context; return(system_get_path(arena, SystemPath_Binary)); @@ -2639,21 +2639,21 @@ Push_4ed_Path(Application_Links *app, Arena *arena) // TODO(allen): do(add a "shown but auto-hides on timer" setting for cursor show type) api(custom) function void -Show_Mouse_Cursor(Application_Links *app, Mouse_Cursor_Show_Type show) +show_mouse_cursor(Application_Links *app, Mouse_Cursor_Show_Type show) { Models *models = (Models*)app->cmd_context; system_show_mouse_cursor(show); } api(custom) function b32 -Set_Edit_Finished_Hook_Repeat_Speed(Application_Links *app, u32 milliseconds){ +set_edit_finished_hook_repeat_speed(Application_Links *app, u32 milliseconds){ Models *models = (Models*)app->cmd_context; models->edit_finished_hook_repeat_speed = milliseconds; return(true); } api(custom) function b32 -Set_Fullscreen(Application_Links *app, b32 full_screen) +set_fullscreen(Application_Links *app, b32 full_screen) { Models *models = (Models*)app->cmd_context; b32 success = system_set_fullscreen(full_screen); @@ -2664,7 +2664,7 @@ Set_Fullscreen(Application_Links *app, b32 full_screen) } api(custom) function b32 -Is_Fullscreen(Application_Links *app) +is_fullscreen(Application_Links *app) { Models *models = (Models*)app->cmd_context; b32 result = system_is_fullscreen(); @@ -2672,14 +2672,14 @@ Is_Fullscreen(Application_Links *app) } api(custom) function void -Send_Exit_Signal(Application_Links *app) +send_exit_signal(Application_Links *app) { Models *models = (Models*)app->cmd_context; models->keep_playing = false; } api(custom) function b32 -Set_Window_Title(Application_Links *app, String_Const_u8 title) +set_window_title(Application_Links *app, String_Const_u8 title) { Models *models = (Models*)app->cmd_context; models->has_new_title = true; @@ -2691,7 +2691,7 @@ Set_Window_Title(Application_Links *app, String_Const_u8 title) } api(custom) function Microsecond_Time_Stamp -Get_Microseconds_Timestamp(Application_Links *app) +get_microseconds_timestamp(Application_Links *app) { // TODO(allen): do(decrease indirection in API calls) Models *models = (Models*)app->cmd_context; @@ -2722,7 +2722,7 @@ draw_helper__models_space_to_screen_space(Models *models, f32_Rect rect){ } api(custom) function Vec2 -Draw_String(Application_Links *app, Face_ID font_id, String_Const_u8 str, Vec2 point, int_color color, u32 flags, Vec2 delta) +draw_string_oriented(Application_Links *app, Face_ID font_id, String_Const_u8 str, Vec2 point, int_color color, u32 flags, Vec2 delta) { Vec2 result = point; Models *models = (Models*)app->cmd_context; @@ -2742,7 +2742,7 @@ Draw_String(Application_Links *app, Face_ID font_id, String_Const_u8 str, Vec2 p } api(custom) function f32 -Get_String_Advance(Application_Links *app, Face_ID font_id, String_Const_u8 str) +get_string_advance(Application_Links *app, Face_ID font_id, String_Const_u8 str) { Models *models = (Models*)app->cmd_context; Face *face = font_set_face_from_id(&models->font_set, font_id); @@ -2750,7 +2750,7 @@ Get_String_Advance(Application_Links *app, Face_ID font_id, String_Const_u8 str) } api(custom) function void -Draw_Rectangle(Application_Links *app, Rect_f32 rect, int_color color){ +draw_rectangle(Application_Links *app, Rect_f32 rect, int_color color){ Models *models = (Models*)app->cmd_context; if (models->in_render_mode){ Color_Table color_table = models->color_table; @@ -2761,7 +2761,7 @@ Draw_Rectangle(Application_Links *app, Rect_f32 rect, int_color color){ } api(custom) function void -Draw_Rectangle_Outline(Application_Links *app, Rect_f32 rect, int_color color) +draw_rectangle_outline(Application_Links *app, Rect_f32 rect, int_color color) { Models *models = (Models*)app->cmd_context; if (models->in_render_mode){ @@ -2773,20 +2773,20 @@ Draw_Rectangle_Outline(Application_Links *app, Rect_f32 rect, int_color color) } api(custom) function void -Draw_Clip_Push(Application_Links *app, Rect_f32 clip_box){ +draw_clip_push(Application_Links *app, Rect_f32 clip_box){ Models *models = (Models*)app->cmd_context; //clip_box = draw_helper__models_space_to_screen_space(models, clip_box); draw_push_clip(models->target, Ri32(clip_box)); } api(custom) function f32_Rect -Draw_Clip_Pop(Application_Links *app){ +draw_clip_pop(Application_Links *app){ Models *models = (Models*)app->cmd_context; return(Rf32(draw_pop_clip(models->target))); } api(custom) function void -Draw_Coordinate_Center_Push(Application_Links *app, Vec2 point){ +draw_coordinate_center_push(Application_Links *app, Vec2 point){ Models *models = (Models*)app->cmd_context; if (models->coordinate_center_stack_top < ArrayCount(models->coordinate_center_stack)){ point = draw_helper__models_space_to_screen_space(models, point); @@ -2796,7 +2796,7 @@ Draw_Coordinate_Center_Push(Application_Links *app, Vec2 point){ } api(custom) function Vec2 -Draw_Coordinate_Center_Pop(Application_Links *app){ +draw_coordinate_center_pop(Application_Links *app){ Models *models = (Models*)app->cmd_context; Vec2 result = {}; if (models->coordinate_center_stack_top > 0){ @@ -2807,7 +2807,7 @@ Draw_Coordinate_Center_Pop(Application_Links *app){ } api(custom) function Text_Layout_ID -Text_Layout_Create(Application_Links *app, Buffer_ID buffer_id, Rect_f32 rect, Buffer_Point buffer_point){ +text_layout_create(Application_Links *app, Buffer_ID buffer_id, Rect_f32 rect, Buffer_Point buffer_point){ Models *models = (Models*)app->cmd_context; Editing_File *file = imp_get_file(models, buffer_id); Text_Layout_ID result = {}; @@ -2849,7 +2849,7 @@ Text_Layout_Create(Application_Links *app, Buffer_ID buffer_id, Rect_f32 rect, B } api(custom) function b32 -Text_Layout_Get_Buffer(Application_Links *app, Text_Layout_ID text_layout_id, Buffer_ID *buffer_id_out){ +text_layout_get_buffer(Application_Links *app, Text_Layout_ID text_layout_id, Buffer_ID *buffer_id_out){ Models *models = (Models*)app->cmd_context; b32 result = false; Text_Layout *layout = text_layout_get(&models->text_layouts, text_layout_id); @@ -2861,7 +2861,7 @@ Text_Layout_Get_Buffer(Application_Links *app, Text_Layout_ID text_layout_id, Bu } api(custom) function Interval_i64 -Text_Layout_Get_Visible_Range(Application_Links *app, Text_Layout_ID text_layout_id){ +text_layout_get_visible_range(Application_Links *app, Text_Layout_ID text_layout_id){ Models *models = (Models*)app->cmd_context; Range_i64 result = {}; Text_Layout *layout = text_layout_get(&models->text_layouts, text_layout_id); @@ -2872,7 +2872,7 @@ Text_Layout_Get_Visible_Range(Application_Links *app, Text_Layout_ID text_layout } api(custom) function Rect_f32 -Text_Layout_Line_On_Screen(Application_Links *app, Text_Layout_ID layout_id, i64 line_number){ +text_layout_line_on_screen(Application_Links *app, Text_Layout_ID layout_id, i64 line_number){ Models *models = (Models*)app->cmd_context; Rect_f32 result = {}; Text_Layout *layout = text_layout_get(&models->text_layouts, layout_id); @@ -2910,7 +2910,7 @@ Text_Layout_Line_On_Screen(Application_Links *app, Text_Layout_ID layout_id, i64 } api(custom) function Rect_f32 -Text_Layout_Character_On_Screen(Application_Links *app, Text_Layout_ID layout_id, i64 pos){ +text_layout_character_on_screen(Application_Links *app, Text_Layout_ID layout_id, i64 pos){ Models *models = (Models*)app->cmd_context; Rect_f32 result = {}; Text_Layout *layout = text_layout_get(&models->text_layouts, layout_id); @@ -2971,7 +2971,7 @@ Text_Layout_Character_On_Screen(Application_Links *app, Text_Layout_ID layout_id } api(custom) function void -Paint_Text_Color(Application_Links *app, Text_Layout_ID layout_id, Interval_i64 range, int_color color){ +paint_text_color(Application_Links *app, Text_Layout_ID layout_id, Interval_i64 range, int_color color){ Models *models = (Models*)app->cmd_context; Rect_f32 result = {}; Text_Layout *layout = text_layout_get(&models->text_layouts, layout_id); @@ -2988,13 +2988,13 @@ Paint_Text_Color(Application_Links *app, Text_Layout_ID layout_id, Interval_i64 } api(custom) function b32 -Text_Layout_Free(Application_Links *app, Text_Layout_ID text_layout_id){ +text_layout_free(Application_Links *app, Text_Layout_ID text_layout_id){ Models *models = (Models*)app->cmd_context; return(text_layout_erase(models, &models->text_layouts, text_layout_id)); } api(custom) function void -Draw_Text_Layout(Application_Links *app, Text_Layout_ID layout_id){ +draw_text_layout(Application_Links *app, Text_Layout_ID layout_id){ Models *models = (Models*)app->cmd_context; Text_Layout *layout = text_layout_get(&models->text_layouts, layout_id); if (layout != 0 && models->target != 0){ @@ -3003,7 +3003,7 @@ Draw_Text_Layout(Application_Links *app, Text_Layout_ID layout_id){ } api(custom) function void -Open_Color_Picker(Application_Links *app, Color_Picker *picker) +open_color_picker(Application_Links *app, Color_Picker *picker) { Models *models = (Models*)app->cmd_context; if (picker->finished){ @@ -3013,7 +3013,7 @@ Open_Color_Picker(Application_Links *app, Color_Picker *picker) } api(custom) function void -Animate_In_N_Milliseconds(Application_Links *app, u32 n) +animate_in_n_milliseconds(Application_Links *app, u32 n) { Models *models = (Models*)app->cmd_context; if (n == 0){ @@ -3025,7 +3025,7 @@ Animate_In_N_Milliseconds(Application_Links *app, u32 n) } api(custom) function String_Match_List -Buffer_Find_All_Matches(Application_Links *app, Arena *arena, Buffer_ID buffer, i32 string_id, Range_i64 range, String_Const_u8 needle, Character_Predicate *predicate, Scan_Direction direction) +buffer_find_all_matches(Application_Links *app, Arena *arena, Buffer_ID buffer, i32 string_id, Range_i64 range, String_Const_u8 needle, Character_Predicate *predicate, Scan_Direction direction) { Models *models = (Models*)app->cmd_context; Editing_File *file = imp_get_file(models, buffer); diff --git a/4ed_api_parser.cpp b/4ed_api_parser.cpp index e8ef35fb..584d687f 100644 --- a/4ed_api_parser.cpp +++ b/4ed_api_parser.cpp @@ -10,17 +10,17 @@ // TOP #include "4coder_base_types.h" -#include "4ed_api_definition.h" #include "4coder_token.h" #include "generated/lexer_cpp.h" +#include "4ed_api_definition.h" #include "4coder_base_types.cpp" -#include "4ed_api_definition.cpp" #include "4coder_stringf.cpp" #include "4coder_malloc_allocator.cpp" #include "4coder_token.cpp" #include "generated/lexer_cpp.cpp" #include "4coder_file.cpp" +#include "4ed_api_definition.cpp" //////////////////////////////// @@ -237,7 +237,7 @@ main(int argc, char **argv){ for (API_Definition *node = list.first; node != 0; node = node->next){ - generate_api_master_list(&arena, node, stdout); + api_definition_generate_api_includes(&arena, node, GeneratedGroup_Custom, APIGeneration_NoAPINameOnCallables); } } diff --git a/4ed_app_target.cpp b/4ed_app_target.cpp index 98b7b829..c5b40408 100644 --- a/4ed_app_target.cpp +++ b/4ed_app_target.cpp @@ -11,9 +11,14 @@ #define REMOVE_OLD_STRING -#include "api/4coder_custom.h" - #include "4coder_base_types.h" +#include "api/4coder_version.h" +#include "api/4coder_keycodes.h" +#include "api/4coder_default_colors.h" +#include "api/4coder_types.h" +#define STATIC_LINK_API +#include "generated/custom_api.h" + #include "4coder_table.h" #include "4ed_font_interface.h" @@ -63,6 +68,7 @@ #include "4ed_log.h" #include "4ed_app_models.h" +#include "generated/custom_api.cpp" #define DYNAMIC_LINK_API #include "generated/system_api.cpp" #define DYNAMIC_LINK_API diff --git a/custom/4coder_base_commands.cpp b/custom/4coder_base_commands.cpp index a4313cb7..83c31640 100644 --- a/custom/4coder_base_commands.cpp +++ b/custom/4coder_base_commands.cpp @@ -908,7 +908,7 @@ isearch(Application_Links *app, Scan_Direction start_scan, String_Const_u8 query case Scan_Forward: { i64 new_pos = 0; - buffer_seek_string_insensitive_forward(app, buffer, pos - 1, 0, bar.string, &new_pos); + seek_string_insensitive_forward(app, buffer, pos - 1, 0, bar.string, &new_pos); if (new_pos < buffer_size){ pos = new_pos; match_size = bar.string.size; @@ -918,7 +918,7 @@ isearch(Application_Links *app, Scan_Direction start_scan, String_Const_u8 query case Scan_Backward: { i64 new_pos = 0; - buffer_seek_string_insensitive_backward(app, buffer, pos + 1, 0, bar.string, &new_pos); + seek_string_insensitive_backward(app, buffer, pos + 1, 0, bar.string, &new_pos); if (new_pos >= 0){ pos = new_pos; match_size = bar.string.size; @@ -932,7 +932,7 @@ isearch(Application_Links *app, Scan_Direction start_scan, String_Const_u8 query case Scan_Forward: { i64 new_pos = 0; - buffer_seek_string_insensitive_forward(app, buffer, pos, 0, bar.string, &new_pos); + seek_string_insensitive_forward(app, buffer, pos, 0, bar.string, &new_pos); if (new_pos < buffer_size){ pos = new_pos; match_size = bar.string.size; @@ -942,7 +942,7 @@ isearch(Application_Links *app, Scan_Direction start_scan, String_Const_u8 query case Scan_Backward: { i64 new_pos = 0; - buffer_seek_string_insensitive_backward(app, buffer, pos, 0, bar.string, &new_pos); + seek_string_insensitive_backward(app, buffer, pos, 0, bar.string, &new_pos); if (new_pos >= 0){ pos = new_pos; match_size = bar.string.size; @@ -1076,7 +1076,7 @@ CUSTOM_DOC("Queries the user for a needle and string. Replaces all occurences of static void query_replace_base(Application_Links *app, View_ID view, Buffer_ID buffer_id, i64 pos, String_Const_u8 r, String_Const_u8 w){ i64 new_pos = 0; - buffer_seek_string_forward(app, buffer_id, pos - 1, 0, r, &new_pos); + seek_string_forward(app, buffer_id, pos - 1, 0, r, &new_pos); cursor_is_hidden = true; @@ -1099,7 +1099,7 @@ query_replace_base(Application_Links *app, View_ID view, Buffer_ID buffer_id, i6 pos = match.max; } - buffer_seek_string_forward(app, buffer_id, pos, 0, r, &new_pos); + seek_string_forward(app, buffer_id, pos, 0, r, &new_pos); } view_disable_highlight_range(app, view); diff --git a/custom/4coder_base_types.h b/custom/4coder_base_types.h index 8aadc6d2..f5327119 100644 --- a/custom/4coder_base_types.h +++ b/custom/4coder_base_types.h @@ -166,6 +166,12 @@ typedef double f64; typedef void Void_Func(void); +typedef i32 Generated_Group; +enum{ + GeneratedGroup_Core, + GeneratedGroup_Custom +}; + #define glue_(a,b) a##b #define glue(a,b) glue_(a,b) diff --git a/custom/4coder_default_hooks.cpp b/custom/4coder_default_hooks.cpp index 0cc13efb..1d321267 100644 --- a/custom/4coder_default_hooks.cpp +++ b/custom/4coder_default_hooks.cpp @@ -475,7 +475,7 @@ default_buffer_render_caller(Application_Links *app, Frame_Info frame_info, View { if (is_active_view){ draw_character_block(app, text_layout_id, cursor_pos, Stag_Cursor); - paint_text_color(app, text_layout_id, cursor_pos, Stag_At_Cursor); + paint_text_color_pos(app, text_layout_id, cursor_pos, Stag_At_Cursor); draw_character_wire_frame(app, text_layout_id, mark_pos, Stag_Mark); } else{ diff --git a/custom/4coder_default_include.cpp b/custom/4coder_default_include.cpp index 5a0bd25a..78c2cc70 100644 --- a/custom/4coder_default_include.cpp +++ b/custom/4coder_default_include.cpp @@ -7,6 +7,7 @@ #if !defined(FCODER_DEFAULT_INCLUDE_CPP) #define FCODER_DEFAULT_INCLUDE_CPP +#include "4coder_base_types.h" #include "api/4coder_custom.h" #include "generated/command_metadata.h" @@ -37,6 +38,7 @@ #include "4coder_combined_write_commands.h" #include "4coder_log_parser.h" +#include "api/4coder_custom.cpp" #include "4coder_log.cpp" #include "4coder_hash_functions.cpp" #include "4coder_table.cpp" diff --git a/custom/4coder_fancy.cpp b/custom/4coder_fancy.cpp index afb8c483..b5fb3074 100644 --- a/custom/4coder_fancy.cpp +++ b/custom/4coder_fancy.cpp @@ -214,7 +214,7 @@ draw_fancy_string(Application_Links *app, Face_ID font_id, Fancy_String *string, Face_Metrics metrics = get_face_metrics(app, font_id); P += (string->pre_margin*metrics.typical_character_width)*dP; - draw_string(app, use_font_id, string->value, P, use_fore, flags, dP); + draw_string_oriented(app, use_font_id, string->value, P, use_fore, flags, dP); P += (adv + string->post_margin*metrics.typical_character_width)*dP; } return(P); @@ -240,7 +240,7 @@ get_fancy_string_advance(Application_Links *app, Face_ID font_id, Fancy_String * } static void -draw_rectangle(Application_Links *app, Rect_f32 rect, Fancy_Color fancy_color){ +draw_rectangle_fancy(Application_Links *app, Rect_f32 rect, Fancy_Color fancy_color){ int_color color = int_color_from(app, fancy_color); draw_rectangle(app, rect, color); } diff --git a/custom/4coder_helper.cpp b/custom/4coder_helper.cpp index bd5e8067..0be7f4a3 100644 --- a/custom/4coder_helper.cpp +++ b/custom/4coder_helper.cpp @@ -877,7 +877,7 @@ boundary_line(Application_Links *app, Buffer_ID buffer, Side side, Scan_Directio // TODO(allen): these need a little more rewrite internal void -buffer_seek_string_forward(Application_Links *app, Buffer_ID buffer, i64 pos, i64 end, String_Const_u8 needle, i64 *result){ +seek_string_forward(Application_Links *app, Buffer_ID buffer, i64 pos, i64 end, String_Const_u8 needle, i64 *result){ if (end == 0){ end = (i32)buffer_get_size(app, buffer); } @@ -897,7 +897,7 @@ buffer_seek_string_forward(Application_Links *app, Buffer_ID buffer, i64 pos, i6 } internal void -buffer_seek_string_backward(Application_Links *app, Buffer_ID buffer, i64 pos, i64 min, String_Const_u8 needle, i64 *result){ +seek_string_backward(Application_Links *app, Buffer_ID buffer, i64 pos, i64 min, String_Const_u8 needle, i64 *result){ String_Match match = {}; match.range.first = pos; for (;;){ @@ -914,7 +914,7 @@ buffer_seek_string_backward(Application_Links *app, Buffer_ID buffer, i64 pos, i } internal void -buffer_seek_string_insensitive_forward(Application_Links *app, Buffer_ID buffer, i64 pos, i64 end, String_Const_u8 needle, i64 *result){ +seek_string_insensitive_forward(Application_Links *app, Buffer_ID buffer, i64 pos, i64 end, String_Const_u8 needle, i64 *result){ if (end == 0){ end = (i32)buffer_get_size(app, buffer); } @@ -928,7 +928,7 @@ buffer_seek_string_insensitive_forward(Application_Links *app, Buffer_ID buffer, } internal void -buffer_seek_string_insensitive_backward(Application_Links *app, Buffer_ID buffer, i64 pos, i64 min, String_Const_u8 needle, i64 *result){ +seek_string_insensitive_backward(Application_Links *app, Buffer_ID buffer, i64 pos, i64 min, String_Const_u8 needle, i64 *result){ String_Match match = buffer_seek_string(app, buffer, needle, Scan_Backward, pos); if (match.range.first >= min && match.buffer == buffer){ *result = match.range.first; @@ -939,26 +939,26 @@ buffer_seek_string_insensitive_backward(Application_Links *app, Buffer_ID buffer } internal void -buffer_seek_string(Application_Links *app, Buffer_ID buffer_id, i64 pos, i64 end, i64 min, String_Const_u8 str, i64 *result, Buffer_Seek_String_Flags flags){ +seek_string(Application_Links *app, Buffer_ID buffer_id, i64 pos, i64 end, i64 min, String_Const_u8 str, i64 *result, Buffer_Seek_String_Flags flags){ switch (flags & 3){ case 0: { - buffer_seek_string_forward(app, buffer_id, pos, end, str, result); + seek_string_forward(app, buffer_id, pos, end, str, result); }break; case BufferSeekString_Backward: { - buffer_seek_string_backward(app, buffer_id, pos, min, str, result); + seek_string_backward(app, buffer_id, pos, min, str, result); }break; case BufferSeekString_CaseInsensitive: { - buffer_seek_string_insensitive_forward(app, buffer_id, pos, end, str, result); + seek_string_insensitive_forward(app, buffer_id, pos, end, str, result); }break; case BufferSeekString_Backward|BufferSeekString_CaseInsensitive: { - buffer_seek_string_insensitive_backward(app, buffer_id, pos, min, str, result); + seek_string_insensitive_backward(app, buffer_id, pos, min, str, result); }break; } } @@ -1399,14 +1399,14 @@ replace_in_range(Application_Links *app, Buffer_ID buffer, Range_i64 range, Stri History_Group group = history_group_begin(app, buffer); i64 pos = range.min - 1; i64 new_pos = 0; - buffer_seek_string_forward(app, buffer, pos, range.end, needle, &new_pos); + seek_string_forward(app, buffer, pos, range.end, needle, &new_pos); i64 shift = replace_range_shift(needle.size, string.size); for (; new_pos + (imem)needle.size <= range.end;){ Range_i64 needle_range = Ii64(new_pos, new_pos + (i32)needle.size); buffer_replace_range(app, buffer, needle_range, string); range.end += shift; pos = new_pos + (i32)string.size - 1; - buffer_seek_string_forward(app, buffer, pos, range.end, needle, &new_pos); + seek_string_forward(app, buffer, pos, range.end, needle, &new_pos); } history_group_end(group); } @@ -2211,7 +2211,7 @@ get_single_record(Application_Links *app, Buffer_ID buffer_id, History_Record_In internal Vec2 draw_string(Application_Links *app, Face_ID font_id, String_Const_u8 string, Vec2 p, int_color color){ - return(draw_string(app, font_id, string, p, color, 0, V2(1.f, 0.f))); + return(draw_string_oriented(app, font_id, string, p, color, 0, V2(1.f, 0.f))); } internal void @@ -2271,7 +2271,7 @@ draw_line_highlight(Application_Links *app, Text_Layout_ID layout, i64 line, int } internal void -paint_text_color(Application_Links *app, Text_Layout_ID layout, i64 pos, int_color color){ +paint_text_color_pos(Application_Links *app, Text_Layout_ID layout, i64 pos, int_color color){ paint_text_color(app, layout, Ii64(pos, pos + 1), color); } diff --git a/custom/4coder_log_parser.cpp b/custom/4coder_log_parser.cpp index 5b9fc7e9..61cd534e 100644 --- a/custom/4coder_log_parser.cpp +++ b/custom/4coder_log_parser.cpp @@ -706,8 +706,8 @@ log_graph_render(Application_Links *app, View_ID view, Frame_Info frame_info, Re margin_color = light_gray; } - draw_rectangle(app, box , margin_color); - draw_rectangle(app, box_inner, black ); + draw_rectangle_fancy(app, box , margin_color); + draw_rectangle_fancy(app, box_inner, black ); Log_Event *event = box_node->event; @@ -744,8 +744,8 @@ log_graph_render(Application_Links *app, View_ID view, Frame_Info frame_info, Re Log_Graph_List_Tab current_tab = log_graph.tab; Log_Filter_Set *viewing_filter_set = log_filter_set_from_tab(current_tab); - draw_rectangle(app, box , dark_gray); - draw_rectangle(app, box_inner, black ); + draw_rectangle_fancy(app, box , dark_gray); + draw_rectangle_fancy(app, box_inner, black ); { f32 y_cursor = box_inner.y0 + 3.f; diff --git a/custom/4coder_stringf.cpp b/custom/4coder_stringf.cpp index 13df9737..b2192f9e 100644 --- a/custom/4coder_stringf.cpp +++ b/custom/4coder_stringf.cpp @@ -4,6 +4,9 @@ // TOP +#if !defined(FCODER_STRINGF_CPP) +#define FCODER_STRINGF_CPP + #include #include @@ -68,5 +71,7 @@ string_list_pushf(Arena *arena, List_String_Const_u8 *list, char *format, ...){ va_end(args); } +#endif + // BOTTOM diff --git a/custom/api/4coder_custom.cpp b/custom/api/4coder_custom.cpp new file mode 100644 index 00000000..bebcd20b --- /dev/null +++ b/custom/api/4coder_custom.cpp @@ -0,0 +1,21 @@ +/* +4coder_custom.cpp +*/ + +// TOP + +#define DYNAMIC_LINK_API +#include "generated/custom_api.cpp" + +extern "C" b32 +get_version(i32 maj, i32 min, i32 patch){ + return(maj == MAJOR && min == MINOR && patch == PATCH); +} + +extern "C" void +init_apis(API_VTable_custom *custom_vtable){ + custom_api_read_vtable(custom_vtable); +} + +// BOTTOM + diff --git a/custom/api/4coder_custom.h b/custom/api/4coder_custom.h index 4da4cf51..225f0669 100644 --- a/custom/api/4coder_custom.h +++ b/custom/api/4coder_custom.h @@ -7,16 +7,12 @@ #ifndef FCODER_CUSTOM_H #define FCODER_CUSTOM_H -#include "4coder_base_types.h" #include "api/4coder_version.h" #include "api/4coder_keycodes.h" #include "api/4coder_default_colors.h" #include "api/4coder_types.h" -#include "generated/app_functions.h" - -extern "C" _GET_VERSION_SIG(get_alpha_4coder_version){ - return((maj == MAJOR && min == MINOR && patch == PATCH)); -} +#define DYNAMIC_LINK_API +#include "generated/custom_api.h" #endif diff --git a/custom/api/4coder_types.h b/custom/api/4coder_types.h index f698b221..8777830a 100644 --- a/custom/api/4coder_types.h +++ b/custom/api/4coder_types.h @@ -13,6 +13,16 @@ #endif +struct Application_Links{ + void *cmd_context; + void *current_coroutine; + i32 type_coroutine; +}; +typedef b32 _Get_Version_Function(i32 maj, i32 min, i32 patch); +typedef void _Init_APIs(struct API_VTable_custom *custom_vtable); + +//////////////////////////////// + TYPEDEF u32 argb_color; TYPEDEF u32 int_color; @@ -618,9 +628,6 @@ STRUCT Binding_Unit{ }; }; -typedef i32 _Get_Version_Function(i32 maj, i32 min, i32 patch); -#define _GET_VERSION_SIG(n) i32 n(i32 maj, i32 min, i32 patch) - STRUCT Color_Picker{ String_Const_u8 title; argb_color *dest; diff --git a/custom/bin/buildsuper_x64.bat b/custom/bin/buildsuper_x64.bat index 554b9958..4b0d4011 100644 --- a/custom/bin/buildsuper_x64.bat +++ b/custom/bin/buildsuper_x64.bat @@ -40,7 +40,7 @@ set preproc_file=4coder_command_metadata.i set meta_opts=/P /Fi%preproc_file% /DMETA_PASS set build_dll=/LD /link /INCREMENTAL:NO /OPT:REF /RELEASE /PDBALTPATH:%%%%_PDB%%%% -set build_dll=%build_dll% /EXPORT:get_bindings /EXPORT:get_alpha_4coder_version +set build_dll=%build_dll% /EXPORT:get_bindings /EXPORT:get_version /EXPORT:init_apis call cl %opts% %meta_opts% %target% call cl %opts% "%custom_root%\4coder_metadata_generator.cpp" /Femetadata_generator diff --git a/custom/bin/buildsuper_x86.bat b/custom/bin/buildsuper_x86.bat index 7e17504a..e591d146 100644 --- a/custom/bin/buildsuper_x86.bat +++ b/custom/bin/buildsuper_x86.bat @@ -17,7 +17,7 @@ set opts=%opts% /GR- /nologo /FC set debug=/Zi set release=/O2 /Zi set build_dll=/LD /link /INCREMENTAL:NO /OPT:REF -set exports=/EXPORT:get_bindings /EXPORT:get_alpha_4coder_version +set build_dll=%build_dll% /EXPORT:get_bindings /EXPORT:get_version /EXPORT:init_apis set mode=%debug% if "%2" == "release" (set mode=%release%) diff --git a/custom/generated/app_functions.h b/custom/generated/app_functions.h deleted file mode 100644 index c6137b5e..00000000 --- a/custom/generated/app_functions.h +++ /dev/null @@ -1,914 +0,0 @@ -struct Application_Links; -#define GLOBAL_SET_SETTING_SIG(n) b32 n(Application_Links *app, Global_Setting_ID setting, i32 value) -#define GLOBAL_SET_MAPPING_SIG(n) b32 n(Application_Links *app, void *data, i32 size) -#define GLOBAL_GET_SCREEN_RECTANGLE_SIG(n) Rect_f32 n(Application_Links *app) -#define GET_THREAD_CONTEXT_SIG(n) Thread_Context* n(Application_Links *app) -#define CREATE_CHILD_PROCESS_SIG(n) b32 n(Application_Links *app, String_Const_u8 path, String_Const_u8 command, Child_Process_ID *child_process_id_out) -#define CHILD_PROCESS_SET_TARGET_BUFFER_SIG(n) b32 n(Application_Links *app, Child_Process_ID child_process_id, Buffer_ID buffer_id, Child_Process_Set_Target_Flags flags) -#define BUFFER_GET_ATTACHED_CHILD_PROCESS_SIG(n) Child_Process_ID n(Application_Links *app, Buffer_ID buffer_id) -#define CHILD_PROCESS_GET_ATTACHED_BUFFER_SIG(n) Buffer_ID n(Application_Links *app, Child_Process_ID child_process_id) -#define CHILD_PROCESS_GET_STATE_SIG(n) Process_State n(Application_Links *app, Child_Process_ID child_process_id) -#define CLIPBOARD_POST_SIG(n) b32 n(Application_Links *app, i32 clipboard_id, String_Const_u8 string) -#define CLIPBOARD_COUNT_SIG(n) i32 n(Application_Links *app, i32 clipboard_id) -#define PUSH_CLIPBOARD_INDEX_SIG(n) String_Const_u8 n(Application_Links *app, Arena *arena, i32 clipboard_id, i32 item_index) -#define GET_BUFFER_COUNT_SIG(n) i32 n(Application_Links *app) -#define GET_BUFFER_NEXT_SIG(n) Buffer_ID n(Application_Links *app, Buffer_ID buffer_id, Access_Flag access) -#define GET_BUFFER_BY_NAME_SIG(n) Buffer_ID n(Application_Links *app, String_Const_u8 name, Access_Flag access) -#define GET_BUFFER_BY_FILE_NAME_SIG(n) Buffer_ID n(Application_Links *app, String_Const_u8 file_name, Access_Flag access) -#define BUFFER_READ_RANGE_SIG(n) b32 n(Application_Links *app, Buffer_ID buffer_id, Range_i64 range, char *out) -#define BUFFER_REPLACE_RANGE_SIG(n) b32 n(Application_Links *app, Buffer_ID buffer_id, Range_i64 range, String_Const_u8 string) -#define BUFFER_BATCH_EDIT_SIG(n) b32 n(Application_Links *app, Buffer_ID buffer_id, Batch_Edit *batch) -#define BUFFER_SEEK_STRING_SIG(n) String_Match n(Application_Links *app, Buffer_ID buffer, String_Const_u8 needle, Scan_Direction direction, i64 start_pos) -#define BUFFER_SEEK_CHARACTER_CLASS_SIG(n) String_Match n(Application_Links *app, Buffer_ID buffer, Character_Predicate *predicate, Scan_Direction direction, i64 start_pos) -#define BUFFER_LINE_Y_DIFFERENCE_SIG(n) f32 n(Application_Links *app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 line_a, i64 line_b) -#define BUFFER_LINE_SHIFT_Y_SIG(n) Line_Shift_Vertical n(Application_Links *app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 line, f32 y_shift) -#define BUFFER_POS_AT_RELATIVE_XY_SIG(n) i64 n(Application_Links *app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, Vec2_f32 relative_xy) -#define BUFFER_RELATIVE_XY_OF_POS_SIG(n) Vec2_f32 n(Application_Links *app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 pos) -#define BUFFER_RELATIVE_CHARACTER_FROM_POS_SIG(n) i64 n(Application_Links *app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 pos) -#define BUFFER_POS_FROM_RELATIVE_CHARACTER_SIG(n) i64 n(Application_Links *app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 relative_character) -#define VIEW_LINE_Y_DIFFERENCE_SIG(n) f32 n(Application_Links *app, View_ID view_id, i64 line_a, i64 line_b) -#define VIEW_LINE_SHIFT_Y_SIG(n) Line_Shift_Vertical n(Application_Links *app, View_ID view_id, i64 line, f32 y_shift) -#define VIEW_POS_AT_RELATIVE_XY_SIG(n) i64 n(Application_Links *app, View_ID view_id, i64 base_line, Vec2_f32 relative_xy) -#define VIEW_RELATIVE_XY_OF_POS_SIG(n) Vec2_f32 n(Application_Links *app, View_ID view_id, i64 base_line, i64 pos) -#define VIEW_RELATIVE_CHARACTER_FROM_POS_SIG(n) i64 n(Application_Links *app, View_ID view_id, i64 base_line, i64 pos) -#define VIEW_POS_FROM_RELATIVE_CHARACTER_SIG(n) i64 n(Application_Links *app, View_ID view_id, i64 base_line, i64 character) -#define BUFFER_EXISTS_SIG(n) b32 n(Application_Links *app, Buffer_ID buffer_id) -#define BUFFER_READY_SIG(n) b32 n(Application_Links *app, Buffer_ID buffer_id) -#define BUFFER_GET_ACCESS_FLAGS_SIG(n) Access_Flag n(Application_Links *app, Buffer_ID buffer_id) -#define BUFFER_GET_SIZE_SIG(n) i64 n(Application_Links *app, Buffer_ID buffer_id) -#define BUFFER_GET_LINE_COUNT_SIG(n) i64 n(Application_Links *app, Buffer_ID buffer_id) -#define PUSH_BUFFER_BASE_NAME_SIG(n) String_Const_u8 n(Application_Links *app, Arena *arena, Buffer_ID buffer_id) -#define PUSH_BUFFER_UNIQUE_NAME_SIG(n) String_Const_u8 n(Application_Links *app, Arena *out, Buffer_ID buffer_id) -#define PUSH_BUFFER_FILE_NAME_SIG(n) String_Const_u8 n(Application_Links *app, Arena *arena, Buffer_ID buffer_id) -#define BUFFER_GET_DIRTY_STATE_SIG(n) Dirty_State n(Application_Links *app, Buffer_ID buffer_id) -#define BUFFER_SET_DIRTY_STATE_SIG(n) b32 n(Application_Links *app, Buffer_ID buffer_id, Dirty_State dirty_state) -#define BUFFER_GET_SETTING_SIG(n) b32 n(Application_Links *app, Buffer_ID buffer_id, Buffer_Setting_ID setting, i32 *value_out) -#define BUFFER_SET_SETTING_SIG(n) b32 n(Application_Links *app, Buffer_ID buffer_id, Buffer_Setting_ID setting, i32 value) -#define BUFFER_GET_MANAGED_SCOPE_SIG(n) Managed_Scope n(Application_Links *app, Buffer_ID buffer_id) -#define BUFFER_SEND_END_SIGNAL_SIG(n) b32 n(Application_Links *app, Buffer_ID buffer_id) -#define CREATE_BUFFER_SIG(n) Buffer_ID n(Application_Links *app, String_Const_u8 file_name, Buffer_Create_Flag flags) -#define BUFFER_SAVE_SIG(n) b32 n(Application_Links *app, Buffer_ID buffer_id, String_Const_u8 file_name, Buffer_Save_Flag flags) -#define BUFFER_KILL_SIG(n) Buffer_Kill_Result n(Application_Links *app, Buffer_ID buffer_id, Buffer_Kill_Flag flags) -#define BUFFER_REOPEN_SIG(n) Buffer_Reopen_Result n(Application_Links *app, Buffer_ID buffer_id, Buffer_Reopen_Flag flags) -#define BUFFER_GET_FILE_ATTRIBUTES_SIG(n) File_Attributes n(Application_Links *app, Buffer_ID buffer_id) -#define GET_FILE_ATTRIBUTES_SIG(n) File_Attributes n(Application_Links *app, String_Const_u8 file_name) -#define GET_VIEW_NEXT_SIG(n) View_ID n(Application_Links *app, View_ID view_id, Access_Flag access) -#define GET_VIEW_PREV_SIG(n) View_ID n(Application_Links *app, View_ID view_id, Access_Flag access) -#define GET_ACTIVE_VIEW_SIG(n) View_ID n(Application_Links *app, Access_Flag access) -#define GET_ACTIVE_PANEL_SIG(n) Panel_ID n(Application_Links *app) -#define VIEW_EXISTS_SIG(n) b32 n(Application_Links *app, View_ID view_id) -#define VIEW_GET_BUFFER_SIG(n) Buffer_ID n(Application_Links *app, View_ID view_id, Access_Flag access) -#define VIEW_GET_CURSOR_POS_SIG(n) i64 n(Application_Links *app, View_ID view_id) -#define VIEW_GET_MARK_POS_SIG(n) i64 n(Application_Links *app, View_ID view_id) -#define VIEW_GET_PREFERRED_X_SIG(n) f32 n(Application_Links *app, View_ID view_id) -#define VIEW_SET_PREFERRED_X_SIG(n) b32 n(Application_Links *app, View_ID view_id, f32 x) -#define VIEW_GET_SCREEN_RECT_SIG(n) Rect_f32 n(Application_Links *app, View_ID view_id) -#define VIEW_GET_PANEL_SIG(n) Panel_ID n(Application_Links *app, View_ID view_id) -#define PANEL_GET_VIEW_SIG(n) View_ID n(Application_Links *app, Panel_ID panel_id) -#define PANEL_IS_SPLIT_SIG(n) b32 n(Application_Links *app, Panel_ID panel_id) -#define PANEL_IS_LEAF_SIG(n) b32 n(Application_Links *app, Panel_ID panel_id) -#define PANEL_SPLIT_SIG(n) b32 n(Application_Links *app, Panel_ID panel_id, Panel_Split_Orientation orientation) -#define PANEL_SET_SPLIT_SIG(n) b32 n(Application_Links *app, Panel_ID panel_id, Panel_Split_Kind kind, float t) -#define PANEL_SWAP_CHILDREN_SIG(n) b32 n(Application_Links *app, Panel_ID panel_id, Panel_Split_Kind kind, float t) -#define PANEL_GET_PARENT_SIG(n) Panel_ID n(Application_Links *app, Panel_ID panel_id) -#define PANEL_GET_CHILD_SIG(n) Panel_ID n(Application_Links *app, Panel_ID panel_id, Panel_Child which_child) -#define PANEL_GET_MAX_SIG(n) Panel_ID n(Application_Links *app, Panel_ID panel_id) -#define PANEL_GET_MARGIN_SIG(n) Rect_i32 n(Application_Links *app, Panel_ID panel_id) -#define VIEW_CLOSE_SIG(n) b32 n(Application_Links *app, View_ID view_id) -#define VIEW_GET_BUFFER_REGION_SIG(n) Rect_f32 n(Application_Links *app, View_ID view_id) -#define VIEW_GET_BUFFER_SCROLL_SIG(n) Buffer_Scroll n(Application_Links *app, View_ID view_id) -#define VIEW_GET_BASIC_SCROLL_SIG(n) Basic_Scroll n(Application_Links *app, View_ID view_id) -#define VIEW_SET_ACTIVE_SIG(n) b32 n(Application_Links *app, View_ID view_id) -#define VIEW_GET_SETTING_SIG(n) b32 n(Application_Links *app, View_ID view_id, View_Setting_ID setting, i32 *value_out) -#define VIEW_SET_SETTING_SIG(n) b32 n(Application_Links *app, View_ID view_id, View_Setting_ID setting, i32 value) -#define VIEW_GET_MANAGED_SCOPE_SIG(n) Managed_Scope n(Application_Links *app, View_ID view_id) -#define BUFFER_COMPUTE_CURSOR_SIG(n) Buffer_Cursor n(Application_Links *app, Buffer_ID buffer, Buffer_Seek seek) -#define VIEW_COMPUTE_CURSOR_SIG(n) Buffer_Cursor n(Application_Links *app, View_ID view_id, Buffer_Seek seek) -#define VIEW_SET_CURSOR_SIG(n) b32 n(Application_Links *app, View_ID view_id, Buffer_Seek seek) -#define VIEW_SET_BUFFER_SCROLL_SIG(n) b32 n(Application_Links *app, View_ID view_id, Buffer_Scroll scroll) -#define VIEW_SET_BASIC_SCROLL_SIG(n) b32 n(Application_Links *app, View_ID view_id, Basic_Scroll scroll) -#define VIEW_SET_MARK_SIG(n) b32 n(Application_Links *app, View_ID view_id, Buffer_Seek seek) -#define VIEW_SET_BUFFER_SIG(n) b32 n(Application_Links *app, View_ID view_id, Buffer_ID buffer_id, Set_Buffer_Flag flags) -#define VIEW_POST_FADE_SIG(n) b32 n(Application_Links *app, View_ID view_id, f32 seconds, Range_i64 range, int_color color) -#define VIEW_BEGIN_UI_MODE_SIG(n) b32 n(Application_Links *app, View_ID view_id) -#define VIEW_END_UI_MODE_SIG(n) b32 n(Application_Links *app, View_ID view_id) -#define VIEW_IS_IN_UI_MODE_SIG(n) b32 n(Application_Links *app, View_ID view_id) -#define VIEW_SET_QUIT_UI_HANDLER_SIG(n) b32 n(Application_Links *app, View_ID view_id, UI_Quit_Function_Type *quit_function) -#define VIEW_GET_QUIT_UI_HANDLER_SIG(n) b32 n(Application_Links *app, View_ID view_id, UI_Quit_Function_Type **quit_function_out) -#define CREATE_USER_MANAGED_SCOPE_SIG(n) Managed_Scope n(Application_Links *app) -#define DESTROY_USER_MANAGED_SCOPE_SIG(n) b32 n(Application_Links *app, Managed_Scope scope) -#define GET_GLOBAL_MANAGED_SCOPE_SIG(n) Managed_Scope n(Application_Links *app) -#define GET_MANAGED_SCOPE_WITH_MULTIPLE_DEPENDENCIES_SIG(n) Managed_Scope n(Application_Links *app, Managed_Scope *scopes, i32 count) -#define MANAGED_SCOPE_CLEAR_CONTENTS_SIG(n) b32 n(Application_Links *app, Managed_Scope scope) -#define MANAGED_SCOPE_CLEAR_SELF_ALL_DEPENDENT_SCOPES_SIG(n) b32 n(Application_Links *app, Managed_Scope scope) -#define MANAGED_SCOPE_ALLOCATOR_SIG(n) Base_Allocator* n(Application_Links *app, Managed_Scope scope) -#define MANAGED_ID_DECLARE_SIG(n) Managed_ID n(Application_Links *app, String_Const_u8 name) -#define MANAGED_SCOPE_GET_ATTACHMENT_SIG(n) void* n(Application_Links *app, Managed_Scope scope, Managed_ID id, umem size) -#define MANAGED_SCOPE_ATTACHMENT_ERASE_SIG(n) void* n(Application_Links *app, Managed_Scope scope, Managed_ID id) -#define ALLOC_MANAGED_MEMORY_IN_SCOPE_SIG(n) Managed_Object n(Application_Links *app, Managed_Scope scope, i32 item_size, i32 count) -#define ALLOC_BUFFER_MARKERS_ON_BUFFER_SIG(n) Managed_Object n(Application_Links *app, Buffer_ID buffer_id, i32 count, Managed_Scope *optional_extra_scope) -#define MANAGED_OBJECT_GET_ITEM_SIZE_SIG(n) u32 n(Application_Links *app, Managed_Object object) -#define MANAGED_OBJECT_GET_ITEM_COUNT_SIG(n) u32 n(Application_Links *app, Managed_Object object) -#define MANAGED_OBJECT_GET_POINTER_SIG(n) void* n(Application_Links *app, Managed_Object object) -#define MANAGED_OBJECT_GET_TYPE_SIG(n) Managed_Object_Type n(Application_Links *app, Managed_Object object) -#define MANAGED_OBJECT_GET_CONTAINING_SCOPE_SIG(n) Managed_Scope n(Application_Links *app, Managed_Object object) -#define MANAGED_OBJECT_FREE_SIG(n) b32 n(Application_Links *app, Managed_Object object) -#define MANAGED_OBJECT_STORE_DATA_SIG(n) b32 n(Application_Links *app, Managed_Object object, u32 first_index, u32 count, void *mem) -#define MANAGED_OBJECT_LOAD_DATA_SIG(n) b32 n(Application_Links *app, Managed_Object object, u32 first_index, u32 count, void *mem_out) -#define GET_USER_INPUT_SIG(n) User_Input n(Application_Links *app, Input_Type_Flag get_type, Input_Type_Flag abort_type) -#define GET_COMMAND_INPUT_SIG(n) User_Input n(Application_Links *app) -#define SET_COMMAND_INPUT_SIG(n) void n(Application_Links *app, Key_Event_Data key_data) -#define GET_MOUSE_STATE_SIG(n) Mouse_State n(Application_Links *app) -#define GET_ACTIVE_QUERY_BARS_SIG(n) b32 n(Application_Links *app, View_ID view_id, i32 max_result_count, Query_Bar_Ptr_Array *array_out) -#define START_QUERY_BAR_SIG(n) b32 n(Application_Links *app, Query_Bar *bar, u32 flags) -#define END_QUERY_BAR_SIG(n) void n(Application_Links *app, Query_Bar *bar, u32 flags) -#define PRINT_MESSAGE_SIG(n) b32 n(Application_Links *app, String_Const_u8 message) -#define LOG_STRING_SIG(n) b32 n(Application_Links *app, String_Const_u8 str) -#define THREAD_GET_ID_SIG(n) i32 n(Application_Links *app) -#define GET_LARGEST_FACE_ID_SIG(n) Face_ID n(Application_Links *app) -#define SET_GLOBAL_FACE_SIG(n) b32 n(Application_Links *app, Face_ID id, b32 apply_to_all_buffers) -#define BUFFER_HISTORY_GET_MAX_RECORD_INDEX_SIG(n) History_Record_Index n(Application_Links *app, Buffer_ID buffer_id) -#define BUFFER_HISTORY_GET_RECORD_INFO_SIG(n) Record_Info n(Application_Links *app, Buffer_ID buffer_id, History_Record_Index index) -#define BUFFER_HISTORY_GET_GROUP_SUB_RECORD_SIG(n) Record_Info n(Application_Links *app, Buffer_ID buffer_id, History_Record_Index index, i32 sub_index) -#define BUFFER_HISTORY_GET_CURRENT_STATE_INDEX_SIG(n) History_Record_Index n(Application_Links *app, Buffer_ID buffer_id) -#define BUFFER_HISTORY_SET_CURRENT_STATE_INDEX_SIG(n) b32 n(Application_Links *app, Buffer_ID buffer_id, History_Record_Index index) -#define BUFFER_HISTORY_MERGE_RECORD_RANGE_SIG(n) b32 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) b32 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) b32 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 face_id) -#define GET_FACE_METRICS_SIG(n) Face_Metrics n(Application_Links *app, Face_ID face_id) -#define GET_FACE_ID_SIG(n) Face_ID n(Application_Links *app, Buffer_ID buffer_id) -#define TRY_CREATE_NEW_FACE_SIG(n) Face_ID n(Application_Links *app, Face_Description *description) -#define TRY_MODIFY_FACE_SIG(n) b32 n(Application_Links *app, Face_ID id, Face_Description *description) -#define TRY_RELEASE_FACE_SIG(n) b32 n(Application_Links *app, Face_ID id, Face_ID replacement_id) -#define SET_THEME_COLORS_SIG(n) void n(Application_Links *app, Theme_Color *colors, i32 count) -#define GET_THEME_COLORS_SIG(n) void n(Application_Links *app, Theme_Color *colors, i32 count) -#define FINALIZE_COLOR_SIG(n) argb_color n(Application_Links *app, int_color color) -#define PUSH_HOT_DIRECTORY_SIG(n) String_Const_u8 n(Application_Links *app, Arena *arena) -#define SET_HOT_DIRECTORY_SIG(n) b32 n(Application_Links *app, String_Const_u8 string) -#define GET_FILE_LIST_SIG(n) File_List n(Application_Links *app, Arena *arena, String_Const_u8 directory) -#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, i32 size) -#define MEMORY_SET_PROTECTION_SIG(n) b32 n(Application_Links *app, void *ptr, i32 size, Memory_Protect_Flags flags) -#define MEMORY_FREE_SIG(n) void n(Application_Links *app, void *ptr, i32 size) -#define PUSH_4ED_PATH_SIG(n) String_Const_u8 n(Application_Links *app, Arena *arena) -#define SHOW_MOUSE_CURSOR_SIG(n) void n(Application_Links *app, Mouse_Cursor_Show_Type show) -#define SET_EDIT_FINISHED_HOOK_REPEAT_SPEED_SIG(n) b32 n(Application_Links *app, u32 milliseconds) -#define SET_FULLSCREEN_SIG(n) b32 n(Application_Links *app, b32 full_screen) -#define IS_FULLSCREEN_SIG(n) b32 n(Application_Links *app) -#define SEND_EXIT_SIGNAL_SIG(n) void n(Application_Links *app) -#define SET_WINDOW_TITLE_SIG(n) b32 n(Application_Links *app, String_Const_u8 title) -#define GET_MICROSECONDS_TIMESTAMP_SIG(n) Microsecond_Time_Stamp n(Application_Links *app) -#define DRAW_STRING_SIG(n) Vec2 n(Application_Links *app, Face_ID font_id, String_Const_u8 str, Vec2 point, int_color color, u32 flags, Vec2 delta) -#define GET_STRING_ADVANCE_SIG(n) f32 n(Application_Links *app, Face_ID font_id, String_Const_u8 str) -#define DRAW_RECTANGLE_SIG(n) void n(Application_Links *app, Rect_f32 rect, int_color color) -#define DRAW_RECTANGLE_OUTLINE_SIG(n) void n(Application_Links *app, Rect_f32 rect, int_color color) -#define DRAW_CLIP_PUSH_SIG(n) void n(Application_Links *app, Rect_f32 clip_box) -#define DRAW_CLIP_POP_SIG(n) f32_Rect n(Application_Links *app) -#define DRAW_COORDINATE_CENTER_PUSH_SIG(n) void n(Application_Links *app, Vec2 point) -#define DRAW_COORDINATE_CENTER_POP_SIG(n) Vec2 n(Application_Links *app) -#define TEXT_LAYOUT_CREATE_SIG(n) Text_Layout_ID n(Application_Links *app, Buffer_ID buffer_id, Rect_f32 rect, Buffer_Point buffer_point) -#define TEXT_LAYOUT_GET_BUFFER_SIG(n) b32 n(Application_Links *app, Text_Layout_ID text_layout_id, Buffer_ID *buffer_id_out) -#define TEXT_LAYOUT_GET_VISIBLE_RANGE_SIG(n) Interval_i64 n(Application_Links *app, Text_Layout_ID text_layout_id) -#define TEXT_LAYOUT_LINE_ON_SCREEN_SIG(n) Rect_f32 n(Application_Links *app, Text_Layout_ID layout_id, i64 line_number) -#define TEXT_LAYOUT_CHARACTER_ON_SCREEN_SIG(n) Rect_f32 n(Application_Links *app, Text_Layout_ID layout_id, i64 pos) -#define PAINT_TEXT_COLOR_SIG(n) void n(Application_Links *app, Text_Layout_ID layout_id, Interval_i64 range, int_color color) -#define TEXT_LAYOUT_FREE_SIG(n) b32 n(Application_Links *app, Text_Layout_ID text_layout_id) -#define DRAW_TEXT_LAYOUT_SIG(n) void n(Application_Links *app, Text_Layout_ID layout_id) -#define OPEN_COLOR_PICKER_SIG(n) void n(Application_Links *app, Color_Picker *picker) -#define ANIMATE_IN_N_MILLISECONDS_SIG(n) void n(Application_Links *app, u32 n) -#define BUFFER_FIND_ALL_MATCHES_SIG(n) String_Match_List n(Application_Links *app, Arena *arena, Buffer_ID buffer, i32 string_id, Range_i64 range, String_Const_u8 needle, Character_Predicate *predicate, Scan_Direction direction) -typedef GLOBAL_SET_SETTING_SIG(Global_Set_Setting_Function); -typedef GLOBAL_SET_MAPPING_SIG(Global_Set_Mapping_Function); -typedef GLOBAL_GET_SCREEN_RECTANGLE_SIG(Global_Get_Screen_Rectangle_Function); -typedef GET_THREAD_CONTEXT_SIG(Get_Thread_Context_Function); -typedef CREATE_CHILD_PROCESS_SIG(Create_Child_Process_Function); -typedef CHILD_PROCESS_SET_TARGET_BUFFER_SIG(Child_Process_Set_Target_Buffer_Function); -typedef BUFFER_GET_ATTACHED_CHILD_PROCESS_SIG(Buffer_Get_Attached_Child_Process_Function); -typedef CHILD_PROCESS_GET_ATTACHED_BUFFER_SIG(Child_Process_Get_Attached_Buffer_Function); -typedef CHILD_PROCESS_GET_STATE_SIG(Child_Process_Get_State_Function); -typedef CLIPBOARD_POST_SIG(Clipboard_Post_Function); -typedef CLIPBOARD_COUNT_SIG(Clipboard_Count_Function); -typedef PUSH_CLIPBOARD_INDEX_SIG(Push_Clipboard_Index_Function); -typedef GET_BUFFER_COUNT_SIG(Get_Buffer_Count_Function); -typedef GET_BUFFER_NEXT_SIG(Get_Buffer_Next_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); -typedef BUFFER_REPLACE_RANGE_SIG(Buffer_Replace_Range_Function); -typedef BUFFER_BATCH_EDIT_SIG(Buffer_Batch_Edit_Function); -typedef BUFFER_SEEK_STRING_SIG(Buffer_Seek_String_Function); -typedef BUFFER_SEEK_CHARACTER_CLASS_SIG(Buffer_Seek_Character_Class_Function); -typedef BUFFER_LINE_Y_DIFFERENCE_SIG(Buffer_Line_Y_Difference_Function); -typedef BUFFER_LINE_SHIFT_Y_SIG(Buffer_Line_Shift_Y_Function); -typedef BUFFER_POS_AT_RELATIVE_XY_SIG(Buffer_Pos_At_Relative_XY_Function); -typedef BUFFER_RELATIVE_XY_OF_POS_SIG(Buffer_Relative_XY_Of_Pos_Function); -typedef BUFFER_RELATIVE_CHARACTER_FROM_POS_SIG(Buffer_Relative_Character_From_Pos_Function); -typedef BUFFER_POS_FROM_RELATIVE_CHARACTER_SIG(Buffer_Pos_From_Relative_Character_Function); -typedef VIEW_LINE_Y_DIFFERENCE_SIG(View_Line_Y_Difference_Function); -typedef VIEW_LINE_SHIFT_Y_SIG(View_Line_Shift_Y_Function); -typedef VIEW_POS_AT_RELATIVE_XY_SIG(View_Pos_At_Relative_XY_Function); -typedef VIEW_RELATIVE_XY_OF_POS_SIG(View_Relative_XY_Of_Pos_Function); -typedef VIEW_RELATIVE_CHARACTER_FROM_POS_SIG(View_Relative_Character_From_Pos_Function); -typedef VIEW_POS_FROM_RELATIVE_CHARACTER_SIG(View_Pos_From_Relative_Character_Function); -typedef BUFFER_EXISTS_SIG(Buffer_Exists_Function); -typedef BUFFER_READY_SIG(Buffer_Ready_Function); -typedef BUFFER_GET_ACCESS_FLAGS_SIG(Buffer_Get_Access_Flags_Function); -typedef BUFFER_GET_SIZE_SIG(Buffer_Get_Size_Function); -typedef BUFFER_GET_LINE_COUNT_SIG(Buffer_Get_Line_Count_Function); -typedef PUSH_BUFFER_BASE_NAME_SIG(Push_Buffer_Base_Name_Function); -typedef PUSH_BUFFER_UNIQUE_NAME_SIG(Push_Buffer_Unique_Name_Function); -typedef PUSH_BUFFER_FILE_NAME_SIG(Push_Buffer_File_Name_Function); -typedef BUFFER_GET_DIRTY_STATE_SIG(Buffer_Get_Dirty_State_Function); -typedef BUFFER_SET_DIRTY_STATE_SIG(Buffer_Set_Dirty_State_Function); -typedef BUFFER_GET_SETTING_SIG(Buffer_Get_Setting_Function); -typedef BUFFER_SET_SETTING_SIG(Buffer_Set_Setting_Function); -typedef BUFFER_GET_MANAGED_SCOPE_SIG(Buffer_Get_Managed_Scope_Function); -typedef BUFFER_SEND_END_SIGNAL_SIG(Buffer_Send_End_Signal_Function); -typedef CREATE_BUFFER_SIG(Create_Buffer_Function); -typedef BUFFER_SAVE_SIG(Buffer_Save_Function); -typedef BUFFER_KILL_SIG(Buffer_Kill_Function); -typedef BUFFER_REOPEN_SIG(Buffer_Reopen_Function); -typedef BUFFER_GET_FILE_ATTRIBUTES_SIG(Buffer_Get_File_Attributes_Function); -typedef GET_FILE_ATTRIBUTES_SIG(Get_File_Attributes_Function); -typedef GET_VIEW_NEXT_SIG(Get_View_Next_Function); -typedef GET_VIEW_PREV_SIG(Get_View_Prev_Function); -typedef GET_ACTIVE_VIEW_SIG(Get_Active_View_Function); -typedef GET_ACTIVE_PANEL_SIG(Get_Active_Panel_Function); -typedef VIEW_EXISTS_SIG(View_Exists_Function); -typedef VIEW_GET_BUFFER_SIG(View_Get_Buffer_Function); -typedef VIEW_GET_CURSOR_POS_SIG(View_Get_Cursor_Pos_Function); -typedef VIEW_GET_MARK_POS_SIG(View_Get_Mark_Pos_Function); -typedef VIEW_GET_PREFERRED_X_SIG(View_Get_Preferred_X_Function); -typedef VIEW_SET_PREFERRED_X_SIG(View_Set_Preferred_X_Function); -typedef VIEW_GET_SCREEN_RECT_SIG(View_Get_Screen_Rect_Function); -typedef VIEW_GET_PANEL_SIG(View_Get_Panel_Function); -typedef PANEL_GET_VIEW_SIG(Panel_Get_View_Function); -typedef PANEL_IS_SPLIT_SIG(Panel_Is_Split_Function); -typedef PANEL_IS_LEAF_SIG(Panel_Is_Leaf_Function); -typedef PANEL_SPLIT_SIG(Panel_Split_Function); -typedef PANEL_SET_SPLIT_SIG(Panel_Set_Split_Function); -typedef PANEL_SWAP_CHILDREN_SIG(Panel_Swap_Children_Function); -typedef PANEL_GET_PARENT_SIG(Panel_Get_Parent_Function); -typedef PANEL_GET_CHILD_SIG(Panel_Get_Child_Function); -typedef PANEL_GET_MAX_SIG(Panel_Get_Max_Function); -typedef PANEL_GET_MARGIN_SIG(Panel_Get_Margin_Function); -typedef VIEW_CLOSE_SIG(View_Close_Function); -typedef VIEW_GET_BUFFER_REGION_SIG(View_Get_Buffer_Region_Function); -typedef VIEW_GET_BUFFER_SCROLL_SIG(View_Get_Buffer_Scroll_Function); -typedef VIEW_GET_BASIC_SCROLL_SIG(View_Get_Basic_Scroll_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); -typedef BUFFER_COMPUTE_CURSOR_SIG(Buffer_Compute_Cursor_Function); -typedef VIEW_COMPUTE_CURSOR_SIG(View_Compute_Cursor_Function); -typedef VIEW_SET_CURSOR_SIG(View_Set_Cursor_Function); -typedef VIEW_SET_BUFFER_SCROLL_SIG(View_Set_Buffer_Scroll_Function); -typedef VIEW_SET_BASIC_SCROLL_SIG(View_Set_Basic_Scroll_Function); -typedef VIEW_SET_MARK_SIG(View_Set_Mark_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); -typedef VIEW_END_UI_MODE_SIG(View_End_UI_Mode_Function); -typedef VIEW_IS_IN_UI_MODE_SIG(View_Is_In_UI_Mode_Function); -typedef VIEW_SET_QUIT_UI_HANDLER_SIG(View_Set_Quit_UI_Handler_Function); -typedef VIEW_GET_QUIT_UI_HANDLER_SIG(View_Get_Quit_UI_Handler_Function); -typedef CREATE_USER_MANAGED_SCOPE_SIG(Create_User_Managed_Scope_Function); -typedef DESTROY_USER_MANAGED_SCOPE_SIG(Destroy_User_Managed_Scope_Function); -typedef GET_GLOBAL_MANAGED_SCOPE_SIG(Get_Global_Managed_Scope_Function); -typedef GET_MANAGED_SCOPE_WITH_MULTIPLE_DEPENDENCIES_SIG(Get_Managed_Scope_With_Multiple_Dependencies_Function); -typedef MANAGED_SCOPE_CLEAR_CONTENTS_SIG(Managed_Scope_Clear_Contents_Function); -typedef MANAGED_SCOPE_CLEAR_SELF_ALL_DEPENDENT_SCOPES_SIG(Managed_Scope_Clear_Self_All_Dependent_Scopes_Function); -typedef MANAGED_SCOPE_ALLOCATOR_SIG(Managed_Scope_Allocator_Function); -typedef MANAGED_ID_DECLARE_SIG(Managed_Id_Declare_Function); -typedef MANAGED_SCOPE_GET_ATTACHMENT_SIG(Managed_Scope_Get_Attachment_Function); -typedef MANAGED_SCOPE_ATTACHMENT_ERASE_SIG(Managed_Scope_Attachment_Erase_Function); -typedef ALLOC_MANAGED_MEMORY_IN_SCOPE_SIG(Alloc_Managed_Memory_In_Scope_Function); -typedef ALLOC_BUFFER_MARKERS_ON_BUFFER_SIG(Alloc_Buffer_Markers_On_Buffer_Function); -typedef MANAGED_OBJECT_GET_ITEM_SIZE_SIG(Managed_Object_Get_Item_Size_Function); -typedef MANAGED_OBJECT_GET_ITEM_COUNT_SIG(Managed_Object_Get_Item_Count_Function); -typedef MANAGED_OBJECT_GET_POINTER_SIG(Managed_Object_Get_Pointer_Function); -typedef MANAGED_OBJECT_GET_TYPE_SIG(Managed_Object_Get_Type_Function); -typedef MANAGED_OBJECT_GET_CONTAINING_SCOPE_SIG(Managed_Object_Get_Containing_Scope_Function); -typedef MANAGED_OBJECT_FREE_SIG(Managed_Object_Free_Function); -typedef MANAGED_OBJECT_STORE_DATA_SIG(Managed_Object_Store_Data_Function); -typedef MANAGED_OBJECT_LOAD_DATA_SIG(Managed_Object_Load_Data_Function); -typedef GET_USER_INPUT_SIG(Get_User_Input_Function); -typedef GET_COMMAND_INPUT_SIG(Get_Command_Input_Function); -typedef SET_COMMAND_INPUT_SIG(Set_Command_Input_Function); -typedef GET_MOUSE_STATE_SIG(Get_Mouse_State_Function); -typedef GET_ACTIVE_QUERY_BARS_SIG(Get_Active_Query_Bars_Function); -typedef START_QUERY_BAR_SIG(Start_Query_Bar_Function); -typedef END_QUERY_BAR_SIG(End_Query_Bar_Function); -typedef PRINT_MESSAGE_SIG(Print_Message_Function); -typedef LOG_STRING_SIG(Log_String_Function); -typedef THREAD_GET_ID_SIG(Thread_Get_ID_Function); -typedef GET_LARGEST_FACE_ID_SIG(Get_Largest_Face_ID_Function); -typedef SET_GLOBAL_FACE_SIG(Set_Global_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); -typedef BUFFER_HISTORY_GET_CURRENT_STATE_INDEX_SIG(Buffer_History_Get_Current_State_Index_Function); -typedef BUFFER_HISTORY_SET_CURRENT_STATE_INDEX_SIG(Buffer_History_Set_Current_State_Index_Function); -typedef BUFFER_HISTORY_MERGE_RECORD_RANGE_SIG(Buffer_History_Merge_Record_Range_Function); -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_METRICS_SIG(Get_Face_Metrics_Function); -typedef GET_FACE_ID_SIG(Get_Face_ID_Function); -typedef TRY_CREATE_NEW_FACE_SIG(Try_Create_New_Face_Function); -typedef TRY_MODIFY_FACE_SIG(Try_Modify_Face_Function); -typedef TRY_RELEASE_FACE_SIG(Try_Release_Face_Function); -typedef SET_THEME_COLORS_SIG(Set_Theme_Colors_Function); -typedef GET_THEME_COLORS_SIG(Get_Theme_Colors_Function); -typedef FINALIZE_COLOR_SIG(Finalize_Color_Function); -typedef PUSH_HOT_DIRECTORY_SIG(Push_Hot_Directory_Function); -typedef SET_HOT_DIRECTORY_SIG(Set_Hot_Directory_Function); -typedef GET_FILE_LIST_SIG(Get_File_List_Function); -typedef SET_GUI_UP_DOWN_KEYS_SIG(Set_GUI_Up_Down_Keys_Function); -typedef MEMORY_ALLOCATE_SIG(Memory_Allocate_Function); -typedef MEMORY_SET_PROTECTION_SIG(Memory_Set_Protection_Function); -typedef MEMORY_FREE_SIG(Memory_Free_Function); -typedef PUSH_4ED_PATH_SIG(Push_4ed_Path_Function); -typedef SHOW_MOUSE_CURSOR_SIG(Show_Mouse_Cursor_Function); -typedef SET_EDIT_FINISHED_HOOK_REPEAT_SPEED_SIG(Set_Edit_Finished_Hook_Repeat_Speed_Function); -typedef SET_FULLSCREEN_SIG(Set_Fullscreen_Function); -typedef IS_FULLSCREEN_SIG(Is_Fullscreen_Function); -typedef SEND_EXIT_SIGNAL_SIG(Send_Exit_Signal_Function); -typedef SET_WINDOW_TITLE_SIG(Set_Window_Title_Function); -typedef GET_MICROSECONDS_TIMESTAMP_SIG(Get_Microseconds_Timestamp_Function); -typedef DRAW_STRING_SIG(Draw_String_Function); -typedef GET_STRING_ADVANCE_SIG(Get_String_Advance_Function); -typedef DRAW_RECTANGLE_SIG(Draw_Rectangle_Function); -typedef DRAW_RECTANGLE_OUTLINE_SIG(Draw_Rectangle_Outline_Function); -typedef DRAW_CLIP_PUSH_SIG(Draw_Clip_Push_Function); -typedef DRAW_CLIP_POP_SIG(Draw_Clip_Pop_Function); -typedef DRAW_COORDINATE_CENTER_PUSH_SIG(Draw_Coordinate_Center_Push_Function); -typedef DRAW_COORDINATE_CENTER_POP_SIG(Draw_Coordinate_Center_Pop_Function); -typedef TEXT_LAYOUT_CREATE_SIG(Text_Layout_Create_Function); -typedef TEXT_LAYOUT_GET_BUFFER_SIG(Text_Layout_Get_Buffer_Function); -typedef TEXT_LAYOUT_GET_VISIBLE_RANGE_SIG(Text_Layout_Get_Visible_Range_Function); -typedef TEXT_LAYOUT_LINE_ON_SCREEN_SIG(Text_Layout_Line_On_Screen_Function); -typedef TEXT_LAYOUT_CHARACTER_ON_SCREEN_SIG(Text_Layout_Character_On_Screen_Function); -typedef PAINT_TEXT_COLOR_SIG(Paint_Text_Color_Function); -typedef TEXT_LAYOUT_FREE_SIG(Text_Layout_Free_Function); -typedef DRAW_TEXT_LAYOUT_SIG(Draw_Text_Layout_Function); -typedef OPEN_COLOR_PICKER_SIG(Open_Color_Picker_Function); -typedef ANIMATE_IN_N_MILLISECONDS_SIG(Animate_In_N_Milliseconds_Function); -typedef BUFFER_FIND_ALL_MATCHES_SIG(Buffer_Find_All_Matches_Function); -struct Application_Links{ - Global_Set_Setting_Function *global_set_setting_; - Global_Set_Mapping_Function *global_set_mapping_; - Global_Get_Screen_Rectangle_Function *global_get_screen_rectangle_; - Get_Thread_Context_Function *get_thread_context_; - Create_Child_Process_Function *create_child_process_; - Child_Process_Set_Target_Buffer_Function *child_process_set_target_buffer_; - Buffer_Get_Attached_Child_Process_Function *buffer_get_attached_child_process_; - Child_Process_Get_Attached_Buffer_Function *child_process_get_attached_buffer_; - Child_Process_Get_State_Function *child_process_get_state_; - Clipboard_Post_Function *clipboard_post_; - Clipboard_Count_Function *clipboard_count_; - Push_Clipboard_Index_Function *push_clipboard_index_; - Get_Buffer_Count_Function *get_buffer_count_; - Get_Buffer_Next_Function *get_buffer_next_; - 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_; - Buffer_Replace_Range_Function *buffer_replace_range_; - Buffer_Batch_Edit_Function *buffer_batch_edit_; - Buffer_Seek_String_Function *buffer_seek_string_; - Buffer_Seek_Character_Class_Function *buffer_seek_character_class_; - Buffer_Line_Y_Difference_Function *buffer_line_y_difference_; - Buffer_Line_Shift_Y_Function *buffer_line_shift_y_; - Buffer_Pos_At_Relative_XY_Function *buffer_pos_at_relative_xy_; - Buffer_Relative_XY_Of_Pos_Function *buffer_relative_xy_of_pos_; - Buffer_Relative_Character_From_Pos_Function *buffer_relative_character_from_pos_; - Buffer_Pos_From_Relative_Character_Function *buffer_pos_from_relative_character_; - View_Line_Y_Difference_Function *view_line_y_difference_; - View_Line_Shift_Y_Function *view_line_shift_y_; - View_Pos_At_Relative_XY_Function *view_pos_at_relative_xy_; - View_Relative_XY_Of_Pos_Function *view_relative_xy_of_pos_; - View_Relative_Character_From_Pos_Function *view_relative_character_from_pos_; - View_Pos_From_Relative_Character_Function *view_pos_from_relative_character_; - Buffer_Exists_Function *buffer_exists_; - Buffer_Ready_Function *buffer_ready_; - Buffer_Get_Access_Flags_Function *buffer_get_access_flags_; - Buffer_Get_Size_Function *buffer_get_size_; - Buffer_Get_Line_Count_Function *buffer_get_line_count_; - Push_Buffer_Base_Name_Function *push_buffer_base_name_; - Push_Buffer_Unique_Name_Function *push_buffer_unique_name_; - Push_Buffer_File_Name_Function *push_buffer_file_name_; - Buffer_Get_Dirty_State_Function *buffer_get_dirty_state_; - Buffer_Set_Dirty_State_Function *buffer_set_dirty_state_; - Buffer_Get_Setting_Function *buffer_get_setting_; - Buffer_Set_Setting_Function *buffer_set_setting_; - Buffer_Get_Managed_Scope_Function *buffer_get_managed_scope_; - Buffer_Send_End_Signal_Function *buffer_send_end_signal_; - Create_Buffer_Function *create_buffer_; - Buffer_Save_Function *buffer_save_; - Buffer_Kill_Function *buffer_kill_; - Buffer_Reopen_Function *buffer_reopen_; - Buffer_Get_File_Attributes_Function *buffer_get_file_attributes_; - Get_File_Attributes_Function *get_file_attributes_; - Get_View_Next_Function *get_view_next_; - Get_View_Prev_Function *get_view_prev_; - Get_Active_View_Function *get_active_view_; - Get_Active_Panel_Function *get_active_panel_; - View_Exists_Function *view_exists_; - View_Get_Buffer_Function *view_get_buffer_; - View_Get_Cursor_Pos_Function *view_get_cursor_pos_; - View_Get_Mark_Pos_Function *view_get_mark_pos_; - View_Get_Preferred_X_Function *view_get_preferred_x_; - View_Set_Preferred_X_Function *view_set_preferred_x_; - View_Get_Screen_Rect_Function *view_get_screen_rect_; - View_Get_Panel_Function *view_get_panel_; - Panel_Get_View_Function *panel_get_view_; - Panel_Is_Split_Function *panel_is_split_; - Panel_Is_Leaf_Function *panel_is_leaf_; - Panel_Split_Function *panel_split_; - Panel_Set_Split_Function *panel_set_split_; - Panel_Swap_Children_Function *panel_swap_children_; - Panel_Get_Parent_Function *panel_get_parent_; - Panel_Get_Child_Function *panel_get_child_; - Panel_Get_Max_Function *panel_get_max_; - Panel_Get_Margin_Function *panel_get_margin_; - View_Close_Function *view_close_; - View_Get_Buffer_Region_Function *view_get_buffer_region_; - View_Get_Buffer_Scroll_Function *view_get_buffer_scroll_; - View_Get_Basic_Scroll_Function *view_get_basic_scroll_; - 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_; - Buffer_Compute_Cursor_Function *buffer_compute_cursor_; - View_Compute_Cursor_Function *view_compute_cursor_; - View_Set_Cursor_Function *view_set_cursor_; - View_Set_Buffer_Scroll_Function *view_set_buffer_scroll_; - View_Set_Basic_Scroll_Function *view_set_basic_scroll_; - View_Set_Mark_Function *view_set_mark_; - View_Set_Buffer_Function *view_set_buffer_; - View_Post_Fade_Function *view_post_fade_; - View_Begin_UI_Mode_Function *view_begin_ui_mode_; - View_End_UI_Mode_Function *view_end_ui_mode_; - View_Is_In_UI_Mode_Function *view_is_in_ui_mode_; - View_Set_Quit_UI_Handler_Function *view_set_quit_ui_handler_; - View_Get_Quit_UI_Handler_Function *view_get_quit_ui_handler_; - Create_User_Managed_Scope_Function *create_user_managed_scope_; - Destroy_User_Managed_Scope_Function *destroy_user_managed_scope_; - Get_Global_Managed_Scope_Function *get_global_managed_scope_; - Get_Managed_Scope_With_Multiple_Dependencies_Function *get_managed_scope_with_multiple_dependencies_; - Managed_Scope_Clear_Contents_Function *managed_scope_clear_contents_; - Managed_Scope_Clear_Self_All_Dependent_Scopes_Function *managed_scope_clear_self_all_dependent_scopes_; - Managed_Scope_Allocator_Function *managed_scope_allocator_; - Managed_Id_Declare_Function *managed_id_declare_; - Managed_Scope_Get_Attachment_Function *managed_scope_get_attachment_; - Managed_Scope_Attachment_Erase_Function *managed_scope_attachment_erase_; - Alloc_Managed_Memory_In_Scope_Function *alloc_managed_memory_in_scope_; - Alloc_Buffer_Markers_On_Buffer_Function *alloc_buffer_markers_on_buffer_; - Managed_Object_Get_Item_Size_Function *managed_object_get_item_size_; - Managed_Object_Get_Item_Count_Function *managed_object_get_item_count_; - Managed_Object_Get_Pointer_Function *managed_object_get_pointer_; - Managed_Object_Get_Type_Function *managed_object_get_type_; - Managed_Object_Get_Containing_Scope_Function *managed_object_get_containing_scope_; - Managed_Object_Free_Function *managed_object_free_; - Managed_Object_Store_Data_Function *managed_object_store_data_; - Managed_Object_Load_Data_Function *managed_object_load_data_; - Get_User_Input_Function *get_user_input_; - Get_Command_Input_Function *get_command_input_; - Set_Command_Input_Function *set_command_input_; - Get_Mouse_State_Function *get_mouse_state_; - Get_Active_Query_Bars_Function *get_active_query_bars_; - Start_Query_Bar_Function *start_query_bar_; - End_Query_Bar_Function *end_query_bar_; - Print_Message_Function *print_message_; - Log_String_Function *log_string_; - Thread_Get_ID_Function *thread_get_id_; - Get_Largest_Face_ID_Function *get_largest_face_id_; - Set_Global_Face_Function *set_global_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_; - Buffer_History_Get_Current_State_Index_Function *buffer_history_get_current_state_index_; - Buffer_History_Set_Current_State_Index_Function *buffer_history_set_current_state_index_; - 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_Metrics_Function *get_face_metrics_; - Get_Face_ID_Function *get_face_id_; - Try_Create_New_Face_Function *try_create_new_face_; - Try_Modify_Face_Function *try_modify_face_; - Try_Release_Face_Function *try_release_face_; - Set_Theme_Colors_Function *set_theme_colors_; - Get_Theme_Colors_Function *get_theme_colors_; - Finalize_Color_Function *finalize_color_; - Push_Hot_Directory_Function *push_hot_directory_; - Set_Hot_Directory_Function *set_hot_directory_; - Get_File_List_Function *get_file_list_; - Set_GUI_Up_Down_Keys_Function *set_gui_up_down_keys_; - Memory_Allocate_Function *memory_allocate_; - Memory_Set_Protection_Function *memory_set_protection_; - Memory_Free_Function *memory_free_; - Push_4ed_Path_Function *push_4ed_path_; - Show_Mouse_Cursor_Function *show_mouse_cursor_; - Set_Edit_Finished_Hook_Repeat_Speed_Function *set_edit_finished_hook_repeat_speed_; - Set_Fullscreen_Function *set_fullscreen_; - Is_Fullscreen_Function *is_fullscreen_; - Send_Exit_Signal_Function *send_exit_signal_; - Set_Window_Title_Function *set_window_title_; - Get_Microseconds_Timestamp_Function *get_microseconds_timestamp_; - Draw_String_Function *draw_string_; - Get_String_Advance_Function *get_string_advance_; - Draw_Rectangle_Function *draw_rectangle_; - Draw_Rectangle_Outline_Function *draw_rectangle_outline_; - Draw_Clip_Push_Function *draw_clip_push_; - Draw_Clip_Pop_Function *draw_clip_pop_; - Draw_Coordinate_Center_Push_Function *draw_coordinate_center_push_; - Draw_Coordinate_Center_Pop_Function *draw_coordinate_center_pop_; - Text_Layout_Create_Function *text_layout_create_; - Text_Layout_Get_Buffer_Function *text_layout_get_buffer_; - Text_Layout_Get_Visible_Range_Function *text_layout_get_visible_range_; - Text_Layout_Line_On_Screen_Function *text_layout_line_on_screen_; - Text_Layout_Character_On_Screen_Function *text_layout_character_on_screen_; - Paint_Text_Color_Function *paint_text_color_; - Text_Layout_Free_Function *text_layout_free_; - Draw_Text_Layout_Function *draw_text_layout_; - Open_Color_Picker_Function *open_color_picker_; - Animate_In_N_Milliseconds_Function *animate_in_n_milliseconds_; - Buffer_Find_All_Matches_Function *buffer_find_all_matches_; - void *cmd_context; - void *system_links; - void *current_coroutine; - int32_t type_coroutine; -}; -#define FillAppLinksAPI(app_links) do{\ - app_links->global_set_setting_ = Global_Set_Setting;\ - app_links->global_set_mapping_ = Global_Set_Mapping;\ - app_links->global_get_screen_rectangle_ = Global_Get_Screen_Rectangle;\ - app_links->get_thread_context_ = Get_Thread_Context;\ - app_links->create_child_process_ = Create_Child_Process;\ - app_links->child_process_set_target_buffer_ = Child_Process_Set_Target_Buffer;\ - app_links->buffer_get_attached_child_process_ = Buffer_Get_Attached_Child_Process;\ - app_links->child_process_get_attached_buffer_ = Child_Process_Get_Attached_Buffer;\ - app_links->child_process_get_state_ = Child_Process_Get_State;\ - app_links->clipboard_post_ = Clipboard_Post;\ - app_links->clipboard_count_ = Clipboard_Count;\ - app_links->push_clipboard_index_ = Push_Clipboard_Index;\ - app_links->get_buffer_count_ = Get_Buffer_Count;\ - app_links->get_buffer_next_ = Get_Buffer_Next;\ - 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;\ - app_links->buffer_replace_range_ = Buffer_Replace_Range;\ - app_links->buffer_batch_edit_ = Buffer_Batch_Edit;\ - app_links->buffer_seek_string_ = Buffer_Seek_String;\ - app_links->buffer_seek_character_class_ = Buffer_Seek_Character_Class;\ - app_links->buffer_line_y_difference_ = Buffer_Line_Y_Difference;\ - app_links->buffer_line_shift_y_ = Buffer_Line_Shift_Y;\ - app_links->buffer_pos_at_relative_xy_ = Buffer_Pos_At_Relative_XY;\ - app_links->buffer_relative_xy_of_pos_ = Buffer_Relative_XY_Of_Pos;\ - app_links->buffer_relative_character_from_pos_ = Buffer_Relative_Character_From_Pos;\ - app_links->buffer_pos_from_relative_character_ = Buffer_Pos_From_Relative_Character;\ - app_links->view_line_y_difference_ = View_Line_Y_Difference;\ - app_links->view_line_shift_y_ = View_Line_Shift_Y;\ - app_links->view_pos_at_relative_xy_ = View_Pos_At_Relative_XY;\ - app_links->view_relative_xy_of_pos_ = View_Relative_XY_Of_Pos;\ - app_links->view_relative_character_from_pos_ = View_Relative_Character_From_Pos;\ - app_links->view_pos_from_relative_character_ = View_Pos_From_Relative_Character;\ - app_links->buffer_exists_ = Buffer_Exists;\ - app_links->buffer_ready_ = Buffer_Ready;\ - app_links->buffer_get_access_flags_ = Buffer_Get_Access_Flags;\ - app_links->buffer_get_size_ = Buffer_Get_Size;\ - app_links->buffer_get_line_count_ = Buffer_Get_Line_Count;\ - app_links->push_buffer_base_name_ = Push_Buffer_Base_Name;\ - app_links->push_buffer_unique_name_ = Push_Buffer_Unique_Name;\ - app_links->push_buffer_file_name_ = Push_Buffer_File_Name;\ - app_links->buffer_get_dirty_state_ = Buffer_Get_Dirty_State;\ - app_links->buffer_set_dirty_state_ = Buffer_Set_Dirty_State;\ - app_links->buffer_get_setting_ = Buffer_Get_Setting;\ - app_links->buffer_set_setting_ = Buffer_Set_Setting;\ - app_links->buffer_get_managed_scope_ = Buffer_Get_Managed_Scope;\ - app_links->buffer_send_end_signal_ = Buffer_Send_End_Signal;\ - app_links->create_buffer_ = Create_Buffer;\ - app_links->buffer_save_ = Buffer_Save;\ - app_links->buffer_kill_ = Buffer_Kill;\ - app_links->buffer_reopen_ = Buffer_Reopen;\ - app_links->buffer_get_file_attributes_ = Buffer_Get_File_Attributes;\ - app_links->get_file_attributes_ = Get_File_Attributes;\ - app_links->get_view_next_ = Get_View_Next;\ - app_links->get_view_prev_ = Get_View_Prev;\ - app_links->get_active_view_ = Get_Active_View;\ - app_links->get_active_panel_ = Get_Active_Panel;\ - app_links->view_exists_ = View_Exists;\ - app_links->view_get_buffer_ = View_Get_Buffer;\ - app_links->view_get_cursor_pos_ = View_Get_Cursor_Pos;\ - app_links->view_get_mark_pos_ = View_Get_Mark_Pos;\ - app_links->view_get_preferred_x_ = View_Get_Preferred_X;\ - app_links->view_set_preferred_x_ = View_Set_Preferred_X;\ - app_links->view_get_screen_rect_ = View_Get_Screen_Rect;\ - app_links->view_get_panel_ = View_Get_Panel;\ - app_links->panel_get_view_ = Panel_Get_View;\ - app_links->panel_is_split_ = Panel_Is_Split;\ - app_links->panel_is_leaf_ = Panel_Is_Leaf;\ - app_links->panel_split_ = Panel_Split;\ - app_links->panel_set_split_ = Panel_Set_Split;\ - app_links->panel_swap_children_ = Panel_Swap_Children;\ - app_links->panel_get_parent_ = Panel_Get_Parent;\ - app_links->panel_get_child_ = Panel_Get_Child;\ - app_links->panel_get_max_ = Panel_Get_Max;\ - app_links->panel_get_margin_ = Panel_Get_Margin;\ - app_links->view_close_ = View_Close;\ - app_links->view_get_buffer_region_ = View_Get_Buffer_Region;\ - app_links->view_get_buffer_scroll_ = View_Get_Buffer_Scroll;\ - app_links->view_get_basic_scroll_ = View_Get_Basic_Scroll;\ - 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;\ - app_links->buffer_compute_cursor_ = Buffer_Compute_Cursor;\ - app_links->view_compute_cursor_ = View_Compute_Cursor;\ - app_links->view_set_cursor_ = View_Set_Cursor;\ - app_links->view_set_buffer_scroll_ = View_Set_Buffer_Scroll;\ - app_links->view_set_basic_scroll_ = View_Set_Basic_Scroll;\ - app_links->view_set_mark_ = View_Set_Mark;\ - 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;\ - app_links->view_end_ui_mode_ = View_End_UI_Mode;\ - app_links->view_is_in_ui_mode_ = View_Is_In_UI_Mode;\ - app_links->view_set_quit_ui_handler_ = View_Set_Quit_UI_Handler;\ - app_links->view_get_quit_ui_handler_ = View_Get_Quit_UI_Handler;\ - app_links->create_user_managed_scope_ = Create_User_Managed_Scope;\ - app_links->destroy_user_managed_scope_ = Destroy_User_Managed_Scope;\ - app_links->get_global_managed_scope_ = Get_Global_Managed_Scope;\ - app_links->get_managed_scope_with_multiple_dependencies_ = Get_Managed_Scope_With_Multiple_Dependencies;\ - app_links->managed_scope_clear_contents_ = Managed_Scope_Clear_Contents;\ - app_links->managed_scope_clear_self_all_dependent_scopes_ = Managed_Scope_Clear_Self_All_Dependent_Scopes;\ - app_links->managed_scope_allocator_ = Managed_Scope_Allocator;\ - app_links->managed_id_declare_ = Managed_Id_Declare;\ - app_links->managed_scope_get_attachment_ = Managed_Scope_Get_Attachment;\ - app_links->managed_scope_attachment_erase_ = Managed_Scope_Attachment_Erase;\ - app_links->alloc_managed_memory_in_scope_ = Alloc_Managed_Memory_In_Scope;\ - app_links->alloc_buffer_markers_on_buffer_ = Alloc_Buffer_Markers_On_Buffer;\ - app_links->managed_object_get_item_size_ = Managed_Object_Get_Item_Size;\ - app_links->managed_object_get_item_count_ = Managed_Object_Get_Item_Count;\ - app_links->managed_object_get_pointer_ = Managed_Object_Get_Pointer;\ - app_links->managed_object_get_type_ = Managed_Object_Get_Type;\ - app_links->managed_object_get_containing_scope_ = Managed_Object_Get_Containing_Scope;\ - app_links->managed_object_free_ = Managed_Object_Free;\ - app_links->managed_object_store_data_ = Managed_Object_Store_Data;\ - app_links->managed_object_load_data_ = Managed_Object_Load_Data;\ - app_links->get_user_input_ = Get_User_Input;\ - app_links->get_command_input_ = Get_Command_Input;\ - app_links->set_command_input_ = Set_Command_Input;\ - app_links->get_mouse_state_ = Get_Mouse_State;\ - app_links->get_active_query_bars_ = Get_Active_Query_Bars;\ - app_links->start_query_bar_ = Start_Query_Bar;\ - app_links->end_query_bar_ = End_Query_Bar;\ - app_links->print_message_ = Print_Message;\ - app_links->log_string_ = Log_String;\ - app_links->thread_get_id_ = Thread_Get_ID;\ - app_links->get_largest_face_id_ = Get_Largest_Face_ID;\ - app_links->set_global_face_ = Set_Global_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;\ - app_links->buffer_history_get_current_state_index_ = Buffer_History_Get_Current_State_Index;\ - app_links->buffer_history_set_current_state_index_ = Buffer_History_Set_Current_State_Index;\ - app_links->buffer_history_merge_record_range_ = Buffer_History_Merge_Record_Range;\ - 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_metrics_ = Get_Face_Metrics;\ - app_links->get_face_id_ = Get_Face_ID;\ - app_links->try_create_new_face_ = Try_Create_New_Face;\ - app_links->try_modify_face_ = Try_Modify_Face;\ - app_links->try_release_face_ = Try_Release_Face;\ - app_links->set_theme_colors_ = Set_Theme_Colors;\ - app_links->get_theme_colors_ = Get_Theme_Colors;\ - app_links->finalize_color_ = Finalize_Color;\ - app_links->push_hot_directory_ = Push_Hot_Directory;\ - app_links->set_hot_directory_ = Set_Hot_Directory;\ - app_links->get_file_list_ = Get_File_List;\ - app_links->set_gui_up_down_keys_ = Set_GUI_Up_Down_Keys;\ - app_links->memory_allocate_ = Memory_Allocate;\ - app_links->memory_set_protection_ = Memory_Set_Protection;\ - app_links->memory_free_ = Memory_Free;\ - app_links->push_4ed_path_ = Push_4ed_Path;\ - app_links->show_mouse_cursor_ = Show_Mouse_Cursor;\ - app_links->set_edit_finished_hook_repeat_speed_ = Set_Edit_Finished_Hook_Repeat_Speed;\ - app_links->set_fullscreen_ = Set_Fullscreen;\ - app_links->is_fullscreen_ = Is_Fullscreen;\ - app_links->send_exit_signal_ = Send_Exit_Signal;\ - app_links->set_window_title_ = Set_Window_Title;\ - app_links->get_microseconds_timestamp_ = Get_Microseconds_Timestamp;\ - app_links->draw_string_ = Draw_String;\ - app_links->get_string_advance_ = Get_String_Advance;\ - app_links->draw_rectangle_ = Draw_Rectangle;\ - app_links->draw_rectangle_outline_ = Draw_Rectangle_Outline;\ - app_links->draw_clip_push_ = Draw_Clip_Push;\ - app_links->draw_clip_pop_ = Draw_Clip_Pop;\ - app_links->draw_coordinate_center_push_ = Draw_Coordinate_Center_Push;\ - app_links->draw_coordinate_center_pop_ = Draw_Coordinate_Center_Pop;\ - app_links->text_layout_create_ = Text_Layout_Create;\ - app_links->text_layout_get_buffer_ = Text_Layout_Get_Buffer;\ - app_links->text_layout_get_visible_range_ = Text_Layout_Get_Visible_Range;\ - app_links->text_layout_line_on_screen_ = Text_Layout_Line_On_Screen;\ - app_links->text_layout_character_on_screen_ = Text_Layout_Character_On_Screen;\ - app_links->paint_text_color_ = Paint_Text_Color;\ - app_links->text_layout_free_ = Text_Layout_Free;\ - app_links->draw_text_layout_ = Draw_Text_Layout;\ - app_links->open_color_picker_ = Open_Color_Picker;\ - app_links->animate_in_n_milliseconds_ = Animate_In_N_Milliseconds;\ - app_links->buffer_find_all_matches_ = Buffer_Find_All_Matches;\ -} while(false) -static b32 global_set_setting(Application_Links *app, Global_Setting_ID setting, i32 value){return(app->global_set_setting_(app, setting, value));} -static b32 global_set_mapping(Application_Links *app, void *data, i32 size){return(app->global_set_mapping_(app, data, size));} -static Rect_f32 global_get_screen_rectangle(Application_Links *app){return(app->global_get_screen_rectangle_(app));} -static Thread_Context* get_thread_context(Application_Links *app){return(app->get_thread_context_(app));} -static b32 create_child_process(Application_Links *app, String_Const_u8 path, String_Const_u8 command, Child_Process_ID *child_process_id_out){return(app->create_child_process_(app, path, command, child_process_id_out));} -static b32 child_process_set_target_buffer(Application_Links *app, Child_Process_ID child_process_id, Buffer_ID buffer_id, Child_Process_Set_Target_Flags flags){return(app->child_process_set_target_buffer_(app, child_process_id, buffer_id, flags));} -static Child_Process_ID buffer_get_attached_child_process(Application_Links *app, Buffer_ID buffer_id){return(app->buffer_get_attached_child_process_(app, buffer_id));} -static Buffer_ID child_process_get_attached_buffer(Application_Links *app, Child_Process_ID child_process_id){return(app->child_process_get_attached_buffer_(app, child_process_id));} -static Process_State child_process_get_state(Application_Links *app, Child_Process_ID child_process_id){return(app->child_process_get_state_(app, child_process_id));} -static b32 clipboard_post(Application_Links *app, i32 clipboard_id, String_Const_u8 string){return(app->clipboard_post_(app, clipboard_id, string));} -static i32 clipboard_count(Application_Links *app, i32 clipboard_id){return(app->clipboard_count_(app, clipboard_id));} -static String_Const_u8 push_clipboard_index(Application_Links *app, Arena *arena, i32 clipboard_id, i32 item_index){return(app->push_clipboard_index_(app, arena, clipboard_id, item_index));} -static i32 get_buffer_count(Application_Links *app){return(app->get_buffer_count_(app));} -static Buffer_ID get_buffer_next(Application_Links *app, Buffer_ID buffer_id, Access_Flag access){return(app->get_buffer_next_(app, buffer_id, access));} -static Buffer_ID get_buffer_by_name(Application_Links *app, String_Const_u8 name, Access_Flag access){return(app->get_buffer_by_name_(app, name, access));} -static Buffer_ID get_buffer_by_file_name(Application_Links *app, String_Const_u8 file_name, Access_Flag access){return(app->get_buffer_by_file_name_(app, file_name, access));} -static b32 buffer_read_range(Application_Links *app, Buffer_ID buffer_id, Range_i64 range, char *out){return(app->buffer_read_range_(app, buffer_id, range, out));} -static b32 buffer_replace_range(Application_Links *app, Buffer_ID buffer_id, Range_i64 range, String_Const_u8 string){return(app->buffer_replace_range_(app, buffer_id, range, string));} -static b32 buffer_batch_edit(Application_Links *app, Buffer_ID buffer_id, Batch_Edit *batch){return(app->buffer_batch_edit_(app, buffer_id, batch));} -static String_Match buffer_seek_string(Application_Links *app, Buffer_ID buffer, String_Const_u8 needle, Scan_Direction direction, i64 start_pos){return(app->buffer_seek_string_(app, buffer, needle, direction, start_pos));} -static String_Match buffer_seek_character_class(Application_Links *app, Buffer_ID buffer, Character_Predicate *predicate, Scan_Direction direction, i64 start_pos){return(app->buffer_seek_character_class_(app, buffer, predicate, direction, start_pos));} -static f32 buffer_line_y_difference(Application_Links *app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 line_a, i64 line_b){return(app->buffer_line_y_difference_(app, buffer_id, width, face_id, line_a, line_b));} -static Line_Shift_Vertical buffer_line_shift_y(Application_Links *app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 line, f32 y_shift){return(app->buffer_line_shift_y_(app, buffer_id, width, face_id, line, y_shift));} -static i64 buffer_pos_at_relative_xy(Application_Links *app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, Vec2_f32 relative_xy){return(app->buffer_pos_at_relative_xy_(app, buffer_id, width, face_id, base_line, relative_xy));} -static Vec2_f32 buffer_relative_xy_of_pos(Application_Links *app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 pos){return(app->buffer_relative_xy_of_pos_(app, buffer_id, width, face_id, base_line, pos));} -static i64 buffer_relative_character_from_pos(Application_Links *app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 pos){return(app->buffer_relative_character_from_pos_(app, buffer_id, width, face_id, base_line, pos));} -static i64 buffer_pos_from_relative_character(Application_Links *app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 relative_character){return(app->buffer_pos_from_relative_character_(app, buffer_id, width, face_id, base_line, relative_character));} -static f32 view_line_y_difference(Application_Links *app, View_ID view_id, i64 line_a, i64 line_b){return(app->view_line_y_difference_(app, view_id, line_a, line_b));} -static Line_Shift_Vertical view_line_shift_y(Application_Links *app, View_ID view_id, i64 line, f32 y_shift){return(app->view_line_shift_y_(app, view_id, line, y_shift));} -static i64 view_pos_at_relative_xy(Application_Links *app, View_ID view_id, i64 base_line, Vec2_f32 relative_xy){return(app->view_pos_at_relative_xy_(app, view_id, base_line, relative_xy));} -static Vec2_f32 view_relative_xy_of_pos(Application_Links *app, View_ID view_id, i64 base_line, i64 pos){return(app->view_relative_xy_of_pos_(app, view_id, base_line, pos));} -static i64 view_relative_character_from_pos(Application_Links *app, View_ID view_id, i64 base_line, i64 pos){return(app->view_relative_character_from_pos_(app, view_id, base_line, pos));} -static i64 view_pos_from_relative_character(Application_Links *app, View_ID view_id, i64 base_line, i64 character){return(app->view_pos_from_relative_character_(app, view_id, base_line, character));} -static b32 buffer_exists(Application_Links *app, Buffer_ID buffer_id){return(app->buffer_exists_(app, buffer_id));} -static b32 buffer_ready(Application_Links *app, Buffer_ID buffer_id){return(app->buffer_ready_(app, buffer_id));} -static Access_Flag buffer_get_access_flags(Application_Links *app, Buffer_ID buffer_id){return(app->buffer_get_access_flags_(app, buffer_id));} -static i64 buffer_get_size(Application_Links *app, Buffer_ID buffer_id){return(app->buffer_get_size_(app, buffer_id));} -static i64 buffer_get_line_count(Application_Links *app, Buffer_ID buffer_id){return(app->buffer_get_line_count_(app, buffer_id));} -static String_Const_u8 push_buffer_base_name(Application_Links *app, Arena *arena, Buffer_ID buffer_id){return(app->push_buffer_base_name_(app, arena, buffer_id));} -static String_Const_u8 push_buffer_unique_name(Application_Links *app, Arena *out, Buffer_ID buffer_id){return(app->push_buffer_unique_name_(app, out, buffer_id));} -static String_Const_u8 push_buffer_file_name(Application_Links *app, Arena *arena, Buffer_ID buffer_id){return(app->push_buffer_file_name_(app, arena, buffer_id));} -static Dirty_State buffer_get_dirty_state(Application_Links *app, Buffer_ID buffer_id){return(app->buffer_get_dirty_state_(app, buffer_id));} -static b32 buffer_set_dirty_state(Application_Links *app, Buffer_ID buffer_id, Dirty_State dirty_state){return(app->buffer_set_dirty_state_(app, buffer_id, dirty_state));} -static b32 buffer_get_setting(Application_Links *app, Buffer_ID buffer_id, Buffer_Setting_ID setting, i32 *value_out){return(app->buffer_get_setting_(app, buffer_id, setting, value_out));} -static b32 buffer_set_setting(Application_Links *app, Buffer_ID buffer_id, Buffer_Setting_ID setting, i32 value){return(app->buffer_set_setting_(app, buffer_id, 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 b32 buffer_send_end_signal(Application_Links *app, Buffer_ID buffer_id){return(app->buffer_send_end_signal_(app, buffer_id));} -static Buffer_ID create_buffer(Application_Links *app, String_Const_u8 file_name, Buffer_Create_Flag flags){return(app->create_buffer_(app, file_name, flags));} -static b32 buffer_save(Application_Links *app, Buffer_ID buffer_id, String_Const_u8 file_name, Buffer_Save_Flag flags){return(app->buffer_save_(app, buffer_id, file_name, flags));} -static Buffer_Kill_Result buffer_kill(Application_Links *app, Buffer_ID buffer_id, Buffer_Kill_Flag flags){return(app->buffer_kill_(app, buffer_id, flags));} -static Buffer_Reopen_Result buffer_reopen(Application_Links *app, Buffer_ID buffer_id, Buffer_Reopen_Flag flags){return(app->buffer_reopen_(app, buffer_id, flags));} -static File_Attributes buffer_get_file_attributes(Application_Links *app, Buffer_ID buffer_id){return(app->buffer_get_file_attributes_(app, buffer_id));} -static File_Attributes get_file_attributes(Application_Links *app, String_Const_u8 file_name){return(app->get_file_attributes_(app, file_name));} -static View_ID get_view_next(Application_Links *app, View_ID view_id, Access_Flag access){return(app->get_view_next_(app, view_id, access));} -static View_ID get_view_prev(Application_Links *app, View_ID view_id, Access_Flag access){return(app->get_view_prev_(app, view_id, access));} -static View_ID get_active_view(Application_Links *app, Access_Flag access){return(app->get_active_view_(app, access));} -static Panel_ID get_active_panel(Application_Links *app){return(app->get_active_panel_(app));} -static b32 view_exists(Application_Links *app, View_ID view_id){return(app->view_exists_(app, view_id));} -static Buffer_ID view_get_buffer(Application_Links *app, View_ID view_id, Access_Flag access){return(app->view_get_buffer_(app, view_id, access));} -static i64 view_get_cursor_pos(Application_Links *app, View_ID view_id){return(app->view_get_cursor_pos_(app, view_id));} -static i64 view_get_mark_pos(Application_Links *app, View_ID view_id){return(app->view_get_mark_pos_(app, view_id));} -static f32 view_get_preferred_x(Application_Links *app, View_ID view_id){return(app->view_get_preferred_x_(app, view_id));} -static b32 view_set_preferred_x(Application_Links *app, View_ID view_id, f32 x){return(app->view_set_preferred_x_(app, view_id, x));} -static Rect_f32 view_get_screen_rect(Application_Links *app, View_ID view_id){return(app->view_get_screen_rect_(app, view_id));} -static Panel_ID view_get_panel(Application_Links *app, View_ID view_id){return(app->view_get_panel_(app, view_id));} -static View_ID panel_get_view(Application_Links *app, Panel_ID panel_id){return(app->panel_get_view_(app, panel_id));} -static b32 panel_is_split(Application_Links *app, Panel_ID panel_id){return(app->panel_is_split_(app, panel_id));} -static b32 panel_is_leaf(Application_Links *app, Panel_ID panel_id){return(app->panel_is_leaf_(app, panel_id));} -static b32 panel_split(Application_Links *app, Panel_ID panel_id, Panel_Split_Orientation orientation){return(app->panel_split_(app, panel_id, orientation));} -static b32 panel_set_split(Application_Links *app, Panel_ID panel_id, Panel_Split_Kind kind, float t){return(app->panel_set_split_(app, panel_id, kind, t));} -static b32 panel_swap_children(Application_Links *app, Panel_ID panel_id, Panel_Split_Kind kind, float t){return(app->panel_swap_children_(app, panel_id, kind, t));} -static Panel_ID panel_get_parent(Application_Links *app, Panel_ID panel_id){return(app->panel_get_parent_(app, panel_id));} -static Panel_ID panel_get_child(Application_Links *app, Panel_ID panel_id, Panel_Child which_child){return(app->panel_get_child_(app, panel_id, which_child));} -static Panel_ID panel_get_max(Application_Links *app, Panel_ID panel_id){return(app->panel_get_max_(app, panel_id));} -static Rect_i32 panel_get_margin(Application_Links *app, Panel_ID panel_id){return(app->panel_get_margin_(app, panel_id));} -static b32 view_close(Application_Links *app, View_ID view_id){return(app->view_close_(app, view_id));} -static Rect_f32 view_get_buffer_region(Application_Links *app, View_ID view_id){return(app->view_get_buffer_region_(app, view_id));} -static Buffer_Scroll view_get_buffer_scroll(Application_Links *app, View_ID view_id){return(app->view_get_buffer_scroll_(app, view_id));} -static Basic_Scroll view_get_basic_scroll(Application_Links *app, View_ID view_id){return(app->view_get_basic_scroll_(app, view_id));} -static b32 view_set_active(Application_Links *app, View_ID view_id){return(app->view_set_active_(app, view_id));} -static b32 view_get_setting(Application_Links *app, View_ID view_id, View_Setting_ID setting, i32 *value_out){return(app->view_get_setting_(app, view_id, setting, value_out));} -static b32 view_set_setting(Application_Links *app, View_ID view_id, View_Setting_ID setting, i32 value){return(app->view_set_setting_(app, view_id, 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 Buffer_Cursor buffer_compute_cursor(Application_Links *app, Buffer_ID buffer, Buffer_Seek seek){return(app->buffer_compute_cursor_(app, buffer, seek));} -static Buffer_Cursor view_compute_cursor(Application_Links *app, View_ID view_id, Buffer_Seek seek){return(app->view_compute_cursor_(app, view_id, seek));} -static b32 view_set_cursor(Application_Links *app, View_ID view_id, Buffer_Seek seek){return(app->view_set_cursor_(app, view_id, seek));} -static b32 view_set_buffer_scroll(Application_Links *app, View_ID view_id, Buffer_Scroll scroll){return(app->view_set_buffer_scroll_(app, view_id, scroll));} -static b32 view_set_basic_scroll(Application_Links *app, View_ID view_id, Basic_Scroll scroll){return(app->view_set_basic_scroll_(app, view_id, scroll));} -static b32 view_set_mark(Application_Links *app, View_ID view_id, Buffer_Seek seek){return(app->view_set_mark_(app, view_id, seek));} -static b32 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 b32 view_post_fade(Application_Links *app, View_ID view_id, f32 seconds, Range_i64 range, int_color color){return(app->view_post_fade_(app, view_id, seconds, range, color));} -static b32 view_begin_ui_mode(Application_Links *app, View_ID view_id){return(app->view_begin_ui_mode_(app, view_id));} -static b32 view_end_ui_mode(Application_Links *app, View_ID view_id){return(app->view_end_ui_mode_(app, view_id));} -static b32 view_is_in_ui_mode(Application_Links *app, View_ID view_id){return(app->view_is_in_ui_mode_(app, view_id));} -static b32 view_set_quit_ui_handler(Application_Links *app, View_ID view_id, UI_Quit_Function_Type *quit_function){return(app->view_set_quit_ui_handler_(app, view_id, quit_function));} -static b32 view_get_quit_ui_handler(Application_Links *app, View_ID view_id, UI_Quit_Function_Type **quit_function_out){return(app->view_get_quit_ui_handler_(app, view_id, quit_function_out));} -static Managed_Scope create_user_managed_scope(Application_Links *app){return(app->create_user_managed_scope_(app));} -static b32 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));} -static Managed_Scope get_managed_scope_with_multiple_dependencies(Application_Links *app, Managed_Scope *scopes, i32 count){return(app->get_managed_scope_with_multiple_dependencies_(app, scopes, count));} -static b32 managed_scope_clear_contents(Application_Links *app, Managed_Scope scope){return(app->managed_scope_clear_contents_(app, scope));} -static b32 managed_scope_clear_self_all_dependent_scopes(Application_Links *app, Managed_Scope scope){return(app->managed_scope_clear_self_all_dependent_scopes_(app, scope));} -static Base_Allocator* managed_scope_allocator(Application_Links *app, Managed_Scope scope){return(app->managed_scope_allocator_(app, scope));} -static Managed_ID managed_id_declare(Application_Links *app, String_Const_u8 name){return(app->managed_id_declare_(app, name));} -static void* managed_scope_get_attachment(Application_Links *app, Managed_Scope scope, Managed_ID id, umem size){return(app->managed_scope_get_attachment_(app, scope, id, size));} -static void* managed_scope_attachment_erase(Application_Links *app, Managed_Scope scope, Managed_ID id){return(app->managed_scope_attachment_erase_(app, scope, id));} -static Managed_Object alloc_managed_memory_in_scope(Application_Links *app, Managed_Scope scope, i32 item_size, i32 count){return(app->alloc_managed_memory_in_scope_(app, scope, item_size, count));} -static Managed_Object alloc_buffer_markers_on_buffer(Application_Links *app, Buffer_ID buffer_id, i32 count, Managed_Scope *optional_extra_scope){return(app->alloc_buffer_markers_on_buffer_(app, buffer_id, count, optional_extra_scope));} -static u32 managed_object_get_item_size(Application_Links *app, Managed_Object object){return(app->managed_object_get_item_size_(app, object));} -static u32 managed_object_get_item_count(Application_Links *app, Managed_Object object){return(app->managed_object_get_item_count_(app, object));} -static void* managed_object_get_pointer(Application_Links *app, Managed_Object object){return(app->managed_object_get_pointer_(app, object));} -static Managed_Object_Type managed_object_get_type(Application_Links *app, Managed_Object object){return(app->managed_object_get_type_(app, object));} -static Managed_Scope managed_object_get_containing_scope(Application_Links *app, Managed_Object object){return(app->managed_object_get_containing_scope_(app, object));} -static b32 managed_object_free(Application_Links *app, Managed_Object object){return(app->managed_object_free_(app, object));} -static b32 managed_object_store_data(Application_Links *app, Managed_Object object, u32 first_index, u32 count, void *mem){return(app->managed_object_store_data_(app, object, first_index, count, mem));} -static b32 managed_object_load_data(Application_Links *app, Managed_Object object, u32 first_index, u32 count, void *mem_out){return(app->managed_object_load_data_(app, object, first_index, count, mem_out));} -static User_Input get_user_input(Application_Links *app, Input_Type_Flag get_type, Input_Type_Flag abort_type){return(app->get_user_input_(app, get_type, abort_type));} -static User_Input get_command_input(Application_Links *app){return(app->get_command_input_(app));} -static void set_command_input(Application_Links *app, Key_Event_Data key_data){(app->set_command_input_(app, key_data));} -static Mouse_State get_mouse_state(Application_Links *app){return(app->get_mouse_state_(app));} -static b32 get_active_query_bars(Application_Links *app, View_ID view_id, i32 max_result_count, Query_Bar_Ptr_Array *array_out){return(app->get_active_query_bars_(app, view_id, max_result_count, array_out));} -static b32 start_query_bar(Application_Links *app, Query_Bar *bar, u32 flags){return(app->start_query_bar_(app, bar, flags));} -static void end_query_bar(Application_Links *app, Query_Bar *bar, u32 flags){(app->end_query_bar_(app, bar, flags));} -static b32 print_message(Application_Links *app, String_Const_u8 message){return(app->print_message_(app, message));} -static b32 log_string(Application_Links *app, String_Const_u8 str){return(app->log_string_(app, str));} -static i32 thread_get_id(Application_Links *app){return(app->thread_get_id_(app));} -static Face_ID get_largest_face_id(Application_Links *app){return(app->get_largest_face_id_(app));} -static b32 set_global_face(Application_Links *app, Face_ID id, b32 apply_to_all_buffers){return(app->set_global_face_(app, id, apply_to_all_buffers));} -static History_Record_Index buffer_history_get_max_record_index(Application_Links *app, Buffer_ID buffer_id){return(app->buffer_history_get_max_record_index_(app, buffer_id));} -static Record_Info buffer_history_get_record_info(Application_Links *app, Buffer_ID buffer_id, History_Record_Index index){return(app->buffer_history_get_record_info_(app, buffer_id, index));} -static Record_Info buffer_history_get_group_sub_record(Application_Links *app, Buffer_ID buffer_id, History_Record_Index index, i32 sub_index){return(app->buffer_history_get_group_sub_record_(app, buffer_id, index, sub_index));} -static History_Record_Index buffer_history_get_current_state_index(Application_Links *app, Buffer_ID buffer_id){return(app->buffer_history_get_current_state_index_(app, buffer_id));} -static b32 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 b32 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 b32 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 b32 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 face_id){return(app->get_face_description_(app, face_id));} -static Face_Metrics get_face_metrics(Application_Links *app, Face_ID face_id){return(app->get_face_metrics_(app, face_id));} -static Face_ID get_face_id(Application_Links *app, Buffer_ID buffer_id){return(app->get_face_id_(app, buffer_id));} -static Face_ID try_create_new_face(Application_Links *app, Face_Description *description){return(app->try_create_new_face_(app, description));} -static b32 try_modify_face(Application_Links *app, Face_ID id, Face_Description *description){return(app->try_modify_face_(app, id, description));} -static b32 try_release_face(Application_Links *app, Face_ID id, Face_ID replacement_id){return(app->try_release_face_(app, id, replacement_id));} -static void set_theme_colors(Application_Links *app, Theme_Color *colors, i32 count){(app->set_theme_colors_(app, colors, count));} -static void get_theme_colors(Application_Links *app, Theme_Color *colors, i32 count){(app->get_theme_colors_(app, colors, count));} -static argb_color finalize_color(Application_Links *app, int_color color){return(app->finalize_color_(app, color));} -static String_Const_u8 push_hot_directory(Application_Links *app, Arena *arena){return(app->push_hot_directory_(app, arena));} -static b32 set_hot_directory(Application_Links *app, String_Const_u8 string){return(app->set_hot_directory_(app, string));} -static File_List get_file_list(Application_Links *app, Arena *arena, String_Const_u8 directory){return(app->get_file_list_(app, arena, directory));} -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, i32 size){return(app->memory_allocate_(app, size));} -static b32 memory_set_protection(Application_Links *app, void *ptr, i32 size, Memory_Protect_Flags flags){return(app->memory_set_protection_(app, ptr, size, flags));} -static void memory_free(Application_Links *app, void *ptr, i32 size){(app->memory_free_(app, ptr, size));} -static String_Const_u8 push_4ed_path(Application_Links *app, Arena *arena){return(app->push_4ed_path_(app, arena));} -static void show_mouse_cursor(Application_Links *app, Mouse_Cursor_Show_Type show){(app->show_mouse_cursor_(app, show));} -static b32 set_edit_finished_hook_repeat_speed(Application_Links *app, u32 milliseconds){return(app->set_edit_finished_hook_repeat_speed_(app, milliseconds));} -static b32 set_fullscreen(Application_Links *app, b32 full_screen){return(app->set_fullscreen_(app, full_screen));} -static b32 is_fullscreen(Application_Links *app){return(app->is_fullscreen_(app));} -static void send_exit_signal(Application_Links *app){(app->send_exit_signal_(app));} -static b32 set_window_title(Application_Links *app, String_Const_u8 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 Vec2 draw_string(Application_Links *app, Face_ID font_id, String_Const_u8 str, Vec2 point, int_color color, u32 flags, Vec2 delta){return(app->draw_string_(app, font_id, str, point, color, flags, delta));} -static f32 get_string_advance(Application_Links *app, Face_ID font_id, String_Const_u8 str){return(app->get_string_advance_(app, font_id, str));} -static void draw_rectangle(Application_Links *app, Rect_f32 rect, int_color color){(app->draw_rectangle_(app, rect, color));} -static void draw_rectangle_outline(Application_Links *app, Rect_f32 rect, int_color color){(app->draw_rectangle_outline_(app, rect, color));} -static void draw_clip_push(Application_Links *app, Rect_f32 clip_box){(app->draw_clip_push_(app, clip_box));} -static f32_Rect draw_clip_pop(Application_Links *app){return(app->draw_clip_pop_(app));} -static void draw_coordinate_center_push(Application_Links *app, Vec2 point){(app->draw_coordinate_center_push_(app, point));} -static Vec2 draw_coordinate_center_pop(Application_Links *app){return(app->draw_coordinate_center_pop_(app));} -static Text_Layout_ID text_layout_create(Application_Links *app, Buffer_ID buffer_id, Rect_f32 rect, Buffer_Point buffer_point){return(app->text_layout_create_(app, buffer_id, rect, buffer_point));} -static b32 text_layout_get_buffer(Application_Links *app, Text_Layout_ID text_layout_id, Buffer_ID *buffer_id_out){return(app->text_layout_get_buffer_(app, text_layout_id, buffer_id_out));} -static Interval_i64 text_layout_get_visible_range(Application_Links *app, Text_Layout_ID text_layout_id){return(app->text_layout_get_visible_range_(app, text_layout_id));} -static Rect_f32 text_layout_line_on_screen(Application_Links *app, Text_Layout_ID layout_id, i64 line_number){return(app->text_layout_line_on_screen_(app, layout_id, line_number));} -static Rect_f32 text_layout_character_on_screen(Application_Links *app, Text_Layout_ID layout_id, i64 pos){return(app->text_layout_character_on_screen_(app, layout_id, pos));} -static void paint_text_color(Application_Links *app, Text_Layout_ID layout_id, Interval_i64 range, int_color color){(app->paint_text_color_(app, layout_id, range, color));} -static b32 text_layout_free(Application_Links *app, Text_Layout_ID text_layout_id){return(app->text_layout_free_(app, text_layout_id));} -static void draw_text_layout(Application_Links *app, Text_Layout_ID layout_id){(app->draw_text_layout_(app, layout_id));} -static void open_color_picker(Application_Links *app, Color_Picker *picker){(app->open_color_picker_(app, picker));} -static void animate_in_n_milliseconds(Application_Links *app, u32 n){(app->animate_in_n_milliseconds_(app, n));} -static String_Match_List buffer_find_all_matches(Application_Links *app, Arena *arena, Buffer_ID buffer, i32 string_id, Range_i64 range, String_Const_u8 needle, Character_Predicate *predicate, Scan_Direction direction){return(app->buffer_find_all_matches_(app, arena, buffer, string_id, range, needle, predicate, direction));} diff --git a/custom/generated/custom_api.cpp b/custom/generated/custom_api.cpp new file mode 100644 index 00000000..65801d7b --- /dev/null +++ b/custom/generated/custom_api.cpp @@ -0,0 +1,371 @@ +function void +custom_api_fill_vtable(API_VTable_custom *vtable){ +vtable->global_set_setting = global_set_setting; +vtable->global_set_mapping = global_set_mapping; +vtable->global_get_screen_rectangle = global_get_screen_rectangle; +vtable->get_thread_context = get_thread_context; +vtable->create_child_process = create_child_process; +vtable->child_process_set_target_buffer = child_process_set_target_buffer; +vtable->buffer_get_attached_child_process = buffer_get_attached_child_process; +vtable->child_process_get_attached_buffer = child_process_get_attached_buffer; +vtable->child_process_get_state = child_process_get_state; +vtable->clipboard_post = clipboard_post; +vtable->clipboard_count = clipboard_count; +vtable->push_clipboard_index = push_clipboard_index; +vtable->get_buffer_count = get_buffer_count; +vtable->get_buffer_next = get_buffer_next; +vtable->get_buffer_by_name = get_buffer_by_name; +vtable->get_buffer_by_file_name = get_buffer_by_file_name; +vtable->buffer_read_range = buffer_read_range; +vtable->buffer_replace_range = buffer_replace_range; +vtable->buffer_batch_edit = buffer_batch_edit; +vtable->buffer_seek_string = buffer_seek_string; +vtable->buffer_seek_character_class = buffer_seek_character_class; +vtable->buffer_line_y_difference = buffer_line_y_difference; +vtable->buffer_line_shift_y = buffer_line_shift_y; +vtable->buffer_pos_at_relative_xy = buffer_pos_at_relative_xy; +vtable->buffer_relative_xy_of_pos = buffer_relative_xy_of_pos; +vtable->buffer_relative_character_from_pos = buffer_relative_character_from_pos; +vtable->buffer_pos_from_relative_character = buffer_pos_from_relative_character; +vtable->view_line_y_difference = view_line_y_difference; +vtable->view_line_shift_y = view_line_shift_y; +vtable->view_pos_at_relative_xy = view_pos_at_relative_xy; +vtable->view_relative_xy_of_pos = view_relative_xy_of_pos; +vtable->view_relative_character_from_pos = view_relative_character_from_pos; +vtable->view_pos_from_relative_character = view_pos_from_relative_character; +vtable->buffer_exists = buffer_exists; +vtable->buffer_ready = buffer_ready; +vtable->buffer_get_access_flags = buffer_get_access_flags; +vtable->buffer_get_size = buffer_get_size; +vtable->buffer_get_line_count = buffer_get_line_count; +vtable->push_buffer_base_name = push_buffer_base_name; +vtable->push_buffer_unique_name = push_buffer_unique_name; +vtable->push_buffer_file_name = push_buffer_file_name; +vtable->buffer_get_dirty_state = buffer_get_dirty_state; +vtable->buffer_set_dirty_state = buffer_set_dirty_state; +vtable->buffer_get_setting = buffer_get_setting; +vtable->buffer_set_setting = buffer_set_setting; +vtable->buffer_get_managed_scope = buffer_get_managed_scope; +vtable->buffer_send_end_signal = buffer_send_end_signal; +vtable->create_buffer = create_buffer; +vtable->buffer_save = buffer_save; +vtable->buffer_kill = buffer_kill; +vtable->buffer_reopen = buffer_reopen; +vtable->buffer_get_file_attributes = buffer_get_file_attributes; +vtable->get_file_attributes = get_file_attributes; +vtable->get_view_next = get_view_next; +vtable->get_view_prev = get_view_prev; +vtable->get_active_view = get_active_view; +vtable->get_active_panel = get_active_panel; +vtable->view_exists = view_exists; +vtable->view_get_buffer = view_get_buffer; +vtable->view_get_cursor_pos = view_get_cursor_pos; +vtable->view_get_mark_pos = view_get_mark_pos; +vtable->view_get_preferred_x = view_get_preferred_x; +vtable->view_set_preferred_x = view_set_preferred_x; +vtable->view_get_screen_rect = view_get_screen_rect; +vtable->view_get_panel = view_get_panel; +vtable->panel_get_view = panel_get_view; +vtable->panel_is_split = panel_is_split; +vtable->panel_is_leaf = panel_is_leaf; +vtable->panel_split = panel_split; +vtable->panel_set_split = panel_set_split; +vtable->panel_swap_children = panel_swap_children; +vtable->panel_get_parent = panel_get_parent; +vtable->panel_get_child = panel_get_child; +vtable->panel_get_max = panel_get_max; +vtable->panel_get_margin = panel_get_margin; +vtable->view_close = view_close; +vtable->view_get_buffer_region = view_get_buffer_region; +vtable->view_get_buffer_scroll = view_get_buffer_scroll; +vtable->view_get_basic_scroll = view_get_basic_scroll; +vtable->view_set_active = view_set_active; +vtable->view_get_setting = view_get_setting; +vtable->view_set_setting = view_set_setting; +vtable->view_get_managed_scope = view_get_managed_scope; +vtable->buffer_compute_cursor = buffer_compute_cursor; +vtable->view_compute_cursor = view_compute_cursor; +vtable->view_set_cursor = view_set_cursor; +vtable->view_set_buffer_scroll = view_set_buffer_scroll; +vtable->view_set_basic_scroll = view_set_basic_scroll; +vtable->view_set_mark = view_set_mark; +vtable->view_set_buffer = view_set_buffer; +vtable->view_post_fade = view_post_fade; +vtable->view_begin_ui_mode = view_begin_ui_mode; +vtable->view_end_ui_mode = view_end_ui_mode; +vtable->view_is_in_ui_mode = view_is_in_ui_mode; +vtable->view_set_quit_ui_handler = view_set_quit_ui_handler; +vtable->view_get_quit_ui_handler = view_get_quit_ui_handler; +vtable->create_user_managed_scope = create_user_managed_scope; +vtable->destroy_user_managed_scope = destroy_user_managed_scope; +vtable->get_global_managed_scope = get_global_managed_scope; +vtable->get_managed_scope_with_multiple_dependencies = get_managed_scope_with_multiple_dependencies; +vtable->managed_scope_clear_contents = managed_scope_clear_contents; +vtable->managed_scope_clear_self_all_dependent_scopes = managed_scope_clear_self_all_dependent_scopes; +vtable->managed_scope_allocator = managed_scope_allocator; +vtable->managed_id_declare = managed_id_declare; +vtable->managed_scope_get_attachment = managed_scope_get_attachment; +vtable->managed_scope_attachment_erase = managed_scope_attachment_erase; +vtable->alloc_managed_memory_in_scope = alloc_managed_memory_in_scope; +vtable->alloc_buffer_markers_on_buffer = alloc_buffer_markers_on_buffer; +vtable->managed_object_get_item_size = managed_object_get_item_size; +vtable->managed_object_get_item_count = managed_object_get_item_count; +vtable->managed_object_get_pointer = managed_object_get_pointer; +vtable->managed_object_get_type = managed_object_get_type; +vtable->managed_object_get_containing_scope = managed_object_get_containing_scope; +vtable->managed_object_free = managed_object_free; +vtable->managed_object_store_data = managed_object_store_data; +vtable->managed_object_load_data = managed_object_load_data; +vtable->get_user_input = get_user_input; +vtable->get_command_input = get_command_input; +vtable->set_command_input = set_command_input; +vtable->get_mouse_state = get_mouse_state; +vtable->get_active_query_bars = get_active_query_bars; +vtable->start_query_bar = start_query_bar; +vtable->end_query_bar = end_query_bar; +vtable->print_message = print_message; +vtable->log_string = log_string; +vtable->thread_get_id = thread_get_id; +vtable->get_largest_face_id = get_largest_face_id; +vtable->set_global_face = set_global_face; +vtable->buffer_history_get_max_record_index = buffer_history_get_max_record_index; +vtable->buffer_history_get_record_info = buffer_history_get_record_info; +vtable->buffer_history_get_group_sub_record = buffer_history_get_group_sub_record; +vtable->buffer_history_get_current_state_index = buffer_history_get_current_state_index; +vtable->buffer_history_set_current_state_index = buffer_history_set_current_state_index; +vtable->buffer_history_merge_record_range = buffer_history_merge_record_range; +vtable->buffer_history_clear_after_current_state = buffer_history_clear_after_current_state; +vtable->global_history_edit_group_begin = global_history_edit_group_begin; +vtable->global_history_edit_group_end = global_history_edit_group_end; +vtable->buffer_set_face = buffer_set_face; +vtable->get_face_description = get_face_description; +vtable->get_face_metrics = get_face_metrics; +vtable->get_face_id = get_face_id; +vtable->try_create_new_face = try_create_new_face; +vtable->try_modify_face = try_modify_face; +vtable->try_release_face = try_release_face; +vtable->set_theme_colors = set_theme_colors; +vtable->get_theme_colors = get_theme_colors; +vtable->finalize_color = finalize_color; +vtable->push_hot_directory = push_hot_directory; +vtable->set_hot_directory = set_hot_directory; +vtable->get_file_list = get_file_list; +vtable->set_gui_up_down_keys = set_gui_up_down_keys; +vtable->memory_allocate = memory_allocate; +vtable->memory_set_protection = memory_set_protection; +vtable->memory_free = memory_free; +vtable->push_4ed_path = push_4ed_path; +vtable->show_mouse_cursor = show_mouse_cursor; +vtable->set_edit_finished_hook_repeat_speed = set_edit_finished_hook_repeat_speed; +vtable->set_fullscreen = set_fullscreen; +vtable->is_fullscreen = is_fullscreen; +vtable->send_exit_signal = send_exit_signal; +vtable->set_window_title = set_window_title; +vtable->get_microseconds_timestamp = get_microseconds_timestamp; +vtable->draw_string_oriented = draw_string_oriented; +vtable->get_string_advance = get_string_advance; +vtable->draw_rectangle = draw_rectangle; +vtable->draw_rectangle_outline = draw_rectangle_outline; +vtable->draw_clip_push = draw_clip_push; +vtable->draw_clip_pop = draw_clip_pop; +vtable->draw_coordinate_center_push = draw_coordinate_center_push; +vtable->draw_coordinate_center_pop = draw_coordinate_center_pop; +vtable->text_layout_create = text_layout_create; +vtable->text_layout_get_buffer = text_layout_get_buffer; +vtable->text_layout_get_visible_range = text_layout_get_visible_range; +vtable->text_layout_line_on_screen = text_layout_line_on_screen; +vtable->text_layout_character_on_screen = text_layout_character_on_screen; +vtable->paint_text_color = paint_text_color; +vtable->text_layout_free = text_layout_free; +vtable->draw_text_layout = draw_text_layout; +vtable->open_color_picker = open_color_picker; +vtable->animate_in_n_milliseconds = animate_in_n_milliseconds; +vtable->buffer_find_all_matches = buffer_find_all_matches; +} +#if defined(DYNAMIC_LINK_API) +function void +custom_api_read_vtable(API_VTable_custom *vtable){ +global_set_setting = vtable->global_set_setting; +global_set_mapping = vtable->global_set_mapping; +global_get_screen_rectangle = vtable->global_get_screen_rectangle; +get_thread_context = vtable->get_thread_context; +create_child_process = vtable->create_child_process; +child_process_set_target_buffer = vtable->child_process_set_target_buffer; +buffer_get_attached_child_process = vtable->buffer_get_attached_child_process; +child_process_get_attached_buffer = vtable->child_process_get_attached_buffer; +child_process_get_state = vtable->child_process_get_state; +clipboard_post = vtable->clipboard_post; +clipboard_count = vtable->clipboard_count; +push_clipboard_index = vtable->push_clipboard_index; +get_buffer_count = vtable->get_buffer_count; +get_buffer_next = vtable->get_buffer_next; +get_buffer_by_name = vtable->get_buffer_by_name; +get_buffer_by_file_name = vtable->get_buffer_by_file_name; +buffer_read_range = vtable->buffer_read_range; +buffer_replace_range = vtable->buffer_replace_range; +buffer_batch_edit = vtable->buffer_batch_edit; +buffer_seek_string = vtable->buffer_seek_string; +buffer_seek_character_class = vtable->buffer_seek_character_class; +buffer_line_y_difference = vtable->buffer_line_y_difference; +buffer_line_shift_y = vtable->buffer_line_shift_y; +buffer_pos_at_relative_xy = vtable->buffer_pos_at_relative_xy; +buffer_relative_xy_of_pos = vtable->buffer_relative_xy_of_pos; +buffer_relative_character_from_pos = vtable->buffer_relative_character_from_pos; +buffer_pos_from_relative_character = vtable->buffer_pos_from_relative_character; +view_line_y_difference = vtable->view_line_y_difference; +view_line_shift_y = vtable->view_line_shift_y; +view_pos_at_relative_xy = vtable->view_pos_at_relative_xy; +view_relative_xy_of_pos = vtable->view_relative_xy_of_pos; +view_relative_character_from_pos = vtable->view_relative_character_from_pos; +view_pos_from_relative_character = vtable->view_pos_from_relative_character; +buffer_exists = vtable->buffer_exists; +buffer_ready = vtable->buffer_ready; +buffer_get_access_flags = vtable->buffer_get_access_flags; +buffer_get_size = vtable->buffer_get_size; +buffer_get_line_count = vtable->buffer_get_line_count; +push_buffer_base_name = vtable->push_buffer_base_name; +push_buffer_unique_name = vtable->push_buffer_unique_name; +push_buffer_file_name = vtable->push_buffer_file_name; +buffer_get_dirty_state = vtable->buffer_get_dirty_state; +buffer_set_dirty_state = vtable->buffer_set_dirty_state; +buffer_get_setting = vtable->buffer_get_setting; +buffer_set_setting = vtable->buffer_set_setting; +buffer_get_managed_scope = vtable->buffer_get_managed_scope; +buffer_send_end_signal = vtable->buffer_send_end_signal; +create_buffer = vtable->create_buffer; +buffer_save = vtable->buffer_save; +buffer_kill = vtable->buffer_kill; +buffer_reopen = vtable->buffer_reopen; +buffer_get_file_attributes = vtable->buffer_get_file_attributes; +get_file_attributes = vtable->get_file_attributes; +get_view_next = vtable->get_view_next; +get_view_prev = vtable->get_view_prev; +get_active_view = vtable->get_active_view; +get_active_panel = vtable->get_active_panel; +view_exists = vtable->view_exists; +view_get_buffer = vtable->view_get_buffer; +view_get_cursor_pos = vtable->view_get_cursor_pos; +view_get_mark_pos = vtable->view_get_mark_pos; +view_get_preferred_x = vtable->view_get_preferred_x; +view_set_preferred_x = vtable->view_set_preferred_x; +view_get_screen_rect = vtable->view_get_screen_rect; +view_get_panel = vtable->view_get_panel; +panel_get_view = vtable->panel_get_view; +panel_is_split = vtable->panel_is_split; +panel_is_leaf = vtable->panel_is_leaf; +panel_split = vtable->panel_split; +panel_set_split = vtable->panel_set_split; +panel_swap_children = vtable->panel_swap_children; +panel_get_parent = vtable->panel_get_parent; +panel_get_child = vtable->panel_get_child; +panel_get_max = vtable->panel_get_max; +panel_get_margin = vtable->panel_get_margin; +view_close = vtable->view_close; +view_get_buffer_region = vtable->view_get_buffer_region; +view_get_buffer_scroll = vtable->view_get_buffer_scroll; +view_get_basic_scroll = vtable->view_get_basic_scroll; +view_set_active = vtable->view_set_active; +view_get_setting = vtable->view_get_setting; +view_set_setting = vtable->view_set_setting; +view_get_managed_scope = vtable->view_get_managed_scope; +buffer_compute_cursor = vtable->buffer_compute_cursor; +view_compute_cursor = vtable->view_compute_cursor; +view_set_cursor = vtable->view_set_cursor; +view_set_buffer_scroll = vtable->view_set_buffer_scroll; +view_set_basic_scroll = vtable->view_set_basic_scroll; +view_set_mark = vtable->view_set_mark; +view_set_buffer = vtable->view_set_buffer; +view_post_fade = vtable->view_post_fade; +view_begin_ui_mode = vtable->view_begin_ui_mode; +view_end_ui_mode = vtable->view_end_ui_mode; +view_is_in_ui_mode = vtable->view_is_in_ui_mode; +view_set_quit_ui_handler = vtable->view_set_quit_ui_handler; +view_get_quit_ui_handler = vtable->view_get_quit_ui_handler; +create_user_managed_scope = vtable->create_user_managed_scope; +destroy_user_managed_scope = vtable->destroy_user_managed_scope; +get_global_managed_scope = vtable->get_global_managed_scope; +get_managed_scope_with_multiple_dependencies = vtable->get_managed_scope_with_multiple_dependencies; +managed_scope_clear_contents = vtable->managed_scope_clear_contents; +managed_scope_clear_self_all_dependent_scopes = vtable->managed_scope_clear_self_all_dependent_scopes; +managed_scope_allocator = vtable->managed_scope_allocator; +managed_id_declare = vtable->managed_id_declare; +managed_scope_get_attachment = vtable->managed_scope_get_attachment; +managed_scope_attachment_erase = vtable->managed_scope_attachment_erase; +alloc_managed_memory_in_scope = vtable->alloc_managed_memory_in_scope; +alloc_buffer_markers_on_buffer = vtable->alloc_buffer_markers_on_buffer; +managed_object_get_item_size = vtable->managed_object_get_item_size; +managed_object_get_item_count = vtable->managed_object_get_item_count; +managed_object_get_pointer = vtable->managed_object_get_pointer; +managed_object_get_type = vtable->managed_object_get_type; +managed_object_get_containing_scope = vtable->managed_object_get_containing_scope; +managed_object_free = vtable->managed_object_free; +managed_object_store_data = vtable->managed_object_store_data; +managed_object_load_data = vtable->managed_object_load_data; +get_user_input = vtable->get_user_input; +get_command_input = vtable->get_command_input; +set_command_input = vtable->set_command_input; +get_mouse_state = vtable->get_mouse_state; +get_active_query_bars = vtable->get_active_query_bars; +start_query_bar = vtable->start_query_bar; +end_query_bar = vtable->end_query_bar; +print_message = vtable->print_message; +log_string = vtable->log_string; +thread_get_id = vtable->thread_get_id; +get_largest_face_id = vtable->get_largest_face_id; +set_global_face = vtable->set_global_face; +buffer_history_get_max_record_index = vtable->buffer_history_get_max_record_index; +buffer_history_get_record_info = vtable->buffer_history_get_record_info; +buffer_history_get_group_sub_record = vtable->buffer_history_get_group_sub_record; +buffer_history_get_current_state_index = vtable->buffer_history_get_current_state_index; +buffer_history_set_current_state_index = vtable->buffer_history_set_current_state_index; +buffer_history_merge_record_range = vtable->buffer_history_merge_record_range; +buffer_history_clear_after_current_state = vtable->buffer_history_clear_after_current_state; +global_history_edit_group_begin = vtable->global_history_edit_group_begin; +global_history_edit_group_end = vtable->global_history_edit_group_end; +buffer_set_face = vtable->buffer_set_face; +get_face_description = vtable->get_face_description; +get_face_metrics = vtable->get_face_metrics; +get_face_id = vtable->get_face_id; +try_create_new_face = vtable->try_create_new_face; +try_modify_face = vtable->try_modify_face; +try_release_face = vtable->try_release_face; +set_theme_colors = vtable->set_theme_colors; +get_theme_colors = vtable->get_theme_colors; +finalize_color = vtable->finalize_color; +push_hot_directory = vtable->push_hot_directory; +set_hot_directory = vtable->set_hot_directory; +get_file_list = vtable->get_file_list; +set_gui_up_down_keys = vtable->set_gui_up_down_keys; +memory_allocate = vtable->memory_allocate; +memory_set_protection = vtable->memory_set_protection; +memory_free = vtable->memory_free; +push_4ed_path = vtable->push_4ed_path; +show_mouse_cursor = vtable->show_mouse_cursor; +set_edit_finished_hook_repeat_speed = vtable->set_edit_finished_hook_repeat_speed; +set_fullscreen = vtable->set_fullscreen; +is_fullscreen = vtable->is_fullscreen; +send_exit_signal = vtable->send_exit_signal; +set_window_title = vtable->set_window_title; +get_microseconds_timestamp = vtable->get_microseconds_timestamp; +draw_string_oriented = vtable->draw_string_oriented; +get_string_advance = vtable->get_string_advance; +draw_rectangle = vtable->draw_rectangle; +draw_rectangle_outline = vtable->draw_rectangle_outline; +draw_clip_push = vtable->draw_clip_push; +draw_clip_pop = vtable->draw_clip_pop; +draw_coordinate_center_push = vtable->draw_coordinate_center_push; +draw_coordinate_center_pop = vtable->draw_coordinate_center_pop; +text_layout_create = vtable->text_layout_create; +text_layout_get_buffer = vtable->text_layout_get_buffer; +text_layout_get_visible_range = vtable->text_layout_get_visible_range; +text_layout_line_on_screen = vtable->text_layout_line_on_screen; +text_layout_character_on_screen = vtable->text_layout_character_on_screen; +paint_text_color = vtable->paint_text_color; +text_layout_free = vtable->text_layout_free; +draw_text_layout = vtable->draw_text_layout; +open_color_picker = vtable->open_color_picker; +animate_in_n_milliseconds = vtable->animate_in_n_milliseconds; +buffer_find_all_matches = vtable->buffer_find_all_matches; +} +#undef DYNAMIC_LINK_API +#endif diff --git a/custom/generated/custom_api.h b/custom/generated/custom_api.h new file mode 100644 index 00000000..4cd68ebc --- /dev/null +++ b/custom/generated/custom_api.h @@ -0,0 +1,912 @@ +#define custom_global_set_setting_sig() b32 custom_global_set_setting(Application_Links* app, Global_Setting_ID setting, i32 value) +#define custom_global_set_mapping_sig() b32 custom_global_set_mapping(Application_Links* app, void* data, i32 size) +#define custom_global_get_screen_rectangle_sig() Rect_f32 custom_global_get_screen_rectangle(Application_Links* app) +#define custom_get_thread_context_sig() Thread_Context* custom_get_thread_context(Application_Links* app) +#define custom_create_child_process_sig() b32 custom_create_child_process(Application_Links* app, String_Const_u8 path, String_Const_u8 command, Child_Process_ID* child_process_id_out) +#define custom_child_process_set_target_buffer_sig() b32 custom_child_process_set_target_buffer(Application_Links* app, Child_Process_ID child_process_id, Buffer_ID buffer_id, Child_Process_Set_Target_Flags flags) +#define custom_buffer_get_attached_child_process_sig() Child_Process_ID custom_buffer_get_attached_child_process(Application_Links* app, Buffer_ID buffer_id) +#define custom_child_process_get_attached_buffer_sig() Buffer_ID custom_child_process_get_attached_buffer(Application_Links* app, Child_Process_ID child_process_id) +#define custom_child_process_get_state_sig() Process_State custom_child_process_get_state(Application_Links* app, Child_Process_ID child_process_id) +#define custom_clipboard_post_sig() b32 custom_clipboard_post(Application_Links* app, i32 clipboard_id, String_Const_u8 string) +#define custom_clipboard_count_sig() i32 custom_clipboard_count(Application_Links* app, i32 clipboard_id) +#define custom_push_clipboard_index_sig() String_Const_u8 custom_push_clipboard_index(Application_Links* app, Arena* arena, i32 clipboard_id, i32 item_index) +#define custom_get_buffer_count_sig() i32 custom_get_buffer_count(Application_Links* app) +#define custom_get_buffer_next_sig() Buffer_ID custom_get_buffer_next(Application_Links* app, Buffer_ID buffer_id, Access_Flag access) +#define custom_get_buffer_by_name_sig() Buffer_ID custom_get_buffer_by_name(Application_Links* app, String_Const_u8 name, Access_Flag access) +#define custom_get_buffer_by_file_name_sig() Buffer_ID custom_get_buffer_by_file_name(Application_Links* app, String_Const_u8 file_name, Access_Flag access) +#define custom_buffer_read_range_sig() b32 custom_buffer_read_range(Application_Links* app, Buffer_ID buffer_id, Range_i64 range, char* out) +#define custom_buffer_replace_range_sig() b32 custom_buffer_replace_range(Application_Links* app, Buffer_ID buffer_id, Range_i64 range, String_Const_u8 string) +#define custom_buffer_batch_edit_sig() b32 custom_buffer_batch_edit(Application_Links* app, Buffer_ID buffer_id, Batch_Edit* batch) +#define custom_buffer_seek_string_sig() String_Match custom_buffer_seek_string(Application_Links* app, Buffer_ID buffer, String_Const_u8 needle, Scan_Direction direction, i64 start_pos) +#define custom_buffer_seek_character_class_sig() String_Match custom_buffer_seek_character_class(Application_Links* app, Buffer_ID buffer, Character_Predicate* predicate, Scan_Direction direction, i64 start_pos) +#define custom_buffer_line_y_difference_sig() f32 custom_buffer_line_y_difference(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 line_a, i64 line_b) +#define custom_buffer_line_shift_y_sig() Line_Shift_Vertical custom_buffer_line_shift_y(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 line, f32 y_shift) +#define custom_buffer_pos_at_relative_xy_sig() i64 custom_buffer_pos_at_relative_xy(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, Vec2_f32 relative_xy) +#define custom_buffer_relative_xy_of_pos_sig() Vec2_f32 custom_buffer_relative_xy_of_pos(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 pos) +#define custom_buffer_relative_character_from_pos_sig() i64 custom_buffer_relative_character_from_pos(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 pos) +#define custom_buffer_pos_from_relative_character_sig() i64 custom_buffer_pos_from_relative_character(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 relative_character) +#define custom_view_line_y_difference_sig() f32 custom_view_line_y_difference(Application_Links* app, View_ID view_id, i64 line_a, i64 line_b) +#define custom_view_line_shift_y_sig() Line_Shift_Vertical custom_view_line_shift_y(Application_Links* app, View_ID view_id, i64 line, f32 y_shift) +#define custom_view_pos_at_relative_xy_sig() i64 custom_view_pos_at_relative_xy(Application_Links* app, View_ID view_id, i64 base_line, Vec2_f32 relative_xy) +#define custom_view_relative_xy_of_pos_sig() Vec2_f32 custom_view_relative_xy_of_pos(Application_Links* app, View_ID view_id, i64 base_line, i64 pos) +#define custom_view_relative_character_from_pos_sig() i64 custom_view_relative_character_from_pos(Application_Links* app, View_ID view_id, i64 base_line, i64 pos) +#define custom_view_pos_from_relative_character_sig() i64 custom_view_pos_from_relative_character(Application_Links* app, View_ID view_id, i64 base_line, i64 character) +#define custom_buffer_exists_sig() b32 custom_buffer_exists(Application_Links* app, Buffer_ID buffer_id) +#define custom_buffer_ready_sig() b32 custom_buffer_ready(Application_Links* app, Buffer_ID buffer_id) +#define custom_buffer_get_access_flags_sig() Access_Flag custom_buffer_get_access_flags(Application_Links* app, Buffer_ID buffer_id) +#define custom_buffer_get_size_sig() i64 custom_buffer_get_size(Application_Links* app, Buffer_ID buffer_id) +#define custom_buffer_get_line_count_sig() i64 custom_buffer_get_line_count(Application_Links* app, Buffer_ID buffer_id) +#define custom_push_buffer_base_name_sig() String_Const_u8 custom_push_buffer_base_name(Application_Links* app, Arena* arena, Buffer_ID buffer_id) +#define custom_push_buffer_unique_name_sig() String_Const_u8 custom_push_buffer_unique_name(Application_Links* app, Arena* out, Buffer_ID buffer_id) +#define custom_push_buffer_file_name_sig() String_Const_u8 custom_push_buffer_file_name(Application_Links* app, Arena* arena, Buffer_ID buffer_id) +#define custom_buffer_get_dirty_state_sig() Dirty_State custom_buffer_get_dirty_state(Application_Links* app, Buffer_ID buffer_id) +#define custom_buffer_set_dirty_state_sig() b32 custom_buffer_set_dirty_state(Application_Links* app, Buffer_ID buffer_id, Dirty_State dirty_state) +#define custom_buffer_get_setting_sig() b32 custom_buffer_get_setting(Application_Links* app, Buffer_ID buffer_id, Buffer_Setting_ID setting, i32* value_out) +#define custom_buffer_set_setting_sig() b32 custom_buffer_set_setting(Application_Links* app, Buffer_ID buffer_id, Buffer_Setting_ID setting, i32 value) +#define custom_buffer_get_managed_scope_sig() Managed_Scope custom_buffer_get_managed_scope(Application_Links* app, Buffer_ID buffer_id) +#define custom_buffer_send_end_signal_sig() b32 custom_buffer_send_end_signal(Application_Links* app, Buffer_ID buffer_id) +#define custom_create_buffer_sig() Buffer_ID custom_create_buffer(Application_Links* app, String_Const_u8 file_name, Buffer_Create_Flag flags) +#define custom_buffer_save_sig() b32 custom_buffer_save(Application_Links* app, Buffer_ID buffer_id, String_Const_u8 file_name, Buffer_Save_Flag flags) +#define custom_buffer_kill_sig() Buffer_Kill_Result custom_buffer_kill(Application_Links* app, Buffer_ID buffer_id, Buffer_Kill_Flag flags) +#define custom_buffer_reopen_sig() Buffer_Reopen_Result custom_buffer_reopen(Application_Links* app, Buffer_ID buffer_id, Buffer_Reopen_Flag flags) +#define custom_buffer_get_file_attributes_sig() File_Attributes custom_buffer_get_file_attributes(Application_Links* app, Buffer_ID buffer_id) +#define custom_get_file_attributes_sig() File_Attributes custom_get_file_attributes(Application_Links* app, String_Const_u8 file_name) +#define custom_get_view_next_sig() View_ID custom_get_view_next(Application_Links* app, View_ID view_id, Access_Flag access) +#define custom_get_view_prev_sig() View_ID custom_get_view_prev(Application_Links* app, View_ID view_id, Access_Flag access) +#define custom_get_active_view_sig() View_ID custom_get_active_view(Application_Links* app, Access_Flag access) +#define custom_get_active_panel_sig() Panel_ID custom_get_active_panel(Application_Links* app) +#define custom_view_exists_sig() b32 custom_view_exists(Application_Links* app, View_ID view_id) +#define custom_view_get_buffer_sig() Buffer_ID custom_view_get_buffer(Application_Links* app, View_ID view_id, Access_Flag access) +#define custom_view_get_cursor_pos_sig() i64 custom_view_get_cursor_pos(Application_Links* app, View_ID view_id) +#define custom_view_get_mark_pos_sig() i64 custom_view_get_mark_pos(Application_Links* app, View_ID view_id) +#define custom_view_get_preferred_x_sig() f32 custom_view_get_preferred_x(Application_Links* app, View_ID view_id) +#define custom_view_set_preferred_x_sig() b32 custom_view_set_preferred_x(Application_Links* app, View_ID view_id, f32 x) +#define custom_view_get_screen_rect_sig() Rect_f32 custom_view_get_screen_rect(Application_Links* app, View_ID view_id) +#define custom_view_get_panel_sig() Panel_ID custom_view_get_panel(Application_Links* app, View_ID view_id) +#define custom_panel_get_view_sig() View_ID custom_panel_get_view(Application_Links* app, Panel_ID panel_id) +#define custom_panel_is_split_sig() b32 custom_panel_is_split(Application_Links* app, Panel_ID panel_id) +#define custom_panel_is_leaf_sig() b32 custom_panel_is_leaf(Application_Links* app, Panel_ID panel_id) +#define custom_panel_split_sig() b32 custom_panel_split(Application_Links* app, Panel_ID panel_id, Panel_Split_Orientation orientation) +#define custom_panel_set_split_sig() b32 custom_panel_set_split(Application_Links* app, Panel_ID panel_id, Panel_Split_Kind kind, float t) +#define custom_panel_swap_children_sig() b32 custom_panel_swap_children(Application_Links* app, Panel_ID panel_id, Panel_Split_Kind kind, float t) +#define custom_panel_get_parent_sig() Panel_ID custom_panel_get_parent(Application_Links* app, Panel_ID panel_id) +#define custom_panel_get_child_sig() Panel_ID custom_panel_get_child(Application_Links* app, Panel_ID panel_id, Panel_Child which_child) +#define custom_panel_get_max_sig() Panel_ID custom_panel_get_max(Application_Links* app, Panel_ID panel_id) +#define custom_panel_get_margin_sig() Rect_i32 custom_panel_get_margin(Application_Links* app, Panel_ID panel_id) +#define custom_view_close_sig() b32 custom_view_close(Application_Links* app, View_ID view_id) +#define custom_view_get_buffer_region_sig() Rect_f32 custom_view_get_buffer_region(Application_Links* app, View_ID view_id) +#define custom_view_get_buffer_scroll_sig() Buffer_Scroll custom_view_get_buffer_scroll(Application_Links* app, View_ID view_id) +#define custom_view_get_basic_scroll_sig() Basic_Scroll custom_view_get_basic_scroll(Application_Links* app, View_ID view_id) +#define custom_view_set_active_sig() b32 custom_view_set_active(Application_Links* app, View_ID view_id) +#define custom_view_get_setting_sig() b32 custom_view_get_setting(Application_Links* app, View_ID view_id, View_Setting_ID setting, i32* value_out) +#define custom_view_set_setting_sig() b32 custom_view_set_setting(Application_Links* app, View_ID view_id, View_Setting_ID setting, i32 value) +#define custom_view_get_managed_scope_sig() Managed_Scope custom_view_get_managed_scope(Application_Links* app, View_ID view_id) +#define custom_buffer_compute_cursor_sig() Buffer_Cursor custom_buffer_compute_cursor(Application_Links* app, Buffer_ID buffer, Buffer_Seek seek) +#define custom_view_compute_cursor_sig() Buffer_Cursor custom_view_compute_cursor(Application_Links* app, View_ID view_id, Buffer_Seek seek) +#define custom_view_set_cursor_sig() b32 custom_view_set_cursor(Application_Links* app, View_ID view_id, Buffer_Seek seek) +#define custom_view_set_buffer_scroll_sig() b32 custom_view_set_buffer_scroll(Application_Links* app, View_ID view_id, Buffer_Scroll scroll) +#define custom_view_set_basic_scroll_sig() b32 custom_view_set_basic_scroll(Application_Links* app, View_ID view_id, Basic_Scroll scroll) +#define custom_view_set_mark_sig() b32 custom_view_set_mark(Application_Links* app, View_ID view_id, Buffer_Seek seek) +#define custom_view_set_buffer_sig() b32 custom_view_set_buffer(Application_Links* app, View_ID view_id, Buffer_ID buffer_id, Set_Buffer_Flag flags) +#define custom_view_post_fade_sig() b32 custom_view_post_fade(Application_Links* app, View_ID view_id, f32 seconds, Range_i64 range, int_color color) +#define custom_view_begin_ui_mode_sig() b32 custom_view_begin_ui_mode(Application_Links* app, View_ID view_id) +#define custom_view_end_ui_mode_sig() b32 custom_view_end_ui_mode(Application_Links* app, View_ID view_id) +#define custom_view_is_in_ui_mode_sig() b32 custom_view_is_in_ui_mode(Application_Links* app, View_ID view_id) +#define custom_view_set_quit_ui_handler_sig() b32 custom_view_set_quit_ui_handler(Application_Links* app, View_ID view_id, UI_Quit_Function_Type* quit_function) +#define custom_view_get_quit_ui_handler_sig() b32 custom_view_get_quit_ui_handler(Application_Links* app, View_ID view_id, UI_Quit_Function_Type** quit_function_out) +#define custom_create_user_managed_scope_sig() Managed_Scope custom_create_user_managed_scope(Application_Links* app) +#define custom_destroy_user_managed_scope_sig() b32 custom_destroy_user_managed_scope(Application_Links* app, Managed_Scope scope) +#define custom_get_global_managed_scope_sig() Managed_Scope custom_get_global_managed_scope(Application_Links* app) +#define custom_get_managed_scope_with_multiple_dependencies_sig() Managed_Scope custom_get_managed_scope_with_multiple_dependencies(Application_Links* app, Managed_Scope* scopes, i32 count) +#define custom_managed_scope_clear_contents_sig() b32 custom_managed_scope_clear_contents(Application_Links* app, Managed_Scope scope) +#define custom_managed_scope_clear_self_all_dependent_scopes_sig() b32 custom_managed_scope_clear_self_all_dependent_scopes(Application_Links* app, Managed_Scope scope) +#define custom_managed_scope_allocator_sig() Base_Allocator* custom_managed_scope_allocator(Application_Links* app, Managed_Scope scope) +#define custom_managed_id_declare_sig() Managed_ID custom_managed_id_declare(Application_Links* app, String_Const_u8 name) +#define custom_managed_scope_get_attachment_sig() void* custom_managed_scope_get_attachment(Application_Links* app, Managed_Scope scope, Managed_ID id, umem size) +#define custom_managed_scope_attachment_erase_sig() void* custom_managed_scope_attachment_erase(Application_Links* app, Managed_Scope scope, Managed_ID id) +#define custom_alloc_managed_memory_in_scope_sig() Managed_Object custom_alloc_managed_memory_in_scope(Application_Links* app, Managed_Scope scope, i32 item_size, i32 count) +#define custom_alloc_buffer_markers_on_buffer_sig() Managed_Object custom_alloc_buffer_markers_on_buffer(Application_Links* app, Buffer_ID buffer_id, i32 count, Managed_Scope* optional_extra_scope) +#define custom_managed_object_get_item_size_sig() u32 custom_managed_object_get_item_size(Application_Links* app, Managed_Object object) +#define custom_managed_object_get_item_count_sig() u32 custom_managed_object_get_item_count(Application_Links* app, Managed_Object object) +#define custom_managed_object_get_pointer_sig() void* custom_managed_object_get_pointer(Application_Links* app, Managed_Object object) +#define custom_managed_object_get_type_sig() Managed_Object_Type custom_managed_object_get_type(Application_Links* app, Managed_Object object) +#define custom_managed_object_get_containing_scope_sig() Managed_Scope custom_managed_object_get_containing_scope(Application_Links* app, Managed_Object object) +#define custom_managed_object_free_sig() b32 custom_managed_object_free(Application_Links* app, Managed_Object object) +#define custom_managed_object_store_data_sig() b32 custom_managed_object_store_data(Application_Links* app, Managed_Object object, u32 first_index, u32 count, void* mem) +#define custom_managed_object_load_data_sig() b32 custom_managed_object_load_data(Application_Links* app, Managed_Object object, u32 first_index, u32 count, void* mem_out) +#define custom_get_user_input_sig() User_Input custom_get_user_input(Application_Links* app, Input_Type_Flag get_type, Input_Type_Flag abort_type) +#define custom_get_command_input_sig() User_Input custom_get_command_input(Application_Links* app) +#define custom_set_command_input_sig() void custom_set_command_input(Application_Links* app, Key_Event_Data key_data) +#define custom_get_mouse_state_sig() Mouse_State custom_get_mouse_state(Application_Links* app) +#define custom_get_active_query_bars_sig() b32 custom_get_active_query_bars(Application_Links* app, View_ID view_id, i32 max_result_count, Query_Bar_Ptr_Array* array_out) +#define custom_start_query_bar_sig() b32 custom_start_query_bar(Application_Links* app, Query_Bar* bar, u32 flags) +#define custom_end_query_bar_sig() void custom_end_query_bar(Application_Links* app, Query_Bar* bar, u32 flags) +#define custom_print_message_sig() b32 custom_print_message(Application_Links* app, String_Const_u8 message) +#define custom_log_string_sig() b32 custom_log_string(Application_Links* app, String_Const_u8 str) +#define custom_thread_get_id_sig() i32 custom_thread_get_id(Application_Links* app) +#define custom_get_largest_face_id_sig() Face_ID custom_get_largest_face_id(Application_Links* app) +#define custom_set_global_face_sig() b32 custom_set_global_face(Application_Links* app, Face_ID id, b32 apply_to_all_buffers) +#define custom_buffer_history_get_max_record_index_sig() History_Record_Index custom_buffer_history_get_max_record_index(Application_Links* app, Buffer_ID buffer_id) +#define custom_buffer_history_get_record_info_sig() Record_Info custom_buffer_history_get_record_info(Application_Links* app, Buffer_ID buffer_id, History_Record_Index index) +#define custom_buffer_history_get_group_sub_record_sig() Record_Info custom_buffer_history_get_group_sub_record(Application_Links* app, Buffer_ID buffer_id, History_Record_Index index, i32 sub_index) +#define custom_buffer_history_get_current_state_index_sig() History_Record_Index custom_buffer_history_get_current_state_index(Application_Links* app, Buffer_ID buffer_id) +#define custom_buffer_history_set_current_state_index_sig() b32 custom_buffer_history_set_current_state_index(Application_Links* app, Buffer_ID buffer_id, History_Record_Index index) +#define custom_buffer_history_merge_record_range_sig() b32 custom_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) +#define custom_buffer_history_clear_after_current_state_sig() b32 custom_buffer_history_clear_after_current_state(Application_Links* app, Buffer_ID buffer_id) +#define custom_global_history_edit_group_begin_sig() void custom_global_history_edit_group_begin(Application_Links* app) +#define custom_global_history_edit_group_end_sig() void custom_global_history_edit_group_end(Application_Links* app) +#define custom_buffer_set_face_sig() b32 custom_buffer_set_face(Application_Links* app, Buffer_ID buffer_id, Face_ID id) +#define custom_get_face_description_sig() Face_Description custom_get_face_description(Application_Links* app, Face_ID face_id) +#define custom_get_face_metrics_sig() Face_Metrics custom_get_face_metrics(Application_Links* app, Face_ID face_id) +#define custom_get_face_id_sig() Face_ID custom_get_face_id(Application_Links* app, Buffer_ID buffer_id) +#define custom_try_create_new_face_sig() Face_ID custom_try_create_new_face(Application_Links* app, Face_Description* description) +#define custom_try_modify_face_sig() b32 custom_try_modify_face(Application_Links* app, Face_ID id, Face_Description* description) +#define custom_try_release_face_sig() b32 custom_try_release_face(Application_Links* app, Face_ID id, Face_ID replacement_id) +#define custom_set_theme_colors_sig() void custom_set_theme_colors(Application_Links* app, Theme_Color* colors, i32 count) +#define custom_get_theme_colors_sig() void custom_get_theme_colors(Application_Links* app, Theme_Color* colors, i32 count) +#define custom_finalize_color_sig() argb_color custom_finalize_color(Application_Links* app, int_color color) +#define custom_push_hot_directory_sig() String_Const_u8 custom_push_hot_directory(Application_Links* app, Arena* arena) +#define custom_set_hot_directory_sig() b32 custom_set_hot_directory(Application_Links* app, String_Const_u8 string) +#define custom_get_file_list_sig() File_List custom_get_file_list(Application_Links* app, Arena* arena, String_Const_u8 directory) +#define custom_set_gui_up_down_keys_sig() void custom_set_gui_up_down_keys(Application_Links* app, Key_Code up_key, Key_Modifier up_key_modifier, Key_Code down_key, Key_Modifier down_key_modifier) +#define custom_memory_allocate_sig() void* custom_memory_allocate(Application_Links* app, i32 size) +#define custom_memory_set_protection_sig() b32 custom_memory_set_protection(Application_Links* app, void* ptr, i32 size, Memory_Protect_Flags flags) +#define custom_memory_free_sig() void custom_memory_free(Application_Links* app, void* ptr, i32 size) +#define custom_push_4ed_path_sig() String_Const_u8 custom_push_4ed_path(Application_Links* app, Arena* arena) +#define custom_show_mouse_cursor_sig() void custom_show_mouse_cursor(Application_Links* app, Mouse_Cursor_Show_Type show) +#define custom_set_edit_finished_hook_repeat_speed_sig() b32 custom_set_edit_finished_hook_repeat_speed(Application_Links* app, u32 milliseconds) +#define custom_set_fullscreen_sig() b32 custom_set_fullscreen(Application_Links* app, b32 full_screen) +#define custom_is_fullscreen_sig() b32 custom_is_fullscreen(Application_Links* app) +#define custom_send_exit_signal_sig() void custom_send_exit_signal(Application_Links* app) +#define custom_set_window_title_sig() b32 custom_set_window_title(Application_Links* app, String_Const_u8 title) +#define custom_get_microseconds_timestamp_sig() Microsecond_Time_Stamp custom_get_microseconds_timestamp(Application_Links* app) +#define custom_draw_string_oriented_sig() Vec2 custom_draw_string_oriented(Application_Links* app, Face_ID font_id, String_Const_u8 str, Vec2 point, int_color color, u32 flags, Vec2 delta) +#define custom_get_string_advance_sig() f32 custom_get_string_advance(Application_Links* app, Face_ID font_id, String_Const_u8 str) +#define custom_draw_rectangle_sig() void custom_draw_rectangle(Application_Links* app, Rect_f32 rect, int_color color) +#define custom_draw_rectangle_outline_sig() void custom_draw_rectangle_outline(Application_Links* app, Rect_f32 rect, int_color color) +#define custom_draw_clip_push_sig() void custom_draw_clip_push(Application_Links* app, Rect_f32 clip_box) +#define custom_draw_clip_pop_sig() f32_Rect custom_draw_clip_pop(Application_Links* app) +#define custom_draw_coordinate_center_push_sig() void custom_draw_coordinate_center_push(Application_Links* app, Vec2 point) +#define custom_draw_coordinate_center_pop_sig() Vec2 custom_draw_coordinate_center_pop(Application_Links* app) +#define custom_text_layout_create_sig() Text_Layout_ID custom_text_layout_create(Application_Links* app, Buffer_ID buffer_id, Rect_f32 rect, Buffer_Point buffer_point) +#define custom_text_layout_get_buffer_sig() b32 custom_text_layout_get_buffer(Application_Links* app, Text_Layout_ID text_layout_id, Buffer_ID* buffer_id_out) +#define custom_text_layout_get_visible_range_sig() Interval_i64 custom_text_layout_get_visible_range(Application_Links* app, Text_Layout_ID text_layout_id) +#define custom_text_layout_line_on_screen_sig() Rect_f32 custom_text_layout_line_on_screen(Application_Links* app, Text_Layout_ID layout_id, i64 line_number) +#define custom_text_layout_character_on_screen_sig() Rect_f32 custom_text_layout_character_on_screen(Application_Links* app, Text_Layout_ID layout_id, i64 pos) +#define custom_paint_text_color_sig() void custom_paint_text_color(Application_Links* app, Text_Layout_ID layout_id, Interval_i64 range, int_color color) +#define custom_text_layout_free_sig() b32 custom_text_layout_free(Application_Links* app, Text_Layout_ID text_layout_id) +#define custom_draw_text_layout_sig() void custom_draw_text_layout(Application_Links* app, Text_Layout_ID layout_id) +#define custom_open_color_picker_sig() void custom_open_color_picker(Application_Links* app, Color_Picker* picker) +#define custom_animate_in_n_milliseconds_sig() void custom_animate_in_n_milliseconds(Application_Links* app, u32 n) +#define custom_buffer_find_all_matches_sig() String_Match_List custom_buffer_find_all_matches(Application_Links* app, Arena* arena, Buffer_ID buffer, i32 string_id, Range_i64 range, String_Const_u8 needle, Character_Predicate* predicate, Scan_Direction direction) +typedef b32 custom_global_set_setting_type(Application_Links* app, Global_Setting_ID setting, i32 value); +typedef b32 custom_global_set_mapping_type(Application_Links* app, void* data, i32 size); +typedef Rect_f32 custom_global_get_screen_rectangle_type(Application_Links* app); +typedef Thread_Context* custom_get_thread_context_type(Application_Links* app); +typedef b32 custom_create_child_process_type(Application_Links* app, String_Const_u8 path, String_Const_u8 command, Child_Process_ID* child_process_id_out); +typedef b32 custom_child_process_set_target_buffer_type(Application_Links* app, Child_Process_ID child_process_id, Buffer_ID buffer_id, Child_Process_Set_Target_Flags flags); +typedef Child_Process_ID custom_buffer_get_attached_child_process_type(Application_Links* app, Buffer_ID buffer_id); +typedef Buffer_ID custom_child_process_get_attached_buffer_type(Application_Links* app, Child_Process_ID child_process_id); +typedef Process_State custom_child_process_get_state_type(Application_Links* app, Child_Process_ID child_process_id); +typedef b32 custom_clipboard_post_type(Application_Links* app, i32 clipboard_id, String_Const_u8 string); +typedef i32 custom_clipboard_count_type(Application_Links* app, i32 clipboard_id); +typedef String_Const_u8 custom_push_clipboard_index_type(Application_Links* app, Arena* arena, i32 clipboard_id, i32 item_index); +typedef i32 custom_get_buffer_count_type(Application_Links* app); +typedef Buffer_ID custom_get_buffer_next_type(Application_Links* app, Buffer_ID buffer_id, Access_Flag access); +typedef Buffer_ID custom_get_buffer_by_name_type(Application_Links* app, String_Const_u8 name, Access_Flag access); +typedef Buffer_ID custom_get_buffer_by_file_name_type(Application_Links* app, String_Const_u8 file_name, Access_Flag access); +typedef b32 custom_buffer_read_range_type(Application_Links* app, Buffer_ID buffer_id, Range_i64 range, char* out); +typedef b32 custom_buffer_replace_range_type(Application_Links* app, Buffer_ID buffer_id, Range_i64 range, String_Const_u8 string); +typedef b32 custom_buffer_batch_edit_type(Application_Links* app, Buffer_ID buffer_id, Batch_Edit* batch); +typedef String_Match custom_buffer_seek_string_type(Application_Links* app, Buffer_ID buffer, String_Const_u8 needle, Scan_Direction direction, i64 start_pos); +typedef String_Match custom_buffer_seek_character_class_type(Application_Links* app, Buffer_ID buffer, Character_Predicate* predicate, Scan_Direction direction, i64 start_pos); +typedef f32 custom_buffer_line_y_difference_type(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 line_a, i64 line_b); +typedef Line_Shift_Vertical custom_buffer_line_shift_y_type(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 line, f32 y_shift); +typedef i64 custom_buffer_pos_at_relative_xy_type(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, Vec2_f32 relative_xy); +typedef Vec2_f32 custom_buffer_relative_xy_of_pos_type(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 pos); +typedef i64 custom_buffer_relative_character_from_pos_type(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 pos); +typedef i64 custom_buffer_pos_from_relative_character_type(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 relative_character); +typedef f32 custom_view_line_y_difference_type(Application_Links* app, View_ID view_id, i64 line_a, i64 line_b); +typedef Line_Shift_Vertical custom_view_line_shift_y_type(Application_Links* app, View_ID view_id, i64 line, f32 y_shift); +typedef i64 custom_view_pos_at_relative_xy_type(Application_Links* app, View_ID view_id, i64 base_line, Vec2_f32 relative_xy); +typedef Vec2_f32 custom_view_relative_xy_of_pos_type(Application_Links* app, View_ID view_id, i64 base_line, i64 pos); +typedef i64 custom_view_relative_character_from_pos_type(Application_Links* app, View_ID view_id, i64 base_line, i64 pos); +typedef i64 custom_view_pos_from_relative_character_type(Application_Links* app, View_ID view_id, i64 base_line, i64 character); +typedef b32 custom_buffer_exists_type(Application_Links* app, Buffer_ID buffer_id); +typedef b32 custom_buffer_ready_type(Application_Links* app, Buffer_ID buffer_id); +typedef Access_Flag custom_buffer_get_access_flags_type(Application_Links* app, Buffer_ID buffer_id); +typedef i64 custom_buffer_get_size_type(Application_Links* app, Buffer_ID buffer_id); +typedef i64 custom_buffer_get_line_count_type(Application_Links* app, Buffer_ID buffer_id); +typedef String_Const_u8 custom_push_buffer_base_name_type(Application_Links* app, Arena* arena, Buffer_ID buffer_id); +typedef String_Const_u8 custom_push_buffer_unique_name_type(Application_Links* app, Arena* out, Buffer_ID buffer_id); +typedef String_Const_u8 custom_push_buffer_file_name_type(Application_Links* app, Arena* arena, Buffer_ID buffer_id); +typedef Dirty_State custom_buffer_get_dirty_state_type(Application_Links* app, Buffer_ID buffer_id); +typedef b32 custom_buffer_set_dirty_state_type(Application_Links* app, Buffer_ID buffer_id, Dirty_State dirty_state); +typedef b32 custom_buffer_get_setting_type(Application_Links* app, Buffer_ID buffer_id, Buffer_Setting_ID setting, i32* value_out); +typedef b32 custom_buffer_set_setting_type(Application_Links* app, Buffer_ID buffer_id, Buffer_Setting_ID setting, i32 value); +typedef Managed_Scope custom_buffer_get_managed_scope_type(Application_Links* app, Buffer_ID buffer_id); +typedef b32 custom_buffer_send_end_signal_type(Application_Links* app, Buffer_ID buffer_id); +typedef Buffer_ID custom_create_buffer_type(Application_Links* app, String_Const_u8 file_name, Buffer_Create_Flag flags); +typedef b32 custom_buffer_save_type(Application_Links* app, Buffer_ID buffer_id, String_Const_u8 file_name, Buffer_Save_Flag flags); +typedef Buffer_Kill_Result custom_buffer_kill_type(Application_Links* app, Buffer_ID buffer_id, Buffer_Kill_Flag flags); +typedef Buffer_Reopen_Result custom_buffer_reopen_type(Application_Links* app, Buffer_ID buffer_id, Buffer_Reopen_Flag flags); +typedef File_Attributes custom_buffer_get_file_attributes_type(Application_Links* app, Buffer_ID buffer_id); +typedef File_Attributes custom_get_file_attributes_type(Application_Links* app, String_Const_u8 file_name); +typedef View_ID custom_get_view_next_type(Application_Links* app, View_ID view_id, Access_Flag access); +typedef View_ID custom_get_view_prev_type(Application_Links* app, View_ID view_id, Access_Flag access); +typedef View_ID custom_get_active_view_type(Application_Links* app, Access_Flag access); +typedef Panel_ID custom_get_active_panel_type(Application_Links* app); +typedef b32 custom_view_exists_type(Application_Links* app, View_ID view_id); +typedef Buffer_ID custom_view_get_buffer_type(Application_Links* app, View_ID view_id, Access_Flag access); +typedef i64 custom_view_get_cursor_pos_type(Application_Links* app, View_ID view_id); +typedef i64 custom_view_get_mark_pos_type(Application_Links* app, View_ID view_id); +typedef f32 custom_view_get_preferred_x_type(Application_Links* app, View_ID view_id); +typedef b32 custom_view_set_preferred_x_type(Application_Links* app, View_ID view_id, f32 x); +typedef Rect_f32 custom_view_get_screen_rect_type(Application_Links* app, View_ID view_id); +typedef Panel_ID custom_view_get_panel_type(Application_Links* app, View_ID view_id); +typedef View_ID custom_panel_get_view_type(Application_Links* app, Panel_ID panel_id); +typedef b32 custom_panel_is_split_type(Application_Links* app, Panel_ID panel_id); +typedef b32 custom_panel_is_leaf_type(Application_Links* app, Panel_ID panel_id); +typedef b32 custom_panel_split_type(Application_Links* app, Panel_ID panel_id, Panel_Split_Orientation orientation); +typedef b32 custom_panel_set_split_type(Application_Links* app, Panel_ID panel_id, Panel_Split_Kind kind, float t); +typedef b32 custom_panel_swap_children_type(Application_Links* app, Panel_ID panel_id, Panel_Split_Kind kind, float t); +typedef Panel_ID custom_panel_get_parent_type(Application_Links* app, Panel_ID panel_id); +typedef Panel_ID custom_panel_get_child_type(Application_Links* app, Panel_ID panel_id, Panel_Child which_child); +typedef Panel_ID custom_panel_get_max_type(Application_Links* app, Panel_ID panel_id); +typedef Rect_i32 custom_panel_get_margin_type(Application_Links* app, Panel_ID panel_id); +typedef b32 custom_view_close_type(Application_Links* app, View_ID view_id); +typedef Rect_f32 custom_view_get_buffer_region_type(Application_Links* app, View_ID view_id); +typedef Buffer_Scroll custom_view_get_buffer_scroll_type(Application_Links* app, View_ID view_id); +typedef Basic_Scroll custom_view_get_basic_scroll_type(Application_Links* app, View_ID view_id); +typedef b32 custom_view_set_active_type(Application_Links* app, View_ID view_id); +typedef b32 custom_view_get_setting_type(Application_Links* app, View_ID view_id, View_Setting_ID setting, i32* value_out); +typedef b32 custom_view_set_setting_type(Application_Links* app, View_ID view_id, View_Setting_ID setting, i32 value); +typedef Managed_Scope custom_view_get_managed_scope_type(Application_Links* app, View_ID view_id); +typedef Buffer_Cursor custom_buffer_compute_cursor_type(Application_Links* app, Buffer_ID buffer, Buffer_Seek seek); +typedef Buffer_Cursor custom_view_compute_cursor_type(Application_Links* app, View_ID view_id, Buffer_Seek seek); +typedef b32 custom_view_set_cursor_type(Application_Links* app, View_ID view_id, Buffer_Seek seek); +typedef b32 custom_view_set_buffer_scroll_type(Application_Links* app, View_ID view_id, Buffer_Scroll scroll); +typedef b32 custom_view_set_basic_scroll_type(Application_Links* app, View_ID view_id, Basic_Scroll scroll); +typedef b32 custom_view_set_mark_type(Application_Links* app, View_ID view_id, Buffer_Seek seek); +typedef b32 custom_view_set_buffer_type(Application_Links* app, View_ID view_id, Buffer_ID buffer_id, Set_Buffer_Flag flags); +typedef b32 custom_view_post_fade_type(Application_Links* app, View_ID view_id, f32 seconds, Range_i64 range, int_color color); +typedef b32 custom_view_begin_ui_mode_type(Application_Links* app, View_ID view_id); +typedef b32 custom_view_end_ui_mode_type(Application_Links* app, View_ID view_id); +typedef b32 custom_view_is_in_ui_mode_type(Application_Links* app, View_ID view_id); +typedef b32 custom_view_set_quit_ui_handler_type(Application_Links* app, View_ID view_id, UI_Quit_Function_Type* quit_function); +typedef b32 custom_view_get_quit_ui_handler_type(Application_Links* app, View_ID view_id, UI_Quit_Function_Type** quit_function_out); +typedef Managed_Scope custom_create_user_managed_scope_type(Application_Links* app); +typedef b32 custom_destroy_user_managed_scope_type(Application_Links* app, Managed_Scope scope); +typedef Managed_Scope custom_get_global_managed_scope_type(Application_Links* app); +typedef Managed_Scope custom_get_managed_scope_with_multiple_dependencies_type(Application_Links* app, Managed_Scope* scopes, i32 count); +typedef b32 custom_managed_scope_clear_contents_type(Application_Links* app, Managed_Scope scope); +typedef b32 custom_managed_scope_clear_self_all_dependent_scopes_type(Application_Links* app, Managed_Scope scope); +typedef Base_Allocator* custom_managed_scope_allocator_type(Application_Links* app, Managed_Scope scope); +typedef Managed_ID custom_managed_id_declare_type(Application_Links* app, String_Const_u8 name); +typedef void* custom_managed_scope_get_attachment_type(Application_Links* app, Managed_Scope scope, Managed_ID id, umem size); +typedef void* custom_managed_scope_attachment_erase_type(Application_Links* app, Managed_Scope scope, Managed_ID id); +typedef Managed_Object custom_alloc_managed_memory_in_scope_type(Application_Links* app, Managed_Scope scope, i32 item_size, i32 count); +typedef Managed_Object custom_alloc_buffer_markers_on_buffer_type(Application_Links* app, Buffer_ID buffer_id, i32 count, Managed_Scope* optional_extra_scope); +typedef u32 custom_managed_object_get_item_size_type(Application_Links* app, Managed_Object object); +typedef u32 custom_managed_object_get_item_count_type(Application_Links* app, Managed_Object object); +typedef void* custom_managed_object_get_pointer_type(Application_Links* app, Managed_Object object); +typedef Managed_Object_Type custom_managed_object_get_type_type(Application_Links* app, Managed_Object object); +typedef Managed_Scope custom_managed_object_get_containing_scope_type(Application_Links* app, Managed_Object object); +typedef b32 custom_managed_object_free_type(Application_Links* app, Managed_Object object); +typedef b32 custom_managed_object_store_data_type(Application_Links* app, Managed_Object object, u32 first_index, u32 count, void* mem); +typedef b32 custom_managed_object_load_data_type(Application_Links* app, Managed_Object object, u32 first_index, u32 count, void* mem_out); +typedef User_Input custom_get_user_input_type(Application_Links* app, Input_Type_Flag get_type, Input_Type_Flag abort_type); +typedef User_Input custom_get_command_input_type(Application_Links* app); +typedef void custom_set_command_input_type(Application_Links* app, Key_Event_Data key_data); +typedef Mouse_State custom_get_mouse_state_type(Application_Links* app); +typedef b32 custom_get_active_query_bars_type(Application_Links* app, View_ID view_id, i32 max_result_count, Query_Bar_Ptr_Array* array_out); +typedef b32 custom_start_query_bar_type(Application_Links* app, Query_Bar* bar, u32 flags); +typedef void custom_end_query_bar_type(Application_Links* app, Query_Bar* bar, u32 flags); +typedef b32 custom_print_message_type(Application_Links* app, String_Const_u8 message); +typedef b32 custom_log_string_type(Application_Links* app, String_Const_u8 str); +typedef i32 custom_thread_get_id_type(Application_Links* app); +typedef Face_ID custom_get_largest_face_id_type(Application_Links* app); +typedef b32 custom_set_global_face_type(Application_Links* app, Face_ID id, b32 apply_to_all_buffers); +typedef History_Record_Index custom_buffer_history_get_max_record_index_type(Application_Links* app, Buffer_ID buffer_id); +typedef Record_Info custom_buffer_history_get_record_info_type(Application_Links* app, Buffer_ID buffer_id, History_Record_Index index); +typedef Record_Info custom_buffer_history_get_group_sub_record_type(Application_Links* app, Buffer_ID buffer_id, History_Record_Index index, i32 sub_index); +typedef History_Record_Index custom_buffer_history_get_current_state_index_type(Application_Links* app, Buffer_ID buffer_id); +typedef b32 custom_buffer_history_set_current_state_index_type(Application_Links* app, Buffer_ID buffer_id, History_Record_Index index); +typedef b32 custom_buffer_history_merge_record_range_type(Application_Links* app, Buffer_ID buffer_id, History_Record_Index first_index, History_Record_Index last_index, Record_Merge_Flag flags); +typedef b32 custom_buffer_history_clear_after_current_state_type(Application_Links* app, Buffer_ID buffer_id); +typedef void custom_global_history_edit_group_begin_type(Application_Links* app); +typedef void custom_global_history_edit_group_end_type(Application_Links* app); +typedef b32 custom_buffer_set_face_type(Application_Links* app, Buffer_ID buffer_id, Face_ID id); +typedef Face_Description custom_get_face_description_type(Application_Links* app, Face_ID face_id); +typedef Face_Metrics custom_get_face_metrics_type(Application_Links* app, Face_ID face_id); +typedef Face_ID custom_get_face_id_type(Application_Links* app, Buffer_ID buffer_id); +typedef Face_ID custom_try_create_new_face_type(Application_Links* app, Face_Description* description); +typedef b32 custom_try_modify_face_type(Application_Links* app, Face_ID id, Face_Description* description); +typedef b32 custom_try_release_face_type(Application_Links* app, Face_ID id, Face_ID replacement_id); +typedef void custom_set_theme_colors_type(Application_Links* app, Theme_Color* colors, i32 count); +typedef void custom_get_theme_colors_type(Application_Links* app, Theme_Color* colors, i32 count); +typedef argb_color custom_finalize_color_type(Application_Links* app, int_color color); +typedef String_Const_u8 custom_push_hot_directory_type(Application_Links* app, Arena* arena); +typedef b32 custom_set_hot_directory_type(Application_Links* app, String_Const_u8 string); +typedef File_List custom_get_file_list_type(Application_Links* app, Arena* arena, String_Const_u8 directory); +typedef void custom_set_gui_up_down_keys_type(Application_Links* app, Key_Code up_key, Key_Modifier up_key_modifier, Key_Code down_key, Key_Modifier down_key_modifier); +typedef void* custom_memory_allocate_type(Application_Links* app, i32 size); +typedef b32 custom_memory_set_protection_type(Application_Links* app, void* ptr, i32 size, Memory_Protect_Flags flags); +typedef void custom_memory_free_type(Application_Links* app, void* ptr, i32 size); +typedef String_Const_u8 custom_push_4ed_path_type(Application_Links* app, Arena* arena); +typedef void custom_show_mouse_cursor_type(Application_Links* app, Mouse_Cursor_Show_Type show); +typedef b32 custom_set_edit_finished_hook_repeat_speed_type(Application_Links* app, u32 milliseconds); +typedef b32 custom_set_fullscreen_type(Application_Links* app, b32 full_screen); +typedef b32 custom_is_fullscreen_type(Application_Links* app); +typedef void custom_send_exit_signal_type(Application_Links* app); +typedef b32 custom_set_window_title_type(Application_Links* app, String_Const_u8 title); +typedef Microsecond_Time_Stamp custom_get_microseconds_timestamp_type(Application_Links* app); +typedef Vec2 custom_draw_string_oriented_type(Application_Links* app, Face_ID font_id, String_Const_u8 str, Vec2 point, int_color color, u32 flags, Vec2 delta); +typedef f32 custom_get_string_advance_type(Application_Links* app, Face_ID font_id, String_Const_u8 str); +typedef void custom_draw_rectangle_type(Application_Links* app, Rect_f32 rect, int_color color); +typedef void custom_draw_rectangle_outline_type(Application_Links* app, Rect_f32 rect, int_color color); +typedef void custom_draw_clip_push_type(Application_Links* app, Rect_f32 clip_box); +typedef f32_Rect custom_draw_clip_pop_type(Application_Links* app); +typedef void custom_draw_coordinate_center_push_type(Application_Links* app, Vec2 point); +typedef Vec2 custom_draw_coordinate_center_pop_type(Application_Links* app); +typedef Text_Layout_ID custom_text_layout_create_type(Application_Links* app, Buffer_ID buffer_id, Rect_f32 rect, Buffer_Point buffer_point); +typedef b32 custom_text_layout_get_buffer_type(Application_Links* app, Text_Layout_ID text_layout_id, Buffer_ID* buffer_id_out); +typedef Interval_i64 custom_text_layout_get_visible_range_type(Application_Links* app, Text_Layout_ID text_layout_id); +typedef Rect_f32 custom_text_layout_line_on_screen_type(Application_Links* app, Text_Layout_ID layout_id, i64 line_number); +typedef Rect_f32 custom_text_layout_character_on_screen_type(Application_Links* app, Text_Layout_ID layout_id, i64 pos); +typedef void custom_paint_text_color_type(Application_Links* app, Text_Layout_ID layout_id, Interval_i64 range, int_color color); +typedef b32 custom_text_layout_free_type(Application_Links* app, Text_Layout_ID text_layout_id); +typedef void custom_draw_text_layout_type(Application_Links* app, Text_Layout_ID layout_id); +typedef void custom_open_color_picker_type(Application_Links* app, Color_Picker* picker); +typedef void custom_animate_in_n_milliseconds_type(Application_Links* app, u32 n); +typedef String_Match_List custom_buffer_find_all_matches_type(Application_Links* app, Arena* arena, Buffer_ID buffer, i32 string_id, Range_i64 range, String_Const_u8 needle, Character_Predicate* predicate, Scan_Direction direction); +struct API_VTable_custom{ +custom_global_set_setting_type *global_set_setting; +custom_global_set_mapping_type *global_set_mapping; +custom_global_get_screen_rectangle_type *global_get_screen_rectangle; +custom_get_thread_context_type *get_thread_context; +custom_create_child_process_type *create_child_process; +custom_child_process_set_target_buffer_type *child_process_set_target_buffer; +custom_buffer_get_attached_child_process_type *buffer_get_attached_child_process; +custom_child_process_get_attached_buffer_type *child_process_get_attached_buffer; +custom_child_process_get_state_type *child_process_get_state; +custom_clipboard_post_type *clipboard_post; +custom_clipboard_count_type *clipboard_count; +custom_push_clipboard_index_type *push_clipboard_index; +custom_get_buffer_count_type *get_buffer_count; +custom_get_buffer_next_type *get_buffer_next; +custom_get_buffer_by_name_type *get_buffer_by_name; +custom_get_buffer_by_file_name_type *get_buffer_by_file_name; +custom_buffer_read_range_type *buffer_read_range; +custom_buffer_replace_range_type *buffer_replace_range; +custom_buffer_batch_edit_type *buffer_batch_edit; +custom_buffer_seek_string_type *buffer_seek_string; +custom_buffer_seek_character_class_type *buffer_seek_character_class; +custom_buffer_line_y_difference_type *buffer_line_y_difference; +custom_buffer_line_shift_y_type *buffer_line_shift_y; +custom_buffer_pos_at_relative_xy_type *buffer_pos_at_relative_xy; +custom_buffer_relative_xy_of_pos_type *buffer_relative_xy_of_pos; +custom_buffer_relative_character_from_pos_type *buffer_relative_character_from_pos; +custom_buffer_pos_from_relative_character_type *buffer_pos_from_relative_character; +custom_view_line_y_difference_type *view_line_y_difference; +custom_view_line_shift_y_type *view_line_shift_y; +custom_view_pos_at_relative_xy_type *view_pos_at_relative_xy; +custom_view_relative_xy_of_pos_type *view_relative_xy_of_pos; +custom_view_relative_character_from_pos_type *view_relative_character_from_pos; +custom_view_pos_from_relative_character_type *view_pos_from_relative_character; +custom_buffer_exists_type *buffer_exists; +custom_buffer_ready_type *buffer_ready; +custom_buffer_get_access_flags_type *buffer_get_access_flags; +custom_buffer_get_size_type *buffer_get_size; +custom_buffer_get_line_count_type *buffer_get_line_count; +custom_push_buffer_base_name_type *push_buffer_base_name; +custom_push_buffer_unique_name_type *push_buffer_unique_name; +custom_push_buffer_file_name_type *push_buffer_file_name; +custom_buffer_get_dirty_state_type *buffer_get_dirty_state; +custom_buffer_set_dirty_state_type *buffer_set_dirty_state; +custom_buffer_get_setting_type *buffer_get_setting; +custom_buffer_set_setting_type *buffer_set_setting; +custom_buffer_get_managed_scope_type *buffer_get_managed_scope; +custom_buffer_send_end_signal_type *buffer_send_end_signal; +custom_create_buffer_type *create_buffer; +custom_buffer_save_type *buffer_save; +custom_buffer_kill_type *buffer_kill; +custom_buffer_reopen_type *buffer_reopen; +custom_buffer_get_file_attributes_type *buffer_get_file_attributes; +custom_get_file_attributes_type *get_file_attributes; +custom_get_view_next_type *get_view_next; +custom_get_view_prev_type *get_view_prev; +custom_get_active_view_type *get_active_view; +custom_get_active_panel_type *get_active_panel; +custom_view_exists_type *view_exists; +custom_view_get_buffer_type *view_get_buffer; +custom_view_get_cursor_pos_type *view_get_cursor_pos; +custom_view_get_mark_pos_type *view_get_mark_pos; +custom_view_get_preferred_x_type *view_get_preferred_x; +custom_view_set_preferred_x_type *view_set_preferred_x; +custom_view_get_screen_rect_type *view_get_screen_rect; +custom_view_get_panel_type *view_get_panel; +custom_panel_get_view_type *panel_get_view; +custom_panel_is_split_type *panel_is_split; +custom_panel_is_leaf_type *panel_is_leaf; +custom_panel_split_type *panel_split; +custom_panel_set_split_type *panel_set_split; +custom_panel_swap_children_type *panel_swap_children; +custom_panel_get_parent_type *panel_get_parent; +custom_panel_get_child_type *panel_get_child; +custom_panel_get_max_type *panel_get_max; +custom_panel_get_margin_type *panel_get_margin; +custom_view_close_type *view_close; +custom_view_get_buffer_region_type *view_get_buffer_region; +custom_view_get_buffer_scroll_type *view_get_buffer_scroll; +custom_view_get_basic_scroll_type *view_get_basic_scroll; +custom_view_set_active_type *view_set_active; +custom_view_get_setting_type *view_get_setting; +custom_view_set_setting_type *view_set_setting; +custom_view_get_managed_scope_type *view_get_managed_scope; +custom_buffer_compute_cursor_type *buffer_compute_cursor; +custom_view_compute_cursor_type *view_compute_cursor; +custom_view_set_cursor_type *view_set_cursor; +custom_view_set_buffer_scroll_type *view_set_buffer_scroll; +custom_view_set_basic_scroll_type *view_set_basic_scroll; +custom_view_set_mark_type *view_set_mark; +custom_view_set_buffer_type *view_set_buffer; +custom_view_post_fade_type *view_post_fade; +custom_view_begin_ui_mode_type *view_begin_ui_mode; +custom_view_end_ui_mode_type *view_end_ui_mode; +custom_view_is_in_ui_mode_type *view_is_in_ui_mode; +custom_view_set_quit_ui_handler_type *view_set_quit_ui_handler; +custom_view_get_quit_ui_handler_type *view_get_quit_ui_handler; +custom_create_user_managed_scope_type *create_user_managed_scope; +custom_destroy_user_managed_scope_type *destroy_user_managed_scope; +custom_get_global_managed_scope_type *get_global_managed_scope; +custom_get_managed_scope_with_multiple_dependencies_type *get_managed_scope_with_multiple_dependencies; +custom_managed_scope_clear_contents_type *managed_scope_clear_contents; +custom_managed_scope_clear_self_all_dependent_scopes_type *managed_scope_clear_self_all_dependent_scopes; +custom_managed_scope_allocator_type *managed_scope_allocator; +custom_managed_id_declare_type *managed_id_declare; +custom_managed_scope_get_attachment_type *managed_scope_get_attachment; +custom_managed_scope_attachment_erase_type *managed_scope_attachment_erase; +custom_alloc_managed_memory_in_scope_type *alloc_managed_memory_in_scope; +custom_alloc_buffer_markers_on_buffer_type *alloc_buffer_markers_on_buffer; +custom_managed_object_get_item_size_type *managed_object_get_item_size; +custom_managed_object_get_item_count_type *managed_object_get_item_count; +custom_managed_object_get_pointer_type *managed_object_get_pointer; +custom_managed_object_get_type_type *managed_object_get_type; +custom_managed_object_get_containing_scope_type *managed_object_get_containing_scope; +custom_managed_object_free_type *managed_object_free; +custom_managed_object_store_data_type *managed_object_store_data; +custom_managed_object_load_data_type *managed_object_load_data; +custom_get_user_input_type *get_user_input; +custom_get_command_input_type *get_command_input; +custom_set_command_input_type *set_command_input; +custom_get_mouse_state_type *get_mouse_state; +custom_get_active_query_bars_type *get_active_query_bars; +custom_start_query_bar_type *start_query_bar; +custom_end_query_bar_type *end_query_bar; +custom_print_message_type *print_message; +custom_log_string_type *log_string; +custom_thread_get_id_type *thread_get_id; +custom_get_largest_face_id_type *get_largest_face_id; +custom_set_global_face_type *set_global_face; +custom_buffer_history_get_max_record_index_type *buffer_history_get_max_record_index; +custom_buffer_history_get_record_info_type *buffer_history_get_record_info; +custom_buffer_history_get_group_sub_record_type *buffer_history_get_group_sub_record; +custom_buffer_history_get_current_state_index_type *buffer_history_get_current_state_index; +custom_buffer_history_set_current_state_index_type *buffer_history_set_current_state_index; +custom_buffer_history_merge_record_range_type *buffer_history_merge_record_range; +custom_buffer_history_clear_after_current_state_type *buffer_history_clear_after_current_state; +custom_global_history_edit_group_begin_type *global_history_edit_group_begin; +custom_global_history_edit_group_end_type *global_history_edit_group_end; +custom_buffer_set_face_type *buffer_set_face; +custom_get_face_description_type *get_face_description; +custom_get_face_metrics_type *get_face_metrics; +custom_get_face_id_type *get_face_id; +custom_try_create_new_face_type *try_create_new_face; +custom_try_modify_face_type *try_modify_face; +custom_try_release_face_type *try_release_face; +custom_set_theme_colors_type *set_theme_colors; +custom_get_theme_colors_type *get_theme_colors; +custom_finalize_color_type *finalize_color; +custom_push_hot_directory_type *push_hot_directory; +custom_set_hot_directory_type *set_hot_directory; +custom_get_file_list_type *get_file_list; +custom_set_gui_up_down_keys_type *set_gui_up_down_keys; +custom_memory_allocate_type *memory_allocate; +custom_memory_set_protection_type *memory_set_protection; +custom_memory_free_type *memory_free; +custom_push_4ed_path_type *push_4ed_path; +custom_show_mouse_cursor_type *show_mouse_cursor; +custom_set_edit_finished_hook_repeat_speed_type *set_edit_finished_hook_repeat_speed; +custom_set_fullscreen_type *set_fullscreen; +custom_is_fullscreen_type *is_fullscreen; +custom_send_exit_signal_type *send_exit_signal; +custom_set_window_title_type *set_window_title; +custom_get_microseconds_timestamp_type *get_microseconds_timestamp; +custom_draw_string_oriented_type *draw_string_oriented; +custom_get_string_advance_type *get_string_advance; +custom_draw_rectangle_type *draw_rectangle; +custom_draw_rectangle_outline_type *draw_rectangle_outline; +custom_draw_clip_push_type *draw_clip_push; +custom_draw_clip_pop_type *draw_clip_pop; +custom_draw_coordinate_center_push_type *draw_coordinate_center_push; +custom_draw_coordinate_center_pop_type *draw_coordinate_center_pop; +custom_text_layout_create_type *text_layout_create; +custom_text_layout_get_buffer_type *text_layout_get_buffer; +custom_text_layout_get_visible_range_type *text_layout_get_visible_range; +custom_text_layout_line_on_screen_type *text_layout_line_on_screen; +custom_text_layout_character_on_screen_type *text_layout_character_on_screen; +custom_paint_text_color_type *paint_text_color; +custom_text_layout_free_type *text_layout_free; +custom_draw_text_layout_type *draw_text_layout; +custom_open_color_picker_type *open_color_picker; +custom_animate_in_n_milliseconds_type *animate_in_n_milliseconds; +custom_buffer_find_all_matches_type *buffer_find_all_matches; +}; +#if defined(STATIC_LINK_API) +internal b32 global_set_setting(Application_Links* app, Global_Setting_ID setting, i32 value); +internal b32 global_set_mapping(Application_Links* app, void* data, i32 size); +internal Rect_f32 global_get_screen_rectangle(Application_Links* app); +internal Thread_Context* get_thread_context(Application_Links* app); +internal b32 create_child_process(Application_Links* app, String_Const_u8 path, String_Const_u8 command, Child_Process_ID* child_process_id_out); +internal b32 child_process_set_target_buffer(Application_Links* app, Child_Process_ID child_process_id, Buffer_ID buffer_id, Child_Process_Set_Target_Flags flags); +internal Child_Process_ID buffer_get_attached_child_process(Application_Links* app, Buffer_ID buffer_id); +internal Buffer_ID child_process_get_attached_buffer(Application_Links* app, Child_Process_ID child_process_id); +internal Process_State child_process_get_state(Application_Links* app, Child_Process_ID child_process_id); +internal b32 clipboard_post(Application_Links* app, i32 clipboard_id, String_Const_u8 string); +internal i32 clipboard_count(Application_Links* app, i32 clipboard_id); +internal String_Const_u8 push_clipboard_index(Application_Links* app, Arena* arena, i32 clipboard_id, i32 item_index); +internal i32 get_buffer_count(Application_Links* app); +internal Buffer_ID get_buffer_next(Application_Links* app, Buffer_ID buffer_id, Access_Flag access); +internal Buffer_ID get_buffer_by_name(Application_Links* app, String_Const_u8 name, Access_Flag access); +internal Buffer_ID get_buffer_by_file_name(Application_Links* app, String_Const_u8 file_name, Access_Flag access); +internal b32 buffer_read_range(Application_Links* app, Buffer_ID buffer_id, Range_i64 range, char* out); +internal b32 buffer_replace_range(Application_Links* app, Buffer_ID buffer_id, Range_i64 range, String_Const_u8 string); +internal b32 buffer_batch_edit(Application_Links* app, Buffer_ID buffer_id, Batch_Edit* batch); +internal String_Match buffer_seek_string(Application_Links* app, Buffer_ID buffer, String_Const_u8 needle, Scan_Direction direction, i64 start_pos); +internal String_Match buffer_seek_character_class(Application_Links* app, Buffer_ID buffer, Character_Predicate* predicate, Scan_Direction direction, i64 start_pos); +internal f32 buffer_line_y_difference(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 line_a, i64 line_b); +internal Line_Shift_Vertical buffer_line_shift_y(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 line, f32 y_shift); +internal i64 buffer_pos_at_relative_xy(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, Vec2_f32 relative_xy); +internal Vec2_f32 buffer_relative_xy_of_pos(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 pos); +internal i64 buffer_relative_character_from_pos(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 pos); +internal i64 buffer_pos_from_relative_character(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 relative_character); +internal f32 view_line_y_difference(Application_Links* app, View_ID view_id, i64 line_a, i64 line_b); +internal Line_Shift_Vertical view_line_shift_y(Application_Links* app, View_ID view_id, i64 line, f32 y_shift); +internal i64 view_pos_at_relative_xy(Application_Links* app, View_ID view_id, i64 base_line, Vec2_f32 relative_xy); +internal Vec2_f32 view_relative_xy_of_pos(Application_Links* app, View_ID view_id, i64 base_line, i64 pos); +internal i64 view_relative_character_from_pos(Application_Links* app, View_ID view_id, i64 base_line, i64 pos); +internal i64 view_pos_from_relative_character(Application_Links* app, View_ID view_id, i64 base_line, i64 character); +internal b32 buffer_exists(Application_Links* app, Buffer_ID buffer_id); +internal b32 buffer_ready(Application_Links* app, Buffer_ID buffer_id); +internal Access_Flag buffer_get_access_flags(Application_Links* app, Buffer_ID buffer_id); +internal i64 buffer_get_size(Application_Links* app, Buffer_ID buffer_id); +internal i64 buffer_get_line_count(Application_Links* app, Buffer_ID buffer_id); +internal String_Const_u8 push_buffer_base_name(Application_Links* app, Arena* arena, Buffer_ID buffer_id); +internal String_Const_u8 push_buffer_unique_name(Application_Links* app, Arena* out, Buffer_ID buffer_id); +internal String_Const_u8 push_buffer_file_name(Application_Links* app, Arena* arena, Buffer_ID buffer_id); +internal Dirty_State buffer_get_dirty_state(Application_Links* app, Buffer_ID buffer_id); +internal b32 buffer_set_dirty_state(Application_Links* app, Buffer_ID buffer_id, Dirty_State dirty_state); +internal b32 buffer_get_setting(Application_Links* app, Buffer_ID buffer_id, Buffer_Setting_ID setting, i32* value_out); +internal b32 buffer_set_setting(Application_Links* app, Buffer_ID buffer_id, Buffer_Setting_ID setting, i32 value); +internal Managed_Scope buffer_get_managed_scope(Application_Links* app, Buffer_ID buffer_id); +internal b32 buffer_send_end_signal(Application_Links* app, Buffer_ID buffer_id); +internal Buffer_ID create_buffer(Application_Links* app, String_Const_u8 file_name, Buffer_Create_Flag flags); +internal b32 buffer_save(Application_Links* app, Buffer_ID buffer_id, String_Const_u8 file_name, Buffer_Save_Flag flags); +internal Buffer_Kill_Result buffer_kill(Application_Links* app, Buffer_ID buffer_id, Buffer_Kill_Flag flags); +internal Buffer_Reopen_Result buffer_reopen(Application_Links* app, Buffer_ID buffer_id, Buffer_Reopen_Flag flags); +internal File_Attributes buffer_get_file_attributes(Application_Links* app, Buffer_ID buffer_id); +internal File_Attributes get_file_attributes(Application_Links* app, String_Const_u8 file_name); +internal View_ID get_view_next(Application_Links* app, View_ID view_id, Access_Flag access); +internal View_ID get_view_prev(Application_Links* app, View_ID view_id, Access_Flag access); +internal View_ID get_active_view(Application_Links* app, Access_Flag access); +internal Panel_ID get_active_panel(Application_Links* app); +internal b32 view_exists(Application_Links* app, View_ID view_id); +internal Buffer_ID view_get_buffer(Application_Links* app, View_ID view_id, Access_Flag access); +internal i64 view_get_cursor_pos(Application_Links* app, View_ID view_id); +internal i64 view_get_mark_pos(Application_Links* app, View_ID view_id); +internal f32 view_get_preferred_x(Application_Links* app, View_ID view_id); +internal b32 view_set_preferred_x(Application_Links* app, View_ID view_id, f32 x); +internal Rect_f32 view_get_screen_rect(Application_Links* app, View_ID view_id); +internal Panel_ID view_get_panel(Application_Links* app, View_ID view_id); +internal View_ID panel_get_view(Application_Links* app, Panel_ID panel_id); +internal b32 panel_is_split(Application_Links* app, Panel_ID panel_id); +internal b32 panel_is_leaf(Application_Links* app, Panel_ID panel_id); +internal b32 panel_split(Application_Links* app, Panel_ID panel_id, Panel_Split_Orientation orientation); +internal b32 panel_set_split(Application_Links* app, Panel_ID panel_id, Panel_Split_Kind kind, float t); +internal b32 panel_swap_children(Application_Links* app, Panel_ID panel_id, Panel_Split_Kind kind, float t); +internal Panel_ID panel_get_parent(Application_Links* app, Panel_ID panel_id); +internal Panel_ID panel_get_child(Application_Links* app, Panel_ID panel_id, Panel_Child which_child); +internal Panel_ID panel_get_max(Application_Links* app, Panel_ID panel_id); +internal Rect_i32 panel_get_margin(Application_Links* app, Panel_ID panel_id); +internal b32 view_close(Application_Links* app, View_ID view_id); +internal Rect_f32 view_get_buffer_region(Application_Links* app, View_ID view_id); +internal Buffer_Scroll view_get_buffer_scroll(Application_Links* app, View_ID view_id); +internal Basic_Scroll view_get_basic_scroll(Application_Links* app, View_ID view_id); +internal b32 view_set_active(Application_Links* app, View_ID view_id); +internal b32 view_get_setting(Application_Links* app, View_ID view_id, View_Setting_ID setting, i32* value_out); +internal b32 view_set_setting(Application_Links* app, View_ID view_id, View_Setting_ID setting, i32 value); +internal Managed_Scope view_get_managed_scope(Application_Links* app, View_ID view_id); +internal Buffer_Cursor buffer_compute_cursor(Application_Links* app, Buffer_ID buffer, Buffer_Seek seek); +internal Buffer_Cursor view_compute_cursor(Application_Links* app, View_ID view_id, Buffer_Seek seek); +internal b32 view_set_cursor(Application_Links* app, View_ID view_id, Buffer_Seek seek); +internal b32 view_set_buffer_scroll(Application_Links* app, View_ID view_id, Buffer_Scroll scroll); +internal b32 view_set_basic_scroll(Application_Links* app, View_ID view_id, Basic_Scroll scroll); +internal b32 view_set_mark(Application_Links* app, View_ID view_id, Buffer_Seek seek); +internal b32 view_set_buffer(Application_Links* app, View_ID view_id, Buffer_ID buffer_id, Set_Buffer_Flag flags); +internal b32 view_post_fade(Application_Links* app, View_ID view_id, f32 seconds, Range_i64 range, int_color color); +internal b32 view_begin_ui_mode(Application_Links* app, View_ID view_id); +internal b32 view_end_ui_mode(Application_Links* app, View_ID view_id); +internal b32 view_is_in_ui_mode(Application_Links* app, View_ID view_id); +internal b32 view_set_quit_ui_handler(Application_Links* app, View_ID view_id, UI_Quit_Function_Type* quit_function); +internal b32 view_get_quit_ui_handler(Application_Links* app, View_ID view_id, UI_Quit_Function_Type** quit_function_out); +internal Managed_Scope create_user_managed_scope(Application_Links* app); +internal b32 destroy_user_managed_scope(Application_Links* app, Managed_Scope scope); +internal Managed_Scope get_global_managed_scope(Application_Links* app); +internal Managed_Scope get_managed_scope_with_multiple_dependencies(Application_Links* app, Managed_Scope* scopes, i32 count); +internal b32 managed_scope_clear_contents(Application_Links* app, Managed_Scope scope); +internal b32 managed_scope_clear_self_all_dependent_scopes(Application_Links* app, Managed_Scope scope); +internal Base_Allocator* managed_scope_allocator(Application_Links* app, Managed_Scope scope); +internal Managed_ID managed_id_declare(Application_Links* app, String_Const_u8 name); +internal void* managed_scope_get_attachment(Application_Links* app, Managed_Scope scope, Managed_ID id, umem size); +internal void* managed_scope_attachment_erase(Application_Links* app, Managed_Scope scope, Managed_ID id); +internal Managed_Object alloc_managed_memory_in_scope(Application_Links* app, Managed_Scope scope, i32 item_size, i32 count); +internal Managed_Object alloc_buffer_markers_on_buffer(Application_Links* app, Buffer_ID buffer_id, i32 count, Managed_Scope* optional_extra_scope); +internal u32 managed_object_get_item_size(Application_Links* app, Managed_Object object); +internal u32 managed_object_get_item_count(Application_Links* app, Managed_Object object); +internal void* managed_object_get_pointer(Application_Links* app, Managed_Object object); +internal Managed_Object_Type managed_object_get_type(Application_Links* app, Managed_Object object); +internal Managed_Scope managed_object_get_containing_scope(Application_Links* app, Managed_Object object); +internal b32 managed_object_free(Application_Links* app, Managed_Object object); +internal b32 managed_object_store_data(Application_Links* app, Managed_Object object, u32 first_index, u32 count, void* mem); +internal b32 managed_object_load_data(Application_Links* app, Managed_Object object, u32 first_index, u32 count, void* mem_out); +internal User_Input get_user_input(Application_Links* app, Input_Type_Flag get_type, Input_Type_Flag abort_type); +internal User_Input get_command_input(Application_Links* app); +internal void set_command_input(Application_Links* app, Key_Event_Data key_data); +internal Mouse_State get_mouse_state(Application_Links* app); +internal b32 get_active_query_bars(Application_Links* app, View_ID view_id, i32 max_result_count, Query_Bar_Ptr_Array* array_out); +internal b32 start_query_bar(Application_Links* app, Query_Bar* bar, u32 flags); +internal void end_query_bar(Application_Links* app, Query_Bar* bar, u32 flags); +internal b32 print_message(Application_Links* app, String_Const_u8 message); +internal b32 log_string(Application_Links* app, String_Const_u8 str); +internal i32 thread_get_id(Application_Links* app); +internal Face_ID get_largest_face_id(Application_Links* app); +internal b32 set_global_face(Application_Links* app, Face_ID id, b32 apply_to_all_buffers); +internal History_Record_Index buffer_history_get_max_record_index(Application_Links* app, Buffer_ID buffer_id); +internal Record_Info buffer_history_get_record_info(Application_Links* app, Buffer_ID buffer_id, History_Record_Index index); +internal Record_Info buffer_history_get_group_sub_record(Application_Links* app, Buffer_ID buffer_id, History_Record_Index index, i32 sub_index); +internal History_Record_Index buffer_history_get_current_state_index(Application_Links* app, Buffer_ID buffer_id); +internal b32 buffer_history_set_current_state_index(Application_Links* app, Buffer_ID buffer_id, History_Record_Index index); +internal b32 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); +internal b32 buffer_history_clear_after_current_state(Application_Links* app, Buffer_ID buffer_id); +internal void global_history_edit_group_begin(Application_Links* app); +internal void global_history_edit_group_end(Application_Links* app); +internal b32 buffer_set_face(Application_Links* app, Buffer_ID buffer_id, Face_ID id); +internal Face_Description get_face_description(Application_Links* app, Face_ID face_id); +internal Face_Metrics get_face_metrics(Application_Links* app, Face_ID face_id); +internal Face_ID get_face_id(Application_Links* app, Buffer_ID buffer_id); +internal Face_ID try_create_new_face(Application_Links* app, Face_Description* description); +internal b32 try_modify_face(Application_Links* app, Face_ID id, Face_Description* description); +internal b32 try_release_face(Application_Links* app, Face_ID id, Face_ID replacement_id); +internal void set_theme_colors(Application_Links* app, Theme_Color* colors, i32 count); +internal void get_theme_colors(Application_Links* app, Theme_Color* colors, i32 count); +internal argb_color finalize_color(Application_Links* app, int_color color); +internal String_Const_u8 push_hot_directory(Application_Links* app, Arena* arena); +internal b32 set_hot_directory(Application_Links* app, String_Const_u8 string); +internal File_List get_file_list(Application_Links* app, Arena* arena, String_Const_u8 directory); +internal void set_gui_up_down_keys(Application_Links* app, Key_Code up_key, Key_Modifier up_key_modifier, Key_Code down_key, Key_Modifier down_key_modifier); +internal void* memory_allocate(Application_Links* app, i32 size); +internal b32 memory_set_protection(Application_Links* app, void* ptr, i32 size, Memory_Protect_Flags flags); +internal void memory_free(Application_Links* app, void* ptr, i32 size); +internal String_Const_u8 push_4ed_path(Application_Links* app, Arena* arena); +internal void show_mouse_cursor(Application_Links* app, Mouse_Cursor_Show_Type show); +internal b32 set_edit_finished_hook_repeat_speed(Application_Links* app, u32 milliseconds); +internal b32 set_fullscreen(Application_Links* app, b32 full_screen); +internal b32 is_fullscreen(Application_Links* app); +internal void send_exit_signal(Application_Links* app); +internal b32 set_window_title(Application_Links* app, String_Const_u8 title); +internal Microsecond_Time_Stamp get_microseconds_timestamp(Application_Links* app); +internal Vec2 draw_string_oriented(Application_Links* app, Face_ID font_id, String_Const_u8 str, Vec2 point, int_color color, u32 flags, Vec2 delta); +internal f32 get_string_advance(Application_Links* app, Face_ID font_id, String_Const_u8 str); +internal void draw_rectangle(Application_Links* app, Rect_f32 rect, int_color color); +internal void draw_rectangle_outline(Application_Links* app, Rect_f32 rect, int_color color); +internal void draw_clip_push(Application_Links* app, Rect_f32 clip_box); +internal f32_Rect draw_clip_pop(Application_Links* app); +internal void draw_coordinate_center_push(Application_Links* app, Vec2 point); +internal Vec2 draw_coordinate_center_pop(Application_Links* app); +internal Text_Layout_ID text_layout_create(Application_Links* app, Buffer_ID buffer_id, Rect_f32 rect, Buffer_Point buffer_point); +internal b32 text_layout_get_buffer(Application_Links* app, Text_Layout_ID text_layout_id, Buffer_ID* buffer_id_out); +internal Interval_i64 text_layout_get_visible_range(Application_Links* app, Text_Layout_ID text_layout_id); +internal Rect_f32 text_layout_line_on_screen(Application_Links* app, Text_Layout_ID layout_id, i64 line_number); +internal Rect_f32 text_layout_character_on_screen(Application_Links* app, Text_Layout_ID layout_id, i64 pos); +internal void paint_text_color(Application_Links* app, Text_Layout_ID layout_id, Interval_i64 range, int_color color); +internal b32 text_layout_free(Application_Links* app, Text_Layout_ID text_layout_id); +internal void draw_text_layout(Application_Links* app, Text_Layout_ID layout_id); +internal void open_color_picker(Application_Links* app, Color_Picker* picker); +internal void animate_in_n_milliseconds(Application_Links* app, u32 n); +internal String_Match_List buffer_find_all_matches(Application_Links* app, Arena* arena, Buffer_ID buffer, i32 string_id, Range_i64 range, String_Const_u8 needle, Character_Predicate* predicate, Scan_Direction direction); +#undef STATIC_LINK_API +#elif defined(DYNAMIC_LINK_API) +global custom_global_set_setting_type *global_set_setting = 0; +global custom_global_set_mapping_type *global_set_mapping = 0; +global custom_global_get_screen_rectangle_type *global_get_screen_rectangle = 0; +global custom_get_thread_context_type *get_thread_context = 0; +global custom_create_child_process_type *create_child_process = 0; +global custom_child_process_set_target_buffer_type *child_process_set_target_buffer = 0; +global custom_buffer_get_attached_child_process_type *buffer_get_attached_child_process = 0; +global custom_child_process_get_attached_buffer_type *child_process_get_attached_buffer = 0; +global custom_child_process_get_state_type *child_process_get_state = 0; +global custom_clipboard_post_type *clipboard_post = 0; +global custom_clipboard_count_type *clipboard_count = 0; +global custom_push_clipboard_index_type *push_clipboard_index = 0; +global custom_get_buffer_count_type *get_buffer_count = 0; +global custom_get_buffer_next_type *get_buffer_next = 0; +global custom_get_buffer_by_name_type *get_buffer_by_name = 0; +global custom_get_buffer_by_file_name_type *get_buffer_by_file_name = 0; +global custom_buffer_read_range_type *buffer_read_range = 0; +global custom_buffer_replace_range_type *buffer_replace_range = 0; +global custom_buffer_batch_edit_type *buffer_batch_edit = 0; +global custom_buffer_seek_string_type *buffer_seek_string = 0; +global custom_buffer_seek_character_class_type *buffer_seek_character_class = 0; +global custom_buffer_line_y_difference_type *buffer_line_y_difference = 0; +global custom_buffer_line_shift_y_type *buffer_line_shift_y = 0; +global custom_buffer_pos_at_relative_xy_type *buffer_pos_at_relative_xy = 0; +global custom_buffer_relative_xy_of_pos_type *buffer_relative_xy_of_pos = 0; +global custom_buffer_relative_character_from_pos_type *buffer_relative_character_from_pos = 0; +global custom_buffer_pos_from_relative_character_type *buffer_pos_from_relative_character = 0; +global custom_view_line_y_difference_type *view_line_y_difference = 0; +global custom_view_line_shift_y_type *view_line_shift_y = 0; +global custom_view_pos_at_relative_xy_type *view_pos_at_relative_xy = 0; +global custom_view_relative_xy_of_pos_type *view_relative_xy_of_pos = 0; +global custom_view_relative_character_from_pos_type *view_relative_character_from_pos = 0; +global custom_view_pos_from_relative_character_type *view_pos_from_relative_character = 0; +global custom_buffer_exists_type *buffer_exists = 0; +global custom_buffer_ready_type *buffer_ready = 0; +global custom_buffer_get_access_flags_type *buffer_get_access_flags = 0; +global custom_buffer_get_size_type *buffer_get_size = 0; +global custom_buffer_get_line_count_type *buffer_get_line_count = 0; +global custom_push_buffer_base_name_type *push_buffer_base_name = 0; +global custom_push_buffer_unique_name_type *push_buffer_unique_name = 0; +global custom_push_buffer_file_name_type *push_buffer_file_name = 0; +global custom_buffer_get_dirty_state_type *buffer_get_dirty_state = 0; +global custom_buffer_set_dirty_state_type *buffer_set_dirty_state = 0; +global custom_buffer_get_setting_type *buffer_get_setting = 0; +global custom_buffer_set_setting_type *buffer_set_setting = 0; +global custom_buffer_get_managed_scope_type *buffer_get_managed_scope = 0; +global custom_buffer_send_end_signal_type *buffer_send_end_signal = 0; +global custom_create_buffer_type *create_buffer = 0; +global custom_buffer_save_type *buffer_save = 0; +global custom_buffer_kill_type *buffer_kill = 0; +global custom_buffer_reopen_type *buffer_reopen = 0; +global custom_buffer_get_file_attributes_type *buffer_get_file_attributes = 0; +global custom_get_file_attributes_type *get_file_attributes = 0; +global custom_get_view_next_type *get_view_next = 0; +global custom_get_view_prev_type *get_view_prev = 0; +global custom_get_active_view_type *get_active_view = 0; +global custom_get_active_panel_type *get_active_panel = 0; +global custom_view_exists_type *view_exists = 0; +global custom_view_get_buffer_type *view_get_buffer = 0; +global custom_view_get_cursor_pos_type *view_get_cursor_pos = 0; +global custom_view_get_mark_pos_type *view_get_mark_pos = 0; +global custom_view_get_preferred_x_type *view_get_preferred_x = 0; +global custom_view_set_preferred_x_type *view_set_preferred_x = 0; +global custom_view_get_screen_rect_type *view_get_screen_rect = 0; +global custom_view_get_panel_type *view_get_panel = 0; +global custom_panel_get_view_type *panel_get_view = 0; +global custom_panel_is_split_type *panel_is_split = 0; +global custom_panel_is_leaf_type *panel_is_leaf = 0; +global custom_panel_split_type *panel_split = 0; +global custom_panel_set_split_type *panel_set_split = 0; +global custom_panel_swap_children_type *panel_swap_children = 0; +global custom_panel_get_parent_type *panel_get_parent = 0; +global custom_panel_get_child_type *panel_get_child = 0; +global custom_panel_get_max_type *panel_get_max = 0; +global custom_panel_get_margin_type *panel_get_margin = 0; +global custom_view_close_type *view_close = 0; +global custom_view_get_buffer_region_type *view_get_buffer_region = 0; +global custom_view_get_buffer_scroll_type *view_get_buffer_scroll = 0; +global custom_view_get_basic_scroll_type *view_get_basic_scroll = 0; +global custom_view_set_active_type *view_set_active = 0; +global custom_view_get_setting_type *view_get_setting = 0; +global custom_view_set_setting_type *view_set_setting = 0; +global custom_view_get_managed_scope_type *view_get_managed_scope = 0; +global custom_buffer_compute_cursor_type *buffer_compute_cursor = 0; +global custom_view_compute_cursor_type *view_compute_cursor = 0; +global custom_view_set_cursor_type *view_set_cursor = 0; +global custom_view_set_buffer_scroll_type *view_set_buffer_scroll = 0; +global custom_view_set_basic_scroll_type *view_set_basic_scroll = 0; +global custom_view_set_mark_type *view_set_mark = 0; +global custom_view_set_buffer_type *view_set_buffer = 0; +global custom_view_post_fade_type *view_post_fade = 0; +global custom_view_begin_ui_mode_type *view_begin_ui_mode = 0; +global custom_view_end_ui_mode_type *view_end_ui_mode = 0; +global custom_view_is_in_ui_mode_type *view_is_in_ui_mode = 0; +global custom_view_set_quit_ui_handler_type *view_set_quit_ui_handler = 0; +global custom_view_get_quit_ui_handler_type *view_get_quit_ui_handler = 0; +global custom_create_user_managed_scope_type *create_user_managed_scope = 0; +global custom_destroy_user_managed_scope_type *destroy_user_managed_scope = 0; +global custom_get_global_managed_scope_type *get_global_managed_scope = 0; +global custom_get_managed_scope_with_multiple_dependencies_type *get_managed_scope_with_multiple_dependencies = 0; +global custom_managed_scope_clear_contents_type *managed_scope_clear_contents = 0; +global custom_managed_scope_clear_self_all_dependent_scopes_type *managed_scope_clear_self_all_dependent_scopes = 0; +global custom_managed_scope_allocator_type *managed_scope_allocator = 0; +global custom_managed_id_declare_type *managed_id_declare = 0; +global custom_managed_scope_get_attachment_type *managed_scope_get_attachment = 0; +global custom_managed_scope_attachment_erase_type *managed_scope_attachment_erase = 0; +global custom_alloc_managed_memory_in_scope_type *alloc_managed_memory_in_scope = 0; +global custom_alloc_buffer_markers_on_buffer_type *alloc_buffer_markers_on_buffer = 0; +global custom_managed_object_get_item_size_type *managed_object_get_item_size = 0; +global custom_managed_object_get_item_count_type *managed_object_get_item_count = 0; +global custom_managed_object_get_pointer_type *managed_object_get_pointer = 0; +global custom_managed_object_get_type_type *managed_object_get_type = 0; +global custom_managed_object_get_containing_scope_type *managed_object_get_containing_scope = 0; +global custom_managed_object_free_type *managed_object_free = 0; +global custom_managed_object_store_data_type *managed_object_store_data = 0; +global custom_managed_object_load_data_type *managed_object_load_data = 0; +global custom_get_user_input_type *get_user_input = 0; +global custom_get_command_input_type *get_command_input = 0; +global custom_set_command_input_type *set_command_input = 0; +global custom_get_mouse_state_type *get_mouse_state = 0; +global custom_get_active_query_bars_type *get_active_query_bars = 0; +global custom_start_query_bar_type *start_query_bar = 0; +global custom_end_query_bar_type *end_query_bar = 0; +global custom_print_message_type *print_message = 0; +global custom_log_string_type *log_string = 0; +global custom_thread_get_id_type *thread_get_id = 0; +global custom_get_largest_face_id_type *get_largest_face_id = 0; +global custom_set_global_face_type *set_global_face = 0; +global custom_buffer_history_get_max_record_index_type *buffer_history_get_max_record_index = 0; +global custom_buffer_history_get_record_info_type *buffer_history_get_record_info = 0; +global custom_buffer_history_get_group_sub_record_type *buffer_history_get_group_sub_record = 0; +global custom_buffer_history_get_current_state_index_type *buffer_history_get_current_state_index = 0; +global custom_buffer_history_set_current_state_index_type *buffer_history_set_current_state_index = 0; +global custom_buffer_history_merge_record_range_type *buffer_history_merge_record_range = 0; +global custom_buffer_history_clear_after_current_state_type *buffer_history_clear_after_current_state = 0; +global custom_global_history_edit_group_begin_type *global_history_edit_group_begin = 0; +global custom_global_history_edit_group_end_type *global_history_edit_group_end = 0; +global custom_buffer_set_face_type *buffer_set_face = 0; +global custom_get_face_description_type *get_face_description = 0; +global custom_get_face_metrics_type *get_face_metrics = 0; +global custom_get_face_id_type *get_face_id = 0; +global custom_try_create_new_face_type *try_create_new_face = 0; +global custom_try_modify_face_type *try_modify_face = 0; +global custom_try_release_face_type *try_release_face = 0; +global custom_set_theme_colors_type *set_theme_colors = 0; +global custom_get_theme_colors_type *get_theme_colors = 0; +global custom_finalize_color_type *finalize_color = 0; +global custom_push_hot_directory_type *push_hot_directory = 0; +global custom_set_hot_directory_type *set_hot_directory = 0; +global custom_get_file_list_type *get_file_list = 0; +global custom_set_gui_up_down_keys_type *set_gui_up_down_keys = 0; +global custom_memory_allocate_type *memory_allocate = 0; +global custom_memory_set_protection_type *memory_set_protection = 0; +global custom_memory_free_type *memory_free = 0; +global custom_push_4ed_path_type *push_4ed_path = 0; +global custom_show_mouse_cursor_type *show_mouse_cursor = 0; +global custom_set_edit_finished_hook_repeat_speed_type *set_edit_finished_hook_repeat_speed = 0; +global custom_set_fullscreen_type *set_fullscreen = 0; +global custom_is_fullscreen_type *is_fullscreen = 0; +global custom_send_exit_signal_type *send_exit_signal = 0; +global custom_set_window_title_type *set_window_title = 0; +global custom_get_microseconds_timestamp_type *get_microseconds_timestamp = 0; +global custom_draw_string_oriented_type *draw_string_oriented = 0; +global custom_get_string_advance_type *get_string_advance = 0; +global custom_draw_rectangle_type *draw_rectangle = 0; +global custom_draw_rectangle_outline_type *draw_rectangle_outline = 0; +global custom_draw_clip_push_type *draw_clip_push = 0; +global custom_draw_clip_pop_type *draw_clip_pop = 0; +global custom_draw_coordinate_center_push_type *draw_coordinate_center_push = 0; +global custom_draw_coordinate_center_pop_type *draw_coordinate_center_pop = 0; +global custom_text_layout_create_type *text_layout_create = 0; +global custom_text_layout_get_buffer_type *text_layout_get_buffer = 0; +global custom_text_layout_get_visible_range_type *text_layout_get_visible_range = 0; +global custom_text_layout_line_on_screen_type *text_layout_line_on_screen = 0; +global custom_text_layout_character_on_screen_type *text_layout_character_on_screen = 0; +global custom_paint_text_color_type *paint_text_color = 0; +global custom_text_layout_free_type *text_layout_free = 0; +global custom_draw_text_layout_type *draw_text_layout = 0; +global custom_open_color_picker_type *open_color_picker = 0; +global custom_animate_in_n_milliseconds_type *animate_in_n_milliseconds = 0; +global custom_buffer_find_all_matches_type *buffer_find_all_matches = 0; +#undef DYNAMIC_LINK_API +#endif diff --git a/custom/generated/custom_api_master_list.h b/custom/generated/custom_api_master_list.h new file mode 100644 index 00000000..f8936be3 --- /dev/null +++ b/custom/generated/custom_api_master_list.h @@ -0,0 +1,181 @@ +api(custom) function b32 global_set_setting(Application_Links* app, Global_Setting_ID setting, i32 value); +api(custom) function b32 global_set_mapping(Application_Links* app, void* data, i32 size); +api(custom) function Rect_f32 global_get_screen_rectangle(Application_Links* app); +api(custom) function Thread_Context* get_thread_context(Application_Links* app); +api(custom) function b32 create_child_process(Application_Links* app, String_Const_u8 path, String_Const_u8 command, Child_Process_ID* child_process_id_out); +api(custom) function b32 child_process_set_target_buffer(Application_Links* app, Child_Process_ID child_process_id, Buffer_ID buffer_id, Child_Process_Set_Target_Flags flags); +api(custom) function Child_Process_ID buffer_get_attached_child_process(Application_Links* app, Buffer_ID buffer_id); +api(custom) function Buffer_ID child_process_get_attached_buffer(Application_Links* app, Child_Process_ID child_process_id); +api(custom) function Process_State child_process_get_state(Application_Links* app, Child_Process_ID child_process_id); +api(custom) function b32 clipboard_post(Application_Links* app, i32 clipboard_id, String_Const_u8 string); +api(custom) function i32 clipboard_count(Application_Links* app, i32 clipboard_id); +api(custom) function String_Const_u8 push_clipboard_index(Application_Links* app, Arena* arena, i32 clipboard_id, i32 item_index); +api(custom) function i32 get_buffer_count(Application_Links* app); +api(custom) function Buffer_ID get_buffer_next(Application_Links* app, Buffer_ID buffer_id, Access_Flag access); +api(custom) function Buffer_ID get_buffer_by_name(Application_Links* app, String_Const_u8 name, Access_Flag access); +api(custom) function Buffer_ID get_buffer_by_file_name(Application_Links* app, String_Const_u8 file_name, Access_Flag access); +api(custom) function b32 buffer_read_range(Application_Links* app, Buffer_ID buffer_id, Range_i64 range, char* out); +api(custom) function b32 buffer_replace_range(Application_Links* app, Buffer_ID buffer_id, Range_i64 range, String_Const_u8 string); +api(custom) function b32 buffer_batch_edit(Application_Links* app, Buffer_ID buffer_id, Batch_Edit* batch); +api(custom) function String_Match buffer_seek_string(Application_Links* app, Buffer_ID buffer, String_Const_u8 needle, Scan_Direction direction, i64 start_pos); +api(custom) function String_Match buffer_seek_character_class(Application_Links* app, Buffer_ID buffer, Character_Predicate* predicate, Scan_Direction direction, i64 start_pos); +api(custom) function f32 buffer_line_y_difference(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 line_a, i64 line_b); +api(custom) function Line_Shift_Vertical buffer_line_shift_y(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 line, f32 y_shift); +api(custom) function i64 buffer_pos_at_relative_xy(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, Vec2_f32 relative_xy); +api(custom) function Vec2_f32 buffer_relative_xy_of_pos(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 pos); +api(custom) function i64 buffer_relative_character_from_pos(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 pos); +api(custom) function i64 buffer_pos_from_relative_character(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 relative_character); +api(custom) function f32 view_line_y_difference(Application_Links* app, View_ID view_id, i64 line_a, i64 line_b); +api(custom) function Line_Shift_Vertical view_line_shift_y(Application_Links* app, View_ID view_id, i64 line, f32 y_shift); +api(custom) function i64 view_pos_at_relative_xy(Application_Links* app, View_ID view_id, i64 base_line, Vec2_f32 relative_xy); +api(custom) function Vec2_f32 view_relative_xy_of_pos(Application_Links* app, View_ID view_id, i64 base_line, i64 pos); +api(custom) function i64 view_relative_character_from_pos(Application_Links* app, View_ID view_id, i64 base_line, i64 pos); +api(custom) function i64 view_pos_from_relative_character(Application_Links* app, View_ID view_id, i64 base_line, i64 character); +api(custom) function b32 buffer_exists(Application_Links* app, Buffer_ID buffer_id); +api(custom) function b32 buffer_ready(Application_Links* app, Buffer_ID buffer_id); +api(custom) function Access_Flag buffer_get_access_flags(Application_Links* app, Buffer_ID buffer_id); +api(custom) function i64 buffer_get_size(Application_Links* app, Buffer_ID buffer_id); +api(custom) function i64 buffer_get_line_count(Application_Links* app, Buffer_ID buffer_id); +api(custom) function String_Const_u8 push_buffer_base_name(Application_Links* app, Arena* arena, Buffer_ID buffer_id); +api(custom) function String_Const_u8 push_buffer_unique_name(Application_Links* app, Arena* out, Buffer_ID buffer_id); +api(custom) function String_Const_u8 push_buffer_file_name(Application_Links* app, Arena* arena, Buffer_ID buffer_id); +api(custom) function Dirty_State buffer_get_dirty_state(Application_Links* app, Buffer_ID buffer_id); +api(custom) function b32 buffer_set_dirty_state(Application_Links* app, Buffer_ID buffer_id, Dirty_State dirty_state); +api(custom) function b32 buffer_get_setting(Application_Links* app, Buffer_ID buffer_id, Buffer_Setting_ID setting, i32* value_out); +api(custom) function b32 buffer_set_setting(Application_Links* app, Buffer_ID buffer_id, Buffer_Setting_ID setting, i32 value); +api(custom) function Managed_Scope buffer_get_managed_scope(Application_Links* app, Buffer_ID buffer_id); +api(custom) function b32 buffer_send_end_signal(Application_Links* app, Buffer_ID buffer_id); +api(custom) function Buffer_ID create_buffer(Application_Links* app, String_Const_u8 file_name, Buffer_Create_Flag flags); +api(custom) function b32 buffer_save(Application_Links* app, Buffer_ID buffer_id, String_Const_u8 file_name, Buffer_Save_Flag flags); +api(custom) function Buffer_Kill_Result buffer_kill(Application_Links* app, Buffer_ID buffer_id, Buffer_Kill_Flag flags); +api(custom) function Buffer_Reopen_Result buffer_reopen(Application_Links* app, Buffer_ID buffer_id, Buffer_Reopen_Flag flags); +api(custom) function File_Attributes buffer_get_file_attributes(Application_Links* app, Buffer_ID buffer_id); +api(custom) function File_Attributes get_file_attributes(Application_Links* app, String_Const_u8 file_name); +api(custom) function View_ID get_view_next(Application_Links* app, View_ID view_id, Access_Flag access); +api(custom) function View_ID get_view_prev(Application_Links* app, View_ID view_id, Access_Flag access); +api(custom) function View_ID get_active_view(Application_Links* app, Access_Flag access); +api(custom) function Panel_ID get_active_panel(Application_Links* app); +api(custom) function b32 view_exists(Application_Links* app, View_ID view_id); +api(custom) function Buffer_ID view_get_buffer(Application_Links* app, View_ID view_id, Access_Flag access); +api(custom) function i64 view_get_cursor_pos(Application_Links* app, View_ID view_id); +api(custom) function i64 view_get_mark_pos(Application_Links* app, View_ID view_id); +api(custom) function f32 view_get_preferred_x(Application_Links* app, View_ID view_id); +api(custom) function b32 view_set_preferred_x(Application_Links* app, View_ID view_id, f32 x); +api(custom) function Rect_f32 view_get_screen_rect(Application_Links* app, View_ID view_id); +api(custom) function Panel_ID view_get_panel(Application_Links* app, View_ID view_id); +api(custom) function View_ID panel_get_view(Application_Links* app, Panel_ID panel_id); +api(custom) function b32 panel_is_split(Application_Links* app, Panel_ID panel_id); +api(custom) function b32 panel_is_leaf(Application_Links* app, Panel_ID panel_id); +api(custom) function b32 panel_split(Application_Links* app, Panel_ID panel_id, Panel_Split_Orientation orientation); +api(custom) function b32 panel_set_split(Application_Links* app, Panel_ID panel_id, Panel_Split_Kind kind, float t); +api(custom) function b32 panel_swap_children(Application_Links* app, Panel_ID panel_id, Panel_Split_Kind kind, float t); +api(custom) function Panel_ID panel_get_parent(Application_Links* app, Panel_ID panel_id); +api(custom) function Panel_ID panel_get_child(Application_Links* app, Panel_ID panel_id, Panel_Child which_child); +api(custom) function Panel_ID panel_get_max(Application_Links* app, Panel_ID panel_id); +api(custom) function Rect_i32 panel_get_margin(Application_Links* app, Panel_ID panel_id); +api(custom) function b32 view_close(Application_Links* app, View_ID view_id); +api(custom) function Rect_f32 view_get_buffer_region(Application_Links* app, View_ID view_id); +api(custom) function Buffer_Scroll view_get_buffer_scroll(Application_Links* app, View_ID view_id); +api(custom) function Basic_Scroll view_get_basic_scroll(Application_Links* app, View_ID view_id); +api(custom) function b32 view_set_active(Application_Links* app, View_ID view_id); +api(custom) function b32 view_get_setting(Application_Links* app, View_ID view_id, View_Setting_ID setting, i32* value_out); +api(custom) function b32 view_set_setting(Application_Links* app, View_ID view_id, View_Setting_ID setting, i32 value); +api(custom) function Managed_Scope view_get_managed_scope(Application_Links* app, View_ID view_id); +api(custom) function Buffer_Cursor buffer_compute_cursor(Application_Links* app, Buffer_ID buffer, Buffer_Seek seek); +api(custom) function Buffer_Cursor view_compute_cursor(Application_Links* app, View_ID view_id, Buffer_Seek seek); +api(custom) function b32 view_set_cursor(Application_Links* app, View_ID view_id, Buffer_Seek seek); +api(custom) function b32 view_set_buffer_scroll(Application_Links* app, View_ID view_id, Buffer_Scroll scroll); +api(custom) function b32 view_set_basic_scroll(Application_Links* app, View_ID view_id, Basic_Scroll scroll); +api(custom) function b32 view_set_mark(Application_Links* app, View_ID view_id, Buffer_Seek seek); +api(custom) function b32 view_set_buffer(Application_Links* app, View_ID view_id, Buffer_ID buffer_id, Set_Buffer_Flag flags); +api(custom) function b32 view_post_fade(Application_Links* app, View_ID view_id, f32 seconds, Range_i64 range, int_color color); +api(custom) function b32 view_begin_ui_mode(Application_Links* app, View_ID view_id); +api(custom) function b32 view_end_ui_mode(Application_Links* app, View_ID view_id); +api(custom) function b32 view_is_in_ui_mode(Application_Links* app, View_ID view_id); +api(custom) function b32 view_set_quit_ui_handler(Application_Links* app, View_ID view_id, UI_Quit_Function_Type* quit_function); +api(custom) function b32 view_get_quit_ui_handler(Application_Links* app, View_ID view_id, UI_Quit_Function_Type** quit_function_out); +api(custom) function Managed_Scope create_user_managed_scope(Application_Links* app); +api(custom) function b32 destroy_user_managed_scope(Application_Links* app, Managed_Scope scope); +api(custom) function Managed_Scope get_global_managed_scope(Application_Links* app); +api(custom) function Managed_Scope get_managed_scope_with_multiple_dependencies(Application_Links* app, Managed_Scope* scopes, i32 count); +api(custom) function b32 managed_scope_clear_contents(Application_Links* app, Managed_Scope scope); +api(custom) function b32 managed_scope_clear_self_all_dependent_scopes(Application_Links* app, Managed_Scope scope); +api(custom) function Base_Allocator* managed_scope_allocator(Application_Links* app, Managed_Scope scope); +api(custom) function Managed_ID managed_id_declare(Application_Links* app, String_Const_u8 name); +api(custom) function void* managed_scope_get_attachment(Application_Links* app, Managed_Scope scope, Managed_ID id, umem size); +api(custom) function void* managed_scope_attachment_erase(Application_Links* app, Managed_Scope scope, Managed_ID id); +api(custom) function Managed_Object alloc_managed_memory_in_scope(Application_Links* app, Managed_Scope scope, i32 item_size, i32 count); +api(custom) function Managed_Object alloc_buffer_markers_on_buffer(Application_Links* app, Buffer_ID buffer_id, i32 count, Managed_Scope* optional_extra_scope); +api(custom) function u32 managed_object_get_item_size(Application_Links* app, Managed_Object object); +api(custom) function u32 managed_object_get_item_count(Application_Links* app, Managed_Object object); +api(custom) function void* managed_object_get_pointer(Application_Links* app, Managed_Object object); +api(custom) function Managed_Object_Type managed_object_get_type(Application_Links* app, Managed_Object object); +api(custom) function Managed_Scope managed_object_get_containing_scope(Application_Links* app, Managed_Object object); +api(custom) function b32 managed_object_free(Application_Links* app, Managed_Object object); +api(custom) function b32 managed_object_store_data(Application_Links* app, Managed_Object object, u32 first_index, u32 count, void* mem); +api(custom) function b32 managed_object_load_data(Application_Links* app, Managed_Object object, u32 first_index, u32 count, void* mem_out); +api(custom) function User_Input get_user_input(Application_Links* app, Input_Type_Flag get_type, Input_Type_Flag abort_type); +api(custom) function User_Input get_command_input(Application_Links* app); +api(custom) function void set_command_input(Application_Links* app, Key_Event_Data key_data); +api(custom) function Mouse_State get_mouse_state(Application_Links* app); +api(custom) function b32 get_active_query_bars(Application_Links* app, View_ID view_id, i32 max_result_count, Query_Bar_Ptr_Array* array_out); +api(custom) function b32 start_query_bar(Application_Links* app, Query_Bar* bar, u32 flags); +api(custom) function void end_query_bar(Application_Links* app, Query_Bar* bar, u32 flags); +api(custom) function b32 print_message(Application_Links* app, String_Const_u8 message); +api(custom) function b32 log_string(Application_Links* app, String_Const_u8 str); +api(custom) function i32 thread_get_id(Application_Links* app); +api(custom) function Face_ID get_largest_face_id(Application_Links* app); +api(custom) function b32 set_global_face(Application_Links* app, Face_ID id, b32 apply_to_all_buffers); +api(custom) function History_Record_Index buffer_history_get_max_record_index(Application_Links* app, Buffer_ID buffer_id); +api(custom) function Record_Info buffer_history_get_record_info(Application_Links* app, Buffer_ID buffer_id, History_Record_Index index); +api(custom) function Record_Info buffer_history_get_group_sub_record(Application_Links* app, Buffer_ID buffer_id, History_Record_Index index, i32 sub_index); +api(custom) function History_Record_Index buffer_history_get_current_state_index(Application_Links* app, Buffer_ID buffer_id); +api(custom) function b32 buffer_history_set_current_state_index(Application_Links* app, Buffer_ID buffer_id, History_Record_Index index); +api(custom) function b32 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); +api(custom) function b32 buffer_history_clear_after_current_state(Application_Links* app, Buffer_ID buffer_id); +api(custom) function void global_history_edit_group_begin(Application_Links* app); +api(custom) function void global_history_edit_group_end(Application_Links* app); +api(custom) function b32 buffer_set_face(Application_Links* app, Buffer_ID buffer_id, Face_ID id); +api(custom) function Face_Description get_face_description(Application_Links* app, Face_ID face_id); +api(custom) function Face_Metrics get_face_metrics(Application_Links* app, Face_ID face_id); +api(custom) function Face_ID get_face_id(Application_Links* app, Buffer_ID buffer_id); +api(custom) function Face_ID try_create_new_face(Application_Links* app, Face_Description* description); +api(custom) function b32 try_modify_face(Application_Links* app, Face_ID id, Face_Description* description); +api(custom) function b32 try_release_face(Application_Links* app, Face_ID id, Face_ID replacement_id); +api(custom) function void set_theme_colors(Application_Links* app, Theme_Color* colors, i32 count); +api(custom) function void get_theme_colors(Application_Links* app, Theme_Color* colors, i32 count); +api(custom) function argb_color finalize_color(Application_Links* app, int_color color); +api(custom) function String_Const_u8 push_hot_directory(Application_Links* app, Arena* arena); +api(custom) function b32 set_hot_directory(Application_Links* app, String_Const_u8 string); +api(custom) function File_List get_file_list(Application_Links* app, Arena* arena, String_Const_u8 directory); +api(custom) function void set_gui_up_down_keys(Application_Links* app, Key_Code up_key, Key_Modifier up_key_modifier, Key_Code down_key, Key_Modifier down_key_modifier); +api(custom) function void* memory_allocate(Application_Links* app, i32 size); +api(custom) function b32 memory_set_protection(Application_Links* app, void* ptr, i32 size, Memory_Protect_Flags flags); +api(custom) function void memory_free(Application_Links* app, void* ptr, i32 size); +api(custom) function String_Const_u8 push_4ed_path(Application_Links* app, Arena* arena); +api(custom) function void show_mouse_cursor(Application_Links* app, Mouse_Cursor_Show_Type show); +api(custom) function b32 set_edit_finished_hook_repeat_speed(Application_Links* app, u32 milliseconds); +api(custom) function b32 set_fullscreen(Application_Links* app, b32 full_screen); +api(custom) function b32 is_fullscreen(Application_Links* app); +api(custom) function void send_exit_signal(Application_Links* app); +api(custom) function b32 set_window_title(Application_Links* app, String_Const_u8 title); +api(custom) function Microsecond_Time_Stamp get_microseconds_timestamp(Application_Links* app); +api(custom) function Vec2 draw_string_oriented(Application_Links* app, Face_ID font_id, String_Const_u8 str, Vec2 point, int_color color, u32 flags, Vec2 delta); +api(custom) function f32 get_string_advance(Application_Links* app, Face_ID font_id, String_Const_u8 str); +api(custom) function void draw_rectangle(Application_Links* app, Rect_f32 rect, int_color color); +api(custom) function void draw_rectangle_outline(Application_Links* app, Rect_f32 rect, int_color color); +api(custom) function void draw_clip_push(Application_Links* app, Rect_f32 clip_box); +api(custom) function f32_Rect draw_clip_pop(Application_Links* app); +api(custom) function void draw_coordinate_center_push(Application_Links* app, Vec2 point); +api(custom) function Vec2 draw_coordinate_center_pop(Application_Links* app); +api(custom) function Text_Layout_ID text_layout_create(Application_Links* app, Buffer_ID buffer_id, Rect_f32 rect, Buffer_Point buffer_point); +api(custom) function b32 text_layout_get_buffer(Application_Links* app, Text_Layout_ID text_layout_id, Buffer_ID* buffer_id_out); +api(custom) function Interval_i64 text_layout_get_visible_range(Application_Links* app, Text_Layout_ID text_layout_id); +api(custom) function Rect_f32 text_layout_line_on_screen(Application_Links* app, Text_Layout_ID layout_id, i64 line_number); +api(custom) function Rect_f32 text_layout_character_on_screen(Application_Links* app, Text_Layout_ID layout_id, i64 pos); +api(custom) function void paint_text_color(Application_Links* app, Text_Layout_ID layout_id, Interval_i64 range, int_color color); +api(custom) function b32 text_layout_free(Application_Links* app, Text_Layout_ID text_layout_id); +api(custom) function void draw_text_layout(Application_Links* app, Text_Layout_ID layout_id); +api(custom) function void open_color_picker(Application_Links* app, Color_Picker* picker); +api(custom) function void animate_in_n_milliseconds(Application_Links* app, u32 n); +api(custom) function String_Match_List buffer_find_all_matches(Application_Links* app, Arena* arena, Buffer_ID buffer, i32 string_id, Range_i64 range, String_Const_u8 needle, Character_Predicate* predicate, Scan_Direction direction); diff --git a/platform_win32/win32_4ed.cpp b/platform_win32/win32_4ed.cpp index 24c69fed..e2f7947c 100644 --- a/platform_win32/win32_4ed.cpp +++ b/platform_win32/win32_4ed.cpp @@ -1615,6 +1615,7 @@ WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdS char custom_not_found_msg[] = "Did not find a library for the custom layer."; char custom_fail_version_msg[] = "Failed to load custom code due to missing version information or a version mismatch. Try rebuilding with buildsuper."; char custom_fail_missing_get_bindings_msg[] = "Failed to load custom code due to missing 'get_bindings' symbol. Try rebuilding with buildsuper."; + char custom_fail_init_apis[] = "Failed to load custom code due to missing 'init_apis' symbol. Try rebuilding with buildsuper"; Scratch_Block scratch(win32vars.tctx, Scratch_Share); String_Const_u8 default_file_name = string_u8_litexpr("custom_4coder.dll"); @@ -1650,14 +1651,18 @@ WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdS if (!has_library){ system_error_box(scratch, custom_not_found_msg); } - custom.get_alpha_4coder_version = (_Get_Version_Function*)system_get_proc(custom_library, "get_alpha_4coder_version"); - if (custom.get_alpha_4coder_version == 0 || custom.get_alpha_4coder_version(MAJOR, MINOR, PATCH) == 0){ + custom.get_version = (_Get_Version_Function*)system_get_proc(custom_library, "get_version"); + if (custom.get_version == 0 || custom.get_version(MAJOR, MINOR, PATCH) == 0){ system_error_box(scratch, custom_fail_version_msg); } custom.get_bindings = (Get_Binding_Data_Function*)system_get_proc(custom_library, "get_bindings"); if (custom.get_bindings == 0){ system_error_box(scratch, custom_fail_missing_get_bindings_msg); } + custom.init_apis = (_Init_APIs*)system_get_proc(custom_library, "init_apis"); + if (custom.init_apis == 0){ + system_error_box(scratch, custom_fail_init_apis); + } } // diff --git a/project.4coder b/project.4coder index 02dfbbaf..ebf6ae73 100644 --- a/project.4coder +++ b/project.4coder @@ -59,7 +59,11 @@ command_list = { { .name = "build api parser", .out = "*compilation*", .footer_panel = true, .save_dirty_files = true, - .cmd = { { "custom\\bin\\build_one_time 4ed_api_parser.cpp ..\\build & copy /B one_time.exe api_parser.exe", .os = "win" }, }, }, + .cmd = { { "custom\\bin\\build_one_time 4ed_api_parser.cpp ..\\build & copy /B ..\\build\\one_time.exe ..\\build\\api_parser.exe", .os = "win" }, }, }, + + { .name = "generate custom api master list", + .out = "*run*", .footer_panel = false, .save_dirty_files = false, + .cmd = { { "..\\build\\api_parser 4ed_api_implementation.cpp", .os = "win" }, }, }, }; fkey_command[1] = "build x64";