Merge remote-tracking branch 'origin/master' into linux-update

master
Alex Baines 2020-02-01 21:29:11 +00:00
commit 1091b9d2d4
115 changed files with 13763 additions and 7981 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
vc120.pdb
4ed_data.ctm
.DS_Store
*.dSYM

1681
4ed.cpp

File diff suppressed because it is too large Load Diff

View File

@ -453,7 +453,7 @@ buffer_line_y_difference(Application_Links *app, Buffer_ID buffer_id,
i64 line_a, i64 line_b){
Models *models = (Models*)app->cmd_context;
Editing_File *file = imp_get_file(models, buffer_id);
f32 result = {};
f32 result = 0.0f;
if (api_check_buffer(file)){
Face *face = font_set_face_from_id(&models->font_set, face_id);
if (face != 0){
@ -521,13 +521,30 @@ buffer_relative_box_of_pos(Application_Links *app, Buffer_ID buffer_id, f32 widt
return(result);
}
api(custom) function Rect_f32
buffer_padded_box_of_pos(Application_Links *app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 pos){
Models *models = (Models*)app->cmd_context;
Editing_File *file = imp_get_file(models, buffer_id);
Rect_f32 result = {};
if (api_check_buffer(file)){
Face *face = font_set_face_from_id(&models->font_set, face_id);
if (face != 0){
Layout_Function *layout_func = file_get_layout_func(file);
result = file_padded_box_of_pos(app->tctx, models, file,
layout_func, width, face,
base_line, pos);
}
}
return(result);
}
api(custom) function i64
buffer_relative_character_from_pos(Application_Links *app, Buffer_ID buffer_id,
f32 width, Face_ID face_id, i64 base_line, i64 pos)
{
Models *models = (Models*)app->cmd_context;
Editing_File *file = imp_get_file(models, buffer_id);
i64 result = {};
i64 result = 0;
if (api_check_buffer(file)){
Face *face = font_set_face_from_id(&models->font_set, face_id);
if (face != 0){
@ -563,7 +580,7 @@ api(custom) function f32
view_line_y_difference(Application_Links *app, View_ID view_id, i64 line_a, i64 line_b){
Models *models = (Models*)app->cmd_context;
View *view = imp_get_view(models, view_id);
f32 result = {};
f32 result = 0.0f;
if (api_check_view(view)){
result = view_line_y_difference(app->tctx, models, view, line_a, line_b);
}
@ -603,11 +620,22 @@ view_relative_box_of_pos(Application_Links *app, View_ID view_id, i64 base_line,
return(result);
}
api(custom) function Rect_f32
view_padded_box_of_pos(Application_Links *app, View_ID view_id, i64 base_line, i64 pos){
Models *models = (Models*)app->cmd_context;
View *view = imp_get_view(models, view_id);
Rect_f32 result = {};
if (api_check_view(view)){
result = view_padded_box_of_pos(app->tctx, models, view, base_line, pos);
}
return(result);
}
api(custom) function i64
view_relative_character_from_pos(Application_Links *app, View_ID view_id, i64 base_line, i64 pos){
Models *models = (Models*)app->cmd_context;
View *view = imp_get_view(models, view_id);
i64 result = {};
i64 result = 0;
if (api_check_view(view)){
result = view_relative_character_from_pos(app->tctx, models, view, base_line, pos);
}
@ -618,7 +646,7 @@ api(custom) function i64
view_pos_from_relative_character(Application_Links *app, View_ID view_id, i64 base_line, i64 character){
Models *models = (Models*)app->cmd_context;
View *view = imp_get_view(models, view_id);
i64 result = {};
i64 result = 0;
if (api_check_view(view)){
result = view_pos_from_relative_character(app->tctx, models, view, base_line, character);
}
@ -702,7 +730,7 @@ api(custom) function Dirty_State
buffer_get_dirty_state(Application_Links *app, Buffer_ID buffer_id){
Models *models = (Models*)app->cmd_context;
Editing_File *file = imp_get_file(models, buffer_id);
Dirty_State result = {};
Dirty_State result = 0;
if (api_check_buffer(file)){
result = file->state.dirty;
}
@ -771,6 +799,11 @@ buffer_get_setting(Application_Links *app, Buffer_ID buffer_id, Buffer_Setting_I
*value_out = file->settings.unimportant;
}break;
case BufferSetting_Unkillable:
{
*value_out = (file->settings.never_kill || file->settings.unkillable);
}break;
case BufferSetting_ReadOnly:
{
*value_out = file->settings.read_only;
@ -809,14 +842,14 @@ buffer_set_setting(Application_Links *app, Buffer_ID buffer_id, Buffer_Setting_I
}
}break;
case BufferSetting_Unkillable:
{
file->settings.unkillable = (value != 0);
}break;
case BufferSetting_ReadOnly:
{
if (value){
file->settings.read_only = true;
}
else{
file->settings.read_only = false;
}
file->settings.read_only = (value != 0);
}break;
case BufferSetting_RecordsHistory:
@ -915,7 +948,7 @@ buffer_kill(Application_Links *app, Buffer_ID buffer_id, Buffer_Kill_Flag flags)
Editing_File *file = imp_get_file(models, buffer_id);
Buffer_Kill_Result result = BufferKillResult_DoesNotExist;
if (api_check_buffer(file)){
if (!file->settings.never_kill){
if (!file->settings.never_kill && !file->settings.unkillable){
b32 needs_to_save = file_needs_save(file);
if (!needs_to_save || (flags & BufferKill_AlwaysKill) != 0){
Thread_Context *tctx = app->tctx;
@ -1080,7 +1113,7 @@ get_view_prev__inner(Layout *layout, View *view){
}
}
else{
Panel *panel = layout_get_first_open_panel(layout);
Panel *panel = layout_get_last_open_panel(layout);
view = panel->view;
}
return(view);
@ -1678,23 +1711,6 @@ view_set_buffer(Application_Links *app, View_ID view_id, Buffer_ID buffer_id, Se
return(result);
}
// TODO(allen): remove this!
api(custom) function b32
view_post_fade(Application_Links *app, View_ID view_id, f32 seconds, Range_i64 range,
ARGB_Color color){
Models *models = (Models*)app->cmd_context;
View *view = imp_get_view(models, view_id);
b32 result = false;
if (api_check_view(view)){
i64 size = range_size(range);
if (size > 0){
view_post_paste_effect(view, seconds, (i32)range.start, (i32)size, color);
result = true;
}
}
return(result);
}
api(custom) function b32
view_push_context(Application_Links *app, View_ID view_id, View_Context *ctx){
Models *models = (Models*)app->cmd_context;
@ -1991,7 +2007,7 @@ managed_scope_get_attachment(Application_Links *app, Managed_Scope scope, Manage
}
else{
#define M \
"ERROR: scope attachment already exists with a size smaller than the requested size; no attachment pointer can be returned."
"ERROR: scope attachment already exists with a size smaller than the requested size; no attachment pointer can be returned."
print_message(app, string_u8_litexpr(M));
#undef M
}
@ -2390,7 +2406,7 @@ set_global_face(Application_Links *app, Face_ID id)
b32 result = false;
Face *face = font_set_face_from_id(&models->font_set, id);
if (face != 0){
models->global_face_id = face->id;
models->global_face_id = face->id;
result = true;
}
return(result);
@ -2733,6 +2749,13 @@ send_exit_signal(Application_Links *app)
models->keep_playing = false;
}
api(custom) function void
hard_exit(Application_Links *app)
{
Models *models = (Models*)app->cmd_context;
models->hard_exit = true;
}
api(custom) function void
set_window_title(Application_Links *app, String_Const_u8 title)
{
@ -2796,7 +2819,7 @@ api(custom) function Text_Layout_ID
text_layout_create(Application_Links *app, Buffer_ID buffer_id, Rect_f32 rect, Buffer_Point buffer_point){
Models *models = (Models*)app->cmd_context;
Editing_File *file = imp_get_file(models, buffer_id);
Text_Layout_ID result = {};
Text_Layout_ID result = 0;
if (api_check_buffer(file)){
Thread_Context *tctx = app->tctx;
Scratch_Block scratch(tctx);
@ -2826,10 +2849,10 @@ text_layout_create(Application_Links *app, Buffer_ID buffer_id, Rect_f32 rect, B
Range_i64 visible_line_number_range = Ii64(buffer_point.line_number, line_number);
Range_i64 visible_range = Ii64(buffer_get_first_pos_from_line_number(buffer, visible_line_number_range.min),
buffer_get_last_pos_from_line_number(buffer, visible_line_number_range.max));
buffer_get_last_pos_from_line_number(buffer, visible_line_number_range.max));
i64 item_count = range_size_inclusive(visible_range);
ARGB_Color *colors_array = push_array_zero(arena, ARGB_Color, item_count);
ARGB_Color *colors_array = push_array_zero(arena, ARGB_Color, item_count);
result = text_layout_new(&models->text_layouts, arena, buffer_id, buffer_point,
visible_range, visible_line_number_range, rect, colors_array,
layout_func);
@ -2944,7 +2967,7 @@ text_layout_character_on_screen(Application_Links *app, Text_Layout_ID layout_id
y += line.height;
}
// TODO(allen): optimization: This is some fairly heavy computation. We really
// TODO(allen): optimization: This is some fairly heavy computation. We really
// need to accelerate the (pos -> item) lookup within a single
// Buffer_Layout_Item_List.
b32 is_first_item = true;
@ -2987,13 +3010,35 @@ paint_text_color(Application_Links *app, Text_Layout_ID layout_id, Range_i64 ran
range.max = clamp_top(range.max, layout->visible_range.max);
range.min -= layout->visible_range.min;
range.max -= layout->visible_range.min;
ARGB_Color *color_ptr = layout->item_colors + range.min;
ARGB_Color *color_ptr = layout->item_colors + range.min;
for (i64 i = range.min; i < range.max; i += 1, color_ptr += 1){
*color_ptr = color;
}
}
}
api(custom) function void
paint_text_color_blend(Application_Links *app, Text_Layout_ID layout_id, Range_i64 range, ARGB_Color color, f32 blend){
Models *models = (Models*)app->cmd_context;
Rect_f32 result = {};
Text_Layout *layout = text_layout_get(&models->text_layouts, layout_id);
if (layout != 0){
range.min = clamp_bot(layout->visible_range.min, range.min);
range.max = clamp_top(range.max, layout->visible_range.max);
range.min -= layout->visible_range.min;
range.max -= layout->visible_range.min;
Vec4_f32 color_v4f32 = unpack_color(color);
Vec4_f32 color_pm_v4f32 = color_v4f32*blend;
f32 neg_blend = 1.f - blend;
ARGB_Color *color_ptr = layout->item_colors + range.min;
for (i64 i = range.min; i < range.max; i += 1, color_ptr += 1){
Vec4_f32 color_ptr_v4f32 = unpack_color(*color_ptr);
Vec4_f32 blended_v4f32 = color_ptr_v4f32*neg_blend + color_pm_v4f32;
*color_ptr = pack_color(blended_v4f32);
}
}
}
api(custom) function b32
text_layout_free(Application_Links *app, Text_Layout_ID text_layout_id){
Models *models = (Models*)app->cmd_context;

View File

@ -105,7 +105,8 @@ struct Models{
Hot_Directory hot_directory;
b32 keep_playing;
b8 keep_playing;
b8 hard_exit;
b32 has_new_title;
char *title_space;

View File

@ -646,53 +646,6 @@ buffer_remeasure_starts(Thread_Context *tctx, Gap_Buffer *buffer, Batch_Edit *ba
}
}
#if 0
internal void
buffer_remeasure_starts(Arena *scratch, Gap_Buffer *buffer,
Range_i64 old_line_indexes, i64 line_shift, i64 text_shift){
Temp_Memory temp = begin_temp(scratch);
buffer_starts__ensure_max_size(buffer, buffer->line_start_count + line_shift);
i64 new_line_indexes_opl = old_line_indexes.one_past_last + line_shift;
i64 old_line_start_count = buffer->line_start_count;
i64 *line_start_ptr = buffer->line_starts + old_line_indexes.one_past_last;
for (i64 i = old_line_indexes.one_past_last;
i < old_line_start_count;
i += 1, line_start_ptr += 1){
*line_start_ptr += text_shift;
}
block_copy_dynamic_array(buffer->line_starts + new_line_indexes_opl,
buffer->line_starts + old_line_indexes.one_past_last,
buffer->line_start_count - old_line_indexes.one_past_last);
i64 first_pos = buffer->line_starts[old_line_indexes.first];
i64 write_counter = old_line_indexes.first + 1;
i64 pos = first_pos;
List_String_Const_u8 list = buffer_get_chunks(scratch, buffer);
buffer_chunks_clamp(&list, Ii64(first_pos, buffer_size(buffer)));
for (Node_String_Const_u8 *node = list.first;
node != 0;
node = node->next){
u8 *byte = node->string.str;
u8 *byte_opl = byte + node->string.size;
for (;byte < byte_opl; byte += 1){
pos += 1;
if (*byte == '\n'){
buffer->line_starts[write_counter] = pos;
write_counter += 1;
if (write_counter == new_line_indexes_opl){
goto double_break;
}
}
}
}
double_break:;
buffer->line_start_count += line_shift;
end_temp(temp);
}
#endif
internal Range_i64
buffer_get_pos_range_from_line_number(Gap_Buffer *buffer, i64 line_number){
Range_i64 result = {};
@ -705,7 +658,7 @@ buffer_get_pos_range_from_line_number(Gap_Buffer *buffer, i64 line_number){
internal i64
buffer_get_first_pos_from_line_number(Gap_Buffer *buffer, i64 line_number){
i64 result = {};
i64 result = 0;
if (line_number < 1){
result = 0;
}
@ -720,7 +673,7 @@ buffer_get_first_pos_from_line_number(Gap_Buffer *buffer, i64 line_number){
internal i64
buffer_get_last_pos_from_line_number(Gap_Buffer *buffer, i64 line_number){
i64 result = {};
i64 result = 0;
if (line_number < 1){
result = 0;
}

View File

@ -90,8 +90,7 @@ edit_fix_markers__compute_scroll_y(i32 line_height, i32 old_y_val, f32 new_y_val
}
function void
edit_fix_markers(Thread_Context *tctx, Models *models, Editing_File *file,
Batch_Edit *batch){
edit_fix_markers(Thread_Context *tctx, Models *models, Editing_File *file, Batch_Edit *batch){
Layout *layout = &models->layout;
Lifetime_Object *file_lifetime_object = file->lifetime_object;
@ -135,7 +134,10 @@ edit_fix_markers(Thread_Context *tctx, Models *models, Editing_File *file,
File_Edit_Positions edit_pos = view_get_edit_pos(view);
write_cursor_with_index(cursors, &cursor_count, (i32)edit_pos.cursor_pos);
write_cursor_with_index(cursors, &cursor_count, (i32)view->mark);
// TODO(allen): write a cursor for the current scroll line
Buffer_Cursor pos_cursor = file_compute_cursor(file, seek_line_col(edit_pos.scroll.position.line_number, 1));
Buffer_Cursor targ_cursor = file_compute_cursor(file, seek_line_col(edit_pos.scroll.target.line_number, 1));
write_cursor_with_index(cursors, &cursor_count, pos_cursor.pos);
write_cursor_with_index(cursors, &cursor_count, targ_cursor.pos);
}
}
@ -156,6 +158,8 @@ edit_fix_markers(Thread_Context *tctx, Models *models, Editing_File *file,
}
}
buffer_remeasure_starts(tctx, &file->state.buffer, batch);
if (cursor_count > 0 || r_cursor_count > 0){
buffer_sort_cursors( cursors, cursor_count);
buffer_sort_cursors(r_cursors, r_cursor_count);
@ -178,8 +182,15 @@ edit_fix_markers(Thread_Context *tctx, Models *models, Editing_File *file,
i64 cursor_pos = cursors[cursor_count++].pos;
view->mark = cursors[cursor_count++].pos;
File_Edit_Positions edit_pos = view_get_edit_pos(view);
i64 scroll_pos = cursors[cursor_count++].pos;
i64 scroll_targ = cursors[cursor_count++].pos;
Buffer_Cursor pos_cursor = file_compute_cursor(file, seek_pos(scroll_pos));
Buffer_Cursor targ_cursor = file_compute_cursor(file, seek_pos(scroll_targ));
edit_pos.scroll.position.line_number = pos_cursor.line;
edit_pos.scroll.target.line_number = targ_cursor.line;
view_set_cursor_and_scroll(tctx, models, view, cursor_pos, edit_pos.scroll);
// TODO(allen): read a cursor for the current scroll line
}
}
@ -254,7 +265,6 @@ edit_single(Thread_Context *tctx, Models *models, Editing_File *file,
batch.edit.text = string;
batch.edit.range = range;
buffer_remeasure_starts(tctx, &file->state.buffer, &batch);
edit_fix_markers(tctx, models, file, &batch);
post_edit_call_hook(tctx, models, file,
Ii64_size(range.first, string.size), range_size(range));
@ -489,7 +499,6 @@ edit_batch(Thread_Context *tctx, Models *models, Editing_File *file,
file_clear_layout_cache(file);
buffer_remeasure_starts(tctx, buffer, batch);
edit_fix_markers(tctx, models, file, batch);
post_edit_call_hook(tctx, models, file, new_range, range_size(old_range));
@ -501,7 +510,7 @@ edit_batch(Thread_Context *tctx, Models *models, Editing_File *file,
////////////////////////////////
function Editing_File*
function Editing_File*
create_file(Thread_Context *tctx, Models *models, String_Const_u8 file_name, Buffer_Create_Flag flags){
Editing_File *result = 0;

View File

@ -440,6 +440,21 @@ file_relative_xy_of_pos(Thread_Context *tctx, Models *models, Editing_File *file
return(rect_center(rect));
}
function Rect_f32
file_padded_box_of_pos(Thread_Context *tctx, Models *models, Editing_File *file,
Layout_Function *layout_func, f32 width, Face *face,
i64 base_line, i64 pos){
i64 line_number = buffer_get_line_index(&file->state.buffer, pos) + 1;
Layout_Item_List line = file_get_line_layout(tctx, models, file, layout_func, width, face, line_number);
Rect_f32 result = layout_padded_box_of_pos(line, pos);
f32 y_difference = file_line_y_difference(tctx, models, file, layout_func, width, face, line_number, base_line);
result.y0 += y_difference;
result.y1 += y_difference;
return(result);
}
internal Buffer_Point
file_normalize_buffer_point(Thread_Context *tctx, Models *models, Editing_File *file,
Layout_Function *layout_func, f32 width, Face *face,

View File

@ -24,15 +24,6 @@ struct File_Edit_Positions{
i64 cursor_pos;
};
// TODO(allen): do(replace Text_Effect with IM rendering over time)
struct Text_Effect{
i64 start;
i64 end;
u32 color;
f32 seconds_down;
f32 seconds_max;
};
struct Editing_File_Settings{
Layout_Function *layout_func;
Face_ID face_id;
@ -40,6 +31,7 @@ struct Editing_File_Settings{
b8 is_initialized;
b8 unimportant;
b8 read_only;
b8 unkillable;
b8 never_kill;
};
@ -62,8 +54,6 @@ struct Editing_File_State{
History history;
i32 current_record_index;
Text_Effect paste_effect;
Dirty_State dirty;
File_Save_State save_state;

View File

@ -314,6 +314,7 @@ history__optimize_group(Arena *scratch, History *history, Record *record){
String_Const_u8 merged_forward = {};
String_Const_u8 merged_backward = {};
i64 merged_first = 0;
if (left->single.first + (i64)left->single.forward_text.size == right->single.first){
do_merge = true;
merged_forward = push_u8_stringf(scratch, "%.*s%.*s",
@ -322,6 +323,7 @@ history__optimize_group(Arena *scratch, History *history, Record *record){
merged_backward = push_u8_stringf(scratch, "%.*s%.*s",
string_expand(left->single.backward_text),
string_expand(right->single.backward_text));
merged_first = left->single.first;
}
else if (right->single.first + (i64)right->single.backward_text.size == left->single.first){
do_merge = true;
@ -331,6 +333,7 @@ history__optimize_group(Arena *scratch, History *history, Record *record){
merged_backward = push_u8_stringf(scratch, "%.*s%.*s",
string_expand(right->single.backward_text),
string_expand(left->single.backward_text));
merged_first = right->single.first;
}
else{
break;
@ -340,6 +343,7 @@ history__optimize_group(Arena *scratch, History *history, Record *record){
end_temp(left->restore_point);
left->edit_number = right->edit_number;
left->single.first = merged_first;
left->single.forward_text = push_string_copy(history->arena, merged_forward);
left->single.backward_text = push_string_copy(history->arena, merged_backward);

View File

@ -123,6 +123,16 @@ layout_get_first_open_panel(Layout *layout){
return(panel);
}
internal Panel*
layout_get_last_open_panel(Layout *layout){
Panel *panel = CastFromMember(Panel, node, layout->open_panels.prev);
if (panel != 0 && &panel->node == &layout->open_panels){
panel = 0;
}
AssertImplies(panel != 0, panel->kind == PanelKind_Final);
return(panel);
}
internal Panel*
layout_get_next_open_panel(Layout *layout, Panel *panel){
panel = CastFromMember(Panel, node, panel->node.next);
@ -289,7 +299,7 @@ layout_initialize(Arena *arena, Layout *layout){
Panel *panel = panels;
layout->free_panels.next = &panel->node;
panel->node.prev = &layout->free_panels;
for (i32 i = 1; i < MAX_VIEWS; i += 1, panel += 1){
for (i32 i = 1; i < panel_alloc_count; i += 1, panel += 1){
panel[1].node.prev = &panel[0].node;
panel[0].node.next = &panel[1].node;
}

View File

@ -125,7 +125,7 @@ find_all_matches_forward(Arena *arena, i32 maximum_output_count,
jump_back_0:
if (n + 1 == needle.size){
String_Match_Flag flags = {};
String_Match_Flag flags = 0;
if (!(last_insensitive >= 0 &&
j <= (u64)last_insensitive &&
(u64)last_insensitive < j + needle.size)){
@ -245,7 +245,7 @@ find_all_matches_backward(Arena *arena, i32 maximum_output_count,
jump_back_0:
if (n + 1 == needle.size){
String_Match_Flag flags = {};
String_Match_Flag flags = 0;
if (!(last_insensitive < size &&
j >= last_insensitive &&
last_insensitive > j - (i64)needle.size)){

View File

@ -234,6 +234,17 @@ view_relative_xy_of_pos(Thread_Context *tctx, Models *models, View *view,
return(rect_center(rect));
}
function Rect_f32
view_padded_box_of_pos(Thread_Context *tctx, Models *models, View *view,
i64 base_line, i64 pos){
Editing_File *file = view->file;
Face *face = file_get_face(models, file);
f32 width = view_width(tctx, models, view);
Layout_Function *layout_func = file_get_layout_func(file);
return(file_padded_box_of_pos(tctx, models, file,
layout_func, width, face, base_line, pos));
}
internal Buffer_Point
view_normalize_buffer_point(Thread_Context *tctx, Models *models, View *view,
Buffer_Point point){
@ -430,16 +441,6 @@ view_set_cursor_and_scroll(Thread_Context *tctx, Models *models, View *view, i64
view_set_edit_pos(view, edit_pos);
}
internal void
view_post_paste_effect(View *view, f32 seconds, i64 start, i64 size, ARGB_Color color){
Editing_File *file = view->file;
file->state.paste_effect.start = start;
file->state.paste_effect.end = start + size;
file->state.paste_effect.color = color;
file->state.paste_effect.seconds_down = seconds;
file->state.paste_effect.seconds_max = seconds;
}
////////////////////////////////
internal void
@ -518,7 +519,7 @@ co_handle_request(Models *models, Coroutine *co, Co_Out *out){
Face_Description *description = out->face_description;
Face *face = font_set_new_face(&models->font_set, description);
Co_In in = {};
in.face_id = face->id;
in.face_id = (face != 0)?face->id:0;
result = coroutine_run(&models->coroutines, co, &in, out);
}break;

View File

@ -21,7 +21,8 @@ file_change_notification_check(Arena *scratch, Working_Set *working_set, Editing
if (file->canon.name_size > 0 && !file->settings.unimportant){
String_Const_u8 name = SCu8(file->canon.name_space, file->canon.name_size);
File_Attributes attributes = system_quick_file_attributes(scratch, name);
if (attributes.last_write_time > file->attributes.last_write_time){
if ((attributes.last_write_time > file->attributes.last_write_time) ||
(attributes.last_write_time == 0 && file->attributes.last_write_time > 0)){
if (file->state.save_state == FileSaveState_SavedWaitingForNotification){
file->state.save_state = FileSaveState_Normal;
file->attributes = attributes;

File diff suppressed because it is too large Load Diff

43
bin/build-mac.sh Executable file
View File

@ -0,0 +1,43 @@
#!/bin/bash
# If any command errors, stop the script
set -e
# Set up directories (mirrors build.bat)
# NOTE(yuval): Replaced readlink with realpath which works for both macOS and Linux
ME="$(realpath "$0")"
LOCATION="$(dirname "$ME")"
SRC_ROOT="$(dirname "$LOCATION")"
PROJECT_ROOT="$(dirname "$SRC_ROOT")"
if [ ! -d "$PROJECT_ROOT/build" ]; then
mkdir "$PROJECT_ROOT/build"
fi
BUILD_ROOT="$PROJECT_ROOT/build"
BIN_ROOT="$SRC_ROOT/bin"
CUSTOM_ROOT="$SRC_ROOT/custom"
CUSTOM_BIN="$CUSTOM_ROOT/bin"
# Get the build mode
BUILD_MODE="$1"
if [ -z "$BUILD_MODE" ]; then
BUILD_MODE="-DDEV_BUILD"
fi
# Get the OS specific flags
chmod +rx "$BIN_ROOT/detect_os.sh"
os=$("$BIN_ROOT/detect_os.sh")
if [[ "$os" == "linux" ]]; then
WARNINGS="-Wno-write-strings -Wno-comment"
elif [[ "$os" == "mac" ]]; then
WARNINGS="-Wno-write-strings -Wno-comment -Wno-null-dereference -Wno-logical-op-parentheses -Wno-switch"
fi
FLAGS="-D_GNU_SOURCE -fPIC -fpermissive $BUILD_MODE"
INCLUDES="-I$SRC_ROOT -I$CUSTOM_ROOT"
# Execute
clang++ $WARNINGS $FLAGS $INCLUDES "$BIN_ROOT/4ed_build.cpp" -g -o "$BUILD_ROOT/build"
pushd "$SRC_ROOT"
"$BUILD_ROOT/build"
popd

View File

@ -1,3 +1,3 @@
@echo off
call build.bat /DOPT_BUILD
call bin\build.bat /DOPT_BUILD

5
bin/build_x86-mac.sh Normal file
View File

@ -0,0 +1,5 @@
#!/bin/bash
./build.sh -DDEV_BUILD_X86

View File

@ -1,7 +1,5 @@
#!/bin/sh
#todo rewrite this as a build.cpp script
if [ "$#" -lt "3" ]
then
echo need 3 parameters

22
bin/itchio_push_mac.sh Executable file
View File

@ -0,0 +1,22 @@
#!/bin/sh
if [ "$#" -lt "3" ]
then
echo need 3 parameters
exit
else
fake=$1
maj=$2
min=$3
vr=$fake.$maj.$min
fv=$fake-$maj-$min
flags="--fix-permissions --userversion=$vr"
dir=../distributions
butler push $flags $dir/demo_x64/4coder-$fv-demo-mac-x64.zip 4coder/4coder:mac-x64-demo
butler push $flags $dir/super_x64/4coder-$fv-super-mac-x64.zip 4coder/4coder:mac-x64
fi

4
bin/package-mac.sh Executable file
View File

@ -0,0 +1,4 @@
#!/bin/bash
chmod 777 bin/build-mac.sh
bin/build-mac.sh "-DPACKAGE"

View File

@ -15,7 +15,7 @@ make_batch_from_indentations(Application_Links *app, Arena *arena, Buffer_ID buf
line_number <= lines.max;
++line_number){
i64 line_start_pos = get_line_start_pos(app, buffer, line_number);
Indent_Info indent_info = get_indent_info_line_start(app, buffer, line_start_pos, tab_width);
Indent_Info indent_info = get_indent_info_line_number_and_start(app, buffer, line_number, line_start_pos, tab_width);
i64 correct_indentation = shifted_indentations[line_number];
if (indent_info.is_blank && HasFlag(flags, Indent_ClearLine)){
@ -63,6 +63,7 @@ set_line_indents(Application_Links *app, Arena *arena, Buffer_ID buffer, Range_i
internal Token*
find_anchor_token(Application_Links *app, Buffer_ID buffer, Token_Array *tokens, i64 invalid_line){
ProfileScope(app, "find anchor token");
Token *result = 0;
if (tokens != 0 && tokens->tokens != 0){
@ -146,8 +147,20 @@ indent__unfinished_statement(Token *token, Nest *current_nest){
return(result);
}
function void
line_indent_cache_update(Application_Links *app, Buffer_ID buffer, i32 tab_width, Indent_Line_Cache *line_cache){
if (line_cache->line_number_for_cached_indent != line_cache->where_token_starts){
ProfileScope(app, "get indent info");
line_cache->line_number_for_cached_indent = line_cache->where_token_starts;
line_cache->start_pos = get_line_start_pos(app, buffer, line_cache->where_token_starts);
Range_i64 range = Ii64(line_cache->start_pos, line_cache->one_past_last_pos);
line_cache->indent_info = get_indent_info_range(app, buffer, range, tab_width);
}
}
internal i64*
get_indentation_array(Application_Links *app, Arena *arena, Buffer_ID buffer, Range_i64 lines, Indent_Flag flags, i32 tab_width, i32 indent_width){
ProfileScope(app, "get indentation array");
i64 count = lines.max - lines.min + 1;
i64 *indentations = push_array(arena, i64, count);
i64 *shifted_indentations = indentations - lines.first;
@ -174,11 +187,17 @@ get_indentation_array(Application_Links *app, Arena *arena, Buffer_ID buffer, Ra
i64 actual_indent = 0;
b32 in_unfinished_statement = false;
Indent_Line_Cache line_cache = {};
for (;;){
Token *token = token_it_read(&token_it);
i64 line_where_token_starts = get_line_number_from_pos(app, buffer, token->pos);
i64 line_start_pos = get_line_start_pos(app, buffer, line_where_token_starts);
Indent_Info line_indent_info = get_indent_info_line_start(app, buffer, line_start_pos, tab_width);
if (line_cache.where_token_starts == 0 ||
token->pos >= line_cache.one_past_last_pos){
ProfileScope(app, "get line number");
line_cache.where_token_starts = get_line_number_from_pos(app, buffer, token->pos);
line_cache.one_past_last_pos = get_line_end_pos(app, buffer, line_cache.where_token_starts);
}
i64 current_indent = 0;
if (nest != 0){
@ -229,7 +248,8 @@ get_indentation_array(Application_Links *app, Arena *arena, Buffer_ID buffer, Ra
Nest *new_nest = indent__new_nest(arena, &nest_alloc);
sll_stack_push(nest, new_nest);
nest->kind = TokenBaseKind_ParentheticalOpen;
nest->indent = (token->pos - line_indent_info.first_char_pos) + 1;
line_indent_cache_update(app, buffer, tab_width, &line_cache);
nest->indent = (token->pos - line_cache.indent_info.first_char_pos) + 1;
following_indent = nest->indent;
shift_by_actual_indent = true;
}break;
@ -245,7 +265,7 @@ get_indentation_array(Application_Links *app, Arena *arena, Buffer_ID buffer, Ra
if (nest != 0){
following_indent = nest->indent;
}
ignore_unfinished_statement = true;
//ignore_unfinished_statement = true;
}break;
}
}
@ -255,30 +275,42 @@ get_indentation_array(Application_Links *app, Arena *arena, Buffer_ID buffer, Ra
}
#define EMIT(N) \
Stmnt(if (lines.first <= line_it){shifted_indentations[line_it]=N;} \
if (line_it == lines.end){goto finished;} \
actual_indent = N; )
Stmnt(if (lines.first <= line_it){shifted_indentations[line_it]=N;} \
if (line_it == lines.end){goto finished;} \
actual_indent = N; )
i64 line_it = line_last_indented;
for (;line_it < line_where_token_starts;){
line_it += 1;
if (line_it == line_where_token_starts){
EMIT(this_indent);
}
else{
EMIT(last_indent);
if (lines.first <= line_cache.where_token_starts){
for (;line_it < line_cache.where_token_starts;){
line_it += 1;
if (line_it == line_cache.where_token_starts){
EMIT(this_indent);
}
else{
EMIT(last_indent);
}
}
}
else{
actual_indent = this_indent;
line_it = line_cache.where_token_starts;
}
i64 line_where_token_starts_shift = this_indent - line_indent_info.indent_pos;
i64 line_where_token_ends = get_line_number_from_pos(app, buffer, token->pos + token->size);
for (;line_it < line_where_token_ends;){
line_it += 1;
i64 line_it_start_pos = get_line_start_pos(app, buffer, line_it);
Indent_Info line_it_indent_info = get_indent_info_line_start(app, buffer, line_it_start_pos, tab_width);
i64 new_indent = line_it_indent_info.indent_pos + line_where_token_starts_shift;
new_indent = clamp_bot(0, new_indent);
EMIT(new_indent);
if (lines.first <= line_where_token_ends){
line_indent_cache_update(app, buffer, tab_width, &line_cache);
i64 line_where_token_starts_shift = this_indent - line_cache.indent_info.indent_pos;
for (;line_it < line_where_token_ends;){
line_it += 1;
i64 line_it_start_pos = get_line_start_pos(app, buffer, line_it);
Indent_Info line_it_indent_info = get_indent_info_line_number_and_start(app, buffer, line_it, line_it_start_pos, tab_width);
i64 new_indent = line_it_indent_info.indent_pos + line_where_token_starts_shift;
new_indent = clamp_bot(0, new_indent);
EMIT(new_indent);
}
}
else{
line_it = line_where_token_ends;
}
#undef EMIT
@ -395,6 +427,7 @@ CUSTOM_DOC("Auto-indents the range between the cursor and the mark.")
CUSTOM_COMMAND_SIG(write_text_and_auto_indent)
CUSTOM_DOC("Inserts text and auto-indents the line on which the cursor sits if any of the text contains 'layout punctuation' such as ;:{}()[]# and new lines.")
{
ProfileScope(app, "write and auto indent");
User_Input in = get_current_input(app);
String_Const_u8 insert = to_writable(&in);
if (insert.str != 0 && insert.size > 0){

View File

@ -24,6 +24,14 @@ struct Nest_Alloc{
Nest *free_nest;
};
struct Indent_Line_Cache{
i64 where_token_starts;
i64 line_number_for_cached_indent;
i64 start_pos;
i64 one_past_last_pos;
Indent_Info indent_info;
};
#endif
// BOTTOM

View File

@ -65,7 +65,7 @@ CUSTOM_DOC("Inserts whatever text was used to trigger this command.")
}
CUSTOM_COMMAND_SIG(write_space)
CUSTOM_DOC("Inserts an underscore.")
CUSTOM_DOC("Inserts a space.")
{
write_text(app, string_u8_litexpr(" "));
}
@ -112,6 +112,17 @@ CUSTOM_DOC("Deletes the character to the left of the cursor.")
}
}
CUSTOM_COMMAND_SIG(test_double_backspace)
CUSTOM_DOC("Made for testing purposes (I should have deleted this if you are reading it let me know)")
{
View_ID view = get_active_view(app, Access_ReadWriteVisible);
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadWriteVisible);
History_Group group = history_group_begin(app, buffer);
backspace_char(app);
backspace_char(app);
history_group_end(group);
}
CUSTOM_COMMAND_SIG(set_mark)
CUSTOM_DOC("Sets the mark to the current position of the cursor.")
{
@ -281,9 +292,15 @@ move_vertical_pixels(Application_Links *app, View_ID view, f32 pixels){
ProfileScope(app, "move vertical pixels");
i64 pos = view_get_cursor_pos(app, view);
Buffer_Cursor cursor = view_compute_cursor(app, view, seek_pos(pos));
Vec2_f32 p = view_relative_xy_of_pos(app, view, cursor.line, pos);
Rect_f32 r = view_padded_box_of_pos(app, view, cursor.line, pos);
Vec2_f32 p = {};
p.x = view_get_preferred_x(app, view);
p.y += pixels;
if (pixels > 0.f){
p.y = r.y1 + pixels;
}
else{
p.y = r.y0 + pixels;
}
i64 new_pos = view_pos_at_relative_xy(app, view, cursor.line, p);
view_set_cursor(app, view, seek_pos(new_pos));
no_mark_snap_to_cursor_if_shift(app, view);
@ -299,20 +316,12 @@ internal void
move_vertical_lines(Application_Links *app, View_ID view, i64 lines){
if (lines > 0){
for (i64 i = 0; i < lines; i += 1){
i64 pos = view_get_cursor_pos(app, view);
Buffer_Cursor cursor = view_compute_cursor(app, view, seek_pos(pos));
Rect_f32 box = view_relative_box_of_pos(app, view, cursor.line, cursor.pos);
f32 half_height = rect_height(box)*0.5f;
move_vertical_pixels(app, half_height + 2.f);
move_vertical_pixels(app, 1.f);
}
}
else{
for (i64 i = 0; i > lines; i -= 1){
i64 pos = view_get_cursor_pos(app, view);
Buffer_Cursor cursor = view_compute_cursor(app, view, seek_pos(pos));
Rect_f32 box = view_relative_box_of_pos(app, view, cursor.line, cursor.pos);
f32 half_height = rect_height(box)*0.5f;
move_vertical_pixels(app, -half_height - 2.f);
move_vertical_pixels(app, -1.f);
}
}
}
@ -1079,10 +1088,8 @@ query_replace_base(Application_Links *app, View_ID view, Buffer_ID buffer_id, i6
i64 new_pos = 0;
seek_string_forward(app, buffer_id, pos - 1, 0, r, &new_pos);
i64 buffer_size = buffer_get_size(app, buffer_id);
User_Input in = {};
for (;new_pos < buffer_size;){
for (;;){
Range_i64 match = Ii64(new_pos, new_pos + r.size);
isearch__update_highlight(app, view, match);
@ -1091,9 +1098,11 @@ query_replace_base(Application_Links *app, View_ID view, Buffer_ID buffer_id, i6
break;
}
if (match_key_code(&in, KeyCode_Y) ||
match_key_code(&in, KeyCode_Return) ||
match_key_code(&in, KeyCode_Tab)){
i64 size = buffer_get_size(app, buffer_id);
if (match.max <= size &&
(match_key_code(&in, KeyCode_Y) ||
match_key_code(&in, KeyCode_Return) ||
match_key_code(&in, KeyCode_Tab))){
buffer_replace_range(app, buffer_id, match, w);
pos = match.start + w.size;
}
@ -1313,23 +1322,20 @@ CUSTOM_DOC("Queries the user for a new name and renames the file of the current
bar.prompt = push_u8_stringf(scratch, "Rename '%.*s' to: ", string_expand(front));
bar.string = SCu8(name_space, (u64)0);
bar.string_capacity = sizeof(name_space);
if (query_user_string(app, &bar)){
if (bar.string.size != 0){
// TODO(allen): There should be a way to say, "detach a buffer's file" and "attach this file to a buffer"
List_String_Const_u8 new_file_name_list = {};
string_list_push(scratch, &new_file_name_list, file_name);
string_list_push(scratch, &new_file_name_list, bar.string);
String_Const_u8 new_file_name = string_list_flatten(scratch, new_file_name_list, StringFill_NullTerminate);
if (buffer_save(app, buffer, new_file_name, BufferSave_IgnoreDirtyFlag)){
Buffer_ID new_buffer = create_buffer(app, new_file_name, BufferCreate_NeverNew|BufferCreate_JustChangedFile);
if (new_buffer != 0 && new_buffer != buffer){
delete_file_base(app, file_name, buffer);
view_set_buffer(app, view, new_buffer, 0);
}
if (query_user_string(app, &bar) && bar.string.size != 0){
// TODO(allen): There should be a way to say, "detach a buffer's file" and "attach this file to a buffer"
List_String_Const_u8 new_file_name_list = {};
string_list_push(scratch, &new_file_name_list, string_remove_front_of_path(file_name));
string_list_push(scratch, &new_file_name_list, bar.string);
String_Const_u8 new_file_name = string_list_flatten(scratch, new_file_name_list, StringFill_NullTerminate);
if (buffer_save(app, buffer, new_file_name, BufferSave_IgnoreDirtyFlag)){
Buffer_ID new_buffer = create_buffer(app, new_file_name, BufferCreate_NeverNew|BufferCreate_JustChangedFile);
if (new_buffer != 0 && new_buffer != buffer){
delete_file_base(app, file_name, buffer);
view_set_buffer(app, view, new_buffer, 0);
}
}
}
}
}

View File

@ -1727,7 +1727,7 @@ Ii32_size(i32 pos, i32 size){
function Range_i64
Ii64_size(i64 pos, i64 size){
return(Ii64(pos, pos + size));
}
}
function Range_u64
Iu64_size(u64 pos, u64 size){
return(Iu64(pos, pos + size));
@ -2978,7 +2978,7 @@ make_base_allocator(Base_Allocator_Reserve_Signature *func_reserve,
}
function Data
base_allocate__inner(Base_Allocator *allocator, u64 size, String_Const_u8 location){
u64 full_size = 0;
u64 full_size = 0;
void *memory = allocator->reserve(allocator->user_data, size, &full_size, location);
allocator->commit(allocator->user_data, memory, full_size);
return(make_data(memory, (u64)full_size));
@ -4321,6 +4321,18 @@ string_remove_last_folder(String_Const_u32 str){
return(str);
}
function b32
string_looks_like_drive_letter(String_Const_u8 string){
b32 result = false;
if (string.size == 3 &&
character_is_alpha(string.str[0]) &&
string.str[1] == ':' &&
character_is_slash(string.str[2])){
result = true;
}
return(result);
}
function String_Const_char
string_remove_front_of_path(String_Const_char str){
i64 slash_pos = string_find_last_slash(str);
@ -4399,6 +4411,26 @@ string_front_of_path(String_Const_u32 str){
return(str);
}
function String_Const_u8
string_remove_front_folder_of_path(String_Const_u8 str){
i64 slash_pos = string_find_last_slash(string_chop(str, 1));
if (slash_pos < 0){
str.size = 0;
}
else{
str.size = slash_pos + 1;
}
return(str);
}
function String_Const_u8
string_front_folder_of_path(String_Const_u8 str){
i64 slash_pos = string_find_last_slash(string_chop(str, 1));
if (slash_pos >= 0){
str = string_skip(str, slash_pos + 1);
}
return(str);
}
function String_Const_char
string_file_extension(String_Const_char string){
return(string_skip(string, string_find_last(string, '.') + 1));
@ -4728,9 +4760,10 @@ string_find_first(String_Const_char str, String_Const_char needle, String_Match_
i = str.size;
if (str.size >= needle.size){
i = 0;
char c = character_to_upper(needle.str[0]);
u64 one_past_last = str.size - needle.size + 1;
for (;i < one_past_last; i += 1){
if (str.str[i] == needle.str[0]){
if (character_to_upper(str.str[i]) == c){
String_Const_char source_part = string_prefix(string_skip(str, i), needle.size);
if (string_match(source_part, needle, rule)){
break;
@ -4751,9 +4784,10 @@ string_find_first(String_Const_u8 str, String_Const_u8 needle, String_Match_Rule
i = str.size;
if (str.size >= needle.size){
i = 0;
u8 c = character_to_upper(needle.str[0]);
u64 one_past_last = str.size - needle.size + 1;
for (;i < one_past_last; i += 1){
if (str.str[i] == needle.str[0]){
if (character_to_upper(str.str[i]) == c){
String_Const_u8 source_part = string_prefix(string_skip(str, i), needle.size);
if (string_match(source_part, needle, rule)){
break;
@ -4774,9 +4808,10 @@ string_find_first(String_Const_u16 str, String_Const_u16 needle, String_Match_Ru
i = str.size;
if (str.size >= needle.size){
i = 0;
u16 c = character_to_upper(needle.str[0]);
u64 one_past_last = str.size - needle.size + 1;
for (;i < one_past_last; i += 1){
if (str.str[i] == needle.str[0]){
if (character_to_upper(str.str[i]) == c){
String_Const_u16 source_part = string_prefix(string_skip(str, i), needle.size);
if (string_match(source_part, needle, rule)){
break;
@ -4797,9 +4832,10 @@ string_find_first(String_Const_u32 str, String_Const_u32 needle, String_Match_Ru
i = str.size;
if (str.size >= needle.size){
i = 0;
u32 c = character_to_upper(needle.str[0]);
u64 one_past_last = str.size - needle.size + 1;
for (;i < one_past_last; i += 1){
if (str.str[i] == needle.str[0]){
if (character_to_upper(str.str[i]) == c){
String_Const_u32 source_part = string_prefix(string_skip(str, i), needle.size);
if (string_match(source_part, needle, rule)){
break;
@ -5281,7 +5317,7 @@ push_string_copy(Arena *arena, u64 size, String_Const_Any src){
return(string);
}
function String_Const_u8_Array
function String_Const_u8_Array
push_string_array_copy(Arena *arena, String_Const_u8_Array src){
String_Const_u8_Array result = {};
result.vals = push_array(arena, String_Const_u8, src.count);
@ -6943,10 +6979,10 @@ global_const u8 integer_symbol_reverse[128] = {
global_const u8 base64[64] = {
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
'_', '$',
};
@ -6963,7 +6999,7 @@ global_const u8 base64_reverse[128] = {
function u64
digit_count_from_integer(u64 x, u32 radix){
u64 result = {};
u64 result = 0;
if (radix >= 2 && radix <= 16){
if (x == 0){
result = 1;

View File

@ -31,14 +31,34 @@
# error architecture not supported yet
# endif
#elif defined(__clang__)
# define COMPILER_CLANG 1
# if defined(__APPLE__) && defined(__MACH__)
# define OS_MAC 1
# else
# error This compiler/platform combo is not supported yet
# endif
# if defined(__amd64__) || defined(__amd64) || defined(__x86_64__) || defined(__x86_64)
# define ARCH_X64 1
# elif defined(i386) || defined(__i386) || defined(__i386__)
# define ARCH_X86 1
# elif defined(__aarch64__)
# define ARCH_ARM64 1
# elif defined(__arm__)
# define ARCH_ARM32 1
# else
# error architecture not supported yet
# endif
#elif defined(__GNUC__) || defined(__GNUG__)
# define COMPILER_GCC 1
# if defined(__gnu_linux__)
# define OS_LINUX 1
# elif defined(__APPLE__) && defined(__MACH__)
# define OS_MAC 1
# else
# error This compiler/platform combo is not supported yet
# endif
@ -92,6 +112,9 @@
#if !defined(COMPILER_GCC)
#define COMPILER_GCC 0
#endif
#if !defined(COMPILER_CLANG)
#define COMPILER_CLANG 0
#endif
#if !defined(OS_WINDOWS)
#define OS_WINDOWS 0
#endif
@ -121,12 +144,11 @@
#endif
#endif
#if OS_WINDOWS
# if ARCH_32BIT
# define CALL_CONVENTION __stdcall
# else
# define CALL_CONVENTION
# endif
// NOTE(yuval): Changed this so that CALL_CONVENTION will be defined for all platforms
#if ARCH_32BIT
# define CALL_CONVENTION __stdcall
#else
# define CALL_CONVENTION
#endif
#if defined(JUST_GUESS_INTS)
@ -268,8 +290,6 @@ enum{
#define Max(a,b) (((a)>(b))?(a):(b))
#define Min(a,b) (((a)<(b))?(a):(b))
#define max(a,b) (((a)>(b))?(a):(b))
#define min(a,b) (((a)<(b))?(a):(b))
#define clamp_top(a,b) Min(a,b)
#define clamp_bot(a,b) Max(a,b)
#define clamp_(a,x,b) ((a>x)?a:((b<x)?b:x))
@ -511,6 +531,9 @@ union SNode{
#define zdll_remove_front(f,l) zdll_remove_back_NP_((l),(f),prev,next)
#define zdll_remove(f,l,n) zdll_remove_NP_((f),(l),(n),next,prev)
#define zdll_assert_good(T,f) Stmnt( if (f != 0){ Assert(f->prev == 0); \
for(T *p_ = f; p_ != 0; p_ = p_->next){ Assert(p_->prev == 0 || p_->prev->next == p_); Assert(p_->next == 0 || p_->next->prev == p_); } } )
////////////////////////////////
union Vec2_i8{
@ -836,7 +859,7 @@ enum{
struct String_Const_char{
char *str;
u64 size;
u64 size;
};
struct String_Const_u8{
union{
@ -924,25 +947,25 @@ struct Node_String_Const_u32{
struct List_String_Const_char{
Node_String_Const_char *first;
Node_String_Const_char *last;
u64 total_size;
u64 total_size;
i32 node_count;
};
struct List_String_Const_u8{
Node_String_Const_u8 *first;
Node_String_Const_u8 *last;
u64 total_size;
u64 total_size;
i32 node_count;
};
struct List_String_Const_u16{
Node_String_Const_u16 *first;
Node_String_Const_u16 *last;
u64 total_size;
u64 total_size;
i32 node_count;
};
struct List_String_Const_u32{
Node_String_Const_u32 *first;
Node_String_Const_u32 *last;
u64 total_size;
u64 total_size;
i32 node_count;
};
@ -953,7 +976,7 @@ struct Node_String_Const_Any{
struct List_String_Const_Any{
Node_String_Const_Any *first;
Node_String_Const_Any *last;
u64 total_size;
u64 total_size;
i32 node_count;
};
@ -962,40 +985,40 @@ struct String_char{
String_Const_char string;
struct{
char *str;
u64 size;
u64 size;
};
};
u64 cap;
u64 cap;
};
struct String_u8{
union{
String_Const_u8 string;
struct{
u8 *str;
u64 size;
u64 size;
};
};
u64 cap;
u64 cap;
};
struct String_u16{
union{
String_Const_u16 string;
struct{
u16 *str;
u64 size;
u64 size;
};
};
u64 cap;
u64 cap;
};
struct String_u32{
union{
String_Const_u32 string;
struct{
u32 *str;
u64 size;
u64 size;
};
};
u64 cap;
u64 cap;
};
struct String_Any{
@ -1003,8 +1026,8 @@ struct String_Any{
union{
struct{
void *str;
u64 size;
u64 cap;
u64 size;
u64 cap;
};
String_char s_char;
String_u8 s_u8;
@ -1091,7 +1114,7 @@ struct Base_Allocator{
struct Cursor{
u8 *base;
u64 pos;
u64 pos;
u64 cap;
};
struct Temp_Memory_Cursor{
@ -1231,7 +1254,7 @@ struct Heap_Node{
struct{
Heap_Basic_Node order;
Heap_Basic_Node alloc;
u64 size;
u64 size;
};
u8 force_size__[64];
};
@ -1242,8 +1265,8 @@ struct Heap{
Arena *arena;
Heap_Basic_Node in_order;
Heap_Basic_Node free_nodes;
u64 used_space;
u64 total_space;
u64 used_space;
u64 total_space;
};
#endif

View File

@ -63,7 +63,7 @@ standard_build_exec_command(Application_Links *app, View_ID view, String_Const_u
standard_build_exec_flags);
}
static b32
function b32
standard_search_and_build_from_dir(Application_Links *app, View_ID view, String_Const_u8 start_dir){
Scratch_Block scratch(app);
@ -82,15 +82,9 @@ standard_search_and_build_from_dir(Application_Links *app, View_ID view, String_
if (result){
// NOTE(allen): Build
String_Const_u8 path = string_remove_last_folder(full_file_path);
#if OS_WINDOWS
String_Const_u8 command = push_u8_stringf(scratch, "%.*s/%.*s",
String_Const_u8 command = push_u8_stringf(scratch, "\"%.*s/%.*s\"",
string_expand(path),
string_expand(cmd_string));
#elif OS_LINUX || OS_MAC
String_Const_u8 command = cmd_string;
#else
#error OS needs standard search and build rules
#endif
if (global_config.automatically_save_changes_on_build){
save_all_dirty_buffers(app);
}
@ -153,7 +147,7 @@ get_or_open_build_panel(Application_Links *app){
return(view);
}
function void
function void
set_fancy_compilation_buffer_font(Application_Links *app){
Buffer_ID buffer = get_comp_buffer(app);
Font_Load_Location font = {};

View File

@ -29,12 +29,16 @@ CUSTOM_DOC("Queries for an output buffer name and system command, runs the syste
bar_out.string = SCu8(out_buffer_space, (u64)0);
bar_out.string_capacity = sizeof(out_buffer_space);
if (!query_user_string(app, &bar_out)) return;
bar_out.string.size = clamp_top(bar_out.string.size, sizeof(out_buffer_space) - 1);
out_buffer_space[bar_out.string.size] = 0;
Query_Bar bar_cmd = {};
bar_cmd.prompt = string_u8_litexpr("Command: ");
bar_cmd.string = SCu8(command_space, (u64)0);
bar_cmd.string_capacity = sizeof(command_space);
if (!query_user_string(app, &bar_cmd)) return;
bar_cmd.string.size = clamp_top(bar_cmd.string.size, sizeof(command_space) - 1);
command_space[bar_cmd.string.size] = 0;
String_Const_u8 hot = push_hot_directory(app, scratch);
{

View File

@ -4,7 +4,7 @@
// TOP
function b32
function b32
clipboard_post_buffer_range(Application_Links *app, i32 clipboard_index, Buffer_ID buffer, Range_i64 range){
b32 success = false;
Scratch_Block scratch(app);
@ -46,24 +46,25 @@ CUSTOM_DOC("At the cursor, insert the text at the top of the clipboard.")
Managed_Scope scope = view_get_managed_scope(app, view);
Rewrite_Type *next_rewrite = scope_attachment(app, scope, view_next_rewrite_loc, Rewrite_Type);
*next_rewrite = Rewrite_Paste;
i32 *paste_index = scope_attachment(app, scope, view_paste_index_loc, i32);
*paste_index = 0;
Scratch_Block scratch(app);
String_Const_u8 string = push_clipboard_index(app, scratch, 0, *paste_index);
if (string.size > 0){
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadWriteVisible);
if (next_rewrite != 0){
*next_rewrite = Rewrite_Paste;
i32 *paste_index = scope_attachment(app, scope, view_paste_index_loc, i32);
*paste_index = 0;
i64 pos = view_get_cursor_pos(app, view);
buffer_replace_range(app, buffer, Ii64(pos), string);
view_set_mark(app, view, seek_pos(pos));
view_set_cursor_and_preferred_x(app, view, seek_pos(pos + (i32)string.size));
Scratch_Block scratch(app);
// TODO(allen): Send this to all views.
ARGB_Color argb = fcolor_resolve(fcolor_id(defcolor_paste));
view_post_fade(app, view, 0.667f, Ii64_size(pos, string.size), argb);
String_Const_u8 string = push_clipboard_index(app, scratch, 0, *paste_index);
if (string.size > 0){
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadWriteVisible);
i64 pos = view_get_cursor_pos(app, view);
buffer_replace_range(app, buffer, Ii64(pos), string);
view_set_mark(app, view, seek_pos(pos));
view_set_cursor_and_preferred_x(app, view, seek_pos(pos + (i32)string.size));
ARGB_Color argb = fcolor_resolve(fcolor_id(defcolor_paste));
buffer_post_fade(app, buffer, 0.667f, Ii64_size(pos, string.size), argb);
}
}
}
}
@ -80,29 +81,31 @@ CUSTOM_DOC("If the previous command was paste or paste_next, replaces the paste
no_mark_snap_to_cursor(app, scope);
Rewrite_Type *rewrite = scope_attachment(app, scope, view_rewrite_loc, Rewrite_Type);
if (*rewrite == Rewrite_Paste){
Rewrite_Type *next_rewrite = scope_attachment(app, scope, view_next_rewrite_loc, Rewrite_Type);
*next_rewrite = Rewrite_Paste;
i32 *paste_index_ptr = scope_attachment(app, scope, view_paste_index_loc, i32);
i32 paste_index = (*paste_index_ptr) + 1;
*paste_index_ptr = paste_index;
String_Const_u8 string = push_clipboard_index(app, scratch, 0, paste_index);
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadWriteVisible);
Range_i64 range = get_view_range(app, view);
i64 pos = range.min;
buffer_replace_range(app, buffer, range, string);
view_set_cursor_and_preferred_x(app, view, seek_pos(pos + string.size));
ARGB_Color argb = fcolor_resolve(fcolor_id(defcolor_paste));
view_post_fade(app, view, 0.667f, Ii64_size(pos, string.size), argb);
}
else{
paste(app);
if (rewrite != 0){
if (*rewrite == Rewrite_Paste){
Rewrite_Type *next_rewrite = scope_attachment(app, scope, view_next_rewrite_loc, Rewrite_Type);
*next_rewrite = Rewrite_Paste;
i32 *paste_index_ptr = scope_attachment(app, scope, view_paste_index_loc, i32);
i32 paste_index = (*paste_index_ptr) + 1;
*paste_index_ptr = paste_index;
String_Const_u8 string = push_clipboard_index(app, scratch, 0, paste_index);
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadWriteVisible);
Range_i64 range = get_view_range(app, view);
i64 pos = range.min;
buffer_replace_range(app, buffer, range, string);
view_set_cursor_and_preferred_x(app, view, seek_pos(pos + string.size));
ARGB_Color argb = fcolor_resolve(fcolor_id(defcolor_paste));
buffer_post_fade(app, buffer, 0.667f, Ii64_size(pos, string.size), argb);
}
else{
paste(app);
}
}
}
}
@ -132,30 +135,30 @@ CUSTOM_COMMAND_SIG(multi_paste){
Managed_Scope scope = view_get_managed_scope(app, view);
Rewrite_Type *rewrite = scope_attachment(app, scope, view_rewrite_loc, Rewrite_Type);
if (*rewrite == Rewrite_Paste){
Rewrite_Type *next_rewrite = scope_attachment(app, scope, view_next_rewrite_loc, Rewrite_Type);
*next_rewrite = Rewrite_Paste;
i32 *paste_index_ptr = scope_attachment(app, scope, view_paste_index_loc, i32);
i32 paste_index = (*paste_index_ptr) + 1;
*paste_index_ptr = paste_index;
String_Const_u8 string = push_clipboard_index(app, scratch, 0, paste_index);
String_Const_u8 insert_string = push_u8_stringf(scratch, "\n%.*s", string_expand(string));
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadWriteVisible);
Range_i64 range = get_view_range(app, view);
buffer_replace_range(app, buffer, Ii64(range.max), insert_string);
view_set_mark(app, view, seek_pos(range.max + 1));
view_set_cursor_and_preferred_x(app, view, seek_pos(range.max + insert_string.size));
ARGB_Color argb = fcolor_resolve(fcolor_id(defcolor_paste));
view_post_fade(app, view, 0.667f,
Ii64(range.max + 1, range.max + insert_string.size),
argb);
}
else{
paste(app);
if (rewrite != 0){
if (*rewrite == Rewrite_Paste){
Rewrite_Type *next_rewrite = scope_attachment(app, scope, view_next_rewrite_loc, Rewrite_Type);
*next_rewrite = Rewrite_Paste;
i32 *paste_index_ptr = scope_attachment(app, scope, view_paste_index_loc, i32);
i32 paste_index = (*paste_index_ptr) + 1;
*paste_index_ptr = paste_index;
String_Const_u8 string = push_clipboard_index(app, scratch, 0, paste_index);
String_Const_u8 insert_string = push_u8_stringf(scratch, "\n%.*s", string_expand(string));
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadWriteVisible);
Range_i64 range = get_view_range(app, view);
buffer_replace_range(app, buffer, Ii64(range.max), insert_string);
view_set_mark(app, view, seek_pos(range.max + 1));
view_set_cursor_and_preferred_x(app, view, seek_pos(range.max + insert_string.size));
ARGB_Color argb = fcolor_resolve(fcolor_id(defcolor_paste));
view_post_fade(app, buffer, 0.667f, Ii64(range.max + 1, range.max + insert_string.size), argb);
}
else{
paste(app);
}
}
}
}
@ -207,9 +210,8 @@ multi_paste_range(Application_Links *app, View_ID view, Range_i64 range, i32 pas
view_set_mark(app, view, seek_pos(finish_range.min));
view_set_cursor_and_preferred_x(app, view, seek_pos(finish_range.max));
// TODO(allen): Send this to all views.
ARGB_Color argb = fcolor_resolve(fcolor_id(defcolor_paste));
view_post_fade(app, view, 0.667f, finish_range, argb);
buffer_post_fade(app, buffer, 0.667f, finish_range, argb);
}
}
return(finish_range);

File diff suppressed because it is too large Load Diff

View File

@ -425,21 +425,21 @@ function Command_Trigger_List
map_get_triggers_recursive(Arena *arena, Mapping *mapping, Command_Map *map, Command_Binding binding){
Command_Trigger_List result = {};
if (mapping != 0){
for (i32 safety_counter = 0;
map != 0 && safety_counter < 40;
safety_counter += 1){
Command_Trigger_List list = map_get_triggers_non_recursive(mapping, map, binding);
for (Command_Trigger *node = list.first, *next = 0;
node != 0;
node = next){
next = node->next;
Command_Trigger *nnode = push_array_write(arena, Command_Trigger, 1, node);
sll_queue_push(result.first, result.last, nnode);
for (i32 safety_counter = 0;
map != 0 && safety_counter < 40;
safety_counter += 1){
Command_Trigger_List list = map_get_triggers_non_recursive(mapping, map, binding);
for (Command_Trigger *node = list.first, *next = 0;
node != 0;
node = next){
next = node->next;
Command_Trigger *nnode = push_array_write(arena, Command_Trigger, 1, node);
sll_queue_push(result.first, result.last, nnode);
}
map = mapping_get_map(mapping, map->parent);
}
map = mapping_get_map(mapping, map->parent);
}
}
return(result);
}
@ -721,7 +721,7 @@ map_set_binding_l(Mapping *mapping, Command_Map *map, Custom_Command_Function *c
va_start(args, code2);
Command_Binding binding = {};
binding.custom = custom;
map_set_binding_lv(mapping, map, binding, code1, code2, args);
map_set_binding_lv(mapping, map, binding, code1, code2, args);
va_end(args);
}
#endif
@ -755,7 +755,7 @@ map_set_binding_l(m, map, BindFWrap_(F), InputEventKind_MouseMove, 0, __VA_ARGS_
#define BindCore(F, K, ...) \
map_set_binding_l(m, map, BindFWrap_(F), InputEventKind_Core, (K), __VA_ARGS__, 0)
#elif COMPILER_GCC
#elif COMPILER_GCC | COMPILER_CLANG
#define Bind(F, K, ...) \
map_set_binding_l(m, map, BindFWrap_(F), InputEventKind_KeyStroke, (K), ##__VA_ARGS__, 0)

File diff suppressed because it is too large Load Diff

View File

@ -185,6 +185,9 @@ struct Config_Data{
String_Const_u8_Array code_exts;
u8 mapping_space[64];
String_Const_u8 mapping;
u8 mode_space[64];
String_Const_u8 mode;
@ -203,15 +206,11 @@ struct Config_Data{
b8 enable_code_wrapping;
b8 automatically_indent_text_on_save;
b8 automatically_save_changes_on_build;
b8 automatically_adjust_wrapping;
b8 automatically_load_project;
b8 indent_with_tabs;
i32 indent_width;
i32 default_wrap_width;
i32 default_min_base_width;
u8 default_theme_name_space[256];
String_Const_u8 default_theme_name;

View File

@ -8,7 +8,10 @@
#define FCODER_DEFAULT_BINDINGS_CPP
#include "4coder_default_include.cpp"
#include "4coder_default_map.cpp"
// NOTE(allen): Users can declare their own managed IDs here.
#include "generated/managed_id_metadata.cpp"
void
custom_layer_init(Application_Links *app){

View File

@ -104,7 +104,7 @@ make_color_table(Application_Links *app, Arena *arena){
function void
set_default_color_scheme(Application_Links *app){
if (global_theme_arena.base_allocator == 0){
global_theme_arena = make_arena_system();
global_theme_arena = make_arena_system();
}
Arena *arena = &global_theme_arena;
@ -120,10 +120,10 @@ set_default_color_scheme(Application_Links *app){
default_color_table.arrays[defcolor_margin] = make_colors(arena, 0xFF181818);
default_color_table.arrays[defcolor_margin_hover] = make_colors(arena, 0xFF252525);
default_color_table.arrays[defcolor_margin_active] = make_colors(arena, 0xFF323232);
default_color_table.arrays[defcolor_list_item] = make_colors(arena, 0xFF181818);
default_color_table.arrays[defcolor_list_item_hover] = make_colors(arena, 0xFF252525);
default_color_table.arrays[defcolor_list_item_active] = make_colors(arena, 0xFF323232);
default_color_table.arrays[defcolor_cursor] = make_colors(arena, 0xFF00EE00);
default_color_table.arrays[defcolor_list_item] = make_colors(arena, 0xFF181818, 0xFF0C0C0C);
default_color_table.arrays[defcolor_list_item_hover] = make_colors(arena, 0xFF252525, 0xFF181818);
default_color_table.arrays[defcolor_list_item_active] = make_colors(arena, 0xFF323232, 0xFF323232);
default_color_table.arrays[defcolor_cursor] = make_colors(arena, 0xFF00EE00, 0xFFEE7700);
default_color_table.arrays[defcolor_at_cursor] = make_colors(arena, 0xFF0C0C0C);
default_color_table.arrays[defcolor_highlight_cursor_line] = make_colors(arena, 0xFF1E1E1E);
default_color_table.arrays[defcolor_highlight] = make_colors(arena, 0xFFDDEE00);
@ -156,6 +156,13 @@ set_default_color_scheme(Application_Links *app){
////////////////////////////////
function void
set_active_color(Color_Table *table){
if (table != 0){
active_color_table = *table;
}
}
function void
save_theme(Color_Table table, String_Const_u8 name){
Color_Table_Node *node = push_array(&global_theme_arena, Color_Table_Node, 1);
@ -165,4 +172,20 @@ save_theme(Color_Table table, String_Const_u8 name){
node->table = table;
}
////////////////////////////////
function Color_Table*
get_color_table_by_name(String_Const_u8 name){
Color_Table *result = 0;
for (Color_Table_Node *node = global_theme_list.first;
node != 0;
node = node->next){
if (string_match(node->name, name)){
result = &node->table;
break;
}
}
return(result);
}
// BOTTOM

View File

@ -484,7 +484,7 @@ CUSTOM_DOC("Clear the theme list")
global_theme_arena = make_arena_system();
}
else{
linalloc_clear(&global_theme_arena);
linalloc_clear(&global_theme_arena);
}
block_zero_struct(&global_theme_list);
@ -500,13 +500,18 @@ default_4coder_initialize(Application_Links *app, String_Const_u8_Array file_nam
heap_init(&global_heap, tctx->allocator);
#define M \
"Welcome to " VERSION "\n" \
"If you're new to 4coder there are some tutorials at http://4coder.net/tutorials.html\n" \
"Direct bug reports and feature requests to https://github.com/4coder-editor/4coder/issues\n" \
"Other questions and discussion can be directed to editor@4coder.net or 4coder.handmade.network\n" \
"The change log can be found in CHANGES.txt\n" \
"\n"
print_message(app, string_u8_litexpr(M));
"Welcome to " VERSION "\n" \
"If you're new to 4coder there is a built in tutorial\n" \
"Use the key combination [ X Alt ] (on mac [ X Control ])\n" \
"Type in 'hms_demo_tutorial' and press enter\n" \
"\n" \
"Direct bug reports and feature requests to https://github.com/4coder-editor/4coder/issues\n" \
"\n" \
"Other questions and discussion can be directed to editor@4coder.net or 4coder.handmade.network\n" \
"\n" \
"The change log can be found in CHANGES.txt\n" \
"\n"
print_message(app, string_u8_litexpr(M));
#undef M
#if 0
@ -529,6 +534,8 @@ default_4coder_initialize(Application_Links *app, String_Const_u8_Array file_nam
create_buffer(app, input_name, 0);
}
}
fade_range_arena = make_arena_system(KB(8));
}
function void
@ -687,5 +694,102 @@ buffer_modified_set_clear(void){
}
}
////////////////////////////////
function Fade_Range*
alloc_fade_range(void){
Fade_Range *result = free_fade_ranges;
if (result == 0){
result = push_array(&fade_range_arena, Fade_Range, 1);
}
else{
sll_stack_pop(free_fade_ranges);
}
return(result);
}
function void
free_fade_range(Fade_Range *range){
sll_stack_push(free_fade_ranges, range);
}
function void
buffer_post_fade(Application_Links *app, Buffer_ID buffer_id, f32 seconds, Range_i64 range, ARGB_Color color){
Fade_Range *fade_range = alloc_fade_range();
sll_queue_push(buffer_fade_ranges.first, buffer_fade_ranges.last, fade_range);
buffer_fade_ranges.count += 1;
fade_range->buffer_id = buffer_id;
fade_range->t = seconds;
fade_range->full_t = seconds;
fade_range->range = range;
fade_range->color= color;
}
function void
view_post_fade(Application_Links *app, View_ID view_id, f32 seconds, Range_i64 range, ARGB_Color color){
Fade_Range *fade_range = alloc_fade_range();
sll_queue_push(view_fade_ranges.first, view_fade_ranges.last, fade_range);
view_fade_ranges.count += 1;
fade_range->view_id = view_id;
fade_range->t = seconds;
fade_range->full_t = seconds;
fade_range->range = range;
fade_range->color= color;
}
function b32
tick_all_fade_ranges(f32 t){
Fade_Range **prev_next = &buffer_fade_ranges.first;
for (Fade_Range *node = buffer_fade_ranges.first, *next = 0;
node != 0;
node = next){
next = node->next;
node->t -= t;
if (node->t <= 0.f){
*prev_next = next;
buffer_fade_ranges.count -= 1;
}
else{
prev_next = &node->next;
}
}
prev_next = &view_fade_ranges.first;
for (Fade_Range *node = view_fade_ranges.first, *next = 0;
node != 0;
node = next){
next = node->next;
node->t -= t;
if (node->t <= 0.f){
*prev_next = next;
view_fade_ranges.count -= 1;
}
else{
prev_next = &node->next;
}
}
return(buffer_fade_ranges.count > 0 || view_fade_ranges.count > 0);
}
function void
paint_fade_ranges(Application_Links *app, Text_Layout_ID layout, Buffer_ID buffer, View_ID view){
for (Fade_Range *node = buffer_fade_ranges.first;
node != 0;
node = node->next){
if (node->buffer_id == buffer){
paint_text_color_blend(app, layout, node->range, node->color, node->t/node->full_t);
}
}
for (Fade_Range *node = view_fade_ranges.first;
node != 0;
node = node->next){
if (node->view_id == view){
paint_text_color_blend(app, layout, node->range, node->color, node->t/node->full_t);
}
}
}
// BOTTOM

View File

@ -94,6 +94,26 @@ struct Buffer_Modified_Set{
Table_u64_u64 id_to_node;
};
////////////////////////////////
struct Fade_Range{
Fade_Range *next;
union{
Buffer_ID buffer_id;
View_ID view_id;
};
f32 t;
f32 full_t;
Range_i64 range;
ARGB_Color color;
};
struct Fade_Range_List{
Fade_Range *first;
Fade_Range *last;
i32 count;
};
#endif
// BOTTOM

View File

@ -86,5 +86,17 @@ global Mapping framework_mapping = {};
global Buffer_Modified_Set global_buffer_modified_set = {};
////////////////////////////////
global b32 global_keyboard_macro_is_recording = false;
global Range_i64 global_keyboard_macro_range = {};
////////////////////////////////
global Fade_Range_List buffer_fade_ranges = {};
global Fade_Range_List view_fade_ranges = {};
global Arena fade_range_arena = {};
global Fade_Range *free_fade_ranges = 0;
// BOTTOM

File diff suppressed because it is too large Load Diff

View File

@ -78,6 +78,8 @@
#include "4coder_token.cpp"
#include "generated/lexer_cpp.cpp"
#include "4coder_command_map.cpp"
#include "4coder_default_map.cpp"
#include "4coder_mac_map.cpp"
#include "4coder_default_framework_variables.cpp"
#include "4coder_default_colors.cpp"
#include "4coder_helper.cpp"
@ -118,8 +120,6 @@
#include "4coder_default_hooks.cpp"
#include "generated/managed_id_metadata.cpp"
#endif
// BOTTOM

View File

@ -14,7 +14,7 @@ doc_commands(Arena *arena){
Doc_Cluster *cluster = new_doc_cluster(arena, "Commands", "commands");
for (i32 i = 0; i < ArrayCount(fcoder_metacmd_table); i += 1){
String_Const_u8 cmd_name = SCu8(fcoder_metacmd_table[i].name,
fcoder_metacmd_table[i].name_len);
fcoder_metacmd_table[i].name_len);
String_Const_u8 title = push_u8_stringf(arena, "Command %.*s", string_expand(cmd_name));
Doc_Page *page = new_doc_page(arena, cluster, (char*)title.str, (char*)cmd_name.str);
Doc_Block *block = new_doc_block(arena, page, "brief");
@ -24,146 +24,150 @@ doc_commands(Arena *arena){
}
function Doc_Cluster*
doc_default_bindings(Arena *arena, Mapping *mapping, i64 global_id, i64 file_id, i64 code_id){
doc_default_bindings(Arena *arena, i32 map_count, Mapping *mapping_array, char **page_titles, char **page_names,
i64 global_id, i64 file_id, i64 code_id){
Doc_Cluster *cluster = new_doc_cluster(arena, "Bindings", "bindings");
Doc_Page *page = new_doc_page(arena, cluster, "Default Bindings", "default_bindings");
for (Command_Map *map = mapping->first_map;
map != 0;
map = map->next){
char *map_name = "";
if (map->id == global_id){
map_name = "Global";
}
else if (map->id == file_id){
map_name = "File";
}
else if (map->id == code_id){
map_name = "Code";
}
Doc_Block *block = new_doc_block(arena, page, map_name);
Doc_Paragraph *par = new_doc_par_table(arena, block);
struct Bind_Node{
Bind_Node *next;
Input_Event_Kind kind;
u32 sub_code;
Input_Modifier_Set mods;
Command_Binding binding;
u32 j;
};
Bind_Node *first = 0;
Bind_Node *last = 0;
i32 node_count = 0;
if (map->text_input_command.name != 0){
Bind_Node *node = push_array_zero(arena, Bind_Node, 1);
sll_queue_push(first, last, node);
node_count += 1;
node->binding = map->text_input_command;
node->j = max_u32;
}
u32 counts[] = {
KeyCode_COUNT,
KeyCode_COUNT,
MouseCode_COUNT,
MouseCode_COUNT,
1,
1,
CoreCode_COUNT,
};
u32 event_codes[] = {
InputEventKind_KeyStroke,
InputEventKind_KeyRelease,
InputEventKind_MouseButton,
InputEventKind_MouseButtonRelease,
InputEventKind_MouseWheel,
InputEventKind_MouseMove,
InputEventKind_Core,
};
char *mouse_wheel_name[] = {"MoveWheel"};
char *mouse_move_name[] = {"MoveMove"};
char **event_names[] = {
key_code_name,
key_code_name,
mouse_code_name,
mouse_code_name,
mouse_wheel_name,
mouse_move_name,
core_code_name,
};
b32 is_release[] = {
false,
true,
false,
true,
false,
false,
false,
};
for (u32 j = 0; j < ArrayCount(counts); j += 1){
for (u32 code = 0; code < counts[j]; code += 1){
u64 key = mapping__key(event_codes[j], code);
Table_Lookup lookup = table_lookup(&map->event_code_to_binding_list, key);
if (lookup.found_match){
u64 val = 0;
table_read(&map->event_code_to_binding_list, lookup, &val);
Command_Binding_List *list = (Command_Binding_List*)IntAsPtr(val);
for (SNode *snode = list->first;
snode != 0;
snode = snode->next){
Command_Modified_Binding *mod_binding = CastFromMember(Command_Modified_Binding, order_node, snode);
Bind_Node *node = push_array_zero(arena, Bind_Node, 1);
sll_queue_push(first, last, node);
node_count += 1;
node->kind = event_codes[j];
node->sub_code = code;
node->mods = mod_binding->mods;
node->binding = mod_binding->binding;
node->j = j;
for (i32 i = 0; i < map_count; i += 1){
Mapping *mapping = &mapping_array[i];
Doc_Page *page = new_doc_page(arena, cluster, page_titles[i], page_names[i]);
for (Command_Map *map = mapping->first_map;
map != 0;
map = map->next){
char *map_name = "";
if (map->id == global_id){
map_name = "Global";
}
else if (map->id == file_id){
map_name = "File";
}
else if (map->id == code_id){
map_name = "Code";
}
Doc_Block *block = new_doc_block(arena, page, map_name);
Doc_Paragraph *par = new_doc_par_table(arena, block);
struct Bind_Node{
Bind_Node *next;
Input_Event_Kind kind;
u32 sub_code;
Input_Modifier_Set mods;
Command_Binding binding;
u32 j;
};
Bind_Node *first = 0;
Bind_Node *last = 0;
i32 node_count = 0;
if (map->text_input_command.name != 0){
Bind_Node *node = push_array_zero(arena, Bind_Node, 1);
sll_queue_push(first, last, node);
node_count += 1;
node->binding = map->text_input_command;
node->j = max_u32;
}
u32 counts[] = {
KeyCode_COUNT,
KeyCode_COUNT,
MouseCode_COUNT,
MouseCode_COUNT,
1,
1,
CoreCode_COUNT,
};
u32 event_codes[] = {
InputEventKind_KeyStroke,
InputEventKind_KeyRelease,
InputEventKind_MouseButton,
InputEventKind_MouseButtonRelease,
InputEventKind_MouseWheel,
InputEventKind_MouseMove,
InputEventKind_Core,
};
char *mouse_wheel_name[] = {"MoveWheel"};
char *mouse_move_name[] = {"MoveMove"};
char **event_names[] = {
key_code_name,
key_code_name,
mouse_code_name,
mouse_code_name,
mouse_wheel_name,
mouse_move_name,
core_code_name,
};
b32 is_release[] = {
false,
true,
false,
true,
false,
false,
false,
};
for (u32 j = 0; j < ArrayCount(counts); j += 1){
for (u32 code = 0; code < counts[j]; code += 1){
u64 key = mapping__key(event_codes[j], code);
Table_Lookup lookup = table_lookup(&map->event_code_to_binding_list, key);
if (lookup.found_match){
u64 val = 0;
table_read(&map->event_code_to_binding_list, lookup, &val);
Command_Binding_List *list = (Command_Binding_List*)IntAsPtr(val);
for (SNode *snode = list->first;
snode != 0;
snode = snode->next){
Command_Modified_Binding *mod_binding = CastFromMember(Command_Modified_Binding, order_node, snode);
Bind_Node *node = push_array_zero(arena, Bind_Node, 1);
sll_queue_push(first, last, node);
node_count += 1;
node->kind = event_codes[j];
node->sub_code = code;
node->mods = mod_binding->mods;
node->binding = mod_binding->binding;
node->j = j;
}
}
}
}
}
Vec2_i32 table_dims = V2i32(2, node_count);
Doc_Content_List *vals = push_array_zero(arena, Doc_Content_List, table_dims.x*table_dims.y);
Bind_Node *bnode = first;
for (i32 y = 0; y < table_dims.y; y += 1, bnode = bnode->next){
Doc_Content_List *line = &vals[y*table_dims.x];
doc_text(arena, &line[0], "[");
if (bnode->j != max_u32){
doc_text(arena, &line[0], event_names[bnode->j][bnode->sub_code]);
if (is_release[bnode->j]){
doc_text(arena, &line[0], "Release");
}
Input_Modifier_Set *mods = &bnode->mods;
for (i32 k = 0; k < mods->count; k += 1){
doc_text(arena, &line[0], key_code_name[mods->mods[k]]);
}
}
else{
doc_text(arena, &line[0], "TextInput");
}
doc_text(arena, &line[0], "]");
Doc_Content *content = doc_text(arena, &line[1], bnode->binding.name);
content->page_link = SCu8(bnode->binding.name);
}
par->table.dim = table_dims;
par->table.vals = vals;
Vec2_i32 table_dims = V2i32(2, node_count);
Doc_Content_List *vals = push_array_zero(arena, Doc_Content_List, table_dims.x*table_dims.y);
Bind_Node *bnode = first;
for (i32 y = 0; y < table_dims.y; y += 1, bnode = bnode->next){
Doc_Content_List *line = &vals[y*table_dims.x];
doc_text(arena, &line[0], "[");
if (bnode->j != max_u32){
doc_text(arena, &line[0], event_names[bnode->j][bnode->sub_code]);
if (is_release[bnode->j]){
doc_text(arena, &line[0], "Release");
}
Input_Modifier_Set *mods = &bnode->mods;
for (i32 k = 0; k < mods->count; k += 1){
doc_text(arena, &line[0], key_code_name[mods->mods[k]]);
}
}
else{
doc_text(arena, &line[0], "TextInput");
}
doc_text(arena, &line[0], "]");
Doc_Content *content = doc_text(arena, &line[1], bnode->binding.name);
content->page_link = SCu8(bnode->binding.name);
}
par->table.dim = table_dims;
par->table.vals = vals;
}
}
return(cluster);
}

View File

@ -204,5 +204,21 @@ doc_paragraph(Arena *arena, Doc_Block *block){
par->kind = DocParagraphKind_Text;
}
////////////////////////////////
function Doc_Page*
doc_get_page(Doc_Cluster *cluster, String_Const_u8 name){
Doc_Page *result = 0;
for (Doc_Page *page = cluster->first_page;
page != 0;
page = page->next){
if (string_match(name, page->name)){
result = page;
break;
}
}
return(result);
}
// BOTTOM

View File

@ -195,8 +195,10 @@ CUSTOM_DOC("Prompts the user to select a command then loads a doc buffer for tha
Scratch_Block scratch(app);
Doc_Cluster *docs = doc_commands(scratch);
Doc_Page *page = get_doc_page_from_user(app, docs, "Doc Page:");
Buffer_ID buffer = render_doc_page(app, page);
view_set_buffer(app, view, buffer, 0);
if (page != 0){
Buffer_ID buffer = render_doc_page(app, page);
view_set_buffer(app, view, buffer, 0);
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -347,11 +347,11 @@ function Fancy_String*
push_fancy_string_fixed(Arena *arena, Fancy_Line *line, FColor fore,
String_Const_u8 value, i32 max){
if (value.size <= max){
return(push_fancy_stringf(arena, line, 0, fore, 0.f, 0.f,
return(push_fancy_stringf(arena, line, (Face_ID)0, fore, 0.f, 0.f,
"%-*.*s", max, string_expand(value)));
}
else{
return(push_fancy_stringf(arena, line, 0, fore, 0.f, 0.f,
return(push_fancy_stringf(arena, line, (Face_ID)0, fore, 0.f, 0.f,
"%-*.*s...", max - 3, string_expand(value)));
}
}
@ -360,12 +360,12 @@ push_fancy_string_fixed(Arena *arena, Fancy_Line *line,
f32 pre_margin, f32 post_margin, String_Const_u8 value,
i32 max){
if (value.size <= max){
return(push_fancy_stringf(arena, line, 0, fcolor_zero(),
return(push_fancy_stringf(arena, line, (Face_ID)0, fcolor_zero(),
pre_margin, post_margin,
"%-*.*s", max, string_expand(value)));
}
else{
return(push_fancy_stringf(arena, line, 0, fcolor_zero(),
return(push_fancy_stringf(arena, line, (Face_ID)0, fcolor_zero(),
pre_margin, post_margin,
"%-*.*s...", max - 3, string_expand(value)));
}
@ -374,11 +374,11 @@ function Fancy_String*
push_fancy_string_fixed(Arena *arena, Fancy_Line *line, String_Const_u8 value,
i32 max){
if (value.size <= max){
return(push_fancy_stringf(arena, line, 0, fcolor_zero(), 0.f, 0.f,
return(push_fancy_stringf(arena, line, (Face_ID)0, fcolor_zero(), 0.f, 0.f,
"%-*.*s", max, string_expand(value)));
}
else{
return(push_fancy_stringf(arena, line, 0, fcolor_zero(), 0.f, 0.f,
return(push_fancy_stringf(arena, line, (Face_ID)0, fcolor_zero(), 0.f, 0.f,
"%-*.*s...", max - 3, string_expand(value)));
}
}
@ -452,11 +452,11 @@ function Fancy_String*
push_fancy_string_trunc(Arena *arena, Fancy_Line *line, FColor fore,
String_Const_u8 value, i32 max){
if (value.size <= max){
return(push_fancy_stringf(arena, line, 0, fore, 0.f, 0.f,
return(push_fancy_stringf(arena, line, (Face_ID)0, fore, 0.f, 0.f,
"%.*s", string_expand(value)));
}
else{
return(push_fancy_stringf(arena, line, 0, fore, 0.f, 0.f,
return(push_fancy_stringf(arena, line, (Face_ID)0, fore, 0.f, 0.f,
"%.*s...", max - 3, value.str));
}
}
@ -465,12 +465,12 @@ push_fancy_string_trunc(Arena *arena, Fancy_Line *line,
f32 pre_margin, f32 post_margin, String_Const_u8 value,
i32 max){
if (value.size <= max){
return(push_fancy_stringf(arena, line, 0, fcolor_zero(),
return(push_fancy_stringf(arena, line, (Face_ID)0, fcolor_zero(),
pre_margin, post_margin,
"%.*s", string_expand(value)));
}
else{
return(push_fancy_stringf(arena, line, 0, fcolor_zero(),
return(push_fancy_stringf(arena, line, (Face_ID)0, fcolor_zero(),
pre_margin, post_margin,
"%.*s...", max - 3, value.str));
}
@ -479,11 +479,11 @@ function Fancy_String*
push_fancy_string_trunc(Arena *arena, Fancy_Line *line, String_Const_u8 value,
i32 max){
if (value.size <= max){
return(push_fancy_stringf(arena, line, 0, fcolor_zero(), 0.f, 0.f,
return(push_fancy_stringf(arena, line, (Face_ID)0, fcolor_zero(), 0.f, 0.f,
"%.*s", string_expand(value)));
}
else{
return(push_fancy_stringf(arena, line, 0, fcolor_zero(), 0.f, 0.f,
return(push_fancy_stringf(arena, line, (Face_ID)0, fcolor_zero(), 0.f, 0.f,
"%.*s...", max - 3, value.str));
}
}
@ -620,7 +620,7 @@ draw_fancy_string__inner(Application_Links *app, Face_ID face, FColor fore, Fanc
use_fore = string->fore;
}
if (use_face != 0){
ARGB_Color use_argb = fcolor_resolve(use_fore);
ARGB_Color use_argb = fcolor_resolve(use_fore);
Face_Metrics metrics = get_face_metrics(app, use_face);
f32 down_shift = (base_line - metrics.ascent);
down_shift = clamp_bot(0.f, down_shift);
@ -668,7 +668,7 @@ get_fancy_string_height(Application_Links *app, Face_ID face,
function f32
get_fancy_string_text_height(Application_Links *app, Face_ID face,
Fancy_String *string){
Fancy_String *string){
Fancy_String *next = string->next;
string->next = 0;
f32 result = get_fancy_string_text_height__inner(app, face, string);
@ -700,10 +700,10 @@ function f32
get_fancy_line_width(Application_Links *app, Face_ID face, Fancy_Line *line){
f32 result = 0.f;
if (line != 0){
if (line->face != 0){
face = line->face;
}
result = get_fancy_string_width__inner(app, face, line->first);
if (line->face != 0){
face = line->face;
}
result = get_fancy_string_width__inner(app, face, line->first);
}
return(result);
}
@ -749,12 +749,12 @@ draw_fancy_line(Application_Links *app, Face_ID face, FColor fore,
Fancy_Line *line, Vec2_f32 p, u32 flags, Vec2_f32 delta){
Vec2_f32 result = {};
if (line != 0){
if (line->face != 0){
face = line->face;
}
if (fcolor_is_valid(line->fore)){
fore = line->fore;
}
if (line->face != 0){
face = line->face;
}
if (fcolor_is_valid(line->fore)){
fore = line->fore;
}
result = draw_fancy_string__inner(app, face, fore, line->first, p, flags, delta);
}
return(result);

View File

@ -33,11 +33,11 @@ static i32 prev_error = 0;
#endif
#define systemf(...) do{ \
i32 n = snprintf(SF_CMD, sizeof(SF_CMD), __VA_ARGS__); \
Assert(n < sizeof(SF_CMD)); \
SYSTEMF_PRINTF("%s\n", SF_CMD); \
prev_error = system(SF_CMD); \
if (prev_error != 0) error_state = 1; \
i32 n = snprintf(SF_CMD, sizeof(SF_CMD), __VA_ARGS__); \
Assert(n < sizeof(SF_CMD)); \
SYSTEMF_PRINTF("%s\n", SF_CMD); \
prev_error = system(SF_CMD); \
if (prev_error != 0) error_state = 1; \
}while(0)
internal void fm_execute_in_dir(char *dir, char *str, char *args);
@ -109,18 +109,18 @@ internal void fm__swap_ptr(char **A, char **B);
#if COMPILER_CL
#define fm_add_to_line(line, str, ...) do{ \
snprintf(line.build_options, \
line.build_max, "%s "str, \
line.build_options_prev, __VA_ARGS__); \
fm__swap_ptr(&line.build_options, &line.build_options_prev); \
snprintf(line.build_options, \
line.build_max, "%s "str, \
line.build_options_prev, __VA_ARGS__); \
fm__swap_ptr(&line.build_options, &line.build_options_prev); \
}while(0)
#elif COMPILER_GCC
#elif COMPILER_GCC | COMPILER_CLANG
#define fm_add_to_line(line, str, ...) do{ \
snprintf(line.build_options, line.build_max, "%s " str, \
line.build_options_prev, ##__VA_ARGS__); \
fm__swap_ptr(&line.build_options, &line.build_options_prev); \
snprintf(line.build_options, line.build_max, "%s " str, \
line.build_options_prev, ##__VA_ARGS__); \
fm__swap_ptr(&line.build_options, &line.build_options_prev); \
}while(0)
#endif
@ -259,9 +259,9 @@ extern "C"{
#define OPEN_ALWAYS 4
#define TRUNCATE_EXISTING 5
#define FILE_ATTRIBUTE_READONLY 0x00000001
#define FILE_ATTRIBUTE_NORMAL 0x00000080
#define FILE_ATTRIBUTE_TEMPORARY 0x00000100
#define FILE_ATTRIBUTE_READONLY 0x00000001
#define FILE_ATTRIBUTE_NORMAL 0x00000080
#define FILE_ATTRIBUTE_TEMPORARY 0x00000100
global u64 perf_frequency;
@ -370,9 +370,9 @@ fm_copy_file(char *file, char *newname){
internal void
fm_copy_all(char *source, char *folder){
fprintf(stdout, "copy %s to %s\n", source, folder);
fflush(stdout);
systemf("xcopy /s /e /y /q %s %s > nul", source, folder);
fprintf(stdout, "copy %s to %s\n", source, folder);
fflush(stdout);
systemf("xcopy /s /e /y /q %s %s > nul", source, folder);
}
internal void
@ -510,7 +510,7 @@ fm_copy_file(char *file, char *newname){
internal void
fm_copy_all(char *source, char *folder){
fprintf(stdout, "copy %s to %s\n", source, folder);
systemf("cp -rf %s %s > /dev/null", source, folder);
systemf("cp -rf %s/* %s > /dev/null", source, folder);
}
internal void

View File

@ -277,13 +277,14 @@ CUSTOM_DOC("Creates a jump list of lines of the current buffer that appear to de
CUSTOM_COMMAND_SIG(list_all_functions_current_buffer_lister)
CUSTOM_DOC("Creates a lister of locations that look like function definitions and declarations in the buffer.")
{
Heap *heap = &global_heap;
View_ID view = get_active_view(app, Access_ReadVisible);
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadVisible);
if (buffer != 0){
list_all_functions(app, buffer);
view = get_active_view(app, Access_Always);
buffer = view_get_buffer(app, view, Access_Always);
Marker_List *list = get_marker_list_for_buffer(buffer);
Marker_List *list = get_or_make_list_for_buffer(app, heap, buffer);
if (list != 0){
Jump_Lister_Result jump = get_jump_index_from_user(app, list,
"Function:");
@ -301,13 +302,13 @@ CUSTOM_DOC("Creates a jump list of lines from all buffers that appear to define
CUSTOM_COMMAND_SIG(list_all_functions_all_buffers_lister)
CUSTOM_DOC("Creates a lister of locations that look like function definitions and declarations all buffers.")
{
Heap *heap = &global_heap;
list_all_functions(app, 0);
View_ID view = get_active_view(app, Access_Always);
Buffer_ID buffer = view_get_buffer(app, view, Access_Always);
Marker_List *list = get_marker_list_for_buffer(buffer);
Marker_List *list = get_or_make_list_for_buffer(app, heap, buffer);
if (list != 0){
Jump_Lister_Result jump = get_jump_index_from_user(app, list,
"Function:");
Jump_Lister_Result jump = get_jump_index_from_user(app, list, "Function:");
jump_to_jump_lister_result(app, view, list, &jump);
}
}

View File

@ -68,15 +68,15 @@ character_predicate_from_function(Character_Predicate_Function *func){
v[bit_index] = func((u8)i);
}
predicate.b[byte_index] = (
(v[0] << 0) |
(v[1] << 1) |
(v[2] << 2) |
(v[3] << 3) |
(v[4] << 4) |
(v[5] << 5) |
(v[6] << 6) |
(v[7] << 7)
);
(v[0] << 0) |
(v[1] << 1) |
(v[2] << 2) |
(v[3] << 3) |
(v[4] << 4) |
(v[5] << 5) |
(v[6] << 6) |
(v[7] << 7)
);
byte_index += 1;
}
return(predicate);
@ -788,7 +788,7 @@ enclose_boundary(Application_Links *app, Buffer_ID buffer, Range_i64 range,
range.min = new_min;
}
i64 new_max = func(app, buffer, Side_Max, Scan_Forward, range.max - 1);
i64 new_max_check = func(app, buffer, Side_Min, Scan_Forward, range.max - 1);
i64 new_max_check = func(app, buffer, Side_Min, Scan_Forward, range.max);
if (new_max_check >= new_max && new_max > range.max){
range.max = new_max;
}
@ -797,7 +797,7 @@ enclose_boundary(Application_Links *app, Buffer_ID buffer, Range_i64 range,
internal Range_i64
left_enclose_boundary(Application_Links *app, Buffer_ID buffer, Range_i64 range,
Boundary_Function *func){
Boundary_Function *func){
i64 new_min = func(app, buffer, Side_Min, Scan_Backward, range.min + 1);
i64 new_min_check = func(app, buffer, Side_Max, Scan_Backward, range.min + 1);
if (new_min_check <= new_min && new_min < range.min){
@ -1227,8 +1227,8 @@ get_indent_info_range(Application_Links *app, Buffer_ID buffer, Range_i64 range,
}
internal Indent_Info
get_indent_info_line_start(Application_Links *app, Buffer_ID buffer, i64 line_start, i32 tab_width){
i64 end = get_line_side_pos_from_pos(app, buffer, line_start, Side_Max);
get_indent_info_line_number_and_start(Application_Links *app, Buffer_ID buffer, i64 line_number, i64 line_start, i32 tab_width){
i64 end = get_line_side_pos(app, buffer, line_number, Side_Max);
return(get_indent_info_range(app, buffer, Ii64(line_start, end), tab_width));
}
@ -1897,7 +1897,7 @@ push_token_or_word_under_pos(Application_Links *app, Arena *arena, Buffer_ID buf
String_Const_u8 result = {};
Token *token = get_token_from_pos(app, buffer, pos);
if (token != 0 && token->size > 0 && token->kind != TokenBaseKind_Whitespace){
Range_i64 range = Ii64(token->pos, token->pos + token->size);
Range_i64 range = Ii64(token);
result = push_buffer_range(app, arena, buffer, range);
}
return(result);

View File

@ -44,7 +44,7 @@ insert_string__no_buffering(Buffer_Insertion *insertion, String_Const_u8 string)
insertion->at += string.size;
}
static void
function void
insert__flush(Buffer_Insertion *insertion){
Cursor *cursor = insertion->cursor;
u64 pos = insertion->temp.temp_memory_cursor.pos;
@ -53,7 +53,7 @@ insert__flush(Buffer_Insertion *insertion){
end_temp(insertion->temp);
}
static char*
function char*
insert__reserve(Buffer_Insertion *insertion, u64 size){
char *space = push_array(insertion->cursor, char, size);
if (space == 0){
@ -63,14 +63,14 @@ insert__reserve(Buffer_Insertion *insertion, u64 size){
return(space);
}
static void
function void
end_buffer_insertion(Buffer_Insertion *insertion){
if (insertion->buffering){
insert__flush(insertion);
}
}
static void
function void
insert_string(Buffer_Insertion *insertion, String_Const_u8 string){
if (!insertion->buffering){
insert_string__no_buffering(insertion, string);
@ -86,7 +86,7 @@ insert_string(Buffer_Insertion *insertion, String_Const_u8 string){
}
}
static u64
function u64
insertf(Buffer_Insertion *insertion, char *format, ...){
Scratch_Block scratch(insertion->app);
va_list args;
@ -97,12 +97,12 @@ insertf(Buffer_Insertion *insertion, char *format, ...){
return(string.size);
}
static void
function void
insertc(Buffer_Insertion *insertion, char C){
insert_string(insertion, SCu8(&C, 1));
}
static b32
function b32
insert_line_from_buffer(Buffer_Insertion *insertion, Buffer_ID buffer_id, i32 line, i32 truncate_at){
b32 success = is_valid_line(insertion->app, buffer_id, line);
if (success){
@ -112,7 +112,7 @@ insert_line_from_buffer(Buffer_Insertion *insertion, Buffer_ID buffer_id, i32 li
return(success);
}
static b32
function b32
insert_line_from_buffer(Buffer_Insertion *insertion, Buffer_ID buffer_id, i32 line){
return(insert_line_from_buffer(insertion, buffer_id, line, 0));
}

View File

@ -59,9 +59,10 @@ jump_to_jump_lister_result(Application_Links *app, View_ID view,
CUSTOM_COMMAND_SIG(view_jump_list_with_lister)
CUSTOM_DOC("When executed on a buffer with jumps, creates a persistent lister for all the jumps")
{
Heap *heap = &global_heap;
View_ID view = get_active_view(app, Access_Always);
Buffer_ID buffer = view_get_buffer(app, view, Access_Always);
Marker_List *list = get_marker_list_for_buffer(buffer);
Marker_List *list = get_or_make_list_for_buffer(app, heap, buffer);
if (list != 0){
Jump_Lister_Result jump = get_jump_index_from_user(app, list, "Jump:");
jump_to_jump_lister_result(app, view, list, &jump);

View File

@ -114,9 +114,9 @@ init_marker_list(Application_Links *app, Heap *heap, Buffer_ID buffer, Marker_Li
}
sort_pairs_by_key(range_index_buffer_id_pairs, buffer_ranges.count);
Range_i32_Array scoped_buffer_ranges = get_ranges_of_duplicate_keys(scratch,
&range_index_buffer_id_pairs->key,
sizeof(*range_index_buffer_id_pairs),
buffer_ranges.count);
&range_index_buffer_id_pairs->key,
sizeof(*range_index_buffer_id_pairs),
buffer_ranges.count);
Sticky_Jump_Stored *stored = push_array(scratch, Sticky_Jump_Stored, jumps.count);
@ -171,7 +171,9 @@ init_marker_list(Application_Links *app, Heap *heap, Buffer_ID buffer, Marker_Li
Assert(managed_object_get_type(app, marker_handle) == ManagedObjectType_Markers);
Managed_Object *marker_handle_ptr = scope_attachment(app, scope, sticky_jump_marker_handle, Managed_Object);
*marker_handle_ptr = marker_handle;
if (marker_handle_ptr != 0){
*marker_handle_ptr = marker_handle;
}
}
Managed_Object stored_jump_array = alloc_managed_memory_in_scope(app, scope_array[0], sizeof(Sticky_Jump_Stored), jumps.count);
@ -279,7 +281,7 @@ get_jump_from_list(Application_Links *app, Marker_List *list, i32 index, ID_Pos_
Managed_Scope scope = get_managed_scope_with_multiple_dependencies(app, scope_array, ArrayCount(scope_array));
Managed_Object *marker_array = scope_attachment(app, scope, sticky_jump_marker_handle, Managed_Object);
if (*marker_array != 0){
if (marker_array != 0 && *marker_array != 0){
Marker marker = {};
managed_object_load_data(app, *marker_array, stored.index_into_marker_array, 1, &marker);
location->buffer_id = target_buffer_id;

View File

@ -4,9 +4,6 @@
// TOP
global b32 global_keyboard_macro_is_recording = false;
global Range_i64 global_keyboard_macro_range = {};
function Buffer_ID
get_keyboard_log_buffer(Application_Links *app){
return(get_buffer_by_name(app, string_u8_litexpr("*keyboard*"), Access_Always));

View File

@ -15,7 +15,6 @@ layout_nearest_pos_to_xy(Layout_Item_List list, Vec2_f32 p){
}
else{
if (0.f < p.x && p.x < max_f32){
f32 bottom_padding = list.bottom_padding;
f32 closest_x = -max_f32;
for (Layout_Item_Block *block = list.first;
block != 0;
@ -30,7 +29,7 @@ layout_nearest_pos_to_xy(Layout_Item_List list, Vec2_f32 p){
if (p.y < item->rect.y0){
goto double_break;
}
if (item->rect.y1 + bottom_padding <= p.y){
if (item->padded_y1 <= p.y){
continue;
}
f32 dist0 = p.x - item->rect.x0;
@ -68,7 +67,7 @@ layout_nearest_pos_to_xy(Layout_Item_List list, Vec2_f32 p){
goto double_break_2;
}
prev_item = item;
if (item->rect.y1 <= p.y){
if (item->padded_y1 <= p.y){
continue;
}
}
@ -97,7 +96,7 @@ layout_nearest_pos_to_xy(Layout_Item_List list, Vec2_f32 p){
if (p.y < item->rect.y0){
goto double_break_3;
}
if (item->rect.y1 <= p.y){
if (item->padded_y1 <= p.y){
continue;
}
closest_item = item;
@ -160,6 +159,19 @@ layout_box_of_pos(Layout_Item_List list, i64 index){
return(result);
}
function Rect_f32
layout_padded_box_of_pos(Layout_Item_List list, i64 index){
Rect_f32 result = {};
Layout_Item *item = layout_get_first_with_index(list, index);
if (item != 0){
result.x0 = item->rect.x0;
result.y0 = item->rect.y0;
result.x1 = item->rect.x1;
result.y1 = item->padded_y1;
}
return(result);
}
internal i64
layout_get_pos_at_character(Layout_Item_List list, i64 character){
i64 result = 0;

View File

@ -56,7 +56,7 @@ layout_item_list_finish(Layout_Item_List *list, f32 bottom_padding){
}
function void
layout_write(Arena *arena, Layout_Item_List *list, Face_ID face, i64 index, u32 codepoint, Layout_Item_Flag flags, Rect_f32 rect){
layout_write(Arena *arena, Layout_Item_List *list, Face_ID face, i64 index, u32 codepoint, Layout_Item_Flag flags, Rect_f32 rect, f32 padded_y1){
Temp_Memory restore_point = begin_temp(arena);
Layout_Item *item = push_array(arena, Layout_Item, 1);
Layout_Item_Block *block = list->last;
@ -95,6 +95,7 @@ layout_write(Arena *arena, Layout_Item_List *list, Face_ID face, i64 index, u32
item->codepoint = codepoint;
item->flags = flags;
item->rect = rect;
item->padded_y1 = padded_y1;
list->height = Max(list->height, rect.y1);
}
@ -179,7 +180,7 @@ lr_tb_write_with_advance_with_flags(LefRig_TopBot_Layout_Vars *vars, Face_ID fac
}
vars->p.x = f32_ceil32(vars->p.x);
f32 next_x = vars->p.x + advance;
layout_write(arena, list, face, index, codepoint, flags, Rf32(vars->p, V2f32(next_x, vars->text_y)));
layout_write(arena, list, face, index, codepoint, flags, Rf32(vars->p, V2f32(next_x, vars->text_y)), vars->line_y);
vars->p.x = next_x;
}
@ -219,15 +220,15 @@ lr_tb_write_byte_with_advance(LefRig_TopBot_Layout_Vars *vars, Face_ID face, f32
f32 text_y = vars->text_y;
Layout_Item_Flag flags = LayoutItemFlag_Special_Character;
layout_write(arena, list, face, index, '\\', flags, Rf32(p, V2f32(next_x, text_y)));
layout_write(arena, list, face, index, '\\', flags, Rf32(p, V2f32(next_x, text_y)), vars->line_y);
p.x = next_x;
flags = LayoutItemFlag_Ghost_Character;
next_x += metrics->byte_sub_advances[1];
layout_write(arena, list, face, index, integer_symbols[hi], flags, Rf32(p, V2f32(next_x, text_y)));
layout_write(arena, list, face, index, integer_symbols[hi], flags, Rf32(p, V2f32(next_x, text_y)), vars->line_y);
p.x = next_x;
next_x += metrics->byte_sub_advances[2];
layout_write(arena, list, face, index, integer_symbols[lo], flags, Rf32(p, V2f32(next_x, text_y)));
layout_write(arena, list, face, index, integer_symbols[lo], flags, Rf32(p, V2f32(next_x, text_y)), vars->line_y);
vars->p.x = final_next_x;
}
@ -242,7 +243,7 @@ lr_tb_write_byte(LefRig_TopBot_Layout_Vars *vars, Face_ID face,
function void
lr_tb_write_blank_dim(LefRig_TopBot_Layout_Vars *vars, Face_ID face, Vec2_f32 dim,
Arena *arena, Layout_Item_List *list, i64 index){
layout_write(arena, list, face, index, ' ', 0, Rf32_xy_wh(vars->p, dim));
layout_write(arena, list, face, index, ' ', 0, Rf32_xy_wh(vars->p, dim), vars->line_y);
vars->p.x += dim.x;
}

View File

@ -266,8 +266,8 @@ lister_render(Application_Links *app, Frame_Info frame_info, View_ID view){
highlight = UIHighlight_Hover;
}
draw_rectangle_fcolor(app, item_rect, 6.f, get_margin_color(highlight));
draw_rectangle_fcolor(app, item_inner, 6.f, fcolor_id(defcolor_back));
draw_rectangle_fcolor(app, item_rect, 6.f, get_item_margin_color(highlight));
draw_rectangle_fcolor(app, item_inner, 6.f, get_item_margin_color(highlight, 1));
Fancy_Line line = {};
push_fancy_string(scratch, &line, fcolor_id(defcolor_text_default), node->string);
@ -472,7 +472,7 @@ run_lister(Application_Links *app, Lister *lister){
case InputEventKind_TextInsert:
{
if (lister->handlers.write_character != 0){
lister->handlers.write_character(app);
result = lister->handlers.write_character(app);
}
}break;
@ -627,7 +627,7 @@ run_lister(Application_Links *app, Lister *lister){
switch (in.event.core.code){
case CoreCode_Animate:
{
lister_update_filtered_list(app, lister);
lister_update_filtered_list(app, lister);
}break;
default:
@ -716,8 +716,9 @@ lister_add_item(Lister *lister, String_Const_u8 string, String_Const_u8 status,
user_data, extra_space));
}
function void
function Lister_Activation_Code
lister__write_string__default(Application_Links *app){
Lister_Activation_Code result = ListerActivation_Continue;
View_ID view = get_active_view(app, Access_Always);
Lister *lister = view_get_lister(view);
if (lister != 0){
@ -731,6 +732,7 @@ lister__write_string__default(Application_Links *app){
lister_update_filtered_list(app, lister);
}
}
return(result);
}
function void

View File

@ -39,6 +39,7 @@ struct Lister_Node_Ptr_Array{
i32 count;
};
typedef Lister_Activation_Code Lister_Write_Character_Function(Application_Links *app);
typedef Lister_Activation_Code Lister_Key_Stroke_Function(Application_Links *app);
typedef void Lister_Navigate_Function(Application_Links *app,
View_ID view, struct Lister *lister,
@ -46,7 +47,7 @@ typedef void Lister_Navigate_Function(Application_Links *app,
struct Lister_Handlers{
Lister_Regenerate_List_Function_Type *refresh;
Custom_Command_Function *write_character;
Lister_Write_Character_Function *write_character;
Custom_Command_Function *backspace;
Lister_Navigate_Function *navigate;
Lister_Key_Stroke_Function *key_stroke;

View File

@ -222,7 +222,7 @@ get_color_table_from_user(Application_Links *app, String_Const_u8 query, Color_T
Lister_Result l_result = run_lister(app, lister);
Color_Table *result = 0;
Color_Table *result = 0;
if (!l_result.canceled){
result = (Color_Table*)l_result.user_data;
}
@ -236,8 +236,9 @@ get_color_table_from_user(Application_Links *app){
////////////////////////////////
function void
function Lister_Activation_Code
lister__write_character__file_path(Application_Links *app){
Lister_Activation_Code result = ListerActivation_Continue;
View_ID view = get_this_ctx_view(app, Access_Always);
Lister *lister = view_get_lister(view);
if (lister != 0){
@ -245,18 +246,20 @@ lister__write_character__file_path(Application_Links *app){
String_Const_u8 string = to_writable(&in);
if (string.str != 0 && string.size > 0){
lister_append_text_field(lister, string);
String_Const_u8 front_name = string_front_of_path(lister->text_field.string);
lister_set_key(lister, front_name);
if (character_is_slash(string.str[0])){
String_Const_u8 new_hot = lister->text_field.string;
set_hot_directory(app, new_hot);
lister_call_refresh_handler(app, lister);
lister->out.text_field = lister->text_field.string;
result = ListerActivation_Finished;
}
else{
String_Const_u8 front_name = string_front_of_path(lister->text_field.string);
lister_set_key(lister, front_name);
}
lister->item_index = 0;
lister_zero_scroll(lister);
lister_update_filtered_list(app, lister);
}
}
return(result);
}
function void
@ -374,15 +377,13 @@ struct File_Name_Result{
};
function File_Name_Result
get_file_name_from_user(Application_Links *app, Arena *arena, String_Const_u8 query,
View_ID view){
get_file_name_from_user(Application_Links *app, Arena *arena, String_Const_u8 query, View_ID view){
Lister_Handlers handlers = lister_get_default_handlers();
handlers.refresh = generate_hot_directory_file_list;
handlers.write_character = lister__write_character__file_path;
handlers.backspace = lister__backspace_text_field__file_path;
Lister_Result l_result =
run_lister_with_refresh_handler(app, arena, query, handlers);
Lister_Result l_result = run_lister_with_refresh_handler(app, arena, query, handlers);
File_Name_Result result = {};
result.canceled = l_result.canceled;
@ -391,12 +392,18 @@ get_file_name_from_user(Application_Links *app, Arena *arena, String_Const_u8 qu
if (l_result.user_data != 0){
String_Const_u8 name = SCu8((u8*)l_result.user_data);
result.file_name_activated = name;
result.is_folder =
character_is_slash(string_get_character(name, name.size -1 ));
result.is_folder = character_is_slash(string_get_character(name, name.size - 1));
}
result.file_name_in_text_field = string_front_of_path(l_result.text_field);
String_Const_u8 path = string_remove_front_of_path(l_result.text_field);
String_Const_u8 path = {};
if (l_result.user_data == 0 && result.file_name_in_text_field.size == 0 && l_result.text_field.size > 0){
result.file_name_in_text_field = string_front_folder_of_path(l_result.text_field);
path = string_remove_front_folder_of_path(l_result.text_field);
}
else{
path = string_remove_front_of_path(l_result.text_field);
}
if (character_is_slash(string_get_character(path, path.size - 1))){
path = string_chop(path, 1);
}
@ -407,8 +414,7 @@ get_file_name_from_user(Application_Links *app, Arena *arena, String_Const_u8 qu
}
function File_Name_Result
get_file_name_from_user(Application_Links *app, Arena *arena, char *query,
View_ID view){
get_file_name_from_user(Application_Links *app, Arena *arena, char *query, View_ID view){
return(get_file_name_from_user(app, arena, SCu8(query), view));
}
@ -429,8 +435,7 @@ do_buffer_kill_user_check(Application_Links *app, Buffer_ID buffer, View_ID view
lister_choice(scratch, &list, "(Y)es" , "", KeyCode_Y, SureToKill_Yes);
lister_choice(scratch, &list, "(S)ave", "", KeyCode_S, SureToKill_Save);
Lister_Choice *choice =
get_choice_from_user(app, "There are unsaved changes, close anyway?", list);
Lister_Choice *choice = get_choice_from_user(app, "There are unsaved changes, close anyway?", list);
b32 do_kill = false;
if (choice != 0){
@ -507,7 +512,7 @@ CUSTOM_DOC("Interactively switch to an open buffer.")
{
Buffer_ID buffer = get_buffer_from_user(app, "Switch:");
if (buffer != 0){
View_ID view = get_this_ctx_view(app, Access_Always);
View_ID view = get_this_ctx_view(app, Access_Always);
view_set_buffer(app, view, buffer, 0);
}
}
@ -524,6 +529,50 @@ CUSTOM_DOC("Interactively kill an open buffer.")
////////////////////////////////
enum{
SureToCreateFolder_NULL = 0,
SureToCreateFolder_No = 1,
SureToCreateFolder_Yes = 2,
};
function b32
query_create_folder(Application_Links *app, String_Const_u8 folder_name){
Scratch_Block scratch(app);
Lister_Choice_List list = {};
lister_choice(scratch, &list, "(N)o" , "", KeyCode_N, SureToKill_No);
lister_choice(scratch, &list, "(Y)es" , "", KeyCode_Y, SureToKill_Yes);
String_Const_u8 message = push_u8_stringf(scratch, "Create the folder %.*s?", string_expand(folder_name));
Lister_Choice *choice = get_choice_from_user(app, message, list);
b32 did_create_folder = false;
if (choice != 0){
switch (choice->user_data){
case SureToCreateFolder_No:
{}break;
case SureToCreateFolder_Yes:
{
String_Const_u8 hot = push_hot_directory(app, scratch);
String_Const_u8 fixed_folder_name = folder_name;
for (;fixed_folder_name.size > 0 &&
character_is_slash(fixed_folder_name.str[fixed_folder_name.size - 1]);){
fixed_folder_name = string_chop(fixed_folder_name, 1);
}
if (fixed_folder_name.size > 0){
String_Const_u8 cmd = push_u8_stringf(scratch, "mkdir %.*s", string_expand(fixed_folder_name));
exec_system_command(app, 0, buffer_identifier(0), hot, cmd, 0);
did_create_folder = true;
}
}break;
}
}
return(did_create_folder);
}
////////////////////////////////
function Lister_Activation_Code
activate_open_or_new__generic(Application_Links *app, View_ID view,
String_Const_u8 path, String_Const_u8 file_name,
@ -566,8 +615,7 @@ CUSTOM_DOC("Interactively open a file out of the file system.")
for (;;){
Scratch_Block scratch(app);
View_ID view = get_this_ctx_view(app, Access_Always);
File_Name_Result result = get_file_name_from_user(app, scratch, "Open:",
view);
File_Name_Result result = get_file_name_from_user(app, scratch, "Open:", view);
if (result.canceled) break;
String_Const_u8 file_name = result.file_name_activated;
@ -577,15 +625,31 @@ CUSTOM_DOC("Interactively open a file out of the file system.")
if (file_name.size == 0) break;
String_Const_u8 path = result.path_in_text_field;
String_Const_u8 full_file_name =
push_u8_stringf(scratch, "%.*s/%.*s",
string_expand(path), string_expand(file_name));
String_Const_u8 full_file_name = push_u8_stringf(scratch, "%.*s/%.*s",
string_expand(path), string_expand(file_name));
if (result.is_folder){
set_hot_directory(app, full_file_name);
continue;
}
if (character_is_slash(file_name.str[file_name.size - 1])){
File_Attributes attribs = system_quick_file_attributes(scratch, full_file_name);
if (HasFlag(attribs.flags, FileAttribute_IsDirectory)){
set_hot_directory(app, full_file_name);
continue;
}
if (string_looks_like_drive_letter(file_name)){
set_hot_directory(app, file_name);
continue;
}
if (query_create_folder(app, file_name)){
set_hot_directory(app, full_file_name);
continue;
}
break;
}
Buffer_ID buffer = create_buffer(app, full_file_name, 0);
if (buffer != 0){
view_set_buffer(app, view, buffer, 0);
@ -622,6 +686,23 @@ CUSTOM_DOC("Interactively creates a new file.")
continue;
}
if (character_is_slash(file_name.str[file_name.size - 1])){
File_Attributes attribs = system_quick_file_attributes(scratch, full_file_name);
if (HasFlag(attribs.flags, FileAttribute_IsDirectory)){
set_hot_directory(app, full_file_name);
continue;
}
if (string_looks_like_drive_letter(file_name)){
set_hot_directory(app, file_name);
continue;
}
if (query_create_folder(app, file_name)){
set_hot_directory(app, full_file_name);
continue;
}
break;
}
Buffer_Create_Flag flags = BufferCreate_AlwaysNew;
Buffer_ID buffer = create_buffer(app, full_file_name, flags);
if (buffer != 0){
@ -637,8 +718,7 @@ CUSTOM_DOC("Interactively opens a file.")
for (;;){
Scratch_Block scratch(app);
View_ID view = get_this_ctx_view(app, Access_Always);
File_Name_Result result = get_file_name_from_user(app, scratch, "Open:",
view);
File_Name_Result result = get_file_name_from_user(app, scratch, "Open:", view);
if (result.canceled) break;
String_Const_u8 file_name = result.file_name_activated;
@ -654,6 +734,19 @@ CUSTOM_DOC("Interactively opens a file.")
continue;
}
if (character_is_slash(file_name.str[file_name.size - 1])){
File_Attributes attribs = system_quick_file_attributes(scratch, full_file_name);
if (HasFlag(attribs.flags, FileAttribute_IsDirectory)){
set_hot_directory(app, full_file_name);
continue;
}
if (query_create_folder(app, file_name)){
set_hot_directory(app, full_file_name);
continue;
}
break;
}
Buffer_Create_Flag flags = BufferCreate_NeverNew;
Buffer_ID buffer = create_buffer(app, full_file_name, flags);
if (buffer != 0){
@ -670,20 +763,20 @@ CUSTOM_DOC("Opens an interactive list of all registered commands.")
{
View_ID view = get_this_ctx_view(app, Access_Always);
if (view != 0){
Command_Lister_Status_Rule rule = {};
Buffer_ID buffer = view_get_buffer(app, view, Access_Visible);
Managed_Scope buffer_scope = buffer_get_managed_scope(app, buffer);
Command_Map_ID *map_id_ptr = scope_attachment(app, buffer_scope, buffer_map_id, Command_Map_ID);
if (map_id_ptr != 0){
rule = command_lister_status_bindings(&framework_mapping, *map_id_ptr);
}
else{
rule = command_lister_status_descriptions();
}
Custom_Command_Function *func = get_command_from_user(app, "Command:", &rule);
if (func != 0){
view_enqueue_command_function(app, view, func);
}
Command_Lister_Status_Rule rule = {};
Buffer_ID buffer = view_get_buffer(app, view, Access_Visible);
Managed_Scope buffer_scope = buffer_get_managed_scope(app, buffer);
Command_Map_ID *map_id_ptr = scope_attachment(app, buffer_scope, buffer_map_id, Command_Map_ID);
if (map_id_ptr != 0){
rule = command_lister_status_bindings(&framework_mapping, *map_id_ptr);
}
else{
rule = command_lister_status_descriptions();
}
Custom_Command_Function *func = get_command_from_user(app, "Command:", &rule);
if (func != 0){
view_enqueue_command_function(app, view, func);
}
}
}

View File

@ -672,7 +672,7 @@ log_graph_render(Application_Links *app, Frame_Info frame_info, View_ID view){
Rect_f32 view_rect = view_get_screen_rect(app, view);
Rect_f32 inner = rect_inner(view_rect, 3);
draw_rectangle_fcolor(app, view_rect, 0.f,
get_margin_color(is_active_view?UIHighlight_Active:UIHighlight_None));
get_item_margin_color(is_active_view?UIHighlight_Active:UIHighlight_None));
draw_rectangle_fcolor(app, inner, 0.f, fcolor_id(defcolor_back));
Rect_f32 prev_clip = draw_set_clip(app, inner);

160
custom/4coder_mac_map.cpp Normal file
View File

@ -0,0 +1,160 @@
/*
4coder_mac_map.cpp - Instantiate mac keyboard bindings.
*/
// TOP
function void
setup_mac_mapping(Mapping *mapping, i64 global_id, i64 file_id, i64 code_id){
MappingScope();
SelectMapping(mapping);
SelectMap(global_id);
BindCore(default_startup, CoreCode_Startup);
BindCore(default_try_exit, CoreCode_TryExit);
Bind(keyboard_macro_start_recording , KeyCode_U, KeyCode_Command);
Bind(keyboard_macro_finish_recording, KeyCode_U, KeyCode_Command, KeyCode_Shift);
Bind(keyboard_macro_replay, KeyCode_U, KeyCode_Control);
Bind(change_active_panel, KeyCode_Comma, KeyCode_Command);
Bind(change_active_panel_backwards, KeyCode_Comma, KeyCode_Command, KeyCode_Shift);
Bind(interactive_new, KeyCode_N, KeyCode_Command);
Bind(interactive_open_or_new, KeyCode_O, KeyCode_Command);
Bind(open_in_other, KeyCode_O, KeyCode_Control);
Bind(interactive_kill_buffer, KeyCode_K, KeyCode_Command);
Bind(interactive_switch_buffer, KeyCode_I, KeyCode_Command);
Bind(project_go_to_root_directory, KeyCode_H, KeyCode_Command);
Bind(save_all_dirty_buffers, KeyCode_S, KeyCode_Command, KeyCode_Shift);
Bind(change_to_build_panel, KeyCode_Period, KeyCode_Control);
Bind(close_build_panel, KeyCode_Comma, KeyCode_Control);
Bind(goto_next_jump, KeyCode_N, KeyCode_Control);
Bind(goto_prev_jump, KeyCode_N, KeyCode_Control, KeyCode_Shift);
Bind(build_in_build_panel, KeyCode_M, KeyCode_Control);
Bind(goto_first_jump, KeyCode_M, KeyCode_Control, KeyCode_Shift);
Bind(toggle_filebar, KeyCode_B, KeyCode_Control);
Bind(execute_any_cli, KeyCode_Z, KeyCode_Control);
Bind(execute_previous_cli, KeyCode_Z, KeyCode_Control, KeyCode_Shift);
Bind(command_lister, KeyCode_X, KeyCode_Control);
Bind(project_command_lister, KeyCode_X, KeyCode_Control, KeyCode_Shift);
Bind(list_all_functions_current_buffer, KeyCode_I, KeyCode_Command, KeyCode_Shift);
Bind(project_fkey_command, KeyCode_F1);
Bind(project_fkey_command, KeyCode_F2);
Bind(project_fkey_command, KeyCode_F3);
Bind(project_fkey_command, KeyCode_F4);
Bind(project_fkey_command, KeyCode_F5);
Bind(project_fkey_command, KeyCode_F6);
Bind(project_fkey_command, KeyCode_F7);
Bind(project_fkey_command, KeyCode_F8);
Bind(project_fkey_command, KeyCode_F9);
Bind(project_fkey_command, KeyCode_F10);
Bind(project_fkey_command, KeyCode_F11);
Bind(project_fkey_command, KeyCode_F12);
Bind(project_fkey_command, KeyCode_F13);
Bind(project_fkey_command, KeyCode_F14);
Bind(project_fkey_command, KeyCode_F15);
Bind(project_fkey_command, KeyCode_F16);
Bind(exit_4coder, KeyCode_F4, KeyCode_Alt);
BindMouseWheel(mouse_wheel_scroll);
BindMouseWheel(mouse_wheel_change_face_size, KeyCode_Command);
SelectMap(file_id);
ParentMap(global_id);
BindTextInput(write_text_input);
BindMouse(click_set_cursor_and_mark, MouseCode_Left);
BindMouseRelease(click_set_cursor, MouseCode_Left);
BindCore(click_set_cursor_and_mark, CoreCode_ClickActivateView);
BindMouseMove(click_set_cursor_if_lbutton);
Bind(delete_char, KeyCode_Delete);
Bind(backspace_char, KeyCode_Backspace);
Bind(move_up, KeyCode_Up);
Bind(move_down, KeyCode_Down);
Bind(move_left, KeyCode_Left);
Bind(move_right, KeyCode_Right);
Bind(seek_end_of_line, KeyCode_End);
Bind(seek_beginning_of_line, KeyCode_Home);
Bind(page_up, KeyCode_PageUp);
Bind(page_down, KeyCode_PageDown);
Bind(goto_beginning_of_file, KeyCode_PageUp, KeyCode_Command);
Bind(goto_end_of_file, KeyCode_PageDown, KeyCode_Command);
Bind(move_up_to_blank_line_end, KeyCode_Up, KeyCode_Command);
Bind(move_down_to_blank_line_end, KeyCode_Down, KeyCode_Command);
Bind(move_left_whitespace_boundary, KeyCode_Left, KeyCode_Command);
Bind(move_right_whitespace_boundary, KeyCode_Right, KeyCode_Command);
Bind(move_line_up, KeyCode_Up, KeyCode_Alt);
Bind(move_line_down, KeyCode_Down, KeyCode_Alt);
Bind(backspace_alpha_numeric_boundary, KeyCode_Backspace, KeyCode_Command);
Bind(delete_alpha_numeric_boundary, KeyCode_Delete, KeyCode_Command);
Bind(snipe_backward_whitespace_or_token_boundary, KeyCode_Backspace, KeyCode_Control);
Bind(snipe_forward_whitespace_or_token_boundary, KeyCode_Delete, KeyCode_Control);
Bind(set_mark, KeyCode_Space, KeyCode_Control);
Bind(set_mark, KeyCode_ForwardSlash, KeyCode_Command);
Bind(replace_in_range, KeyCode_A, KeyCode_Command);
Bind(copy, KeyCode_C, KeyCode_Command);
Bind(delete_range, KeyCode_D, KeyCode_Command);
Bind(delete_line, KeyCode_D, KeyCode_Command, KeyCode_Shift);
Bind(center_view, KeyCode_E, KeyCode_Command);
Bind(left_adjust_view, KeyCode_E, KeyCode_Command, KeyCode_Shift);
Bind(search, KeyCode_F, KeyCode_Command);
Bind(list_all_locations, KeyCode_F, KeyCode_Command, KeyCode_Shift);
Bind(list_all_substring_locations_case_insensitive, KeyCode_F, KeyCode_Control);
Bind(goto_line, KeyCode_G, KeyCode_Command);
Bind(list_all_locations_of_selection, KeyCode_G, KeyCode_Command, KeyCode_Shift);
Bind(snippet_lister, KeyCode_J, KeyCode_Command);
Bind(kill_buffer, KeyCode_K, KeyCode_Command, KeyCode_Shift);
Bind(duplicate_line, KeyCode_L, KeyCode_Command);
Bind(cursor_mark_swap, KeyCode_M, KeyCode_Command);
Bind(reopen, KeyCode_O, KeyCode_Command, KeyCode_Shift);
Bind(query_replace, KeyCode_Q, KeyCode_Command);
Bind(query_replace_identifier, KeyCode_Q, KeyCode_Command, KeyCode_Shift);
Bind(query_replace_selection, KeyCode_Q, KeyCode_Control);
Bind(reverse_search, KeyCode_R, KeyCode_Command);
Bind(save, KeyCode_S, KeyCode_Command);
Bind(save_all_dirty_buffers, KeyCode_S, KeyCode_Command, KeyCode_Shift);
Bind(search_identifier, KeyCode_T, KeyCode_Command);
Bind(list_all_locations_of_identifier, KeyCode_T, KeyCode_Command, KeyCode_Shift);
Bind(paste_and_indent, KeyCode_V, KeyCode_Command);
Bind(paste_next_and_indent, KeyCode_V, KeyCode_Command, KeyCode_Shift);
Bind(cut, KeyCode_X, KeyCode_Command);
Bind(redo, KeyCode_Y, KeyCode_Command);
Bind(undo, KeyCode_Z, KeyCode_Command);
Bind(view_buffer_other_panel, KeyCode_1, KeyCode_Command);
Bind(swap_panels, KeyCode_2, KeyCode_Command);
Bind(if_read_only_goto_position, KeyCode_Return);
Bind(if_read_only_goto_position_same_panel, KeyCode_Return, KeyCode_Shift);
Bind(view_jump_list_with_lister, KeyCode_Period, KeyCode_Command, KeyCode_Shift);
SelectMap(code_id);
ParentMap(file_id);
BindTextInput(write_text_and_auto_indent);
Bind(move_left_alpha_numeric_boundary, KeyCode_Left, KeyCode_Command);
Bind(move_right_alpha_numeric_boundary, KeyCode_Right, KeyCode_Command);
Bind(move_left_alpha_numeric_or_camel_boundary, KeyCode_Left, KeyCode_Control);
Bind(move_right_alpha_numeric_or_camel_boundary, KeyCode_Right, KeyCode_Control);
Bind(comment_line_toggle, KeyCode_Semicolon, KeyCode_Command);
Bind(word_complete, KeyCode_Tab);
Bind(auto_indent_range, KeyCode_Tab, KeyCode_Command);
Bind(auto_indent_line_at_cursor, KeyCode_Tab, KeyCode_Shift);
Bind(word_complete_drop_down, KeyCode_Tab, KeyCode_Shift, KeyCode_Command);
Bind(write_block, KeyCode_R, KeyCode_Control);
Bind(write_todo, KeyCode_T, KeyCode_Control);
Bind(write_note, KeyCode_Y, KeyCode_Control);
Bind(list_all_locations_of_type_definition, KeyCode_D, KeyCode_Control);
Bind(list_all_locations_of_type_definition_of_identifier, KeyCode_T, KeyCode_Control, KeyCode_Shift);
Bind(open_long_braces, KeyCode_LeftBracket, KeyCode_Command);
Bind(open_long_braces_semicolon, KeyCode_LeftBracket, KeyCode_Command, KeyCode_Shift);
Bind(open_long_braces_break, KeyCode_RightBracket, KeyCode_Command, KeyCode_Shift);
Bind(select_surrounding_scope, KeyCode_LeftBracket, KeyCode_Control);
Bind(select_surrounding_scope_maximal, KeyCode_LeftBracket, KeyCode_Control, KeyCode_Shift);
Bind(select_prev_scope_absolute, KeyCode_RightBracket, KeyCode_Control);
Bind(select_prev_top_most_scope, KeyCode_RightBracket, KeyCode_Control, KeyCode_Shift);
Bind(select_next_scope_absolute, KeyCode_Quote, KeyCode_Control);
Bind(select_next_scope_after_current, KeyCode_Quote, KeyCode_Control, KeyCode_Shift);
Bind(place_in_scope, KeyCode_ForwardSlash, KeyCode_Control);
Bind(delete_current_scope, KeyCode_Minus, KeyCode_Control);
Bind(if0_off, KeyCode_I, KeyCode_Control);
Bind(open_file_in_quotes, KeyCode_1, KeyCode_Control);
Bind(open_matching_file_cpp, KeyCode_2, KeyCode_Control);
Bind(write_zero_struct, KeyCode_0, KeyCode_Command);
}
// BOTTOM

View File

@ -5,7 +5,10 @@
// TOP
#include <stdlib.h>
#include <malloc.h>
#if !OS_MAC
# include <malloc.h>
#endif
internal void*
base_reserve__malloc(void *user_data, u64 size, u64 *size_out, String_Const_u8 location){

View File

@ -91,17 +91,20 @@ internal String_Const_u8_Array
user_list_definition_array(Application_Links *app, Arena *arena, String_Const_u8 base_needle){
String_Const_u8_Array result = {};
if (base_needle.size > 0){
result.count = 9;
result.count = 12;
result.vals = push_array(arena, String_Const_u8, result.count);
i32 i = 0;
result.vals[i++] = (push_u8_stringf(arena, "struct %.*s{" , string_expand(base_needle)));
result.vals[i++] = (push_u8_stringf(arena, "struct %.*s\n{", string_expand(base_needle)));
result.vals[i++] = (push_u8_stringf(arena, "struct %.*s\r\n{", string_expand(base_needle)));
result.vals[i++] = (push_u8_stringf(arena, "struct %.*s {" , string_expand(base_needle)));
result.vals[i++] = (push_u8_stringf(arena, "union %.*s{" , string_expand(base_needle)));
result.vals[i++] = (push_u8_stringf(arena, "union %.*s\n{" , string_expand(base_needle)));
result.vals[i++] = (push_u8_stringf(arena, "union %.*s\r\n{" , string_expand(base_needle)));
result.vals[i++] = (push_u8_stringf(arena, "union %.*s {" , string_expand(base_needle)));
result.vals[i++] = (push_u8_stringf(arena, "enum %.*s{" , string_expand(base_needle)));
result.vals[i++] = (push_u8_stringf(arena, "enum %.*s\n{" , string_expand(base_needle)));
result.vals[i++] = (push_u8_stringf(arena, "enum %.*s\r\n{" , string_expand(base_needle)));
result.vals[i++] = (push_u8_stringf(arena, "enum %.*s {" , string_expand(base_needle)));
Assert(i == result.count);
}

View File

@ -121,7 +121,7 @@ tutorial_render(Application_Links *app, Frame_Info frame_info, View_ID view_id){
View_ID active_view = get_active_view(app, Access_Always);
b32 is_active_view = (active_view == view_id);
FColor margin_color = get_margin_color(is_active_view?UIHighlight_Active:UIHighlight_None);
FColor margin_color = get_panel_margin_color(is_active_view?UIHighlight_Active:UIHighlight_None);
Rect_f32 region = draw_background_and_margin(app, view_id, margin_color, margin_color);
Rect_f32 prev_clip = draw_set_clip(app, region);
@ -152,9 +152,9 @@ tutorial_render(Application_Links *app, Frame_Info frame_info, View_ID view_id){
Rect_f32_Pair pair = rect_split_left_right(footer, b_width);
footer = pair.max;
footer.x0 += 10.f;
if (draw_button(app, pair.min, m_p, face, string_u8_litexpr("minimize"))){
tutorial.hover_action = TutorialAction_Minimize;
}
if (draw_button(app, pair.min, m_p, face, string_u8_litexpr("minimize"))){
tutorial.hover_action = TutorialAction_Minimize;
}
}
{
@ -241,7 +241,7 @@ tutorial_run_loop(Application_Links *app){
case CoreCode_ClickActivateView:
{
tutorial_maximize(app);
tutorial_action(app, tutorial.hover_action);
tutorial_action(app, tutorial.hover_action);
change_active_panel(app);
}break;

View File

@ -54,7 +54,7 @@ struct Color_Array{
api(custom)
struct Color_Table{
Color_Array *arrays;
Color_Array *arrays;
u32 count;
};
@ -178,6 +178,7 @@ enum{
BufferSetting_Unimportant,
BufferSetting_ReadOnly,
BufferSetting_RecordsHistory,
BufferSetting_Unkillable,
};
api(custom)
@ -707,6 +708,7 @@ struct Layout_Item{
u32 codepoint;
Layout_Item_Flag flags;
Rect_f32 rect;
f32 padded_y1;
};
api(custom)
@ -741,7 +743,7 @@ struct View_Context{
u64 delta_rule_memory_size;
b32 hides_buffer;
struct Mapping *mapping;
i64 map_id;
i64 map_id;
};
api(custom)
@ -777,4 +779,3 @@ struct Process_State{
};
#endif

View File

@ -1,6 +1,6 @@
#define MAJOR 4
#define MINOR 1
#define PATCH 0
#define PATCH 2
// string
#define VN__(a,b,c) #a "." #b "." #c

View File

@ -0,0 +1,30 @@
#!/bin/bash
# If any command errors, stop the script
set -e
# Store the real CWD
ME="$(realpath "$0")"
LOCATION="$(dirname "$ME")"
CODE_HOME="$(dirname "$LOCATION")"
# Find the most reasonable candidate build file
SOURCE="$1"
if [ -z "$SOURCE" ]; then
SOURCE="$(realpath "$CODE_HOME/4coder_default_bindings.cpp")"
fi
# NOTE(yuval): Removed -Wno-writable-strings as it is the same as -Wno-write-strings
opts="-Wno-write-strings -Wno-null-dereference -Wno-comment -Wno-switch -Wno-missing-declarations -Wno-logical-op-parentheses -g"
arch=-m64
preproc_file=4coder_command_metadata.i
meta_macros="-DMETA_PASS"
clang++ -I"$CODE_HOME" $meta_macros $arch $opts $debug -std=gnu++0x "$SOURCE" -E -o $preproc_file
clang++ -I"$CODE_HOME" $opts $debug -std=gnu++0x "$CODE_HOME/4coder_metadata_generator.cpp" -o "$CODE_HOME/metadata_generator"
"$CODE_HOME/metadata_generator" -R "$CODE_HOME" "$PWD/$preproc_file"
clang++ -I"$CODE_HOME" $arch $opts $debug -std=c++11 "$SOURCE" -shared -o custom_4coder.so -fPIC
rm "$CODE_HOME/metadata_generator"
rm $preproc_file

View File

@ -0,0 +1,30 @@
#!/bin/bash
# If any command errors, stop the script
set -e
# Store the real CWD
ME="$(realpath "$0")"
LOCATION="$(dirname "$ME")"
CODE_HOME="$(dirname "$LOCATION")"
# Find the most reasonable candidate build file
SOURCE="$1"
if [ -z "$SOURCE" ]; then
SOURCE="$(readlink -f "$CODE_HOME/4coder_default_bindings.cpp")"
fi
# NOTE(yuval): Removed -Wno-writable-strings as it is the same as -Wno-write-strings
opts="-Wno-write-strings -Wno-null-dereference -Wno-comment -Wno-switch -Wno-missing-declarations -Wno-logical-op-parentheses -g"
arch=-m32
preproc_file=4coder_command_metadata.i
meta_macros="-DMETA_PASS"
clang++ -I"$CODE_HOME" $meta_macros $arch $opts $debug -std=gnu++0x "$SOURCE" -E -o $preproc_file
clang++ -I"$CODE_HOME" $opts $debug -std=gnu++0x "$CODE_HOME/4coder_metadata_generator.cpp" -o "$CODE_HOME/metadata_generator"
"$CODE_HOME/metadata_generator" -R "$CODE_HOME" "$PWD/$preproc_file"
clang++ -I"$CODE_HOME" $arch $opts $debug -std=c++11 "$SOURCE" -shared -o custom_4coder.so -fPIC
rm "$CODE_HOME/metadata_generator"
rm $preproc_file

View File

@ -22,3 +22,10 @@ IF NOT DEFINED LIB (IF EXIST "%VC_PATH%" (call "%VC_PATH%\VC\Auxiliary\Build\vcv
SET VC_PATH=C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional
IF NOT DEFINED LIB (IF EXIST "%VC_PATH%" (call "%VC_PATH%\VC\Auxiliary\Build\vcvarsall.bat" %1))
SET VC_PATH=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
IF NOT DEFINED LIB (IF EXIST "%VC_PATH%" (call "%VC_PATH%\VC\Auxiliary\Build\vcvarsall.bat" %1))
SET VC_PATH=C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional
IF NOT DEFINED LIB (IF EXIST "%VC_PATH%" (call "%VC_PATH%\VC\Auxiliary\Build\vcvarsall.bat" %1))

View File

@ -1,212 +1,212 @@
enum{
KeyCode_A = 1,
KeyCode_B = 2,
KeyCode_C = 3,
KeyCode_D = 4,
KeyCode_E = 5,
KeyCode_F = 6,
KeyCode_G = 7,
KeyCode_H = 8,
KeyCode_I = 9,
KeyCode_J = 10,
KeyCode_K = 11,
KeyCode_L = 12,
KeyCode_M = 13,
KeyCode_N = 14,
KeyCode_O = 15,
KeyCode_P = 16,
KeyCode_Q = 17,
KeyCode_R = 18,
KeyCode_S = 19,
KeyCode_T = 20,
KeyCode_U = 21,
KeyCode_V = 22,
KeyCode_W = 23,
KeyCode_X = 24,
KeyCode_Y = 25,
KeyCode_Z = 26,
KeyCode_0 = 27,
KeyCode_1 = 28,
KeyCode_2 = 29,
KeyCode_3 = 30,
KeyCode_4 = 31,
KeyCode_5 = 32,
KeyCode_6 = 33,
KeyCode_7 = 34,
KeyCode_8 = 35,
KeyCode_9 = 36,
KeyCode_Space = 37,
KeyCode_Tick = 38,
KeyCode_Minus = 39,
KeyCode_Equal = 40,
KeyCode_LeftBracket = 41,
KeyCode_RightBracket = 42,
KeyCode_Semicolon = 43,
KeyCode_Quote = 44,
KeyCode_Comma = 45,
KeyCode_Period = 46,
KeyCode_ForwardSlash = 47,
KeyCode_BackwardSlash = 48,
KeyCode_Tab = 49,
KeyCode_Escape = 50,
KeyCode_Pause = 51,
KeyCode_Up = 52,
KeyCode_Down = 53,
KeyCode_Left = 54,
KeyCode_Right = 55,
KeyCode_Backspace = 56,
KeyCode_Return = 57,
KeyCode_Delete = 58,
KeyCode_Insert = 59,
KeyCode_Home = 60,
KeyCode_End = 61,
KeyCode_PageUp = 62,
KeyCode_PageDown = 63,
KeyCode_CapsLock = 64,
KeyCode_NumLock = 65,
KeyCode_ScrollLock = 66,
KeyCode_Menu = 67,
KeyCode_Shift = 68,
KeyCode_Control = 69,
KeyCode_Alt = 70,
KeyCode_Command = 71,
KeyCode_F1 = 72,
KeyCode_F2 = 73,
KeyCode_F3 = 74,
KeyCode_F4 = 75,
KeyCode_F5 = 76,
KeyCode_F6 = 77,
KeyCode_F7 = 78,
KeyCode_F8 = 79,
KeyCode_F9 = 80,
KeyCode_F10 = 81,
KeyCode_F11 = 82,
KeyCode_F12 = 83,
KeyCode_F13 = 84,
KeyCode_F14 = 85,
KeyCode_F15 = 86,
KeyCode_F16 = 87,
KeyCode_COUNT = 88,
KeyCode_A = 1,
KeyCode_B = 2,
KeyCode_C = 3,
KeyCode_D = 4,
KeyCode_E = 5,
KeyCode_F = 6,
KeyCode_G = 7,
KeyCode_H = 8,
KeyCode_I = 9,
KeyCode_J = 10,
KeyCode_K = 11,
KeyCode_L = 12,
KeyCode_M = 13,
KeyCode_N = 14,
KeyCode_O = 15,
KeyCode_P = 16,
KeyCode_Q = 17,
KeyCode_R = 18,
KeyCode_S = 19,
KeyCode_T = 20,
KeyCode_U = 21,
KeyCode_V = 22,
KeyCode_W = 23,
KeyCode_X = 24,
KeyCode_Y = 25,
KeyCode_Z = 26,
KeyCode_0 = 27,
KeyCode_1 = 28,
KeyCode_2 = 29,
KeyCode_3 = 30,
KeyCode_4 = 31,
KeyCode_5 = 32,
KeyCode_6 = 33,
KeyCode_7 = 34,
KeyCode_8 = 35,
KeyCode_9 = 36,
KeyCode_Space = 37,
KeyCode_Tick = 38,
KeyCode_Minus = 39,
KeyCode_Equal = 40,
KeyCode_LeftBracket = 41,
KeyCode_RightBracket = 42,
KeyCode_Semicolon = 43,
KeyCode_Quote = 44,
KeyCode_Comma = 45,
KeyCode_Period = 46,
KeyCode_ForwardSlash = 47,
KeyCode_BackwardSlash = 48,
KeyCode_Tab = 49,
KeyCode_Escape = 50,
KeyCode_Pause = 51,
KeyCode_Up = 52,
KeyCode_Down = 53,
KeyCode_Left = 54,
KeyCode_Right = 55,
KeyCode_Backspace = 56,
KeyCode_Return = 57,
KeyCode_Delete = 58,
KeyCode_Insert = 59,
KeyCode_Home = 60,
KeyCode_End = 61,
KeyCode_PageUp = 62,
KeyCode_PageDown = 63,
KeyCode_CapsLock = 64,
KeyCode_NumLock = 65,
KeyCode_ScrollLock = 66,
KeyCode_Menu = 67,
KeyCode_Shift = 68,
KeyCode_Control = 69,
KeyCode_Alt = 70,
KeyCode_Command = 71,
KeyCode_F1 = 72,
KeyCode_F2 = 73,
KeyCode_F3 = 74,
KeyCode_F4 = 75,
KeyCode_F5 = 76,
KeyCode_F6 = 77,
KeyCode_F7 = 78,
KeyCode_F8 = 79,
KeyCode_F9 = 80,
KeyCode_F10 = 81,
KeyCode_F11 = 82,
KeyCode_F12 = 83,
KeyCode_F13 = 84,
KeyCode_F14 = 85,
KeyCode_F15 = 86,
KeyCode_F16 = 87,
KeyCode_COUNT = 88,
};
global char* key_code_name[KeyCode_COUNT] = {
"None",
"A",
"B",
"C",
"D",
"E",
"F",
"G",
"H",
"I",
"J",
"K",
"L",
"M",
"N",
"O",
"P",
"Q",
"R",
"S",
"T",
"U",
"V",
"W",
"X",
"Y",
"Z",
"0",
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9",
"Space",
"Tick",
"Minus",
"Equal",
"LeftBracket",
"RightBracket",
"Semicolon",
"Quote",
"Comma",
"Period",
"ForwardSlash",
"BackwardSlash",
"Tab",
"Escape",
"Pause",
"Up",
"Down",
"Left",
"Right",
"Backspace",
"Return",
"Delete",
"Insert",
"Home",
"End",
"PageUp",
"PageDown",
"CapsLock",
"NumLock",
"ScrollLock",
"Menu",
"Shift",
"Control",
"Alt",
"Command",
"F1",
"F2",
"F3",
"F4",
"F5",
"F6",
"F7",
"F8",
"F9",
"F10",
"F11",
"F12",
"F13",
"F14",
"F15",
"F16",
"None",
"A",
"B",
"C",
"D",
"E",
"F",
"G",
"H",
"I",
"J",
"K",
"L",
"M",
"N",
"O",
"P",
"Q",
"R",
"S",
"T",
"U",
"V",
"W",
"X",
"Y",
"Z",
"0",
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9",
"Space",
"Tick",
"Minus",
"Equal",
"LeftBracket",
"RightBracket",
"Semicolon",
"Quote",
"Comma",
"Period",
"ForwardSlash",
"BackwardSlash",
"Tab",
"Escape",
"Pause",
"Up",
"Down",
"Left",
"Right",
"Backspace",
"Return",
"Delete",
"Insert",
"Home",
"End",
"PageUp",
"PageDown",
"CapsLock",
"NumLock",
"ScrollLock",
"Menu",
"Shift",
"Control",
"Alt",
"Command",
"F1",
"F2",
"F3",
"F4",
"F5",
"F6",
"F7",
"F8",
"F9",
"F10",
"F11",
"F12",
"F13",
"F14",
"F15",
"F16",
};
enum{
MouseCode_Left = 1,
MouseCode_Middle = 2,
MouseCode_Right = 3,
MouseCode_COUNT = 4,
MouseCode_Left = 1,
MouseCode_Middle = 2,
MouseCode_Right = 3,
MouseCode_COUNT = 4,
};
global char* mouse_code_name[MouseCode_COUNT] = {
"None",
"Left",
"Middle",
"Right",
"None",
"Left",
"Middle",
"Right",
};
enum{
CoreCode_Startup = 1,
CoreCode_Animate = 2,
CoreCode_ClickActivateView = 3,
CoreCode_ClickDeactivateView = 4,
CoreCode_TryExit = 5,
CoreCode_FileExternallyModified = 6,
CoreCode_NewClipboardContents = 7,
CoreCode_COUNT = 8,
CoreCode_Startup = 1,
CoreCode_Animate = 2,
CoreCode_ClickActivateView = 3,
CoreCode_ClickDeactivateView = 4,
CoreCode_TryExit = 5,
CoreCode_FileExternallyModified = 6,
CoreCode_NewClipboardContents = 7,
CoreCode_COUNT = 8,
};
global char* core_code_name[CoreCode_COUNT] = {
"None",
"Startup",
"Animate",
"ClickActivateView",
"ClickDeactivateView",
"TryExit",
"FileExternallyModified",
"NewClipboardContents",
"None",
"Startup",
"Animate",
"ClickActivateView",
"ClickDeactivateView",
"TryExit",
"FileExternallyModified",
"NewClipboardContents",
};

View File

@ -2,7 +2,7 @@
#define command_id(c) (fcoder_metacmd_ID_##c)
#define command_metadata(c) (&fcoder_metacmd_table[command_id(c)])
#define command_metadata_by_id(id) (&fcoder_metacmd_table[id])
#define command_one_past_last_id 229
#define command_one_past_last_id 231
#if defined(CUSTOM_COMMAND_SIG)
#define PROC_LINKS(x,y) x
#else
@ -99,6 +99,7 @@ CUSTOM_COMMAND_SIG(list_all_locations_of_type_definition_of_identifier);
CUSTOM_COMMAND_SIG(list_all_substring_locations);
CUSTOM_COMMAND_SIG(list_all_substring_locations_case_insensitive);
CUSTOM_COMMAND_SIG(load_project);
CUSTOM_COMMAND_SIG(load_theme_current_buffer);
CUSTOM_COMMAND_SIG(load_themes_default_folder);
CUSTOM_COMMAND_SIG(load_themes_hot_directory);
CUSTOM_COMMAND_SIG(make_directory_query);
@ -206,6 +207,7 @@ CUSTOM_COMMAND_SIG(snipe_forward_whitespace_or_token_boundary);
CUSTOM_COMMAND_SIG(snippet_lister);
CUSTOM_COMMAND_SIG(suppress_mouse);
CUSTOM_COMMAND_SIG(swap_panels);
CUSTOM_COMMAND_SIG(test_double_backspace);
CUSTOM_COMMAND_SIG(theme_lister);
CUSTOM_COMMAND_SIG(to_lowercase);
CUSTOM_COMMAND_SIG(to_uppercase);
@ -250,236 +252,238 @@ char *source_name;
i32 source_name_len;
i32 line_number;
};
static Command_Metadata fcoder_metacmd_table[229] = {
{ PROC_LINKS(allow_mouse, 0), false, "allow_mouse", 11, "Shows the mouse and causes all mouse input to be processed normally.", 68, "../code/custom/4coder_default_framework.cpp", 43, 409 },
{ PROC_LINKS(auto_indent_line_at_cursor, 0), false, "auto_indent_line_at_cursor", 26, "Auto-indents the line on which the cursor sits.", 47, "../code/custom/4coder_auto_indent.cpp", 37, 375 },
{ PROC_LINKS(auto_indent_range, 0), false, "auto_indent_range", 17, "Auto-indents the range between the cursor and the mark.", 55, "../code/custom/4coder_auto_indent.cpp", 37, 385 },
{ PROC_LINKS(auto_indent_whole_file, 0), false, "auto_indent_whole_file", 22, "Audo-indents the entire current buffer.", 39, "../code/custom/4coder_auto_indent.cpp", 37, 366 },
{ PROC_LINKS(backspace_alpha_numeric_boundary, 0), false, "backspace_alpha_numeric_boundary", 32, "Delete characters between the cursor position and the first alphanumeric boundary to the left.", 94, "../code/custom/4coder_base_commands.cpp", 39, 154 },
{ PROC_LINKS(backspace_char, 0), false, "backspace_char", 14, "Deletes the character to the left of the cursor.", 48, "../code/custom/4coder_base_commands.cpp", 39, 96 },
{ PROC_LINKS(basic_change_active_panel, 0), false, "basic_change_active_panel", 25, "Change the currently active panel, moving to the panel with the next highest view_id. Will not skipe the build panel if it is open.", 132, "../code/custom/4coder_base_commands.cpp", 39, 613 },
{ PROC_LINKS(build_in_build_panel, 0), false, "build_in_build_panel", 20, "Looks for a build.bat, build.sh, or makefile in the current and parent directories. Runs the first that it finds and prints the output to *compilation*. Puts the *compilation* buffer in a panel at the footer of the current view.", 230, "../code/custom/4coder_build_commands.cpp", 40, 165 },
{ PROC_LINKS(build_search, 0), false, "build_search", 12, "Looks for a build.bat, build.sh, or makefile in the current and parent directories. Runs the first that it finds and prints the output to *compilation*.", 153, "../code/custom/4coder_build_commands.cpp", 40, 128 },
{ PROC_LINKS(center_view, 0), false, "center_view", 11, "Centers the view vertically on the line on which the cursor sits.", 65, "../code/custom/4coder_base_commands.cpp", 39, 197 },
{ PROC_LINKS(change_active_panel, 0), false, "change_active_panel", 19, "Change the currently active panel, moving to the panel with the next highest view_id.", 85, "../code/custom/4coder_default_framework.cpp", 43, 284 },
{ PROC_LINKS(change_active_panel_backwards, 0), false, "change_active_panel_backwards", 29, "Change the currently active panel, moving to the panel with the next lowest view_id.", 84, "../code/custom/4coder_default_framework.cpp", 43, 290 },
{ PROC_LINKS(change_to_build_panel, 0), false, "change_to_build_panel", 21, "If the special build panel is open, makes the build panel the active panel.", 75, "../code/custom/4coder_build_commands.cpp", 40, 186 },
{ PROC_LINKS(clean_all_lines, 0), false, "clean_all_lines", 15, "Removes trailing whitespace from all lines in the current buffer.", 65, "../code/custom/4coder_base_commands.cpp", 39, 578 },
{ PROC_LINKS(clear_all_themes, 0), false, "clear_all_themes", 16, "Clear the theme list", 20, "../code/custom/4coder_default_framework.cpp", 43, 480 },
{ PROC_LINKS(click_set_cursor, 0), false, "click_set_cursor", 16, "Sets the cursor position to the mouse position.", 47, "../code/custom/4coder_base_commands.cpp", 39, 233 },
{ PROC_LINKS(click_set_cursor_and_mark, 0), false, "click_set_cursor_and_mark", 25, "Sets the cursor position and mark to the mouse position.", 56, "../code/custom/4coder_base_commands.cpp", 39, 223 },
{ PROC_LINKS(click_set_cursor_if_lbutton, 0), false, "click_set_cursor_if_lbutton", 27, "If the mouse left button is pressed, sets the cursor position to the mouse position.", 84, "../code/custom/4coder_base_commands.cpp", 39, 243 },
{ PROC_LINKS(click_set_mark, 0), false, "click_set_mark", 14, "Sets the mark position to the mouse position.", 45, "../code/custom/4coder_base_commands.cpp", 39, 255 },
{ PROC_LINKS(close_all_code, 0), false, "close_all_code", 14, "Closes any buffer with a filename ending with an extension configured to be recognized as a code file type.", 107, "../code/custom/4coder_project_commands.cpp", 42, 842 },
{ PROC_LINKS(close_build_panel, 0), false, "close_build_panel", 17, "If the special build panel is open, closes it.", 46, "../code/custom/4coder_build_commands.cpp", 40, 180 },
{ PROC_LINKS(close_panel, 0), false, "close_panel", 11, "Closes the currently active panel if it is not the only panel open.", 67, "../code/custom/4coder_base_commands.cpp", 39, 621 },
{ PROC_LINKS(command_documentation, 0), true, "command_documentation", 21, "Prompts the user to select a command then loads a doc buffer for that item", 74, "../code/custom/4coder_docs.cpp", 30, 190 },
{ PROC_LINKS(command_lister, 0), true, "command_lister", 14, "Opens an interactive list of all registered commands.", 53, "../code/custom/4coder_lists.cpp", 31, 668 },
{ PROC_LINKS(comment_line, 0), false, "comment_line", 12, "Insert '//' at the beginning of the line after leading whitespace.", 66, "../code/custom/4coder_combined_write_commands.cpp", 49, 125 },
{ PROC_LINKS(comment_line_toggle, 0), false, "comment_line_toggle", 19, "Turns uncommented lines into commented lines and vice versa for comments starting with '//'.", 92, "../code/custom/4coder_combined_write_commands.cpp", 49, 149 },
{ PROC_LINKS(copy, 0), false, "copy", 4, "Copy the text in the range from the cursor to the mark onto the clipboard.", 74, "../code/custom/4coder_clipboard.cpp", 35, 19 },
{ PROC_LINKS(cursor_mark_swap, 0), false, "cursor_mark_swap", 16, "Swaps the position of the cursor and the mark.", 46, "../code/custom/4coder_base_commands.cpp", 39, 124 },
{ PROC_LINKS(custom_api_documentation, 0), true, "custom_api_documentation", 24, "Prompts the user to select a Custom API item then loads a doc buffer for that item", 82, "../code/custom/4coder_docs.cpp", 30, 175 },
{ PROC_LINKS(cut, 0), false, "cut", 3, "Cut the text in the range from the cursor to the mark onto the clipboard.", 73, "../code/custom/4coder_clipboard.cpp", 35, 28 },
{ PROC_LINKS(decrease_face_size, 0), false, "decrease_face_size", 18, "Decrease the size of the face used by the current buffer.", 57, "../code/custom/4coder_base_commands.cpp", 39, 684 },
{ PROC_LINKS(default_file_externally_modified, 0), false, "default_file_externally_modified", 32, "Notes the external modification of attached files by printing a message.", 72, "../code/custom/4coder_base_commands.cpp", 39, 1798 },
{ PROC_LINKS(default_startup, 0), false, "default_startup", 15, "Default command for responding to a startup event", 49, "../code/custom/4coder_default_hooks.cpp", 39, 7 },
{ PROC_LINKS(default_try_exit, 0), false, "default_try_exit", 16, "Default command for responding to a try-exit event", 50, "../code/custom/4coder_default_hooks.cpp", 39, 23 },
{ PROC_LINKS(default_view_input_handler, 0), false, "default_view_input_handler", 26, "Input consumption loop for default view behavior", 48, "../code/custom/4coder_default_hooks.cpp", 39, 57 },
{ PROC_LINKS(delete_alpha_numeric_boundary, 0), false, "delete_alpha_numeric_boundary", 29, "Delete characters between the cursor position and the first alphanumeric boundary to the right.", 95, "../code/custom/4coder_base_commands.cpp", 39, 162 },
{ PROC_LINKS(delete_char, 0), false, "delete_char", 11, "Deletes the character to the right of the cursor.", 49, "../code/custom/4coder_base_commands.cpp", 39, 79 },
{ PROC_LINKS(delete_current_scope, 0), false, "delete_current_scope", 20, "Deletes the braces surrounding the currently selected scope. Leaves the contents within the scope.", 99, "../code/custom/4coder_scope_commands.cpp", 40, 112 },
{ PROC_LINKS(delete_file_query, 0), false, "delete_file_query", 17, "Deletes the file of the current buffer if 4coder has the appropriate access rights. Will ask the user for confirmation first.", 125, "../code/custom/4coder_base_commands.cpp", 39, 1221 },
{ PROC_LINKS(delete_line, 0), false, "delete_line", 11, "Delete the line the on which the cursor sits.", 45, "../code/custom/4coder_base_commands.cpp", 39, 1396 },
{ PROC_LINKS(delete_range, 0), false, "delete_range", 12, "Deletes the text in the range between the cursor and the mark.", 62, "../code/custom/4coder_base_commands.cpp", 39, 134 },
{ PROC_LINKS(duplicate_line, 0), false, "duplicate_line", 14, "Create a copy of the line on which the cursor sits.", 51, "../code/custom/4coder_base_commands.cpp", 39, 1382 },
{ PROC_LINKS(execute_any_cli, 0), false, "execute_any_cli", 15, "Queries for an output buffer name and system command, runs the system command as a CLI and prints the output to the specified buffer.", 133, "../code/custom/4coder_cli_command.cpp", 37, 22 },
{ PROC_LINKS(execute_previous_cli, 0), false, "execute_previous_cli", 20, "If the command execute_any_cli has already been used, this will execute a CLI reusing the most recent buffer name and command.", 126, "../code/custom/4coder_cli_command.cpp", 37, 7 },
{ PROC_LINKS(exit_4coder, 0), false, "exit_4coder", 11, "Attempts to close 4coder.", 25, "../code/custom/4coder_base_commands.cpp", 39, 740 },
{ PROC_LINKS(goto_beginning_of_file, 0), false, "goto_beginning_of_file", 22, "Sets the cursor to the beginning of the file.", 45, "../code/custom/4coder_helper.cpp", 32, 2184 },
{ PROC_LINKS(goto_end_of_file, 0), false, "goto_end_of_file", 16, "Sets the cursor to the end of the file.", 39, "../code/custom/4coder_helper.cpp", 32, 2192 },
{ PROC_LINKS(goto_first_jump, 0), false, "goto_first_jump", 15, "If a buffer containing jump locations has been locked in, goes to the first jump in the buffer.", 95, "../code/custom/4coder_jump_sticky.cpp", 37, 523 },
{ PROC_LINKS(goto_first_jump_same_panel_sticky, 0), false, "goto_first_jump_same_panel_sticky", 33, "If a buffer containing jump locations has been locked in, goes to the first jump in the buffer and views the buffer in the panel where the jump list was.", 153, "../code/custom/4coder_jump_sticky.cpp", 37, 540 },
{ PROC_LINKS(goto_jump_at_cursor, 0), false, "goto_jump_at_cursor", 19, "If the cursor is found to be on a jump location, parses the jump location and brings up the file and position in another view and changes the active panel to the view containing the jump.", 187, "../code/custom/4coder_jump_sticky.cpp", 37, 346 },
{ PROC_LINKS(goto_jump_at_cursor_same_panel, 0), false, "goto_jump_at_cursor_same_panel", 30, "If the cursor is found to be on a jump location, parses the jump location and brings up the file and position in this view, losing the compilation output or jump list.", 167, "../code/custom/4coder_jump_sticky.cpp", 37, 373 },
{ PROC_LINKS(goto_line, 0), false, "goto_line", 9, "Queries the user for a number, and jumps the cursor to the corresponding line.", 78, "../code/custom/4coder_base_commands.cpp", 39, 748 },
{ PROC_LINKS(goto_next_jump, 0), false, "goto_next_jump", 14, "If a buffer containing jump locations has been locked in, goes to the next jump in the buffer, skipping sub jump locations.", 123, "../code/custom/4coder_jump_sticky.cpp", 37, 462 },
{ PROC_LINKS(goto_next_jump_no_skips, 0), false, "goto_next_jump_no_skips", 23, "If a buffer containing jump locations has been locked in, goes to the next jump in the buffer, and does not skip sub jump locations.", 132, "../code/custom/4coder_jump_sticky.cpp", 37, 492 },
{ PROC_LINKS(goto_prev_jump, 0), false, "goto_prev_jump", 14, "If a buffer containing jump locations has been locked in, goes to the previous jump in the buffer, skipping sub jump locations.", 127, "../code/custom/4coder_jump_sticky.cpp", 37, 479 },
{ PROC_LINKS(goto_prev_jump_no_skips, 0), false, "goto_prev_jump_no_skips", 23, "If a buffer containing jump locations has been locked in, goes to the previous jump in the buffer, and does not skip sub jump locations.", 136, "../code/custom/4coder_jump_sticky.cpp", 37, 509 },
{ PROC_LINKS(hide_filebar, 0), false, "hide_filebar", 12, "Sets the current view to hide it's filebar.", 43, "../code/custom/4coder_base_commands.cpp", 39, 651 },
{ PROC_LINKS(hide_scrollbar, 0), false, "hide_scrollbar", 14, "Sets the current view to hide it's scrollbar.", 45, "../code/custom/4coder_base_commands.cpp", 39, 637 },
{ PROC_LINKS(hms_demo_tutorial, 0), false, "hms_demo_tutorial", 17, "Tutorial for built in 4coder bindings and features.", 51, "../code/custom/4coder_tutorial.cpp", 34, 869 },
{ PROC_LINKS(if0_off, 0), false, "if0_off", 7, "Surround the range between the cursor and mark with an '#if 0' and an '#endif'", 78, "../code/custom/4coder_combined_write_commands.cpp", 49, 70 },
{ PROC_LINKS(if_read_only_goto_position, 0), false, "if_read_only_goto_position", 26, "If the buffer in the active view is writable, inserts a character, otherwise performs goto_jump_at_cursor.", 106, "../code/custom/4coder_jump_sticky.cpp", 37, 562 },
{ PROC_LINKS(if_read_only_goto_position_same_panel, 0), false, "if_read_only_goto_position_same_panel", 37, "If the buffer in the active view is writable, inserts a character, otherwise performs goto_jump_at_cursor_same_panel.", 117, "../code/custom/4coder_jump_sticky.cpp", 37, 579 },
{ PROC_LINKS(increase_face_size, 0), false, "increase_face_size", 18, "Increase the size of the face used by the current buffer.", 57, "../code/custom/4coder_base_commands.cpp", 39, 673 },
{ PROC_LINKS(interactive_kill_buffer, 0), true, "interactive_kill_buffer", 23, "Interactively kill an open buffer.", 34, "../code/custom/4coder_lists.cpp", 31, 515 },
{ PROC_LINKS(interactive_new, 0), true, "interactive_new", 15, "Interactively creates a new file.", 33, "../code/custom/4coder_lists.cpp", 31, 597 },
{ PROC_LINKS(interactive_open, 0), true, "interactive_open", 16, "Interactively opens a file.", 27, "../code/custom/4coder_lists.cpp", 31, 634 },
{ PROC_LINKS(interactive_open_or_new, 0), true, "interactive_open_or_new", 23, "Interactively open a file out of the file system.", 49, "../code/custom/4coder_lists.cpp", 31, 563 },
{ PROC_LINKS(interactive_switch_buffer, 0), true, "interactive_switch_buffer", 25, "Interactively switch to an open buffer.", 39, "../code/custom/4coder_lists.cpp", 31, 505 },
{ PROC_LINKS(jump_to_definition, 0), true, "jump_to_definition", 18, "List all definitions in the code index and jump to one chosen by the user.", 74, "../code/custom/4coder_code_index_listers.cpp", 44, 12 },
{ PROC_LINKS(keyboard_macro_finish_recording, 0), false, "keyboard_macro_finish_recording", 31, "Stop macro recording, do nothing if macro recording is not already started", 74, "../code/custom/4coder_keyboard_macro.cpp", 40, 57 },
{ PROC_LINKS(keyboard_macro_replay, 0), false, "keyboard_macro_replay", 21, "Replay the most recently recorded keyboard macro", 48, "../code/custom/4coder_keyboard_macro.cpp", 40, 80 },
{ PROC_LINKS(keyboard_macro_start_recording, 0), false, "keyboard_macro_start_recording", 30, "Start macro recording, do nothing if macro recording is already started", 71, "../code/custom/4coder_keyboard_macro.cpp", 40, 44 },
{ PROC_LINKS(kill_buffer, 0), false, "kill_buffer", 11, "Kills the current buffer.", 25, "../code/custom/4coder_base_commands.cpp", 39, 1542 },
{ PROC_LINKS(kill_tutorial, 0), false, "kill_tutorial", 13, "If there is an active tutorial, kill it.", 40, "../code/custom/4coder_tutorial.cpp", 34, 9 },
{ PROC_LINKS(left_adjust_view, 0), false, "left_adjust_view", 16, "Sets the left size of the view near the x position of the cursor.", 65, "../code/custom/4coder_base_commands.cpp", 39, 211 },
{ PROC_LINKS(list_all_functions_all_buffers, 0), false, "list_all_functions_all_buffers", 30, "Creates a jump list of lines from all buffers that appear to define or declare functions.", 89, "../code/custom/4coder_function_list.cpp", 39, 295 },
{ PROC_LINKS(list_all_functions_all_buffers_lister, 0), false, "list_all_functions_all_buffers_lister", 37, "Creates a lister of locations that look like function definitions and declarations all buffers.", 95, "../code/custom/4coder_function_list.cpp", 39, 301 },
{ PROC_LINKS(list_all_functions_current_buffer, 0), false, "list_all_functions_current_buffer", 33, "Creates a jump list of lines of the current buffer that appear to define or declare functions.", 94, "../code/custom/4coder_function_list.cpp", 39, 267 },
{ PROC_LINKS(list_all_functions_current_buffer_lister, 0), false, "list_all_functions_current_buffer_lister", 40, "Creates a lister of locations that look like function definitions and declarations in the buffer.", 97, "../code/custom/4coder_function_list.cpp", 39, 277 },
{ PROC_LINKS(list_all_locations, 0), false, "list_all_locations", 18, "Queries the user for a string and lists all exact case-sensitive matches found in all open buffers.", 99, "../code/custom/4coder_search.cpp", 32, 162 },
{ PROC_LINKS(list_all_locations_case_insensitive, 0), false, "list_all_locations_case_insensitive", 35, "Queries the user for a string and lists all exact case-insensitive matches found in all open buffers.", 101, "../code/custom/4coder_search.cpp", 32, 174 },
{ PROC_LINKS(list_all_locations_of_identifier, 0), false, "list_all_locations_of_identifier", 32, "Reads a token or word under the cursor and lists all exact case-sensitive mathces in all open buffers.", 102, "../code/custom/4coder_search.cpp", 32, 186 },
{ PROC_LINKS(list_all_locations_of_identifier_case_insensitive, 0), false, "list_all_locations_of_identifier_case_insensitive", 49, "Reads a token or word under the cursor and lists all exact case-insensitive mathces in all open buffers.", 104, "../code/custom/4coder_search.cpp", 32, 192 },
{ PROC_LINKS(list_all_locations_of_selection, 0), false, "list_all_locations_of_selection", 31, "Reads the string in the selected range and lists all exact case-sensitive mathces in all open buffers.", 102, "../code/custom/4coder_search.cpp", 32, 198 },
{ PROC_LINKS(list_all_locations_of_selection_case_insensitive, 0), false, "list_all_locations_of_selection_case_insensitive", 48, "Reads the string in the selected range and lists all exact case-insensitive mathces in all open buffers.", 104, "../code/custom/4coder_search.cpp", 32, 204 },
{ PROC_LINKS(list_all_locations_of_type_definition, 0), false, "list_all_locations_of_type_definition", 37, "Queries user for string, lists all locations of strings that appear to define a type whose name matches the input string.", 121, "../code/custom/4coder_search.cpp", 32, 210 },
{ PROC_LINKS(list_all_locations_of_type_definition_of_identifier, 0), false, "list_all_locations_of_type_definition_of_identifier", 51, "Reads a token or word under the cursor and lists all locations of strings that appear to define a type whose name matches it.", 125, "../code/custom/4coder_search.cpp", 32, 218 },
{ PROC_LINKS(list_all_substring_locations, 0), false, "list_all_substring_locations", 28, "Queries the user for a string and lists all case-sensitive substring matches found in all open buffers.", 103, "../code/custom/4coder_search.cpp", 32, 168 },
{ PROC_LINKS(list_all_substring_locations_case_insensitive, 0), false, "list_all_substring_locations_case_insensitive", 45, "Queries the user for a string and lists all case-insensitive substring matches found in all open buffers.", 105, "../code/custom/4coder_search.cpp", 32, 180 },
{ PROC_LINKS(load_project, 0), false, "load_project", 12, "Looks for a project.4coder file in the current directory and tries to load it. Looks in parent directories until a project file is found or there are no more parents.", 167, "../code/custom/4coder_project_commands.cpp", 42, 862 },
{ PROC_LINKS(load_themes_default_folder, 0), false, "load_themes_default_folder", 26, "Loads all the theme files in the default theme folder.", 54, "../code/custom/4coder_default_framework.cpp", 43, 457 },
{ PROC_LINKS(load_themes_hot_directory, 0), false, "load_themes_hot_directory", 25, "Loads all the theme files in the current hot directory.", 55, "../code/custom/4coder_default_framework.cpp", 43, 469 },
{ PROC_LINKS(make_directory_query, 0), false, "make_directory_query", 20, "Queries the user for a name and creates a new directory with the given name.", 76, "../code/custom/4coder_base_commands.cpp", 39, 1336 },
{ PROC_LINKS(miblo_decrement_basic, 0), false, "miblo_decrement_basic", 21, "Decrement an integer under the cursor by one.", 45, "../code/custom/4coder_miblo_numbers.cpp", 39, 44 },
{ PROC_LINKS(miblo_decrement_time_stamp, 0), false, "miblo_decrement_time_stamp", 26, "Decrement a time stamp under the cursor by one second. (format [m]m:ss or h:mm:ss", 81, "../code/custom/4coder_miblo_numbers.cpp", 39, 237 },
{ PROC_LINKS(miblo_decrement_time_stamp_minute, 0), false, "miblo_decrement_time_stamp_minute", 33, "Decrement a time stamp under the cursor by one minute. (format [m]m:ss or h:mm:ss", 81, "../code/custom/4coder_miblo_numbers.cpp", 39, 249 },
{ PROC_LINKS(miblo_increment_basic, 0), false, "miblo_increment_basic", 21, "Increment an integer under the cursor by one.", 45, "../code/custom/4coder_miblo_numbers.cpp", 39, 29 },
{ PROC_LINKS(miblo_increment_time_stamp, 0), false, "miblo_increment_time_stamp", 26, "Increment a time stamp under the cursor by one second. (format [m]m:ss or h:mm:ss", 81, "../code/custom/4coder_miblo_numbers.cpp", 39, 231 },
{ PROC_LINKS(miblo_increment_time_stamp_minute, 0), false, "miblo_increment_time_stamp_minute", 33, "Increment a time stamp under the cursor by one minute. (format [m]m:ss or h:mm:ss", 81, "../code/custom/4coder_miblo_numbers.cpp", 39, 243 },
{ PROC_LINKS(mouse_wheel_change_face_size, 0), false, "mouse_wheel_change_face_size", 28, "Reads the state of the mouse wheel and uses it to either increase or decrease the face size.", 92, "../code/custom/4coder_base_commands.cpp", 39, 695 },
{ PROC_LINKS(mouse_wheel_scroll, 0), false, "mouse_wheel_scroll", 18, "Reads the scroll wheel value from the mouse state and scrolls accordingly.", 74, "../code/custom/4coder_base_commands.cpp", 39, 265 },
{ PROC_LINKS(move_down, 0), false, "move_down", 9, "Moves the cursor down one line.", 31, "../code/custom/4coder_base_commands.cpp", 39, 338 },
{ PROC_LINKS(move_down_10, 0), false, "move_down_10", 12, "Moves the cursor down ten lines.", 32, "../code/custom/4coder_base_commands.cpp", 39, 350 },
{ PROC_LINKS(move_down_textual, 0), false, "move_down_textual", 17, "Moves down to the next line of actual text, regardless of line wrapping.", 72, "../code/custom/4coder_base_commands.cpp", 39, 356 },
{ PROC_LINKS(move_down_to_blank_line, 0), false, "move_down_to_blank_line", 23, "Seeks the cursor down to the next blank line.", 45, "../code/custom/4coder_base_commands.cpp", 39, 409 },
{ PROC_LINKS(move_down_to_blank_line_end, 0), false, "move_down_to_blank_line_end", 27, "Seeks the cursor down to the next blank line and places it at the end of the line.", 82, "../code/custom/4coder_base_commands.cpp", 39, 433 },
{ PROC_LINKS(move_down_to_blank_line_skip_whitespace, 0), false, "move_down_to_blank_line_skip_whitespace", 39, "Seeks the cursor down to the next blank line and places it at the end of the line.", 82, "../code/custom/4coder_base_commands.cpp", 39, 421 },
{ PROC_LINKS(move_left, 0), false, "move_left", 9, "Moves the cursor one character to the left.", 43, "../code/custom/4coder_base_commands.cpp", 39, 439 },
{ PROC_LINKS(move_left_alpha_numeric_boundary, 0), false, "move_left_alpha_numeric_boundary", 32, "Seek left for boundary between alphanumeric characters and non-alphanumeric characters.", 87, "../code/custom/4coder_base_commands.cpp", 39, 516 },
{ PROC_LINKS(move_left_alpha_numeric_or_camel_boundary, 0), false, "move_left_alpha_numeric_or_camel_boundary", 41, "Seek left for boundary between alphanumeric characters or camel case word and non-alphanumeric characters.", 106, "../code/custom/4coder_base_commands.cpp", 39, 530 },
{ PROC_LINKS(move_left_token_boundary, 0), false, "move_left_token_boundary", 24, "Seek left for the next beginning of a token.", 44, "../code/custom/4coder_base_commands.cpp", 39, 488 },
{ PROC_LINKS(move_left_whitespace_boundary, 0), false, "move_left_whitespace_boundary", 29, "Seek left for the next boundary between whitespace and non-whitespace.", 70, "../code/custom/4coder_base_commands.cpp", 39, 473 },
{ PROC_LINKS(move_left_whitespace_or_token_boundary, 0), false, "move_left_whitespace_or_token_boundary", 38, "Seek left for the next end of a token or boundary between whitespace and non-whitespace.", 88, "../code/custom/4coder_base_commands.cpp", 39, 502 },
{ PROC_LINKS(move_line_down, 0), false, "move_line_down", 14, "Swaps the line under the cursor with the line below it, and moves the cursor down with it.", 90, "../code/custom/4coder_base_commands.cpp", 39, 1376 },
{ PROC_LINKS(move_line_up, 0), false, "move_line_up", 12, "Swaps the line under the cursor with the line above it, and moves the cursor up with it.", 88, "../code/custom/4coder_base_commands.cpp", 39, 1370 },
{ PROC_LINKS(move_right, 0), false, "move_right", 10, "Moves the cursor one character to the right.", 44, "../code/custom/4coder_base_commands.cpp", 39, 447 },
{ PROC_LINKS(move_right_alpha_numeric_boundary, 0), false, "move_right_alpha_numeric_boundary", 33, "Seek right for boundary between alphanumeric characters and non-alphanumeric characters.", 88, "../code/custom/4coder_base_commands.cpp", 39, 509 },
{ PROC_LINKS(move_right_alpha_numeric_or_camel_boundary, 0), false, "move_right_alpha_numeric_or_camel_boundary", 42, "Seek right for boundary between alphanumeric characters or camel case word and non-alphanumeric characters.", 107, "../code/custom/4coder_base_commands.cpp", 39, 523 },
{ PROC_LINKS(move_right_token_boundary, 0), false, "move_right_token_boundary", 25, "Seek right for the next end of a token.", 39, "../code/custom/4coder_base_commands.cpp", 39, 481 },
{ PROC_LINKS(move_right_whitespace_boundary, 0), false, "move_right_whitespace_boundary", 30, "Seek right for the next boundary between whitespace and non-whitespace.", 71, "../code/custom/4coder_base_commands.cpp", 39, 465 },
{ PROC_LINKS(move_right_whitespace_or_token_boundary, 0), false, "move_right_whitespace_or_token_boundary", 39, "Seek right for the next end of a token or boundary between whitespace and non-whitespace.", 89, "../code/custom/4coder_base_commands.cpp", 39, 495 },
{ PROC_LINKS(move_up, 0), false, "move_up", 7, "Moves the cursor up one line.", 29, "../code/custom/4coder_base_commands.cpp", 39, 332 },
{ PROC_LINKS(move_up_10, 0), false, "move_up_10", 10, "Moves the cursor up ten lines.", 30, "../code/custom/4coder_base_commands.cpp", 39, 344 },
{ PROC_LINKS(move_up_to_blank_line, 0), false, "move_up_to_blank_line", 21, "Seeks the cursor up to the next blank line.", 43, "../code/custom/4coder_base_commands.cpp", 39, 403 },
{ PROC_LINKS(move_up_to_blank_line_end, 0), false, "move_up_to_blank_line_end", 25, "Seeks the cursor up to the next blank line and places it at the end of the line.", 80, "../code/custom/4coder_base_commands.cpp", 39, 427 },
{ PROC_LINKS(move_up_to_blank_line_skip_whitespace, 0), false, "move_up_to_blank_line_skip_whitespace", 37, "Seeks the cursor up to the next blank line and places it at the end of the line.", 80, "../code/custom/4coder_base_commands.cpp", 39, 415 },
{ PROC_LINKS(open_all_code, 0), false, "open_all_code", 13, "Open all code in the current directory. File types are determined by extensions. An extension is considered code based on the extensions specified in 4coder.config.", 164, "../code/custom/4coder_project_commands.cpp", 42, 848 },
{ PROC_LINKS(open_all_code_recursive, 0), false, "open_all_code_recursive", 23, "Works as open_all_code but also runs in all subdirectories.", 59, "../code/custom/4coder_project_commands.cpp", 42, 854 },
{ PROC_LINKS(open_file_in_quotes, 0), false, "open_file_in_quotes", 19, "Reads a filename from surrounding '\"' characters and attempts to open the corresponding file.", 94, "../code/custom/4coder_base_commands.cpp", 39, 1461 },
{ PROC_LINKS(open_in_other, 0), false, "open_in_other", 13, "Interactively opens a file in the other panel.", 46, "../code/custom/4coder_base_commands.cpp", 39, 1792 },
{ PROC_LINKS(open_long_braces, 0), false, "open_long_braces", 16, "At the cursor, insert a '{' and '}' separated by a blank line.", 62, "../code/custom/4coder_combined_write_commands.cpp", 49, 46 },
{ PROC_LINKS(open_long_braces_break, 0), false, "open_long_braces_break", 22, "At the cursor, insert a '{' and '}break;' separated by a blank line.", 68, "../code/custom/4coder_combined_write_commands.cpp", 49, 62 },
{ PROC_LINKS(open_long_braces_semicolon, 0), false, "open_long_braces_semicolon", 26, "At the cursor, insert a '{' and '};' separated by a blank line.", 63, "../code/custom/4coder_combined_write_commands.cpp", 49, 54 },
{ PROC_LINKS(open_matching_file_cpp, 0), false, "open_matching_file_cpp", 22, "If the current file is a *.cpp or *.h, attempts to open the corresponding *.h or *.cpp file in the other view.", 110, "../code/custom/4coder_base_commands.cpp", 39, 1493 },
{ PROC_LINKS(open_panel_hsplit, 0), false, "open_panel_hsplit", 17, "Create a new panel by horizontally splitting the active panel.", 62, "../code/custom/4coder_default_framework.cpp", 43, 310 },
{ PROC_LINKS(open_panel_vsplit, 0), false, "open_panel_vsplit", 17, "Create a new panel by vertically splitting the active panel.", 60, "../code/custom/4coder_default_framework.cpp", 43, 300 },
{ PROC_LINKS(page_down, 0), false, "page_down", 9, "Scrolls the view down one view height and moves the cursor down one view height.", 80, "../code/custom/4coder_base_commands.cpp", 39, 374 },
{ PROC_LINKS(page_up, 0), false, "page_up", 7, "Scrolls the view up one view height and moves the cursor up one view height.", 76, "../code/custom/4coder_base_commands.cpp", 39, 366 },
{ PROC_LINKS(paste, 0), false, "paste", 5, "At the cursor, insert the text at the top of the clipboard.", 59, "../code/custom/4coder_clipboard.cpp", 35, 39 },
{ PROC_LINKS(paste_and_indent, 0), false, "paste_and_indent", 16, "Paste from the top of clipboard and run auto-indent on the newly pasted text.", 77, "../code/custom/4coder_clipboard.cpp", 35, 110 },
{ PROC_LINKS(paste_next, 0), false, "paste_next", 10, "If the previous command was paste or paste_next, replaces the paste range with the next text down on the clipboard, otherwise operates as the paste command.", 156, "../code/custom/4coder_clipboard.cpp", 35, 71 },
{ PROC_LINKS(paste_next_and_indent, 0), false, "paste_next_and_indent", 21, "Paste the next item on the clipboard and run auto-indent on the newly pasted text.", 82, "../code/custom/4coder_clipboard.cpp", 35, 117 },
{ PROC_LINKS(place_in_scope, 0), false, "place_in_scope", 14, "Wraps the code contained in the range between cursor and mark with a new curly brace scope.", 91, "../code/custom/4coder_scope_commands.cpp", 40, 106 },
{ PROC_LINKS(profile_clear, 0), false, "profile_clear", 13, "Clear all profiling information from 4coder's self profiler.", 60, "../code/custom/4coder_profile.cpp", 33, 226 },
{ PROC_LINKS(profile_disable, 0), false, "profile_disable", 15, "Prevent 4coder's self profiler from gathering new profiling information.", 72, "../code/custom/4coder_profile.cpp", 33, 219 },
{ PROC_LINKS(profile_enable, 0), false, "profile_enable", 14, "Allow 4coder's self profiler to gather new profiling information.", 65, "../code/custom/4coder_profile.cpp", 33, 212 },
{ PROC_LINKS(profile_inspect, 0), true, "profile_inspect", 15, "Inspect all currently collected profiling information in 4coder's self profiler.", 80, "../code/custom/4coder_profile_inspect.cpp", 41, 886 },
{ PROC_LINKS(project_command_lister, 0), false, "project_command_lister", 22, "Open a lister of all commands in the currently loaded project.", 62, "../code/custom/4coder_project_commands.cpp", 42, 1289 },
{ PROC_LINKS(project_fkey_command, 0), false, "project_fkey_command", 20, "Run an 'fkey command' configured in a project.4coder file. Determines the index of the 'fkey command' by which function key or numeric key was pressed to trigger the command.", 175, "../code/custom/4coder_project_commands.cpp", 42, 870 },
{ PROC_LINKS(project_go_to_root_directory, 0), false, "project_go_to_root_directory", 28, "Changes 4coder's hot directory to the root directory of the currently loaded project. With no loaded project nothing hapepns.", 125, "../code/custom/4coder_project_commands.cpp", 42, 896 },
{ PROC_LINKS(query_replace, 0), false, "query_replace", 13, "Queries the user for two strings, and incrementally replaces every occurence of the first string with the second string.", 120, "../code/custom/4coder_base_commands.cpp", 39, 1149 },
{ PROC_LINKS(query_replace_identifier, 0), false, "query_replace_identifier", 24, "Queries the user for a string, and incrementally replace every occurence of the word or token found at the cursor with the specified string.", 140, "../code/custom/4coder_base_commands.cpp", 39, 1170 },
{ PROC_LINKS(query_replace_selection, 0), false, "query_replace_selection", 23, "Queries the user for a string, and incrementally replace every occurence of the string found in the selected range with the specified string.", 141, "../code/custom/4coder_base_commands.cpp", 39, 1186 },
{ PROC_LINKS(redo, 0), false, "redo", 4, "Advances forwards through the undo history of the current buffer.", 65, "../code/custom/4coder_base_commands.cpp", 39, 1631 },
{ PROC_LINKS(redo_all_buffers, 0), false, "redo_all_buffers", 16, "Advances forward through the undo history in the buffer containing the most recent regular edit.", 96, "../code/custom/4coder_base_commands.cpp", 39, 1716 },
{ PROC_LINKS(rename_file_query, 0), false, "rename_file_query", 17, "Queries the user for a new name and renames the file of the current buffer, altering the buffer's name too.", 107, "../code/custom/4coder_base_commands.cpp", 39, 1298 },
{ PROC_LINKS(reopen, 0), false, "reopen", 6, "Reopen the current buffer from the hard drive.", 46, "../code/custom/4coder_base_commands.cpp", 39, 1560 },
{ PROC_LINKS(replace_in_all_buffers, 0), false, "replace_in_all_buffers", 22, "Queries the user for a needle and string. Replaces all occurences of needle with string in all editable buffers.", 112, "../code/custom/4coder_base_commands.cpp", 39, 1059 },
{ PROC_LINKS(replace_in_buffer, 0), false, "replace_in_buffer", 17, "Queries the user for a needle and string. Replaces all occurences of needle with string in the active buffer.", 109, "../code/custom/4coder_base_commands.cpp", 39, 1050 },
{ PROC_LINKS(replace_in_range, 0), false, "replace_in_range", 16, "Queries the user for a needle and string. Replaces all occurences of needle with string in the range between cursor and the mark in the active buffer.", 150, "../code/custom/4coder_base_commands.cpp", 39, 1041 },
{ PROC_LINKS(reverse_search, 0), false, "reverse_search", 14, "Begins an incremental search up through the current buffer for a user specified string.", 87, "../code/custom/4coder_base_commands.cpp", 39, 982 },
{ PROC_LINKS(reverse_search_identifier, 0), false, "reverse_search_identifier", 25, "Begins an incremental search up through the current buffer for the word or token under the cursor.", 98, "../code/custom/4coder_base_commands.cpp", 39, 994 },
{ PROC_LINKS(save, 0), false, "save", 4, "Saves the current buffer.", 25, "../code/custom/4coder_base_commands.cpp", 39, 1550 },
{ PROC_LINKS(save_all_dirty_buffers, 0), false, "save_all_dirty_buffers", 22, "Saves all buffers marked dirty (showing the '*' indicator).", 59, "../code/custom/4coder_default_framework.cpp", 43, 382 },
{ PROC_LINKS(save_to_query, 0), false, "save_to_query", 13, "Queries the user for a file name and saves the contents of the current buffer, altering the buffer's name too.", 110, "../code/custom/4coder_base_commands.cpp", 39, 1265 },
{ PROC_LINKS(search, 0), false, "search", 6, "Begins an incremental search down through the current buffer for a user specified string.", 89, "../code/custom/4coder_base_commands.cpp", 39, 976 },
{ PROC_LINKS(search_identifier, 0), false, "search_identifier", 17, "Begins an incremental search down through the current buffer for the word or token under the cursor.", 100, "../code/custom/4coder_base_commands.cpp", 39, 988 },
{ PROC_LINKS(seek_beginning_of_line, 0), false, "seek_beginning_of_line", 22, "Seeks the cursor to the beginning of the visual line.", 53, "../code/custom/4coder_helper.cpp", 32, 2172 },
{ PROC_LINKS(seek_beginning_of_textual_line, 0), false, "seek_beginning_of_textual_line", 30, "Seeks the cursor to the beginning of the line across all text.", 62, "../code/custom/4coder_helper.cpp", 32, 2160 },
{ PROC_LINKS(seek_end_of_line, 0), false, "seek_end_of_line", 16, "Seeks the cursor to the end of the visual line.", 47, "../code/custom/4coder_helper.cpp", 32, 2178 },
{ PROC_LINKS(seek_end_of_textual_line, 0), false, "seek_end_of_textual_line", 24, "Seeks the cursor to the end of the line across all text.", 56, "../code/custom/4coder_helper.cpp", 32, 2166 },
{ PROC_LINKS(select_all, 0), false, "select_all", 10, "Puts the cursor at the top of the file, and the mark at the bottom of the file.", 79, "../code/custom/4coder_base_commands.cpp", 39, 539 },
{ PROC_LINKS(select_next_scope_absolute, 0), false, "select_next_scope_absolute", 26, "Finds the first scope started by '{' after the cursor and puts the cursor and mark on the '{' and '}'.", 102, "../code/custom/4coder_scope_commands.cpp", 40, 57 },
{ PROC_LINKS(select_next_scope_after_current, 0), false, "select_next_scope_after_current", 31, "If a scope is selected, find first scope that starts after the selected scope. Otherwise find the first scope that starts after the cursor.", 139, "../code/custom/4coder_scope_commands.cpp", 40, 66 },
{ PROC_LINKS(select_prev_scope_absolute, 0), false, "select_prev_scope_absolute", 26, "Finds the first scope started by '{' before the cursor and puts the cursor and mark on the '{' and '}'.", 103, "../code/custom/4coder_scope_commands.cpp", 40, 82 },
{ PROC_LINKS(select_prev_top_most_scope, 0), false, "select_prev_top_most_scope", 26, "Finds the first scope that starts before the cursor, then finds the top most scope that contains that scope.", 108, "../code/custom/4coder_scope_commands.cpp", 40, 99 },
{ PROC_LINKS(select_surrounding_scope, 0), false, "select_surrounding_scope", 24, "Finds the scope enclosed by '{' '}' surrounding the cursor and puts the cursor and mark on the '{' and '}'.", 107, "../code/custom/4coder_scope_commands.cpp", 40, 27 },
{ PROC_LINKS(select_surrounding_scope_maximal, 0), false, "select_surrounding_scope_maximal", 32, "Selects the top-most scope that surrounds the cursor.", 53, "../code/custom/4coder_scope_commands.cpp", 40, 39 },
{ PROC_LINKS(set_eol_mode_from_contents, 0), false, "set_eol_mode_from_contents", 26, "Sets the buffer's line ending mode to match the contents of the buffer.", 71, "../code/custom/4coder_eol.cpp", 29, 125 },
{ PROC_LINKS(set_eol_mode_to_binary, 0), false, "set_eol_mode_to_binary", 22, "Puts the buffer in bin line ending mode.", 40, "../code/custom/4coder_eol.cpp", 29, 112 },
{ PROC_LINKS(set_eol_mode_to_crlf, 0), false, "set_eol_mode_to_crlf", 20, "Puts the buffer in crlf line ending mode.", 41, "../code/custom/4coder_eol.cpp", 29, 86 },
{ PROC_LINKS(set_eol_mode_to_lf, 0), false, "set_eol_mode_to_lf", 18, "Puts the buffer in lf line ending mode.", 39, "../code/custom/4coder_eol.cpp", 29, 99 },
{ PROC_LINKS(set_mark, 0), false, "set_mark", 8, "Sets the mark to the current position of the cursor.", 52, "../code/custom/4coder_base_commands.cpp", 39, 115 },
{ PROC_LINKS(set_mode_to_notepad_like, 0), false, "set_mode_to_notepad_like", 24, "Sets the edit mode to Notepad like.", 35, "../code/custom/4coder_default_framework.cpp", 43, 427 },
{ PROC_LINKS(set_mode_to_original, 0), false, "set_mode_to_original", 20, "Sets the edit mode to 4coder original.", 38, "../code/custom/4coder_default_framework.cpp", 43, 421 },
{ PROC_LINKS(setup_build_bat, 0), false, "setup_build_bat", 15, "Queries the user for several configuration options and initializes a new build batch script.", 92, "../code/custom/4coder_project_commands.cpp", 42, 1237 },
{ PROC_LINKS(setup_build_bat_and_sh, 0), false, "setup_build_bat_and_sh", 22, "Queries the user for several configuration options and initializes a new build batch script.", 92, "../code/custom/4coder_project_commands.cpp", 42, 1249 },
{ PROC_LINKS(setup_build_sh, 0), false, "setup_build_sh", 14, "Queries the user for several configuration options and initializes a new build shell script.", 92, "../code/custom/4coder_project_commands.cpp", 42, 1243 },
{ PROC_LINKS(setup_new_project, 0), false, "setup_new_project", 17, "Queries the user for several configuration options and initializes a new 4coder project with build scripts for every OS.", 120, "../code/custom/4coder_project_commands.cpp", 42, 1230 },
{ PROC_LINKS(show_filebar, 0), false, "show_filebar", 12, "Sets the current view to show it's filebar.", 43, "../code/custom/4coder_base_commands.cpp", 39, 644 },
{ PROC_LINKS(show_scrollbar, 0), false, "show_scrollbar", 14, "Sets the current view to show it's scrollbar.", 45, "../code/custom/4coder_base_commands.cpp", 39, 630 },
{ PROC_LINKS(show_the_log_graph, 0), true, "show_the_log_graph", 18, "Parses *log* and displays the 'log graph' UI", 44, "../code/custom/4coder_log_parser.cpp", 36, 994 },
{ PROC_LINKS(snipe_backward_whitespace_or_token_boundary, 0), false, "snipe_backward_whitespace_or_token_boundary", 43, "Delete a single, whole token on or to the left of the cursor and post it to the clipboard.", 90, "../code/custom/4coder_base_commands.cpp", 39, 179 },
{ PROC_LINKS(snipe_forward_whitespace_or_token_boundary, 0), false, "snipe_forward_whitespace_or_token_boundary", 42, "Delete a single, whole token on or to the right of the cursor and post it to the clipboard.", 91, "../code/custom/4coder_base_commands.cpp", 39, 187 },
{ PROC_LINKS(snippet_lister, 0), true, "snippet_lister", 14, "Opens a snippet lister for inserting whole pre-written snippets of text.", 72, "../code/custom/4coder_combined_write_commands.cpp", 49, 237 },
{ PROC_LINKS(suppress_mouse, 0), false, "suppress_mouse", 14, "Hides the mouse and causes all mosue input (clicks, position, wheel) to be ignored.", 83, "../code/custom/4coder_default_framework.cpp", 43, 403 },
{ PROC_LINKS(swap_panels, 0), false, "swap_panels", 11, "Swaps the active panel with it's sibling.", 41, "../code/custom/4coder_base_commands.cpp", 39, 1518 },
{ PROC_LINKS(theme_lister, 0), true, "theme_lister", 12, "Opens an interactive list of all registered themes.", 51, "../code/custom/4coder_lists.cpp", 31, 692 },
{ PROC_LINKS(to_lowercase, 0), false, "to_lowercase", 12, "Converts all ascii text in the range between the cursor and the mark to lowercase.", 82, "../code/custom/4coder_base_commands.cpp", 39, 565 },
{ PROC_LINKS(to_uppercase, 0), false, "to_uppercase", 12, "Converts all ascii text in the range between the cursor and the mark to uppercase.", 82, "../code/custom/4coder_base_commands.cpp", 39, 552 },
{ PROC_LINKS(toggle_filebar, 0), false, "toggle_filebar", 14, "Toggles the visibility status of the current view's filebar.", 60, "../code/custom/4coder_base_commands.cpp", 39, 658 },
{ PROC_LINKS(toggle_fps_meter, 0), false, "toggle_fps_meter", 16, "Toggles the visibility of the FPS performance meter", 51, "../code/custom/4coder_base_commands.cpp", 39, 667 },
{ PROC_LINKS(toggle_fullscreen, 0), false, "toggle_fullscreen", 17, "Toggle fullscreen mode on or off. The change(s) do not take effect until the next frame.", 89, "../code/custom/4coder_default_framework.cpp", 43, 451 },
{ PROC_LINKS(toggle_highlight_enclosing_scopes, 0), false, "toggle_highlight_enclosing_scopes", 33, "In code files scopes surrounding the cursor are highlighted with distinguishing colors.", 87, "../code/custom/4coder_default_framework.cpp", 43, 439 },
{ PROC_LINKS(toggle_highlight_line_at_cursor, 0), false, "toggle_highlight_line_at_cursor", 31, "Toggles the line highlight at the cursor.", 41, "../code/custom/4coder_default_framework.cpp", 43, 433 },
{ PROC_LINKS(toggle_line_numbers, 0), false, "toggle_line_numbers", 19, "Toggles the left margin line numbers.", 37, "../code/custom/4coder_base_commands.cpp", 39, 721 },
{ PROC_LINKS(toggle_line_wrap, 0), false, "toggle_line_wrap", 16, "Toggles the line wrap setting on this buffer.", 45, "../code/custom/4coder_base_commands.cpp", 39, 727 },
{ PROC_LINKS(toggle_mouse, 0), false, "toggle_mouse", 12, "Toggles the mouse suppression mode, see suppress_mouse and allow_mouse.", 71, "../code/custom/4coder_default_framework.cpp", 43, 415 },
{ PROC_LINKS(toggle_paren_matching_helper, 0), false, "toggle_paren_matching_helper", 28, "In code files matching parentheses pairs are colored with distinguishing colors.", 80, "../code/custom/4coder_default_framework.cpp", 43, 445 },
{ PROC_LINKS(toggle_show_whitespace, 0), false, "toggle_show_whitespace", 22, "Toggles the current buffer's whitespace visibility status.", 58, "../code/custom/4coder_base_commands.cpp", 39, 712 },
{ PROC_LINKS(toggle_virtual_whitespace, 0), false, "toggle_virtual_whitespace", 25, "Toggles the current buffer's virtual whitespace status.", 55, "../code/custom/4coder_code_index.cpp", 36, 1160 },
{ PROC_LINKS(tutorial_maximize, 0), false, "tutorial_maximize", 17, "Expand the tutorial window", 26, "../code/custom/4coder_tutorial.cpp", 34, 20 },
{ PROC_LINKS(tutorial_minimize, 0), false, "tutorial_minimize", 17, "Shrink the tutorial window", 26, "../code/custom/4coder_tutorial.cpp", 34, 34 },
{ PROC_LINKS(uncomment_line, 0), false, "uncomment_line", 14, "If present, delete '//' at the beginning of the line after leading whitespace.", 78, "../code/custom/4coder_combined_write_commands.cpp", 49, 137 },
{ PROC_LINKS(undo, 0), false, "undo", 4, "Advances backwards through the undo history of the current buffer.", 66, "../code/custom/4coder_base_commands.cpp", 39, 1618 },
{ PROC_LINKS(undo_all_buffers, 0), false, "undo_all_buffers", 16, "Advances backward through the undo history in the buffer containing the most recent regular edit.", 97, "../code/custom/4coder_base_commands.cpp", 39, 1645 },
{ PROC_LINKS(view_buffer_other_panel, 0), false, "view_buffer_other_panel", 23, "Set the other non-active panel to view the buffer that the active panel views, and switch to that panel.", 104, "../code/custom/4coder_base_commands.cpp", 39, 1506 },
{ PROC_LINKS(view_jump_list_with_lister, 0), false, "view_jump_list_with_lister", 26, "When executed on a buffer with jumps, creates a persistent lister for all the jumps", 83, "../code/custom/4coder_jump_lister.cpp", 37, 59 },
{ PROC_LINKS(word_complete, 0), false, "word_complete", 13, "Iteratively tries completing the word to the left of the cursor with other words in open buffers that have the same prefix string.", 130, "../code/custom/4coder_search.cpp", 32, 392 },
{ PROC_LINKS(word_complete_drop_down, 0), false, "word_complete_drop_down", 23, "Word complete with drop down menu.", 34, "../code/custom/4coder_search.cpp", 32, 639 },
{ PROC_LINKS(write_block, 0), false, "write_block", 11, "At the cursor, insert a block comment.", 38, "../code/custom/4coder_combined_write_commands.cpp", 49, 94 },
{ PROC_LINKS(write_hack, 0), false, "write_hack", 10, "At the cursor, insert a '// HACK' comment, includes user name if it was specified in config.4coder.", 99, "../code/custom/4coder_combined_write_commands.cpp", 49, 82 },
{ PROC_LINKS(write_note, 0), false, "write_note", 10, "At the cursor, insert a '// NOTE' comment, includes user name if it was specified in config.4coder.", 99, "../code/custom/4coder_combined_write_commands.cpp", 49, 88 },
{ PROC_LINKS(write_space, 0), false, "write_space", 11, "Inserts an underscore.", 22, "../code/custom/4coder_base_commands.cpp", 39, 67 },
{ PROC_LINKS(write_text_and_auto_indent, 0), false, "write_text_and_auto_indent", 26, "Inserts text and auto-indents the line on which the cursor sits if any of the text contains 'layout punctuation' such as ;:{}()[]# and new lines.", 145, "../code/custom/4coder_auto_indent.cpp", 37, 395 },
{ PROC_LINKS(write_text_input, 0), false, "write_text_input", 16, "Inserts whatever text was used to trigger this command.", 55, "../code/custom/4coder_base_commands.cpp", 39, 59 },
{ PROC_LINKS(write_todo, 0), false, "write_todo", 10, "At the cursor, insert a '// TODO' comment, includes user name if it was specified in config.4coder.", 99, "../code/custom/4coder_combined_write_commands.cpp", 49, 76 },
{ PROC_LINKS(write_underscore, 0), false, "write_underscore", 16, "Inserts an underscore.", 22, "../code/custom/4coder_base_commands.cpp", 39, 73 },
{ PROC_LINKS(write_zero_struct, 0), false, "write_zero_struct", 17, "At the cursor, insert a ' = {};'.", 33, "../code/custom/4coder_combined_write_commands.cpp", 49, 100 },
static Command_Metadata fcoder_metacmd_table[231] = {
{ PROC_LINKS(allow_mouse, 0), false, "allow_mouse", 11, "Shows the mouse and causes all mouse input to be processed normally.", 68, "c:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 409 },
{ PROC_LINKS(auto_indent_line_at_cursor, 0), false, "auto_indent_line_at_cursor", 26, "Auto-indents the line on which the cursor sits.", 47, "c:\\4ed\\code\\custom\\4coder_auto_indent.cpp", 41, 407 },
{ PROC_LINKS(auto_indent_range, 0), false, "auto_indent_range", 17, "Auto-indents the range between the cursor and the mark.", 55, "c:\\4ed\\code\\custom\\4coder_auto_indent.cpp", 41, 417 },
{ PROC_LINKS(auto_indent_whole_file, 0), false, "auto_indent_whole_file", 22, "Audo-indents the entire current buffer.", 39, "c:\\4ed\\code\\custom\\4coder_auto_indent.cpp", 41, 398 },
{ PROC_LINKS(backspace_alpha_numeric_boundary, 0), false, "backspace_alpha_numeric_boundary", 32, "Delete characters between the cursor position and the first alphanumeric boundary to the left.", 94, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 165 },
{ PROC_LINKS(backspace_char, 0), false, "backspace_char", 14, "Deletes the character to the left of the cursor.", 48, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 96 },
{ PROC_LINKS(basic_change_active_panel, 0), false, "basic_change_active_panel", 25, "Change the currently active panel, moving to the panel with the next highest view_id. Will not skipe the build panel if it is open.", 132, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 622 },
{ PROC_LINKS(build_in_build_panel, 0), false, "build_in_build_panel", 20, "Looks for a build.bat, build.sh, or makefile in the current and parent directories. Runs the first that it finds and prints the output to *compilation*. Puts the *compilation* buffer in a panel at the footer of the current view.", 230, "c:\\4ed\\code\\custom\\4coder_build_commands.cpp", 44, 159 },
{ PROC_LINKS(build_search, 0), false, "build_search", 12, "Looks for a build.bat, build.sh, or makefile in the current and parent directories. Runs the first that it finds and prints the output to *compilation*.", 153, "c:\\4ed\\code\\custom\\4coder_build_commands.cpp", 44, 122 },
{ PROC_LINKS(center_view, 0), false, "center_view", 11, "Centers the view vertically on the line on which the cursor sits.", 65, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 208 },
{ PROC_LINKS(change_active_panel, 0), false, "change_active_panel", 19, "Change the currently active panel, moving to the panel with the next highest view_id.", 85, "c:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 284 },
{ PROC_LINKS(change_active_panel_backwards, 0), false, "change_active_panel_backwards", 29, "Change the currently active panel, moving to the panel with the next lowest view_id.", 84, "c:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 290 },
{ PROC_LINKS(change_to_build_panel, 0), false, "change_to_build_panel", 21, "If the special build panel is open, makes the build panel the active panel.", 75, "c:\\4ed\\code\\custom\\4coder_build_commands.cpp", 44, 180 },
{ PROC_LINKS(clean_all_lines, 0), false, "clean_all_lines", 15, "Removes trailing whitespace from all lines in the current buffer.", 65, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 587 },
{ PROC_LINKS(clear_all_themes, 0), false, "clear_all_themes", 16, "Clear the theme list", 20, "c:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 480 },
{ PROC_LINKS(click_set_cursor, 0), false, "click_set_cursor", 16, "Sets the cursor position to the mouse position.", 47, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 244 },
{ PROC_LINKS(click_set_cursor_and_mark, 0), false, "click_set_cursor_and_mark", 25, "Sets the cursor position and mark to the mouse position.", 56, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 234 },
{ PROC_LINKS(click_set_cursor_if_lbutton, 0), false, "click_set_cursor_if_lbutton", 27, "If the mouse left button is pressed, sets the cursor position to the mouse position.", 84, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 254 },
{ PROC_LINKS(click_set_mark, 0), false, "click_set_mark", 14, "Sets the mark position to the mouse position.", 45, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 266 },
{ PROC_LINKS(close_all_code, 0), false, "close_all_code", 14, "Closes any buffer with a filename ending with an extension configured to be recognized as a code file type.", 107, "c:\\4ed\\code\\custom\\4coder_project_commands.cpp", 46, 842 },
{ PROC_LINKS(close_build_panel, 0), false, "close_build_panel", 17, "If the special build panel is open, closes it.", 46, "c:\\4ed\\code\\custom\\4coder_build_commands.cpp", 44, 174 },
{ PROC_LINKS(close_panel, 0), false, "close_panel", 11, "Closes the currently active panel if it is not the only panel open.", 67, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 630 },
{ PROC_LINKS(command_documentation, 0), true, "command_documentation", 21, "Prompts the user to select a command then loads a doc buffer for that item", 74, "c:\\4ed\\code\\custom\\4coder_docs.cpp", 34, 190 },
{ PROC_LINKS(command_lister, 0), true, "command_lister", 14, "Opens an interactive list of all registered commands.", 53, "c:\\4ed\\code\\custom\\4coder_lists.cpp", 35, 761 },
{ PROC_LINKS(comment_line, 0), false, "comment_line", 12, "Insert '//' at the beginning of the line after leading whitespace.", 66, "c:\\4ed\\code\\custom\\4coder_combined_write_commands.cpp", 53, 125 },
{ PROC_LINKS(comment_line_toggle, 0), false, "comment_line_toggle", 19, "Turns uncommented lines into commented lines and vice versa for comments starting with '//'.", 92, "c:\\4ed\\code\\custom\\4coder_combined_write_commands.cpp", 53, 149 },
{ PROC_LINKS(copy, 0), false, "copy", 4, "Copy the text in the range from the cursor to the mark onto the clipboard.", 74, "c:\\4ed\\code\\custom\\4coder_clipboard.cpp", 39, 19 },
{ PROC_LINKS(cursor_mark_swap, 0), false, "cursor_mark_swap", 16, "Swaps the position of the cursor and the mark.", 46, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 135 },
{ PROC_LINKS(custom_api_documentation, 0), true, "custom_api_documentation", 24, "Prompts the user to select a Custom API item then loads a doc buffer for that item", 82, "c:\\4ed\\code\\custom\\4coder_docs.cpp", 34, 175 },
{ PROC_LINKS(cut, 0), false, "cut", 3, "Cut the text in the range from the cursor to the mark onto the clipboard.", 73, "c:\\4ed\\code\\custom\\4coder_clipboard.cpp", 39, 28 },
{ PROC_LINKS(decrease_face_size, 0), false, "decrease_face_size", 18, "Decrease the size of the face used by the current buffer.", 57, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 693 },
{ PROC_LINKS(default_file_externally_modified, 0), false, "default_file_externally_modified", 32, "Notes the external modification of attached files by printing a message.", 72, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1804 },
{ PROC_LINKS(default_startup, 0), false, "default_startup", 15, "Default command for responding to a startup event", 49, "c:\\4ed\\code\\custom\\4coder_default_hooks.cpp", 43, 7 },
{ PROC_LINKS(default_try_exit, 0), false, "default_try_exit", 16, "Default command for responding to a try-exit event", 50, "c:\\4ed\\code\\custom\\4coder_default_hooks.cpp", 43, 23 },
{ PROC_LINKS(default_view_input_handler, 0), false, "default_view_input_handler", 26, "Input consumption loop for default view behavior", 48, "c:\\4ed\\code\\custom\\4coder_default_hooks.cpp", 43, 51 },
{ PROC_LINKS(delete_alpha_numeric_boundary, 0), false, "delete_alpha_numeric_boundary", 29, "Delete characters between the cursor position and the first alphanumeric boundary to the right.", 95, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 173 },
{ PROC_LINKS(delete_char, 0), false, "delete_char", 11, "Deletes the character to the right of the cursor.", 49, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 79 },
{ PROC_LINKS(delete_current_scope, 0), false, "delete_current_scope", 20, "Deletes the braces surrounding the currently selected scope. Leaves the contents within the scope.", 99, "c:\\4ed\\code\\custom\\4coder_scope_commands.cpp", 44, 112 },
{ PROC_LINKS(delete_file_query, 0), false, "delete_file_query", 17, "Deletes the file of the current buffer if 4coder has the appropriate access rights. Will ask the user for confirmation first.", 125, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1230 },
{ PROC_LINKS(delete_line, 0), false, "delete_line", 11, "Delete the line the on which the cursor sits.", 45, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1402 },
{ PROC_LINKS(delete_range, 0), false, "delete_range", 12, "Deletes the text in the range between the cursor and the mark.", 62, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 145 },
{ PROC_LINKS(duplicate_line, 0), false, "duplicate_line", 14, "Create a copy of the line on which the cursor sits.", 51, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1388 },
{ PROC_LINKS(execute_any_cli, 0), false, "execute_any_cli", 15, "Queries for an output buffer name and system command, runs the system command as a CLI and prints the output to the specified buffer.", 133, "c:\\4ed\\code\\custom\\4coder_cli_command.cpp", 41, 22 },
{ PROC_LINKS(execute_previous_cli, 0), false, "execute_previous_cli", 20, "If the command execute_any_cli has already been used, this will execute a CLI reusing the most recent buffer name and command.", 126, "c:\\4ed\\code\\custom\\4coder_cli_command.cpp", 41, 7 },
{ PROC_LINKS(exit_4coder, 0), false, "exit_4coder", 11, "Attempts to close 4coder.", 25, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 749 },
{ PROC_LINKS(goto_beginning_of_file, 0), false, "goto_beginning_of_file", 22, "Sets the cursor to the beginning of the file.", 45, "c:\\4ed\\code\\custom\\4coder_helper.cpp", 36, 2184 },
{ PROC_LINKS(goto_end_of_file, 0), false, "goto_end_of_file", 16, "Sets the cursor to the end of the file.", 39, "c:\\4ed\\code\\custom\\4coder_helper.cpp", 36, 2192 },
{ PROC_LINKS(goto_first_jump, 0), false, "goto_first_jump", 15, "If a buffer containing jump locations has been locked in, goes to the first jump in the buffer.", 95, "c:\\4ed\\code\\custom\\4coder_jump_sticky.cpp", 41, 525 },
{ PROC_LINKS(goto_first_jump_same_panel_sticky, 0), false, "goto_first_jump_same_panel_sticky", 33, "If a buffer containing jump locations has been locked in, goes to the first jump in the buffer and views the buffer in the panel where the jump list was.", 153, "c:\\4ed\\code\\custom\\4coder_jump_sticky.cpp", 41, 542 },
{ PROC_LINKS(goto_jump_at_cursor, 0), false, "goto_jump_at_cursor", 19, "If the cursor is found to be on a jump location, parses the jump location and brings up the file and position in another view and changes the active panel to the view containing the jump.", 187, "c:\\4ed\\code\\custom\\4coder_jump_sticky.cpp", 41, 348 },
{ PROC_LINKS(goto_jump_at_cursor_same_panel, 0), false, "goto_jump_at_cursor_same_panel", 30, "If the cursor is found to be on a jump location, parses the jump location and brings up the file and position in this view, losing the compilation output or jump list.", 167, "c:\\4ed\\code\\custom\\4coder_jump_sticky.cpp", 41, 375 },
{ PROC_LINKS(goto_line, 0), false, "goto_line", 9, "Queries the user for a number, and jumps the cursor to the corresponding line.", 78, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 757 },
{ PROC_LINKS(goto_next_jump, 0), false, "goto_next_jump", 14, "If a buffer containing jump locations has been locked in, goes to the next jump in the buffer, skipping sub jump locations.", 123, "c:\\4ed\\code\\custom\\4coder_jump_sticky.cpp", 41, 464 },
{ PROC_LINKS(goto_next_jump_no_skips, 0), false, "goto_next_jump_no_skips", 23, "If a buffer containing jump locations has been locked in, goes to the next jump in the buffer, and does not skip sub jump locations.", 132, "c:\\4ed\\code\\custom\\4coder_jump_sticky.cpp", 41, 494 },
{ PROC_LINKS(goto_prev_jump, 0), false, "goto_prev_jump", 14, "If a buffer containing jump locations has been locked in, goes to the previous jump in the buffer, skipping sub jump locations.", 127, "c:\\4ed\\code\\custom\\4coder_jump_sticky.cpp", 41, 481 },
{ PROC_LINKS(goto_prev_jump_no_skips, 0), false, "goto_prev_jump_no_skips", 23, "If a buffer containing jump locations has been locked in, goes to the previous jump in the buffer, and does not skip sub jump locations.", 136, "c:\\4ed\\code\\custom\\4coder_jump_sticky.cpp", 41, 511 },
{ PROC_LINKS(hide_filebar, 0), false, "hide_filebar", 12, "Sets the current view to hide it's filebar.", 43, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 660 },
{ PROC_LINKS(hide_scrollbar, 0), false, "hide_scrollbar", 14, "Sets the current view to hide it's scrollbar.", 45, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 646 },
{ PROC_LINKS(hms_demo_tutorial, 0), false, "hms_demo_tutorial", 17, "Tutorial for built in 4coder bindings and features.", 51, "c:\\4ed\\code\\custom\\4coder_tutorial.cpp", 38, 869 },
{ PROC_LINKS(if0_off, 0), false, "if0_off", 7, "Surround the range between the cursor and mark with an '#if 0' and an '#endif'", 78, "c:\\4ed\\code\\custom\\4coder_combined_write_commands.cpp", 53, 70 },
{ PROC_LINKS(if_read_only_goto_position, 0), false, "if_read_only_goto_position", 26, "If the buffer in the active view is writable, inserts a character, otherwise performs goto_jump_at_cursor.", 106, "c:\\4ed\\code\\custom\\4coder_jump_sticky.cpp", 41, 564 },
{ PROC_LINKS(if_read_only_goto_position_same_panel, 0), false, "if_read_only_goto_position_same_panel", 37, "If the buffer in the active view is writable, inserts a character, otherwise performs goto_jump_at_cursor_same_panel.", 117, "c:\\4ed\\code\\custom\\4coder_jump_sticky.cpp", 41, 581 },
{ PROC_LINKS(increase_face_size, 0), false, "increase_face_size", 18, "Increase the size of the face used by the current buffer.", 57, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 682 },
{ PROC_LINKS(interactive_kill_buffer, 0), true, "interactive_kill_buffer", 23, "Interactively kill an open buffer.", 34, "c:\\4ed\\code\\custom\\4coder_lists.cpp", 35, 520 },
{ PROC_LINKS(interactive_new, 0), true, "interactive_new", 15, "Interactively creates a new file.", 33, "c:\\4ed\\code\\custom\\4coder_lists.cpp", 35, 661 },
{ PROC_LINKS(interactive_open, 0), true, "interactive_open", 16, "Interactively opens a file.", 27, "c:\\4ed\\code\\custom\\4coder_lists.cpp", 35, 715 },
{ PROC_LINKS(interactive_open_or_new, 0), true, "interactive_open_or_new", 23, "Interactively open a file out of the file system.", 49, "c:\\4ed\\code\\custom\\4coder_lists.cpp", 35, 612 },
{ PROC_LINKS(interactive_switch_buffer, 0), true, "interactive_switch_buffer", 25, "Interactively switch to an open buffer.", 39, "c:\\4ed\\code\\custom\\4coder_lists.cpp", 35, 510 },
{ PROC_LINKS(jump_to_definition, 0), true, "jump_to_definition", 18, "List all definitions in the code index and jump to one chosen by the user.", 74, "c:\\4ed\\code\\custom\\4coder_code_index_listers.cpp", 48, 12 },
{ PROC_LINKS(keyboard_macro_finish_recording, 0), false, "keyboard_macro_finish_recording", 31, "Stop macro recording, do nothing if macro recording is not already started", 74, "c:\\4ed\\code\\custom\\4coder_keyboard_macro.cpp", 44, 54 },
{ PROC_LINKS(keyboard_macro_replay, 0), false, "keyboard_macro_replay", 21, "Replay the most recently recorded keyboard macro", 48, "c:\\4ed\\code\\custom\\4coder_keyboard_macro.cpp", 44, 77 },
{ PROC_LINKS(keyboard_macro_start_recording, 0), false, "keyboard_macro_start_recording", 30, "Start macro recording, do nothing if macro recording is already started", 71, "c:\\4ed\\code\\custom\\4coder_keyboard_macro.cpp", 44, 41 },
{ PROC_LINKS(kill_buffer, 0), false, "kill_buffer", 11, "Kills the current buffer.", 25, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1548 },
{ PROC_LINKS(kill_tutorial, 0), false, "kill_tutorial", 13, "If there is an active tutorial, kill it.", 40, "c:\\4ed\\code\\custom\\4coder_tutorial.cpp", 38, 9 },
{ PROC_LINKS(left_adjust_view, 0), false, "left_adjust_view", 16, "Sets the left size of the view near the x position of the cursor.", 65, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 222 },
{ PROC_LINKS(list_all_functions_all_buffers, 0), false, "list_all_functions_all_buffers", 30, "Creates a jump list of lines from all buffers that appear to define or declare functions.", 89, "c:\\4ed\\code\\custom\\4coder_function_list.cpp", 43, 296 },
{ PROC_LINKS(list_all_functions_all_buffers_lister, 0), false, "list_all_functions_all_buffers_lister", 37, "Creates a lister of locations that look like function definitions and declarations all buffers.", 95, "c:\\4ed\\code\\custom\\4coder_function_list.cpp", 43, 302 },
{ PROC_LINKS(list_all_functions_current_buffer, 0), false, "list_all_functions_current_buffer", 33, "Creates a jump list of lines of the current buffer that appear to define or declare functions.", 94, "c:\\4ed\\code\\custom\\4coder_function_list.cpp", 43, 267 },
{ PROC_LINKS(list_all_functions_current_buffer_lister, 0), false, "list_all_functions_current_buffer_lister", 40, "Creates a lister of locations that look like function definitions and declarations in the buffer.", 97, "c:\\4ed\\code\\custom\\4coder_function_list.cpp", 43, 277 },
{ PROC_LINKS(list_all_locations, 0), false, "list_all_locations", 18, "Queries the user for a string and lists all exact case-sensitive matches found in all open buffers.", 99, "c:\\4ed\\code\\custom\\4coder_search.cpp", 36, 165 },
{ PROC_LINKS(list_all_locations_case_insensitive, 0), false, "list_all_locations_case_insensitive", 35, "Queries the user for a string and lists all exact case-insensitive matches found in all open buffers.", 101, "c:\\4ed\\code\\custom\\4coder_search.cpp", 36, 177 },
{ PROC_LINKS(list_all_locations_of_identifier, 0), false, "list_all_locations_of_identifier", 32, "Reads a token or word under the cursor and lists all exact case-sensitive mathces in all open buffers.", 102, "c:\\4ed\\code\\custom\\4coder_search.cpp", 36, 189 },
{ PROC_LINKS(list_all_locations_of_identifier_case_insensitive, 0), false, "list_all_locations_of_identifier_case_insensitive", 49, "Reads a token or word under the cursor and lists all exact case-insensitive mathces in all open buffers.", 104, "c:\\4ed\\code\\custom\\4coder_search.cpp", 36, 195 },
{ PROC_LINKS(list_all_locations_of_selection, 0), false, "list_all_locations_of_selection", 31, "Reads the string in the selected range and lists all exact case-sensitive mathces in all open buffers.", 102, "c:\\4ed\\code\\custom\\4coder_search.cpp", 36, 201 },
{ PROC_LINKS(list_all_locations_of_selection_case_insensitive, 0), false, "list_all_locations_of_selection_case_insensitive", 48, "Reads the string in the selected range and lists all exact case-insensitive mathces in all open buffers.", 104, "c:\\4ed\\code\\custom\\4coder_search.cpp", 36, 207 },
{ PROC_LINKS(list_all_locations_of_type_definition, 0), false, "list_all_locations_of_type_definition", 37, "Queries user for string, lists all locations of strings that appear to define a type whose name matches the input string.", 121, "c:\\4ed\\code\\custom\\4coder_search.cpp", 36, 213 },
{ PROC_LINKS(list_all_locations_of_type_definition_of_identifier, 0), false, "list_all_locations_of_type_definition_of_identifier", 51, "Reads a token or word under the cursor and lists all locations of strings that appear to define a type whose name matches it.", 125, "c:\\4ed\\code\\custom\\4coder_search.cpp", 36, 221 },
{ PROC_LINKS(list_all_substring_locations, 0), false, "list_all_substring_locations", 28, "Queries the user for a string and lists all case-sensitive substring matches found in all open buffers.", 103, "c:\\4ed\\code\\custom\\4coder_search.cpp", 36, 171 },
{ PROC_LINKS(list_all_substring_locations_case_insensitive, 0), false, "list_all_substring_locations_case_insensitive", 45, "Queries the user for a string and lists all case-insensitive substring matches found in all open buffers.", 105, "c:\\4ed\\code\\custom\\4coder_search.cpp", 36, 183 },
{ PROC_LINKS(load_project, 0), false, "load_project", 12, "Looks for a project.4coder file in the current directory and tries to load it. Looks in parent directories until a project file is found or there are no more parents.", 167, "c:\\4ed\\code\\custom\\4coder_project_commands.cpp", 46, 862 },
{ PROC_LINKS(load_theme_current_buffer, 0), false, "load_theme_current_buffer", 25, "Parse the current buffer as a theme file and add the theme to the theme list. If the buffer has a .4coder postfix in it's name, it is removed when the name is saved.", 165, "c:\\4ed\\code\\custom\\4coder_config.cpp", 36, 1622 },
{ PROC_LINKS(load_themes_default_folder, 0), false, "load_themes_default_folder", 26, "Loads all the theme files in the default theme folder.", 54, "c:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 457 },
{ PROC_LINKS(load_themes_hot_directory, 0), false, "load_themes_hot_directory", 25, "Loads all the theme files in the current hot directory.", 55, "c:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 469 },
{ PROC_LINKS(make_directory_query, 0), false, "make_directory_query", 20, "Queries the user for a name and creates a new directory with the given name.", 76, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1342 },
{ PROC_LINKS(miblo_decrement_basic, 0), false, "miblo_decrement_basic", 21, "Decrement an integer under the cursor by one.", 45, "c:\\4ed\\code\\custom\\4coder_miblo_numbers.cpp", 43, 44 },
{ PROC_LINKS(miblo_decrement_time_stamp, 0), false, "miblo_decrement_time_stamp", 26, "Decrement a time stamp under the cursor by one second. (format [m]m:ss or h:mm:ss", 81, "c:\\4ed\\code\\custom\\4coder_miblo_numbers.cpp", 43, 237 },
{ PROC_LINKS(miblo_decrement_time_stamp_minute, 0), false, "miblo_decrement_time_stamp_minute", 33, "Decrement a time stamp under the cursor by one minute. (format [m]m:ss or h:mm:ss", 81, "c:\\4ed\\code\\custom\\4coder_miblo_numbers.cpp", 43, 249 },
{ PROC_LINKS(miblo_increment_basic, 0), false, "miblo_increment_basic", 21, "Increment an integer under the cursor by one.", 45, "c:\\4ed\\code\\custom\\4coder_miblo_numbers.cpp", 43, 29 },
{ PROC_LINKS(miblo_increment_time_stamp, 0), false, "miblo_increment_time_stamp", 26, "Increment a time stamp under the cursor by one second. (format [m]m:ss or h:mm:ss", 81, "c:\\4ed\\code\\custom\\4coder_miblo_numbers.cpp", 43, 231 },
{ PROC_LINKS(miblo_increment_time_stamp_minute, 0), false, "miblo_increment_time_stamp_minute", 33, "Increment a time stamp under the cursor by one minute. (format [m]m:ss or h:mm:ss", 81, "c:\\4ed\\code\\custom\\4coder_miblo_numbers.cpp", 43, 243 },
{ PROC_LINKS(mouse_wheel_change_face_size, 0), false, "mouse_wheel_change_face_size", 28, "Reads the state of the mouse wheel and uses it to either increase or decrease the face size.", 92, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 704 },
{ PROC_LINKS(mouse_wheel_scroll, 0), false, "mouse_wheel_scroll", 18, "Reads the scroll wheel value from the mouse state and scrolls accordingly.", 74, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 276 },
{ PROC_LINKS(move_down, 0), false, "move_down", 9, "Moves the cursor down one line.", 31, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 347 },
{ PROC_LINKS(move_down_10, 0), false, "move_down_10", 12, "Moves the cursor down ten lines.", 32, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 359 },
{ PROC_LINKS(move_down_textual, 0), false, "move_down_textual", 17, "Moves down to the next line of actual text, regardless of line wrapping.", 72, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 365 },
{ PROC_LINKS(move_down_to_blank_line, 0), false, "move_down_to_blank_line", 23, "Seeks the cursor down to the next blank line.", 45, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 418 },
{ PROC_LINKS(move_down_to_blank_line_end, 0), false, "move_down_to_blank_line_end", 27, "Seeks the cursor down to the next blank line and places it at the end of the line.", 82, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 442 },
{ PROC_LINKS(move_down_to_blank_line_skip_whitespace, 0), false, "move_down_to_blank_line_skip_whitespace", 39, "Seeks the cursor down to the next blank line and places it at the end of the line.", 82, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 430 },
{ PROC_LINKS(move_left, 0), false, "move_left", 9, "Moves the cursor one character to the left.", 43, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 448 },
{ PROC_LINKS(move_left_alpha_numeric_boundary, 0), false, "move_left_alpha_numeric_boundary", 32, "Seek left for boundary between alphanumeric characters and non-alphanumeric characters.", 87, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 525 },
{ PROC_LINKS(move_left_alpha_numeric_or_camel_boundary, 0), false, "move_left_alpha_numeric_or_camel_boundary", 41, "Seek left for boundary between alphanumeric characters or camel case word and non-alphanumeric characters.", 106, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 539 },
{ PROC_LINKS(move_left_token_boundary, 0), false, "move_left_token_boundary", 24, "Seek left for the next beginning of a token.", 44, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 497 },
{ PROC_LINKS(move_left_whitespace_boundary, 0), false, "move_left_whitespace_boundary", 29, "Seek left for the next boundary between whitespace and non-whitespace.", 70, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 482 },
{ PROC_LINKS(move_left_whitespace_or_token_boundary, 0), false, "move_left_whitespace_or_token_boundary", 38, "Seek left for the next end of a token or boundary between whitespace and non-whitespace.", 88, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 511 },
{ PROC_LINKS(move_line_down, 0), false, "move_line_down", 14, "Swaps the line under the cursor with the line below it, and moves the cursor down with it.", 90, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1382 },
{ PROC_LINKS(move_line_up, 0), false, "move_line_up", 12, "Swaps the line under the cursor with the line above it, and moves the cursor up with it.", 88, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1376 },
{ PROC_LINKS(move_right, 0), false, "move_right", 10, "Moves the cursor one character to the right.", 44, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 456 },
{ PROC_LINKS(move_right_alpha_numeric_boundary, 0), false, "move_right_alpha_numeric_boundary", 33, "Seek right for boundary between alphanumeric characters and non-alphanumeric characters.", 88, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 518 },
{ PROC_LINKS(move_right_alpha_numeric_or_camel_boundary, 0), false, "move_right_alpha_numeric_or_camel_boundary", 42, "Seek right for boundary between alphanumeric characters or camel case word and non-alphanumeric characters.", 107, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 532 },
{ PROC_LINKS(move_right_token_boundary, 0), false, "move_right_token_boundary", 25, "Seek right for the next end of a token.", 39, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 490 },
{ PROC_LINKS(move_right_whitespace_boundary, 0), false, "move_right_whitespace_boundary", 30, "Seek right for the next boundary between whitespace and non-whitespace.", 71, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 474 },
{ PROC_LINKS(move_right_whitespace_or_token_boundary, 0), false, "move_right_whitespace_or_token_boundary", 39, "Seek right for the next end of a token or boundary between whitespace and non-whitespace.", 89, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 504 },
{ PROC_LINKS(move_up, 0), false, "move_up", 7, "Moves the cursor up one line.", 29, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 341 },
{ PROC_LINKS(move_up_10, 0), false, "move_up_10", 10, "Moves the cursor up ten lines.", 30, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 353 },
{ PROC_LINKS(move_up_to_blank_line, 0), false, "move_up_to_blank_line", 21, "Seeks the cursor up to the next blank line.", 43, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 412 },
{ PROC_LINKS(move_up_to_blank_line_end, 0), false, "move_up_to_blank_line_end", 25, "Seeks the cursor up to the next blank line and places it at the end of the line.", 80, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 436 },
{ PROC_LINKS(move_up_to_blank_line_skip_whitespace, 0), false, "move_up_to_blank_line_skip_whitespace", 37, "Seeks the cursor up to the next blank line and places it at the end of the line.", 80, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 424 },
{ PROC_LINKS(open_all_code, 0), false, "open_all_code", 13, "Open all code in the current directory. File types are determined by extensions. An extension is considered code based on the extensions specified in 4coder.config.", 164, "c:\\4ed\\code\\custom\\4coder_project_commands.cpp", 46, 848 },
{ PROC_LINKS(open_all_code_recursive, 0), false, "open_all_code_recursive", 23, "Works as open_all_code but also runs in all subdirectories.", 59, "c:\\4ed\\code\\custom\\4coder_project_commands.cpp", 46, 854 },
{ PROC_LINKS(open_file_in_quotes, 0), false, "open_file_in_quotes", 19, "Reads a filename from surrounding '\"' characters and attempts to open the corresponding file.", 94, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1467 },
{ PROC_LINKS(open_in_other, 0), false, "open_in_other", 13, "Interactively opens a file in the other panel.", 46, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1798 },
{ PROC_LINKS(open_long_braces, 0), false, "open_long_braces", 16, "At the cursor, insert a '{' and '}' separated by a blank line.", 62, "c:\\4ed\\code\\custom\\4coder_combined_write_commands.cpp", 53, 46 },
{ PROC_LINKS(open_long_braces_break, 0), false, "open_long_braces_break", 22, "At the cursor, insert a '{' and '}break;' separated by a blank line.", 68, "c:\\4ed\\code\\custom\\4coder_combined_write_commands.cpp", 53, 62 },
{ PROC_LINKS(open_long_braces_semicolon, 0), false, "open_long_braces_semicolon", 26, "At the cursor, insert a '{' and '};' separated by a blank line.", 63, "c:\\4ed\\code\\custom\\4coder_combined_write_commands.cpp", 53, 54 },
{ PROC_LINKS(open_matching_file_cpp, 0), false, "open_matching_file_cpp", 22, "If the current file is a *.cpp or *.h, attempts to open the corresponding *.h or *.cpp file in the other view.", 110, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1499 },
{ PROC_LINKS(open_panel_hsplit, 0), false, "open_panel_hsplit", 17, "Create a new panel by horizontally splitting the active panel.", 62, "c:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 310 },
{ PROC_LINKS(open_panel_vsplit, 0), false, "open_panel_vsplit", 17, "Create a new panel by vertically splitting the active panel.", 60, "c:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 300 },
{ PROC_LINKS(page_down, 0), false, "page_down", 9, "Scrolls the view down one view height and moves the cursor down one view height.", 80, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 383 },
{ PROC_LINKS(page_up, 0), false, "page_up", 7, "Scrolls the view up one view height and moves the cursor up one view height.", 76, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 375 },
{ PROC_LINKS(paste, 0), false, "paste", 5, "At the cursor, insert the text at the top of the clipboard.", 59, "c:\\4ed\\code\\custom\\4coder_clipboard.cpp", 39, 39 },
{ PROC_LINKS(paste_and_indent, 0), false, "paste_and_indent", 16, "Paste from the top of clipboard and run auto-indent on the newly pasted text.", 77, "c:\\4ed\\code\\custom\\4coder_clipboard.cpp", 39, 113 },
{ PROC_LINKS(paste_next, 0), false, "paste_next", 10, "If the previous command was paste or paste_next, replaces the paste range with the next text down on the clipboard, otherwise operates as the paste command.", 156, "c:\\4ed\\code\\custom\\4coder_clipboard.cpp", 39, 72 },
{ PROC_LINKS(paste_next_and_indent, 0), false, "paste_next_and_indent", 21, "Paste the next item on the clipboard and run auto-indent on the newly pasted text.", 82, "c:\\4ed\\code\\custom\\4coder_clipboard.cpp", 39, 120 },
{ PROC_LINKS(place_in_scope, 0), false, "place_in_scope", 14, "Wraps the code contained in the range between cursor and mark with a new curly brace scope.", 91, "c:\\4ed\\code\\custom\\4coder_scope_commands.cpp", 44, 106 },
{ PROC_LINKS(profile_clear, 0), false, "profile_clear", 13, "Clear all profiling information from 4coder's self profiler.", 60, "c:\\4ed\\code\\custom\\4coder_profile.cpp", 37, 226 },
{ PROC_LINKS(profile_disable, 0), false, "profile_disable", 15, "Prevent 4coder's self profiler from gathering new profiling information.", 72, "c:\\4ed\\code\\custom\\4coder_profile.cpp", 37, 219 },
{ PROC_LINKS(profile_enable, 0), false, "profile_enable", 14, "Allow 4coder's self profiler to gather new profiling information.", 65, "c:\\4ed\\code\\custom\\4coder_profile.cpp", 37, 212 },
{ PROC_LINKS(profile_inspect, 0), true, "profile_inspect", 15, "Inspect all currently collected profiling information in 4coder's self profiler.", 80, "c:\\4ed\\code\\custom\\4coder_profile_inspect.cpp", 45, 886 },
{ PROC_LINKS(project_command_lister, 0), false, "project_command_lister", 22, "Open a lister of all commands in the currently loaded project.", 62, "c:\\4ed\\code\\custom\\4coder_project_commands.cpp", 46, 1289 },
{ PROC_LINKS(project_fkey_command, 0), false, "project_fkey_command", 20, "Run an 'fkey command' configured in a project.4coder file. Determines the index of the 'fkey command' by which function key or numeric key was pressed to trigger the command.", 175, "c:\\4ed\\code\\custom\\4coder_project_commands.cpp", 46, 870 },
{ PROC_LINKS(project_go_to_root_directory, 0), false, "project_go_to_root_directory", 28, "Changes 4coder's hot directory to the root directory of the currently loaded project. With no loaded project nothing hapepns.", 125, "c:\\4ed\\code\\custom\\4coder_project_commands.cpp", 46, 896 },
{ PROC_LINKS(query_replace, 0), false, "query_replace", 13, "Queries the user for two strings, and incrementally replaces every occurence of the first string with the second string.", 120, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1158 },
{ PROC_LINKS(query_replace_identifier, 0), false, "query_replace_identifier", 24, "Queries the user for a string, and incrementally replace every occurence of the word or token found at the cursor with the specified string.", 140, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1179 },
{ PROC_LINKS(query_replace_selection, 0), false, "query_replace_selection", 23, "Queries the user for a string, and incrementally replace every occurence of the string found in the selected range with the specified string.", 141, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1195 },
{ PROC_LINKS(redo, 0), false, "redo", 4, "Advances forwards through the undo history of the current buffer.", 65, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1637 },
{ PROC_LINKS(redo_all_buffers, 0), false, "redo_all_buffers", 16, "Advances forward through the undo history in the buffer containing the most recent regular edit.", 96, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1722 },
{ PROC_LINKS(rename_file_query, 0), false, "rename_file_query", 17, "Queries the user for a new name and renames the file of the current buffer, altering the buffer's name too.", 107, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1307 },
{ PROC_LINKS(reopen, 0), false, "reopen", 6, "Reopen the current buffer from the hard drive.", 46, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1566 },
{ PROC_LINKS(replace_in_all_buffers, 0), false, "replace_in_all_buffers", 22, "Queries the user for a needle and string. Replaces all occurences of needle with string in all editable buffers.", 112, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1068 },
{ PROC_LINKS(replace_in_buffer, 0), false, "replace_in_buffer", 17, "Queries the user for a needle and string. Replaces all occurences of needle with string in the active buffer.", 109, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1059 },
{ PROC_LINKS(replace_in_range, 0), false, "replace_in_range", 16, "Queries the user for a needle and string. Replaces all occurences of needle with string in the range between cursor and the mark in the active buffer.", 150, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1050 },
{ PROC_LINKS(reverse_search, 0), false, "reverse_search", 14, "Begins an incremental search up through the current buffer for a user specified string.", 87, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 991 },
{ PROC_LINKS(reverse_search_identifier, 0), false, "reverse_search_identifier", 25, "Begins an incremental search up through the current buffer for the word or token under the cursor.", 98, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1003 },
{ PROC_LINKS(save, 0), false, "save", 4, "Saves the current buffer.", 25, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1556 },
{ PROC_LINKS(save_all_dirty_buffers, 0), false, "save_all_dirty_buffers", 22, "Saves all buffers marked dirty (showing the '*' indicator).", 59, "c:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 382 },
{ PROC_LINKS(save_to_query, 0), false, "save_to_query", 13, "Queries the user for a file name and saves the contents of the current buffer, altering the buffer's name too.", 110, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1274 },
{ PROC_LINKS(search, 0), false, "search", 6, "Begins an incremental search down through the current buffer for a user specified string.", 89, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 985 },
{ PROC_LINKS(search_identifier, 0), false, "search_identifier", 17, "Begins an incremental search down through the current buffer for the word or token under the cursor.", 100, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 997 },
{ PROC_LINKS(seek_beginning_of_line, 0), false, "seek_beginning_of_line", 22, "Seeks the cursor to the beginning of the visual line.", 53, "c:\\4ed\\code\\custom\\4coder_helper.cpp", 36, 2172 },
{ PROC_LINKS(seek_beginning_of_textual_line, 0), false, "seek_beginning_of_textual_line", 30, "Seeks the cursor to the beginning of the line across all text.", 62, "c:\\4ed\\code\\custom\\4coder_helper.cpp", 36, 2160 },
{ PROC_LINKS(seek_end_of_line, 0), false, "seek_end_of_line", 16, "Seeks the cursor to the end of the visual line.", 47, "c:\\4ed\\code\\custom\\4coder_helper.cpp", 36, 2178 },
{ PROC_LINKS(seek_end_of_textual_line, 0), false, "seek_end_of_textual_line", 24, "Seeks the cursor to the end of the line across all text.", 56, "c:\\4ed\\code\\custom\\4coder_helper.cpp", 36, 2166 },
{ PROC_LINKS(select_all, 0), false, "select_all", 10, "Puts the cursor at the top of the file, and the mark at the bottom of the file.", 79, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 548 },
{ PROC_LINKS(select_next_scope_absolute, 0), false, "select_next_scope_absolute", 26, "Finds the first scope started by '{' after the cursor and puts the cursor and mark on the '{' and '}'.", 102, "c:\\4ed\\code\\custom\\4coder_scope_commands.cpp", 44, 57 },
{ PROC_LINKS(select_next_scope_after_current, 0), false, "select_next_scope_after_current", 31, "If a scope is selected, find first scope that starts after the selected scope. Otherwise find the first scope that starts after the cursor.", 139, "c:\\4ed\\code\\custom\\4coder_scope_commands.cpp", 44, 66 },
{ PROC_LINKS(select_prev_scope_absolute, 0), false, "select_prev_scope_absolute", 26, "Finds the first scope started by '{' before the cursor and puts the cursor and mark on the '{' and '}'.", 103, "c:\\4ed\\code\\custom\\4coder_scope_commands.cpp", 44, 82 },
{ PROC_LINKS(select_prev_top_most_scope, 0), false, "select_prev_top_most_scope", 26, "Finds the first scope that starts before the cursor, then finds the top most scope that contains that scope.", 108, "c:\\4ed\\code\\custom\\4coder_scope_commands.cpp", 44, 99 },
{ PROC_LINKS(select_surrounding_scope, 0), false, "select_surrounding_scope", 24, "Finds the scope enclosed by '{' '}' surrounding the cursor and puts the cursor and mark on the '{' and '}'.", 107, "c:\\4ed\\code\\custom\\4coder_scope_commands.cpp", 44, 27 },
{ PROC_LINKS(select_surrounding_scope_maximal, 0), false, "select_surrounding_scope_maximal", 32, "Selects the top-most scope that surrounds the cursor.", 53, "c:\\4ed\\code\\custom\\4coder_scope_commands.cpp", 44, 39 },
{ PROC_LINKS(set_eol_mode_from_contents, 0), false, "set_eol_mode_from_contents", 26, "Sets the buffer's line ending mode to match the contents of the buffer.", 71, "c:\\4ed\\code\\custom\\4coder_eol.cpp", 33, 125 },
{ PROC_LINKS(set_eol_mode_to_binary, 0), false, "set_eol_mode_to_binary", 22, "Puts the buffer in bin line ending mode.", 40, "c:\\4ed\\code\\custom\\4coder_eol.cpp", 33, 112 },
{ PROC_LINKS(set_eol_mode_to_crlf, 0), false, "set_eol_mode_to_crlf", 20, "Puts the buffer in crlf line ending mode.", 41, "c:\\4ed\\code\\custom\\4coder_eol.cpp", 33, 86 },
{ PROC_LINKS(set_eol_mode_to_lf, 0), false, "set_eol_mode_to_lf", 18, "Puts the buffer in lf line ending mode.", 39, "c:\\4ed\\code\\custom\\4coder_eol.cpp", 33, 99 },
{ PROC_LINKS(set_mark, 0), false, "set_mark", 8, "Sets the mark to the current position of the cursor.", 52, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 126 },
{ PROC_LINKS(set_mode_to_notepad_like, 0), false, "set_mode_to_notepad_like", 24, "Sets the edit mode to Notepad like.", 35, "c:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 427 },
{ PROC_LINKS(set_mode_to_original, 0), false, "set_mode_to_original", 20, "Sets the edit mode to 4coder original.", 38, "c:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 421 },
{ PROC_LINKS(setup_build_bat, 0), false, "setup_build_bat", 15, "Queries the user for several configuration options and initializes a new build batch script.", 92, "c:\\4ed\\code\\custom\\4coder_project_commands.cpp", 46, 1237 },
{ PROC_LINKS(setup_build_bat_and_sh, 0), false, "setup_build_bat_and_sh", 22, "Queries the user for several configuration options and initializes a new build batch script.", 92, "c:\\4ed\\code\\custom\\4coder_project_commands.cpp", 46, 1249 },
{ PROC_LINKS(setup_build_sh, 0), false, "setup_build_sh", 14, "Queries the user for several configuration options and initializes a new build shell script.", 92, "c:\\4ed\\code\\custom\\4coder_project_commands.cpp", 46, 1243 },
{ PROC_LINKS(setup_new_project, 0), false, "setup_new_project", 17, "Queries the user for several configuration options and initializes a new 4coder project with build scripts for every OS.", 120, "c:\\4ed\\code\\custom\\4coder_project_commands.cpp", 46, 1230 },
{ PROC_LINKS(show_filebar, 0), false, "show_filebar", 12, "Sets the current view to show it's filebar.", 43, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 653 },
{ PROC_LINKS(show_scrollbar, 0), false, "show_scrollbar", 14, "Sets the current view to show it's scrollbar.", 45, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 639 },
{ PROC_LINKS(show_the_log_graph, 0), true, "show_the_log_graph", 18, "Parses *log* and displays the 'log graph' UI", 44, "c:\\4ed\\code\\custom\\4coder_log_parser.cpp", 40, 994 },
{ PROC_LINKS(snipe_backward_whitespace_or_token_boundary, 0), false, "snipe_backward_whitespace_or_token_boundary", 43, "Delete a single, whole token on or to the left of the cursor and post it to the clipboard.", 90, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 190 },
{ PROC_LINKS(snipe_forward_whitespace_or_token_boundary, 0), false, "snipe_forward_whitespace_or_token_boundary", 42, "Delete a single, whole token on or to the right of the cursor and post it to the clipboard.", 91, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 198 },
{ PROC_LINKS(snippet_lister, 0), true, "snippet_lister", 14, "Opens a snippet lister for inserting whole pre-written snippets of text.", 72, "c:\\4ed\\code\\custom\\4coder_combined_write_commands.cpp", 53, 237 },
{ PROC_LINKS(suppress_mouse, 0), false, "suppress_mouse", 14, "Hides the mouse and causes all mosue input (clicks, position, wheel) to be ignored.", 83, "c:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 403 },
{ PROC_LINKS(swap_panels, 0), false, "swap_panels", 11, "Swaps the active panel with it's sibling.", 41, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1524 },
{ PROC_LINKS(test_double_backspace, 0), false, "test_double_backspace", 21, "Made for testing purposes (I should have deleted this if you are reading it let me know)", 88, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 115 },
{ PROC_LINKS(theme_lister, 0), true, "theme_lister", 12, "Opens an interactive list of all registered themes.", 51, "c:\\4ed\\code\\custom\\4coder_lists.cpp", 35, 785 },
{ PROC_LINKS(to_lowercase, 0), false, "to_lowercase", 12, "Converts all ascii text in the range between the cursor and the mark to lowercase.", 82, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 574 },
{ PROC_LINKS(to_uppercase, 0), false, "to_uppercase", 12, "Converts all ascii text in the range between the cursor and the mark to uppercase.", 82, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 561 },
{ PROC_LINKS(toggle_filebar, 0), false, "toggle_filebar", 14, "Toggles the visibility status of the current view's filebar.", 60, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 667 },
{ PROC_LINKS(toggle_fps_meter, 0), false, "toggle_fps_meter", 16, "Toggles the visibility of the FPS performance meter", 51, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 676 },
{ PROC_LINKS(toggle_fullscreen, 0), false, "toggle_fullscreen", 17, "Toggle fullscreen mode on or off. The change(s) do not take effect until the next frame.", 89, "c:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 451 },
{ PROC_LINKS(toggle_highlight_enclosing_scopes, 0), false, "toggle_highlight_enclosing_scopes", 33, "In code files scopes surrounding the cursor are highlighted with distinguishing colors.", 87, "c:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 439 },
{ PROC_LINKS(toggle_highlight_line_at_cursor, 0), false, "toggle_highlight_line_at_cursor", 31, "Toggles the line highlight at the cursor.", 41, "c:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 433 },
{ PROC_LINKS(toggle_line_numbers, 0), false, "toggle_line_numbers", 19, "Toggles the left margin line numbers.", 37, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 730 },
{ PROC_LINKS(toggle_line_wrap, 0), false, "toggle_line_wrap", 16, "Toggles the line wrap setting on this buffer.", 45, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 736 },
{ PROC_LINKS(toggle_mouse, 0), false, "toggle_mouse", 12, "Toggles the mouse suppression mode, see suppress_mouse and allow_mouse.", 71, "c:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 415 },
{ PROC_LINKS(toggle_paren_matching_helper, 0), false, "toggle_paren_matching_helper", 28, "In code files matching parentheses pairs are colored with distinguishing colors.", 80, "c:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 445 },
{ PROC_LINKS(toggle_show_whitespace, 0), false, "toggle_show_whitespace", 22, "Toggles the current buffer's whitespace visibility status.", 58, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 721 },
{ PROC_LINKS(toggle_virtual_whitespace, 0), false, "toggle_virtual_whitespace", 25, "Toggles the current buffer's virtual whitespace status.", 55, "c:\\4ed\\code\\custom\\4coder_code_index.cpp", 40, 1170 },
{ PROC_LINKS(tutorial_maximize, 0), false, "tutorial_maximize", 17, "Expand the tutorial window", 26, "c:\\4ed\\code\\custom\\4coder_tutorial.cpp", 38, 20 },
{ PROC_LINKS(tutorial_minimize, 0), false, "tutorial_minimize", 17, "Shrink the tutorial window", 26, "c:\\4ed\\code\\custom\\4coder_tutorial.cpp", 38, 34 },
{ PROC_LINKS(uncomment_line, 0), false, "uncomment_line", 14, "If present, delete '//' at the beginning of the line after leading whitespace.", 78, "c:\\4ed\\code\\custom\\4coder_combined_write_commands.cpp", 53, 137 },
{ PROC_LINKS(undo, 0), false, "undo", 4, "Advances backwards through the undo history of the current buffer.", 66, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1624 },
{ PROC_LINKS(undo_all_buffers, 0), false, "undo_all_buffers", 16, "Advances backward through the undo history in the buffer containing the most recent regular edit.", 97, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1651 },
{ PROC_LINKS(view_buffer_other_panel, 0), false, "view_buffer_other_panel", 23, "Set the other non-active panel to view the buffer that the active panel views, and switch to that panel.", 104, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1512 },
{ PROC_LINKS(view_jump_list_with_lister, 0), false, "view_jump_list_with_lister", 26, "When executed on a buffer with jumps, creates a persistent lister for all the jumps", 83, "c:\\4ed\\code\\custom\\4coder_jump_lister.cpp", 41, 59 },
{ PROC_LINKS(word_complete, 0), false, "word_complete", 13, "Iteratively tries completing the word to the left of the cursor with other words in open buffers that have the same prefix string.", 130, "c:\\4ed\\code\\custom\\4coder_search.cpp", 36, 395 },
{ PROC_LINKS(word_complete_drop_down, 0), false, "word_complete_drop_down", 23, "Word complete with drop down menu.", 34, "c:\\4ed\\code\\custom\\4coder_search.cpp", 36, 642 },
{ PROC_LINKS(write_block, 0), false, "write_block", 11, "At the cursor, insert a block comment.", 38, "c:\\4ed\\code\\custom\\4coder_combined_write_commands.cpp", 53, 94 },
{ PROC_LINKS(write_hack, 0), false, "write_hack", 10, "At the cursor, insert a '// HACK' comment, includes user name if it was specified in config.4coder.", 99, "c:\\4ed\\code\\custom\\4coder_combined_write_commands.cpp", 53, 82 },
{ PROC_LINKS(write_note, 0), false, "write_note", 10, "At the cursor, insert a '// NOTE' comment, includes user name if it was specified in config.4coder.", 99, "c:\\4ed\\code\\custom\\4coder_combined_write_commands.cpp", 53, 88 },
{ PROC_LINKS(write_space, 0), false, "write_space", 11, "Inserts a space.", 16, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 67 },
{ PROC_LINKS(write_text_and_auto_indent, 0), false, "write_text_and_auto_indent", 26, "Inserts text and auto-indents the line on which the cursor sits if any of the text contains 'layout punctuation' such as ;:{}()[]# and new lines.", 145, "c:\\4ed\\code\\custom\\4coder_auto_indent.cpp", 41, 427 },
{ PROC_LINKS(write_text_input, 0), false, "write_text_input", 16, "Inserts whatever text was used to trigger this command.", 55, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 59 },
{ PROC_LINKS(write_todo, 0), false, "write_todo", 10, "At the cursor, insert a '// TODO' comment, includes user name if it was specified in config.4coder.", 99, "c:\\4ed\\code\\custom\\4coder_combined_write_commands.cpp", 53, 76 },
{ PROC_LINKS(write_underscore, 0), false, "write_underscore", 16, "Inserts an underscore.", 22, "c:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 73 },
{ PROC_LINKS(write_zero_struct, 0), false, "write_zero_struct", 17, "At the cursor, insert a ' = {};'.", 33, "c:\\4ed\\code\\custom\\4coder_combined_write_commands.cpp", 53, 100 },
};
static i32 fcoder_metacmd_ID_allow_mouse = 0;
static i32 fcoder_metacmd_ID_auto_indent_line_at_cursor = 1;
@ -571,143 +575,145 @@ static i32 fcoder_metacmd_ID_list_all_locations_of_type_definition_of_identifier
static i32 fcoder_metacmd_ID_list_all_substring_locations = 87;
static i32 fcoder_metacmd_ID_list_all_substring_locations_case_insensitive = 88;
static i32 fcoder_metacmd_ID_load_project = 89;
static i32 fcoder_metacmd_ID_load_themes_default_folder = 90;
static i32 fcoder_metacmd_ID_load_themes_hot_directory = 91;
static i32 fcoder_metacmd_ID_make_directory_query = 92;
static i32 fcoder_metacmd_ID_miblo_decrement_basic = 93;
static i32 fcoder_metacmd_ID_miblo_decrement_time_stamp = 94;
static i32 fcoder_metacmd_ID_miblo_decrement_time_stamp_minute = 95;
static i32 fcoder_metacmd_ID_miblo_increment_basic = 96;
static i32 fcoder_metacmd_ID_miblo_increment_time_stamp = 97;
static i32 fcoder_metacmd_ID_miblo_increment_time_stamp_minute = 98;
static i32 fcoder_metacmd_ID_mouse_wheel_change_face_size = 99;
static i32 fcoder_metacmd_ID_mouse_wheel_scroll = 100;
static i32 fcoder_metacmd_ID_move_down = 101;
static i32 fcoder_metacmd_ID_move_down_10 = 102;
static i32 fcoder_metacmd_ID_move_down_textual = 103;
static i32 fcoder_metacmd_ID_move_down_to_blank_line = 104;
static i32 fcoder_metacmd_ID_move_down_to_blank_line_end = 105;
static i32 fcoder_metacmd_ID_move_down_to_blank_line_skip_whitespace = 106;
static i32 fcoder_metacmd_ID_move_left = 107;
static i32 fcoder_metacmd_ID_move_left_alpha_numeric_boundary = 108;
static i32 fcoder_metacmd_ID_move_left_alpha_numeric_or_camel_boundary = 109;
static i32 fcoder_metacmd_ID_move_left_token_boundary = 110;
static i32 fcoder_metacmd_ID_move_left_whitespace_boundary = 111;
static i32 fcoder_metacmd_ID_move_left_whitespace_or_token_boundary = 112;
static i32 fcoder_metacmd_ID_move_line_down = 113;
static i32 fcoder_metacmd_ID_move_line_up = 114;
static i32 fcoder_metacmd_ID_move_right = 115;
static i32 fcoder_metacmd_ID_move_right_alpha_numeric_boundary = 116;
static i32 fcoder_metacmd_ID_move_right_alpha_numeric_or_camel_boundary = 117;
static i32 fcoder_metacmd_ID_move_right_token_boundary = 118;
static i32 fcoder_metacmd_ID_move_right_whitespace_boundary = 119;
static i32 fcoder_metacmd_ID_move_right_whitespace_or_token_boundary = 120;
static i32 fcoder_metacmd_ID_move_up = 121;
static i32 fcoder_metacmd_ID_move_up_10 = 122;
static i32 fcoder_metacmd_ID_move_up_to_blank_line = 123;
static i32 fcoder_metacmd_ID_move_up_to_blank_line_end = 124;
static i32 fcoder_metacmd_ID_move_up_to_blank_line_skip_whitespace = 125;
static i32 fcoder_metacmd_ID_open_all_code = 126;
static i32 fcoder_metacmd_ID_open_all_code_recursive = 127;
static i32 fcoder_metacmd_ID_open_file_in_quotes = 128;
static i32 fcoder_metacmd_ID_open_in_other = 129;
static i32 fcoder_metacmd_ID_open_long_braces = 130;
static i32 fcoder_metacmd_ID_open_long_braces_break = 131;
static i32 fcoder_metacmd_ID_open_long_braces_semicolon = 132;
static i32 fcoder_metacmd_ID_open_matching_file_cpp = 133;
static i32 fcoder_metacmd_ID_open_panel_hsplit = 134;
static i32 fcoder_metacmd_ID_open_panel_vsplit = 135;
static i32 fcoder_metacmd_ID_page_down = 136;
static i32 fcoder_metacmd_ID_page_up = 137;
static i32 fcoder_metacmd_ID_paste = 138;
static i32 fcoder_metacmd_ID_paste_and_indent = 139;
static i32 fcoder_metacmd_ID_paste_next = 140;
static i32 fcoder_metacmd_ID_paste_next_and_indent = 141;
static i32 fcoder_metacmd_ID_place_in_scope = 142;
static i32 fcoder_metacmd_ID_profile_clear = 143;
static i32 fcoder_metacmd_ID_profile_disable = 144;
static i32 fcoder_metacmd_ID_profile_enable = 145;
static i32 fcoder_metacmd_ID_profile_inspect = 146;
static i32 fcoder_metacmd_ID_project_command_lister = 147;
static i32 fcoder_metacmd_ID_project_fkey_command = 148;
static i32 fcoder_metacmd_ID_project_go_to_root_directory = 149;
static i32 fcoder_metacmd_ID_query_replace = 150;
static i32 fcoder_metacmd_ID_query_replace_identifier = 151;
static i32 fcoder_metacmd_ID_query_replace_selection = 152;
static i32 fcoder_metacmd_ID_redo = 153;
static i32 fcoder_metacmd_ID_redo_all_buffers = 154;
static i32 fcoder_metacmd_ID_rename_file_query = 155;
static i32 fcoder_metacmd_ID_reopen = 156;
static i32 fcoder_metacmd_ID_replace_in_all_buffers = 157;
static i32 fcoder_metacmd_ID_replace_in_buffer = 158;
static i32 fcoder_metacmd_ID_replace_in_range = 159;
static i32 fcoder_metacmd_ID_reverse_search = 160;
static i32 fcoder_metacmd_ID_reverse_search_identifier = 161;
static i32 fcoder_metacmd_ID_save = 162;
static i32 fcoder_metacmd_ID_save_all_dirty_buffers = 163;
static i32 fcoder_metacmd_ID_save_to_query = 164;
static i32 fcoder_metacmd_ID_search = 165;
static i32 fcoder_metacmd_ID_search_identifier = 166;
static i32 fcoder_metacmd_ID_seek_beginning_of_line = 167;
static i32 fcoder_metacmd_ID_seek_beginning_of_textual_line = 168;
static i32 fcoder_metacmd_ID_seek_end_of_line = 169;
static i32 fcoder_metacmd_ID_seek_end_of_textual_line = 170;
static i32 fcoder_metacmd_ID_select_all = 171;
static i32 fcoder_metacmd_ID_select_next_scope_absolute = 172;
static i32 fcoder_metacmd_ID_select_next_scope_after_current = 173;
static i32 fcoder_metacmd_ID_select_prev_scope_absolute = 174;
static i32 fcoder_metacmd_ID_select_prev_top_most_scope = 175;
static i32 fcoder_metacmd_ID_select_surrounding_scope = 176;
static i32 fcoder_metacmd_ID_select_surrounding_scope_maximal = 177;
static i32 fcoder_metacmd_ID_set_eol_mode_from_contents = 178;
static i32 fcoder_metacmd_ID_set_eol_mode_to_binary = 179;
static i32 fcoder_metacmd_ID_set_eol_mode_to_crlf = 180;
static i32 fcoder_metacmd_ID_set_eol_mode_to_lf = 181;
static i32 fcoder_metacmd_ID_set_mark = 182;
static i32 fcoder_metacmd_ID_set_mode_to_notepad_like = 183;
static i32 fcoder_metacmd_ID_set_mode_to_original = 184;
static i32 fcoder_metacmd_ID_setup_build_bat = 185;
static i32 fcoder_metacmd_ID_setup_build_bat_and_sh = 186;
static i32 fcoder_metacmd_ID_setup_build_sh = 187;
static i32 fcoder_metacmd_ID_setup_new_project = 188;
static i32 fcoder_metacmd_ID_show_filebar = 189;
static i32 fcoder_metacmd_ID_show_scrollbar = 190;
static i32 fcoder_metacmd_ID_show_the_log_graph = 191;
static i32 fcoder_metacmd_ID_snipe_backward_whitespace_or_token_boundary = 192;
static i32 fcoder_metacmd_ID_snipe_forward_whitespace_or_token_boundary = 193;
static i32 fcoder_metacmd_ID_snippet_lister = 194;
static i32 fcoder_metacmd_ID_suppress_mouse = 195;
static i32 fcoder_metacmd_ID_swap_panels = 196;
static i32 fcoder_metacmd_ID_theme_lister = 197;
static i32 fcoder_metacmd_ID_to_lowercase = 198;
static i32 fcoder_metacmd_ID_to_uppercase = 199;
static i32 fcoder_metacmd_ID_toggle_filebar = 200;
static i32 fcoder_metacmd_ID_toggle_fps_meter = 201;
static i32 fcoder_metacmd_ID_toggle_fullscreen = 202;
static i32 fcoder_metacmd_ID_toggle_highlight_enclosing_scopes = 203;
static i32 fcoder_metacmd_ID_toggle_highlight_line_at_cursor = 204;
static i32 fcoder_metacmd_ID_toggle_line_numbers = 205;
static i32 fcoder_metacmd_ID_toggle_line_wrap = 206;
static i32 fcoder_metacmd_ID_toggle_mouse = 207;
static i32 fcoder_metacmd_ID_toggle_paren_matching_helper = 208;
static i32 fcoder_metacmd_ID_toggle_show_whitespace = 209;
static i32 fcoder_metacmd_ID_toggle_virtual_whitespace = 210;
static i32 fcoder_metacmd_ID_tutorial_maximize = 211;
static i32 fcoder_metacmd_ID_tutorial_minimize = 212;
static i32 fcoder_metacmd_ID_uncomment_line = 213;
static i32 fcoder_metacmd_ID_undo = 214;
static i32 fcoder_metacmd_ID_undo_all_buffers = 215;
static i32 fcoder_metacmd_ID_view_buffer_other_panel = 216;
static i32 fcoder_metacmd_ID_view_jump_list_with_lister = 217;
static i32 fcoder_metacmd_ID_word_complete = 218;
static i32 fcoder_metacmd_ID_word_complete_drop_down = 219;
static i32 fcoder_metacmd_ID_write_block = 220;
static i32 fcoder_metacmd_ID_write_hack = 221;
static i32 fcoder_metacmd_ID_write_note = 222;
static i32 fcoder_metacmd_ID_write_space = 223;
static i32 fcoder_metacmd_ID_write_text_and_auto_indent = 224;
static i32 fcoder_metacmd_ID_write_text_input = 225;
static i32 fcoder_metacmd_ID_write_todo = 226;
static i32 fcoder_metacmd_ID_write_underscore = 227;
static i32 fcoder_metacmd_ID_write_zero_struct = 228;
static i32 fcoder_metacmd_ID_load_theme_current_buffer = 90;
static i32 fcoder_metacmd_ID_load_themes_default_folder = 91;
static i32 fcoder_metacmd_ID_load_themes_hot_directory = 92;
static i32 fcoder_metacmd_ID_make_directory_query = 93;
static i32 fcoder_metacmd_ID_miblo_decrement_basic = 94;
static i32 fcoder_metacmd_ID_miblo_decrement_time_stamp = 95;
static i32 fcoder_metacmd_ID_miblo_decrement_time_stamp_minute = 96;
static i32 fcoder_metacmd_ID_miblo_increment_basic = 97;
static i32 fcoder_metacmd_ID_miblo_increment_time_stamp = 98;
static i32 fcoder_metacmd_ID_miblo_increment_time_stamp_minute = 99;
static i32 fcoder_metacmd_ID_mouse_wheel_change_face_size = 100;
static i32 fcoder_metacmd_ID_mouse_wheel_scroll = 101;
static i32 fcoder_metacmd_ID_move_down = 102;
static i32 fcoder_metacmd_ID_move_down_10 = 103;
static i32 fcoder_metacmd_ID_move_down_textual = 104;
static i32 fcoder_metacmd_ID_move_down_to_blank_line = 105;
static i32 fcoder_metacmd_ID_move_down_to_blank_line_end = 106;
static i32 fcoder_metacmd_ID_move_down_to_blank_line_skip_whitespace = 107;
static i32 fcoder_metacmd_ID_move_left = 108;
static i32 fcoder_metacmd_ID_move_left_alpha_numeric_boundary = 109;
static i32 fcoder_metacmd_ID_move_left_alpha_numeric_or_camel_boundary = 110;
static i32 fcoder_metacmd_ID_move_left_token_boundary = 111;
static i32 fcoder_metacmd_ID_move_left_whitespace_boundary = 112;
static i32 fcoder_metacmd_ID_move_left_whitespace_or_token_boundary = 113;
static i32 fcoder_metacmd_ID_move_line_down = 114;
static i32 fcoder_metacmd_ID_move_line_up = 115;
static i32 fcoder_metacmd_ID_move_right = 116;
static i32 fcoder_metacmd_ID_move_right_alpha_numeric_boundary = 117;
static i32 fcoder_metacmd_ID_move_right_alpha_numeric_or_camel_boundary = 118;
static i32 fcoder_metacmd_ID_move_right_token_boundary = 119;
static i32 fcoder_metacmd_ID_move_right_whitespace_boundary = 120;
static i32 fcoder_metacmd_ID_move_right_whitespace_or_token_boundary = 121;
static i32 fcoder_metacmd_ID_move_up = 122;
static i32 fcoder_metacmd_ID_move_up_10 = 123;
static i32 fcoder_metacmd_ID_move_up_to_blank_line = 124;
static i32 fcoder_metacmd_ID_move_up_to_blank_line_end = 125;
static i32 fcoder_metacmd_ID_move_up_to_blank_line_skip_whitespace = 126;
static i32 fcoder_metacmd_ID_open_all_code = 127;
static i32 fcoder_metacmd_ID_open_all_code_recursive = 128;
static i32 fcoder_metacmd_ID_open_file_in_quotes = 129;
static i32 fcoder_metacmd_ID_open_in_other = 130;
static i32 fcoder_metacmd_ID_open_long_braces = 131;
static i32 fcoder_metacmd_ID_open_long_braces_break = 132;
static i32 fcoder_metacmd_ID_open_long_braces_semicolon = 133;
static i32 fcoder_metacmd_ID_open_matching_file_cpp = 134;
static i32 fcoder_metacmd_ID_open_panel_hsplit = 135;
static i32 fcoder_metacmd_ID_open_panel_vsplit = 136;
static i32 fcoder_metacmd_ID_page_down = 137;
static i32 fcoder_metacmd_ID_page_up = 138;
static i32 fcoder_metacmd_ID_paste = 139;
static i32 fcoder_metacmd_ID_paste_and_indent = 140;
static i32 fcoder_metacmd_ID_paste_next = 141;
static i32 fcoder_metacmd_ID_paste_next_and_indent = 142;
static i32 fcoder_metacmd_ID_place_in_scope = 143;
static i32 fcoder_metacmd_ID_profile_clear = 144;
static i32 fcoder_metacmd_ID_profile_disable = 145;
static i32 fcoder_metacmd_ID_profile_enable = 146;
static i32 fcoder_metacmd_ID_profile_inspect = 147;
static i32 fcoder_metacmd_ID_project_command_lister = 148;
static i32 fcoder_metacmd_ID_project_fkey_command = 149;
static i32 fcoder_metacmd_ID_project_go_to_root_directory = 150;
static i32 fcoder_metacmd_ID_query_replace = 151;
static i32 fcoder_metacmd_ID_query_replace_identifier = 152;
static i32 fcoder_metacmd_ID_query_replace_selection = 153;
static i32 fcoder_metacmd_ID_redo = 154;
static i32 fcoder_metacmd_ID_redo_all_buffers = 155;
static i32 fcoder_metacmd_ID_rename_file_query = 156;
static i32 fcoder_metacmd_ID_reopen = 157;
static i32 fcoder_metacmd_ID_replace_in_all_buffers = 158;
static i32 fcoder_metacmd_ID_replace_in_buffer = 159;
static i32 fcoder_metacmd_ID_replace_in_range = 160;
static i32 fcoder_metacmd_ID_reverse_search = 161;
static i32 fcoder_metacmd_ID_reverse_search_identifier = 162;
static i32 fcoder_metacmd_ID_save = 163;
static i32 fcoder_metacmd_ID_save_all_dirty_buffers = 164;
static i32 fcoder_metacmd_ID_save_to_query = 165;
static i32 fcoder_metacmd_ID_search = 166;
static i32 fcoder_metacmd_ID_search_identifier = 167;
static i32 fcoder_metacmd_ID_seek_beginning_of_line = 168;
static i32 fcoder_metacmd_ID_seek_beginning_of_textual_line = 169;
static i32 fcoder_metacmd_ID_seek_end_of_line = 170;
static i32 fcoder_metacmd_ID_seek_end_of_textual_line = 171;
static i32 fcoder_metacmd_ID_select_all = 172;
static i32 fcoder_metacmd_ID_select_next_scope_absolute = 173;
static i32 fcoder_metacmd_ID_select_next_scope_after_current = 174;
static i32 fcoder_metacmd_ID_select_prev_scope_absolute = 175;
static i32 fcoder_metacmd_ID_select_prev_top_most_scope = 176;
static i32 fcoder_metacmd_ID_select_surrounding_scope = 177;
static i32 fcoder_metacmd_ID_select_surrounding_scope_maximal = 178;
static i32 fcoder_metacmd_ID_set_eol_mode_from_contents = 179;
static i32 fcoder_metacmd_ID_set_eol_mode_to_binary = 180;
static i32 fcoder_metacmd_ID_set_eol_mode_to_crlf = 181;
static i32 fcoder_metacmd_ID_set_eol_mode_to_lf = 182;
static i32 fcoder_metacmd_ID_set_mark = 183;
static i32 fcoder_metacmd_ID_set_mode_to_notepad_like = 184;
static i32 fcoder_metacmd_ID_set_mode_to_original = 185;
static i32 fcoder_metacmd_ID_setup_build_bat = 186;
static i32 fcoder_metacmd_ID_setup_build_bat_and_sh = 187;
static i32 fcoder_metacmd_ID_setup_build_sh = 188;
static i32 fcoder_metacmd_ID_setup_new_project = 189;
static i32 fcoder_metacmd_ID_show_filebar = 190;
static i32 fcoder_metacmd_ID_show_scrollbar = 191;
static i32 fcoder_metacmd_ID_show_the_log_graph = 192;
static i32 fcoder_metacmd_ID_snipe_backward_whitespace_or_token_boundary = 193;
static i32 fcoder_metacmd_ID_snipe_forward_whitespace_or_token_boundary = 194;
static i32 fcoder_metacmd_ID_snippet_lister = 195;
static i32 fcoder_metacmd_ID_suppress_mouse = 196;
static i32 fcoder_metacmd_ID_swap_panels = 197;
static i32 fcoder_metacmd_ID_test_double_backspace = 198;
static i32 fcoder_metacmd_ID_theme_lister = 199;
static i32 fcoder_metacmd_ID_to_lowercase = 200;
static i32 fcoder_metacmd_ID_to_uppercase = 201;
static i32 fcoder_metacmd_ID_toggle_filebar = 202;
static i32 fcoder_metacmd_ID_toggle_fps_meter = 203;
static i32 fcoder_metacmd_ID_toggle_fullscreen = 204;
static i32 fcoder_metacmd_ID_toggle_highlight_enclosing_scopes = 205;
static i32 fcoder_metacmd_ID_toggle_highlight_line_at_cursor = 206;
static i32 fcoder_metacmd_ID_toggle_line_numbers = 207;
static i32 fcoder_metacmd_ID_toggle_line_wrap = 208;
static i32 fcoder_metacmd_ID_toggle_mouse = 209;
static i32 fcoder_metacmd_ID_toggle_paren_matching_helper = 210;
static i32 fcoder_metacmd_ID_toggle_show_whitespace = 211;
static i32 fcoder_metacmd_ID_toggle_virtual_whitespace = 212;
static i32 fcoder_metacmd_ID_tutorial_maximize = 213;
static i32 fcoder_metacmd_ID_tutorial_minimize = 214;
static i32 fcoder_metacmd_ID_uncomment_line = 215;
static i32 fcoder_metacmd_ID_undo = 216;
static i32 fcoder_metacmd_ID_undo_all_buffers = 217;
static i32 fcoder_metacmd_ID_view_buffer_other_panel = 218;
static i32 fcoder_metacmd_ID_view_jump_list_with_lister = 219;
static i32 fcoder_metacmd_ID_word_complete = 220;
static i32 fcoder_metacmd_ID_word_complete_drop_down = 221;
static i32 fcoder_metacmd_ID_write_block = 222;
static i32 fcoder_metacmd_ID_write_hack = 223;
static i32 fcoder_metacmd_ID_write_note = 224;
static i32 fcoder_metacmd_ID_write_space = 225;
static i32 fcoder_metacmd_ID_write_text_and_auto_indent = 226;
static i32 fcoder_metacmd_ID_write_text_input = 227;
static i32 fcoder_metacmd_ID_write_todo = 228;
static i32 fcoder_metacmd_ID_write_underscore = 229;
static i32 fcoder_metacmd_ID_write_zero_struct = 230;
#endif

View File

@ -25,12 +25,14 @@ 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;
@ -90,7 +92,6 @@ 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_post_fade = view_post_fade;
vtable->view_push_context = view_push_context;
vtable->view_pop_context = view_pop_context;
vtable->view_alter_context = view_alter_context;
@ -154,6 +155,7 @@ 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->draw_string_oriented = draw_string_oriented;
vtable->get_string_advance = get_string_advance;
@ -167,6 +169,7 @@ 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;
@ -203,12 +206,14 @@ 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;
@ -268,7 +273,6 @@ 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_post_fade = vtable->view_post_fade;
view_push_context = vtable->view_push_context;
view_pop_context = vtable->view_pop_context;
view_alter_context = vtable->view_alter_context;
@ -332,6 +336,7 @@ 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;
draw_string_oriented = vtable->draw_string_oriented;
get_string_advance = vtable->get_string_advance;
@ -345,6 +350,7 @@ 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;

View File

@ -23,12 +23,14 @@
#define custom_buffer_line_shift_y_sig() Line_Shift_Vertical custom_buffer_line_shift_y(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 line, f32 y_shift)
#define custom_buffer_pos_at_relative_xy_sig() i64 custom_buffer_pos_at_relative_xy(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, Vec2_f32 relative_xy)
#define custom_buffer_relative_box_of_pos_sig() Rect_f32 custom_buffer_relative_box_of_pos(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 pos)
#define custom_buffer_padded_box_of_pos_sig() Rect_f32 custom_buffer_padded_box_of_pos(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 pos)
#define custom_buffer_relative_character_from_pos_sig() i64 custom_buffer_relative_character_from_pos(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 pos)
#define custom_buffer_pos_from_relative_character_sig() i64 custom_buffer_pos_from_relative_character(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 relative_character)
#define custom_view_line_y_difference_sig() f32 custom_view_line_y_difference(Application_Links* app, View_ID view_id, i64 line_a, i64 line_b)
#define custom_view_line_shift_y_sig() Line_Shift_Vertical custom_view_line_shift_y(Application_Links* app, View_ID view_id, i64 line, f32 y_shift)
#define custom_view_pos_at_relative_xy_sig() i64 custom_view_pos_at_relative_xy(Application_Links* app, View_ID view_id, i64 base_line, Vec2_f32 relative_xy)
#define custom_view_relative_box_of_pos_sig() Rect_f32 custom_view_relative_box_of_pos(Application_Links* app, View_ID view_id, i64 base_line, i64 pos)
#define custom_view_padded_box_of_pos_sig() Rect_f32 custom_view_padded_box_of_pos(Application_Links* app, View_ID view_id, i64 base_line, i64 pos)
#define custom_view_relative_character_from_pos_sig() i64 custom_view_relative_character_from_pos(Application_Links* app, View_ID view_id, i64 base_line, i64 pos)
#define custom_view_pos_from_relative_character_sig() i64 custom_view_pos_from_relative_character(Application_Links* app, View_ID view_id, i64 base_line, i64 character)
#define custom_buffer_exists_sig() b32 custom_buffer_exists(Application_Links* app, Buffer_ID buffer_id)
@ -88,7 +90,6 @@
#define custom_view_set_mark_sig() b32 custom_view_set_mark(Application_Links* app, View_ID view_id, Buffer_Seek seek)
#define custom_view_quit_ui_sig() b32 custom_view_quit_ui(Application_Links* app, View_ID view_id)
#define custom_view_set_buffer_sig() b32 custom_view_set_buffer(Application_Links* app, View_ID view_id, Buffer_ID buffer_id, Set_Buffer_Flag flags)
#define custom_view_post_fade_sig() b32 custom_view_post_fade(Application_Links* app, View_ID view_id, f32 seconds, Range_i64 range, ARGB_Color color)
#define custom_view_push_context_sig() b32 custom_view_push_context(Application_Links* app, View_ID view_id, View_Context* ctx)
#define custom_view_pop_context_sig() b32 custom_view_pop_context(Application_Links* app, View_ID view_id)
#define custom_view_alter_context_sig() b32 custom_view_alter_context(Application_Links* app, View_ID view_id, View_Context* ctx)
@ -152,6 +153,7 @@
#define custom_push_hot_directory_sig() String_Const_u8 custom_push_hot_directory(Application_Links* app, Arena* arena)
#define custom_set_hot_directory_sig() void custom_set_hot_directory(Application_Links* app, String_Const_u8 string)
#define custom_send_exit_signal_sig() void custom_send_exit_signal(Application_Links* app)
#define custom_hard_exit_sig() void custom_hard_exit(Application_Links* app)
#define custom_set_window_title_sig() void custom_set_window_title(Application_Links* app, String_Const_u8 title)
#define custom_draw_string_oriented_sig() Vec2_f32 custom_draw_string_oriented(Application_Links* app, Face_ID font_id, ARGB_Color color, String_Const_u8 str, Vec2_f32 point, u32 flags, Vec2_f32 delta)
#define custom_get_string_advance_sig() f32 custom_get_string_advance(Application_Links* app, Face_ID font_id, String_Const_u8 str)
@ -165,6 +167,7 @@
#define custom_text_layout_line_on_screen_sig() Range_f32 custom_text_layout_line_on_screen(Application_Links* app, Text_Layout_ID layout_id, i64 line_number)
#define custom_text_layout_character_on_screen_sig() Rect_f32 custom_text_layout_character_on_screen(Application_Links* app, Text_Layout_ID layout_id, i64 pos)
#define custom_paint_text_color_sig() void custom_paint_text_color(Application_Links* app, Text_Layout_ID layout_id, Range_i64 range, ARGB_Color color)
#define custom_paint_text_color_blend_sig() void custom_paint_text_color_blend(Application_Links* app, Text_Layout_ID layout_id, Range_i64 range, ARGB_Color color, f32 blend)
#define custom_text_layout_free_sig() b32 custom_text_layout_free(Application_Links* app, Text_Layout_ID text_layout_id)
#define custom_draw_text_layout_sig() void custom_draw_text_layout(Application_Links* app, Text_Layout_ID layout_id, ARGB_Color special_color, ARGB_Color ghost_color)
#define custom_open_color_picker_sig() void custom_open_color_picker(Application_Links* app, Color_Picker* picker)
@ -197,12 +200,14 @@ typedef f32 custom_buffer_line_y_difference_type(Application_Links* app, Buffer_
typedef Line_Shift_Vertical custom_buffer_line_shift_y_type(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 line, f32 y_shift);
typedef i64 custom_buffer_pos_at_relative_xy_type(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, Vec2_f32 relative_xy);
typedef Rect_f32 custom_buffer_relative_box_of_pos_type(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 pos);
typedef Rect_f32 custom_buffer_padded_box_of_pos_type(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 pos);
typedef i64 custom_buffer_relative_character_from_pos_type(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 pos);
typedef i64 custom_buffer_pos_from_relative_character_type(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 relative_character);
typedef f32 custom_view_line_y_difference_type(Application_Links* app, View_ID view_id, i64 line_a, i64 line_b);
typedef Line_Shift_Vertical custom_view_line_shift_y_type(Application_Links* app, View_ID view_id, i64 line, f32 y_shift);
typedef i64 custom_view_pos_at_relative_xy_type(Application_Links* app, View_ID view_id, i64 base_line, Vec2_f32 relative_xy);
typedef Rect_f32 custom_view_relative_box_of_pos_type(Application_Links* app, View_ID view_id, i64 base_line, i64 pos);
typedef Rect_f32 custom_view_padded_box_of_pos_type(Application_Links* app, View_ID view_id, i64 base_line, i64 pos);
typedef i64 custom_view_relative_character_from_pos_type(Application_Links* app, View_ID view_id, i64 base_line, i64 pos);
typedef i64 custom_view_pos_from_relative_character_type(Application_Links* app, View_ID view_id, i64 base_line, i64 character);
typedef b32 custom_buffer_exists_type(Application_Links* app, Buffer_ID buffer_id);
@ -262,7 +267,6 @@ typedef b32 custom_view_set_buffer_scroll_type(Application_Links* app, View_ID v
typedef b32 custom_view_set_mark_type(Application_Links* app, View_ID view_id, Buffer_Seek seek);
typedef b32 custom_view_quit_ui_type(Application_Links* app, View_ID view_id);
typedef b32 custom_view_set_buffer_type(Application_Links* app, View_ID view_id, Buffer_ID buffer_id, Set_Buffer_Flag flags);
typedef b32 custom_view_post_fade_type(Application_Links* app, View_ID view_id, f32 seconds, Range_i64 range, ARGB_Color color);
typedef b32 custom_view_push_context_type(Application_Links* app, View_ID view_id, View_Context* ctx);
typedef b32 custom_view_pop_context_type(Application_Links* app, View_ID view_id);
typedef b32 custom_view_alter_context_type(Application_Links* app, View_ID view_id, View_Context* ctx);
@ -326,6 +330,7 @@ typedef b32 custom_try_release_face_type(Application_Links* app, Face_ID id, Fac
typedef String_Const_u8 custom_push_hot_directory_type(Application_Links* app, Arena* arena);
typedef void custom_set_hot_directory_type(Application_Links* app, String_Const_u8 string);
typedef void custom_send_exit_signal_type(Application_Links* app);
typedef void custom_hard_exit_type(Application_Links* app);
typedef void custom_set_window_title_type(Application_Links* app, String_Const_u8 title);
typedef Vec2_f32 custom_draw_string_oriented_type(Application_Links* app, Face_ID font_id, ARGB_Color color, String_Const_u8 str, Vec2_f32 point, u32 flags, Vec2_f32 delta);
typedef f32 custom_get_string_advance_type(Application_Links* app, Face_ID font_id, String_Const_u8 str);
@ -339,6 +344,7 @@ typedef Range_i64 custom_text_layout_get_visible_range_type(Application_Links* a
typedef Range_f32 custom_text_layout_line_on_screen_type(Application_Links* app, Text_Layout_ID layout_id, i64 line_number);
typedef Rect_f32 custom_text_layout_character_on_screen_type(Application_Links* app, Text_Layout_ID layout_id, i64 pos);
typedef void custom_paint_text_color_type(Application_Links* app, Text_Layout_ID layout_id, Range_i64 range, ARGB_Color color);
typedef void custom_paint_text_color_blend_type(Application_Links* app, Text_Layout_ID layout_id, Range_i64 range, ARGB_Color color, f32 blend);
typedef b32 custom_text_layout_free_type(Application_Links* app, Text_Layout_ID text_layout_id);
typedef void custom_draw_text_layout_type(Application_Links* app, Text_Layout_ID layout_id, ARGB_Color special_color, ARGB_Color ghost_color);
typedef void custom_open_color_picker_type(Application_Links* app, Color_Picker* picker);
@ -372,12 +378,14 @@ 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;
@ -437,7 +445,6 @@ 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_post_fade_type *view_post_fade;
custom_view_push_context_type *view_push_context;
custom_view_pop_context_type *view_pop_context;
custom_view_alter_context_type *view_alter_context;
@ -501,6 +508,7 @@ 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_draw_string_oriented_type *draw_string_oriented;
custom_get_string_advance_type *get_string_advance;
@ -514,6 +522,7 @@ 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;
@ -548,12 +557,14 @@ internal f32 buffer_line_y_difference(Application_Links* app, Buffer_ID buffer_i
internal Line_Shift_Vertical buffer_line_shift_y(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 line, f32 y_shift);
internal i64 buffer_pos_at_relative_xy(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, Vec2_f32 relative_xy);
internal Rect_f32 buffer_relative_box_of_pos(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 pos);
internal Rect_f32 buffer_padded_box_of_pos(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 pos);
internal i64 buffer_relative_character_from_pos(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 pos);
internal i64 buffer_pos_from_relative_character(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 relative_character);
internal f32 view_line_y_difference(Application_Links* app, View_ID view_id, i64 line_a, i64 line_b);
internal Line_Shift_Vertical view_line_shift_y(Application_Links* app, View_ID view_id, i64 line, f32 y_shift);
internal i64 view_pos_at_relative_xy(Application_Links* app, View_ID view_id, i64 base_line, Vec2_f32 relative_xy);
internal Rect_f32 view_relative_box_of_pos(Application_Links* app, View_ID view_id, i64 base_line, i64 pos);
internal Rect_f32 view_padded_box_of_pos(Application_Links* app, View_ID view_id, i64 base_line, i64 pos);
internal i64 view_relative_character_from_pos(Application_Links* app, View_ID view_id, i64 base_line, i64 pos);
internal i64 view_pos_from_relative_character(Application_Links* app, View_ID view_id, i64 base_line, i64 character);
internal b32 buffer_exists(Application_Links* app, Buffer_ID buffer_id);
@ -613,7 +624,6 @@ internal b32 view_set_buffer_scroll(Application_Links* app, View_ID view_id, Buf
internal b32 view_set_mark(Application_Links* app, View_ID view_id, Buffer_Seek seek);
internal b32 view_quit_ui(Application_Links* app, View_ID view_id);
internal b32 view_set_buffer(Application_Links* app, View_ID view_id, Buffer_ID buffer_id, Set_Buffer_Flag flags);
internal b32 view_post_fade(Application_Links* app, View_ID view_id, f32 seconds, Range_i64 range, ARGB_Color color);
internal b32 view_push_context(Application_Links* app, View_ID view_id, View_Context* ctx);
internal b32 view_pop_context(Application_Links* app, View_ID view_id);
internal b32 view_alter_context(Application_Links* app, View_ID view_id, View_Context* ctx);
@ -677,6 +687,7 @@ internal b32 try_release_face(Application_Links* app, Face_ID id, Face_ID replac
internal String_Const_u8 push_hot_directory(Application_Links* app, Arena* arena);
internal void set_hot_directory(Application_Links* app, String_Const_u8 string);
internal void send_exit_signal(Application_Links* app);
internal void hard_exit(Application_Links* app);
internal void set_window_title(Application_Links* app, String_Const_u8 title);
internal Vec2_f32 draw_string_oriented(Application_Links* app, Face_ID font_id, ARGB_Color color, String_Const_u8 str, Vec2_f32 point, u32 flags, Vec2_f32 delta);
internal f32 get_string_advance(Application_Links* app, Face_ID font_id, String_Const_u8 str);
@ -690,6 +701,7 @@ internal Range_i64 text_layout_get_visible_range(Application_Links* app, Text_La
internal Range_f32 text_layout_line_on_screen(Application_Links* app, Text_Layout_ID layout_id, i64 line_number);
internal Rect_f32 text_layout_character_on_screen(Application_Links* app, Text_Layout_ID layout_id, i64 pos);
internal void paint_text_color(Application_Links* app, Text_Layout_ID layout_id, Range_i64 range, ARGB_Color color);
internal void paint_text_color_blend(Application_Links* app, Text_Layout_ID layout_id, Range_i64 range, ARGB_Color color, f32 blend);
internal b32 text_layout_free(Application_Links* app, Text_Layout_ID text_layout_id);
internal void draw_text_layout(Application_Links* app, Text_Layout_ID layout_id, ARGB_Color special_color, ARGB_Color ghost_color);
internal void open_color_picker(Application_Links* app, Color_Picker* picker);
@ -724,12 +736,14 @@ global custom_buffer_line_y_difference_type *buffer_line_y_difference = 0;
global custom_buffer_line_shift_y_type *buffer_line_shift_y = 0;
global custom_buffer_pos_at_relative_xy_type *buffer_pos_at_relative_xy = 0;
global custom_buffer_relative_box_of_pos_type *buffer_relative_box_of_pos = 0;
global custom_buffer_padded_box_of_pos_type *buffer_padded_box_of_pos = 0;
global custom_buffer_relative_character_from_pos_type *buffer_relative_character_from_pos = 0;
global custom_buffer_pos_from_relative_character_type *buffer_pos_from_relative_character = 0;
global custom_view_line_y_difference_type *view_line_y_difference = 0;
global custom_view_line_shift_y_type *view_line_shift_y = 0;
global custom_view_pos_at_relative_xy_type *view_pos_at_relative_xy = 0;
global custom_view_relative_box_of_pos_type *view_relative_box_of_pos = 0;
global custom_view_padded_box_of_pos_type *view_padded_box_of_pos = 0;
global custom_view_relative_character_from_pos_type *view_relative_character_from_pos = 0;
global custom_view_pos_from_relative_character_type *view_pos_from_relative_character = 0;
global custom_buffer_exists_type *buffer_exists = 0;
@ -789,7 +803,6 @@ global custom_view_set_buffer_scroll_type *view_set_buffer_scroll = 0;
global custom_view_set_mark_type *view_set_mark = 0;
global custom_view_quit_ui_type *view_quit_ui = 0;
global custom_view_set_buffer_type *view_set_buffer = 0;
global custom_view_post_fade_type *view_post_fade = 0;
global custom_view_push_context_type *view_push_context = 0;
global custom_view_pop_context_type *view_pop_context = 0;
global custom_view_alter_context_type *view_alter_context = 0;
@ -853,6 +866,7 @@ global custom_try_release_face_type *try_release_face = 0;
global custom_push_hot_directory_type *push_hot_directory = 0;
global custom_set_hot_directory_type *set_hot_directory = 0;
global custom_send_exit_signal_type *send_exit_signal = 0;
global custom_hard_exit_type *hard_exit = 0;
global custom_set_window_title_type *set_window_title = 0;
global custom_draw_string_oriented_type *draw_string_oriented = 0;
global custom_get_string_advance_type *get_string_advance = 0;
@ -866,6 +880,7 @@ global custom_text_layout_get_visible_range_type *text_layout_get_visible_range
global custom_text_layout_line_on_screen_type *text_layout_line_on_screen = 0;
global custom_text_layout_character_on_screen_type *text_layout_character_on_screen = 0;
global custom_paint_text_color_type *paint_text_color = 0;
global custom_paint_text_color_blend_type *paint_text_color_blend = 0;
global custom_text_layout_free_type *text_layout_free = 0;
global custom_draw_text_layout_type *draw_text_layout = 0;
global custom_open_color_picker_type *open_color_picker = 0;

View File

@ -161,6 +161,15 @@ api_param(arena, call, "i64", "base_line");
api_param(arena, call, "i64", "pos");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("buffer_padded_box_of_pos"), string_u8_litexpr("Rect_f32"), string_u8_litexpr(""));
api_param(arena, call, "Application_Links*", "app");
api_param(arena, call, "Buffer_ID", "buffer_id");
api_param(arena, call, "f32", "width");
api_param(arena, call, "Face_ID", "face_id");
api_param(arena, call, "i64", "base_line");
api_param(arena, call, "i64", "pos");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("buffer_relative_character_from_pos"), string_u8_litexpr("i64"), string_u8_litexpr(""));
api_param(arena, call, "Application_Links*", "app");
api_param(arena, call, "Buffer_ID", "buffer_id");
@ -207,6 +216,13 @@ api_param(arena, call, "i64", "base_line");
api_param(arena, call, "i64", "pos");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("view_padded_box_of_pos"), string_u8_litexpr("Rect_f32"), string_u8_litexpr(""));
api_param(arena, call, "Application_Links*", "app");
api_param(arena, call, "View_ID", "view_id");
api_param(arena, call, "i64", "base_line");
api_param(arena, call, "i64", "pos");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("view_relative_character_from_pos"), string_u8_litexpr("i64"), string_u8_litexpr(""));
api_param(arena, call, "Application_Links*", "app");
api_param(arena, call, "View_ID", "view_id");
@ -890,6 +906,10 @@ API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("send_e
api_param(arena, call, "Application_Links*", "app");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("hard_exit"), string_u8_litexpr("void"), string_u8_litexpr(""));
api_param(arena, call, "Application_Links*", "app");
}
{
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("set_window_title"), string_u8_litexpr("void"), string_u8_litexpr(""));
api_param(arena, call, "Application_Links*", "app");
api_param(arena, call, "String_Const_u8", "title");
@ -968,7 +988,7 @@ api_param(arena, call, "i64", "pos");
API_Call *call = api_call_with_location(arena, result, string_u8_litexpr("paint_text_color"), string_u8_litexpr("void"), string_u8_litexpr(""));
api_param(arena, call, "Application_Links*", "app");
api_param(arena, call, "Text_Layout_ID", "layout_id");
api_param(arena, call, "Interval_i64", "range");
api_param(arena, call, "Range_i64", "range");
api_param(arena, call, "ARGB_Color", "color");
}
{

View File

@ -23,12 +23,14 @@ api(custom) function f32 buffer_line_y_difference(Application_Links* app, Buffer
api(custom) function Line_Shift_Vertical buffer_line_shift_y(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 line, f32 y_shift);
api(custom) function i64 buffer_pos_at_relative_xy(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, Vec2_f32 relative_xy);
api(custom) function Rect_f32 buffer_relative_box_of_pos(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 pos);
api(custom) function Rect_f32 buffer_padded_box_of_pos(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 pos);
api(custom) function i64 buffer_relative_character_from_pos(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 pos);
api(custom) function i64 buffer_pos_from_relative_character(Application_Links* app, Buffer_ID buffer_id, f32 width, Face_ID face_id, i64 base_line, i64 relative_character);
api(custom) function f32 view_line_y_difference(Application_Links* app, View_ID view_id, i64 line_a, i64 line_b);
api(custom) function Line_Shift_Vertical view_line_shift_y(Application_Links* app, View_ID view_id, i64 line, f32 y_shift);
api(custom) function i64 view_pos_at_relative_xy(Application_Links* app, View_ID view_id, i64 base_line, Vec2_f32 relative_xy);
api(custom) function Rect_f32 view_relative_box_of_pos(Application_Links* app, View_ID view_id, i64 base_line, i64 pos);
api(custom) function Rect_f32 view_padded_box_of_pos(Application_Links* app, View_ID view_id, i64 base_line, i64 pos);
api(custom) function i64 view_relative_character_from_pos(Application_Links* app, View_ID view_id, i64 base_line, i64 pos);
api(custom) function i64 view_pos_from_relative_character(Application_Links* app, View_ID view_id, i64 base_line, i64 character);
api(custom) function b32 buffer_exists(Application_Links* app, Buffer_ID buffer_id);
@ -88,7 +90,6 @@ api(custom) function b32 view_set_buffer_scroll(Application_Links* app, View_ID
api(custom) function b32 view_set_mark(Application_Links* app, View_ID view_id, Buffer_Seek seek);
api(custom) function b32 view_quit_ui(Application_Links* app, View_ID view_id);
api(custom) function b32 view_set_buffer(Application_Links* app, View_ID view_id, Buffer_ID buffer_id, Set_Buffer_Flag flags);
api(custom) function b32 view_post_fade(Application_Links* app, View_ID view_id, f32 seconds, Range_i64 range, ARGB_Color color);
api(custom) function b32 view_push_context(Application_Links* app, View_ID view_id, View_Context* ctx);
api(custom) function b32 view_pop_context(Application_Links* app, View_ID view_id);
api(custom) function b32 view_alter_context(Application_Links* app, View_ID view_id, View_Context* ctx);
@ -152,6 +153,7 @@ api(custom) function b32 try_release_face(Application_Links* app, Face_ID id, Fa
api(custom) function String_Const_u8 push_hot_directory(Application_Links* app, Arena* arena);
api(custom) function void set_hot_directory(Application_Links* app, String_Const_u8 string);
api(custom) function void send_exit_signal(Application_Links* app);
api(custom) function void hard_exit(Application_Links* app);
api(custom) function void set_window_title(Application_Links* app, String_Const_u8 title);
api(custom) function Vec2_f32 draw_string_oriented(Application_Links* app, Face_ID font_id, ARGB_Color color, String_Const_u8 str, Vec2_f32 point, u32 flags, Vec2_f32 delta);
api(custom) function f32 get_string_advance(Application_Links* app, Face_ID font_id, String_Const_u8 str);
@ -165,6 +167,7 @@ api(custom) function Range_i64 text_layout_get_visible_range(Application_Links*
api(custom) function Range_f32 text_layout_line_on_screen(Application_Links* app, Text_Layout_ID layout_id, i64 line_number);
api(custom) function Rect_f32 text_layout_character_on_screen(Application_Links* app, Text_Layout_ID layout_id, i64 pos);
api(custom) function void paint_text_color(Application_Links* app, Text_Layout_ID layout_id, Range_i64 range, ARGB_Color color);
api(custom) function void paint_text_color_blend(Application_Links* app, Text_Layout_ID layout_id, Range_i64 range, ARGB_Color color, f32 blend);
api(custom) function b32 text_layout_free(Application_Links* app, Text_Layout_ID text_layout_id);
api(custom) function void draw_text_layout(Application_Links* app, Text_Layout_ID layout_id, ARGB_Color special_color, ARGB_Color ghost_color);
api(custom) function void open_color_picker(Application_Links* app, Color_Picker* picker);

View File

@ -43,447 +43,453 @@ lexeme_table_lookup(u64 *hash_array, String_Const_u8 *key_array,
}
#endif
u64 main_keys_hash_array[121] = {
0x3165da52e461ac3f,0x0000000000000000,0x3165da52f92661bd,0x0000000000000000,
0x0000000000000000,0x0000000000000000,0x3165da52f9fa6ddb,0xbfc3c777d05a650b,
0x3165da52ea1d2cb3,0x0000000000000000,0x0000000000000000,0x0000000000000000,
0x0000000000000000,0xa47e4b3347ca768b,0xa47e4b0d60643265,0xf9ddaa09147bac4d,
0x95351611c4501ef3,0x0000000000000000,0x0000000000000000,0xa47e4b33693ada65,
0x0000000000000000,0xdb05013ca08bb8f1,0xf9ddaa091485019b,0xbfc3dfcbf5462bb3,
0x0000000000000000,0x3165da52f85e6961,0x0000000000000000,0xdb0563922ce5394d,
0x0000000000000000,0xa47e4b334bfc993f,0xdb02e2748a4d7e43,0x0000000000000000,
0xb4c81ca554c806f3,0x0000000000000000,0x3165da52e0f88b5b,0x501eeeb814fbf821,
0x0000000000000000,0xdb0503951fae6cc1,0x0000000000000000,0x0000000000000000,
0xbfc3de349dfab331,0x0000000000000000,0x0000000000000000,0x3165da52f092830f,
0xa47e4b300b3f05d3,0xbfc3dfcbf546362d,0xdb05125809d1c12f,0x0000000000000000,
0xed66c2eeb45a9c73,0x0000000000000000,0xf9ddaa0914eaa03f,0x77f5a2bcd06af3a3,
0xa47e4b0cab3b440f,0x0000000000000000,0x0000000000000000,0x3165da52ebde8871,
0xa47e4b0cab0869b5,0x3165da52e5b576b7,0x0000000000000000,0x0000000000000000,
0xa47e4b336935d383,0x0000000000000000,0x0000000000000000,0xa47e4b30efc0220b,
0x0000000000000000,0x0000000000000000,0x501eeeb814fabe67,0xbfc3dfefa2fc3a77,
0x0000000000000000,0x0000000000000000,0x0000000000000000,0xf9ddaa0914bb0bf9,
0x0000000000000000,0xf9ddaa09148a58bb,0x0000000000000000,0xdb02e323971f6e8d,
0x501eeeb814fa0161,0xa9cef01e4d45a29b,0x501eeeb814fb939f,0x0000000000000000,
0xdb0517ba16b3ab83,0xbfc3dfb0ab021849,0xdb0541265bb691e9,0xbfc3df66cacb41a5,
0xa47e4b325526bb31,0x0000000000000000,0xeca54fbddbbe35d5,0xa47e4b3347a263d3,
0x0000000000000000,0x77e3dcb62d4753c1,0xdb05aa39286523b1,0x0000000000000000,
0xf9ddaa0914b809a1,0x0000000000000000,0xc6f60bbdf7c8c073,0x3165da52e44f8393,
0x0000000000000000,0x0000000000000000,0xa47e4b32f4f66927,0x0000000000000000,
0xf9ddaa0914dd4631,0x0000000000000000,0xa47e4b322642ad51,0x0000000000000000,
0x0000000000000000,0x0000000000000000,0x0000000000000000,0x0000000000000000,
0xa47e4b335ea331b5,0x0000000000000000,0x0000000000000000,0x0000000000000000,
0xdb0545d45d35a161,0xeca54fbddbbe34ff,0x44a0daa872c59baf,0x0000000000000000,
0xf9ddaa0914c5876b,0x0000000000000000,0x501eeeb814fa0b79,0xf9ddaa0914df8d85,
0xf9ddaa0914b167f3,
u64 cpp_main_keys_hash_array[124] = {
0x26092f2f0215ece3,0x0000000000000000,0x5ce5a2eda58b1f23,0xb2d6c5c6769fa3a3,
0xb9ddf454bfe26d23,0x0000000000000000,0xcd0f6cfa687dd553,0x0000000000000000,
0x0000000000000000,0x5ce5a2e0c5100279,0x5ce5a2ede7babb3d,0x0000000000000000,
0x0000000000000000,0x6f6d951cb7cb582d,0x0e10b5f7624a6565,0xf889fe35be4428e3,
0x6f6d951cb404483f,0x26092f2f02f1c5ef,0x0000000000000000,0xe2b3ddb2fb5b2e6b,
0x0000000000000000,0x6f6d951cb4ea937d,0x0000000000000000,0x0000000000000000,
0x0000000000000000,0x0e10b1af23a24eb5,0x5ce5a2f3706ea43f,0x0000000000000000,
0xb2d6ca88b991d451,0xe2b3ddb2fb5a20a9,0x0000000000000000,0x26092f2f02d33cab,
0x0000000000000000,0x0000000000000000,0x5ce5a2e66f839a73,0x0000000000000000,
0x5ce5a2eda5890521,0x0000000000000000,0x6f6d951cb4228ddb,0x6f6d951cba73c8ab,
0xb9ddf454bfe26e41,0xd50b424c05eec7e9,0x8557f78510d2bb43,0x0000000000000000,
0x0000000000000000,0x26092f2f020b132d,0x0000000000000000,0x0000000000000000,
0xe2b3ddb2fb5bc1c9,0x0000000000000000,0x8ef935ae0949ace3,0x0000000000000000,
0x0000000000000000,0x0000000000000000,0x0000000000000000,0x26092f2f02d2781b,
0x26092f2f02e7a15d,0xb2d6c74182f6a66d,0x0000000000000000,0x0000000000000000,
0x0000000000000000,0x0000000000000000,0x0000000000000000,0x26092f2f02e78453,
0xe2b3ddb2fb5bd5b5,0xb2d6c74182f6a7e9,0x0000000000000000,0x0000000000000000,
0xb2d6c6c7361150b5,0x5ce5a2e0b306cde5,0x0000000000000000,0x0000000000000000,
0x0000000000000000,0x0000000000000000,0x5ce5a2e7e5c24db3,0x26092f2f0216583b,
0x0e101bb85ac205ad,0x6f6d951cacb1aa35,0x0000000000000000,0x0000000000000000,
0x0000000000000000,0x5ce5a2e197faf9d9,0xe2b3ddb2fb5baba1,0x6f6d951cba402e7b,
0x26092f2f02e1d2eb,0x0000000000000000,0x73a9345f7aa71363,0x0000000000000000,
0x0e10b66610117f15,0x0000000000000000,0xe95e136b18f58763,0x0e10078c941fcafb,
0x0000000000000000,0x0000000000000000,0x5ce5a2f37530abf3,0xb2d6c68c37b0f1f7,
0x5ce5a2e7e4364fe9,0x5ce5a2f37536698d,0x0000000000000000,0x0000000000000000,
0x5ce5a2e049adcf39,0x0000000000000000,0x0000000000000000,0x0e100efea5987c03,
0x6f6d951c847de2fb,0x0e106caf9da9bbbd,0x0e109bd9232f3723,0x0000000000000000,
0x6f6d951c86ec6929,0x0000000000000000,0x0000000000000000,0x0e114d6868e6156b,
0x6f6d951c8f3e1899,0x0e105b1fdc2b41ad,0xb2d6c5dc5a9a53e5,0x0000000000000000,
0x0000000000000000,0x0000000000000000,0x26092f2f0212aa4b,0x0000000000000000,
0x0000000000000000,0x0000000000000000,0x5ce5a2f37ca36a8b,0xcd1ba7f6b56d6ce3,
};
u8 main_keys_key_array_0[] = {0x63,0x61,0x74,0x63,0x68,};
u8 main_keys_key_array_2[] = {0x75,0x6e,0x69,0x6f,0x6e,};
u8 main_keys_key_array_6[] = {0x75,0x73,0x69,0x6e,0x67,};
u8 main_keys_key_array_7[] = {0x76,0x69,0x72,0x74,0x75,0x61,0x6c,};
u8 main_keys_key_array_8[] = {0x66,0x6c,0x6f,0x61,0x74,};
u8 main_keys_key_array_13[] = {0x73,0x74,0x61,0x74,0x69,0x63,};
u8 main_keys_key_array_14[] = {0x69,0x6e,0x6c,0x69,0x6e,0x65,};
u8 main_keys_key_array_15[] = {0x74,0x72,0x75,0x65,};
u8 main_keys_key_array_16[] = {0x64,0x79,0x6e,0x61,0x6d,0x69,0x63,0x5f,0x63,0x61,0x73,0x74,};
u8 main_keys_key_array_19[] = {0x73,0x69,0x7a,0x65,0x6f,0x66,};
u8 main_keys_key_array_21[] = {0x74,0x65,0x6d,0x70,0x6c,0x61,0x74,0x65,};
u8 main_keys_key_array_22[] = {0x74,0x68,0x69,0x73,};
u8 main_keys_key_array_23[] = {0x61,0x6c,0x69,0x67,0x6e,0x61,0x73,};
u8 main_keys_key_array_25[] = {0x77,0x68,0x69,0x6c,0x65,};
u8 main_keys_key_array_27[] = {0x74,0x79,0x70,0x65,0x6e,0x61,0x6d,0x65,};
u8 main_keys_key_array_29[] = {0x73,0x77,0x69,0x74,0x63,0x68,};
u8 main_keys_key_array_30[] = {0x65,0x78,0x70,0x6c,0x69,0x63,0x69,0x74,};
u8 main_keys_key_array_32[] = {0x73,0x74,0x61,0x74,0x69,0x63,0x5f,0x63,0x61,0x73,0x74,};
u8 main_keys_key_array_34[] = {0x62,0x72,0x65,0x61,0x6b,};
u8 main_keys_key_array_35[] = {0x74,0x72,0x79,};
u8 main_keys_key_array_37[] = {0x64,0x65,0x63,0x6c,0x74,0x79,0x70,0x65,};
u8 main_keys_key_array_40[] = {0x70,0x72,0x69,0x76,0x61,0x74,0x65,};
u8 main_keys_key_array_43[] = {0x73,0x68,0x6f,0x72,0x74,};
u8 main_keys_key_array_44[] = {0x74,0x79,0x70,0x65,0x69,0x64,};
u8 main_keys_key_array_45[] = {0x61,0x6c,0x69,0x67,0x6e,0x6f,0x66,};
u8 main_keys_key_array_46[] = {0x6e,0x6f,0x65,0x78,0x63,0x65,0x70,0x74,};
u8 main_keys_key_array_48[] = {0x72,0x65,0x69,0x6e,0x74,0x65,0x72,0x70,0x72,0x65,0x74,0x5f,0x63,0x61,0x73,0x74,};
u8 main_keys_key_array_50[] = {0x67,0x6f,0x74,0x6f,};
u8 main_keys_key_array_51[] = {0x70,0x72,0x6f,0x74,0x65,0x63,0x74,0x65,0x64,};
u8 main_keys_key_array_52[] = {0x65,0x78,0x70,0x6f,0x72,0x74,};
u8 main_keys_key_array_55[] = {0x66,0x61,0x6c,0x73,0x65,};
u8 main_keys_key_array_56[] = {0x65,0x78,0x74,0x65,0x72,0x6e,};
u8 main_keys_key_array_57[] = {0x63,0x6c,0x61,0x73,0x73,};
u8 main_keys_key_array_60[] = {0x73,0x69,0x67,0x6e,0x65,0x64,};
u8 main_keys_key_array_63[] = {0x70,0x75,0x62,0x6c,0x69,0x63,};
u8 main_keys_key_array_66[] = {0x69,0x6e,0x74,};
u8 main_keys_key_array_67[] = {0x64,0x65,0x66,0x61,0x75,0x6c,0x74,};
u8 main_keys_key_array_71[] = {0x63,0x68,0x61,0x72,};
u8 main_keys_key_array_73[] = {0x6c,0x6f,0x6e,0x67,};
u8 main_keys_key_array_75[] = {0x63,0x6f,0x6e,0x74,0x69,0x6e,0x75,0x65,};
u8 main_keys_key_array_76[] = {0x66,0x6f,0x72,};
u8 main_keys_key_array_77[] = {0x74,0x68,0x72,0x65,0x61,0x64,0x5f,0x6c,0x6f,0x63,0x61,0x6c,};
u8 main_keys_key_array_78[] = {0x6e,0x65,0x77,};
u8 main_keys_key_array_80[] = {0x75,0x6e,0x73,0x69,0x67,0x6e,0x65,0x64,};
u8 main_keys_key_array_81[] = {0x6e,0x75,0x6c,0x6c,0x70,0x74,0x72,};
u8 main_keys_key_array_82[] = {0x6f,0x70,0x65,0x72,0x61,0x74,0x6f,0x72,};
u8 main_keys_key_array_83[] = {0x74,0x79,0x70,0x65,0x64,0x65,0x66,};
u8 main_keys_key_array_84[] = {0x64,0x65,0x6c,0x65,0x74,0x65,};
u8 main_keys_key_array_86[] = {0x69,0x66,};
u8 main_keys_key_array_87[] = {0x73,0x74,0x72,0x75,0x63,0x74,};
u8 main_keys_key_array_89[] = {0x6e,0x61,0x6d,0x65,0x73,0x70,0x61,0x63,0x65,};
u8 main_keys_key_array_90[] = {0x72,0x65,0x67,0x69,0x73,0x74,0x65,0x72,};
u8 main_keys_key_array_92[] = {0x63,0x61,0x73,0x65,};
u8 main_keys_key_array_94[] = {0x63,0x6f,0x6e,0x73,0x74,0x5f,0x63,0x61,0x73,0x74,};
u8 main_keys_key_array_95[] = {0x63,0x6f,0x6e,0x73,0x74,};
u8 main_keys_key_array_98[] = {0x66,0x72,0x69,0x65,0x6e,0x64,};
u8 main_keys_key_array_100[] = {0x65,0x6c,0x73,0x65,};
u8 main_keys_key_array_102[] = {0x64,0x6f,0x75,0x62,0x6c,0x65,};
u8 main_keys_key_array_108[] = {0x72,0x65,0x74,0x75,0x72,0x6e,};
u8 main_keys_key_array_112[] = {0x76,0x6f,0x6c,0x61,0x74,0x69,0x6c,0x65,};
u8 main_keys_key_array_113[] = {0x64,0x6f,};
u8 main_keys_key_array_114[] = {0x73,0x74,0x61,0x74,0x69,0x63,0x5f,0x61,0x73,0x73,0x65,0x72,0x74,};
u8 main_keys_key_array_116[] = {0x62,0x6f,0x6f,0x6c,};
u8 main_keys_key_array_118[] = {0x61,0x73,0x6d,};
u8 main_keys_key_array_119[] = {0x65,0x6e,0x75,0x6d,};
u8 main_keys_key_array_120[] = {0x76,0x6f,0x69,0x64,};
String_Const_u8 main_keys_key_array[121] = {
{main_keys_key_array_0, 5},
u8 cpp_main_keys_key_array_0[] = {0x74,0x72,0x75,0x65,};
u8 cpp_main_keys_key_array_2[] = {0x73,0x69,0x67,0x6e,0x65,0x64,};
u8 cpp_main_keys_key_array_3[] = {0x76,0x69,0x72,0x74,0x75,0x61,0x6c,};
u8 cpp_main_keys_key_array_4[] = {0x64,0x6f,};
u8 cpp_main_keys_key_array_6[] = {0x70,0x72,0x6f,0x74,0x65,0x63,0x74,0x65,0x64,};
u8 cpp_main_keys_key_array_9[] = {0x64,0x6f,0x75,0x62,0x6c,0x65,};
u8 cpp_main_keys_key_array_10[] = {0x70,0x75,0x62,0x6c,0x69,0x63,};
u8 cpp_main_keys_key_array_13[] = {0x63,0x6c,0x61,0x73,0x73,};
u8 cpp_main_keys_key_array_14[] = {0x74,0x65,0x6d,0x70,0x6c,0x61,0x74,0x65,};
u8 cpp_main_keys_key_array_15[] = {0x73,0x74,0x61,0x74,0x69,0x63,0x5f,0x63,0x61,0x73,0x74,};
u8 cpp_main_keys_key_array_16[] = {0x63,0x61,0x74,0x63,0x68,};
u8 cpp_main_keys_key_array_17[] = {0x67,0x6f,0x74,0x6f,};
u8 cpp_main_keys_key_array_19[] = {0x61,0x73,0x6d,};
u8 cpp_main_keys_key_array_21[] = {0x62,0x72,0x65,0x61,0x6b,};
u8 cpp_main_keys_key_array_25[] = {0x76,0x6f,0x6c,0x61,0x74,0x69,0x6c,0x65,};
u8 cpp_main_keys_key_array_26[] = {0x73,0x77,0x69,0x74,0x63,0x68,};
u8 cpp_main_keys_key_array_28[] = {0x74,0x79,0x70,0x65,0x64,0x65,0x66,};
u8 cpp_main_keys_key_array_29[] = {0x74,0x72,0x79,};
u8 cpp_main_keys_key_array_31[] = {0x65,0x6c,0x73,0x65,};
u8 cpp_main_keys_key_array_34[] = {0x72,0x65,0x74,0x75,0x72,0x6e,};
u8 cpp_main_keys_key_array_36[] = {0x73,0x69,0x7a,0x65,0x6f,0x66,};
u8 cpp_main_keys_key_array_38[] = {0x63,0x6f,0x6e,0x73,0x74,};
u8 cpp_main_keys_key_array_39[] = {0x66,0x61,0x6c,0x73,0x65,};
u8 cpp_main_keys_key_array_40[] = {0x69,0x66,};
u8 cpp_main_keys_key_array_41[] = {0x73,0x74,0x61,0x74,0x69,0x63,0x5f,0x61,0x73,0x73,0x65,0x72,0x74,};
u8 cpp_main_keys_key_array_42[] = {0x74,0x68,0x72,0x65,0x61,0x64,0x5f,0x6c,0x6f,0x63,0x61,0x6c,};
u8 cpp_main_keys_key_array_45[] = {0x74,0x68,0x69,0x73,};
u8 cpp_main_keys_key_array_48[] = {0x69,0x6e,0x74,};
u8 cpp_main_keys_key_array_50[] = {0x64,0x79,0x6e,0x61,0x6d,0x69,0x63,0x5f,0x63,0x61,0x73,0x74,};
u8 cpp_main_keys_key_array_55[] = {0x65,0x6e,0x75,0x6d,};
u8 cpp_main_keys_key_array_56[] = {0x63,0x68,0x61,0x72,};
u8 cpp_main_keys_key_array_57[] = {0x61,0x6c,0x69,0x67,0x6e,0x61,0x73,};
u8 cpp_main_keys_key_array_63[] = {0x63,0x61,0x73,0x65,};
u8 cpp_main_keys_key_array_64[] = {0x66,0x6f,0x72,};
u8 cpp_main_keys_key_array_65[] = {0x61,0x6c,0x69,0x67,0x6e,0x6f,0x66,};
u8 cpp_main_keys_key_array_68[] = {0x64,0x65,0x66,0x61,0x75,0x6c,0x74,};
u8 cpp_main_keys_key_array_69[] = {0x64,0x65,0x6c,0x65,0x74,0x65,};
u8 cpp_main_keys_key_array_74[] = {0x65,0x78,0x74,0x65,0x72,0x6e,};
u8 cpp_main_keys_key_array_75[] = {0x6c,0x6f,0x6e,0x67,};
u8 cpp_main_keys_key_array_76[] = {0x72,0x65,0x67,0x69,0x73,0x74,0x65,0x72,};
u8 cpp_main_keys_key_array_77[] = {0x77,0x68,0x69,0x6c,0x65,};
u8 cpp_main_keys_key_array_81[] = {0x69,0x6e,0x6c,0x69,0x6e,0x65,};
u8 cpp_main_keys_key_array_82[] = {0x6e,0x65,0x77,};
u8 cpp_main_keys_key_array_83[] = {0x66,0x6c,0x6f,0x61,0x74,};
u8 cpp_main_keys_key_array_84[] = {0x62,0x6f,0x6f,0x6c,};
u8 cpp_main_keys_key_array_86[] = {0x63,0x6f,0x6e,0x73,0x74,0x5f,0x63,0x61,0x73,0x74,};
u8 cpp_main_keys_key_array_88[] = {0x6f,0x70,0x65,0x72,0x61,0x74,0x6f,0x72,};
u8 cpp_main_keys_key_array_90[] = {0x72,0x65,0x69,0x6e,0x74,0x65,0x72,0x70,0x72,0x65,0x74,0x5f,0x63,0x61,0x73,0x74,};
u8 cpp_main_keys_key_array_91[] = {0x65,0x78,0x70,0x6c,0x69,0x63,0x69,0x74,};
u8 cpp_main_keys_key_array_94[] = {0x73,0x74,0x72,0x75,0x63,0x74,};
u8 cpp_main_keys_key_array_95[] = {0x6e,0x75,0x6c,0x6c,0x70,0x74,0x72,};
u8 cpp_main_keys_key_array_96[] = {0x65,0x78,0x70,0x6f,0x72,0x74,};
u8 cpp_main_keys_key_array_97[] = {0x73,0x74,0x61,0x74,0x69,0x63,};
u8 cpp_main_keys_key_array_100[] = {0x66,0x72,0x69,0x65,0x6e,0x64,};
u8 cpp_main_keys_key_array_103[] = {0x63,0x6f,0x6e,0x74,0x69,0x6e,0x75,0x65,};
u8 cpp_main_keys_key_array_104[] = {0x75,0x73,0x69,0x6e,0x67,};
u8 cpp_main_keys_key_array_105[] = {0x64,0x65,0x63,0x6c,0x74,0x79,0x70,0x65,};
u8 cpp_main_keys_key_array_106[] = {0x75,0x6e,0x73,0x69,0x67,0x6e,0x65,0x64,};
u8 cpp_main_keys_key_array_108[] = {0x73,0x68,0x6f,0x72,0x74,};
u8 cpp_main_keys_key_array_111[] = {0x74,0x79,0x70,0x65,0x6e,0x61,0x6d,0x65,};
u8 cpp_main_keys_key_array_112[] = {0x75,0x6e,0x69,0x6f,0x6e,};
u8 cpp_main_keys_key_array_113[] = {0x6e,0x6f,0x65,0x78,0x63,0x65,0x70,0x74,};
u8 cpp_main_keys_key_array_114[] = {0x70,0x72,0x69,0x76,0x61,0x74,0x65,};
u8 cpp_main_keys_key_array_118[] = {0x76,0x6f,0x69,0x64,};
u8 cpp_main_keys_key_array_122[] = {0x74,0x79,0x70,0x65,0x69,0x64,};
u8 cpp_main_keys_key_array_123[] = {0x6e,0x61,0x6d,0x65,0x73,0x70,0x61,0x63,0x65,};
String_Const_u8 cpp_main_keys_key_array[124] = {
{cpp_main_keys_key_array_0, 4},
{0, 0},
{main_keys_key_array_2, 5},
{cpp_main_keys_key_array_2, 6},
{cpp_main_keys_key_array_3, 7},
{cpp_main_keys_key_array_4, 2},
{0, 0},
{cpp_main_keys_key_array_6, 9},
{0, 0},
{0, 0},
{cpp_main_keys_key_array_9, 6},
{cpp_main_keys_key_array_10, 6},
{0, 0},
{0, 0},
{cpp_main_keys_key_array_13, 5},
{cpp_main_keys_key_array_14, 8},
{cpp_main_keys_key_array_15, 11},
{cpp_main_keys_key_array_16, 5},
{cpp_main_keys_key_array_17, 4},
{0, 0},
{cpp_main_keys_key_array_19, 3},
{0, 0},
{cpp_main_keys_key_array_21, 5},
{0, 0},
{0, 0},
{0, 0},
{main_keys_key_array_6, 5},
{main_keys_key_array_7, 7},
{main_keys_key_array_8, 5},
{cpp_main_keys_key_array_25, 8},
{cpp_main_keys_key_array_26, 6},
{0, 0},
{cpp_main_keys_key_array_28, 7},
{cpp_main_keys_key_array_29, 3},
{0, 0},
{cpp_main_keys_key_array_31, 4},
{0, 0},
{0, 0},
{cpp_main_keys_key_array_34, 6},
{0, 0},
{cpp_main_keys_key_array_36, 6},
{0, 0},
{cpp_main_keys_key_array_38, 5},
{cpp_main_keys_key_array_39, 5},
{cpp_main_keys_key_array_40, 2},
{cpp_main_keys_key_array_41, 13},
{cpp_main_keys_key_array_42, 12},
{0, 0},
{0, 0},
{cpp_main_keys_key_array_45, 4},
{0, 0},
{0, 0},
{cpp_main_keys_key_array_48, 3},
{0, 0},
{cpp_main_keys_key_array_50, 12},
{0, 0},
{0, 0},
{0, 0},
{0, 0},
{main_keys_key_array_13, 6},
{main_keys_key_array_14, 6},
{main_keys_key_array_15, 4},
{main_keys_key_array_16, 12},
{0, 0},
{0, 0},
{main_keys_key_array_19, 6},
{0, 0},
{main_keys_key_array_21, 8},
{main_keys_key_array_22, 4},
{main_keys_key_array_23, 7},
{0, 0},
{main_keys_key_array_25, 5},
{0, 0},
{main_keys_key_array_27, 8},
{0, 0},
{main_keys_key_array_29, 6},
{main_keys_key_array_30, 8},
{0, 0},
{main_keys_key_array_32, 11},
{0, 0},
{main_keys_key_array_34, 5},
{main_keys_key_array_35, 3},
{0, 0},
{main_keys_key_array_37, 8},
{0, 0},
{0, 0},
{main_keys_key_array_40, 7},
{0, 0},
{0, 0},
{main_keys_key_array_43, 5},
{main_keys_key_array_44, 6},
{main_keys_key_array_45, 7},
{main_keys_key_array_46, 8},
{0, 0},
{main_keys_key_array_48, 16},
{0, 0},
{main_keys_key_array_50, 4},
{main_keys_key_array_51, 9},
{main_keys_key_array_52, 6},
{0, 0},
{0, 0},
{main_keys_key_array_55, 5},
{main_keys_key_array_56, 6},
{main_keys_key_array_57, 5},
{0, 0},
{0, 0},
{main_keys_key_array_60, 6},
{0, 0},
{0, 0},
{main_keys_key_array_63, 6},
{0, 0},
{0, 0},
{main_keys_key_array_66, 3},
{main_keys_key_array_67, 7},
{0, 0},
{0, 0},
{0, 0},
{main_keys_key_array_71, 4},
{0, 0},
{main_keys_key_array_73, 4},
{0, 0},
{main_keys_key_array_75, 8},
{main_keys_key_array_76, 3},
{main_keys_key_array_77, 12},
{main_keys_key_array_78, 3},
{0, 0},
{main_keys_key_array_80, 8},
{main_keys_key_array_81, 7},
{main_keys_key_array_82, 8},
{main_keys_key_array_83, 7},
{main_keys_key_array_84, 6},
{0, 0},
{main_keys_key_array_86, 2},
{main_keys_key_array_87, 6},
{0, 0},
{main_keys_key_array_89, 9},
{main_keys_key_array_90, 8},
{0, 0},
{main_keys_key_array_92, 4},
{0, 0},
{main_keys_key_array_94, 10},
{main_keys_key_array_95, 5},
{0, 0},
{0, 0},
{main_keys_key_array_98, 6},
{0, 0},
{main_keys_key_array_100, 4},
{0, 0},
{main_keys_key_array_102, 6},
{cpp_main_keys_key_array_55, 4},
{cpp_main_keys_key_array_56, 4},
{cpp_main_keys_key_array_57, 7},
{0, 0},
{0, 0},
{0, 0},
{0, 0},
{0, 0},
{main_keys_key_array_108, 6},
{cpp_main_keys_key_array_63, 4},
{cpp_main_keys_key_array_64, 3},
{cpp_main_keys_key_array_65, 7},
{0, 0},
{0, 0},
{cpp_main_keys_key_array_68, 7},
{cpp_main_keys_key_array_69, 6},
{0, 0},
{0, 0},
{0, 0},
{main_keys_key_array_112, 8},
{main_keys_key_array_113, 2},
{main_keys_key_array_114, 13},
{0, 0},
{main_keys_key_array_116, 4},
{cpp_main_keys_key_array_74, 6},
{cpp_main_keys_key_array_75, 4},
{cpp_main_keys_key_array_76, 8},
{cpp_main_keys_key_array_77, 5},
{0, 0},
{main_keys_key_array_118, 3},
{main_keys_key_array_119, 4},
{main_keys_key_array_120, 4},
{0, 0},
{0, 0},
{cpp_main_keys_key_array_81, 6},
{cpp_main_keys_key_array_82, 3},
{cpp_main_keys_key_array_83, 5},
{cpp_main_keys_key_array_84, 4},
{0, 0},
{cpp_main_keys_key_array_86, 10},
{0, 0},
{cpp_main_keys_key_array_88, 8},
{0, 0},
{cpp_main_keys_key_array_90, 16},
{cpp_main_keys_key_array_91, 8},
{0, 0},
{0, 0},
{cpp_main_keys_key_array_94, 6},
{cpp_main_keys_key_array_95, 7},
{cpp_main_keys_key_array_96, 6},
{cpp_main_keys_key_array_97, 6},
{0, 0},
{0, 0},
{cpp_main_keys_key_array_100, 6},
{0, 0},
{0, 0},
{cpp_main_keys_key_array_103, 8},
{cpp_main_keys_key_array_104, 5},
{cpp_main_keys_key_array_105, 8},
{cpp_main_keys_key_array_106, 8},
{0, 0},
{cpp_main_keys_key_array_108, 5},
{0, 0},
{0, 0},
{cpp_main_keys_key_array_111, 8},
{cpp_main_keys_key_array_112, 5},
{cpp_main_keys_key_array_113, 8},
{cpp_main_keys_key_array_114, 7},
{0, 0},
{0, 0},
{0, 0},
{cpp_main_keys_key_array_118, 4},
{0, 0},
{0, 0},
{0, 0},
{cpp_main_keys_key_array_122, 6},
{cpp_main_keys_key_array_123, 9},
};
Lexeme_Table_Value main_keys_value_array[121] = {
{4, TokenCppKind_Catch},
{0, 0},
{4, TokenCppKind_Union},
{0, 0},
{0, 0},
{0, 0},
{4, TokenCppKind_Using},
{4, TokenCppKind_Virtual},
{4, TokenCppKind_Float},
{0, 0},
{0, 0},
{0, 0},
{0, 0},
{4, TokenCppKind_Static},
{4, TokenCppKind_Inline},
Lexeme_Table_Value cpp_main_keys_value_array[124] = {
{8, TokenCppKind_LiteralTrue},
{4, TokenCppKind_DynamicCast},
{0, 0},
{0, 0},
{4, TokenCppKind_SizeOf},
{0, 0},
{4, TokenCppKind_Template},
{4, TokenCppKind_This},
{4, TokenCppKind_AlignAs},
{0, 0},
{4, TokenCppKind_While},
{0, 0},
{4, TokenCppKind_Typename},
{0, 0},
{4, TokenCppKind_Switch},
{4, TokenCppKind_Explicit},
{0, 0},
{4, TokenCppKind_StaticCast},
{0, 0},
{4, TokenCppKind_Break},
{4, TokenCppKind_Try},
{0, 0},
{4, TokenCppKind_DeclType},
{0, 0},
{0, 0},
{4, TokenCppKind_Private},
{0, 0},
{0, 0},
{4, TokenCppKind_Short},
{4, TokenCppKind_TypeID},
{4, TokenCppKind_AlignOf},
{4, TokenCppKind_NoExcept},
{0, 0},
{4, TokenCppKind_ReinterpretCast},
{0, 0},
{4, TokenCppKind_Goto},
{4, TokenCppKind_Protected},
{4, TokenCppKind_Export},
{0, 0},
{0, 0},
{8, TokenCppKind_LiteralFalse},
{4, TokenCppKind_Extern},
{4, TokenCppKind_Class},
{0, 0},
{0, 0},
{4, TokenCppKind_Signed},
{4, TokenCppKind_Virtual},
{4, TokenCppKind_Do},
{0, 0},
{4, TokenCppKind_Protected},
{0, 0},
{0, 0},
{4, TokenCppKind_Double},
{4, TokenCppKind_Public},
{0, 0},
{0, 0},
{4, TokenCppKind_Int},
{4, TokenCppKind_Default},
{4, TokenCppKind_Class},
{4, TokenCppKind_Template},
{4, TokenCppKind_StaticCast},
{4, TokenCppKind_Catch},
{4, TokenCppKind_Goto},
{0, 0},
{4, TokenCppKind_Asm},
{0, 0},
{0, 0},
{4, TokenCppKind_Char},
{0, 0},
{4, TokenCppKind_Long},
{0, 0},
{4, TokenCppKind_Continue},
{4, TokenCppKind_For},
{4, TokenCppKind_ThreadLocal},
{4, TokenCppKind_New},
{0, 0},
{4, TokenCppKind_Unsigned},
{4, TokenCppKind_NullPtr},
{4, TokenCppKind_Operator},
{4, TokenCppKind_Typedef},
{4, TokenCppKind_Delete},
{0, 0},
{4, TokenCppKind_If},
{4, TokenCppKind_Struct},
{0, 0},
{4, TokenCppKind_Namespace},
{4, TokenCppKind_Register},
{0, 0},
{4, TokenCppKind_Case},
{0, 0},
{4, TokenCppKind_ConstCast},
{4, TokenCppKind_Const},
{0, 0},
{0, 0},
{4, TokenCppKind_Friend},
{0, 0},
{4, TokenCppKind_Else},
{0, 0},
{4, TokenCppKind_Double},
{0, 0},
{0, 0},
{0, 0},
{0, 0},
{0, 0},
{4, TokenCppKind_Return},
{4, TokenCppKind_Break},
{0, 0},
{0, 0},
{0, 0},
{4, TokenCppKind_Volatile},
{4, TokenCppKind_Do},
{4, TokenCppKind_StaticAssert},
{4, TokenCppKind_Switch},
{0, 0},
{4, TokenCppKind_Typedef},
{4, TokenCppKind_Try},
{0, 0},
{4, TokenCppKind_Else},
{0, 0},
{0, 0},
{4, TokenCppKind_Return},
{0, 0},
{4, TokenCppKind_SizeOf},
{0, 0},
{4, TokenCppKind_Const},
{8, TokenCppKind_LiteralFalse},
{4, TokenCppKind_If},
{4, TokenCppKind_StaticAssert},
{4, TokenCppKind_ThreadLocal},
{0, 0},
{0, 0},
{4, TokenCppKind_This},
{0, 0},
{0, 0},
{4, TokenCppKind_Int},
{0, 0},
{4, TokenCppKind_DynamicCast},
{0, 0},
{0, 0},
{0, 0},
{0, 0},
{4, TokenCppKind_Enum},
{4, TokenCppKind_Char},
{4, TokenCppKind_AlignAs},
{0, 0},
{0, 0},
{0, 0},
{0, 0},
{0, 0},
{4, TokenCppKind_Case},
{4, TokenCppKind_For},
{4, TokenCppKind_AlignOf},
{0, 0},
{0, 0},
{4, TokenCppKind_Default},
{4, TokenCppKind_Delete},
{0, 0},
{0, 0},
{0, 0},
{0, 0},
{4, TokenCppKind_Extern},
{4, TokenCppKind_Long},
{4, TokenCppKind_Register},
{4, TokenCppKind_While},
{0, 0},
{0, 0},
{0, 0},
{4, TokenCppKind_Inline},
{4, TokenCppKind_New},
{4, TokenCppKind_Float},
{4, TokenCppKind_Bool},
{0, 0},
{4, TokenCppKind_Asm},
{4, TokenCppKind_Enum},
{4, TokenCppKind_ConstCast},
{0, 0},
{4, TokenCppKind_Operator},
{0, 0},
{4, TokenCppKind_ReinterpretCast},
{4, TokenCppKind_Explicit},
{0, 0},
{0, 0},
{4, TokenCppKind_Struct},
{4, TokenCppKind_NullPtr},
{4, TokenCppKind_Export},
{4, TokenCppKind_Static},
{0, 0},
{0, 0},
{4, TokenCppKind_Friend},
{0, 0},
{0, 0},
{4, TokenCppKind_Continue},
{4, TokenCppKind_Using},
{4, TokenCppKind_DeclType},
{4, TokenCppKind_Unsigned},
{0, 0},
{4, TokenCppKind_Short},
{0, 0},
{0, 0},
{4, TokenCppKind_Typename},
{4, TokenCppKind_Union},
{4, TokenCppKind_NoExcept},
{4, TokenCppKind_Private},
{0, 0},
{0, 0},
{0, 0},
{4, TokenCppKind_Void},
{0, 0},
{0, 0},
{0, 0},
{4, TokenCppKind_TypeID},
{4, TokenCppKind_Namespace},
};
i32 main_keys_slot_count = 121;
u64 main_keys_seed = 0x32a240442a6e221f;
u64 pp_directives_hash_array[25] = {
0xa8f3b0d79807b793,0x808ba552d670368f,0x0000000000000000,0x808ba54dc047d94b,
0x3b97f7088cbf95df,0x7fd91d3d238e04c9,0x0000000000000000,0x7fd91d3dac09e067,
0x0000000000000000,0x0000000000000000,0xa8f3beab5b880ad3,0x0000000000000000,
0x3b97f7088cbffd3b,0x3b97f7088cdab44b,0x79521904bb682f3f,0x0000000000000000,
0x0000000000000000,0x7fd91d3d978c615f,0x808ba553ad911e19,0x0000000000000000,
0x808ba54ef8496067,0x7fd91d3d2fe85067,0x7fd91d3d97a21607,0x0000000000000000,
i32 cpp_main_keys_slot_count = 124;
u64 cpp_main_keys_seed = 0x8546da5e0b8a4494;
u64 cpp_pp_directives_hash_array[25] = {
0xa9c93e3b092cb44d,0x0000000000000000,0x0dd88216be8f0f45,0x0000000000000000,
0x0dd88216bc8af78d,0x92a889595c683c55,0xdab9e300145b906f,0x92a889577e972a4b,
0x0000000000000000,0x0dd88216bb8053ff,0x0000000000000000,0x0dd88216bd573601,
0x0000000000000000,0xdab9e300142a071d,0x0000000000000000,0xa9c93ef34054fce1,
0x0dd88216a4783a45,0xdab9e300145b9a25,0x92a889595b4a2105,0x0000000000000000,
0x86d1d427e10cd86d,0x0000000000000000,0x92a889590753d01d,0x0000000000000000,
0x0000000000000000,
};
u8 pp_directives_key_array_0[] = {0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,};
u8 pp_directives_key_array_1[] = {0x70,0x72,0x61,0x67,0x6d,0x61,};
u8 pp_directives_key_array_3[] = {0x64,0x65,0x66,0x69,0x6e,0x65,};
u8 pp_directives_key_array_4[] = {0x65,0x6c,0x69,0x66,};
u8 pp_directives_key_array_5[] = {0x75,0x73,0x69,0x6e,0x67,};
u8 pp_directives_key_array_7[] = {0x69,0x66,0x64,0x65,0x66,};
u8 pp_directives_key_array_10[] = {0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,};
u8 pp_directives_key_array_12[] = {0x65,0x6c,0x73,0x65,};
u8 pp_directives_key_array_13[] = {0x6c,0x69,0x6e,0x65,};
u8 pp_directives_key_array_14[] = {0x69,0x66,};
u8 pp_directives_key_array_17[] = {0x65,0x6e,0x64,0x69,0x66,};
u8 pp_directives_key_array_18[] = {0x69,0x6d,0x70,0x6f,0x72,0x74,};
u8 pp_directives_key_array_20[] = {0x69,0x66,0x6e,0x64,0x65,0x66,};
u8 pp_directives_key_array_21[] = {0x75,0x6e,0x64,0x65,0x66,};
u8 pp_directives_key_array_22[] = {0x65,0x72,0x72,0x6f,0x72,};
String_Const_u8 pp_directives_key_array[25] = {
{pp_directives_key_array_0, 7},
{pp_directives_key_array_1, 6},
u8 cpp_pp_directives_key_array_0[] = {0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,};
u8 cpp_pp_directives_key_array_2[] = {0x69,0x66,0x64,0x65,0x66,};
u8 cpp_pp_directives_key_array_4[] = {0x65,0x6e,0x64,0x69,0x66,};
u8 cpp_pp_directives_key_array_5[] = {0x69,0x66,0x6e,0x64,0x65,0x66,};
u8 cpp_pp_directives_key_array_6[] = {0x65,0x6c,0x73,0x65,};
u8 cpp_pp_directives_key_array_7[] = {0x70,0x72,0x61,0x67,0x6d,0x61,};
u8 cpp_pp_directives_key_array_9[] = {0x75,0x73,0x69,0x6e,0x67,};
u8 cpp_pp_directives_key_array_11[] = {0x65,0x72,0x72,0x6f,0x72,};
u8 cpp_pp_directives_key_array_13[] = {0x6c,0x69,0x6e,0x65,};
u8 cpp_pp_directives_key_array_15[] = {0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,};
u8 cpp_pp_directives_key_array_16[] = {0x75,0x6e,0x64,0x65,0x66,};
u8 cpp_pp_directives_key_array_17[] = {0x65,0x6c,0x69,0x66,};
u8 cpp_pp_directives_key_array_18[] = {0x69,0x6d,0x70,0x6f,0x72,0x74,};
u8 cpp_pp_directives_key_array_20[] = {0x69,0x66,};
u8 cpp_pp_directives_key_array_22[] = {0x64,0x65,0x66,0x69,0x6e,0x65,};
String_Const_u8 cpp_pp_directives_key_array[25] = {
{cpp_pp_directives_key_array_0, 7},
{0, 0},
{pp_directives_key_array_3, 6},
{pp_directives_key_array_4, 4},
{pp_directives_key_array_5, 5},
{cpp_pp_directives_key_array_2, 5},
{0, 0},
{pp_directives_key_array_7, 5},
{cpp_pp_directives_key_array_4, 5},
{cpp_pp_directives_key_array_5, 6},
{cpp_pp_directives_key_array_6, 4},
{cpp_pp_directives_key_array_7, 6},
{0, 0},
{cpp_pp_directives_key_array_9, 5},
{0, 0},
{pp_directives_key_array_10, 7},
{cpp_pp_directives_key_array_11, 5},
{0, 0},
{pp_directives_key_array_12, 4},
{pp_directives_key_array_13, 4},
{pp_directives_key_array_14, 2},
{cpp_pp_directives_key_array_13, 4},
{0, 0},
{cpp_pp_directives_key_array_15, 7},
{cpp_pp_directives_key_array_16, 5},
{cpp_pp_directives_key_array_17, 4},
{cpp_pp_directives_key_array_18, 6},
{0, 0},
{pp_directives_key_array_17, 5},
{pp_directives_key_array_18, 6},
{cpp_pp_directives_key_array_20, 2},
{0, 0},
{pp_directives_key_array_20, 6},
{pp_directives_key_array_21, 5},
{pp_directives_key_array_22, 5},
{cpp_pp_directives_key_array_22, 6},
{0, 0},
{0, 0},
};
Lexeme_Table_Value pp_directives_value_array[25] = {
{5, TokenCppKind_PPInclude},
{5, TokenCppKind_PPPragma},
{0, 0},
{5, TokenCppKind_PPDefine},
{5, TokenCppKind_PPElIf},
{5, TokenCppKind_PPUsing},
Lexeme_Table_Value cpp_pp_directives_value_array[25] = {
{5, TokenCppKind_PPVersion},
{0, 0},
{5, TokenCppKind_PPIfDef},
{0, 0},
{0, 0},
{5, TokenCppKind_PPVersion},
{0, 0},
{5, TokenCppKind_PPElse},
{5, TokenCppKind_PPLine},
{5, TokenCppKind_PPIf},
{0, 0},
{0, 0},
{5, TokenCppKind_PPEndIf},
{5, TokenCppKind_PPImport},
{0, 0},
{5, TokenCppKind_PPIfNDef},
{5, TokenCppKind_PPUndef},
{5, TokenCppKind_PPElse},
{5, TokenCppKind_PPPragma},
{0, 0},
{5, TokenCppKind_PPUsing},
{0, 0},
{5, TokenCppKind_PPError},
{0, 0},
{5, TokenCppKind_PPLine},
{0, 0},
{5, TokenCppKind_PPInclude},
{5, TokenCppKind_PPUndef},
{5, TokenCppKind_PPElIf},
{5, TokenCppKind_PPImport},
{0, 0},
{5, TokenCppKind_PPIf},
{0, 0},
{5, TokenCppKind_PPDefine},
{0, 0},
{0, 0},
};
i32 pp_directives_slot_count = 25;
u64 pp_directives_seed = 0x8848fb3caaf5d4d5;
u64 pp_keys_hash_array[2] = {
0x0000000000000000,0x72743f437c9f847d,
i32 cpp_pp_directives_slot_count = 25;
u64 cpp_pp_directives_seed = 0x6e8a1011f7d8dd90;
u64 cpp_pp_keys_hash_array[2] = {
0x56dd32803fcaa4ab,0x0000000000000000,
};
u8 pp_keys_key_array_1[] = {0x64,0x65,0x66,0x69,0x6e,0x65,0x64,};
String_Const_u8 pp_keys_key_array[2] = {
u8 cpp_pp_keys_key_array_0[] = {0x64,0x65,0x66,0x69,0x6e,0x65,0x64,};
String_Const_u8 cpp_pp_keys_key_array[2] = {
{cpp_pp_keys_key_array_0, 7},
{0, 0},
{pp_keys_key_array_1, 7},
};
Lexeme_Table_Value pp_keys_value_array[2] = {
{0, 0},
Lexeme_Table_Value cpp_pp_keys_value_array[2] = {
{4, TokenCppKind_PPDefined},
{0, 0},
};
i32 pp_keys_slot_count = 2;
u64 pp_keys_seed = 0x71428d58f01a7eed;
i32 cpp_pp_keys_slot_count = 2;
u64 cpp_pp_keys_seed = 0xbb7907ea1860ef2c;
struct Lex_State_Cpp{
u32 flags_ZF0;
u32 flags_KF0;
@ -971,14 +977,14 @@ token.size = (i64)(state.ptr - state.emit_ptr);
token.flags = state.flags_KB0;
do{
if (HasFlag(state.flags_KB0, 0x1)){
Lexeme_Table_Lookup lookup = lexeme_table_lookup(pp_keys_hash_array, pp_keys_key_array, pp_keys_value_array, pp_keys_slot_count, pp_keys_seed, state.emit_ptr, token.size);
Lexeme_Table_Lookup lookup = lexeme_table_lookup(cpp_pp_keys_hash_array, cpp_pp_keys_key_array, cpp_pp_keys_value_array, cpp_pp_keys_slot_count, cpp_pp_keys_seed, state.emit_ptr, token.size);
if (lookup.found_match){
token.kind = lookup.base_kind;
token.sub_kind = lookup.sub_kind;
break;
}
}
Lexeme_Table_Lookup lookup = lexeme_table_lookup(main_keys_hash_array, main_keys_key_array, main_keys_value_array, main_keys_slot_count, main_keys_seed, state.emit_ptr, token.size);
Lexeme_Table_Lookup lookup = lexeme_table_lookup(cpp_main_keys_hash_array, cpp_main_keys_key_array, cpp_main_keys_value_array, cpp_main_keys_slot_count, cpp_main_keys_seed, state.emit_ptr, token.size);
if (lookup.found_match){
token.kind = lookup.base_kind;
token.sub_kind = lookup.sub_kind;
@ -1014,14 +1020,14 @@ token.size = (i64)(state.ptr - state.emit_ptr);
token.flags = state.flags_KB0;
do{
if (HasFlag(state.flags_KB0, 0x1)){
Lexeme_Table_Lookup lookup = lexeme_table_lookup(pp_keys_hash_array, pp_keys_key_array, pp_keys_value_array, pp_keys_slot_count, pp_keys_seed, state.emit_ptr, token.size);
Lexeme_Table_Lookup lookup = lexeme_table_lookup(cpp_pp_keys_hash_array, cpp_pp_keys_key_array, cpp_pp_keys_value_array, cpp_pp_keys_slot_count, cpp_pp_keys_seed, state.emit_ptr, token.size);
if (lookup.found_match){
token.kind = lookup.base_kind;
token.sub_kind = lookup.sub_kind;
break;
}
}
Lexeme_Table_Lookup lookup = lexeme_table_lookup(main_keys_hash_array, main_keys_key_array, main_keys_value_array, main_keys_slot_count, main_keys_seed, state.emit_ptr, token.size);
Lexeme_Table_Lookup lookup = lexeme_table_lookup(cpp_main_keys_hash_array, cpp_main_keys_key_array, cpp_main_keys_value_array, cpp_main_keys_slot_count, cpp_main_keys_seed, state.emit_ptr, token.size);
if (lookup.found_match){
token.kind = lookup.base_kind;
token.sub_kind = lookup.sub_kind;
@ -2760,7 +2766,7 @@ token.pos = (i64)(state.emit_ptr - state.base);
token.size = (i64)(state.ptr - state.emit_ptr);
token.flags = state.flags_KB0;
do{
Lexeme_Table_Lookup lookup = lexeme_table_lookup(pp_directives_hash_array, pp_directives_key_array, pp_directives_value_array, pp_directives_slot_count, pp_directives_seed, state.delim_first, (state.delim_one_past_last - state.delim_first));
Lexeme_Table_Lookup lookup = lexeme_table_lookup(cpp_pp_directives_hash_array, cpp_pp_directives_key_array, cpp_pp_directives_value_array, cpp_pp_directives_slot_count, cpp_pp_directives_seed, state.delim_first, (state.delim_one_past_last - state.delim_first));
if (lookup.found_match){
token.kind = lookup.base_kind;
token.sub_kind = lookup.sub_kind;
@ -2797,7 +2803,7 @@ token.pos = (i64)(state.emit_ptr - state.base);
token.size = (i64)(state.ptr - state.emit_ptr);
token.flags = state.flags_KB0;
do{
Lexeme_Table_Lookup lookup = lexeme_table_lookup(pp_directives_hash_array, pp_directives_key_array, pp_directives_value_array, pp_directives_slot_count, pp_directives_seed, state.delim_first, (state.delim_one_past_last - state.delim_first));
Lexeme_Table_Lookup lookup = lexeme_table_lookup(cpp_pp_directives_hash_array, cpp_pp_directives_key_array, cpp_pp_directives_value_array, cpp_pp_directives_slot_count, cpp_pp_directives_seed, state.delim_first, (state.delim_one_past_last - state.delim_first));
if (lookup.found_match){
token.kind = lookup.base_kind;
token.sub_kind = lookup.sub_kind;

View File

@ -93,53 +93,53 @@ typedef b32 system_set_fullscreen_type(b32 full_screen);
typedef b32 system_is_fullscreen_type(void);
typedef Input_Modifier_Set system_get_keyboard_modifiers_type(Arena* arena);
struct API_VTable_system{
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_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_post_clipboard_type *post_clipboard;
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_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_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_post_clipboard_type *post_clipboard;
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;
};
#if defined(STATIC_LINK_API)
internal String_Const_u8 system_get_path(Arena* arena, System_Path_Code path_code);

View File

@ -1130,7 +1130,6 @@ build_language_model(void){
sm_case_eof_peek(emit);
}
sm_fallback(comment_line);
}
// BOTTOM

View File

@ -2700,7 +2700,7 @@ opt_key_layout(Arena *arena, Keyword_Set keywords, i32 slot_count, u64 seed){
else{
run_length += 1;
layout.error_score += run_length;
max_run_length = max(max_run_length, run_length);
max_run_length = Max(max_run_length, run_length);
}
}
i32 total_run_length = run_length;
@ -2711,7 +2711,7 @@ opt_key_layout(Arena *arena, Keyword_Set keywords, i32 slot_count, u64 seed){
else{
layout.error_score += run_length;
total_run_length += 1;
max_run_length = max(max_run_length, total_run_length);
max_run_length = Max(max_run_length, total_run_length);
}
}
layout.max_single_error_score = max_run_length;
@ -3181,7 +3181,7 @@ gen_keyword_table(Arena *scratch, Token_Kind_Set tokens, Keyword_Set keywords, F
Temp_Memory temp = begin_temp(scratch);
Keyword_Layout key_layout = opt_key_layout(scratch, keywords);
fprintf(out, "u64 %.*s_hash_array[%d] = {\n",
fprintf(out, "u64 " LANG_NAME_LOWER_STR "_%.*s_hash_array[%d] = {\n",
string_expand(keywords.pretty_name), key_layout.slot_count);
for (i32 i = 0; i < key_layout.slot_count; i += 1){
if (key_layout.slots[i] == 0){
@ -3198,7 +3198,7 @@ gen_keyword_table(Arena *scratch, Token_Kind_Set tokens, Keyword_Set keywords, F
for (i32 i = 0; i < key_layout.slot_count; i += 1){
if (key_layout.slots[i] != 0){
fprintf(out, "u8 %.*s_key_array_%d[] = {",
fprintf(out, "u8 " LANG_NAME_LOWER_STR "_%.*s_key_array_%d[] = {",
string_expand(keywords.pretty_name), i);
String_Const_u8 lexeme = key_layout.slots[i]->lexeme;
for (u64 j = 0; j < lexeme.size; j += 1){
@ -3208,20 +3208,20 @@ gen_keyword_table(Arena *scratch, Token_Kind_Set tokens, Keyword_Set keywords, F
}
}
fprintf(out, "String_Const_u8 %.*s_key_array[%d] = {\n",
fprintf(out, "String_Const_u8 " LANG_NAME_LOWER_STR "_%.*s_key_array[%d] = {\n",
string_expand(keywords.pretty_name), key_layout.slot_count);
for (i32 i = 0; i < key_layout.slot_count; i += 1){
if (key_layout.slots[i] == 0){
fprintf(out, "{0, 0},\n");
}
else{
fprintf(out, "{%.*s_key_array_%d, %llu},\n",
fprintf(out, "{" LANG_NAME_LOWER_STR "_%.*s_key_array_%d, %llu},\n",
string_expand(keywords.pretty_name), i, key_layout.slots[i]->lexeme.size);
}
}
fprintf(out, "};\n");
fprintf(out, "Lexeme_Table_Value %.*s_value_array[%d] = {\n",
fprintf(out, "Lexeme_Table_Value " LANG_NAME_LOWER_STR "_%.*s_value_array[%d] = {\n",
string_expand(keywords.pretty_name), key_layout.slot_count);
for (i32 i = 0; i < key_layout.slot_count; i += 1){
if (key_layout.slots[i] == 0){
@ -3245,9 +3245,9 @@ gen_keyword_table(Arena *scratch, Token_Kind_Set tokens, Keyword_Set keywords, F
}
fprintf(out, "};\n");
fprintf(out, "i32 %.*s_slot_count = %d;\n",
fprintf(out, "i32 " LANG_NAME_LOWER_STR "_%.*s_slot_count = %d;\n",
string_expand(keywords.pretty_name), key_layout.slot_count);
fprintf(out, "u64 %.*s_seed = 0x%016llx;\n",
fprintf(out, "u64 " LANG_NAME_LOWER_STR "_%.*s_seed = 0x%016llx;\n",
string_expand(keywords.pretty_name), key_layout.seed);
end_temp(temp);
@ -3453,8 +3453,12 @@ gen_SLOW_action_list__cont_flow(Arena *scratch, Token_Kind_Set tokens, Flag_Set
{
Keyword_Set *keywords = handler->keywords;
fprintf(out, "Lexeme_Table_Lookup lookup = "
"lexeme_table_lookup(%.*s_hash_array, %.*s_key_array, "
"%.*s_value_array, %.*s_slot_count, %.*s_seed, "
"lexeme_table_lookup("
LANG_NAME_LOWER_STR "_%.*s_hash_array, "
LANG_NAME_LOWER_STR "_%.*s_key_array, "
LANG_NAME_LOWER_STR "_%.*s_value_array, "
LANG_NAME_LOWER_STR "_%.*s_slot_count, "
LANG_NAME_LOWER_STR "_%.*s_seed, "
"state.emit_ptr, token.size);\n",
string_expand(keywords->pretty_name),
string_expand(keywords->pretty_name),
@ -3477,8 +3481,12 @@ gen_SLOW_action_list__cont_flow(Arena *scratch, Token_Kind_Set tokens, Flag_Set
{
Keyword_Set *keywords = handler->keywords;
fprintf(out, "Lexeme_Table_Lookup lookup = "
"lexeme_table_lookup(%.*s_hash_array, %.*s_key_array, "
"%.*s_value_array, %.*s_slot_count, %.*s_seed, "
"lexeme_table_lookup("
LANG_NAME_LOWER_STR "_%.*s_hash_array, "
LANG_NAME_LOWER_STR "_%.*s_key_array, "
LANG_NAME_LOWER_STR "_%.*s_value_array, "
LANG_NAME_LOWER_STR "_%.*s_slot_count, "
LANG_NAME_LOWER_STR "_%.*s_seed, "
"state.delim_first, (state.delim_one_past_last - state.delim_first));\n",
string_expand(keywords->pretty_name),
string_expand(keywords->pretty_name),

View File

@ -384,6 +384,39 @@ doc_custom_api__buffer(Arena *arena, API_Definition *api_def, Doc_Cluster *clust
////////////////////////////////
if (begin_doc_call(arena, cluster, api_def, "buffer_padded_box_of_pos", &func)){
doc_function_brief(arena, &func, "Compute the rectangle around a character at a particular byte position, relative to the top left corner of a given line");
// params
Doc_Block *params = doc_function_begin_params(arena, &func);
doc_custom_app_ptr(arena, &func);
doc_function_param(arena, &func, "buffer_id");
doc_text(arena, params, "the id of the buffer who's layout will be measured");
doc_function_param(arena, &func, "width");
doc_text(arena, params, "the width parameter of the layout, passed to layout rules as a recommended wrap point");
doc_function_param(arena, &func, "face_id");
doc_text(arena, params, "the face parameter of the layout, passed to layout rules as a recommended face");
doc_function_param(arena, &func, "base_line");
doc_text(arena, params, "the line number of the line that serves as the relative starting point of the measurement");
doc_function_param(arena, &func, "pos");
doc_text(arena, params, "the absolute byte index of the position to query");
// return
Doc_Block *ret = doc_function_return(arena, &func);
doc_text(arena, ret, "the rectangle around a character in the layout that is closest to including the given query position in it's span, with coordinates set relative to the top left corner of the base line, on success, when the buffer exists and contains the base line and query position, cleared to zero otherwise");
// details
Doc_Block *det = doc_function_details(arena, &func);
doc_text(arena, det, "Line numbers are 1 based.");
}
////////////////////////////////
if (begin_doc_call(arena, cluster, api_def, "buffer_relative_character_from_pos", &func)){
doc_function_brief(arena, &func, "Compute a character index relative to a particular lines first character");
@ -627,6 +660,39 @@ doc_custom_api__buffer(Arena *arena, API_Definition *api_def, Doc_Cluster *clust
////////////////////////////////
if (begin_doc_call(arena, cluster, api_def, "buffer_set_layout", &func)){
doc_function_brief(arena, &func, "Set the layout function of a buffer");
// params
Doc_Block *params = doc_function_begin_params(arena, &func);
doc_custom_app_ptr(arena, &func);
doc_function_param(arena, &func, "buffer_id");
doc_text(arena, params, "the id of the buffer to be modified");
doc_function_param(arena, &func, "layout_func");
doc_text(arena, params, "the new layout function for the buffer's layout");
// return
Doc_Block *ret = doc_function_return(arena, &func);
doc_text(arena, ret, "non-zero on success, when the buffer exists, otherwise zero");
}
////////////////////////////////
if (begin_doc_call(arena, cluster, api_def, "buffer_clear_layout_cache", &func)){
doc_function_brief(arena, &func, "Clear all the layout information cached in the buffer");
// params
Doc_Block *params = doc_function_begin_params(arena, &func);
doc_custom_app_ptr(arena, &func);
doc_function_param(arena, &func, "buffer_id");
doc_text(arena, params, "the id of the buffer to be modified");
}
////////////////////////////////
if (begin_doc_call(arena, cluster, api_def, "buffer_get_layout", &func)){
doc_function_brief(arena, &func, "Retrieve the layout rule of a buffer");

View File

@ -1174,6 +1174,16 @@ doc_custom_api__global(Arena *arena, API_Definition *api_def, Doc_Cluster *clust
////////////////////////////////
if (begin_doc_call(arena, cluster, api_def, "hard_exit", &func)){
doc_function_brief(arena, &func, "Exits 4coder at the end of the frame, no matter what; for instance, call from the exit signal handler to actual exit 4coder.");
// params
doc_function_begin_params(arena, &func);
doc_custom_app_ptr(arena, &func);
}
////////////////////////////////
if (begin_doc_call(arena, cluster, api_def, "set_window_title", &func)){
doc_function_brief(arena, &func, "Set the title of the 4coder window");

View File

@ -60,6 +60,8 @@ int main(void){
API_Definition *api_def = api_get_api(&def_list, string_u8_litexpr("custom"));
Doc_Cluster *cluster = doc_custom_api(&arena, api_def);
doc_api_check_full_coverage(&arena, cluster, api_def);
for (Doc_Log *node = cluster->first_log;
node != 0;
node = node->next){

View File

@ -133,6 +133,33 @@ doc_custom_api__view(Arena *arena, API_Definition *api_def, Doc_Cluster *cluster
////////////////////////////////
if (begin_doc_call(arena, cluster, api_def, "view_padded_box_of_pos", &func)){
doc_function_brief(arena, &func, "Compute the rectangle around a character at a particular byte position, relative to the top left corner of a given line");
// params
Doc_Block *params = doc_function_begin_params(arena, &func);
doc_custom_app_ptr(arena, &func);
doc_function_param(arena, &func, "view_id");
doc_text(arena, params, "the id of the view who's layout will be measured");
doc_function_param(arena, &func, "base_line");
doc_text(arena, params, "the line number of the line that serves as the relative starting point of the measurement");
doc_function_param(arena, &func, "pos");
doc_text(arena, params, "the absolute byte index of the position to query");
// return
Doc_Block *ret = doc_function_return(arena, &func);
doc_text(arena, ret, "the rectangle around a character in the layout that is closest to including the given query position in it's span, with coordinates set relative to the top left corner of the base line, on success, when the view exists and contains the base line and query position, cleared to zero otherwise");
// details
Doc_Block *det = doc_function_details(arena, &func);
doc_text(arena, det, "Line numbers are 1 based.");
}
////////////////////////////////
if (begin_doc_call(arena, cluster, api_def, "view_relative_character_from_pos", &func)){
doc_function_brief(arena, &func, "Compute a character index relative to a particular lines first character");
@ -888,13 +915,6 @@ doc_custom_api__view(Arena *arena, API_Definition *api_def, Doc_Cluster *cluster
////////////////////////////////
// TODO(allen): remove view_post_fade
if (begin_doc_call(arena, cluster, api_def, "view_post_fade", &func)){
doc_function_brief(arena, &func, "Plans to deprecate - do not rely on this call!");
}
////////////////////////////////
if (begin_doc_call(arena, cluster, api_def, "view_push_context", &func)){
doc_function_brief(arena, &func, "Push a view's stack of context details with a pointer to the new values for the context");

View File

@ -155,4 +155,19 @@ doc_function_add_related(Arena *arena, Doc_Block *rel, char *name){
content->page_link = SCu8(name);
}
////////////////////////////////
function void
doc_api_check_full_coverage(Arena *arena, Doc_Cluster *cluster, API_Definition *api_def){
for (API_Call *call = api_def->first_call;
call != 0;
call = call->next){
String_Const_u8 name = call->name;
Doc_Page *page = doc_get_page(cluster, name);
if (page == 0){
doc_errorf(arena, cluster, "missing documentation for %.*s", string_expand(name));
}
}
}
// BOTTOM

641
metal/4ed_metal_render.mm Normal file
View File

@ -0,0 +1,641 @@
/* 4coder Metal render implementation */
#undef clamp
#undef function
#import <simd/simd.h>
#import <MetalKit/MetalKit.h>
#define function static
////////////////////////////////
struct Metal_Buffer{
Node node;
id<MTLBuffer> buffer;
u32 size;
u64 last_reuse_time;
};
////////////////////////////////
typedef id<MTLTexture> Metal_Texture;
// NOTE(yuval): This is a locator used to describe where a specific slot is located.
union Metal_Texture_Slot_Locator{
u32 packed;
struct{
u16 bucket_index;
u16 slot_index;
};
};
// NOTE(yuval): This is the ACTUAL texture slot. Each slot contains the texture handle, the slot locator, and a pointer to the next slot in the free list (in case the slot if not occupied).
struct Metal_Texture_Slot{
// NOTE(yuval): This is a pointer to the next texture in the free texture slots list
Metal_Texture_Slot *next;
Metal_Texture texture;
Metal_Texture_Slot_Locator locator;
};
global_const u32 metal__texture_slots_per_bucket = 256;
// NOTE(yuval): This a bucket of ACTUAL texture slots.
struct Metal_Texture_Slot_Bucket{
Metal_Texture_Slot_Bucket *next;
Metal_Texture_Slot slots[metal__texture_slots_per_bucket];
};
// NOTE(yuval): This a struct contaning all texture slot buckets and a list of the currently free slots.
struct Metal_Texture_Slot_List{
Metal_Texture_Slot_Bucket *first_bucket;
Metal_Texture_Slot_Bucket *last_bucket;
u16 bucket_count;
Metal_Texture_Slot *first_free_slot;
Metal_Texture_Slot *last_free_slot;
};
global_const u32 metal__invalid_texture_slot_locator = (u32)-1;
////////////////////////////////
@interface Metal_Renderer : NSObject<MTKViewDelegate>
- (nonnull instancetype)initWithMetalKitView:(nonnull MTKView*)mtkView target:(Render_Target*)target;
- (u32)get_texture_of_dim:(Vec3_i32)dim kind:(Texture_Kind)kind;
- (b32)fill_texture:(u32)texture kind:(Texture_Kind)kind pos:(Vec3_i32)p dim:(Vec3_i32)dim data:(void*)data;
- (void)bind_texture:(u32)handle encoder:(id<MTLRenderCommandEncoder>)render_encoder;
- (Metal_Texture_Slot*)get_texture_slot_at_locator:(Metal_Texture_Slot_Locator)locator;
- (Metal_Texture_Slot*)get_texture_slot_at_handle:(u32)handle;
- (Metal_Buffer*)get_reusable_buffer_with_size:(NSUInteger)size;
- (void)add_reusable_buffer:(Metal_Buffer*)buffer;
@end
////////////////////////////////
global_const char *metal__shaders_source = R"(
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
////////////////////////////////
typedef struct{
float2 xy [[attribute(0)]];
float3 uvw [[attribute(1)]];
uint32_t color [[attribute(2)]];
float half_thickness [[attribute(3)]];
} Vertex;
// NOTE(yuval): Vertex shader outputs and fragment shader inputs
typedef struct{
// NOTE(yuval): Vertex shader output
float4 position [[position]];
// NOTE(yuval): Fragment shader inputs
float4 color;
float3 uvw;
float2 xy;
float2 adjusted_half_dim;
float half_thickness;
} Rasterizer_Data;
////////////////////////////////
vertex Rasterizer_Data
vertex_shader(Vertex in [[stage_in]],
constant float4x4 &proj [[buffer(1)]]){
Rasterizer_Data out;
// NOTE(yuval): Calculate position in NDC
out.position = proj * float4(in.xy, 0.0, 1.0);
// NOTE(yuval): Convert color to float4 format
out.color.b = ((float((in.color ) & 0xFFu)) / 255.0);
out.color.g = ((float((in.color >> 8u) & 0xFFu)) / 255.0);
out.color.r = ((float((in.color >> 16u) & 0xFFu)) / 255.0);
out.color.a = ((float((in.color >> 24u) & 0xFFu)) / 255.0);
// NOTE(yuval): Pass uvw coordinates to the fragment shader
out.uvw = in.uvw;
// NOTE(yuval): Calculate adjusted half dim
float2 center = in.uvw.xy;
float2 half_dim = abs(in.xy - center);
out.adjusted_half_dim = (half_dim - in.uvw.zz + float2(0.5, 0.5));
// NOTE(yuval): Pass half_thickness to the fragment shader
out.half_thickness = in.half_thickness;
// NOTE(yuval): Pass xy to the fragment shader
out.xy = in.xy;
return(out);
}
////////////////////////////////
float
rectangle_sd(float2 p, float2 b){
float2 d = (abs(p) - b);
float result = (length(max(d, float2(0.0, 0.0))) + min(max(d.x, d.y), 0.0));
return(result);
}
fragment float4
fragment_shader(Rasterizer_Data in [[stage_in]],
texture2d_array<half> in_texture [[texture(0)]]){
float has_thickness = step(0.49, in.half_thickness);
float does_not_have_thickness = (1.0 - has_thickness);
constexpr sampler texture_sampler(coord::normalized, min_filter::linear, mag_filter::linear, mip_filter::linear);
half sample_value = in_texture.sample(texture_sampler, in.uvw.xy, in.uvw.z).r;
sample_value *= does_not_have_thickness;
float2 center = in.uvw.xy;
float roundness = in.uvw.z;
float sd = rectangle_sd(in.xy - center, in.adjusted_half_dim);
sd = sd - roundness;
sd = (abs(sd + in.half_thickness) - in.half_thickness);
float shape_value = (1.0 - smoothstep(-1.0, 0.0, sd));
shape_value *= has_thickness;
float4 out_color = float4(in.color.xyz, in.color.a * (sample_value + shape_value));
return(out_color);
}
)";
////////////////////////////////
function Metal_Buffer*
metal__make_buffer(u32 size, id<MTLDevice> device){
Metal_Buffer *result = (Metal_Buffer*)malloc(sizeof(Metal_Buffer));
// NOTE(yuval): Create the vertex buffer
MTLResourceOptions options = MTLCPUCacheModeWriteCombined|MTLResourceStorageModeManaged;
result->buffer = [device newBufferWithLength:size options:options];
result->size = size;
// NOTE(yuval): Set the last_reuse_time to the current time
result->last_reuse_time = system_now_time();
return result;
}
////////////////////////////////
@implementation Metal_Renderer{
Render_Target *_target;
id<MTLDevice> _device;
id<MTLRenderPipelineState> _pipeline_state;
id<MTLCommandQueue> _command_queue;
id<MTLCaptureScope> _capture_scope;
Node _buffer_cache;
u64 _last_buffer_cache_purge_time;
Metal_Texture_Slot_List _texture_slots;
}
- (nonnull instancetype)initWithMetalKitView:(nonnull MTKView*)mtk_view target:(Render_Target*)target{
self = [super init];
if (self == nil){
return(nil);
}
_target = target;
NSError *error = nil;
_device = mtk_view.device;
// NOTE(yuval): Compile the shaders
id<MTLFunction> vertex_function = nil;
id<MTLFunction> fragment_function = nil;
{
NSString *shaders_source_str = [NSString stringWithUTF8String:metal__shaders_source];
MTLCompileOptions *options = [[MTLCompileOptions alloc] init];
options.fastMathEnabled = YES;
id<MTLLibrary> shader_library = [_device newLibraryWithSource:shaders_source_str
options:options error:&error];
vertex_function = [shader_library newFunctionWithName:@"vertex_shader"];
fragment_function = [shader_library newFunctionWithName:@"fragment_shader"];
[options release];
}
Assert(error == nil);
Assert((vertex_function != nil) && (fragment_function != nil));
// NOTE(yuval): Configure the pipeline descriptor
{
MTLVertexDescriptor *vertexDescriptor = [MTLVertexDescriptor vertexDescriptor];
vertexDescriptor.attributes[0].offset = OffsetOfMember(Render_Vertex, xy);
vertexDescriptor.attributes[0].format = MTLVertexFormatFloat2; // position
vertexDescriptor.attributes[0].bufferIndex = 0;
vertexDescriptor.attributes[1].offset = OffsetOfMember(Render_Vertex, uvw);
vertexDescriptor.attributes[1].format = MTLVertexFormatFloat3; // texCoords
vertexDescriptor.attributes[1].bufferIndex = 0;
vertexDescriptor.attributes[2].offset = OffsetOfMember(Render_Vertex, color);
vertexDescriptor.attributes[2].format = MTLVertexFormatUInt; // color
vertexDescriptor.attributes[2].bufferIndex = 0;
vertexDescriptor.attributes[3].offset = OffsetOfMember(Render_Vertex, half_thickness);
vertexDescriptor.attributes[3].format = MTLVertexFormatFloat; // position
vertexDescriptor.attributes[3].bufferIndex = 0;
vertexDescriptor.layouts[0].stepRate = 1;
vertexDescriptor.layouts[0].stepFunction = MTLVertexStepFunctionPerVertex;
vertexDescriptor.layouts[0].stride = sizeof(Render_Vertex);
MTLRenderPipelineDescriptor *pipeline_state_descriptor = [[MTLRenderPipelineDescriptor alloc] init];
pipeline_state_descriptor.label = @"4coder Metal Renderer Pipeline";
pipeline_state_descriptor.vertexFunction = vertex_function;
pipeline_state_descriptor.fragmentFunction = fragment_function;
pipeline_state_descriptor.vertexDescriptor = vertexDescriptor;
pipeline_state_descriptor.colorAttachments[0].pixelFormat = mtk_view.colorPixelFormat;
pipeline_state_descriptor.colorAttachments[0].blendingEnabled = YES;
pipeline_state_descriptor.colorAttachments[0].alphaBlendOperation = MTLBlendOperationAdd;
pipeline_state_descriptor.colorAttachments[0].rgbBlendOperation = MTLBlendOperationAdd;
pipeline_state_descriptor.colorAttachments[0].sourceRGBBlendFactor = MTLBlendFactorSourceAlpha;
pipeline_state_descriptor.colorAttachments[0].destinationRGBBlendFactor = MTLBlendFactorOneMinusSourceAlpha;
pipeline_state_descriptor.colorAttachments[0].sourceAlphaBlendFactor = MTLBlendFactorOne;
pipeline_state_descriptor.colorAttachments[0].destinationAlphaBlendFactor = MTLBlendFactorOneMinusSourceAlpha;
_pipeline_state = [_device newRenderPipelineStateWithDescriptor:pipeline_state_descriptor
error:&error];
}
Assert(error == nil);
// NOTE(yuval): Create the command queue
_command_queue = [_device newCommandQueue];
// NOTE(yuval): Initialize buffer caching
dll_init_sentinel(&_buffer_cache);
_last_buffer_cache_purge_time = system_now_time();
// NOTE(yuval): Initialize the texture slot list
block_zero_struct(&_texture_slots);
// NOTE(yuval): Create the fallback texture
_target->fallback_texture_id = [self get_texture_of_dim:V3i32(2, 2, 1)
kind:TextureKind_Mono];
u8 white_block[] = {0xFF, 0xFF, 0xFF, 0xFF};
[self fill_texture:_target->fallback_texture_id
kind:TextureKind_Mono
pos:V3i32(0, 0, 0)
dim:V3i32(2, 2, 1)
data:white_block];
// NOTE(yuval): Create a capture scope for gpu frame capture
_capture_scope = [[MTLCaptureManager sharedCaptureManager]
newCaptureScopeWithDevice:_device];
_capture_scope.label = @"4coder Metal Capture Scope";
return(self);
}
- (void)mtkView:(nonnull MTKView*)view drawableSizeWillChange:(CGSize)size{
// NOTE(yuval): Nothing to do here because we use the render target's dimentions for rendering
}
- (void)drawInMTKView:(nonnull MTKView*)view{
#if FRED_INTERNAL
[_capture_scope beginScope];
#endif
// HACK(yuval): This is the best way I found to force valid width and height without drawing on the next draw cycle (1 frame delay).
CGSize drawable_size = [view drawableSize];
i32 width = (i32)Min(_target->width, drawable_size.width);
i32 height = (i32)Min(_target->height, drawable_size.height);
Font_Set *font_set = (Font_Set*)_target->font_set;
// NOTE(yuval): Free any textures in the target's texture free list
for (Render_Free_Texture *free_texture = _target->free_texture_first;
free_texture;
free_texture = free_texture->next){
Metal_Texture_Slot *texture_slot = [self get_texture_slot_at_handle:free_texture->tex_id];
if (texture_slot){
sll_queue_push(_texture_slots.first_free_slot, _texture_slots.last_free_slot, texture_slot);
}
}
_target->free_texture_first = 0;
_target->free_texture_last = 0;
// NOTE(yuval): Create the command buffer
id<MTLCommandBuffer> command_buffer = [_command_queue commandBuffer];
command_buffer.label = @"4coder Metal Render Command";
// NOTE(yuval): Obtain the render pass descriptor from the renderer's view
MTLRenderPassDescriptor *render_pass_descriptor = view.currentRenderPassDescriptor;
if (render_pass_descriptor != nil){
render_pass_descriptor.colorAttachments[0].clearColor = MTLClearColorMake(0.0f, 0.0f, 0.0f, 1.0f);
// NOTE(yuval): Create the render command encoder
id<MTLRenderCommandEncoder> render_encoder =
[command_buffer renderCommandEncoderWithDescriptor:render_pass_descriptor];
render_encoder.label = @"4coder Render Encoder";
// NOTE(yuval): Set the region of the drawable to draw into
[render_encoder setViewport:(MTLViewport){0.0, 0.0, (double)width, (double)height, 0.0, 1.0}];
// NOTE(yuval): Set the render pipeline to use for drawing
[render_encoder setRenderPipelineState:_pipeline_state];
// NOTE(yuval): Calculate the projection matrix
float left = 0, right = (float)width;
float bottom = (float)height, top = 0;
float near_depth = -1.0f, far_depth = 1.0f;
float proj[16] = {
2.0f / (right - left), 0.0f, 0.0f, 0.0f,
0.0f, 2.0f / (top - bottom), 0.0f, 0.0f,
0.0f, 0.0f, -1.0f / (far_depth - near_depth), 0.0f,
-((right + left) / (right - left)), -((top + bottom) / (top - bottom)),
-(near_depth / (far_depth - near_depth)), 1.0f
};
// NOTE(yuval): Calculate required vertex buffer size
i32 all_vertex_count = 0;
for (Render_Group *group = _target->group_first;
group;
group = group->next){
all_vertex_count += group->vertex_list.vertex_count;
}
u32 vertex_buffer_size = (all_vertex_count * sizeof(Render_Vertex));
// NOTE(yuval): Find & Get a vertex buffer matching the required size
Metal_Buffer *buffer = [self get_reusable_buffer_with_size:vertex_buffer_size];
// NOTE(yuval): Pass the vertex buffer to the vertex shader
[render_encoder setVertexBuffer:buffer->buffer
offset:0
atIndex:0];
// NOTE(yuval): Pass the projection matrix to the vertex shader
[render_encoder setVertexBytes:&proj
length:sizeof(proj)
atIndex:1];
u32 buffer_offset = 0;
for (Render_Group *group = _target->group_first;
group;
group = group->next){
// NOTE(yuval): Set scissor rect
{
Rect_i32 box = Ri32(group->clip_box);
NSUInteger x0 = (NSUInteger)Min(Max(0, box.x0), width - 1);
NSUInteger x1 = (NSUInteger)Min(Max(0, box.x1), width);
NSUInteger y0 = (NSUInteger)Min(Max(0, box.y0), height - 1);
NSUInteger y1 = (NSUInteger)Min(Max(0, box.y1), height);
MTLScissorRect scissor_rect;
scissor_rect.x = x0;
scissor_rect.y = y0;
scissor_rect.width = (x1 - x0);
scissor_rect.height = (y1 - y0);
[render_encoder setScissorRect:scissor_rect];
}
i32 vertex_count = group->vertex_list.vertex_count;
if (vertex_count > 0){
// NOTE(yuval): Bind a texture
{
Face* face = font_set_face_from_id(font_set, group->face_id);
if (face != 0){
// NOTE(yuval): Bind face texture
[self bind_texture:face->texture
encoder:render_encoder];
} else{
// NOTE(yuval): Bind fallback texture
[self bind_texture:_target->fallback_texture_id
encoder:render_encoder];
}
}
// NOTE(yuval): Copy the vertex data to the vertex buffer
{
u8 *group_buffer_contents = (u8*)[buffer->buffer contents] + buffer_offset;
u8 *cursor = group_buffer_contents;
for (Render_Vertex_Array_Node *node = group->vertex_list.first;
node;
node = node->next){
i32 size = node->vertex_count * sizeof(*node->vertices);
memcpy(cursor, node->vertices, size);
cursor += size;
}
NSUInteger data_size = (NSUInteger)(cursor - group_buffer_contents);
NSRange modify_range = NSMakeRange(buffer_offset, data_size);
[buffer->buffer didModifyRange:modify_range];
}
// NOTE(yuval): Set the vertex buffer offset to the beginning of the group's vertices
[render_encoder setVertexBufferOffset:buffer_offset atIndex:0];
// NOTE(yuval): Draw the vertices
[render_encoder drawPrimitives:MTLPrimitiveTypeTriangle
vertexStart:0
vertexCount:vertex_count];
buffer_offset += (vertex_count * sizeof(Render_Vertex));
}
}
[render_encoder endEncoding];
// NOTE(yuval): Schedule a present once the framebuffer is complete using the current drawable
[command_buffer presentDrawable:view.currentDrawable];
[command_buffer addCompletedHandler:^(id<MTLCommandBuffer>){
dispatch_async(dispatch_get_main_queue(), ^{
[self add_reusable_buffer:buffer];
});
}];
}
// NOTE(yuval): Finalize rendering here and push the command buffer to the GPU
[command_buffer commit];
#if FRED_INTERNAL
[_capture_scope endScope];
#endif
}
- (u32)get_texture_of_dim:(Vec3_i32)dim kind:(Texture_Kind)kind{
u32 handle = metal__invalid_texture_slot_locator;
// NOTE(yuval): Check for a free texture slot and allocate another slot bucket if no free slot has been found
if (!_texture_slots.first_free_slot){
// NOTE(yuval): Assert that the next bucket's index can fit in a u16
Assert(_texture_slots.bucket_count < ((u16)-1));
Metal_Texture_Slot_Bucket *bucket = (Metal_Texture_Slot_Bucket*)system_memory_allocate(sizeof(Metal_Texture_Slot_Bucket), file_name_line_number_lit_u8);
for (u16 slot_index = 0;
slot_index < ArrayCount(bucket->slots);
++slot_index){
Metal_Texture_Slot *slot = &bucket->slots[slot_index];
block_zero_struct(slot);
slot->locator.bucket_index = _texture_slots.bucket_count;
slot->locator.slot_index = slot_index;
sll_queue_push(_texture_slots.first_free_slot, _texture_slots.last_free_slot, slot);
}
sll_queue_push(_texture_slots.first_bucket, _texture_slots.last_bucket, bucket);
_texture_slots.bucket_count += 1;
}
// NOTE(yuval): Get the first free texture slot and remove it from the free list (a slot is guarenteed to exist because we assert that above).
if (_texture_slots.first_free_slot){
Metal_Texture_Slot *texture_slot = _texture_slots.first_free_slot;
sll_queue_pop(_texture_slots.first_free_slot, _texture_slots.last_free_slot);
texture_slot->next = 0;
// NOTE(yuval): Create a texture descriptor.
MTLTextureDescriptor *texture_descriptor = [[MTLTextureDescriptor alloc] init];
texture_descriptor.textureType = MTLTextureType2DArray;
texture_descriptor.pixelFormat = MTLPixelFormatR8Unorm;
texture_descriptor.width = dim.x;
texture_descriptor.height = dim.y;
texture_descriptor.depth = dim.z;
// NOTE(yuval): Create the texture from the device using the descriptor and add it to the textures array.
Metal_Texture texture = [_device newTextureWithDescriptor:texture_descriptor];
texture_slot->texture = texture;
handle = texture_slot->locator.packed;
}
return handle;
}
- (b32)fill_texture:(u32)handle kind:(Texture_Kind)kind pos:(Vec3_i32)p dim:(Vec3_i32)dim data:(void*)data{
b32 result = false;
if (data){
Metal_Texture_Slot *texture_slot = [self get_texture_slot_at_handle:handle];
if (texture_slot){
Metal_Texture texture = texture_slot->texture;
if (texture != 0){
MTLRegion replace_region = {
{(NSUInteger)p.x, (NSUInteger)p.y, (NSUInteger)p.z},
{(NSUInteger)dim.x, (NSUInteger)dim.y, (NSUInteger)dim.z}
};
// NOTE(yuval): Fill the texture with data
[texture replaceRegion:replace_region
mipmapLevel:0
withBytes:data
bytesPerRow:dim.x];
result = true;
}
}
}
return(result);
}
- (void)bind_texture:(u32)handle encoder:(id<MTLRenderCommandEncoder>)render_encoder{
Metal_Texture_Slot *texture_slot = [self get_texture_slot_at_handle:handle];
if (texture_slot){
Metal_Texture texture = texture_slot->texture;
if (texture != 0){
[render_encoder setFragmentTexture:texture
atIndex:0];
}
}
}
- (Metal_Texture_Slot*)get_texture_slot_at_locator:(Metal_Texture_Slot_Locator)locator{
Metal_Texture_Slot *result = 0;
if (locator.packed != metal__invalid_texture_slot_locator){
Metal_Texture_Slot_Bucket *bucket = _texture_slots.first_bucket;
for (u16 bucket_index = 0;
(bucket_index < locator.bucket_index) && bucket;
++bucket_index, bucket = bucket->next);
if (bucket && (locator.slot_index < metal__texture_slots_per_bucket)){
result = &bucket->slots[locator.slot_index];
}
}
return(result);
}
- (Metal_Texture_Slot*)get_texture_slot_at_handle:(u32)handle{
Metal_Texture_Slot_Locator locator;
locator.packed = handle;
Metal_Texture_Slot *result = [self get_texture_slot_at_locator:locator];
return(result);
}
- (Metal_Buffer*)get_reusable_buffer_with_size:(NSUInteger)size{
// NOTE(yuval): This routine is a modified version of Dear ImGui's MetalContext::dequeueReusableBufferOfLength in imgui_impl_metal.mm
u64 now = system_now_time();
// NOTE(yuval): Purge old buffers that haven't been useful for a while
if ((now - _last_buffer_cache_purge_time) > 1000000){
Node prev_buffer_cache = _buffer_cache;
dll_init_sentinel(&_buffer_cache);
for (Node *node = prev_buffer_cache.next;
node != &_buffer_cache;
node = node->next){
Metal_Buffer *candidate = CastFromMember(Metal_Buffer, node, node);
if (candidate->last_reuse_time > _last_buffer_cache_purge_time){
dll_insert(&_buffer_cache, node);
}
}
_last_buffer_cache_purge_time = now;
}
// NOTE(yuval): See if we have a buffer we can reuse
Metal_Buffer *best_candidate = 0;
for (Node *node = _buffer_cache.next;
node != &_buffer_cache;
node = node->next){
Metal_Buffer *candidate = CastFromMember(Metal_Buffer, node, node);
if ((candidate->size >= size) && ((!best_candidate) || (best_candidate->last_reuse_time > candidate->last_reuse_time))){
best_candidate = candidate;
}
}
Metal_Buffer *result;
if (best_candidate){
// NOTE(yuval): A best candidate has been found! Remove it from the buffer list and set its last reuse time.
dll_remove(&best_candidate->node);
best_candidate->last_reuse_time = now;
result = best_candidate;
} else{
// NOTE(yuval): No luck; make a new buffer.
result = metal__make_buffer(size, _device);
}
return(result);
}
- (void)add_reusable_buffer:(Metal_Buffer*)buffer{
// NOTE(yuval): This routine is a modified version of Dear ImGui's MetalContext::enqueueReusableBuffer in imgui_impl_metal.mm
dll_insert(&_buffer_cache, &buffer->node);
}
@end

View File

@ -12,8 +12,6 @@
#if !defined(FRED_OPENGL_DEFINES_H)
#define FRED_OPENGL_DEFINES_H
#include <GL/gl.h>
#define GL_TEXTURE_MAX_LEVEL 0x813D
#define GL_MULTISAMPLE 0x809D
@ -224,9 +222,6 @@ typedef void GL_Debug_Function(GLenum src,
void *user_data);
typedef GL_Debug_Function *GLDEBUGPROC;
#define GL_FUNC(N,R,P) typedef R (CALL_CONVENTION N##_Function)P; N##_Function *N = 0;
#include "4ed_opengl_funcs.h"
#endif
// BOTTOM

View File

@ -9,8 +9,6 @@
// TOP
#include "4ed_opengl_defines.h"
internal void
gl__bind_texture(Render_Target *t, i32 texid){
if (t->bound_texture != texid){
@ -225,11 +223,16 @@ gl_render(Render_Target *t){
#if !SHIP_MODE
glEnable(GL_DEBUG_OUTPUT);
glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS);
glDebugMessageControl(GL_DONT_CARE, GL_DONT_CARE, GL_DEBUG_SEVERITY_NOTIFICATION, 0, 0, false);
glDebugMessageControl(GL_DONT_CARE, GL_DONT_CARE, GL_DEBUG_SEVERITY_LOW, 0, 0, false);
glDebugMessageControl(GL_DONT_CARE, GL_DONT_CARE, GL_DEBUG_SEVERITY_MEDIUM, 0, 0, true);
glDebugMessageControl(GL_DONT_CARE, GL_DONT_CARE, GL_DEBUG_SEVERITY_HIGH, 0, 0, true);
glDebugMessageCallback(gl__error_callback, 0);
if (glDebugMessageControl){
glDebugMessageControl(GL_DONT_CARE, GL_DONT_CARE, GL_DEBUG_SEVERITY_NOTIFICATION, 0, 0, false);
glDebugMessageControl(GL_DONT_CARE, GL_DONT_CARE, GL_DEBUG_SEVERITY_LOW, 0, 0, false);
glDebugMessageControl(GL_DONT_CARE, GL_DONT_CARE, GL_DEBUG_SEVERITY_MEDIUM, 0, 0, true);
glDebugMessageControl(GL_DONT_CARE, GL_DONT_CARE, GL_DEBUG_SEVERITY_HIGH, 0, 0, true);
}
if (glDebugMessageCallback){
glDebugMessageCallback(gl__error_callback, 0);
}
#endif
////////////////////////////////
@ -256,7 +259,7 @@ gl_render(Render_Target *t){
////////////////////////////////
{
{
t->fallback_texture_id = gl__get_texture(V3i32(2, 2, 1), TextureKind_Mono);
u8 white_block[] = { 0xFF, 0xFF, 0xFF, 0xFF, };
gl__fill_texture(TextureKind_Mono, 0, V3i32(0, 0, 0), V3i32(2, 2, 1), white_block);
@ -286,7 +289,15 @@ gl_render(Render_Target *t){
group != 0;
group = group->next){
Rect_i32 box = Ri32(group->clip_box);
glScissor(box.x0, height - box.y1, box.x1 - box.x0, box.y1 - box.y0);
Rect_i32 scissor_box = {
box.x0, height - box.y1, box.x1 - box.x0, box.y1 - box.y0,
};
scissor_box.x0 = clamp_bot(0, scissor_box.x0);
scissor_box.y0 = clamp_bot(0, scissor_box.y0);
scissor_box.x1 = clamp_bot(0, scissor_box.x1);
scissor_box.y1 = clamp_bot(0, scissor_box.y1);
glScissor(scissor_box.x0, scissor_box.y0, scissor_box.x1, scissor_box.y1);
i32 vertex_count = group->vertex_list.vertex_count;
if (vertex_count > 0){

1393
platform_mac/mac_4ed.mm Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,937 @@
/* macOS System/Graphics/Font API Implementations */
/********************/
/* System API */
/********************/
////////////////////////////////
function
system_get_path_sig(){
String_Const_u8 result = {};
switch (path_code){
case SystemPath_CurrentDirectory:
{
char *working_dir = getcwd(NULL, 0);
u64 working_dir_length = cstring_length(working_dir);
// TODO(yuval): Maybe use push_string_copy instead
u8 *out = push_array(arena, u8, working_dir_length);
block_copy(out, working_dir, working_dir_length);
free(working_dir);
result = SCu8(out, working_dir_length);
} break;
case SystemPath_Binary:
{
local_persist b32 has_stashed_4ed_path = false;
if (!has_stashed_4ed_path){
local_const u32 binary_path_capacity = PATH_MAX;
u8 *memory = (u8*)system_memory_allocate(binary_path_capacity, file_name_line_number_lit_u8);
pid_t pid = getpid();
i32 size = proc_pidpath(pid, memory, binary_path_capacity);
Assert(size < binary_path_capacity);
mac_vars.binary_path = SCu8(memory, size);
mac_vars.binary_path = string_remove_last_folder(mac_vars.binary_path);
mac_vars.binary_path.str[mac_vars.binary_path.size] = 0;
has_stashed_4ed_path = true;
}
result = push_string_copy(arena, mac_vars.binary_path);
} break;
}
return(result);
}
function
system_get_canonical_sig(){
NSString *path_ns_str =
[[NSString alloc] initWithBytes:name.data length:name.size encoding:NSUTF8StringEncoding];
NSString *standardized_path_ns_str = [path_ns_str stringByStandardizingPath];
String_Const_u8 standardized_path = SCu8((u8*)[standardized_path_ns_str UTF8String],[standardized_path_ns_str lengthOfBytesUsingEncoding:NSUTF8StringEncoding]);
String_Const_u8 result = push_string_copy(arena, standardized_path);
[path_ns_str release];
return(result);
}
////////////////////////////////
function File_Attributes
mac_get_file_attributes(struct stat file_stat) {
File_Attributes result;
result.size = file_stat.st_size;
result.last_write_time = file_stat.st_mtimespec.tv_sec;
result.flags = 0;
if (S_ISDIR(file_stat.st_mode)) {
result.flags |= FileAttribute_IsDirectory;
}
return(result);
}
function inline File_Attributes
mac_file_attributes_from_path(char *path) {
File_Attributes result = {};
struct stat file_stat;
if (stat(path, &file_stat) == 0){
result = mac_get_file_attributes(file_stat);
}
return(result);
}
function inline File_Attributes
mac_file_attributes_from_fd(i32 fd) {
File_Attributes result = {};
struct stat file_stat;
if (fstat(fd, &file_stat) == 0){
result = mac_get_file_attributes(file_stat);
}
return(result);
}
function
system_get_file_list_sig(){
File_List result = {};
u8 *c_directory = push_array(arena, u8, directory.size + 1);
block_copy(c_directory, directory.str, directory.size);
c_directory[directory.size] = 0;
DIR *dir = opendir((char*)c_directory);
if (dir){
File_Info* first = 0;
File_Info* last = 0;
i32 count = 0;
for (struct dirent *entry = readdir(dir);
entry;
entry = readdir(dir)){
char *c_file_name = entry->d_name;
String_Const_u8 file_name = SCu8(c_file_name);
if (string_match(file_name, string_u8_litexpr(".")) || string_match(file_name, string_u8_litexpr(".."))){
continue;
}
File_Info *info = push_array(arena, File_Info, 1);
sll_queue_push(first, last, info);
count += 1;
info->file_name = push_string_copy(arena, file_name);
// NOTE(yuval): Get file attributes
{
Temp_Memory temp = begin_temp(arena);
b32 append_slash = false;
u64 file_path_size = directory.size + file_name.size;
if (string_get_character(directory, directory.size - 1) != '/'){
append_slash = true;
file_path_size += 1;
}
char *file_path = push_array(arena, char, file_path_size + 1);
char *file_path_at = file_path;
block_copy(file_path_at, directory.str, directory.size);
file_path_at += directory.size;
if (append_slash){
*file_path_at = '/';
file_path_at += 1;
}
block_copy(file_path_at, file_name.str, file_name.size);
file_path_at += file_name.size;
*file_path_at = 0;
info->attributes = mac_file_attributes_from_path(file_path);
end_temp(temp);
}
}
closedir(dir);
result.infos = push_array(arena, File_Info*, count);
result.count = count;
i32 index = 0;
for (File_Info *node = first;
node != 0;
node = node->next){
result.infos[index] = node;
index += 1;
}
}
return(result);
}
function
system_quick_file_attributes_sig(){
Temp_Memory temp = begin_temp(scratch);
char *c_file_name = push_array(scratch, char, file_name.size + 1);
block_copy(c_file_name, file_name.str, file_name.size);
c_file_name[file_name.size] = 0;
File_Attributes result = mac_file_attributes_from_path(c_file_name);
end_temp(temp);
return(result);
}
function inline Plat_Handle
mac_to_plat_handle(i32 fd){
Plat_Handle result = *(Plat_Handle*)(&fd);
return(result);
}
function inline i32
mac_to_fd(Plat_Handle handle){
i32 result = *(i32*)(&handle);
return(result);
}
function
system_load_handle_sig(){
b32 result = false;
i32 fd = open(file_name, O_RDONLY);
if ((fd != -1) && (fd != 0)) {
*out = mac_to_plat_handle(fd);
result = true;
}
return(result);
}
function
system_load_attributes_sig(){
i32 fd = mac_to_fd(handle);
File_Attributes result = mac_file_attributes_from_fd(fd);
return(result);
}
function
system_load_file_sig(){
i32 fd = mac_to_fd(handle);
do{
ssize_t bytes_read = read(fd, buffer, size);
if (bytes_read == -1){
if (errno != EINTR){
// NOTE(yuval): An error occured while reading from the file descriptor
break;
}
} else{
size -= bytes_read;
buffer += bytes_read;
}
} while (size > 0);
b32 result = (size == 0);
return(result);
}
function
system_load_close_sig(){
b32 result = true;
i32 fd = mac_to_fd(handle);
if (close(fd) == -1){
// NOTE(yuval): An error occured while close the file descriptor
result = false;
}
return(result);
}
function
system_save_file_sig(){
File_Attributes result = {};
i32 fd = open(file_name, O_WRONLY | O_TRUNC | O_CREAT, 00640);
if (fd != -1) {
do{
ssize_t bytes_written = write(fd, data.str, data.size);
if (bytes_written == -1){
if (errno != EINTR){
// NOTE(yuval): An error occured while writing to the file descriptor
break;
}
} else{
data.size -= bytes_written;
data.str += bytes_written;
}
} while (data.size > 0);
if (data.size == 0) {
result = mac_file_attributes_from_fd(fd);
}
close(fd);
}
return(result);
}
////////////////////////////////
function inline System_Library
mac_to_system_library(void *dl_handle){
System_Library result = *(System_Library*)(&dl_handle);
return(result);
}
function inline void*
mac_to_dl_handle(System_Library system_lib){
void *result = *(void**)(&system_lib);
return(result);
}
function
system_load_library_sig(){
b32 result = false;
void *lib = 0;
// NOTE(yuval): Open library handle
{
Temp_Memory temp = begin_temp(scratch);
char *c_file_name = push_array(scratch, char, file_name.size + 1);
block_copy(c_file_name, file_name.str, file_name.size);
c_file_name[file_name.size] = 0;
lib = dlopen(c_file_name, RTLD_LAZY | RTLD_GLOBAL);
end_temp(temp);
}
if (lib){
*out = mac_to_system_library(lib);
result = true;
}
return(result);
}
function
system_release_library_sig(){
void *lib = mac_to_dl_handle(handle);
i32 rc = dlclose(lib);
b32 result = (rc == 0);
return(result);
}
function
system_get_proc_sig(){
void *lib = mac_to_dl_handle(handle);
Void_Func *result = (Void_Func*)dlsym(lib, proc_name);
return(result);
}
////////////////////////////////
function
system_now_time_sig(){
u64 now = mach_absolute_time();
// NOTE(yuval): Now time nanoseconds conversion
f64 now_nano = (f64)((f64)now *
((f64)mac_vars.timebase_info.numer /
(f64)mac_vars.timebase_info.denom));
// NOTE(yuval): Conversion to useconds
u64 result = (u64)(now_nano * 1.0E-3);
return(result);
}
function
system_wake_up_timer_create_sig(){
Mac_Object *object = mac_alloc_object(MacObjectKind_Timer);
dll_insert(&mac_vars.timer_objects, &object->node);
object->timer = nil;
Plat_Handle result = mac_to_plat_handle(object);
return(result);
}
function
system_wake_up_timer_release_sig(){
Mac_Object *object = mac_to_object(handle);
if (object->kind == MacObjectKind_Timer){
if ((object->timer != nil) && [object->timer isValid]) {
[object->timer invalidate];
mac_free_object(object);
}
}
}
function
system_wake_up_timer_set_sig(){
Mac_Object *object = mac_to_object(handle);
if (object->kind == MacObjectKind_Timer){
f64 time_seconds = ((f64)time_milliseconds / 1000.0);
object->timer = [NSTimer scheduledTimerWithTimeInterval:time_seconds
target:mac_vars.view
selector:@selector(request_display)
userInfo:nil repeats:NO];
}
}
function
system_signal_step_sig(){
#if 0
if (!mac_vars.step_requested){
[NSTimer scheduledTimerWithTimeInterval:0.0
target:mac_vars.view
selector:@selector(request_display)
userInfo:nil repeats:NO];
mac_vars.step_requested = true;
}
#else
mac_vars.step_requested = true;
dispatch_async(dispatch_get_main_queue(),
^{
[NSTimer scheduledTimerWithTimeInterval:0.0
target:mac_vars.view
selector:@selector(request_display)
userInfo:nil repeats:NO];
});
#endif
}
function
system_sleep_sig(){
u64 nanoseconds = (microseconds * Thousand(1));
u64 abs_sleep_time = (u64)((f64)nanoseconds *
((f64)mac_vars.timebase_info.denom /
(f64)mac_vars.timebase_info.numer));
u64 now = mach_absolute_time();
mach_wait_until(now + abs_sleep_time);
}
////////////////////////////////
function
system_post_clipboard_sig(){
Arena *arena = &mac_vars.clip_post_arena;
if (arena->base_allocator == 0){
*arena = make_arena_system();
} else{
linalloc_clear(arena);
}
mac_vars.clip_post.str = push_array(arena, u8, str.size + 1);
if (mac_vars.clip_post.str != 0){
block_copy(mac_vars.clip_post.str, str.str, str.size);
mac_vars.clip_post.str[str.size] = 0;
mac_vars.clip_post.size = str.size;
} else{
// NOTE(yuval): Failed to allocate buffer for clipboard post
}
}
////////////////////////////////
function
system_cli_call_sig(){
b32 result = false;
int pipe_fds[2];
if (pipe(pipe_fds) == -1){
perror("system_cli_call: pipe");
return(false);
}
pid_t child_pid = fork();
if (child_pid == -1){
perror("system_cli_call: fork");
return(false);
}
enum { PIPE_FD_READ, PIPE_FD_WRITE };
if (child_pid == 0){
// NOTE(yuval): Child Process
close(pipe_fds[PIPE_FD_READ]);
dup2(pipe_fds[PIPE_FD_WRITE], STDOUT_FILENO);
dup2(pipe_fds[PIPE_FD_WRITE], STDERR_FILENO);
if (chdir(path) == -1){
perror("system_cli_call: chdir");
exit(1);
}
char* argv[] = {"sh", "-c", script, 0};
if (execv("/bin/sh", argv) == -1){
perror("system_cli_call: execv");
}
exit(1);
} else{
// NOTE(yuval): Parent Process
close(pipe_fds[PIPE_FD_WRITE]);
*(pid_t*)&cli_out->proc = child_pid;
*(int*)&cli_out->out_read = pipe_fds[PIPE_FD_READ];
*(int*)&cli_out->out_write = pipe_fds[PIPE_FD_WRITE];
mac_vars.running_cli += 1;
}
return(true);
}
function
system_cli_begin_update_sig(){
// NOTE(yuval): Nothing to do here.
}
function
system_cli_update_step_sig(){
int pipe_read_fd = *(int*)&cli->out_read;
fd_set fds;
FD_ZERO(&fds);
FD_SET(pipe_read_fd, &fds);
struct timeval tv = {};
size_t space_left = max;
char* ptr = dest;
while (space_left > 0 && (select(pipe_read_fd + 1, &fds, NULL, NULL, &tv) == 1)){
ssize_t num = read(pipe_read_fd, ptr, space_left);
if (num == -1){
perror("system_cli_update_step: read");
} else if (num == 0){
// NOTE(inso): EOF
break;
} else{
ptr += num;
space_left -= num;
}
}
*amount = (ptr - dest);
b32 result = ((ptr - dest) > 0);
return(result);
}
function
system_cli_end_update_sig(){
b32 close_me = false;
pid_t pid = *(pid_t*)&cli->proc;
int status;
if (pid && (waitpid(pid, &status, WNOHANG) > 0)){
cli->exit = WEXITSTATUS(status);
close(*(int*)&cli->out_read);
close(*(int*)&cli->out_write);
mac_vars.running_cli -= 1;
close_me = true;
}
return(close_me);
}
////////////////////////////////
function
system_open_color_picker_sig(){
NotImplemented;
}
function
system_get_screen_scale_factor_sig(){
f32 result = mac_vars.screen_scale_factor;
return(result);
}
////////////////////////////////
function void*
mac_thread_wrapper(void *ptr){
Mac_Object *object = (Mac_Object*)ptr;
Thread_Function *proc = object->thread.proc;
void *object_ptr = object->thread.ptr;
pthread_mutex_lock(&mac_vars.thread_launch_mutex);
{
mac_vars.waiting_for_launch = false;
pthread_cond_signal(&mac_vars.thread_launch_cv);
}
pthread_mutex_unlock(&mac_vars.thread_launch_mutex);
proc(object_ptr);
return(0);
}
function
system_thread_launch_sig(){
Mac_Object *object = mac_alloc_object(MacObjectKind_Thread);
object->thread.proc = proc;
object->thread.ptr = ptr;
pthread_mutex_lock(&mac_vars.thread_launch_mutex);
{
mac_vars.waiting_for_launch = true;
pthread_create(&object->thread.thread, 0, mac_thread_wrapper, object);
while (mac_vars.waiting_for_launch){
pthread_cond_wait(&mac_vars.thread_launch_cv, &mac_vars.thread_launch_mutex);
}
}
pthread_mutex_unlock(&mac_vars.thread_launch_mutex);
System_Thread result = mac_to_plat_handle(object);
return(result);
}
function
system_thread_join_sig(){
Mac_Object *object = mac_to_object(thread);
if (object->kind == MacObjectKind_Thread){
pthread_join(object->thread.thread, 0);
}
}
function
system_thread_free_sig(){
Mac_Object* object = mac_to_object(thread);
if (object->kind == MacObjectKind_Thread){
mac_free_object(object);
}
}
function
system_thread_get_id_sig(){
pthread_t id = pthread_self();
i32 result = *(i32*)(&id);
return(result);
}
function
system_mutex_make_sig(){
Mac_Object *object = mac_alloc_object(MacObjectKind_Mutex);
mac_init_recursive_mutex(&object->mutex);
System_Mutex result = mac_to_plat_handle(object);
return(result);
}
function
system_mutex_acquire_sig(){
Mac_Object *object = mac_to_object(mutex);
if (object->kind == MacObjectKind_Mutex){
pthread_mutex_lock(&object->mutex);
}
}
function
system_mutex_release_sig(){
Mac_Object *object = mac_to_object(mutex);
if (object->kind == MacObjectKind_Mutex){
pthread_mutex_unlock(&object->mutex);
}
}
function
system_mutex_free_sig(){
Mac_Object *object = mac_to_object(mutex);
if (object->kind == MacObjectKind_Mutex){
pthread_mutex_destroy(&object->mutex);
mac_free_object(object);
}
}
function
system_acquire_global_frame_mutex_sig(){
if (tctx->kind == ThreadKind_AsyncTasks){
system_mutex_acquire(mac_vars.global_frame_mutex);
}
}
function
system_release_global_frame_mutex_sig(){
if (tctx->kind == ThreadKind_AsyncTasks){
system_mutex_release(mac_vars.global_frame_mutex);
}
}
function
system_condition_variable_make_sig(){
Mac_Object *object = mac_alloc_object(MacObjectKind_CV);
pthread_cond_init(&object->cv, 0);
System_Condition_Variable result = mac_to_plat_handle(object);
return(result);
}
function
system_condition_variable_wait_sig(){
Mac_Object *object_cv = mac_to_object(cv);
Mac_Object *object_mutex = mac_to_object(mutex);
if ((object_cv->kind == MacObjectKind_CV) && (object_mutex->kind == MacObjectKind_Mutex)){
pthread_cond_wait(&object_cv->cv, &object_mutex->mutex);
}
}
function
system_condition_variable_signal_sig(){
Mac_Object *object = mac_to_object(cv);
if (object->kind == MacObjectKind_CV){
pthread_cond_signal(&object->cv);
}
}
function
system_condition_variable_free_sig(){
Mac_Object *object = mac_to_object(cv);
if (object->kind == MacObjectKind_CV){
pthread_cond_destroy(&object->cv);
mac_free_object(object);
}
}
////////////////////////////////
struct Memory_Annotation_Tracker_Node{
Memory_Annotation_Tracker_Node *next;
Memory_Annotation_Tracker_Node *prev;
String_Const_u8 location;
u64 size;
};
struct Memory_Annotation_Tracker{
Memory_Annotation_Tracker_Node *first;
Memory_Annotation_Tracker_Node *last;
i32 count;
};
global Memory_Annotation_Tracker memory_tracker = {};
global pthread_mutex_t memory_tracker_mutex;
global_const u64 ALLOCATION_SIZE_ADJUSTMENT = 64;
function void*
mac_memory_allocate_extended(void *base, u64 size, String_Const_u8 location){
u64 adjusted_size = size + ALLOCATION_SIZE_ADJUSTMENT;
void *memory = mmap(base, adjusted_size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
Assert(memory != MAP_FAILED);
Memory_Annotation_Tracker_Node *node = (Memory_Annotation_Tracker_Node*)memory;
pthread_mutex_lock(&memory_tracker_mutex);
{
zdll_push_back(memory_tracker.first, memory_tracker.last, node);
memory_tracker.count += 1;
}
pthread_mutex_unlock(&memory_tracker_mutex);
node->location = location;
node->size = size;
void* result = (node + 1);
return(result);
}
function void
mac_memory_free_extended(void *ptr){
Memory_Annotation_Tracker_Node *node = (Memory_Annotation_Tracker_Node*)ptr;
node -= 1;
pthread_mutex_lock(&memory_tracker_mutex);
{
zdll_remove(memory_tracker.first, memory_tracker.last, node);
memory_tracker.count -= 1;
}
pthread_mutex_unlock(&memory_tracker_mutex);
munmap(node, node->size + ALLOCATION_SIZE_ADJUSTMENT);
}
function
system_memory_allocate_sig(){
void* result = mac_memory_allocate_extended(0, size, location);
return(result);
}
function
system_memory_set_protection_sig(){
b32 result = true;
int protect = 0;
switch (flags & 0x7){
case 0:
{
protect = PROT_NONE;
} break;
case MemProtect_Read:
{
protect = PROT_READ;
} break;
case MemProtect_Write:
case MemProtect_Read | MemProtect_Write:
{
protect = PROT_READ | PROT_WRITE;
} break;
case MemProtect_Execute:
{
protect = PROT_EXEC;
} break;
case MemProtect_Execute | MemProtect_Read:
{
protect = PROT_READ | PROT_EXEC;
} break;
// NOTE(inso): some W^X protection things might be unhappy about this one
case MemProtect_Execute | MemProtect_Write:
case MemProtect_Execute | MemProtect_Write | MemProtect_Read:
{
protect = PROT_READ | PROT_WRITE | PROT_EXEC;
} break;
}
Memory_Annotation_Tracker_Node *node = (Memory_Annotation_Tracker_Node*)ptr;
node -= 1;
if(mprotect(node, size, protect) == -1){
result = false;
}
return(result);
}
function
system_memory_free_sig(){
mac_memory_free_extended(ptr);
}
function
system_memory_annotation_sig(){
Memory_Annotation result = {};
pthread_mutex_lock(&memory_tracker_mutex);
{
for (Memory_Annotation_Tracker_Node *node = memory_tracker.first;
node != 0;
node = node->next){
Memory_Annotation_Node *r_node = push_array(arena, Memory_Annotation_Node, 1);
sll_queue_push(result.first, result.last, r_node);
result.count += 1;
r_node->location = node->location;
r_node->address = node + 1;
r_node->size = node->size;
}
}
pthread_mutex_unlock(&memory_tracker_mutex);
return(result);
}
////////////////////////////////
function
system_show_mouse_cursor_sig(){
mac_vars.cursor_show = show;
}
function
system_set_fullscreen_sig(){
// NOTE(yuval): Read comment in system_set_fullscreen_sig in win32_4ed.cpp
mac_vars.do_toggle = (mac_vars.full_screen != full_screen);
b32 success = true;
return(success);
}
function
system_is_fullscreen_sig(){
// NOTE(yuval): Read comment in system_is_fullscreen_sig in win32_4ed.cpp
b32 result = (mac_vars.full_screen != mac_vars.do_toggle);
return(result);
}
function
system_get_keyboard_modifiers_sig(){
Input_Modifier_Set result = copy_modifier_set(arena, &mac_vars.input_chunk.pers.modifiers);
return(result);
}
////////////////////////////////
/**********************/
/* Graphics API */
/**********************/
////////////////////////////////
function
graphics_get_texture_sig(){
u32 result = renderer->get_texture(renderer, dim, texture_kind);
return(result);
}
function
graphics_fill_texture_sig(){
b32 result = renderer->fill_texture(renderer, texture_kind, texture, p, dim, data);
return(result);
}
////////////////////////////////
/******************/
/* Font API */
/******************/
////////////////////////////////
function
font_make_face_sig(){
Face* result = ft__font_make_face(arena, description, scale_factor);
return(result);
}
////////////////////////////////

View File

@ -0,0 +1,83 @@
/* Mac Metal layer for 4coder */
#import "metal/4ed_metal_render.mm"
////////////////////////////////
struct Mac_Metal{
Mac_Renderer base;
Metal_Renderer *renderer;
MTKView *view;
};
////////////////////////////////
function
mac_render_sig(mac_metal__render){
#if defined(FRED_INTERNAL)
printf("Redering using Metal!\n");
#endif
Mac_Metal *metal = (Mac_Metal*)renderer;
[metal->view draw];
}
function
mac_get_texture_sig(mac_metal__get_texture){
Mac_Metal *metal = (Mac_Metal*)renderer;
u32 result = [metal->renderer get_texture_of_dim:dim
kind:texture_kind];
return(result);
}
function
mac_fill_texture_sig(mac_metal__fill_texture){
Mac_Metal *metal = (Mac_Metal*)renderer;
b32 result = [metal->renderer fill_texture:texture
kind:texture_kind
pos:p
dim:dim
data:data];
return(result);
}
function Mac_Metal*
mac_metal__init(NSWindow *window, Render_Target *target){
// NOTE(yuval): Create the Mac Metal rendere
Mac_Metal *metal = (Mac_Metal*)system_memory_allocate(sizeof(Mac_Metal),
file_name_line_number_lit_u8);
metal->base.render = mac_metal__render;
metal->base.get_texture = mac_metal__get_texture;
metal->base.fill_texture = mac_metal__fill_texture;
// NOTE(yuval): Create the Metal view
NSView *content_view = [window contentView];
metal->view = [[MTKView alloc] initWithFrame:[content_view bounds]];
[metal->view setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
[metal->view setPaused:YES];
[metal->view setEnableSetNeedsDisplay:NO];
metal->view.device = MTLCreateSystemDefaultDevice();
// NOTE(yuval): Add the Metal view as a subview of the window
[content_view addSubview:metal->view];
// NOTE(yuval): Create the Metal renderer and set it as the Metal view's delegate
metal->renderer = [[Metal_Renderer alloc] initWithMetalKitView:metal->view target:target];
metal->view.delegate = metal->renderer;
return(metal);
}
////////////////////////////////
// TODO(yuval): This function should be exported to a DLL
function
mac_load_renderer_sig(mac_load_metal_renderer){
Mac_Renderer *renderer = (Mac_Renderer*)mac_metal__init(window, target);
return(renderer);
}

View File

@ -782,7 +782,7 @@ osx_init(){
osxvars.input.first_step = true;
//
// HACK(allen):
// HACK(allen):
// Previously zipped stuff is here, it should be zipped in the new pattern now.
//

View File

@ -814,9 +814,9 @@ osx_list_loadable_fonts(void){
NSString *font_n = fonts[i];
char *font_n_c = (char*)[font_n UTF8String];
NSFont *font = [font_manager
fontWithFamily:font_n
traits:NSUnboldFontMask|NSUnitalicFontMask
weight:5
fontWithFamily:font_n
traits:NSUnboldFontMask|NSUnitalicFontMask
weight:5
size:12];
NSString *path = get_font_path(font);
char *path_c = 0;

View File

@ -0,0 +1,183 @@
/* Mac OpenGL layer for 4coder */
#include "mac_4ed_renderer.h"
////////////////////////////////
#include <OpenGL/OpenGL.h>
#include <OpenGL/gl.h>
#include "opengl/4ed_opengl_defines.h"
#define GL_FUNC(N,R,P) typedef R (CALL_CONVENTION N##_Function)P; N##_Function *N = 0;
#include "mac_4ed_opengl_funcs.h"
////////////////////////////////
#include "opengl/4ed_opengl_render.cpp"
////////////////////////////////
@interface OpenGL_View : NSOpenGLView
- (void)init_gl;
- (void)render:(Render_Target*)target;
@end
////////////////////////////////
struct Mac_OpenGL{
Mac_Renderer base;
OpenGL_View *view;
};
////////////////////////////////
@implementation OpenGL_View{
b32 gl_is_initialized;
}
- (id)init{
self = [super init];
if (self == nil){
return nil;
}
gl_is_initialized = false;
[self init_gl];
return self;
}
- (void)dealloc{
[super dealloc];
}
- (void)prepareOpenGL{
[super prepareOpenGL];
[[self openGLContext] makeCurrentContext];
// NOTE(yuval): Setup vsync
GLint swap_int = 1;
[[self openGLContext] setValues:&swap_int forParameter:NSOpenGLCPSwapInterval];
}
- (void)awakeFromNib{
[self init_gl];
}
- (void)reshape{
[super reshape];
[[self openGLContext] makeCurrentContext];
[[self openGLContext] update];
}
- (void)init_gl{
if (gl_is_initialized){
return;
}
// NOTE(yuval): Setup OpenGL
NSOpenGLPixelFormatAttribute opengl_attrs[] = {
NSOpenGLPFAOpenGLProfile, NSOpenGLProfileVersion3_2Core,
NSOpenGLPFAAccelerated,
NSOpenGLPFADoubleBuffer,
NSOpenGLPFAColorSize, 32,
NSOpenGLPFAAlphaSize, 8,
NSOpenGLPFADepthSize, 24,
0
};
NSOpenGLPixelFormat *pixel_format = [[NSOpenGLPixelFormat alloc] initWithAttributes:opengl_attrs];
if (pixel_format == nil){
fprintf(stderr, "Error creating OpenGLPixelFormat\n");
exit(1);
}
NSOpenGLContext *context = [[NSOpenGLContext alloc] initWithFormat:pixel_format shareContext:nil];
[self setPixelFormat:pixel_format];
[self setOpenGLContext:context];
[context makeCurrentContext];
[pixel_format release];
gl_is_initialized = true;
}
- (void)render:(Render_Target*)target{
Assert(gl_is_initialized);
CGLLockContext([[self openGLContext] CGLContextObj]);
[[self openGLContext] makeCurrentContext];
gl_render(target);
[[self openGLContext] flushBuffer];
CGLUnlockContext([[self openGLContext] CGLContextObj]);
}
@end
////////////////////////////////
function
mac_render_sig(mac_gl__render){
#if defined(FRED_INTERNAL)
printf("Redering using OpenGL!\n");
#endif
Mac_OpenGL *gl = (Mac_OpenGL*)renderer;
[gl->view render:target];
}
function
mac_get_texture_sig(mac_gl__get_texture){
u32 result = gl__get_texture(dim, texture_kind);
return(result);
}
function
mac_fill_texture_sig(mac_gl__fill_texture){
b32 result = gl__fill_texture(texture_kind, texture, p, dim, data);
return(result);
}
function Mac_OpenGL*
mac_gl__init(NSWindow *window, Render_Target *target){
// NOTE(yuval): Create the Mac OpenGL Renderer
Mac_OpenGL *gl = (Mac_OpenGL*)system_memory_allocate(sizeof(Mac_OpenGL),
file_name_line_number_lit_u8);
gl->base.render = mac_gl__render;
gl->base.get_texture = mac_gl__get_texture;
gl->base.fill_texture = mac_gl__fill_texture;
// NOTE(yuval): Create the OpenGL view
NSView *content_view = [window contentView];
gl->view = [[OpenGL_View alloc] init];
[gl->view setFrame:[content_view bounds]];
[gl->view setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
[gl->view setWantsBestResolutionOpenGLSurface:YES];
// NOTE(yuval): Add the OpenGL view as a subview of the window
[content_view addSubview:gl->view];
// NOTE(yuval): Load gl functions
void *gl_image = dlopen("/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL", RTLD_LAZY);
#define GL_FUNC(f,R,P) ((f) = (f##_Function*)dlsym(gl_image, #f));
#include "mac_4ed_opengl_funcs.h"
return(gl);
}
////////////////////////////////
// TODO(yuval): This function should be exported to a DLL
function
mac_load_renderer_sig(mac_load_opengl_renderer){
Mac_Renderer *renderer = (Mac_Renderer*)mac_gl__init(window, target);
return(renderer);
}

View File

@ -0,0 +1,17 @@
/* Mac OpenGL functions for 4coder */
// TOP
/* Usage:
#define GL_FUNC(N,R,P) ~~~~
#include "4ed_opengl_funcs.h"
*/
GL_FUNC(glDebugMessageControl, void, (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled))
GL_FUNC(glDebugMessageCallback, void, (GLDEBUGPROC callback, const void *userParam))
GL_FUNC(glGenVertexArrays, void, (GLsizei n, GLuint *arrays))
GL_FUNC(glBindVertexArray, void, (GLuint array))
GL_FUNC(glVertexAttribIPointer, void, (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer))
#undef GL_FUNC

View File

@ -0,0 +1,44 @@
/* Mac Renderer Abstraction */
#if !defined(FRED_MAC_RENDERER_H)
#define FRED_MAC_RENDERER_H
////////////////////////////////
// TODO(yuval): This should be refactored into a platform independent renderer
struct Mac_Renderer;
#define mac_render_sig(name) void name(Mac_Renderer *renderer, Render_Target *target)
typedef mac_render_sig(mac_render_type);
#define mac_get_texture_sig(name) u32 name(Mac_Renderer *renderer, Vec3_i32 dim, Texture_Kind texture_kind)
typedef mac_get_texture_sig(mac_get_texture_type);
#define mac_fill_texture_sig(name) b32 name(Mac_Renderer *renderer, Texture_Kind texture_kind, u32 texture, Vec3_i32 p, Vec3_i32 dim, void* data)
typedef mac_fill_texture_sig(mac_fill_texture_type);
typedef i32 Mac_Renderer_Kind;
enum{
MacRenderer_OpenGL,
MacRenderer_Metal,
//
MacRenderer_COUNT
};
struct Mac_Renderer{
mac_render_type *render;
mac_get_texture_type *get_texture;
mac_fill_texture_type *fill_texture;
};
////////////////////////////////
// NOTE(yuval): This is the actual platform dependent function that each renderer implementation implements and should be exported into a DLL
#define mac_load_renderer_sig(name) Mac_Renderer* name(NSWindow *window, Render_Target *target)
typedef mac_load_renderer_sig(mac_load_renderer_type);
////////////////////////////////
#endif

View File

@ -0,0 +1,26 @@
/* Mac Renderer Abstraction Implementation */
// TODO(yuval): This should NOT be included here once the renderer is exported to a DLL
#import "mac_4ed_opengl.mm"
#import "mac_4ed_metal.mm"
// TODO(yuval): Replace this array with an array of the paths to the renderer dlls
global mac_load_renderer_type *mac_renderer_load_functions[MacRenderer_COUNT] = {
mac_load_opengl_renderer,
mac_load_metal_renderer
};
function Mac_Renderer*
mac_init_renderer(Mac_Renderer_Kind kind, NSWindow *window, Render_Target *target){
// TODO(yuval): Import renderer load function from a DLL instead of using an array of the load functions. This would allow us to switch the renderer backend and implemented new backends with ease.
mac_load_renderer_type *load_renderer = mac_renderer_load_functions[kind];
Mac_Renderer *result = load_renderer(window, target);
if (!result){
mac_error_box("Unable to initialize the renderer!");
}
return result;
}

View File

@ -0,0 +1,24 @@
/* Types and functions for communication between C++ and Objective-C layers. */
#if !defined(MAC_OBJECTIVE_C_TO_CPP_LINKS_H)
#define MAC_OBJECTIVE_C_TO_CPP_LINKS_H
// In C++ layer
external String_Const_u8
mac_SCu8(u8* str, u64 size);
external String_Const_u8
mac_push_string_copy(Arena *arena, String_Const_u8 src);
external void
mac_init();
// In Objective-C layer
external String_Const_u8
mac_standardize_path(Arena* arena, String_Const_u8 path);
external i32
mac_get_binary_path(void* buffer, u32 size);
#endif

View File

@ -64,7 +64,7 @@ Sys_Memory_Allocate_Sig(system_memory_allocate){
return(result);
}
internal
internal
Sys_Memory_Set_Protection_Sig(system_memory_set_protection){
bool32 result = true;

View File

@ -335,7 +335,7 @@ system_set_fullscreen_sig(){
internal
system_is_fullscreen_sig(){
// NOTE(allen): Report the fullscreen status as it would be set at the beginning of the
// NOTE(allen): Report the fullscreen status as it would be set at the beginning of the
// next frame. That is, take into account all fullscreen toggle requests that have come in
// already this frame. Read: "full_screen XOR do_toggle"
b32 result = (win32vars.full_screen != win32vars.do_toggle);
@ -605,6 +605,9 @@ os_popup_error(char *title, char *message){
#include "4ed_font_provider_freetype.cpp"
#include <GL/gl.h>
#include "opengl/4ed_opengl_defines.h"
#define GL_FUNC(N,R,P) typedef R (CALL_CONVENTION N##_Function)P; N##_Function *N = 0;
#include "opengl/4ed_opengl_funcs.h"
#include "opengl/4ed_opengl_render.cpp"
internal
@ -640,6 +643,7 @@ win32_keycode_init(void){
keycode_lookup_table[VK_SPACE] = KeyCode_Space;
keycode_lookup_table[VK_OEM_3] = KeyCode_Tick;
keycode_lookup_table[VK_OEM_MINUS] = KeyCode_Minus;
keycode_lookup_table[VK_OEM_PLUS] = KeyCode_Equal;
keycode_lookup_table[VK_OEM_4] = KeyCode_LeftBracket;
keycode_lookup_table[VK_OEM_6] = KeyCode_RightBracket;
keycode_lookup_table[VK_OEM_1] = KeyCode_Semicolon;
@ -1240,10 +1244,10 @@ win32_wgl_good(Void_Func *f){
f != (Void_Func*)-1);
}
typedef HGLRC (wglCreateContextAttribsARB_Function)(HDC,HGLRC,i32*);
typedef BOOL (wglChoosePixelFormatARB_Function)(HDC,i32*,f32*,u32,i32*,u32*);
typedef char* (wglGetExtensionsStringEXT_Function)();
typedef VOID (wglSwapIntervalEXT_Function)(i32);
typedef HGLRC (CALL_CONVENTION wglCreateContextAttribsARB_Function)(HDC,HGLRC,i32*);
typedef BOOL (CALL_CONVENTION wglChoosePixelFormatARB_Function)(HDC,i32*,f32*,u32,i32*,u32*);
typedef char* (CALL_CONVENTION wglGetExtensionsStringEXT_Function)();
typedef VOID (CALL_CONVENTION wglSwapIntervalEXT_Function)(i32);
global wglCreateContextAttribsARB_Function *wglCreateContextAttribsARB = 0;
global wglChoosePixelFormatARB_Function *wglChoosePixelFormatARB = 0;
@ -1308,7 +1312,7 @@ win32_gl_create_window(HWND *wnd_out, HGLRC *context_out, DWORD style, RECT rect
// NOTE(allen): Load wgl extensions
#define LoadWGL(f,l) Stmnt((f) = (f##_Function*)wglGetProcAddress(#f); \
(l) = (l) && win32_wgl_good((Void_Func*)(f));)
(l) = (l) && win32_wgl_good((Void_Func*)(f));)
b32 load_success = true;
LoadWGL(wglCreateContextAttribsARB, load_success);
@ -1413,10 +1417,10 @@ win32_gl_create_window(HWND *wnd_out, HGLRC *context_out, DWORD style, RECT rect
/*0*/WGL_CONTEXT_MAJOR_VERSION_ARB, 3,
/*2*/WGL_CONTEXT_MINOR_VERSION_ARB, 2,
/*4*/WGL_CONTEXT_FLAGS_ARB, WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB
#if GL_DEBUG_MODE
|WGL_CONTEXT_DEBUG_BIT_ARB
#endif
,
#if GL_DEBUG_MODE
|WGL_CONTEXT_DEBUG_BIT_ARB
#endif
,
/*6*/WGL_CONTEXT_PROFILE_MASK_ARB, WGL_CONTEXT_CORE_PROFILE_BIT_ARB,
/*8*/0
};

View File

@ -444,7 +444,7 @@ color_picker_hook(HWND Window, UINT Message, WPARAM WParam, LPARAM LParam){
// Would it have killed you to update rgbResult continuously, or at least
// provide a GetCurrentColor() call???
//
// Anyway, since the color picker doesn't tell us when the color is
// Anyway, since the color picker doesn't tell us when the color is
// changed, what we do is watch for messages that repaint the color
// swatch, which is dialog id 0x2c5, and then we sample it to see what
// color it is. No, I'm not fucking kidding, that's what we do.
@ -533,7 +533,7 @@ internal
system_open_color_picker_sig(){
// TODO(allen): review
// NOTE(casey): Because this is going to be used by a semi-permanent thread, we need to
// copy it to system memory where it can live as long as it wants, no matter what we do
// copy it to system memory where it can live as long as it wants, no matter what we do
// over here on the 4coder threads.
Color_Picker *perm = (Color_Picker*)system_memory_allocate(sizeof(Color_Picker), string_u8_litexpr(file_name_line_number));
*perm = *picker;

View File

@ -6,6 +6,7 @@ patterns = {
"*.cpp",
"*.h",
"*.m",
"*.mm",
"*.bat",
"*.sh",
"*.4coder",
@ -25,21 +26,23 @@ load_paths = {
build_x64_win32 = "echo build: x64 & bin\\build.bat";
build_x86_win32 = "echo build: x86 & bin\\build.bat /DDEV_BUILD_X86";
build_x64_unix = "echo build: x64 & bin/build.sh";
build_x86_unix = "echo build: x86 & bin/build.sh -DDEV_BUILD_X86";
build_x64_linux = "echo build: x64 & bin/build.sh";
build_x86_linux = "echo build: x86 & bin/build.sh -DDEV_BUILD_X86";
build_x64_mac = "echo build: x64 & bin/build-mac.sh";
build_x86_mac = "echo build: x86 & bin/build-mac.sh -DDEV_BUILD_X86";
command_list = {
{ .name = "build x64",
.out = "*compilation*", .footer_panel = true, .save_dirty_files = true,
.cmd = { {build_x64_win32, .os = "win" },
{build_x64_unix , .os = "linux"},
{build_x64_unix , .os = "mac" }, }, },
{build_x64_linux, .os = "linux"},
{build_x64_mac , .os = "mac" }, }, },
{ .name = "build x86",
.out = "*compilation*", .footer_panel = true, .save_dirty_files = true,
.cmd = { {build_x86_win32, .os = "win" },
{build_x86_unix , .os = "linux"},
{build_x86_unix , .os = "mac" }, }, },
{build_x86_linux, .os = "linux"},
{build_x86_mac , .os = "mac" }, }, },
{ .name = "package",
.out = "*compilation*", .footer_panel = false, .save_dirty_files = true,
@ -49,11 +52,13 @@ command_list = {
{ .name = "run one time",
.out = "*run*", .footer_panel = false, .save_dirty_files = false,
.cmd = { { "pushd ..\\build & one_time", .os = "win" }, }, },
.cmd = { { "pushd ..\\build & one_time", .os = "win" },
{ "pushd ../build & one_time", .os = "mac" }, }, },
{ .name = "build custom api docs",
.out = "*compilation*", .footer_panel = true, .save_dirty_files = true,
.cmd = { { "custom\\bin\\build_one_time docs\\4ed_doc_custom_api_main.cpp ..\\build", .os = "win" }, }, },
.cmd = { { "custom\\bin\\build_one_time docs\\4ed_doc_custom_api_main.cpp ..\\build", .os = "win" },
{ "custom/bin/build_one_time.sh docs/4ed_doc_custom_api_main.cpp ../build", .os = "mac" }, }, },
{ .name = "build C++ lexer generator",
.out = "*compilation*", .footer_panel = true, .save_dirty_files = true,

View File

@ -6,9 +6,12 @@ https://github.com/4coder-editor/4coder/issues
For questions email:
editor@4coder.net
Sign up for the newsletter for the most critical 4coder news:
newsletter.4coder.net
Watch the 4coder.handmade.network blog and @AllenWebster4th twitter for news about 4coder.
For documentation, feature lists, and usage tutorial videos go to:
For documentation, feature lists, and more visit the home page:
4coder.net

Some files were not shown because too many files have changed in this diff Show More