Fade ranges added to default rendering rules; fixed crash on bad font path

master
Allen Webster 2020-01-15 10:14:17 -08:00
parent d0937976d7
commit 4a8febcdde
19 changed files with 3037 additions and 2935 deletions

View File

@ -531,8 +531,8 @@ buffer_padded_box_of_pos(Application_Links *app, Buffer_ID buffer_id, f32 width,
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);
layout_func, width, face,
base_line, pos);
}
}
return(result);
@ -1706,23 +1706,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;
@ -2019,7 +2002,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
}
@ -2418,7 +2401,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);
@ -2861,10 +2844,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);
@ -3022,13 +3005,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

@ -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;
@ -62,8 +53,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

@ -289,7 +289,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

@ -236,13 +236,13 @@ view_relative_xy_of_pos(Thread_Context *tctx, Models *models, View *view,
function Rect_f32
view_padded_box_of_pos(Thread_Context *tctx, Models *models, View *view,
i64 base_line, i64 pos){
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));
layout_func, width, face, base_line, pos));
}
internal Buffer_Point
@ -441,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
@ -529,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

@ -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);
@ -61,9 +61,8 @@ CUSTOM_DOC("At the cursor, insert the text at the top of the clipboard.")
view_set_mark(app, view, seek_pos(pos));
view_set_cursor_and_preferred_x(app, view, seek_pos(pos + (i32)string.size));
// 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);
buffer_post_fade(app, buffer, 0.667f, Ii64_size(pos, string.size), argb);
}
}
}
@ -99,7 +98,7 @@ CUSTOM_DOC("If the previous command was paste or paste_next, replaces the paste
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);
buffer_post_fade(app, buffer, 0.667f, Ii64_size(pos, string.size), argb);
}
else{
paste(app);
@ -150,9 +149,7 @@ CUSTOM_COMMAND_SIG(multi_paste){
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);
view_post_fade(app, buffer, 0.667f, Ii64(range.max + 1, range.max + insert_string.size), argb);
}
else{
paste(app);
@ -207,9 +204,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);

View File

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

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,13 @@ 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 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));
#undef M
#if 0
@ -529,6 +529,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 +689,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

@ -91,5 +91,12 @@ 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

View File

@ -189,6 +189,10 @@ default_tick(Application_Links *app, Frame_Info frame_info){
}
buffer_modified_set_clear();
if (tick_all_fade_ranges(frame_info.animation_dt)){
animate_in_n_milliseconds(app, 0);
}
}
function Rect_f32
@ -252,7 +256,7 @@ recursive_nest_highlight(Application_Links *app, Text_Layout_ID layout_id, Range
}
}
ARGB_Color argb = finalize_color(defcolor_text_cycle, counter);
ARGB_Color argb = finalize_color(defcolor_text_cycle, counter);
for (;ptr < ptr_end; ptr += 1){
Code_Index_Nest *nest = *ptr;
@ -362,6 +366,9 @@ default_render_buffer(Application_Links *app, View_ID view_id, Face_ID face_id,
}break;
}
// NOTE(allen): Fade ranges
paint_fade_ranges(app, text_layout_id, buffer, view_id);
// NOTE(allen): put the actual text on the actual screen
draw_text_layout_default(app, text_layout_id);
@ -627,18 +634,18 @@ do_full_lex_async__inner(Async_Context *actx, Buffer_ID buffer_id){
Token_List list = {};
b32 canceled = false;
Lex_State_Cpp state = {};
lex_full_input_cpp_init(&state, contents);
for (;;){
ProfileBlock(app, "async lex block");
if (lex_full_input_cpp_breaks(scratch, &list, &state, limit_factor)){
break;
}
if (async_check_canceled(actx)){
canceled = true;
break;
}
Lex_State_Cpp state = {};
lex_full_input_cpp_init(&state, contents);
for (;;){
ProfileBlock(app, "async lex block");
if (lex_full_input_cpp_breaks(scratch, &list, &state, limit_factor)){
break;
}
if (async_check_canceled(actx)){
canceled = true;
break;
}
}
if (!canceled){
ProfileBlock(app, "async lex save results (before mutex)");
@ -804,7 +811,7 @@ BUFFER_HOOK_SIG(default_begin_buffer){
b32 treat_as_code = false;
String_Const_u8 file_name = push_buffer_file_name(app, scratch, buffer_id);
if (file_name.size > 0){
String_Const_u8_Array extensions = global_config.code_exts;
String_Const_u8_Array extensions = global_config.code_exts;
String_Const_u8 ext = string_file_extension(file_name);
for (i32 i = 0; i < extensions.count; ++i){
if (string_match(ext, extensions.strings[i])){
@ -1108,7 +1115,7 @@ BUFFER_HOOK_SIG(default_end_buffer){
if (lex_task_ptr != 0){
async_task_cancel(&global_async_system, *lex_task_ptr);
}
buffer_unmark_as_modified(buffer_id);
buffer_unmark_as_modified(buffer_id);
code_index_lock();
code_index_erase_file(buffer_id);
code_index_unlock();

View File

@ -118,8 +118,6 @@
#include "4coder_default_hooks.cpp"
#include "generated/managed_id_metadata.cpp"
#endif
// BOTTOM

View File

@ -111,16 +111,13 @@ draw_character_block(Application_Links *app, Text_Layout_ID layout, Range_i64 ra
}
draw_rectangle(app, Rf32(x, y), roundness, color);
}
for (i64 i = range.first; i < range.one_past_last; i += 1){
draw_character_block(app, layout, i, roundness, color);
}
}
function void
draw_character_block(Application_Links *app, Text_Layout_ID layout, Range_i64 range, f32 roundness, FColor color){
ARGB_Color argb = fcolor_resolve(color);
draw_character_block(app, layout, range, roundness, argb);
}
}
function void
draw_character_wire_frame(Application_Links *app, Text_Layout_ID layout, i64 pos, f32 roundness, f32 thickness, ARGB_Color color){
@ -428,7 +425,7 @@ draw_fps_hud(Application_Links *app, Frame_Info frame_info,
function FColor
get_token_color_cpp(Token token){
Managed_ID color = defcolor_text_default;
Managed_ID color = defcolor_text_default;
switch (token.kind){
case TokenBaseKind_Preprocessor:
{
@ -699,7 +696,7 @@ draw_highlight_range(Application_Links *app, View_ID view_id,
draw_character_block(app, text_layout_id, range, roundness,
fcolor_id(defcolor_highlight));
paint_text_color_fcolor(app, text_layout_id, range,
fcolor_id(defcolor_at_highlight));
fcolor_id(defcolor_at_highlight));
}
}
}
@ -755,10 +752,8 @@ draw_notepad_style_cursor_highlight(Application_Links *app, View_ID view_id,
i64 mark_pos = view_get_mark_pos(app, view_id);
if (cursor_pos != mark_pos){
Range_i64 range = Ii64(cursor_pos, mark_pos);
draw_character_block(app, text_layout_id, range, roundness,
fcolor_id(defcolor_highlight));
paint_text_color_fcolor(app, text_layout_id, range,
fcolor_id(defcolor_at_highlight));
draw_character_block(app, text_layout_id, range, roundness, fcolor_id(defcolor_highlight));
paint_text_color_fcolor(app, text_layout_id, range, fcolor_id(defcolor_at_highlight));
}
draw_character_i_bar(app, text_layout_id, cursor_pos, fcolor_id(defcolor_cursor, cursor_sub_id));
}

View File

@ -710,8 +710,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;

View File

@ -274,7 +274,7 @@ static Command_Metadata fcoder_metacmd_table[229] = {
{ PROC_LINKS(close_build_panel, 0), false, "close_build_panel", 17, "If the special build panel is open, closes it.", 46, "w:\\4ed\\code\\custom\\4coder_build_commands.cpp", 44, 180 },
{ PROC_LINKS(close_panel, 0), false, "close_panel", 11, "Closes the currently active panel if it is not the only panel open.", 67, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 619 },
{ 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, "w:\\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, "w:\\4ed\\code\\custom\\4coder_lists.cpp", 35, 754 },
{ PROC_LINKS(command_lister, 0), true, "command_lister", 14, "Opens an interactive list of all registered commands.", 53, "w:\\4ed\\code\\custom\\4coder_lists.cpp", 35, 753 },
{ PROC_LINKS(comment_line, 0), false, "comment_line", 12, "Insert '//' at the beginning of the line after leading whitespace.", 66, "w:\\4ed\\code\\custom\\4coder_combined_write_commands.cpp", 53, 125 },
{ PROC_LINKS(comment_line_toggle, 0), false, "comment_line_toggle", 19, "Turns uncommented lines into commented lines and vice versa for comments starting with '//'.", 92, "w:\\4ed\\code\\custom\\4coder_combined_write_commands.cpp", 53, 149 },
{ PROC_LINKS(copy, 0), false, "copy", 4, "Copy the text in the range from the cursor to the mark onto the clipboard.", 74, "w:\\4ed\\code\\custom\\4coder_clipboard.cpp", 39, 19 },
@ -390,9 +390,9 @@ static Command_Metadata fcoder_metacmd_table[229] = {
{ PROC_LINKS(page_down, 0), false, "page_down", 9, "Scrolls the view down one view height and moves the cursor down one view height.", 80, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 372 },
{ PROC_LINKS(page_up, 0), false, "page_up", 7, "Scrolls the view up one view height and moves the cursor up one view height.", 76, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 364 },
{ PROC_LINKS(paste, 0), false, "paste", 5, "At the cursor, insert the text at the top of the clipboard.", 59, "w:\\4ed\\code\\custom\\4coder_clipboard.cpp", 39, 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, "w:\\4ed\\code\\custom\\4coder_clipboard.cpp", 39, 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, "w:\\4ed\\code\\custom\\4coder_clipboard.cpp", 39, 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, "w:\\4ed\\code\\custom\\4coder_clipboard.cpp", 39, 117 },
{ PROC_LINKS(paste_and_indent, 0), false, "paste_and_indent", 16, "Paste from the top of clipboard and run auto-indent on the newly pasted text.", 77, "w:\\4ed\\code\\custom\\4coder_clipboard.cpp", 39, 109 },
{ PROC_LINKS(paste_next, 0), false, "paste_next", 10, "If the previous command was paste or paste_next, replaces the paste range with the next text down on the clipboard, otherwise operates as the paste command.", 156, "w:\\4ed\\code\\custom\\4coder_clipboard.cpp", 39, 70 },
{ PROC_LINKS(paste_next_and_indent, 0), false, "paste_next_and_indent", 21, "Paste the next item on the clipboard and run auto-indent on the newly pasted text.", 82, "w:\\4ed\\code\\custom\\4coder_clipboard.cpp", 39, 116 },
{ PROC_LINKS(place_in_scope, 0), false, "place_in_scope", 14, "Wraps the code contained in the range between cursor and mark with a new curly brace scope.", 91, "w:\\4ed\\code\\custom\\4coder_scope_commands.cpp", 44, 106 },
{ PROC_LINKS(profile_clear, 0), false, "profile_clear", 13, "Clear all profiling information from 4coder's self profiler.", 60, "w:\\4ed\\code\\custom\\4coder_profile.cpp", 37, 226 },
{ PROC_LINKS(profile_disable, 0), false, "profile_disable", 15, "Prevent 4coder's self profiler from gathering new profiling information.", 72, "w:\\4ed\\code\\custom\\4coder_profile.cpp", 37, 219 },
@ -448,7 +448,7 @@ static Command_Metadata fcoder_metacmd_table[229] = {
{ PROC_LINKS(snippet_lister, 0), true, "snippet_lister", 14, "Opens a snippet lister for inserting whole pre-written snippets of text.", 72, "w:\\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, "w:\\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, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1513 },
{ PROC_LINKS(theme_lister, 0), true, "theme_lister", 12, "Opens an interactive list of all registered themes.", 51, "w:\\4ed\\code\\custom\\4coder_lists.cpp", 35, 778 },
{ PROC_LINKS(theme_lister, 0), true, "theme_lister", 12, "Opens an interactive list of all registered themes.", 51, "w:\\4ed\\code\\custom\\4coder_lists.cpp", 35, 777 },
{ 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, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 563 },
{ 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, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 550 },
{ PROC_LINKS(toggle_filebar, 0), false, "toggle_filebar", 14, "Toggles the visibility status of the current view's filebar.", 60, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 656 },

View File

@ -92,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;
@ -170,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;
@ -273,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;
@ -351,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

@ -90,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)
@ -168,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)
@ -267,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);
@ -345,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);
@ -445,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;
@ -523,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;
@ -624,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);
@ -702,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);
@ -803,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;
@ -881,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

@ -90,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);
@ -168,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

@ -915,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");