A user reported on the handmade network discord an issue where when you change the font size (e.g. ctrl + scroll up/down) 4coder was crashing. They were using the D3D11 renderer.

The crash is caused by dereferencing a invalid pointer to a texture. The D3D11 renderer as a arbitrary limit of 32 textures (there is normally no reason to have more than 2 or 3 textures in 4coder) because it needs to keep track of a few pointer in its state, while OpenGL doesn't (it just uses the id returned by `glGenTexture`). The code that recreate the texture atlas when changing the font size, never frees the previous texture, so both DirectX and OpenGL are leaking texture.

So this fix just frees the previous texture after 4coder successfully creates a new one. If for some reason the new texture can't be created, we continue using the last one. This is better than crashing as we can still use 4coder, but since we can't change font size anymore the editor might be stuck with a uncomfortable font size.

Unfortunately 4coder doesn't expose a way to delete texture outside the platform layer, and the font size code is not in the platform layer. So I had to expose a `free texture` function, which lead me to understand how 4coder generates API in the `generated` folder.

I updated the README to keep that information somewhere since it's not clear from the get go. The basic idea is that there are a few files that you can compile as a small standalone program and run to generate the files. For the graphics api, you need to compile `4ed_graphics_api.cpp`.

I took some time to also modify a little the generator so that the generated file contains the name of the file that generated them, and added a bit of indentation to make the file a bit more readable (even if we're not supposed to modify them).
This commit is contained in:
Simon Anciaux 2025-01-06 18:37:44 +01:00 committed by Peter Slattery
parent e040b1a29b
commit 0e2b8d0df8
24 changed files with 2298 additions and 2098 deletions

View File

@ -26,5 +26,55 @@ Welcome to the 4coder community repository.
1. `$ cd 4cc/code`
2. `$ ./bin/build-linux.sh`
## Mac (Untested)
1. The steps should be the same as linux but replace the `*-linux.sh` with their `*-mac.sh` equivalents.
## Mac
> 4coder targets x86_64. If you are using a M1+ ARM CPU you need to prefix the build scripts commands with: `arch -arch x86_64`
1. Use the `package-mac.sh` script from the code directory (this builds a distribution in the `distributions` directory with all the non-binary dependencies)
1. `$ cd 4cc/code`
2. `$ ./bin/package-mac.sh`
2. You can also use the `build-mac.sh` script if you want just build the binaries, (this produces the build artifacts in the `build` directory, this doesn't produce a functional distribution)
1. `$ cd 4cc/code`
2. `$ ./bin/build-mac.sh`
### Older Macs, 10.15.7 Catalina
If you are using an older version of mac, such as 10.15.7 Catalina you need to install the realpath command:
1. `$ sudo port install coreutils`
2. macports names the `realpath` command `grealpath`, so make a symbolic link in order to use build-mac.sh:
`$ sudo ln -s /opt/local/bin/grealpath /opt/local/bin/realpath`
## Build script parameter
The build script accepts a parameter (mutually exclusive):
- `/DDEV_BUILD` or `/DDEV_BUILD_X86` (default value) : build without optimizations.
Produces debug symbols.
Defines: `FRED_INTERNAL`, `FRED_SUPER`, `DO_CRAZY_EXPENSIVE_ASSERTS` (on Windows) macros.
- `/DOPT_BUILD` or `/DOPT_BUILD_X86` (similar to `build_optimized` script): build with optimizations.
Doesn't produce debug symbols.
Defines `FRED_SUPER` macro.
- `/DPACKAGE_SUPER_X64` or `/DPACKAGE_SUPER_X86` (similar to `package` script): package 4coder for distribution.
Turns on optimizations.
Produces debug symbols.
Defines `SHIP_MODE`, `FRED_SUPER`, `DO_CRAZY_EXPENSIVE_ASSERTS` (on Windows) macros.
- `/DPACKAGE_DEMO_X64` or `/DPACKAGE_DEMO_X86`: packages 4coder demo for distribution.
Turns on optimizations.
Produces debug symbols.
Defines `SHIP_MODE`, `DO_CRAZY_EXPENSIVE_ASSERTS` (on Windows) macros.
## API generators
4coder uses several small programs to generate some headers and source files. Those do not run automatically, you must build them and run them when needed (which shouldn't really happen).
- `code\4ed_font_api.cpp` creates, in `code\generated`, `font_api.h`, `font_api.cpp`, `font_api_constructor.cpp` (not used) and `font_api_master_list.h` (not used);
- `code\4ed_graphics_api.cpp` creates, in `code\generated`, `graphics_api.h` and `graphics_api.cpp`, `graphics_api_constructor.cpp` (not used) and `graphics_api_master_list.h` (not used);
- `code\4ed_system_api.cpp` creates, in `code\custom\generated`, `system_api.h`, `system_api.cpp`, `system_api_constructor.cpp`, `system_api_master_list.h`;
- `code\4ed_api_parser_main.cpp` is a little different, as it parses source files passed as parameters to search for functions and type preceded by `api(some_api_name)` and creates 4 files in the `code\custom\generated`. It is used to generate `custom_api.h`, `custom_api.cpp`, `custom_api_constructor.cpp` and `custom_api_master_list.h` by passing `code\4ed_api_implementation.cpp` as a parameter.
You need to compile one of those file and run it from the `code` directory.
There is also `code\4ed_api_check.cpp` to verify the generated file but it's not clear at the moment what to check against.
- `code\4ed_generate_keycodes.cpp` is also a bit appart as it generates `code\custom\generated\4coder_event_codes.h` which are keyboard key codes and some event hook ids.

View File

@ -208,7 +208,10 @@ api_get_callable_name(Arena *arena, String_Const_u8 api_name, String_Const_u8 na
////////////////////////////////
function void
generate_api_master_list(Arena *scratch, API_Definition *api, API_Generation_Flag flags, FILE *out){
generate_api_master_list(Arena *scratch, API_Definition *api, API_Generation_Flag flags, FILE *out, String_Const_u8 generated_by){
fprintf(out, "/* Generated by \"%.*s\" */\n\n", string_expand(generated_by));
for (API_Call *call = api->first_call;
call != 0;
call = call->next){
@ -236,7 +239,10 @@ generate_api_master_list(Arena *scratch, API_Definition *api, API_Generation_Fla
}
function void
generate_header(Arena *scratch, API_Definition *api, API_Generation_Flag flags, FILE *out){
generate_header(Arena *scratch, API_Definition *api, API_Generation_Flag flags, FILE *out, String_Const_u8 generated_by){
fprintf(out, "/* Generated by \"%.*s\" */\n\n", string_expand(generated_by));
for (API_Call *call = api->first_call;
call != 0;
call = call->next){
@ -264,6 +270,8 @@ generate_header(Arena *scratch, API_Definition *api, API_Generation_Flag flags,
fprintf(out, ")\n");
}
fprintf(out, "\n");
for (API_Call *call = api->first_call;
call != 0;
call = call->next){
@ -289,11 +297,13 @@ generate_header(Arena *scratch, API_Definition *api, API_Generation_Flag flags,
fprintf(out, ");\n");
}
fprintf(out, "\n");
fprintf(out, "struct API_VTable_%.*s{\n", string_expand(api->name));
for (API_Call *call = api->first_call;
call != 0;
call = call->next){
fprintf(out, "%.*s_%.*s_type *",
fprintf(out, " %.*s_%.*s_type *",
string_expand(api->name),
string_expand(call->name));
fprintf(out, "%.*s",
@ -302,6 +312,8 @@ generate_header(Arena *scratch, API_Definition *api, API_Generation_Flag flags,
}
fprintf(out, "};\n");
fprintf(out, "\n");
fprintf(out, "#if defined(STATIC_LINK_API)\n");
for (API_Call *call = api->first_call;
call != 0;
@ -328,6 +340,7 @@ generate_header(Arena *scratch, API_Definition *api, API_Generation_Flag flags,
fprintf(out, ");\n");
}
fprintf(out, "#undef STATIC_LINK_API\n");
fprintf(out, "\n");
fprintf(out, "#elif defined(DYNAMIC_LINK_API)\n");
for (API_Call *call = api->first_call;
call != 0;
@ -343,7 +356,10 @@ generate_header(Arena *scratch, API_Definition *api, API_Generation_Flag flags,
}
function void
generate_cpp(Arena *scratch, API_Definition *api, API_Generation_Flag flags, FILE *out){
generate_cpp(Arena *scratch, API_Definition *api, API_Generation_Flag flags, FILE *out, String_Const_u8 generated_by){
fprintf(out, "/* Generated by \"%.*s\" */\n\n", string_expand(generated_by));
fprintf(out, "function void\n");
fprintf(out, "%.*s_api_fill_vtable(API_VTable_%.*s *vtable){\n",
string_expand(api->name),
@ -352,11 +368,12 @@ generate_cpp(Arena *scratch, API_Definition *api, API_Generation_Flag flags, FIL
call != 0;
call = call->next){
String_Const_u8 callable_name = api_get_callable_name(scratch, api->name, call->name, flags);
fprintf(out, "vtable->%.*s = %.*s;\n",
fprintf(out, " vtable->%.*s = %.*s;\n",
string_expand(call->name),
string_expand(callable_name));
}
fprintf(out, "}\n");
fprintf(out, "\n");
fprintf(out, "#if defined(DYNAMIC_LINK_API)\n");
fprintf(out, "function void\n");
@ -367,7 +384,7 @@ generate_cpp(Arena *scratch, API_Definition *api, API_Generation_Flag flags, FIL
call != 0;
call = call->next){
String_Const_u8 callable_name = api_get_callable_name(scratch, api->name, call->name, flags);
fprintf(out, "%.*s = vtable->%.*s;\n",
fprintf(out, " %.*s = vtable->%.*s;\n",
string_expand(callable_name),
string_expand(call->name));
}
@ -377,18 +394,21 @@ generate_cpp(Arena *scratch, API_Definition *api, API_Generation_Flag flags, FIL
}
function void
generate_constructor(Arena *scratch, API_Definition *api, API_Generation_Flag flags, FILE *out){
generate_constructor(Arena *scratch, API_Definition *api, API_Generation_Flag flags, FILE *out, String_Const_u8 generated_by){
fprintf(out, "/* Generated by \"%.*s\" */\n\n", string_expand(generated_by));
fprintf(out, "function API_Definition*\n");
fprintf(out, "%.*s_api_construct(Arena *arena){\n",
string_expand(api->name));
fprintf(out, "API_Definition *result = begin_api(arena, \"%.*s\");\n",
fprintf(out, " API_Definition *result = begin_api(arena, \"%.*s\");\n",
string_expand(api->name));
for (API_Call *call = api->first_call;
call != 0;
call = call->next){
fprintf(out, "{\n");
fprintf(out, "API_Call *call = api_call_with_location(arena, result, "
fprintf(out, " {\n");
fprintf(out, " API_Call *call = api_call_with_location(arena, result, "
"string_u8_litexpr(\"%.*s\"), "
"string_u8_litexpr(\"%.*s\"), "
"string_u8_litexpr(\"\"));\n",
@ -396,29 +416,29 @@ generate_constructor(Arena *scratch, API_Definition *api, API_Generation_Flag fl
string_expand(call->return_type));
if (call->params.count == 0){
fprintf(out, "(void)call;\n");
fprintf(out, " (void)call;\n");
}
else{
for (API_Param *param = call->params.first;
param != 0;
param = param->next){
fprintf(out, "api_param(arena, call, \"%.*s\", \"%.*s\");\n",
fprintf(out, " api_param(arena, call, \"%.*s\", \"%.*s\");\n",
string_expand(param->type_name),
string_expand(param->name));
}
}
fprintf(out, "}\n");
fprintf(out, " }\n");
}
fprintf(out, "return(result);\n");
fprintf(out, " return(result);\n");
fprintf(out, "}\n");
}
////////////////////////////////
function b32
api_definition_generate_api_includes(Arena *arena, API_Definition *api, Generated_Group group, API_Generation_Flag flags){
api_definition_generate_api_includes(Arena *arena, API_Definition *api, Generated_Group group, API_Generation_Flag flags, String_Const_u8 generated_by){
// NOTE(allen): Arrange output files
String_Const_u8 path_to_self = string_u8_litexpr(__FILE__);
@ -494,10 +514,10 @@ api_definition_generate_api_includes(Arena *arena, API_Definition *api, Generate
// 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);
generate_constructor(arena, api, flags, out_file_con);
generate_api_master_list(arena, api, flags, out_file_ml, generated_by);
generate_header(arena, api, flags, out_file_h, generated_by);
generate_cpp(arena, api, flags, out_file_cpp, generated_by);
generate_constructor(arena, api, flags, out_file_con, generated_by);
////////////////////////////////
@ -594,7 +614,7 @@ api_definition_check(Arena *arena, API_Definition *correct, API_Definition *remo
API_Call *correct_call = api_get_call(correct, call->name);
if (correct_call == 0 && report_extra){
api_definition_error(arena, error_list,
"remote call", call,
"remote call", call,
"does not exist in api master");
}
}

View File

@ -31,7 +31,7 @@ int
main(void){
Arena arena = make_arena_malloc();
API_Definition *api = define_api(&arena);
if (!api_definition_generate_api_includes(&arena, api, get_api_group(), 0)){
if (!api_definition_generate_api_includes(&arena, api, get_api_group(), 0, SCu8(GENERATED_BY))){
return(1);
}
return(0);

View File

@ -37,9 +37,49 @@ main(int argc, char **argv){
exit(1);
}
String_Const_u8 exe = SCu8("4ed_api_parser_main.exe");
u32 command_line_length = exe.size + 1;
String_Const_u8 command_line = { 0 };
for (i32 i = 1; i < argc; i+=1){
command_line_length += cstring_length(argv[i]) + 1;
}
command_line = push_data(&arena, command_line_length);
u8* command_line_current = command_line.str;
u8* command_line_end = command_line.str + command_line.size;
{
char* c = ( char* ) exe.str;
while ( *c != 0 && command_line_current < command_line_end ) {
*command_line_current = *c;
command_line_current++;
c++;
}
}
if ( command_line_current < command_line_end ) {
*command_line_current = ' ';
command_line_current++;
}
API_Definition_List list = {};
for (i32 i = 1; i < argc; i += 1){
char *file_name = argv[i];
char* c = file_name;
while ( *c != 0 && command_line_current < command_line_end ) {
*command_line_current = *c;
command_line_current++;
c++;
}
if ( command_line_current < command_line_end ) {
*command_line_current = ' ';
command_line_current++;
}
FILE *file = fopen(file_name, "rb");
if (file == 0){
printf("error: could not open input file: '%s'\n", argv[i]);
@ -57,7 +97,7 @@ main(int argc, char **argv){
for (API_Definition *node = list.first;
node != 0;
node = node->next){
api_definition_generate_api_includes(&arena, node, GeneratedGroup_Custom, APIGeneration_NoAPINameOnCallables);
api_definition_generate_api_includes(&arena, node, GeneratedGroup_Custom, APIGeneration_NoAPINameOnCallables, command_line);
}
}

View File

@ -9,6 +9,8 @@
// TOP
#define GENERATED_BY "4ed_font_api.cpp"
#include "4ed_api_definition_main.cpp"
function API_Definition*

View File

@ -200,7 +200,7 @@ ft__font_make_face(Arena *arena, Face_Description *description, f32 scale_factor
if (error == 0){
face = push_array_zero(arena, Face, 1);
u32 pt_size_unscaled = Max(description->parameters.pt_size, 8);
u32 pt_size_unscaled = Max(description->parameters.pt_size, 8);
u32 pt_size = (u32)(pt_size_unscaled*scale_factor);
b32 hinting = description->parameters.hinting;
@ -332,59 +332,69 @@ ft__font_make_face(Arena *arena, Face_Description *description, f32 scale_factor
Texture_Kind texture_kind = TextureKind_Mono;
u32 texture = graphics_get_texture(pack.dim, texture_kind);
face->texture_kind = texture_kind;
face->texture = texture;
Vec3_f32 texture_dim = V3f32(pack.dim);
face->texture_dim = texture_dim;
{
Vec3_i32 p = V3i32((i32)face->white.uv.x0, (i32)face->white.uv.y0, (i32)face->white.w);
Vec3_i32 dim = V3i32(white.dim.x, white.dim.y, 1);
graphics_fill_texture(texture_kind, texture, p, dim, white.data);
face->white.uv.x1 = (face->white.uv.x0 + face->white.uv.x1)/texture_dim.x;
face->white.uv.y1 = (face->white.uv.y0 + face->white.uv.y1)/texture_dim.y;
face->white.uv.x0 = face->white.uv.x0/texture_dim.x;
face->white.uv.y0 = face->white.uv.y0/texture_dim.y;
face->white.w /= texture_dim.z;
}
for (u16 i = 0; i < index_count; i += 1){
Vec3_i32 p = V3i32((i32)face->bounds[i].uv.x0, (i32)face->bounds[i].uv.y0, (i32)face->bounds[i].w);
Vec3_i32 dim = V3i32(glyph_bitmaps[i].dim.x, glyph_bitmaps[i].dim.y, 1);
graphics_fill_texture(texture_kind, texture, p, dim, glyph_bitmaps[i].data);
face->bounds[i].uv.x1 = (face->bounds[i].uv.x0 + face->bounds[i].uv.x1)/texture_dim.x;
face->bounds[i].uv.y1 = (face->bounds[i].uv.y0 + face->bounds[i].uv.y1)/texture_dim.y;
face->bounds[i].uv.x0 = face->bounds[i].uv.x0/texture_dim.x;
face->bounds[i].uv.y0 = face->bounds[i].uv.y0/texture_dim.y;
face->bounds[i].w /= texture_dim.z;
}
{
Face_Advance_Map *advance_map = &face->advance_map;
/* NOTE simon (06/01/25): This assumes that every platforms don't use 0 as a valid texture id.
This is valid for OpenGL and the DX11 implementaion. Someone needs to check the MAC versions. */
if (texture != 0 ){
met->space_advance = font_get_glyph_advance(advance_map, met, ' ', 0);
met->decimal_digit_advance =
font_get_max_glyph_advance_range(advance_map, met, '0', '9', 0);
met->hex_digit_advance =
font_get_max_glyph_advance_range(advance_map, met, 'A', 'F', 0);
met->hex_digit_advance =
Max(met->hex_digit_advance, met->decimal_digit_advance);
met->byte_sub_advances[0] =
font_get_glyph_advance(advance_map, met, '\\', 0);
met->byte_sub_advances[1] = met->hex_digit_advance;
met->byte_sub_advances[2] = met->hex_digit_advance;
met->byte_advance =
met->byte_sub_advances[0] +
met->byte_sub_advances[1] +
met->byte_sub_advances[2];
met->normal_lowercase_advance =
font_get_average_glyph_advance_range(advance_map, met, 'a', 'z', 0);
met->normal_uppercase_advance =
font_get_average_glyph_advance_range(advance_map, met, 'A', 'Z', 0);
met->normal_advance = (26*met->normal_lowercase_advance +
26*met->normal_uppercase_advance +
10*met->decimal_digit_advance)/62.f;
face->texture_kind = texture_kind;
face->texture = texture;
Vec3_f32 texture_dim = V3f32(pack.dim);
face->texture_dim = texture_dim;
{
Vec3_i32 p = V3i32((i32)face->white.uv.x0, (i32)face->white.uv.y0, (i32)face->white.w);
Vec3_i32 dim = V3i32(white.dim.x, white.dim.y, 1);
graphics_fill_texture(texture_kind, texture, p, dim, white.data);
face->white.uv.x1 = (face->white.uv.x0 + face->white.uv.x1)/texture_dim.x;
face->white.uv.y1 = (face->white.uv.y0 + face->white.uv.y1)/texture_dim.y;
face->white.uv.x0 = face->white.uv.x0/texture_dim.x;
face->white.uv.y0 = face->white.uv.y0/texture_dim.y;
face->white.w /= texture_dim.z;
}
for (u16 i = 0; i < index_count; i += 1){
Vec3_i32 p = V3i32((i32)face->bounds[i].uv.x0, (i32)face->bounds[i].uv.y0, (i32)face->bounds[i].w);
Vec3_i32 dim = V3i32(glyph_bitmaps[i].dim.x, glyph_bitmaps[i].dim.y, 1);
graphics_fill_texture(texture_kind, texture, p, dim, glyph_bitmaps[i].data);
face->bounds[i].uv.x1 = (face->bounds[i].uv.x0 + face->bounds[i].uv.x1)/texture_dim.x;
face->bounds[i].uv.y1 = (face->bounds[i].uv.y0 + face->bounds[i].uv.y1)/texture_dim.y;
face->bounds[i].uv.x0 = face->bounds[i].uv.x0/texture_dim.x;
face->bounds[i].uv.y0 = face->bounds[i].uv.y0/texture_dim.y;
face->bounds[i].w /= texture_dim.z;
}
{
Face_Advance_Map *advance_map = &face->advance_map;
met->space_advance = font_get_glyph_advance(advance_map, met, ' ', 0);
met->decimal_digit_advance =
font_get_max_glyph_advance_range(advance_map, met, '0', '9', 0);
met->hex_digit_advance =
font_get_max_glyph_advance_range(advance_map, met, 'A', 'F', 0);
met->hex_digit_advance =
Max(met->hex_digit_advance, met->decimal_digit_advance);
met->byte_sub_advances[0] =
font_get_glyph_advance(advance_map, met, '\\', 0);
met->byte_sub_advances[1] = met->hex_digit_advance;
met->byte_sub_advances[2] = met->hex_digit_advance;
met->byte_advance =
met->byte_sub_advances[0] +
met->byte_sub_advances[1] +
met->byte_sub_advances[2];
met->normal_lowercase_advance =
font_get_average_glyph_advance_range(advance_map, met, 'a', 'z', 0);
met->normal_uppercase_advance =
font_get_average_glyph_advance_range(advance_map, met, 'A', 'Z', 0);
met->normal_advance = (26*met->normal_lowercase_advance +
26*met->normal_uppercase_advance +
10*met->decimal_digit_advance)/62.f;
}
} else {
pop_array(arena, Face, 1);
face = 0;
}
}

View File

@ -153,6 +153,9 @@ font_set_modify_face(Font_Set *set, Face_ID id, Face_Description *description){
Arena arena = make_arena_system();
Face *face = font_make_face(&arena, description, set->scale_factor);
if (face != 0){
if (slot->face->texture != 0){
graphics_free_texture(slot->face->texture);
}
linalloc_clear(&slot->arena);
slot->arena = arena;
slot->face = face;

View File

@ -9,6 +9,8 @@
// TOP
#define GENERATED_BY "4ed_graphics_api.cpp"
#include "4ed_api_definition_main.cpp"
function API_Definition*
@ -30,6 +32,11 @@ define_api(Arena *arena){
api_param(arena, call, "void*", "data");
}
{
API_Call *call = api_call(arena, api, "free_texture", "void");
api_param(arena, call, "u32", "texid");
}
return(api);
}

View File

@ -9,6 +9,8 @@
// TOP
#define GENERATED_BY "4ed_system_api.cpp"
#include "4ed_api_definition_main.cpp"
function API_Definition*

View File

@ -1,367 +1,370 @@
/* Generated by "4ed_api_parser_main.exe 4ed_api_implementation.cpp " */
function void
custom_api_fill_vtable(API_VTable_custom *vtable){
vtable->global_set_setting = global_set_setting;
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->enqueue_virtual_event = enqueue_virtual_event;
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_box_of_pos = buffer_relative_box_of_pos;
vtable->buffer_padded_box_of_pos = buffer_padded_box_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_box_of_pos = view_relative_box_of_pos;
vtable->view_padded_box_of_pos = view_padded_box_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_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_set_layout = buffer_set_layout;
vtable->buffer_clear_layout_cache = buffer_clear_layout_cache;
vtable->buffer_get_layout = buffer_get_layout;
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_view_next = get_view_next;
vtable->get_view_prev = get_view_prev;
vtable->get_this_ctx_view = get_this_ctx_view;
vtable->get_active_view = get_active_view;
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_root = panel_get_root;
vtable->panel_get_parent = panel_get_parent;
vtable->panel_get_child = panel_get_child;
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_set_active = view_set_active;
vtable->view_enqueue_command_function = view_enqueue_command_function;
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_camera_bounds = view_set_camera_bounds;
vtable->view_get_camera_bounds = view_get_camera_bounds;
vtable->view_set_cursor = view_set_cursor;
vtable->view_set_buffer_scroll = view_set_buffer_scroll;
vtable->view_set_mark = view_set_mark;
vtable->view_quit_ui = view_quit_ui;
vtable->view_set_buffer = view_set_buffer;
vtable->view_push_context = view_push_context;
vtable->view_pop_context = view_pop_context;
vtable->view_alter_context = view_alter_context;
vtable->view_current_context = view_current_context;
vtable->view_current_context_hook_memory = view_current_context_hook_memory;
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_group_highest_id = managed_id_group_highest_id;
vtable->managed_id_declare = managed_id_declare;
vtable->managed_id_get = managed_id_get;
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_next_input_raw = get_next_input_raw;
vtable->get_current_input_sequence_number = get_current_input_sequence_number;
vtable->get_current_input = get_current_input;
vtable->set_current_input = set_current_input;
vtable->leave_current_input_unhandled = leave_current_input_unhandled;
vtable->set_custom_hook = set_custom_hook;
vtable->get_custom_hook = get_custom_hook;
vtable->set_custom_hook_memory_size = set_custom_hook_memory_size;
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->clear_all_query_bars = clear_all_query_bars;
vtable->print_message = print_message;
vtable->log_string = log_string;
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_advance_map = get_face_advance_map;
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->push_hot_directory = push_hot_directory;
vtable->set_hot_directory = set_hot_directory;
vtable->send_exit_signal = send_exit_signal;
vtable->hard_exit = hard_exit;
vtable->set_window_title = set_window_title;
vtable->acquire_global_frame_mutex = acquire_global_frame_mutex;
vtable->release_global_frame_mutex = release_global_frame_mutex;
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_set_clip = draw_set_clip;
vtable->text_layout_create = text_layout_create;
vtable->text_layout_region = text_layout_region;
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->paint_text_color_blend = paint_text_color_blend;
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;
vtable->get_core_profile_list = get_core_profile_list;
vtable->get_custom_layer_boundary_docs = get_custom_layer_boundary_docs;
vtable->global_set_setting = global_set_setting;
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->enqueue_virtual_event = enqueue_virtual_event;
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_box_of_pos = buffer_relative_box_of_pos;
vtable->buffer_padded_box_of_pos = buffer_padded_box_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_box_of_pos = view_relative_box_of_pos;
vtable->view_padded_box_of_pos = view_padded_box_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_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_set_layout = buffer_set_layout;
vtable->buffer_clear_layout_cache = buffer_clear_layout_cache;
vtable->buffer_get_layout = buffer_get_layout;
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_view_next = get_view_next;
vtable->get_view_prev = get_view_prev;
vtable->get_this_ctx_view = get_this_ctx_view;
vtable->get_active_view = get_active_view;
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_root = panel_get_root;
vtable->panel_get_parent = panel_get_parent;
vtable->panel_get_child = panel_get_child;
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_set_active = view_set_active;
vtable->view_enqueue_command_function = view_enqueue_command_function;
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_camera_bounds = view_set_camera_bounds;
vtable->view_get_camera_bounds = view_get_camera_bounds;
vtable->view_set_cursor = view_set_cursor;
vtable->view_set_buffer_scroll = view_set_buffer_scroll;
vtable->view_set_mark = view_set_mark;
vtable->view_quit_ui = view_quit_ui;
vtable->view_set_buffer = view_set_buffer;
vtable->view_push_context = view_push_context;
vtable->view_pop_context = view_pop_context;
vtable->view_alter_context = view_alter_context;
vtable->view_current_context = view_current_context;
vtable->view_current_context_hook_memory = view_current_context_hook_memory;
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_group_highest_id = managed_id_group_highest_id;
vtable->managed_id_declare = managed_id_declare;
vtable->managed_id_get = managed_id_get;
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_next_input_raw = get_next_input_raw;
vtable->get_current_input_sequence_number = get_current_input_sequence_number;
vtable->get_current_input = get_current_input;
vtable->set_current_input = set_current_input;
vtable->leave_current_input_unhandled = leave_current_input_unhandled;
vtable->set_custom_hook = set_custom_hook;
vtable->get_custom_hook = get_custom_hook;
vtable->set_custom_hook_memory_size = set_custom_hook_memory_size;
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->clear_all_query_bars = clear_all_query_bars;
vtable->print_message = print_message;
vtable->log_string = log_string;
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_advance_map = get_face_advance_map;
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->push_hot_directory = push_hot_directory;
vtable->set_hot_directory = set_hot_directory;
vtable->send_exit_signal = send_exit_signal;
vtable->hard_exit = hard_exit;
vtable->set_window_title = set_window_title;
vtable->acquire_global_frame_mutex = acquire_global_frame_mutex;
vtable->release_global_frame_mutex = release_global_frame_mutex;
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_set_clip = draw_set_clip;
vtable->text_layout_create = text_layout_create;
vtable->text_layout_region = text_layout_region;
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->paint_text_color_blend = paint_text_color_blend;
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;
vtable->get_core_profile_list = get_core_profile_list;
vtable->get_custom_layer_boundary_docs = get_custom_layer_boundary_docs;
}
#if defined(DYNAMIC_LINK_API)
function void
custom_api_read_vtable(API_VTable_custom *vtable){
global_set_setting = vtable->global_set_setting;
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;
enqueue_virtual_event = vtable->enqueue_virtual_event;
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_box_of_pos = vtable->buffer_relative_box_of_pos;
buffer_padded_box_of_pos = vtable->buffer_padded_box_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_box_of_pos = vtable->view_relative_box_of_pos;
view_padded_box_of_pos = vtable->view_padded_box_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_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_set_layout = vtable->buffer_set_layout;
buffer_clear_layout_cache = vtable->buffer_clear_layout_cache;
buffer_get_layout = vtable->buffer_get_layout;
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_view_next = vtable->get_view_next;
get_view_prev = vtable->get_view_prev;
get_this_ctx_view = vtable->get_this_ctx_view;
get_active_view = vtable->get_active_view;
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_root = vtable->panel_get_root;
panel_get_parent = vtable->panel_get_parent;
panel_get_child = vtable->panel_get_child;
view_close = vtable->view_close;
view_get_buffer_region = vtable->view_get_buffer_region;
view_get_buffer_scroll = vtable->view_get_buffer_scroll;
view_set_active = vtable->view_set_active;
view_enqueue_command_function = vtable->view_enqueue_command_function;
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_camera_bounds = vtable->view_set_camera_bounds;
view_get_camera_bounds = vtable->view_get_camera_bounds;
view_set_cursor = vtable->view_set_cursor;
view_set_buffer_scroll = vtable->view_set_buffer_scroll;
view_set_mark = vtable->view_set_mark;
view_quit_ui = vtable->view_quit_ui;
view_set_buffer = vtable->view_set_buffer;
view_push_context = vtable->view_push_context;
view_pop_context = vtable->view_pop_context;
view_alter_context = vtable->view_alter_context;
view_current_context = vtable->view_current_context;
view_current_context_hook_memory = vtable->view_current_context_hook_memory;
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_group_highest_id = vtable->managed_id_group_highest_id;
managed_id_declare = vtable->managed_id_declare;
managed_id_get = vtable->managed_id_get;
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_next_input_raw = vtable->get_next_input_raw;
get_current_input_sequence_number = vtable->get_current_input_sequence_number;
get_current_input = vtable->get_current_input;
set_current_input = vtable->set_current_input;
leave_current_input_unhandled = vtable->leave_current_input_unhandled;
set_custom_hook = vtable->set_custom_hook;
get_custom_hook = vtable->get_custom_hook;
set_custom_hook_memory_size = vtable->set_custom_hook_memory_size;
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;
clear_all_query_bars = vtable->clear_all_query_bars;
print_message = vtable->print_message;
log_string = vtable->log_string;
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_advance_map = vtable->get_face_advance_map;
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;
push_hot_directory = vtable->push_hot_directory;
set_hot_directory = vtable->set_hot_directory;
send_exit_signal = vtable->send_exit_signal;
hard_exit = vtable->hard_exit;
set_window_title = vtable->set_window_title;
acquire_global_frame_mutex = vtable->acquire_global_frame_mutex;
release_global_frame_mutex = vtable->release_global_frame_mutex;
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_set_clip = vtable->draw_set_clip;
text_layout_create = vtable->text_layout_create;
text_layout_region = vtable->text_layout_region;
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;
paint_text_color_blend = vtable->paint_text_color_blend;
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;
get_core_profile_list = vtable->get_core_profile_list;
get_custom_layer_boundary_docs = vtable->get_custom_layer_boundary_docs;
global_set_setting = vtable->global_set_setting;
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;
enqueue_virtual_event = vtable->enqueue_virtual_event;
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_box_of_pos = vtable->buffer_relative_box_of_pos;
buffer_padded_box_of_pos = vtable->buffer_padded_box_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_box_of_pos = vtable->view_relative_box_of_pos;
view_padded_box_of_pos = vtable->view_padded_box_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_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_set_layout = vtable->buffer_set_layout;
buffer_clear_layout_cache = vtable->buffer_clear_layout_cache;
buffer_get_layout = vtable->buffer_get_layout;
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_view_next = vtable->get_view_next;
get_view_prev = vtable->get_view_prev;
get_this_ctx_view = vtable->get_this_ctx_view;
get_active_view = vtable->get_active_view;
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_root = vtable->panel_get_root;
panel_get_parent = vtable->panel_get_parent;
panel_get_child = vtable->panel_get_child;
view_close = vtable->view_close;
view_get_buffer_region = vtable->view_get_buffer_region;
view_get_buffer_scroll = vtable->view_get_buffer_scroll;
view_set_active = vtable->view_set_active;
view_enqueue_command_function = vtable->view_enqueue_command_function;
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_camera_bounds = vtable->view_set_camera_bounds;
view_get_camera_bounds = vtable->view_get_camera_bounds;
view_set_cursor = vtable->view_set_cursor;
view_set_buffer_scroll = vtable->view_set_buffer_scroll;
view_set_mark = vtable->view_set_mark;
view_quit_ui = vtable->view_quit_ui;
view_set_buffer = vtable->view_set_buffer;
view_push_context = vtable->view_push_context;
view_pop_context = vtable->view_pop_context;
view_alter_context = vtable->view_alter_context;
view_current_context = vtable->view_current_context;
view_current_context_hook_memory = vtable->view_current_context_hook_memory;
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_group_highest_id = vtable->managed_id_group_highest_id;
managed_id_declare = vtable->managed_id_declare;
managed_id_get = vtable->managed_id_get;
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_next_input_raw = vtable->get_next_input_raw;
get_current_input_sequence_number = vtable->get_current_input_sequence_number;
get_current_input = vtable->get_current_input;
set_current_input = vtable->set_current_input;
leave_current_input_unhandled = vtable->leave_current_input_unhandled;
set_custom_hook = vtable->set_custom_hook;
get_custom_hook = vtable->get_custom_hook;
set_custom_hook_memory_size = vtable->set_custom_hook_memory_size;
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;
clear_all_query_bars = vtable->clear_all_query_bars;
print_message = vtable->print_message;
log_string = vtable->log_string;
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_advance_map = vtable->get_face_advance_map;
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;
push_hot_directory = vtable->push_hot_directory;
set_hot_directory = vtable->set_hot_directory;
send_exit_signal = vtable->send_exit_signal;
hard_exit = vtable->hard_exit;
set_window_title = vtable->set_window_title;
acquire_global_frame_mutex = vtable->acquire_global_frame_mutex;
release_global_frame_mutex = vtable->release_global_frame_mutex;
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_set_clip = vtable->draw_set_clip;
text_layout_create = vtable->text_layout_create;
text_layout_region = vtable->text_layout_region;
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;
paint_text_color_blend = vtable->paint_text_color_blend;
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;
get_core_profile_list = vtable->get_core_profile_list;
get_custom_layer_boundary_docs = vtable->get_custom_layer_boundary_docs;
}
#undef DYNAMIC_LINK_API
#endif

View File

@ -1,3 +1,5 @@
/* Generated by "4ed_api_parser_main.exe 4ed_api_implementation.cpp " */
#define custom_global_set_setting_sig() b32 custom_global_set_setting(Application_Links* app, Global_Setting_ID setting, i64 value)
#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)
@ -177,6 +179,7 @@
#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)
#define custom_get_core_profile_list_sig() Profile_Global_List* custom_get_core_profile_list(Application_Links* app)
#define custom_get_custom_layer_boundary_docs_sig() Doc_Cluster* custom_get_custom_layer_boundary_docs(Application_Links* app, Arena* arena)
typedef b32 custom_global_set_setting_type(Application_Links* app, Global_Setting_ID setting, i64 value);
typedef Rect_f32 custom_global_get_screen_rectangle_type(Application_Links* app);
typedef Thread_Context* custom_get_thread_context_type(Application_Links* app);
@ -356,187 +359,189 @@ 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);
typedef Profile_Global_List* custom_get_core_profile_list_type(Application_Links* app);
typedef Doc_Cluster* custom_get_custom_layer_boundary_docs_type(Application_Links* app, Arena* arena);
struct API_VTable_custom{
custom_global_set_setting_type *global_set_setting;
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_enqueue_virtual_event_type *enqueue_virtual_event;
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_box_of_pos_type *buffer_relative_box_of_pos;
custom_buffer_padded_box_of_pos_type *buffer_padded_box_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_box_of_pos_type *view_relative_box_of_pos;
custom_view_padded_box_of_pos_type *view_padded_box_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_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_set_layout_type *buffer_set_layout;
custom_buffer_clear_layout_cache_type *buffer_clear_layout_cache;
custom_buffer_get_layout_type *buffer_get_layout;
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_view_next_type *get_view_next;
custom_get_view_prev_type *get_view_prev;
custom_get_this_ctx_view_type *get_this_ctx_view;
custom_get_active_view_type *get_active_view;
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_root_type *panel_get_root;
custom_panel_get_parent_type *panel_get_parent;
custom_panel_get_child_type *panel_get_child;
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_set_active_type *view_set_active;
custom_view_enqueue_command_function_type *view_enqueue_command_function;
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_camera_bounds_type *view_set_camera_bounds;
custom_view_get_camera_bounds_type *view_get_camera_bounds;
custom_view_set_cursor_type *view_set_cursor;
custom_view_set_buffer_scroll_type *view_set_buffer_scroll;
custom_view_set_mark_type *view_set_mark;
custom_view_quit_ui_type *view_quit_ui;
custom_view_set_buffer_type *view_set_buffer;
custom_view_push_context_type *view_push_context;
custom_view_pop_context_type *view_pop_context;
custom_view_alter_context_type *view_alter_context;
custom_view_current_context_type *view_current_context;
custom_view_current_context_hook_memory_type *view_current_context_hook_memory;
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_group_highest_id_type *managed_id_group_highest_id;
custom_managed_id_declare_type *managed_id_declare;
custom_managed_id_get_type *managed_id_get;
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_next_input_raw_type *get_next_input_raw;
custom_get_current_input_sequence_number_type *get_current_input_sequence_number;
custom_get_current_input_type *get_current_input;
custom_set_current_input_type *set_current_input;
custom_leave_current_input_unhandled_type *leave_current_input_unhandled;
custom_set_custom_hook_type *set_custom_hook;
custom_get_custom_hook_type *get_custom_hook;
custom_set_custom_hook_memory_size_type *set_custom_hook_memory_size;
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_clear_all_query_bars_type *clear_all_query_bars;
custom_print_message_type *print_message;
custom_log_string_type *log_string;
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_advance_map_type *get_face_advance_map;
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_push_hot_directory_type *push_hot_directory;
custom_set_hot_directory_type *set_hot_directory;
custom_send_exit_signal_type *send_exit_signal;
custom_hard_exit_type *hard_exit;
custom_set_window_title_type *set_window_title;
custom_acquire_global_frame_mutex_type *acquire_global_frame_mutex;
custom_release_global_frame_mutex_type *release_global_frame_mutex;
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_set_clip_type *draw_set_clip;
custom_text_layout_create_type *text_layout_create;
custom_text_layout_region_type *text_layout_region;
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_paint_text_color_blend_type *paint_text_color_blend;
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;
custom_get_core_profile_list_type *get_core_profile_list;
custom_get_custom_layer_boundary_docs_type *get_custom_layer_boundary_docs;
custom_global_set_setting_type *global_set_setting;
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_enqueue_virtual_event_type *enqueue_virtual_event;
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_box_of_pos_type *buffer_relative_box_of_pos;
custom_buffer_padded_box_of_pos_type *buffer_padded_box_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_box_of_pos_type *view_relative_box_of_pos;
custom_view_padded_box_of_pos_type *view_padded_box_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_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_set_layout_type *buffer_set_layout;
custom_buffer_clear_layout_cache_type *buffer_clear_layout_cache;
custom_buffer_get_layout_type *buffer_get_layout;
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_view_next_type *get_view_next;
custom_get_view_prev_type *get_view_prev;
custom_get_this_ctx_view_type *get_this_ctx_view;
custom_get_active_view_type *get_active_view;
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_root_type *panel_get_root;
custom_panel_get_parent_type *panel_get_parent;
custom_panel_get_child_type *panel_get_child;
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_set_active_type *view_set_active;
custom_view_enqueue_command_function_type *view_enqueue_command_function;
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_camera_bounds_type *view_set_camera_bounds;
custom_view_get_camera_bounds_type *view_get_camera_bounds;
custom_view_set_cursor_type *view_set_cursor;
custom_view_set_buffer_scroll_type *view_set_buffer_scroll;
custom_view_set_mark_type *view_set_mark;
custom_view_quit_ui_type *view_quit_ui;
custom_view_set_buffer_type *view_set_buffer;
custom_view_push_context_type *view_push_context;
custom_view_pop_context_type *view_pop_context;
custom_view_alter_context_type *view_alter_context;
custom_view_current_context_type *view_current_context;
custom_view_current_context_hook_memory_type *view_current_context_hook_memory;
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_group_highest_id_type *managed_id_group_highest_id;
custom_managed_id_declare_type *managed_id_declare;
custom_managed_id_get_type *managed_id_get;
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_next_input_raw_type *get_next_input_raw;
custom_get_current_input_sequence_number_type *get_current_input_sequence_number;
custom_get_current_input_type *get_current_input;
custom_set_current_input_type *set_current_input;
custom_leave_current_input_unhandled_type *leave_current_input_unhandled;
custom_set_custom_hook_type *set_custom_hook;
custom_get_custom_hook_type *get_custom_hook;
custom_set_custom_hook_memory_size_type *set_custom_hook_memory_size;
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_clear_all_query_bars_type *clear_all_query_bars;
custom_print_message_type *print_message;
custom_log_string_type *log_string;
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_advance_map_type *get_face_advance_map;
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_push_hot_directory_type *push_hot_directory;
custom_set_hot_directory_type *set_hot_directory;
custom_send_exit_signal_type *send_exit_signal;
custom_hard_exit_type *hard_exit;
custom_set_window_title_type *set_window_title;
custom_acquire_global_frame_mutex_type *acquire_global_frame_mutex;
custom_release_global_frame_mutex_type *release_global_frame_mutex;
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_set_clip_type *draw_set_clip;
custom_text_layout_create_type *text_layout_create;
custom_text_layout_region_type *text_layout_region;
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_paint_text_color_blend_type *paint_text_color_blend;
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;
custom_get_core_profile_list_type *get_core_profile_list;
custom_get_custom_layer_boundary_docs_type *get_custom_layer_boundary_docs;
};
#if defined(STATIC_LINK_API)
internal b32 global_set_setting(Application_Links* app, Global_Setting_ID setting, i64 value);
internal Rect_f32 global_get_screen_rectangle(Application_Links* app);
@ -718,6 +723,7 @@ internal String_Match_List buffer_find_all_matches(Application_Links* app, Arena
internal Profile_Global_List* get_core_profile_list(Application_Links* app);
internal Doc_Cluster* get_custom_layer_boundary_docs(Application_Links* app, Arena* arena);
#undef STATIC_LINK_API
#elif defined(DYNAMIC_LINK_API)
global custom_global_set_setting_type *global_set_setting = 0;
global custom_global_get_screen_rectangle_type *global_get_screen_rectangle = 0;

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,5 @@
/* Generated by "4ed_api_parser_main.exe 4ed_api_implementation.cpp " */
api(custom) function b32 global_set_setting(Application_Links* app, Global_Setting_ID setting, i64 value);
api(custom) function Rect_f32 global_get_screen_rectangle(Application_Links* app);
api(custom) function Thread_Context* get_thread_context(Application_Links* app);

View File

@ -1,123 +1,126 @@
/* Generated by "4ed_system_api.cpp" */
function void
system_api_fill_vtable(API_VTable_system *vtable){
vtable->error_box = system_error_box;
vtable->get_path = system_get_path;
vtable->get_canonical = system_get_canonical;
vtable->get_file_list = system_get_file_list;
vtable->quick_file_attributes = system_quick_file_attributes;
vtable->load_handle = system_load_handle;
vtable->load_attributes = system_load_attributes;
vtable->load_file = system_load_file;
vtable->load_close = system_load_close;
vtable->save_file = system_save_file;
vtable->load_library = system_load_library;
vtable->release_library = system_release_library;
vtable->get_proc = system_get_proc;
vtable->now_time = system_now_time;
vtable->now_date_time_universal = system_now_date_time_universal;
vtable->local_date_time_from_universal = system_local_date_time_from_universal;
vtable->universal_date_time_from_local = system_universal_date_time_from_local;
vtable->wake_up_timer_create = system_wake_up_timer_create;
vtable->wake_up_timer_release = system_wake_up_timer_release;
vtable->wake_up_timer_set = system_wake_up_timer_set;
vtable->signal_step = system_signal_step;
vtable->sleep = system_sleep;
vtable->get_clipboard = system_get_clipboard;
vtable->post_clipboard = system_post_clipboard;
vtable->set_clipboard_catch_all = system_set_clipboard_catch_all;
vtable->get_clipboard_catch_all = system_get_clipboard_catch_all;
vtable->cli_call = system_cli_call;
vtable->cli_begin_update = system_cli_begin_update;
vtable->cli_update_step = system_cli_update_step;
vtable->cli_end_update = system_cli_end_update;
vtable->open_color_picker = system_open_color_picker;
vtable->get_screen_scale_factor = system_get_screen_scale_factor;
vtable->thread_launch = system_thread_launch;
vtable->thread_join = system_thread_join;
vtable->thread_free = system_thread_free;
vtable->thread_get_id = system_thread_get_id;
vtable->acquire_global_frame_mutex = system_acquire_global_frame_mutex;
vtable->release_global_frame_mutex = system_release_global_frame_mutex;
vtable->mutex_make = system_mutex_make;
vtable->mutex_acquire = system_mutex_acquire;
vtable->mutex_release = system_mutex_release;
vtable->mutex_free = system_mutex_free;
vtable->condition_variable_make = system_condition_variable_make;
vtable->condition_variable_wait = system_condition_variable_wait;
vtable->condition_variable_signal = system_condition_variable_signal;
vtable->condition_variable_free = system_condition_variable_free;
vtable->memory_allocate = system_memory_allocate;
vtable->memory_set_protection = system_memory_set_protection;
vtable->memory_free = system_memory_free;
vtable->memory_annotation = system_memory_annotation;
vtable->show_mouse_cursor = system_show_mouse_cursor;
vtable->set_fullscreen = system_set_fullscreen;
vtable->is_fullscreen = system_is_fullscreen;
vtable->get_keyboard_modifiers = system_get_keyboard_modifiers;
vtable->set_key_mode = system_set_key_mode;
vtable->set_source_mixer = system_set_source_mixer;
vtable->set_destination_mixer = system_set_destination_mixer;
vtable->error_box = system_error_box;
vtable->get_path = system_get_path;
vtable->get_canonical = system_get_canonical;
vtable->get_file_list = system_get_file_list;
vtable->quick_file_attributes = system_quick_file_attributes;
vtable->load_handle = system_load_handle;
vtable->load_attributes = system_load_attributes;
vtable->load_file = system_load_file;
vtable->load_close = system_load_close;
vtable->save_file = system_save_file;
vtable->load_library = system_load_library;
vtable->release_library = system_release_library;
vtable->get_proc = system_get_proc;
vtable->now_time = system_now_time;
vtable->now_date_time_universal = system_now_date_time_universal;
vtable->local_date_time_from_universal = system_local_date_time_from_universal;
vtable->universal_date_time_from_local = system_universal_date_time_from_local;
vtable->wake_up_timer_create = system_wake_up_timer_create;
vtable->wake_up_timer_release = system_wake_up_timer_release;
vtable->wake_up_timer_set = system_wake_up_timer_set;
vtable->signal_step = system_signal_step;
vtable->sleep = system_sleep;
vtable->get_clipboard = system_get_clipboard;
vtable->post_clipboard = system_post_clipboard;
vtable->set_clipboard_catch_all = system_set_clipboard_catch_all;
vtable->get_clipboard_catch_all = system_get_clipboard_catch_all;
vtable->cli_call = system_cli_call;
vtable->cli_begin_update = system_cli_begin_update;
vtable->cli_update_step = system_cli_update_step;
vtable->cli_end_update = system_cli_end_update;
vtable->open_color_picker = system_open_color_picker;
vtable->get_screen_scale_factor = system_get_screen_scale_factor;
vtable->thread_launch = system_thread_launch;
vtable->thread_join = system_thread_join;
vtable->thread_free = system_thread_free;
vtable->thread_get_id = system_thread_get_id;
vtable->acquire_global_frame_mutex = system_acquire_global_frame_mutex;
vtable->release_global_frame_mutex = system_release_global_frame_mutex;
vtable->mutex_make = system_mutex_make;
vtable->mutex_acquire = system_mutex_acquire;
vtable->mutex_release = system_mutex_release;
vtable->mutex_free = system_mutex_free;
vtable->condition_variable_make = system_condition_variable_make;
vtable->condition_variable_wait = system_condition_variable_wait;
vtable->condition_variable_signal = system_condition_variable_signal;
vtable->condition_variable_free = system_condition_variable_free;
vtable->memory_allocate = system_memory_allocate;
vtable->memory_set_protection = system_memory_set_protection;
vtable->memory_free = system_memory_free;
vtable->memory_annotation = system_memory_annotation;
vtable->show_mouse_cursor = system_show_mouse_cursor;
vtable->set_fullscreen = system_set_fullscreen;
vtable->is_fullscreen = system_is_fullscreen;
vtable->get_keyboard_modifiers = system_get_keyboard_modifiers;
vtable->set_key_mode = system_set_key_mode;
vtable->set_source_mixer = system_set_source_mixer;
vtable->set_destination_mixer = system_set_destination_mixer;
}
#if defined(DYNAMIC_LINK_API)
function void
system_api_read_vtable(API_VTable_system *vtable){
system_error_box = vtable->error_box;
system_get_path = vtable->get_path;
system_get_canonical = vtable->get_canonical;
system_get_file_list = vtable->get_file_list;
system_quick_file_attributes = vtable->quick_file_attributes;
system_load_handle = vtable->load_handle;
system_load_attributes = vtable->load_attributes;
system_load_file = vtable->load_file;
system_load_close = vtable->load_close;
system_save_file = vtable->save_file;
system_load_library = vtable->load_library;
system_release_library = vtable->release_library;
system_get_proc = vtable->get_proc;
system_now_time = vtable->now_time;
system_now_date_time_universal = vtable->now_date_time_universal;
system_local_date_time_from_universal = vtable->local_date_time_from_universal;
system_universal_date_time_from_local = vtable->universal_date_time_from_local;
system_wake_up_timer_create = vtable->wake_up_timer_create;
system_wake_up_timer_release = vtable->wake_up_timer_release;
system_wake_up_timer_set = vtable->wake_up_timer_set;
system_signal_step = vtable->signal_step;
system_sleep = vtable->sleep;
system_get_clipboard = vtable->get_clipboard;
system_post_clipboard = vtable->post_clipboard;
system_set_clipboard_catch_all = vtable->set_clipboard_catch_all;
system_get_clipboard_catch_all = vtable->get_clipboard_catch_all;
system_cli_call = vtable->cli_call;
system_cli_begin_update = vtable->cli_begin_update;
system_cli_update_step = vtable->cli_update_step;
system_cli_end_update = vtable->cli_end_update;
system_open_color_picker = vtable->open_color_picker;
system_get_screen_scale_factor = vtable->get_screen_scale_factor;
system_thread_launch = vtable->thread_launch;
system_thread_join = vtable->thread_join;
system_thread_free = vtable->thread_free;
system_thread_get_id = vtable->thread_get_id;
system_acquire_global_frame_mutex = vtable->acquire_global_frame_mutex;
system_release_global_frame_mutex = vtable->release_global_frame_mutex;
system_mutex_make = vtable->mutex_make;
system_mutex_acquire = vtable->mutex_acquire;
system_mutex_release = vtable->mutex_release;
system_mutex_free = vtable->mutex_free;
system_condition_variable_make = vtable->condition_variable_make;
system_condition_variable_wait = vtable->condition_variable_wait;
system_condition_variable_signal = vtable->condition_variable_signal;
system_condition_variable_free = vtable->condition_variable_free;
system_memory_allocate = vtable->memory_allocate;
system_memory_set_protection = vtable->memory_set_protection;
system_memory_free = vtable->memory_free;
system_memory_annotation = vtable->memory_annotation;
system_show_mouse_cursor = vtable->show_mouse_cursor;
system_set_fullscreen = vtable->set_fullscreen;
system_is_fullscreen = vtable->is_fullscreen;
system_get_keyboard_modifiers = vtable->get_keyboard_modifiers;
system_set_key_mode = vtable->set_key_mode;
system_set_source_mixer = vtable->set_source_mixer;
system_set_destination_mixer = vtable->set_destination_mixer;
system_error_box = vtable->error_box;
system_get_path = vtable->get_path;
system_get_canonical = vtable->get_canonical;
system_get_file_list = vtable->get_file_list;
system_quick_file_attributes = vtable->quick_file_attributes;
system_load_handle = vtable->load_handle;
system_load_attributes = vtable->load_attributes;
system_load_file = vtable->load_file;
system_load_close = vtable->load_close;
system_save_file = vtable->save_file;
system_load_library = vtable->load_library;
system_release_library = vtable->release_library;
system_get_proc = vtable->get_proc;
system_now_time = vtable->now_time;
system_now_date_time_universal = vtable->now_date_time_universal;
system_local_date_time_from_universal = vtable->local_date_time_from_universal;
system_universal_date_time_from_local = vtable->universal_date_time_from_local;
system_wake_up_timer_create = vtable->wake_up_timer_create;
system_wake_up_timer_release = vtable->wake_up_timer_release;
system_wake_up_timer_set = vtable->wake_up_timer_set;
system_signal_step = vtable->signal_step;
system_sleep = vtable->sleep;
system_get_clipboard = vtable->get_clipboard;
system_post_clipboard = vtable->post_clipboard;
system_set_clipboard_catch_all = vtable->set_clipboard_catch_all;
system_get_clipboard_catch_all = vtable->get_clipboard_catch_all;
system_cli_call = vtable->cli_call;
system_cli_begin_update = vtable->cli_begin_update;
system_cli_update_step = vtable->cli_update_step;
system_cli_end_update = vtable->cli_end_update;
system_open_color_picker = vtable->open_color_picker;
system_get_screen_scale_factor = vtable->get_screen_scale_factor;
system_thread_launch = vtable->thread_launch;
system_thread_join = vtable->thread_join;
system_thread_free = vtable->thread_free;
system_thread_get_id = vtable->thread_get_id;
system_acquire_global_frame_mutex = vtable->acquire_global_frame_mutex;
system_release_global_frame_mutex = vtable->release_global_frame_mutex;
system_mutex_make = vtable->mutex_make;
system_mutex_acquire = vtable->mutex_acquire;
system_mutex_release = vtable->mutex_release;
system_mutex_free = vtable->mutex_free;
system_condition_variable_make = vtable->condition_variable_make;
system_condition_variable_wait = vtable->condition_variable_wait;
system_condition_variable_signal = vtable->condition_variable_signal;
system_condition_variable_free = vtable->condition_variable_free;
system_memory_allocate = vtable->memory_allocate;
system_memory_set_protection = vtable->memory_set_protection;
system_memory_free = vtable->memory_free;
system_memory_annotation = vtable->memory_annotation;
system_show_mouse_cursor = vtable->show_mouse_cursor;
system_set_fullscreen = vtable->set_fullscreen;
system_is_fullscreen = vtable->is_fullscreen;
system_get_keyboard_modifiers = vtable->get_keyboard_modifiers;
system_set_key_mode = vtable->set_key_mode;
system_set_source_mixer = vtable->set_source_mixer;
system_set_destination_mixer = vtable->set_destination_mixer;
}
#undef DYNAMIC_LINK_API
#endif

View File

@ -1,3 +1,5 @@
/* Generated by "4ed_system_api.cpp" */
#define system_error_box_sig() void system_error_box(char* msg)
#define system_get_path_sig() String_Const_u8 system_get_path(Arena* arena, System_Path_Code path_code)
#define system_get_canonical_sig() String_Const_u8 system_get_canonical(Arena* arena, String_Const_u8 name)
@ -55,6 +57,7 @@
#define system_set_key_mode_sig() void system_set_key_mode(Key_Mode mode)
#define system_set_source_mixer_sig() void system_set_source_mixer(void* ctx, Audio_Mix_Sources_Function* mix_func)
#define system_set_destination_mixer_sig() void system_set_destination_mixer(Audio_Mix_Destination_Function* mix_func)
typedef void system_error_box_type(char* msg);
typedef String_Const_u8 system_get_path_type(Arena* arena, System_Path_Code path_code);
typedef String_Const_u8 system_get_canonical_type(Arena* arena, String_Const_u8 name);
@ -112,65 +115,67 @@ typedef Input_Modifier_Set system_get_keyboard_modifiers_type(Arena* arena);
typedef void system_set_key_mode_type(Key_Mode mode);
typedef void system_set_source_mixer_type(void* ctx, Audio_Mix_Sources_Function* mix_func);
typedef void system_set_destination_mixer_type(Audio_Mix_Destination_Function* mix_func);
struct API_VTable_system{
system_error_box_type *error_box;
system_get_path_type *get_path;
system_get_canonical_type *get_canonical;
system_get_file_list_type *get_file_list;
system_quick_file_attributes_type *quick_file_attributes;
system_load_handle_type *load_handle;
system_load_attributes_type *load_attributes;
system_load_file_type *load_file;
system_load_close_type *load_close;
system_save_file_type *save_file;
system_load_library_type *load_library;
system_release_library_type *release_library;
system_get_proc_type *get_proc;
system_now_time_type *now_time;
system_now_date_time_universal_type *now_date_time_universal;
system_local_date_time_from_universal_type *local_date_time_from_universal;
system_universal_date_time_from_local_type *universal_date_time_from_local;
system_wake_up_timer_create_type *wake_up_timer_create;
system_wake_up_timer_release_type *wake_up_timer_release;
system_wake_up_timer_set_type *wake_up_timer_set;
system_signal_step_type *signal_step;
system_sleep_type *sleep;
system_get_clipboard_type *get_clipboard;
system_post_clipboard_type *post_clipboard;
system_set_clipboard_catch_all_type *set_clipboard_catch_all;
system_get_clipboard_catch_all_type *get_clipboard_catch_all;
system_cli_call_type *cli_call;
system_cli_begin_update_type *cli_begin_update;
system_cli_update_step_type *cli_update_step;
system_cli_end_update_type *cli_end_update;
system_open_color_picker_type *open_color_picker;
system_get_screen_scale_factor_type *get_screen_scale_factor;
system_thread_launch_type *thread_launch;
system_thread_join_type *thread_join;
system_thread_free_type *thread_free;
system_thread_get_id_type *thread_get_id;
system_acquire_global_frame_mutex_type *acquire_global_frame_mutex;
system_release_global_frame_mutex_type *release_global_frame_mutex;
system_mutex_make_type *mutex_make;
system_mutex_acquire_type *mutex_acquire;
system_mutex_release_type *mutex_release;
system_mutex_free_type *mutex_free;
system_condition_variable_make_type *condition_variable_make;
system_condition_variable_wait_type *condition_variable_wait;
system_condition_variable_signal_type *condition_variable_signal;
system_condition_variable_free_type *condition_variable_free;
system_memory_allocate_type *memory_allocate;
system_memory_set_protection_type *memory_set_protection;
system_memory_free_type *memory_free;
system_memory_annotation_type *memory_annotation;
system_show_mouse_cursor_type *show_mouse_cursor;
system_set_fullscreen_type *set_fullscreen;
system_is_fullscreen_type *is_fullscreen;
system_get_keyboard_modifiers_type *get_keyboard_modifiers;
system_set_key_mode_type *set_key_mode;
system_set_source_mixer_type *set_source_mixer;
system_set_destination_mixer_type *set_destination_mixer;
system_error_box_type *error_box;
system_get_path_type *get_path;
system_get_canonical_type *get_canonical;
system_get_file_list_type *get_file_list;
system_quick_file_attributes_type *quick_file_attributes;
system_load_handle_type *load_handle;
system_load_attributes_type *load_attributes;
system_load_file_type *load_file;
system_load_close_type *load_close;
system_save_file_type *save_file;
system_load_library_type *load_library;
system_release_library_type *release_library;
system_get_proc_type *get_proc;
system_now_time_type *now_time;
system_now_date_time_universal_type *now_date_time_universal;
system_local_date_time_from_universal_type *local_date_time_from_universal;
system_universal_date_time_from_local_type *universal_date_time_from_local;
system_wake_up_timer_create_type *wake_up_timer_create;
system_wake_up_timer_release_type *wake_up_timer_release;
system_wake_up_timer_set_type *wake_up_timer_set;
system_signal_step_type *signal_step;
system_sleep_type *sleep;
system_get_clipboard_type *get_clipboard;
system_post_clipboard_type *post_clipboard;
system_set_clipboard_catch_all_type *set_clipboard_catch_all;
system_get_clipboard_catch_all_type *get_clipboard_catch_all;
system_cli_call_type *cli_call;
system_cli_begin_update_type *cli_begin_update;
system_cli_update_step_type *cli_update_step;
system_cli_end_update_type *cli_end_update;
system_open_color_picker_type *open_color_picker;
system_get_screen_scale_factor_type *get_screen_scale_factor;
system_thread_launch_type *thread_launch;
system_thread_join_type *thread_join;
system_thread_free_type *thread_free;
system_thread_get_id_type *thread_get_id;
system_acquire_global_frame_mutex_type *acquire_global_frame_mutex;
system_release_global_frame_mutex_type *release_global_frame_mutex;
system_mutex_make_type *mutex_make;
system_mutex_acquire_type *mutex_acquire;
system_mutex_release_type *mutex_release;
system_mutex_free_type *mutex_free;
system_condition_variable_make_type *condition_variable_make;
system_condition_variable_wait_type *condition_variable_wait;
system_condition_variable_signal_type *condition_variable_signal;
system_condition_variable_free_type *condition_variable_free;
system_memory_allocate_type *memory_allocate;
system_memory_set_protection_type *memory_set_protection;
system_memory_free_type *memory_free;
system_memory_annotation_type *memory_annotation;
system_show_mouse_cursor_type *show_mouse_cursor;
system_set_fullscreen_type *set_fullscreen;
system_is_fullscreen_type *is_fullscreen;
system_get_keyboard_modifiers_type *get_keyboard_modifiers;
system_set_key_mode_type *set_key_mode;
system_set_source_mixer_type *set_source_mixer;
system_set_destination_mixer_type *set_destination_mixer;
};
#if defined(STATIC_LINK_API)
internal void system_error_box(char* msg);
internal String_Const_u8 system_get_path(Arena* arena, System_Path_Code path_code);
@ -230,6 +235,7 @@ internal void system_set_key_mode(Key_Mode mode);
internal void system_set_source_mixer(void* ctx, Audio_Mix_Sources_Function* mix_func);
internal void system_set_destination_mixer(Audio_Mix_Destination_Function* mix_func);
#undef STATIC_LINK_API
#elif defined(DYNAMIC_LINK_API)
global system_error_box_type *system_error_box = 0;
global system_get_path_type *system_get_path = 0;

View File

@ -1,262 +1,264 @@
/* Generated by "4ed_system_api.cpp" */
function API_Definition*
system_api_construct(Arena *arena){
API_Definition *result = begin_api(arena, "system");
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("error_box"), string_u8_litexpr("void"), string_u8_litexpr(""));
api_param(arena, call, "char*", "msg");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("get_path"), string_u8_litexpr("String_Const_u8"), string_u8_litexpr(""));
api_param(arena, call, "Arena*", "arena");
api_param(arena, call, "System_Path_Code", "path_code");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("get_canonical"), string_u8_litexpr("String_Const_u8"), string_u8_litexpr(""));
api_param(arena, call, "Arena*", "arena");
api_param(arena, call, "String_Const_u8", "name");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("get_file_list"), string_u8_litexpr("File_List"), string_u8_litexpr(""));
api_param(arena, call, "Arena*", "arena");
api_param(arena, call, "String_Const_u8", "directory");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("quick_file_attributes"), string_u8_litexpr("File_Attributes"), string_u8_litexpr(""));
api_param(arena, call, "Arena*", "scratch");
api_param(arena, call, "String_Const_u8", "file_name");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("load_handle"), string_u8_litexpr("b32"), string_u8_litexpr(""));
api_param(arena, call, "Arena*", "scratch");
api_param(arena, call, "char*", "file_name");
api_param(arena, call, "Plat_Handle*", "out");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("load_attributes"), string_u8_litexpr("File_Attributes"), string_u8_litexpr(""));
api_param(arena, call, "Plat_Handle", "handle");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("load_file"), string_u8_litexpr("b32"), string_u8_litexpr(""));
api_param(arena, call, "Plat_Handle", "handle");
api_param(arena, call, "char*", "buffer");
api_param(arena, call, "u32", "size");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("load_close"), string_u8_litexpr("b32"), string_u8_litexpr(""));
api_param(arena, call, "Plat_Handle", "handle");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("save_file"), string_u8_litexpr("File_Attributes"), string_u8_litexpr(""));
api_param(arena, call, "Arena*", "scratch");
api_param(arena, call, "char*", "file_name");
api_param(arena, call, "String_Const_u8", "data");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("load_library"), string_u8_litexpr("b32"), string_u8_litexpr(""));
api_param(arena, call, "Arena*", "scratch");
api_param(arena, call, "String_Const_u8", "file_name");
api_param(arena, call, "System_Library*", "out");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("release_library"), string_u8_litexpr("b32"), string_u8_litexpr(""));
api_param(arena, call, "System_Library", "handle");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("get_proc"), string_u8_litexpr("Void_Func*"), string_u8_litexpr(""));
api_param(arena, call, "System_Library", "handle");
api_param(arena, call, "char*", "proc_name");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("now_time"), string_u8_litexpr("u64"), string_u8_litexpr(""));
(void)call;
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("now_date_time_universal"), string_u8_litexpr("Date_Time"), string_u8_litexpr(""));
(void)call;
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("local_date_time_from_universal"), string_u8_litexpr("Date_Time"), string_u8_litexpr(""));
api_param(arena, call, "Date_Time*", "date_time");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("universal_date_time_from_local"), string_u8_litexpr("Date_Time"), string_u8_litexpr(""));
api_param(arena, call, "Date_Time*", "date_time");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("wake_up_timer_create"), string_u8_litexpr("Plat_Handle"), string_u8_litexpr(""));
(void)call;
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("wake_up_timer_release"), string_u8_litexpr("void"), string_u8_litexpr(""));
api_param(arena, call, "Plat_Handle", "handle");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("wake_up_timer_set"), string_u8_litexpr("void"), string_u8_litexpr(""));
api_param(arena, call, "Plat_Handle", "handle");
api_param(arena, call, "u32", "time_milliseconds");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("signal_step"), string_u8_litexpr("void"), string_u8_litexpr(""));
api_param(arena, call, "u32", "code");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("sleep"), string_u8_litexpr("void"), string_u8_litexpr(""));
api_param(arena, call, "u64", "microseconds");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("get_clipboard"), string_u8_litexpr("String_Const_u8"), string_u8_litexpr(""));
api_param(arena, call, "Arena*", "arena");
api_param(arena, call, "i32", "index");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("post_clipboard"), string_u8_litexpr("void"), string_u8_litexpr(""));
api_param(arena, call, "String_Const_u8", "str");
api_param(arena, call, "i32", "index");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("set_clipboard_catch_all"), string_u8_litexpr("void"), string_u8_litexpr(""));
api_param(arena, call, "b32", "enabled");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("get_clipboard_catch_all"), string_u8_litexpr("b32"), string_u8_litexpr(""));
(void)call;
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("cli_call"), string_u8_litexpr("b32"), string_u8_litexpr(""));
api_param(arena, call, "Arena*", "scratch");
api_param(arena, call, "char*", "path");
api_param(arena, call, "char*", "script");
api_param(arena, call, "CLI_Handles*", "cli_out");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("cli_begin_update"), string_u8_litexpr("void"), string_u8_litexpr(""));
api_param(arena, call, "CLI_Handles*", "cli");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("cli_update_step"), string_u8_litexpr("b32"), string_u8_litexpr(""));
api_param(arena, call, "CLI_Handles*", "cli");
api_param(arena, call, "char*", "dest");
api_param(arena, call, "u32", "max");
api_param(arena, call, "u32*", "amount");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("cli_end_update"), string_u8_litexpr("b32"), string_u8_litexpr(""));
api_param(arena, call, "CLI_Handles*", "cli");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("open_color_picker"), string_u8_litexpr("void"), string_u8_litexpr(""));
api_param(arena, call, "Color_Picker*", "picker");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("get_screen_scale_factor"), string_u8_litexpr("f32"), string_u8_litexpr(""));
(void)call;
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("thread_launch"), string_u8_litexpr("System_Thread"), string_u8_litexpr(""));
api_param(arena, call, "Thread_Function*", "proc");
api_param(arena, call, "void*", "ptr");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("thread_join"), string_u8_litexpr("void"), string_u8_litexpr(""));
api_param(arena, call, "System_Thread", "thread");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("thread_free"), string_u8_litexpr("void"), string_u8_litexpr(""));
api_param(arena, call, "System_Thread", "thread");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("thread_get_id"), string_u8_litexpr("i32"), string_u8_litexpr(""));
(void)call;
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("acquire_global_frame_mutex"), string_u8_litexpr("void"), string_u8_litexpr(""));
api_param(arena, call, "Thread_Context*", "tctx");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("release_global_frame_mutex"), string_u8_litexpr("void"), string_u8_litexpr(""));
api_param(arena, call, "Thread_Context*", "tctx");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("mutex_make"), string_u8_litexpr("System_Mutex"), string_u8_litexpr(""));
(void)call;
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("mutex_acquire"), string_u8_litexpr("void"), string_u8_litexpr(""));
api_param(arena, call, "System_Mutex", "mutex");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("mutex_release"), string_u8_litexpr("void"), string_u8_litexpr(""));
api_param(arena, call, "System_Mutex", "mutex");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("mutex_free"), string_u8_litexpr("void"), string_u8_litexpr(""));
api_param(arena, call, "System_Mutex", "mutex");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("condition_variable_make"), string_u8_litexpr("System_Condition_Variable"), string_u8_litexpr(""));
(void)call;
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("condition_variable_wait"), string_u8_litexpr("void"), string_u8_litexpr(""));
api_param(arena, call, "System_Condition_Variable", "cv");
api_param(arena, call, "System_Mutex", "mutex");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("condition_variable_signal"), string_u8_litexpr("void"), string_u8_litexpr(""));
api_param(arena, call, "System_Condition_Variable", "cv");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("condition_variable_free"), string_u8_litexpr("void"), string_u8_litexpr(""));
api_param(arena, call, "System_Condition_Variable", "cv");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("memory_allocate"), string_u8_litexpr("void*"), string_u8_litexpr(""));
api_param(arena, call, "u64", "size");
api_param(arena, call, "String_Const_u8", "location");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("memory_set_protection"), string_u8_litexpr("b32"), string_u8_litexpr(""));
api_param(arena, call, "void*", "ptr");
api_param(arena, call, "u64", "size");
api_param(arena, call, "u32", "flags");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("memory_free"), string_u8_litexpr("void"), string_u8_litexpr(""));
api_param(arena, call, "void*", "ptr");
api_param(arena, call, "u64", "size");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("memory_annotation"), string_u8_litexpr("Memory_Annotation"), string_u8_litexpr(""));
api_param(arena, call, "Arena*", "arena");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("show_mouse_cursor"), string_u8_litexpr("void"), string_u8_litexpr(""));
api_param(arena, call, "i32", "show");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("set_fullscreen"), string_u8_litexpr("b32"), string_u8_litexpr(""));
api_param(arena, call, "b32", "full_screen");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("is_fullscreen"), string_u8_litexpr("b32"), string_u8_litexpr(""));
(void)call;
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("get_keyboard_modifiers"), string_u8_litexpr("Input_Modifier_Set"), string_u8_litexpr(""));
api_param(arena, call, "Arena*", "arena");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("set_key_mode"), string_u8_litexpr("void"), string_u8_litexpr(""));
api_param(arena, call, "Key_Mode", "mode");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("set_source_mixer"), string_u8_litexpr("void"), string_u8_litexpr(""));
api_param(arena, call, "void*", "ctx");
api_param(arena, call, "Audio_Mix_Sources_Function*", "mix_func");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("set_destination_mixer"), string_u8_litexpr("void"), string_u8_litexpr(""));
api_param(arena, call, "Audio_Mix_Destination_Function*", "mix_func");
}
return(result);
API_Definition *result = begin_api(arena, "system");
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("error_box"), string_u8_litexpr("void"), string_u8_litexpr(""));
api_param(arena, call, "char*", "msg");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("get_path"), string_u8_litexpr("String_Const_u8"), string_u8_litexpr(""));
api_param(arena, call, "Arena*", "arena");
api_param(arena, call, "System_Path_Code", "path_code");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("get_canonical"), string_u8_litexpr("String_Const_u8"), string_u8_litexpr(""));
api_param(arena, call, "Arena*", "arena");
api_param(arena, call, "String_Const_u8", "name");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("get_file_list"), string_u8_litexpr("File_List"), string_u8_litexpr(""));
api_param(arena, call, "Arena*", "arena");
api_param(arena, call, "String_Const_u8", "directory");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("quick_file_attributes"), string_u8_litexpr("File_Attributes"), string_u8_litexpr(""));
api_param(arena, call, "Arena*", "scratch");
api_param(arena, call, "String_Const_u8", "file_name");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("load_handle"), string_u8_litexpr("b32"), string_u8_litexpr(""));
api_param(arena, call, "Arena*", "scratch");
api_param(arena, call, "char*", "file_name");
api_param(arena, call, "Plat_Handle*", "out");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("load_attributes"), string_u8_litexpr("File_Attributes"), string_u8_litexpr(""));
api_param(arena, call, "Plat_Handle", "handle");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("load_file"), string_u8_litexpr("b32"), string_u8_litexpr(""));
api_param(arena, call, "Plat_Handle", "handle");
api_param(arena, call, "char*", "buffer");
api_param(arena, call, "u32", "size");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("load_close"), string_u8_litexpr("b32"), string_u8_litexpr(""));
api_param(arena, call, "Plat_Handle", "handle");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("save_file"), string_u8_litexpr("File_Attributes"), string_u8_litexpr(""));
api_param(arena, call, "Arena*", "scratch");
api_param(arena, call, "char*", "file_name");
api_param(arena, call, "String_Const_u8", "data");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("load_library"), string_u8_litexpr("b32"), string_u8_litexpr(""));
api_param(arena, call, "Arena*", "scratch");
api_param(arena, call, "String_Const_u8", "file_name");
api_param(arena, call, "System_Library*", "out");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("release_library"), string_u8_litexpr("b32"), string_u8_litexpr(""));
api_param(arena, call, "System_Library", "handle");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("get_proc"), string_u8_litexpr("Void_Func*"), string_u8_litexpr(""));
api_param(arena, call, "System_Library", "handle");
api_param(arena, call, "char*", "proc_name");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("now_time"), string_u8_litexpr("u64"), string_u8_litexpr(""));
(void)call;
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("now_date_time_universal"), string_u8_litexpr("Date_Time"), string_u8_litexpr(""));
(void)call;
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("local_date_time_from_universal"), string_u8_litexpr("Date_Time"), string_u8_litexpr(""));
api_param(arena, call, "Date_Time*", "date_time");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("universal_date_time_from_local"), string_u8_litexpr("Date_Time"), string_u8_litexpr(""));
api_param(arena, call, "Date_Time*", "date_time");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("wake_up_timer_create"), string_u8_litexpr("Plat_Handle"), string_u8_litexpr(""));
(void)call;
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("wake_up_timer_release"), string_u8_litexpr("void"), string_u8_litexpr(""));
api_param(arena, call, "Plat_Handle", "handle");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("wake_up_timer_set"), string_u8_litexpr("void"), string_u8_litexpr(""));
api_param(arena, call, "Plat_Handle", "handle");
api_param(arena, call, "u32", "time_milliseconds");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("signal_step"), string_u8_litexpr("void"), string_u8_litexpr(""));
api_param(arena, call, "u32", "code");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("sleep"), string_u8_litexpr("void"), string_u8_litexpr(""));
api_param(arena, call, "u64", "microseconds");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("get_clipboard"), string_u8_litexpr("String_Const_u8"), string_u8_litexpr(""));
api_param(arena, call, "Arena*", "arena");
api_param(arena, call, "i32", "index");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("post_clipboard"), string_u8_litexpr("void"), string_u8_litexpr(""));
api_param(arena, call, "String_Const_u8", "str");
api_param(arena, call, "i32", "index");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("set_clipboard_catch_all"), string_u8_litexpr("void"), string_u8_litexpr(""));
api_param(arena, call, "b32", "enabled");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("get_clipboard_catch_all"), string_u8_litexpr("b32"), string_u8_litexpr(""));
(void)call;
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("cli_call"), string_u8_litexpr("b32"), string_u8_litexpr(""));
api_param(arena, call, "Arena*", "scratch");
api_param(arena, call, "char*", "path");
api_param(arena, call, "char*", "script");
api_param(arena, call, "CLI_Handles*", "cli_out");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("cli_begin_update"), string_u8_litexpr("void"), string_u8_litexpr(""));
api_param(arena, call, "CLI_Handles*", "cli");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("cli_update_step"), string_u8_litexpr("b32"), string_u8_litexpr(""));
api_param(arena, call, "CLI_Handles*", "cli");
api_param(arena, call, "char*", "dest");
api_param(arena, call, "u32", "max");
api_param(arena, call, "u32*", "amount");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("cli_end_update"), string_u8_litexpr("b32"), string_u8_litexpr(""));
api_param(arena, call, "CLI_Handles*", "cli");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("open_color_picker"), string_u8_litexpr("void"), string_u8_litexpr(""));
api_param(arena, call, "Color_Picker*", "picker");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("get_screen_scale_factor"), string_u8_litexpr("f32"), string_u8_litexpr(""));
(void)call;
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("thread_launch"), string_u8_litexpr("System_Thread"), string_u8_litexpr(""));
api_param(arena, call, "Thread_Function*", "proc");
api_param(arena, call, "void*", "ptr");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("thread_join"), string_u8_litexpr("void"), string_u8_litexpr(""));
api_param(arena, call, "System_Thread", "thread");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("thread_free"), string_u8_litexpr("void"), string_u8_litexpr(""));
api_param(arena, call, "System_Thread", "thread");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("thread_get_id"), string_u8_litexpr("i32"), string_u8_litexpr(""));
(void)call;
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("acquire_global_frame_mutex"), string_u8_litexpr("void"), string_u8_litexpr(""));
api_param(arena, call, "Thread_Context*", "tctx");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("release_global_frame_mutex"), string_u8_litexpr("void"), string_u8_litexpr(""));
api_param(arena, call, "Thread_Context*", "tctx");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("mutex_make"), string_u8_litexpr("System_Mutex"), string_u8_litexpr(""));
(void)call;
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("mutex_acquire"), string_u8_litexpr("void"), string_u8_litexpr(""));
api_param(arena, call, "System_Mutex", "mutex");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("mutex_release"), string_u8_litexpr("void"), string_u8_litexpr(""));
api_param(arena, call, "System_Mutex", "mutex");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("mutex_free"), string_u8_litexpr("void"), string_u8_litexpr(""));
api_param(arena, call, "System_Mutex", "mutex");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("condition_variable_make"), string_u8_litexpr("System_Condition_Variable"), string_u8_litexpr(""));
(void)call;
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("condition_variable_wait"), string_u8_litexpr("void"), string_u8_litexpr(""));
api_param(arena, call, "System_Condition_Variable", "cv");
api_param(arena, call, "System_Mutex", "mutex");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("condition_variable_signal"), string_u8_litexpr("void"), string_u8_litexpr(""));
api_param(arena, call, "System_Condition_Variable", "cv");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("condition_variable_free"), string_u8_litexpr("void"), string_u8_litexpr(""));
api_param(arena, call, "System_Condition_Variable", "cv");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("memory_allocate"), string_u8_litexpr("void*"), string_u8_litexpr(""));
api_param(arena, call, "u64", "size");
api_param(arena, call, "String_Const_u8", "location");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("memory_set_protection"), string_u8_litexpr("b32"), string_u8_litexpr(""));
api_param(arena, call, "void*", "ptr");
api_param(arena, call, "u64", "size");
api_param(arena, call, "u32", "flags");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("memory_free"), string_u8_litexpr("void"), string_u8_litexpr(""));
api_param(arena, call, "void*", "ptr");
api_param(arena, call, "u64", "size");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("memory_annotation"), string_u8_litexpr("Memory_Annotation"), string_u8_litexpr(""));
api_param(arena, call, "Arena*", "arena");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("show_mouse_cursor"), string_u8_litexpr("void"), string_u8_litexpr(""));
api_param(arena, call, "i32", "show");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("set_fullscreen"), string_u8_litexpr("b32"), string_u8_litexpr(""));
api_param(arena, call, "b32", "full_screen");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("is_fullscreen"), string_u8_litexpr("b32"), string_u8_litexpr(""));
(void)call;
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("get_keyboard_modifiers"), string_u8_litexpr("Input_Modifier_Set"), string_u8_litexpr(""));
api_param(arena, call, "Arena*", "arena");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("set_key_mode"), string_u8_litexpr("void"), string_u8_litexpr(""));
api_param(arena, call, "Key_Mode", "mode");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("set_source_mixer"), string_u8_litexpr("void"), string_u8_litexpr(""));
api_param(arena, call, "void*", "ctx");
api_param(arena, call, "Audio_Mix_Sources_Function*", "mix_func");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("set_destination_mixer"), string_u8_litexpr("void"), string_u8_litexpr(""));
api_param(arena, call, "Audio_Mix_Destination_Function*", "mix_func");
}
return(result);
}

View File

@ -1,3 +1,5 @@
/* Generated by "4ed_system_api.cpp" */
api(system) function void error_box(char* msg);
api(system) function String_Const_u8 get_path(Arena* arena, System_Path_Code path_code);
api(system) function String_Const_u8 get_canonical(Arena* arena, String_Const_u8 name);

View File

@ -1,11 +1,14 @@
/* Generated by "4ed_font_api.cpp" */
function void
font_api_fill_vtable(API_VTable_font *vtable){
vtable->make_face = font_make_face;
vtable->make_face = font_make_face;
}
#if defined(DYNAMIC_LINK_API)
function void
font_api_read_vtable(API_VTable_font *vtable){
font_make_face = vtable->make_face;
font_make_face = vtable->make_face;
}
#undef DYNAMIC_LINK_API
#endif

View File

@ -1,11 +1,17 @@
/* Generated by "4ed_font_api.cpp" */
#define font_make_face_sig() Face* font_make_face(Arena* arena, Face_Description* description, f32 scale_factor)
typedef Face* font_make_face_type(Arena* arena, Face_Description* description, f32 scale_factor);
struct API_VTable_font{
font_make_face_type *make_face;
font_make_face_type *make_face;
};
#if defined(STATIC_LINK_API)
internal Face* font_make_face(Arena* arena, Face_Description* description, f32 scale_factor);
#undef STATIC_LINK_API
#elif defined(DYNAMIC_LINK_API)
global font_make_face_type *font_make_face = 0;
#undef DYNAMIC_LINK_API

View File

@ -1,13 +1,18 @@
/* Generated by "4ed_graphics_api.cpp" */
function void
graphics_api_fill_vtable(API_VTable_graphics *vtable){
vtable->get_texture = graphics_get_texture;
vtable->fill_texture = graphics_fill_texture;
vtable->get_texture = graphics_get_texture;
vtable->fill_texture = graphics_fill_texture;
vtable->free_texture = graphics_free_texture;
}
#if defined(DYNAMIC_LINK_API)
function void
graphics_api_read_vtable(API_VTable_graphics *vtable){
graphics_get_texture = vtable->get_texture;
graphics_fill_texture = vtable->fill_texture;
graphics_get_texture = vtable->get_texture;
graphics_fill_texture = vtable->fill_texture;
graphics_free_texture = vtable->free_texture;
}
#undef DYNAMIC_LINK_API
#endif

View File

@ -1,17 +1,28 @@
/* Generated by "4ed_graphics_api.cpp" */
#define graphics_get_texture_sig() u32 graphics_get_texture(Vec3_i32 dim, Texture_Kind texture_kind)
#define graphics_fill_texture_sig() b32 graphics_fill_texture(Texture_Kind texture_kind, u32 texture, Vec3_i32 p, Vec3_i32 dim, void* data)
#define graphics_free_texture_sig() void graphics_free_texture(u32 texid)
typedef u32 graphics_get_texture_type(Vec3_i32 dim, Texture_Kind texture_kind);
typedef b32 graphics_fill_texture_type(Texture_Kind texture_kind, u32 texture, Vec3_i32 p, Vec3_i32 dim, void* data);
typedef void graphics_free_texture_type(u32 texid);
struct API_VTable_graphics{
graphics_get_texture_type *get_texture;
graphics_fill_texture_type *fill_texture;
graphics_get_texture_type *get_texture;
graphics_fill_texture_type *fill_texture;
graphics_free_texture_type *free_texture;
};
#if defined(STATIC_LINK_API)
internal u32 graphics_get_texture(Vec3_i32 dim, Texture_Kind texture_kind);
internal b32 graphics_fill_texture(Texture_Kind texture_kind, u32 texture, Vec3_i32 p, Vec3_i32 dim, void* data);
internal void graphics_free_texture(u32 texid);
#undef STATIC_LINK_API
#elif defined(DYNAMIC_LINK_API)
global graphics_get_texture_type *graphics_get_texture = 0;
global graphics_fill_texture_type *graphics_fill_texture = 0;
global graphics_free_texture_type *graphics_free_texture = 0;
#undef DYNAMIC_LINK_API
#endif

View File

@ -53,6 +53,11 @@ gl__fill_texture(Texture_Kind texture_kind, u32 texture, Vec3_i32 p, Vec3_i32 di
return(result);
}
internal void
gl__free_texture(u32 texture){
glDeleteTextures(1, &texture);
}
internal void
gl__error_callback(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const char *message, const void *userParam){
switch (id){
@ -107,20 +112,20 @@ char *gl__fragment = R"foo(
smooth in float half_thickness;
uniform sampler2DArray sampler;
out vec4 out_color;
float rectangle_sd(vec2 p, vec2 b){
vec2 d = abs(p) - b;
return(length(max(d, vec2(0.0, 0.0))) + min(max(d.x, d.y), 0.0));
}
void main(void)
{
float has_thickness = (step(0.49, half_thickness));
float does_not_have_thickness = 1.0 - has_thickness;
float sample_value = texture(sampler, uvw).r;
sample_value *= does_not_have_thickness;
vec2 center = uvw.xy;
float roundness = uvw.z;
float sd = rectangle_sd(xy - center, adjusted_half_dim);
@ -128,7 +133,7 @@ char *gl__fragment = R"foo(
sd = abs(sd + half_thickness) - half_thickness;
float shape_value = 1.0 - smoothstep(-1.0, 0.0, sd);
shape_value *= has_thickness;
out_color = vec4(fragment_color.xyz, fragment_color.a*(sample_value + shape_value));
}
)foo";

View File

@ -588,6 +588,11 @@ graphics_fill_texture_sig(){
return(gl__fill_texture(texture_kind, texture, p, dim, data));
}
internal
graphics_free_texture_sig(){
gl__free_texture(texid);
}
////////////////////////////
internal Face*

View File

@ -670,6 +670,11 @@ graphics_fill_texture_sig(){
return(gl__fill_texture(texture_kind, texture, p, dim, data));
}
internal
graphics_free_texture_sig(){
gl__free_texture(texid);
}
internal
font_make_face_sig(){
return(ft__font_make_face(arena, description, scale_factor));