API Cleanup, documentation work

master
Allen Webster 2018-10-01 12:32:28 -07:00
parent 418b14f092
commit 10fdb57542
15 changed files with 862 additions and 371 deletions

View File

@ -695,40 +695,40 @@ static Managed_Scope ManagedScope_NULL = 0;
static Managed_Variable_ID ManagedVariableIndex_ERROR = -1;
static Managed_Object ManagedObject_NULL = 0;
STRUCT Marker_Visuals{
STRUCT Marker_Visual{
Managed_Scope scope;
uint32_t slot_id;
uint32_t gen_id;
};
ENUM(int32_t, Marker_Visuals_Type)
ENUM(int32_t, Marker_Visual_Type)
{
BufferMarkersType_Invisible = 0,
BufferMarkersType_CharacterBlocks = 1,
BufferMarkersType_CharacterWireFrames = 2,
BufferMarkersType_CharacterIBars = 3,
BufferMarkersType_LineHighlights = 4,
BufferMarkersType_CharacterHighlightRanges = 5,
BufferMarkersType_LineHighlightRanges = 6,
BufferMarkersType_COUNT = 7,
VisualType_Invisible = 0,
VisualType_CharacterBlocks = 1,
VisualType_CharacterWireFrames = 2,
VisualType_CharacterIBars = 3,
VisualType_LineHighlights = 4,
VisualType_CharacterHighlightRanges = 5,
VisualType_LineHighlightRanges = 6,
VisualType_COUNT = 7,
};
ENUM(uint32_t, Marker_Visuals_Symbolic_Color)
ENUM(uint32_t, Marker_Visual_Symbolic_Color)
{
SymbolicColor_Default = 0,
SymbolicColor_Transparent = 1,
SymbolicColor__StagColorFlag = 0x00800000,
};
#define SymbolicColorFromPalette(x) ((x)|SymbolicColor__StagColorFlag)
ENUM(int32_t, Marker_Visuals_Text_Style)
ENUM(int32_t, Marker_Visual_Text_Style)
{
MARKER_TEXT_STYLE_NOT_YET_IMPLEMENTED,
};
STRUCT Marker_Visuals_Take_Rule{
STRUCT Marker_Visual_Take_Rule{
int32_t first_index;
int32_t take_count_per_step;
int32_t step_stride_in_marker_count;
int32_t maximum_number_of_markers;
};
ENUM(uint32_t, Marker_Visuals_Priority_Level){
ENUM(uint32_t, Marker_Visual_Priority_Level){
VisualPriority_Lowest = 0,
VisualPriority_Low = 1000,
VisualPriority_Default = 2000,

View File

@ -695,12 +695,12 @@ isearch(Application_Links *app, bool32 start_reversed, String query_init, bool32
Managed_Scope view_scope = view_get_managed_scope(app, view.view_id);
Managed_Object highlight = alloc_buffer_markers_on_buffer(app, buffer.buffer_id, 2, &view_scope);
Marker_Visuals visuals = create_marker_visuals(app, highlight);
marker_visuals_set_look(app, visuals,
BufferMarkersType_CharacterHighlightRanges,
SymbolicColorFromPalette(Stag_Highlight),
SymbolicColorFromPalette(Stag_At_Highlight), 0);
marker_visuals_set_view_key(app, visuals, view.view_id);
Marker_Visual visual = create_marker_visual(app, highlight);
marker_visual_set_look(app, visual,
VisualType_CharacterHighlightRanges,
SymbolicColorFromPalette(Stag_Highlight),
SymbolicColorFromPalette(Stag_At_Highlight), 0);
marker_visual_set_view_key(app, visual, view.view_id);
isearch__update_highlight(app, &view, highlight, match.start, match.end);
cursor_is_hidden = true;
@ -932,12 +932,12 @@ query_replace_base(Application_Links *app, View_Summary *view, Buffer_Summary *b
Managed_Scope view_scope = view_get_managed_scope(app, view->view_id);
Managed_Object highlight = alloc_buffer_markers_on_buffer(app, buffer->buffer_id, 2, &view_scope);
Marker_Visuals visuals = create_marker_visuals(app, highlight);
marker_visuals_set_look(app, visuals,
BufferMarkersType_CharacterHighlightRanges,
SymbolicColorFromPalette(Stag_Highlight),
SymbolicColorFromPalette(Stag_At_Highlight), 0);
marker_visuals_set_view_key(app, visuals, view->view_id);
Marker_Visual visual = create_marker_visual(app, highlight);
marker_visual_set_look(app, visual,
VisualType_CharacterHighlightRanges,
SymbolicColorFromPalette(Stag_Highlight),
SymbolicColorFromPalette(Stag_At_Highlight), 0);
marker_visual_set_view_key(app, visual, view->view_id);
cursor_is_hidden = true;
User_Input in = {0};

View File

@ -113,7 +113,7 @@ get_enclosure_ranges(Application_Links *app, Partition *part,
static void
mark_enclosures(Application_Links *app, Partition *scratch, Managed_Scope render_scope,
Buffer_Summary *buffer, int32_t pos, uint32_t flags,
Marker_Visuals_Type type,
Marker_Visual_Type type,
int_color *back_colors, int_color *fore_colors, int32_t color_count){
Temp_Memory temp = begin_temp_memory(scratch);
Range_Array ranges = get_enclosure_ranges(app, scratch,
@ -133,7 +133,7 @@ mark_enclosures(Application_Links *app, Partition *scratch, Managed_Scope render
Managed_Object o = alloc_buffer_markers_on_buffer(app, buffer->buffer_id, marker_count, &render_scope);
managed_object_store_data(app, o, 0, marker_count, markers);
Marker_Visuals_Take_Rule take_rule = {0};
Marker_Visual_Take_Rule take_rule = {0};
take_rule.take_count_per_step = 2;
take_rule.step_stride_in_marker_count = 8;
@ -141,7 +141,7 @@ mark_enclosures(Application_Links *app, Partition *scratch, Managed_Scope render
for (int32_t i = 0, color_index = first_color_index;
i < color_count;
i += 1){
Marker_Visuals visuals = create_marker_visuals(app, o);
Marker_Visual visual = create_marker_visual(app, o);
int_color back = SymbolicColor_Transparent;
int_color fore = SymbolicColor_Default;
if (back_colors != 0){
@ -150,9 +150,9 @@ mark_enclosures(Application_Links *app, Partition *scratch, Managed_Scope render
if (fore_colors != 0){
fore = fore_colors[color_index];
}
marker_visuals_set_look(app, visuals, type, back, fore, 0);
marker_visual_set_effect(app, visual, type, back, fore, 0);
take_rule.first_index = i*2;
marker_visuals_set_take_rule(app, visuals, take_rule);
marker_visual_set_take_rule(app, visual, take_rule);
color_index = color_index - 1;
if (color_index < 0){
color_index += color_count;
@ -229,11 +229,11 @@ RENDER_CALLER_SIG(default_render_caller){
int32_t marker_count = (int32_t)(push_array(scratch, Marker, 0) - markers);
Managed_Object o = alloc_buffer_markers_on_buffer(app, buffer.buffer_id, marker_count, &render_scope);
managed_object_store_data(app, o, 0, marker_count, markers);
Marker_Visuals v = create_marker_visuals(app, o);
marker_visuals_set_look(app, v,
BufferMarkersType_CharacterHighlightRanges,
SymbolicColor_Transparent, current_color, 0);
marker_visuals_set_priority(app, v, VisualPriority_Lowest);
Marker_Visual v = create_marker_visual(app, o);
marker_visual_set_effect(app, v,
VisualType_CharacterHighlightRanges,
SymbolicColor_Transparent, current_color, 0);
marker_visual_set_priority(app, v, VisualPriority_Lowest);
end_temp_memory(marker_temp);
current_color = records[i].color;
}
@ -265,25 +265,25 @@ RENDER_CALLER_SIG(default_render_caller){
uint32_t cursor_color = colors[0].color;
uint32_t mark_color = colors[1].color;
Marker_Visuals_Take_Rule take_rule = {0};
Marker_Visual_Take_Rule take_rule = {0};
take_rule.first_index = 0;
take_rule.take_count_per_step = 1;
take_rule.step_stride_in_marker_count = 1;
take_rule.maximum_number_of_markers = 1;
Marker_Visuals visuals = create_marker_visuals(app, cursor_and_mark);
Marker_Visuals_Type type = is_active_view?BufferMarkersType_CharacterBlocks:BufferMarkersType_CharacterWireFrames;
marker_visuals_set_look(app, visuals,
type, cursor_color, SymbolicColorFromPalette(Stag_At_Cursor), 0);
marker_visuals_set_take_rule(app, visuals, take_rule);
marker_visuals_set_priority(app, visuals, VisualPriority_Highest);
Marker_Visual visual = create_marker_visual(app, cursor_and_mark);
Marker_Visual_Type type = is_active_view?VisualType_CharacterBlocks:VisualType_CharacterWireFrames;
marker_visual_set_effect(app, visual,
type, cursor_color, SymbolicColorFromPalette(Stag_At_Cursor), 0);
marker_visual_set_take_rule(app, visual, take_rule);
marker_visual_set_priority(app, visual, VisualPriority_Highest);
visuals = create_marker_visuals(app, cursor_and_mark);
marker_visuals_set_look(app, visuals,
BufferMarkersType_CharacterWireFrames, mark_color, 0, 0);
visual = create_marker_visual(app, cursor_and_mark);
marker_visual_set_effect(app, visual,
VisualType_CharacterWireFrames, mark_color, 0, 0);
take_rule.first_index = 1;
marker_visuals_set_take_rule(app, visuals, take_rule);
marker_visuals_set_priority(app, visuals, VisualPriority_Highest);
marker_visual_set_take_rule(app, visual, take_rule);
marker_visual_set_priority(app, visual, VisualPriority_Highest);
}break;
case FCoderMode_NotepadLike:
@ -295,23 +295,23 @@ RENDER_CALLER_SIG(default_render_caller){
uint32_t cursor_color = colors[0].color;
uint32_t highlight_color = colors[1].color;
Marker_Visuals_Take_Rule take_rule = {0};
Marker_Visual_Take_Rule take_rule = {0};
take_rule.first_index = 0;
take_rule.take_count_per_step = 1;
take_rule.step_stride_in_marker_count = 1;
take_rule.maximum_number_of_markers = 1;
Marker_Visuals visuals = create_marker_visuals(app, cursor_and_mark);
marker_visuals_set_look(app, visuals, BufferMarkersType_CharacterIBars, cursor_color, 0, 0);
marker_visuals_set_take_rule(app, visuals, take_rule);
marker_visuals_set_priority(app, visuals, VisualPriority_Highest);
Marker_Visual visual = create_marker_visual(app, cursor_and_mark);
marker_visual_set_effect(app, visual, VisualType_CharacterIBars, cursor_color, 0, 0);
marker_visual_set_take_rule(app, visual, take_rule);
marker_visual_set_priority(app, visual, VisualPriority_Highest);
if (view.cursor.pos != view.mark.pos){
visuals = create_marker_visuals(app, cursor_and_mark);
marker_visuals_set_look(app, visuals, BufferMarkersType_CharacterHighlightRanges, highlight_color, SymbolicColorFromPalette(Stag_At_Highlight), 0);
visual = create_marker_visual(app, cursor_and_mark);
marker_visual_set_effect(app, visual, VisualType_CharacterHighlightRanges, highlight_color, SymbolicColorFromPalette(Stag_At_Highlight), 0);
take_rule.maximum_number_of_markers = 2;
marker_visuals_set_take_rule(app, visuals, take_rule);
marker_visuals_set_priority(app, visuals, VisualPriority_Highest);
marker_visual_set_take_rule(app, visual, take_rule);
marker_visual_set_priority(app, visual, VisualPriority_Highest);
}
}break;
}
@ -323,16 +323,16 @@ RENDER_CALLER_SIG(default_render_caller){
color.tag = Stag_Highlight_Cursor_Line;
get_theme_colors(app, &color, 1);
uint32_t line_color = color.color;
Marker_Visuals visuals = create_marker_visuals(app, cursor_and_mark);
marker_visuals_set_look(app, visuals, BufferMarkersType_LineHighlights,
line_color, 0, 0);
Marker_Visuals_Take_Rule take_rule = {0};
Marker_Visual visual = create_marker_visual(app, cursor_and_mark);
marker_visual_set_effect(app, visual, VisualType_LineHighlights,
line_color, 0, 0);
Marker_Visual_Take_Rule take_rule = {0};
take_rule.first_index = 0;
take_rule.take_count_per_step = 1;
take_rule.step_stride_in_marker_count = 1;
take_rule.maximum_number_of_markers = 1;
marker_visuals_set_take_rule(app, visuals, take_rule);
marker_visuals_set_priority(app, visuals, VisualPriority_Highest);
marker_visual_set_take_rule(app, visual, take_rule);
marker_visual_set_priority(app, visual, VisualPriority_Highest);
}
// NOTE(allen): Token highlight setup
@ -353,10 +353,10 @@ RENDER_CALLER_SIG(default_render_caller){
range_markers[0].pos = pos1;
range_markers[1].pos = pos2;
managed_object_store_data(app, token_highlight, 0, 2, range_markers);
Marker_Visuals visuals = create_marker_visuals(app, token_highlight);
marker_visuals_set_look(app, visuals,
BufferMarkersType_CharacterHighlightRanges,
token_color, SymbolicColorFromPalette(Stag_At_Highlight), 0);
Marker_Visual visual = create_marker_visual(app, token_highlight);
marker_visual_set_effect(app, visual,
VisualType_CharacterHighlightRanges,
token_color, SymbolicColorFromPalette(Stag_At_Highlight), 0);
}
// NOTE(allen): Matching enclosure highlight setup
@ -373,7 +373,7 @@ RENDER_CALLER_SIG(default_render_caller){
}
mark_enclosures(app, scratch, render_scope,
&buffer, view.cursor.pos, FindScope_Brace,
BufferMarkersType_LineHighlightRanges,
VisualType_LineHighlightRanges,
colors, 0, color_count);
}
if (do_matching_paren_highlight){
@ -388,13 +388,13 @@ RENDER_CALLER_SIG(default_render_caller){
}
mark_enclosures(app, scratch, render_scope,
&buffer, view.cursor.pos, FindScope_Paren,
BufferMarkersType_CharacterBlocks,
VisualType_CharacterBlocks,
0, colors, color_count);
}
do_core_render(app);
clear_managed_scope_and_all_dependent_scopes(app, render_scope);
managed_scope_clear_self_all_dependent_scopes(app, render_scope);
}
HOOK_SIG(default_exit){

View File

@ -45,32 +45,31 @@ struct Application_Links;
#define VIEW_SET_HIGHLIGHT_SIG(n) bool32 n(Application_Links *app, View_Summary *view, int32_t start, int32_t end, bool32 turn_on)
#define VIEW_SET_BUFFER_SIG(n) bool32 n(Application_Links *app, View_Summary *view, Buffer_ID buffer_id, Set_Buffer_Flag flags)
#define VIEW_POST_FADE_SIG(n) bool32 n(Application_Links *app, View_Summary *view, float seconds, int32_t start, int32_t end, int_color color)
#define VIEW_START_UI_MODE_SIG(n) bool32 n(Application_Links *app, View_Summary *view)
#define VIEW_BEGIN_UI_MODE_SIG(n) bool32 n(Application_Links *app, View_Summary *view)
#define VIEW_END_UI_MODE_SIG(n) int32_t n(Application_Links *app, View_Summary *view)
#define VIEW_SET_UI_SIG(n) bool32 n(Application_Links *app, View_Summary *view, UI_Control *control, UI_Quit_Function_Type *quit_function)
#define VIEW_GET_UI_COPY_SIG(n) UI_Control n(Application_Links *app, View_Summary *view, struct Partition *part)
#define CREATE_USER_MANAGED_SCOPE_SIG(n) Managed_Scope n(Application_Links *app)
#define DESTROY_USER_MANAGED_SCOPE_SIG(n) bool32 n(Application_Links *app, Managed_Scope scope)
#define GET_GLOBAL_MANAGED_SCOPE_SIG(n) Managed_Scope n(Application_Links *app)
#define GET_MANAGED_SCOPE_WITH_MULTIPLE_DEPENDENCIES_SIG(n) Managed_Scope n(Application_Links *app, Managed_Scope *intersected_scopes, int32_t count)
#define GET_MANAGED_SCOPE_WITH_MULTIPLE_DEPENDENCIES_SIG(n) Managed_Scope n(Application_Links *app, Managed_Scope *scopes, int32_t count)
#define MANAGED_SCOPE_CLEAR_CONTENTS_SIG(n) bool32 n(Application_Links *app, Managed_Scope scope)
#define CLEAR_MANAGED_SCOPE_SIG(n) bool32 n(Application_Links *app, Managed_Scope scope)
#define CLEAR_MANAGED_SCOPE_AND_ALL_DEPENDENT_SCOPES_SIG(n) bool32 n(Application_Links *app, Managed_Scope scope)
#define MANAGED_SCOPE_CLEAR_SELF_ALL_DEPENDENT_SCOPES_SIG(n) bool32 n(Application_Links *app, Managed_Scope scope)
#define MANAGED_VARIABLE_CREATE_SIG(n) Managed_Variable_ID n(Application_Links *app, char *null_terminated_name, uint64_t default_value)
#define MANAGED_VARIABLE_GET_ID_SIG(n) Managed_Variable_ID n(Application_Links *app, char *null_terminated_name)
#define MANAGED_VARIABLE_CREATE_OR_GET_ID_SIG(n) Managed_Variable_ID n(Application_Links *app, char *null_terminated_name, uint64_t default_value)
#define MANAGED_VARIABLE_SET_SIG(n) bool32 n(Application_Links *app, Managed_Scope scope, Managed_Variable_ID location, uint64_t value)
#define MANAGED_VARIABLE_GET_SIG(n) bool32 n(Application_Links *app, Managed_Scope scope, Managed_Variable_ID location, uint64_t *value_out)
#define MANAGED_VARIABLE_SET_SIG(n) bool32 n(Application_Links *app, Managed_Scope scope, Managed_Variable_ID id, uint64_t value)
#define MANAGED_VARIABLE_GET_SIG(n) bool32 n(Application_Links *app, Managed_Scope scope, Managed_Variable_ID id, uint64_t *value_out)
#define ALLOC_MANAGED_MEMORY_IN_SCOPE_SIG(n) Managed_Object n(Application_Links *app, Managed_Scope scope, int32_t item_size, int32_t count)
#define ALLOC_BUFFER_MARKERS_ON_BUFFER_SIG(n) Managed_Object n(Application_Links *app, Buffer_ID buffer_id, int32_t count, Managed_Scope *optional_extra_scope)
#define CREATE_MARKER_VISUALS_SIG(n) Marker_Visuals n(Application_Links *app, Managed_Object object)
#define MARKER_VISUALS_SET_LOOK_SIG(n) bool32 n(Application_Links *app, Marker_Visuals visuals, Marker_Visuals_Type type, int_color color, int_color text_color, Marker_Visuals_Text_Style text_style)
#define MARKER_VISUALS_SET_TAKE_RULE_SIG(n) bool32 n(Application_Links *app, Marker_Visuals visuals, Marker_Visuals_Take_Rule take_rule)
#define MARKER_VISUALS_SET_PRIORITY_SIG(n) bool32 n(Application_Links *app, Marker_Visuals visuals, Marker_Visuals_Priority_Level priority)
#define MARKER_VISUALS_SET_VIEW_KEY_SIG(n) bool32 n(Application_Links *app, Marker_Visuals visuals, View_ID key_view_id)
#define DESTROY_MARKER_VISUALS_SIG(n) bool32 n(Application_Links *app, Marker_Visuals visuals)
#define BUFFER_MARKERS_GET_ATTACHED_VISUALS_COUNT_SIG(n) int32_t n(Application_Links *app, Managed_Object object)
#define BUFFER_MARKERS_GET_ATTACHED_VISUALS_SIG(n) Marker_Visuals* n(Application_Links *app, Partition *part, Managed_Object object)
#define CREATE_MARKER_VISUAL_SIG(n) Marker_Visual n(Application_Links *app, Managed_Object object)
#define MARKER_VISUAL_SET_EFFECT_SIG(n) bool32 n(Application_Links *app, Marker_Visual visual, Marker_Visual_Type type, int_color color, int_color text_color, Marker_Visual_Text_Style text_style)
#define MARKER_VISUAL_SET_TAKE_RULE_SIG(n) bool32 n(Application_Links *app, Marker_Visual visual, Marker_Visual_Take_Rule take_rule)
#define MARKER_VISUAL_SET_PRIORITY_SIG(n) bool32 n(Application_Links *app, Marker_Visual visual, Marker_Visual_Priority_Level priority)
#define MARKER_VISUAL_SET_VIEW_KEY_SIG(n) bool32 n(Application_Links *app, Marker_Visual visual, View_ID key_view_id)
#define DESTROY_MARKER_VISUAL_SIG(n) bool32 n(Application_Links *app, Marker_Visual visual)
#define BUFFER_MARKERS_GET_ATTACHED_VISUAL_COUNT_SIG(n) int32_t n(Application_Links *app, Managed_Object object)
#define BUFFER_MARKERS_GET_ATTACHED_VISUAL_SIG(n) Marker_Visual* n(Application_Links *app, Partition *part, Managed_Object object)
#define MANAGED_OBJECT_GET_ITEM_SIZE_SIG(n) uint32_t n(Application_Links *app, Managed_Object object)
#define MANAGED_OBJECT_GET_ITEM_COUNT_SIG(n) uint32_t n(Application_Links *app, Managed_Object object)
#define MANAGED_OBJECT_GET_TYPE_SIG(n) Managed_Object_Type n(Application_Links *app, Managed_Object object)
@ -163,7 +162,7 @@ typedef VIEW_SET_MARK_SIG(View_Set_Mark_Function);
typedef VIEW_SET_HIGHLIGHT_SIG(View_Set_Highlight_Function);
typedef VIEW_SET_BUFFER_SIG(View_Set_Buffer_Function);
typedef VIEW_POST_FADE_SIG(View_Post_Fade_Function);
typedef VIEW_START_UI_MODE_SIG(View_Start_UI_Mode_Function);
typedef VIEW_BEGIN_UI_MODE_SIG(View_Begin_UI_Mode_Function);
typedef VIEW_END_UI_MODE_SIG(View_End_UI_Mode_Function);
typedef VIEW_SET_UI_SIG(View_Set_UI_Function);
typedef VIEW_GET_UI_COPY_SIG(View_Get_UI_Copy_Function);
@ -172,8 +171,7 @@ typedef DESTROY_USER_MANAGED_SCOPE_SIG(Destroy_User_Managed_Scope_Function);
typedef GET_GLOBAL_MANAGED_SCOPE_SIG(Get_Global_Managed_Scope_Function);
typedef GET_MANAGED_SCOPE_WITH_MULTIPLE_DEPENDENCIES_SIG(Get_Managed_Scope_With_Multiple_Dependencies_Function);
typedef MANAGED_SCOPE_CLEAR_CONTENTS_SIG(Managed_Scope_Clear_Contents_Function);
typedef CLEAR_MANAGED_SCOPE_SIG(Clear_Managed_Scope_Function);
typedef CLEAR_MANAGED_SCOPE_AND_ALL_DEPENDENT_SCOPES_SIG(Clear_Managed_Scope_And_All_Dependent_Scopes_Function);
typedef MANAGED_SCOPE_CLEAR_SELF_ALL_DEPENDENT_SCOPES_SIG(Managed_Scope_Clear_Self_All_Dependent_Scopes_Function);
typedef MANAGED_VARIABLE_CREATE_SIG(Managed_Variable_Create_Function);
typedef MANAGED_VARIABLE_GET_ID_SIG(Managed_Variable_Get_ID_Function);
typedef MANAGED_VARIABLE_CREATE_OR_GET_ID_SIG(Managed_Variable_Create_Or_Get_ID_Function);
@ -181,14 +179,14 @@ typedef MANAGED_VARIABLE_SET_SIG(Managed_Variable_Set_Function);
typedef MANAGED_VARIABLE_GET_SIG(Managed_Variable_Get_Function);
typedef ALLOC_MANAGED_MEMORY_IN_SCOPE_SIG(Alloc_Managed_Memory_In_Scope_Function);
typedef ALLOC_BUFFER_MARKERS_ON_BUFFER_SIG(Alloc_Buffer_Markers_On_Buffer_Function);
typedef CREATE_MARKER_VISUALS_SIG(Create_Marker_Visuals_Function);
typedef MARKER_VISUALS_SET_LOOK_SIG(Marker_Visuals_Set_Look_Function);
typedef MARKER_VISUALS_SET_TAKE_RULE_SIG(Marker_Visuals_Set_Take_Rule_Function);
typedef MARKER_VISUALS_SET_PRIORITY_SIG(Marker_Visuals_Set_Priority_Function);
typedef MARKER_VISUALS_SET_VIEW_KEY_SIG(Marker_Visuals_Set_View_Key_Function);
typedef DESTROY_MARKER_VISUALS_SIG(Destroy_Marker_Visuals_Function);
typedef BUFFER_MARKERS_GET_ATTACHED_VISUALS_COUNT_SIG(Buffer_Markers_Get_Attached_Visuals_Count_Function);
typedef BUFFER_MARKERS_GET_ATTACHED_VISUALS_SIG(Buffer_Markers_Get_Attached_Visuals_Function);
typedef CREATE_MARKER_VISUAL_SIG(Create_Marker_Visual_Function);
typedef MARKER_VISUAL_SET_EFFECT_SIG(Marker_Visual_Set_Effect_Function);
typedef MARKER_VISUAL_SET_TAKE_RULE_SIG(Marker_Visual_Set_Take_Rule_Function);
typedef MARKER_VISUAL_SET_PRIORITY_SIG(Marker_Visual_Set_Priority_Function);
typedef MARKER_VISUAL_SET_VIEW_KEY_SIG(Marker_Visual_Set_View_Key_Function);
typedef DESTROY_MARKER_VISUAL_SIG(Destroy_Marker_Visual_Function);
typedef BUFFER_MARKERS_GET_ATTACHED_VISUAL_COUNT_SIG(Buffer_Markers_Get_Attached_Visual_Count_Function);
typedef BUFFER_MARKERS_GET_ATTACHED_VISUAL_SIG(Buffer_Markers_Get_Attached_Visual_Function);
typedef MANAGED_OBJECT_GET_ITEM_SIZE_SIG(Managed_Object_Get_Item_Size_Function);
typedef MANAGED_OBJECT_GET_ITEM_COUNT_SIG(Managed_Object_Get_Item_Count_Function);
typedef MANAGED_OBJECT_GET_TYPE_SIG(Managed_Object_Get_Type_Function);
@ -283,7 +281,7 @@ View_Set_Mark_Function *view_set_mark;
View_Set_Highlight_Function *view_set_highlight;
View_Set_Buffer_Function *view_set_buffer;
View_Post_Fade_Function *view_post_fade;
View_Start_UI_Mode_Function *view_start_ui_mode;
View_Begin_UI_Mode_Function *view_begin_ui_mode;
View_End_UI_Mode_Function *view_end_ui_mode;
View_Set_UI_Function *view_set_ui;
View_Get_UI_Copy_Function *view_get_ui_copy;
@ -292,8 +290,7 @@ Destroy_User_Managed_Scope_Function *destroy_user_managed_scope;
Get_Global_Managed_Scope_Function *get_global_managed_scope;
Get_Managed_Scope_With_Multiple_Dependencies_Function *get_managed_scope_with_multiple_dependencies;
Managed_Scope_Clear_Contents_Function *managed_scope_clear_contents;
Clear_Managed_Scope_Function *clear_managed_scope;
Clear_Managed_Scope_And_All_Dependent_Scopes_Function *clear_managed_scope_and_all_dependent_scopes;
Managed_Scope_Clear_Self_All_Dependent_Scopes_Function *managed_scope_clear_self_all_dependent_scopes;
Managed_Variable_Create_Function *managed_variable_create;
Managed_Variable_Get_ID_Function *managed_variable_get_id;
Managed_Variable_Create_Or_Get_ID_Function *managed_variable_create_or_get_id;
@ -301,14 +298,14 @@ Managed_Variable_Set_Function *managed_variable_set;
Managed_Variable_Get_Function *managed_variable_get;
Alloc_Managed_Memory_In_Scope_Function *alloc_managed_memory_in_scope;
Alloc_Buffer_Markers_On_Buffer_Function *alloc_buffer_markers_on_buffer;
Create_Marker_Visuals_Function *create_marker_visuals;
Marker_Visuals_Set_Look_Function *marker_visuals_set_look;
Marker_Visuals_Set_Take_Rule_Function *marker_visuals_set_take_rule;
Marker_Visuals_Set_Priority_Function *marker_visuals_set_priority;
Marker_Visuals_Set_View_Key_Function *marker_visuals_set_view_key;
Destroy_Marker_Visuals_Function *destroy_marker_visuals;
Buffer_Markers_Get_Attached_Visuals_Count_Function *buffer_markers_get_attached_visuals_count;
Buffer_Markers_Get_Attached_Visuals_Function *buffer_markers_get_attached_visuals;
Create_Marker_Visual_Function *create_marker_visual;
Marker_Visual_Set_Effect_Function *marker_visual_set_effect;
Marker_Visual_Set_Take_Rule_Function *marker_visual_set_take_rule;
Marker_Visual_Set_Priority_Function *marker_visual_set_priority;
Marker_Visual_Set_View_Key_Function *marker_visual_set_view_key;
Destroy_Marker_Visual_Function *destroy_marker_visual;
Buffer_Markers_Get_Attached_Visual_Count_Function *buffer_markers_get_attached_visual_count;
Buffer_Markers_Get_Attached_Visual_Function *buffer_markers_get_attached_visual;
Managed_Object_Get_Item_Size_Function *managed_object_get_item_size;
Managed_Object_Get_Item_Count_Function *managed_object_get_item_count;
Managed_Object_Get_Type_Function *managed_object_get_type;
@ -402,7 +399,7 @@ View_Set_Mark_Function *view_set_mark_;
View_Set_Highlight_Function *view_set_highlight_;
View_Set_Buffer_Function *view_set_buffer_;
View_Post_Fade_Function *view_post_fade_;
View_Start_UI_Mode_Function *view_start_ui_mode_;
View_Begin_UI_Mode_Function *view_begin_ui_mode_;
View_End_UI_Mode_Function *view_end_ui_mode_;
View_Set_UI_Function *view_set_ui_;
View_Get_UI_Copy_Function *view_get_ui_copy_;
@ -411,8 +408,7 @@ Destroy_User_Managed_Scope_Function *destroy_user_managed_scope_;
Get_Global_Managed_Scope_Function *get_global_managed_scope_;
Get_Managed_Scope_With_Multiple_Dependencies_Function *get_managed_scope_with_multiple_dependencies_;
Managed_Scope_Clear_Contents_Function *managed_scope_clear_contents_;
Clear_Managed_Scope_Function *clear_managed_scope_;
Clear_Managed_Scope_And_All_Dependent_Scopes_Function *clear_managed_scope_and_all_dependent_scopes_;
Managed_Scope_Clear_Self_All_Dependent_Scopes_Function *managed_scope_clear_self_all_dependent_scopes_;
Managed_Variable_Create_Function *managed_variable_create_;
Managed_Variable_Get_ID_Function *managed_variable_get_id_;
Managed_Variable_Create_Or_Get_ID_Function *managed_variable_create_or_get_id_;
@ -420,14 +416,14 @@ Managed_Variable_Set_Function *managed_variable_set_;
Managed_Variable_Get_Function *managed_variable_get_;
Alloc_Managed_Memory_In_Scope_Function *alloc_managed_memory_in_scope_;
Alloc_Buffer_Markers_On_Buffer_Function *alloc_buffer_markers_on_buffer_;
Create_Marker_Visuals_Function *create_marker_visuals_;
Marker_Visuals_Set_Look_Function *marker_visuals_set_look_;
Marker_Visuals_Set_Take_Rule_Function *marker_visuals_set_take_rule_;
Marker_Visuals_Set_Priority_Function *marker_visuals_set_priority_;
Marker_Visuals_Set_View_Key_Function *marker_visuals_set_view_key_;
Destroy_Marker_Visuals_Function *destroy_marker_visuals_;
Buffer_Markers_Get_Attached_Visuals_Count_Function *buffer_markers_get_attached_visuals_count_;
Buffer_Markers_Get_Attached_Visuals_Function *buffer_markers_get_attached_visuals_;
Create_Marker_Visual_Function *create_marker_visual_;
Marker_Visual_Set_Effect_Function *marker_visual_set_effect_;
Marker_Visual_Set_Take_Rule_Function *marker_visual_set_take_rule_;
Marker_Visual_Set_Priority_Function *marker_visual_set_priority_;
Marker_Visual_Set_View_Key_Function *marker_visual_set_view_key_;
Destroy_Marker_Visual_Function *destroy_marker_visual_;
Buffer_Markers_Get_Attached_Visual_Count_Function *buffer_markers_get_attached_visual_count_;
Buffer_Markers_Get_Attached_Visual_Function *buffer_markers_get_attached_visual_;
Managed_Object_Get_Item_Size_Function *managed_object_get_item_size_;
Managed_Object_Get_Item_Count_Function *managed_object_get_item_count_;
Managed_Object_Get_Type_Function *managed_object_get_type_;
@ -529,7 +525,7 @@ app_links->view_set_mark_ = View_Set_Mark;\
app_links->view_set_highlight_ = View_Set_Highlight;\
app_links->view_set_buffer_ = View_Set_Buffer;\
app_links->view_post_fade_ = View_Post_Fade;\
app_links->view_start_ui_mode_ = View_Start_UI_Mode;\
app_links->view_begin_ui_mode_ = View_Begin_UI_Mode;\
app_links->view_end_ui_mode_ = View_End_UI_Mode;\
app_links->view_set_ui_ = View_Set_UI;\
app_links->view_get_ui_copy_ = View_Get_UI_Copy;\
@ -538,8 +534,7 @@ app_links->destroy_user_managed_scope_ = Destroy_User_Managed_Scope;\
app_links->get_global_managed_scope_ = Get_Global_Managed_Scope;\
app_links->get_managed_scope_with_multiple_dependencies_ = Get_Managed_Scope_With_Multiple_Dependencies;\
app_links->managed_scope_clear_contents_ = Managed_Scope_Clear_Contents;\
app_links->clear_managed_scope_ = Clear_Managed_Scope;\
app_links->clear_managed_scope_and_all_dependent_scopes_ = Clear_Managed_Scope_And_All_Dependent_Scopes;\
app_links->managed_scope_clear_self_all_dependent_scopes_ = Managed_Scope_Clear_Self_All_Dependent_Scopes;\
app_links->managed_variable_create_ = Managed_Variable_Create;\
app_links->managed_variable_get_id_ = Managed_Variable_Get_ID;\
app_links->managed_variable_create_or_get_id_ = Managed_Variable_Create_Or_Get_ID;\
@ -547,14 +542,14 @@ app_links->managed_variable_set_ = Managed_Variable_Set;\
app_links->managed_variable_get_ = Managed_Variable_Get;\
app_links->alloc_managed_memory_in_scope_ = Alloc_Managed_Memory_In_Scope;\
app_links->alloc_buffer_markers_on_buffer_ = Alloc_Buffer_Markers_On_Buffer;\
app_links->create_marker_visuals_ = Create_Marker_Visuals;\
app_links->marker_visuals_set_look_ = Marker_Visuals_Set_Look;\
app_links->marker_visuals_set_take_rule_ = Marker_Visuals_Set_Take_Rule;\
app_links->marker_visuals_set_priority_ = Marker_Visuals_Set_Priority;\
app_links->marker_visuals_set_view_key_ = Marker_Visuals_Set_View_Key;\
app_links->destroy_marker_visuals_ = Destroy_Marker_Visuals;\
app_links->buffer_markers_get_attached_visuals_count_ = Buffer_Markers_Get_Attached_Visuals_Count;\
app_links->buffer_markers_get_attached_visuals_ = Buffer_Markers_Get_Attached_Visuals;\
app_links->create_marker_visual_ = Create_Marker_Visual;\
app_links->marker_visual_set_effect_ = Marker_Visual_Set_Effect;\
app_links->marker_visual_set_take_rule_ = Marker_Visual_Set_Take_Rule;\
app_links->marker_visual_set_priority_ = Marker_Visual_Set_Priority;\
app_links->marker_visual_set_view_key_ = Marker_Visual_Set_View_Key;\
app_links->destroy_marker_visual_ = Destroy_Marker_Visual;\
app_links->buffer_markers_get_attached_visual_count_ = Buffer_Markers_Get_Attached_Visual_Count;\
app_links->buffer_markers_get_attached_visual_ = Buffer_Markers_Get_Attached_Visual;\
app_links->managed_object_get_item_size_ = Managed_Object_Get_Item_Size;\
app_links->managed_object_get_item_count_ = Managed_Object_Get_Item_Count;\
app_links->managed_object_get_type_ = Managed_Object_Get_Type;\
@ -648,32 +643,31 @@ static inline bool32 view_set_mark(Application_Links *app, View_Summary *view, B
static inline bool32 view_set_highlight(Application_Links *app, View_Summary *view, int32_t start, int32_t end, bool32 turn_on){return(app->view_set_highlight(app, view, start, end, turn_on));}
static inline bool32 view_set_buffer(Application_Links *app, View_Summary *view, Buffer_ID buffer_id, Set_Buffer_Flag flags){return(app->view_set_buffer(app, view, buffer_id, flags));}
static inline bool32 view_post_fade(Application_Links *app, View_Summary *view, float seconds, int32_t start, int32_t end, int_color color){return(app->view_post_fade(app, view, seconds, start, end, color));}
static inline bool32 view_start_ui_mode(Application_Links *app, View_Summary *view){return(app->view_start_ui_mode(app, view));}
static inline bool32 view_begin_ui_mode(Application_Links *app, View_Summary *view){return(app->view_begin_ui_mode(app, view));}
static inline int32_t view_end_ui_mode(Application_Links *app, View_Summary *view){return(app->view_end_ui_mode(app, view));}
static inline bool32 view_set_ui(Application_Links *app, View_Summary *view, UI_Control *control, UI_Quit_Function_Type *quit_function){return(app->view_set_ui(app, view, control, quit_function));}
static inline UI_Control view_get_ui_copy(Application_Links *app, View_Summary *view, struct Partition *part){return(app->view_get_ui_copy(app, view, part));}
static inline Managed_Scope create_user_managed_scope(Application_Links *app){return(app->create_user_managed_scope(app));}
static inline bool32 destroy_user_managed_scope(Application_Links *app, Managed_Scope scope){return(app->destroy_user_managed_scope(app, scope));}
static inline Managed_Scope get_global_managed_scope(Application_Links *app){return(app->get_global_managed_scope(app));}
static inline Managed_Scope get_managed_scope_with_multiple_dependencies(Application_Links *app, Managed_Scope *intersected_scopes, int32_t count){return(app->get_managed_scope_with_multiple_dependencies(app, intersected_scopes, count));}
static inline Managed_Scope get_managed_scope_with_multiple_dependencies(Application_Links *app, Managed_Scope *scopes, int32_t count){return(app->get_managed_scope_with_multiple_dependencies(app, scopes, count));}
static inline bool32 managed_scope_clear_contents(Application_Links *app, Managed_Scope scope){return(app->managed_scope_clear_contents(app, scope));}
static inline bool32 clear_managed_scope(Application_Links *app, Managed_Scope scope){return(app->clear_managed_scope(app, scope));}
static inline bool32 clear_managed_scope_and_all_dependent_scopes(Application_Links *app, Managed_Scope scope){return(app->clear_managed_scope_and_all_dependent_scopes(app, scope));}
static inline bool32 managed_scope_clear_self_all_dependent_scopes(Application_Links *app, Managed_Scope scope){return(app->managed_scope_clear_self_all_dependent_scopes(app, scope));}
static inline Managed_Variable_ID managed_variable_create(Application_Links *app, char *null_terminated_name, uint64_t default_value){return(app->managed_variable_create(app, null_terminated_name, default_value));}
static inline Managed_Variable_ID managed_variable_get_id(Application_Links *app, char *null_terminated_name){return(app->managed_variable_get_id(app, null_terminated_name));}
static inline Managed_Variable_ID managed_variable_create_or_get_id(Application_Links *app, char *null_terminated_name, uint64_t default_value){return(app->managed_variable_create_or_get_id(app, null_terminated_name, default_value));}
static inline bool32 managed_variable_set(Application_Links *app, Managed_Scope scope, Managed_Variable_ID location, uint64_t value){return(app->managed_variable_set(app, scope, location, value));}
static inline bool32 managed_variable_get(Application_Links *app, Managed_Scope scope, Managed_Variable_ID location, uint64_t *value_out){return(app->managed_variable_get(app, scope, location, value_out));}
static inline bool32 managed_variable_set(Application_Links *app, Managed_Scope scope, Managed_Variable_ID id, uint64_t value){return(app->managed_variable_set(app, scope, id, value));}
static inline bool32 managed_variable_get(Application_Links *app, Managed_Scope scope, Managed_Variable_ID id, uint64_t *value_out){return(app->managed_variable_get(app, scope, id, value_out));}
static inline Managed_Object alloc_managed_memory_in_scope(Application_Links *app, Managed_Scope scope, int32_t item_size, int32_t count){return(app->alloc_managed_memory_in_scope(app, scope, item_size, count));}
static inline Managed_Object alloc_buffer_markers_on_buffer(Application_Links *app, Buffer_ID buffer_id, int32_t count, Managed_Scope *optional_extra_scope){return(app->alloc_buffer_markers_on_buffer(app, buffer_id, count, optional_extra_scope));}
static inline Marker_Visuals create_marker_visuals(Application_Links *app, Managed_Object object){return(app->create_marker_visuals(app, object));}
static inline bool32 marker_visuals_set_look(Application_Links *app, Marker_Visuals visuals, Marker_Visuals_Type type, int_color color, int_color text_color, Marker_Visuals_Text_Style text_style){return(app->marker_visuals_set_look(app, visuals, type, color, text_color, text_style));}
static inline bool32 marker_visuals_set_take_rule(Application_Links *app, Marker_Visuals visuals, Marker_Visuals_Take_Rule take_rule){return(app->marker_visuals_set_take_rule(app, visuals, take_rule));}
static inline bool32 marker_visuals_set_priority(Application_Links *app, Marker_Visuals visuals, Marker_Visuals_Priority_Level priority){return(app->marker_visuals_set_priority(app, visuals, priority));}
static inline bool32 marker_visuals_set_view_key(Application_Links *app, Marker_Visuals visuals, View_ID key_view_id){return(app->marker_visuals_set_view_key(app, visuals, key_view_id));}
static inline bool32 destroy_marker_visuals(Application_Links *app, Marker_Visuals visuals){return(app->destroy_marker_visuals(app, visuals));}
static inline int32_t buffer_markers_get_attached_visuals_count(Application_Links *app, Managed_Object object){return(app->buffer_markers_get_attached_visuals_count(app, object));}
static inline Marker_Visuals* buffer_markers_get_attached_visuals(Application_Links *app, Partition *part, Managed_Object object){return(app->buffer_markers_get_attached_visuals(app, part, object));}
static inline Marker_Visual create_marker_visual(Application_Links *app, Managed_Object object){return(app->create_marker_visual(app, object));}
static inline bool32 marker_visual_set_effect(Application_Links *app, Marker_Visual visual, Marker_Visual_Type type, int_color color, int_color text_color, Marker_Visual_Text_Style text_style){return(app->marker_visual_set_effect(app, visual, type, color, text_color, text_style));}
static inline bool32 marker_visual_set_take_rule(Application_Links *app, Marker_Visual visual, Marker_Visual_Take_Rule take_rule){return(app->marker_visual_set_take_rule(app, visual, take_rule));}
static inline bool32 marker_visual_set_priority(Application_Links *app, Marker_Visual visual, Marker_Visual_Priority_Level priority){return(app->marker_visual_set_priority(app, visual, priority));}
static inline bool32 marker_visual_set_view_key(Application_Links *app, Marker_Visual visual, View_ID key_view_id){return(app->marker_visual_set_view_key(app, visual, key_view_id));}
static inline bool32 destroy_marker_visual(Application_Links *app, Marker_Visual visual){return(app->destroy_marker_visual(app, visual));}
static inline int32_t buffer_markers_get_attached_visual_count(Application_Links *app, Managed_Object object){return(app->buffer_markers_get_attached_visual_count(app, object));}
static inline Marker_Visual* buffer_markers_get_attached_visual(Application_Links *app, Partition *part, Managed_Object object){return(app->buffer_markers_get_attached_visual(app, part, object));}
static inline uint32_t managed_object_get_item_size(Application_Links *app, Managed_Object object){return(app->managed_object_get_item_size(app, object));}
static inline uint32_t managed_object_get_item_count(Application_Links *app, Managed_Object object){return(app->managed_object_get_item_count(app, object));}
static inline Managed_Object_Type managed_object_get_type(Application_Links *app, Managed_Object object){return(app->managed_object_get_type(app, object));}
@ -767,32 +761,31 @@ static inline bool32 view_set_mark(Application_Links *app, View_Summary *view, B
static inline bool32 view_set_highlight(Application_Links *app, View_Summary *view, int32_t start, int32_t end, bool32 turn_on){return(app->view_set_highlight_(app, view, start, end, turn_on));}
static inline bool32 view_set_buffer(Application_Links *app, View_Summary *view, Buffer_ID buffer_id, Set_Buffer_Flag flags){return(app->view_set_buffer_(app, view, buffer_id, flags));}
static inline bool32 view_post_fade(Application_Links *app, View_Summary *view, float seconds, int32_t start, int32_t end, int_color color){return(app->view_post_fade_(app, view, seconds, start, end, color));}
static inline bool32 view_start_ui_mode(Application_Links *app, View_Summary *view){return(app->view_start_ui_mode_(app, view));}
static inline bool32 view_begin_ui_mode(Application_Links *app, View_Summary *view){return(app->view_begin_ui_mode_(app, view));}
static inline int32_t view_end_ui_mode(Application_Links *app, View_Summary *view){return(app->view_end_ui_mode_(app, view));}
static inline bool32 view_set_ui(Application_Links *app, View_Summary *view, UI_Control *control, UI_Quit_Function_Type *quit_function){return(app->view_set_ui_(app, view, control, quit_function));}
static inline UI_Control view_get_ui_copy(Application_Links *app, View_Summary *view, struct Partition *part){return(app->view_get_ui_copy_(app, view, part));}
static inline Managed_Scope create_user_managed_scope(Application_Links *app){return(app->create_user_managed_scope_(app));}
static inline bool32 destroy_user_managed_scope(Application_Links *app, Managed_Scope scope){return(app->destroy_user_managed_scope_(app, scope));}
static inline Managed_Scope get_global_managed_scope(Application_Links *app){return(app->get_global_managed_scope_(app));}
static inline Managed_Scope get_managed_scope_with_multiple_dependencies(Application_Links *app, Managed_Scope *intersected_scopes, int32_t count){return(app->get_managed_scope_with_multiple_dependencies_(app, intersected_scopes, count));}
static inline Managed_Scope get_managed_scope_with_multiple_dependencies(Application_Links *app, Managed_Scope *scopes, int32_t count){return(app->get_managed_scope_with_multiple_dependencies_(app, scopes, count));}
static inline bool32 managed_scope_clear_contents(Application_Links *app, Managed_Scope scope){return(app->managed_scope_clear_contents_(app, scope));}
static inline bool32 clear_managed_scope(Application_Links *app, Managed_Scope scope){return(app->clear_managed_scope_(app, scope));}
static inline bool32 clear_managed_scope_and_all_dependent_scopes(Application_Links *app, Managed_Scope scope){return(app->clear_managed_scope_and_all_dependent_scopes_(app, scope));}
static inline bool32 managed_scope_clear_self_all_dependent_scopes(Application_Links *app, Managed_Scope scope){return(app->managed_scope_clear_self_all_dependent_scopes_(app, scope));}
static inline Managed_Variable_ID managed_variable_create(Application_Links *app, char *null_terminated_name, uint64_t default_value){return(app->managed_variable_create_(app, null_terminated_name, default_value));}
static inline Managed_Variable_ID managed_variable_get_id(Application_Links *app, char *null_terminated_name){return(app->managed_variable_get_id_(app, null_terminated_name));}
static inline Managed_Variable_ID managed_variable_create_or_get_id(Application_Links *app, char *null_terminated_name, uint64_t default_value){return(app->managed_variable_create_or_get_id_(app, null_terminated_name, default_value));}
static inline bool32 managed_variable_set(Application_Links *app, Managed_Scope scope, Managed_Variable_ID location, uint64_t value){return(app->managed_variable_set_(app, scope, location, value));}
static inline bool32 managed_variable_get(Application_Links *app, Managed_Scope scope, Managed_Variable_ID location, uint64_t *value_out){return(app->managed_variable_get_(app, scope, location, value_out));}
static inline bool32 managed_variable_set(Application_Links *app, Managed_Scope scope, Managed_Variable_ID id, uint64_t value){return(app->managed_variable_set_(app, scope, id, value));}
static inline bool32 managed_variable_get(Application_Links *app, Managed_Scope scope, Managed_Variable_ID id, uint64_t *value_out){return(app->managed_variable_get_(app, scope, id, value_out));}
static inline Managed_Object alloc_managed_memory_in_scope(Application_Links *app, Managed_Scope scope, int32_t item_size, int32_t count){return(app->alloc_managed_memory_in_scope_(app, scope, item_size, count));}
static inline Managed_Object alloc_buffer_markers_on_buffer(Application_Links *app, Buffer_ID buffer_id, int32_t count, Managed_Scope *optional_extra_scope){return(app->alloc_buffer_markers_on_buffer_(app, buffer_id, count, optional_extra_scope));}
static inline Marker_Visuals create_marker_visuals(Application_Links *app, Managed_Object object){return(app->create_marker_visuals_(app, object));}
static inline bool32 marker_visuals_set_look(Application_Links *app, Marker_Visuals visuals, Marker_Visuals_Type type, int_color color, int_color text_color, Marker_Visuals_Text_Style text_style){return(app->marker_visuals_set_look_(app, visuals, type, color, text_color, text_style));}
static inline bool32 marker_visuals_set_take_rule(Application_Links *app, Marker_Visuals visuals, Marker_Visuals_Take_Rule take_rule){return(app->marker_visuals_set_take_rule_(app, visuals, take_rule));}
static inline bool32 marker_visuals_set_priority(Application_Links *app, Marker_Visuals visuals, Marker_Visuals_Priority_Level priority){return(app->marker_visuals_set_priority_(app, visuals, priority));}
static inline bool32 marker_visuals_set_view_key(Application_Links *app, Marker_Visuals visuals, View_ID key_view_id){return(app->marker_visuals_set_view_key_(app, visuals, key_view_id));}
static inline bool32 destroy_marker_visuals(Application_Links *app, Marker_Visuals visuals){return(app->destroy_marker_visuals_(app, visuals));}
static inline int32_t buffer_markers_get_attached_visuals_count(Application_Links *app, Managed_Object object){return(app->buffer_markers_get_attached_visuals_count_(app, object));}
static inline Marker_Visuals* buffer_markers_get_attached_visuals(Application_Links *app, Partition *part, Managed_Object object){return(app->buffer_markers_get_attached_visuals_(app, part, object));}
static inline Marker_Visual create_marker_visual(Application_Links *app, Managed_Object object){return(app->create_marker_visual_(app, object));}
static inline bool32 marker_visual_set_effect(Application_Links *app, Marker_Visual visual, Marker_Visual_Type type, int_color color, int_color text_color, Marker_Visual_Text_Style text_style){return(app->marker_visual_set_effect_(app, visual, type, color, text_color, text_style));}
static inline bool32 marker_visual_set_take_rule(Application_Links *app, Marker_Visual visual, Marker_Visual_Take_Rule take_rule){return(app->marker_visual_set_take_rule_(app, visual, take_rule));}
static inline bool32 marker_visual_set_priority(Application_Links *app, Marker_Visual visual, Marker_Visual_Priority_Level priority){return(app->marker_visual_set_priority_(app, visual, priority));}
static inline bool32 marker_visual_set_view_key(Application_Links *app, Marker_Visual visual, View_ID key_view_id){return(app->marker_visual_set_view_key_(app, visual, key_view_id));}
static inline bool32 destroy_marker_visual(Application_Links *app, Marker_Visual visual){return(app->destroy_marker_visual_(app, visual));}
static inline int32_t buffer_markers_get_attached_visual_count(Application_Links *app, Managed_Object object){return(app->buffer_markers_get_attached_visual_count_(app, object));}
static inline Marker_Visual* buffer_markers_get_attached_visual(Application_Links *app, Partition *part, Managed_Object object){return(app->buffer_markers_get_attached_visual_(app, part, object));}
static inline uint32_t managed_object_get_item_size(Application_Links *app, Managed_Object object){return(app->managed_object_get_item_size_(app, object));}
static inline uint32_t managed_object_get_item_count(Application_Links *app, Managed_Object object){return(app->managed_object_get_item_count_(app, object));}
static inline Managed_Object_Type managed_object_get_type(Application_Links *app, Managed_Object object){return(app->managed_object_get_type_(app, object));}

View File

@ -157,9 +157,9 @@ init_marker_list(Application_Links *app, Partition *scratch, Heap *heap, Buffer_
Theme_Color color = {};
color.tag = Stag_Highlight_Junk;
get_theme_colors(app, &color, 1);
Marker_Visuals visuals = create_marker_visuals(app, marker_handle);
marker_visuals_set_look(app, visuals,
BufferMarkersType_LineHighlights, color.color, 0, 0);
Marker_Visual visual = create_marker_visual(app, marker_handle);
marker_visual_set_look(app, visual,
VisualType_LineHighlights, color.color, 0, 0);
}
end_temp_memory(marker_temp);

View File

@ -313,7 +313,7 @@ begin_integrated_lister__with_refresh_handler(Application_Links *app, char *quer
if (handlers.refresh != 0){
Partition *scratch = &global_part;
Heap *heap = &global_heap;
view_start_ui_mode(app, view);
view_begin_ui_mode(app, view);
view_set_setting(app, view, ViewSetting_UICommandMap, default_lister_ui_map);
Lister_State *state = view_get_lister_state(view);
init_lister_state(state, heap);
@ -342,7 +342,7 @@ begin_integrated_lister__basic_list(Application_Links *app, char *query_string,
View_Summary *view){
Partition *scratch = &global_part;
Heap *heap = &global_heap;
view_start_ui_mode(app, view);
view_begin_ui_mode(app, view);
view_set_setting(app, view, ViewSetting_UICommandMap, default_lister_ui_map);
Lister_State *state = view_get_lister_state(view);
int32_t arena_size = (user_data_size + option_count*sizeof(Lister_Node) + estimated_string_space_size);
@ -373,7 +373,7 @@ begin_integrated_lister__with_fixed_options(Application_Links *app, char *query_
View_Summary *view){
Partition *scratch = &global_part;
Heap *heap = &global_heap;
view_start_ui_mode(app, view);
view_begin_ui_mode(app, view);
view_set_setting(app, view, ViewSetting_UICommandMap, default_lister_ui_map);
Lister_State *state = view_get_lister_state(view);
init_lister_state(state, heap);
@ -416,7 +416,7 @@ begin_integrated_lister__ui_list(Application_Links *app, char *query_string,
View_Summary *view){
Partition *scratch = &global_part;
Heap *heap = &global_heap;
view_start_ui_mode(app, view);
view_begin_ui_mode(app, view);
view_set_setting(app, view, ViewSetting_UICommandMap, default_lister_ui_map);
Lister_State *state = view_get_lister_state(view);
init_lister_state(state, heap);

View File

@ -4,6 +4,8 @@
// TOP
static UI_Item*
ui_list_add_item(Partition *arena, UI_List *list, UI_Item item){
UI_Item_Node *node = push_array(arena, UI_Item_Node, 1);
@ -538,12 +540,12 @@ lister_default(Application_Links *app, Partition *scratch, Heap *heap,
case ListerActivation_Continue:
{
view_start_ui_mode(app, view);
view_begin_ui_mode(app, view);
}break;
case ListerActivation_ContinueAndRefresh:
{
view_start_ui_mode(app, view);
view_begin_ui_mode(app, view);
state->item_index = 0;
lister_call_refresh_handler(app, &state->arena, &state->lister);
lister_update_ui(app, scratch, view, state);

View File

@ -1091,6 +1091,12 @@ buffer_get_managed_scope__inner(Editing_File *file){
API_EXPORT Managed_Scope
Buffer_Get_Managed_Scope(Application_Links *app, Buffer_ID buffer_id)
/*
DOC_PARAM(buffer_id, The id of the buffer from which to get a managed scope.)
DOC_RETURN(If the buffer_id specifies a valid buffer, the scope returned is the scope tied to the
lifetime of the buffer. This is a 'basic scope' and is not considered a 'user managed scope'.
If the buffer_id does not specify a valid buffer, the returned scope is null.)
*/
{
Command_Data *cmd = (Command_Data*)app->cmd_context;
Editing_File *file = imp_get_file(cmd, buffer_id);
@ -1827,6 +1833,12 @@ DOC_SEE(View_Setting_ID)
API_EXPORT Managed_Scope
View_Get_Managed_Scope(Application_Links *app, View_ID view_id)
/*
DOC_PARAM(view_id, The id of the view from which to get a managed scope.)
DOC_RETURN(If the view_id specifies a valid view, the scope returned is the scope tied to the
lifetime of the view. This is a 'basic scope' and is not considered a 'user managed scope'.
If the view_id does not specify a valid view, the returned scope is null.)
*/
{
Command_Data *cmd = (Command_Data*)app->cmd_context;
View *view = imp_get_view(cmd, view_id);
@ -2075,22 +2087,26 @@ DOC_SEE(int_color)
*/{
Command_Data *cmd = (Command_Data*)app->cmd_context;
View *vptr = imp_get_view(cmd, view);
bool32 result = false;
int32_t size = end - start;
if (vptr){
if (size > 0){
result = true;
view_post_paste_effect(vptr, seconds, start, size, color | 0xFF000000);
view_post_paste_effect(vptr, seconds, start, size, color|0xFF000000);
}
}
return(result);
}
API_EXPORT bool32
View_Start_UI_Mode(Application_Links *app, View_Summary *view)
View_Begin_UI_Mode(Application_Links *app, View_Summary *view)
/*
DOC_PARAM(view, A summary for the view which is to be placed into UI mode.)
DOC_RETURN(This call returns non-zero on success. It can fail if view is invalid, or if the view is already in UI mode.)
DOC(In UI mode, the view no longer renders it's buffer. Instead it renders UI elements attached to the view. The UI elements attached to a view can be modified by a view_set_ui call.)
DOC_SEE(view_end_ui_mode)
DOC_SEE(view_set_ui)
*/
{
Command_Data *cmd = (Command_Data*)app->cmd_context;
View *vptr = imp_get_view(cmd, view);
@ -2110,6 +2126,14 @@ View_Start_UI_Mode(Application_Links *app, View_Summary *view)
API_EXPORT int32_t
View_End_UI_Mode(Application_Links *app, View_Summary *view)
/*
DOC_PARAM(view, A summary for the view which is to be taken out of UI mode.)
DOC_RETURN(This call returns non-zero on success. It can fail if view is invalid, or if the view is not in UI mode.)
DOC(Taking a view out of UI mode not only causes it to resume showing a buffer, but also sends a quit UI signal.
The exit signal calls the quit_function that is set by a view_set_ui call.)
DOC_SEE(view_begin_ui_mode)
DOC_SEE(view_set_ui)
*/
{
Command_Data *cmd = (Command_Data*)app->cmd_context;
View *vptr = imp_get_view(cmd, view);
@ -2132,6 +2156,17 @@ View_End_UI_Mode(Application_Links *app, View_Summary *view)
API_EXPORT bool32
View_Set_UI(Application_Links *app, View_Summary *view, UI_Control *control, UI_Quit_Function_Type *quit_function)
/*
DOC_PARAM(view, A summary for the view which is to get the new UI widget data.)
DOC_PARAM(control, A pointer to the baked UI widget data. To get data in the UI_Control format see the helper called ui_list_to_ui_control. More information about specifying widget data can be found in a comment in '4coder_ui_helper.cpp'. If this pointer is null the view's widget data is cleared to zero. The core maintains it's own copy of the widget data, so after this call the memory used to specify widget data may be freed.)
DOC_PARAM(quit_function, A function pointer to be called when a quit UI signal is sent to the view. This pointer may be set to null.)
DOC_RETURN(This call returns non-zero on success. It can fail if view is invalid.)
DOC(Setting the UI widget data determines what the view will look like in UI mode. The UI widget data can be set no matter what the current mode is. The UI widget data can be replaced any number of times regardless of whether the view is in UI mode or not. See documentation on the UI widget data type UI_Control and the comments at the top of '4coder_ui_helper.cpp' for more information about the types of widgets that can be used.)
DOC_SEE(view_begin_ui_mode)
DOC_SEE(view_end_ui_mode)
DOC_SEE(UI_Control)
DOC_SEE(UI_Quit_Function_Type)
*/
{
Command_Data *cmd = (Command_Data*)app->cmd_context;
Models *models = cmd->models;
@ -2142,85 +2177,87 @@ View_Set_UI(Application_Links *app, View_Summary *view, UI_Control *control, UI_
heap_free(heap, vptr->transient.ui_control.items);
}
memset(&vptr->transient.ui_control, 0, sizeof(vptr->transient.ui_control));
if (control->count > 0){
i32 string_size = 0;
for (UI_Item *item = control->items, *one_past_last = control->items + control->count;
item < one_past_last;
item += 1){
switch (item->type){
case UIType_Option:
{
string_size += item->option.string.size;
string_size += item->option.status.size;
}break;
case UIType_TextField:
{
string_size += item->text_field.query.size;
string_size += item->text_field.string.size;
}break;
case UIType_ColorTheme:
{
string_size += item->color_theme.string.size;
}break;
}
}
i32 all_items_size = sizeof(UI_Item)*control->count;
i32 memory_size = all_items_size + string_size;
UI_Item *new_items = (UI_Item*)heap_allocate(heap, memory_size);
if (new_items != 0){
char *string_space = (char*)(new_items + control->count);
Partition string_alloc = make_part(string_space, string_size);
i32 count = control->count;
memcpy(new_items, control->items, all_items_size);
for (UI_Item *item = new_items, *one_past_last = new_items + count;
vptr->transient.ui_quit = quit_function;
if (control != 0){
if (control->count > 0){
i32 string_size = 0;
for (UI_Item *item = control->items, *one_past_last = control->items + control->count;
item < one_past_last;
item += 1){
String *fixup[2];
int32_t fixup_count = 0;
switch (item->type){
case UIType_Option:
{
fixup[0] = &item->option.string;
fixup[1] = &item->option.status;
fixup_count = 2;
string_size += item->option.string.size;
string_size += item->option.status.size;
}break;
case UIType_TextField:
{
fixup[0] = &item->text_field.query;
fixup[1] = &item->text_field.string;
fixup_count = 2;
string_size += item->text_field.query.size;
string_size += item->text_field.string.size;
}break;
case UIType_ColorTheme:
{
fixup[0] = &item->color_theme.string;
fixup_count = 1;
string_size += item->color_theme.string.size;
}break;
}
for (i32 i = 0; i < fixup_count; i += 1){
String old = *fixup[i];
char *new_str = push_array(&string_alloc, char, old.size);
fixup[i]->str = new_str;
fixup[i]->size = old.size;
fixup[i]->memory_size = old.size;
memcpy(new_str, old.str, old.size);
}
}
vptr->transient.ui_control.items = new_items;
vptr->transient.ui_control.count = count;
}
else{
return(false);
i32 all_items_size = sizeof(UI_Item)*control->count;
i32 memory_size = all_items_size + string_size;
UI_Item *new_items = (UI_Item*)heap_allocate(heap, memory_size);
if (new_items != 0){
char *string_space = (char*)(new_items + control->count);
Partition string_alloc = make_part(string_space, string_size);
i32 count = control->count;
memcpy(new_items, control->items, all_items_size);
for (UI_Item *item = new_items, *one_past_last = new_items + count;
item < one_past_last;
item += 1){
String *fixup[2];
int32_t fixup_count = 0;
switch (item->type){
case UIType_Option:
{
fixup[0] = &item->option.string;
fixup[1] = &item->option.status;
fixup_count = 2;
}break;
case UIType_TextField:
{
fixup[0] = &item->text_field.query;
fixup[1] = &item->text_field.string;
fixup_count = 2;
}break;
case UIType_ColorTheme:
{
fixup[0] = &item->color_theme.string;
fixup_count = 1;
}break;
}
for (i32 i = 0; i < fixup_count; i += 1){
String old = *fixup[i];
char *new_str = push_array(&string_alloc, char, old.size);
fixup[i]->str = new_str;
fixup[i]->size = old.size;
fixup[i]->memory_size = old.size;
memcpy(new_str, old.str, old.size);
}
}
vptr->transient.ui_control.items = new_items;
vptr->transient.ui_control.count = count;
}
else{
return(false);
}
}
memcpy(vptr->transient.ui_control.bounding_box, control->bounding_box,
sizeof(control->bounding_box));
}
memcpy(vptr->transient.ui_control.bounding_box, control->bounding_box,
sizeof(control->bounding_box));
vptr->transient.ui_quit = quit_function;
return(true);
}
return(false);
@ -2228,11 +2265,17 @@ View_Set_UI(Application_Links *app, View_Summary *view, UI_Control *control, UI_
API_EXPORT UI_Control
View_Get_UI_Copy(Application_Links *app, View_Summary *view, struct Partition *part)
/*
DOC_PARAM(view, A summary for the view which is to get the new UI widget data.)
DOC_PARAM(part, A memory arena onto which the UI widget data will be allocated.)
DOC_RETURN(If the view is valid, and there is enough space in part, then the UI_Control stucture returned points to a copy of the widget data currently attached to the view.)
DOC_SEE(view_set_ui)
*/
{
Command_Data *cmd = (Command_Data*)app->cmd_context;
View *vptr = imp_get_view(cmd, view);
UI_Control result = {0};
if (vptr != 0){
if (vptr != 0 && part != 0){
UI_Control *control = &vptr->transient.ui_control;
result.items = push_array(part, UI_Item, control->count);
if (result.items != 0){
@ -2258,7 +2301,12 @@ get_dynamic_workspace(Models *models, Managed_Scope handle){
}
API_EXPORT Managed_Scope
Create_User_Managed_Scope(Application_Links *app){
Create_User_Managed_Scope(Application_Links *app)
/*
DOC_RETURN(Always returns a newly created scope with a handle that is unique from all other scopes that have been created either by the core or the custom layer. The new scope is a 'basic scope' and is a 'user managed scope'.)
DOC_SEE(destroy_user_managed_scope)
*/
{
Command_Data *cmd = (Command_Data*)app->cmd_context;
Models *models = cmd->models;
Heap *heap = &models->mem.heap;
@ -2269,7 +2317,14 @@ Create_User_Managed_Scope(Application_Links *app){
}
API_EXPORT bool32
Destroy_User_Managed_Scope(Application_Links *app, Managed_Scope scope){
Destroy_User_Managed_Scope(Application_Links *app, Managed_Scope scope)
/*
DOC_PARAM(scope, The handle for the scope which is to be destroyed)
DOC_RETURN(If the scope is a valid 'user managed scope' this function returns non-zero, otherwise it returns zero.)
DOC(This call only operates on 'user managed scopes'. 'User managed scopes' are those scopes created by create_user_managed_scope. Scopes tied to views, and buffers, and the global scope are not 'user managed scopes'.)
DOC_SEE(create_user_managed_scope)
*/
{
Command_Data *cmd = (Command_Data*)app->cmd_context;
Models *models = cmd->models;
Dynamic_Workspace *workspace = get_dynamic_workspace(models, scope);
@ -2283,6 +2338,9 @@ Destroy_User_Managed_Scope(Application_Links *app, Managed_Scope scope){
API_EXPORT Managed_Scope
Get_Global_Managed_Scope(Application_Links *app)
/*
DOC_RETURN(Always returns the handle to the 'global scope'. The 'global scope' is unique in that it is not dependent on any object at all. The handle for the 'global scope' never changes in a 4coder session, and when used as a dependency in get_managed_scope_with_multiple_dependencies it has no effect.)
*/
{
Command_Data *cmd = (Command_Data*)app->cmd_context;
Models *models = cmd->models;
@ -2312,7 +2370,14 @@ get_lifetime_object_from_workspace(Dynamic_Workspace *workspace){
}
API_EXPORT Managed_Scope
Get_Managed_Scope_With_Multiple_Dependencies(Application_Links *app, Managed_Scope *intersected_scopes, int32_t count)
Get_Managed_Scope_With_Multiple_Dependencies(Application_Links *app, Managed_Scope *scopes, int32_t count)
/*
DOC_PARAM(scopes, An array of scope handles which are to represent the various dependencies that the returned scope will have.)
DOC_PARAM(count, The number of scopes in the scopes array)
DOC_RETURN(Always returns the handle to a scope with the appropriate dependencies.)
DOC(Scopes with multiple dependencies are a subtle topic, for a full treatment please read
https://4coder.handmade.network/blogs/p/3412-new_features_p3__memory_management_scopes)
*/
{
Command_Data *cmd = (Command_Data*)app->cmd_context;
Models *models = cmd->models;
@ -2324,7 +2389,7 @@ Get_Managed_Scope_With_Multiple_Dependencies(Application_Links *app, Managed_Sco
b32 filled_array = true;
Lifetime_Object **object_ptr_array = push_array(scratch, Lifetime_Object*, 0);
for (i32 i = 0; i < count; i += 1){
Dynamic_Workspace *workspace = get_dynamic_workspace(models, intersected_scopes[i]);
Dynamic_Workspace *workspace = get_dynamic_workspace(models, scopes[i]);
if (workspace == 0){
filled_array = false;
break;
@ -2381,7 +2446,13 @@ Get_Managed_Scope_With_Multiple_Dependencies(Application_Links *app, Managed_Sco
}
API_EXPORT bool32
Managed_Scope_Clear_Contents(Application_Links *app, Managed_Scope scope){
Managed_Scope_Clear_Contents(Application_Links *app, Managed_Scope scope)
/*
DOC_PARAM(scope, A handle to the scope which is to be cleared.)
DOC_RETURN(Returns non-zero on succes, and zero on failure. This call fails when the scope handle does not refer to a valid scope.)
DOC(Clearing the contents of a scope resets all managed variables to have their default values, and frees all managed objects. The scope handle remains valid and refers to the same scope which still has the same dependencies.)
*/
{
Command_Data *cmd = (Command_Data*)app->cmd_context;
Models *models = cmd->models;
Dynamic_Workspace *workspace = get_dynamic_workspace(models, scope);
@ -2393,19 +2464,15 @@ Managed_Scope_Clear_Contents(Application_Links *app, Managed_Scope scope){
}
API_EXPORT bool32
Clear_Managed_Scope(Application_Links *app, Managed_Scope scope){
Command_Data *cmd = (Command_Data*)app->cmd_context;
Models *models = cmd->models;
Dynamic_Workspace *workspace = get_dynamic_workspace(models, scope);
if (workspace != 0){
dynamic_workspace_clear_contents(&models->mem.heap, workspace);
return(true);
}
return(false);
}
API_EXPORT bool32
Clear_Managed_Scope_And_All_Dependent_Scopes(Application_Links *app, Managed_Scope scope){
Managed_Scope_Clear_Self_All_Dependent_Scopes(Application_Links *app, Managed_Scope scope)
/*
DOC_PARAM(scope, A handle to the 'basic scope' which is to be cleared.)
DOC_RETURN(Returns non-zero on succes, and zero on failure. This call fails when the scope handle does not refer to a valid 'basic scope'.)
DOC(The parameter scope must be a 'basic scope' which means a scope with a single dependency. Scopes tied to buffers and view, and 'user managed scopes' are the 'basic scopes'. This call treats the scope as an identifier for the single object up which the scope depends, and clears all scopes that depend on that object, this includes clearing 'scope' itself. The scopes returned from get_managed_scope_with_multiple_dependencies that included 'scope' via the union rule are the only other scopes that can be cleared by this call.
For more on the union rule read the full treatment of managed scopes
https://4coder.handmade.network/blogs/p/3412-new_features_p3__memory_management_scopes)
*/
{
Command_Data *cmd = (Command_Data*)app->cmd_context;
Models *models = cmd->models;
Dynamic_Workspace *workspace = get_dynamic_workspace(models, scope);
@ -2420,6 +2487,14 @@ Clear_Managed_Scope_And_All_Dependent_Scopes(Application_Links *app, Managed_Sco
API_EXPORT Managed_Variable_ID
Managed_Variable_Create(Application_Links *app, char *null_terminated_name, uint64_t default_value)
/*
DOC_PARAM(null_terminated_name, The unique name for this managed variable.)
DOC_PARAM(default_value, The default value that this variable will have in a scope that has not set this variable.)
DOC_RETURN(Returns the Managed_Variable_ID for the new variable on success or zero on failure. This call fails when a variable with the given name alraedy exists.)
DOC(Variables are stored in scopes but creating a variable does not mean that all scopes will allocate space for this variable. Space for variables is allocated sparsly on demand in each scope. Once a variable exists it will exist for the entire duration of the 4coder session and will never have a different id. The id will be used to set and get the value of the variable in managed scopes.)
DOC_SEE(managed_variable_get_id)
DOC_SEE(managed_variable_create_or_get_id)
*/
{
Command_Data *cmd = (Command_Data*)app->cmd_context;
Models *models = cmd->models;
@ -2431,6 +2506,12 @@ Managed_Variable_Create(Application_Links *app, char *null_terminated_name, uint
API_EXPORT Managed_Variable_ID
Managed_Variable_Get_ID(Application_Links *app, char *null_terminated_name)
/*
DOC_PARAM(null_terminated_name, The unique name for this managed variable.)
DOC_RETURN(Returns the Managed_Variable_ID for the variable on success or zero on failure. This call fails when no variable that already exists has the given name.)
DOC_SEE(managed_variable_create)
DOC_SEE(managed_variable_create_or_get_id)
*/
{
Command_Data *cmd = (Command_Data*)app->cmd_context;
Models *models = cmd->models;
@ -2441,6 +2522,14 @@ Managed_Variable_Get_ID(Application_Links *app, char *null_terminated_name)
API_EXPORT Managed_Variable_ID
Managed_Variable_Create_Or_Get_ID(Application_Links *app, char *null_terminated_name, uint64_t default_value)
/*
DOC_PARAM(null_terminated_name, The unique name for this managed variable.)
DOC_PARAM(default_value, The default value that this variable will have in a scope that has not set this variable. This parameter is ignored if the variable already exists.)
DOC_RETURN(Returns the Managed_Variable_ID for the variable on success, this call never fails.)
DOC(This call first tries to get the variable id in the same way that managed_variable_get_id would, if this fails it creates the variable and returns the new id in the way that managed_variable_create would. )
DOC_SEE(managed_variable_create)
DOC_SEE(managed_variable_get_id)
*/
{
Command_Data *cmd = (Command_Data*)app->cmd_context;
Models *models = cmd->models;
@ -2466,11 +2555,17 @@ get_dynamic_variable(Command_Data *cmd, Managed_Scope handle, int32_t location,
}
API_EXPORT bool32
Managed_Variable_Set(Application_Links *app, Managed_Scope scope, Managed_Variable_ID location, uint64_t value)
Managed_Variable_Set(Application_Links *app, Managed_Scope scope, Managed_Variable_ID id, uint64_t value)
/*
DOC_PARAM(scope, A handle to the scope in which the value of the given variable will be set.)
DOC_PARAM(id, The id of the variable to set.)
DOC_PARAM(value, The new value of the variable.)
DOC_RETURN(Returns non-zero on success. This call fails if scope does not refer to a valid managed scope, or id does not refer to an existing managed variable.)
*/
{
Command_Data *cmd = (Command_Data*)app->cmd_context;
u64 *ptr = 0;
if (get_dynamic_variable(cmd, scope, location, &ptr)){
if (get_dynamic_variable(cmd, scope, id, &ptr)){
*ptr = value;
return(true);
}
@ -2478,11 +2573,17 @@ Managed_Variable_Set(Application_Links *app, Managed_Scope scope, Managed_Variab
}
API_EXPORT bool32
Managed_Variable_Get(Application_Links *app, Managed_Scope scope, Managed_Variable_ID location, uint64_t *value_out)
Managed_Variable_Get(Application_Links *app, Managed_Scope scope, Managed_Variable_ID id, uint64_t *value_out)
/*
DOC_PARAM(scope, A handle to the scope from which the value of the given variable will be queried.)
DOC_PARAM(id, The id of the variable to get.)
DOC_PARAM(value_out, An address where the value of the given variable in the given scope will be stored.)
DOC_RETURN(Returns non-zero on success. This call fails if scope does not refer to a valid managed scope, or id does not refer to an existing managed variable. If the managed scope and managed variable both exist, but the variable has never been set, then the default value for the variable that was determined when the variable was created is used to fill value_out, this is treated as a success and returns non-zero.)
*/
{
Command_Data *cmd = (Command_Data*)app->cmd_context;
u64 *ptr = 0;
if (get_dynamic_variable(cmd, scope, location, &ptr)){
if (get_dynamic_variable(cmd, scope, id, &ptr)){
*value_out = *ptr;
return(true);
}
@ -2491,6 +2592,13 @@ Managed_Variable_Get(Application_Links *app, Managed_Scope scope, Managed_Variab
API_EXPORT Managed_Object
Alloc_Managed_Memory_In_Scope(Application_Links *app, Managed_Scope scope, int32_t item_size, int32_t count)
/*
DOC_PARAM(scope, A handle to the scope in which the new object will be allocated.)
DOC_PARAM(item_size, The size, in bytes, of a single 'item' in this memory object. This effects the size of the allocation, and the indexing of the memory in the store and load calls.)
DOC_PARAM(count, The number of 'items' allocated for this memory object. The total memory size is item_size*count.)
DOC_RETURN(Returns the handle to the new object on success, or zero on failure. This call fails if scope does not refer to a valid managed scope.)
DOC(Managed objects allocate memory that is tied to the scope. When the scope is cleared or destroyed all of the memory allocated in it is freed in bulk and the handles to the objects never again become valid. Thus the handle returned by this call will only ever refer to this memory allocation.)
*/
{
Command_Data *cmd = (Command_Data*)app->cmd_context;
Models *models = cmd->models;
@ -2512,6 +2620,15 @@ Alloc_Managed_Memory_In_Scope(Application_Links *app, Managed_Scope scope, int32
API_EXPORT Managed_Object
Alloc_Buffer_Markers_On_Buffer(Application_Links *app, Buffer_ID buffer_id, int32_t count, Managed_Scope *optional_extra_scope)
/*
DOC_PARAM(buffer_id, The id for the buffer onto which these markers will be attached. The markers will live in the scope of the buffer, or in another scope dependent on this buffer, thus guaranteeing that when the buffer is closed, all attached markers are freed in bulk with it.)
DOC_PARAM(count, The number of Marker items allocated in this object. The total memory size is sizeof(Marker)*count.)
DOC_PARAM(optional_extra_scope, If this pointer is non-null, then it is treated as a scope with additional dependencies for the allocated markers. In this case, the scope of buffer and extra scope are unioned via get_managed_scope_with_multiple_dependencies and marker object lives in the resulting scope.)
DOC_RETURN(Returns the handle to the new object on succes, or zero on failure. This call fails if buffer_id does not refer to a valid buffer, or optional_extra_scope does not refer to a valid scope.)
DOC(The created managed object is essentially a memory object with item size equal to sizeof(Marker). The primary difference is that if the buffer referred to by buffer_id is edited, the position of all markers attached to that buffer can be changed by the core. Thus this not a memory storage so much as position marking and tracking in a buffer.)
DOC_SEE(alloc_managed_memory_in_scope)
DOC_SEE(Marker)
*/
{
Command_Data *cmd = (Command_Data*)app->cmd_context;
Editing_File *file = imp_get_file(cmd, buffer_id);
@ -2536,9 +2653,9 @@ Alloc_Buffer_Markers_On_Buffer(Application_Links *app, Buffer_ID buffer_id, int3
zdll_push_back(workspace->buffer_markers_list.first, workspace->buffer_markers_list.last, header);
workspace->buffer_markers_list.count += 1;
header->buffer_id = buffer_id;
header->visuals_first = 0;
header->visuals_last = 0;
header->visuals_count = 0;
header->visual_first = 0;
header->visual_last = 0;
header->visual_count = 0;
file->state.total_marker_count += count;
u32 id = dynamic_workspace_store_pointer(heap, workspace, ptr);
result = ((u64)markers_scope << 32) | (u64)id;
@ -2563,44 +2680,51 @@ get_dynamic_object_ptrs(Models *models, Managed_Object object){
return(result);
}
API_EXPORT Marker_Visuals
Create_Marker_Visuals(Application_Links *app, Managed_Object object){
API_EXPORT Marker_Visual
Create_Marker_Visual(Application_Links *app, Managed_Object object)
/*
DOC_PARAM(object, A handle to the marker object on which the new visual will be attached.)
DOC_RETURN(Returns the handle to the newly created marker visual on success, or zero on failure. This call fails when object does not refer to a valid marker object.)
DOC(A marker visual adds graphical effects to markers such as cursors, highlight ranges, text colors, etc. A marker object can have any number of attached visuals. The memory in the 4coder core for visuals is stored in the same scope as the object.)
DOC_SEE(destroy_marker_visuals)
*/
{
Command_Data *cmd = (Command_Data*)app->cmd_context;
Models *models = cmd->models;
Managed_Object_Ptr_And_Workspace object_ptrs = get_dynamic_object_ptrs(models, object);
Marker_Visuals visuals = {0};
Marker_Visual visual = {0};
if (object_ptrs.header != 0 && object_ptrs.header->type == ManagedObjectType_Markers){
Heap *heap = &models->mem.heap;
Dynamic_Workspace *workspace = object_ptrs.workspace;
Marker_Visuals_Data *data = dynamic_workspace_alloc_visuals(heap, &workspace->mem_bank, workspace);
Marker_Visual_Data *data = dynamic_workspace_alloc_visual(heap, &workspace->mem_bank, workspace);
Managed_Buffer_Markers_Header *markers = (Managed_Buffer_Markers_Header*)object_ptrs.header;
zdll_push_back(markers->visuals_first, markers->visuals_last, data);
markers->visuals_count += 1;
zdll_push_back(markers->visual_first, markers->visual_last, data);
markers->visual_count += 1;
data->owner_object = object;
marker_visuals_defaults(data);
marker_visual_defaults(data);
visuals.scope = workspace->scope_id;
visuals.slot_id = data->slot_id;
visuals.gen_id = data->gen_id;
visual.scope = workspace->scope_id;
visual.slot_id = data->slot_id;
visual.gen_id = data->gen_id;
}
return(visuals);
return(visual);
}
internal Marker_Visuals_Data*
get_marker_visuals_pointer(Models *models, Marker_Visuals visuals){
Dynamic_Workspace *workspace = get_dynamic_workspace(models, visuals.scope);
internal Marker_Visual_Data*
get_marker_visual_pointer(Models *models, Marker_Visual visual){
Dynamic_Workspace *workspace = get_dynamic_workspace(models, visual.scope);
if (workspace != 0){
return(dynamic_workspace_get_visuals_pointer(workspace, visuals.slot_id, visuals.gen_id));
return(dynamic_workspace_get_visual_pointer(workspace, visual.slot_id, visual.gen_id));
}
return(0);
}
API_EXPORT bool32
Marker_Visuals_Set_Look(Application_Links *app, Marker_Visuals visuals, Marker_Visuals_Type type, int_color color, int_color text_color, Marker_Visuals_Text_Style text_style){
Marker_Visual_Set_Effect(Application_Links *app, Marker_Visual visual, Marker_Visual_Type type, int_color color, int_color text_color, Marker_Visual_Text_Style text_style){
Command_Data *cmd = (Command_Data*)app->cmd_context;
Models *models = cmd->models;
Marker_Visuals_Data *data = get_marker_visuals_pointer(models, visuals);
Marker_Visual_Data *data = get_marker_visual_pointer(models, visual);
if (data != 0){
data->type = type;
data->color = color;
@ -2611,10 +2735,10 @@ Marker_Visuals_Set_Look(Application_Links *app, Marker_Visuals visuals, Marker_V
}
API_EXPORT bool32
Marker_Visuals_Set_Take_Rule(Application_Links *app, Marker_Visuals visuals, Marker_Visuals_Take_Rule take_rule){
Marker_Visual_Set_Take_Rule(Application_Links *app, Marker_Visual visual, Marker_Visual_Take_Rule take_rule){
Command_Data *cmd = (Command_Data*)app->cmd_context;
Models *models = cmd->models;
Marker_Visuals_Data *data = get_marker_visuals_pointer(models, visuals);
Marker_Visual_Data *data = get_marker_visual_pointer(models, visual);
if (data != 0){
Assert(take_rule.take_count_per_step != 0);
take_rule.first_index = clamp_bottom(0, take_rule.first_index);
@ -2635,10 +2759,10 @@ Marker_Visuals_Set_Take_Rule(Application_Links *app, Marker_Visuals visuals, Mar
}
API_EXPORT bool32
Marker_Visuals_Set_Priority(Application_Links *app, Marker_Visuals visuals, Marker_Visuals_Priority_Level priority){
Marker_Visual_Set_Priority(Application_Links *app, Marker_Visual visual, Marker_Visual_Priority_Level priority){
Command_Data *cmd = (Command_Data*)app->cmd_context;
Models *models = cmd->models;
Marker_Visuals_Data *data = get_marker_visuals_pointer(models, visuals);
Marker_Visual_Data *data = get_marker_visual_pointer(models, visual);
if (data != 0){
data->priority = priority;
}
@ -2646,10 +2770,10 @@ Marker_Visuals_Set_Priority(Application_Links *app, Marker_Visuals visuals, Mark
}
API_EXPORT bool32
Marker_Visuals_Set_View_Key(Application_Links *app, Marker_Visuals visuals, View_ID key_view_id){
Marker_Visual_Set_View_Key(Application_Links *app, Marker_Visual visual, View_ID key_view_id){
Command_Data *cmd = (Command_Data*)app->cmd_context;
Models *models = cmd->models;
Marker_Visuals_Data *data = get_marker_visuals_pointer(models, visuals);
Marker_Visual_Data *data = get_marker_visual_pointer(models, visual);
if (data != 0){
data->key_view_id = key_view_id;
}
@ -2657,80 +2781,57 @@ Marker_Visuals_Set_View_Key(Application_Links *app, Marker_Visuals visuals, View
}
API_EXPORT bool32
Destroy_Marker_Visuals(Application_Links *app, Marker_Visuals visuals){
Destroy_Marker_Visual(Application_Links *app, Marker_Visual visual){
Command_Data *cmd = (Command_Data*)app->cmd_context;
Models *models = cmd->models;
Dynamic_Workspace *workspace = get_dynamic_workspace(models, visuals.scope);
Dynamic_Workspace *workspace = get_dynamic_workspace(models, visual.scope);
if (workspace != 0){
Marker_Visuals_Data *data = dynamic_workspace_get_visuals_pointer(workspace, visuals.slot_id, visuals.gen_id);
Marker_Visual_Data *data = dynamic_workspace_get_visual_pointer(workspace, visual.slot_id, visual.gen_id);
if (data != 0){
marker_visuals_free(&workspace->visuals_allocator, data);
marker_visual_free(&workspace->visual_allocator, data);
}
}
return(false);
}
API_EXPORT int32_t
Buffer_Markers_Get_Attached_Visuals_Count(Application_Links *app, Managed_Object object){
Buffer_Markers_Get_Attached_Visual_Count(Application_Links *app, Managed_Object object){
Command_Data *cmd = (Command_Data*)app->cmd_context;
Models *models = cmd->models;
Managed_Object_Ptr_And_Workspace object_ptrs = get_dynamic_object_ptrs(models, object);
if (object_ptrs.header != 0 && object_ptrs.header->type == ManagedObjectType_Markers){
Managed_Buffer_Markers_Header *markers = (Managed_Buffer_Markers_Header*)object_ptrs.header;
return(markers->visuals_count);
return(markers->visual_count);
}
return(0);
}
API_EXPORT Marker_Visuals*
Buffer_Markers_Get_Attached_Visuals(Application_Links *app, Partition *part, Managed_Object object){
API_EXPORT Marker_Visual*
Buffer_Markers_Get_Attached_Visual(Application_Links *app, Partition *part, Managed_Object object){
Command_Data *cmd = (Command_Data*)app->cmd_context;
Models *models = cmd->models;
Managed_Object_Ptr_And_Workspace object_ptrs = get_dynamic_object_ptrs(models, object);
if (object_ptrs.header != 0 && object_ptrs.header->type == ManagedObjectType_Markers){
Managed_Buffer_Markers_Header *markers = (Managed_Buffer_Markers_Header*)object_ptrs.header;
i32 count = markers->visuals_count;
Marker_Visuals *visuals = push_array(part, Marker_Visuals, count);
if (visuals != 0){
Marker_Visuals *v = visuals;
i32 count = markers->visual_count;
Marker_Visual *visual = push_array(part, Marker_Visual, count);
if (visual != 0){
Marker_Visual *v = visual;
Managed_Scope scope = object_ptrs.workspace->scope_id;
for (Marker_Visuals_Data *data = markers->visuals_first;
for (Marker_Visual_Data *data = markers->visual_first;
data != 0;
data = data->next, v += 1){
v->scope = scope;
v->slot_id = data->slot_id;
v->gen_id = data->gen_id;
}
Assert(v == visuals + count);
Assert(v == visual + count);
}
return(visuals);
return(visual);
}
return(0);
}
/*
#if 0
API_EXPORT bool32
Buffer_Markers_Set_Visuals(Application_Links *app, Managed_Object object, Marker_Visuals_Type marker_type, uint32_t color, uint32_t text_color, View_ID key_view_id){
Command_Data *cmd = (Command_Data*)app->cmd_context;
Models *models = cmd->models;
Managed_Object_Ptr_And_Workspace object_ptrs = get_dynamic_object_ptrs(models, object);
if (0 <= marker_type && marker_type < BufferMarkersType_COUNT){
if (object_ptrs.header != 0 &&
object_ptrs.header->type == ManagedObjectType_Markers){
Managed_Buffer_Markers_Header *header = (Managed_Buffer_Markers_Header*)object_ptrs.header;
header->marker_type = marker_type;
header->color = color;
header->text_color = text_color;
header->key_view_id = key_view_id;
return(true);
}
}
return(false);
}
#endif
*/
internal u8*
get_dynamic_object_memory_ptr(Managed_Object_Standard_Header *header){
if (header != 0){
@ -2808,7 +2909,7 @@ Managed_Object_Free(Application_Links *app, Managed_Object object)
Managed_Object_Type *type = (Managed_Object_Type*)object_ptr;
if (*type == ManagedObjectType_Markers){
Managed_Buffer_Markers_Header *header = (Managed_Buffer_Markers_Header*)object_ptr;
marker_visuals_free_chain(&workspace->visuals_allocator, header->visuals_first, header->visuals_last, header->visuals_count);
marker_visual_free_chain(&workspace->visual_allocator, header->visual_first, header->visual_last, header->visual_count);
zdll_remove(workspace->buffer_markers_list.first, workspace->buffer_markers_list.last, header);
workspace->buffer_markers_list.count -= 1;
}

View File

@ -185,19 +185,19 @@ insert_u32_Ptr_table(Heap *heap, Dynamic_Memory_Bank *mem_bank, u32_Ptr_Table *t
////////////////////////////////
internal void
marker_visuals_allocator_init(Marker_Visuals_Allocator *allocator){
marker_visual_allocator_init(Marker_Visual_Allocator *allocator){
memset(allocator, 0, sizeof(*allocator));
}
internal Marker_Visuals_Data*
dynamic_workspace_alloc_visuals(Heap *heap, Dynamic_Memory_Bank *mem_bank, Dynamic_Workspace *workspace){
Marker_Visuals_Allocator *allocator = &workspace->visuals_allocator;
internal Marker_Visual_Data*
dynamic_workspace_alloc_visual(Heap *heap, Dynamic_Memory_Bank *mem_bank, Dynamic_Workspace *workspace){
Marker_Visual_Allocator *allocator = &workspace->visual_allocator;
if (allocator->free_count == 0){
i32 new_slots_count = clamp_bottom(16, allocator->total_visual_count);
i32 memsize = new_slots_count*sizeof(Marker_Visuals_Data);
i32 memsize = new_slots_count*sizeof(Marker_Visual_Data);
void *new_slots_memory = dynamic_memory_bank_allocate(heap, mem_bank, memsize);
memset(new_slots_memory, 0, memsize);
Marker_Visuals_Data *new_slot = (Marker_Visuals_Data*)new_slots_memory;
Marker_Visual_Data *new_slot = (Marker_Visual_Data*)new_slots_memory;
allocator->free_count += new_slots_count;
allocator->total_visual_count += new_slots_count;
for (i32 i = 0; i < new_slots_count; i += 1, new_slot += 1){
@ -206,7 +206,7 @@ dynamic_workspace_alloc_visuals(Heap *heap, Dynamic_Memory_Bank *mem_bank, Dynam
insert_u32_Ptr_table(heap, mem_bank, &allocator->id_to_ptr_table, new_slot->slot_id, new_slot);
}
}
Marker_Visuals_Data *data = allocator->free_first;
Marker_Visual_Data *data = allocator->free_first;
zdll_remove(allocator->free_first, allocator->free_last, data);
allocator->free_count -= 1;
data->gen_id += 1;
@ -214,13 +214,13 @@ dynamic_workspace_alloc_visuals(Heap *heap, Dynamic_Memory_Bank *mem_bank, Dynam
}
internal void
marker_visuals_free(Marker_Visuals_Allocator *allocator, Marker_Visuals_Data *data){
marker_visual_free(Marker_Visual_Allocator *allocator, Marker_Visual_Data *data){
zdll_push_back(allocator->free_first, allocator->free_last, data);
allocator->free_count += 1;
}
internal void
marker_visuals_free_chain(Marker_Visuals_Allocator *allocator, Marker_Visuals_Data *first, Marker_Visuals_Data *last, i32 count){
marker_visual_free_chain(Marker_Visual_Allocator *allocator, Marker_Visual_Data *first, Marker_Visual_Data *last, i32 count){
if (allocator->free_first == 0){
allocator->free_first = first;
allocator->free_last = last;
@ -234,8 +234,8 @@ marker_visuals_free_chain(Marker_Visuals_Allocator *allocator, Marker_Visuals_Da
}
internal void
marker_visuals_defaults(Marker_Visuals_Data *data){
data->type = BufferMarkersType_Invisible;
marker_visual_defaults(Marker_Visual_Data *data){
data->type = VisualType_Invisible;
data->color = 0;
data->text_color = 0;
data->text_style = 0;
@ -255,7 +255,7 @@ dynamic_workspace_init(Heap *heap, Lifetime_Allocator *lifetime_allocator, i32 u
memset(workspace, 0, sizeof(*workspace));
dynamic_variables_block_init(heap, &workspace->var_block);
dynamic_memory_bank_init(heap, &workspace->mem_bank);
marker_visuals_allocator_init(&workspace->visuals_allocator);
marker_visual_allocator_init(&workspace->visual_allocator);
if (lifetime_allocator->scope_id_counter == 0){
lifetime_allocator->scope_id_counter = 1;
}
@ -280,7 +280,7 @@ dynamic_workspace_clear_contents(Heap *heap, Dynamic_Workspace *workspace){
memset(&workspace->buffer_markers_list, 0, sizeof(workspace->buffer_markers_list));
dynamic_variables_block_init(heap, &workspace->var_block);
dynamic_memory_bank_init(heap, &workspace->mem_bank);
marker_visuals_allocator_init(&workspace->visuals_allocator);
marker_visual_allocator_init(&workspace->visual_allocator);
}
internal u32
@ -307,11 +307,11 @@ dynamic_workspace_get_pointer(Dynamic_Workspace *workspace, u32 id){
return(0);
}
internal Marker_Visuals_Data*
dynamic_workspace_get_visuals_pointer(Dynamic_Workspace *workspace, u32 slot_id, u32 gen_id){
internal Marker_Visual_Data*
dynamic_workspace_get_visual_pointer(Dynamic_Workspace *workspace, u32 slot_id, u32 gen_id){
void *data_ptr = 0;
if (lookup_u32_Ptr_table(&workspace->visuals_allocator.id_to_ptr_table, slot_id, &data_ptr)){
Marker_Visuals_Data *data = (Marker_Visuals_Data*)data_ptr;
if (lookup_u32_Ptr_table(&workspace->visual_allocator.id_to_ptr_table, slot_id, &data_ptr)){
Marker_Visual_Data *data = (Marker_Visual_Data*)data_ptr;
if (data->gen_id == gen_id){
void *object_ptr = dynamic_workspace_get_pointer(workspace, data->owner_object&max_u32);
if (object_ptr != 0){

View File

@ -30,34 +30,34 @@ struct Managed_Buffer_Markers_Header{
Managed_Buffer_Markers_Header *next;
Managed_Buffer_Markers_Header *prev;
Buffer_ID buffer_id;
struct Marker_Visuals_Data *visuals_first;
struct Marker_Visuals_Data *visuals_last;
i32 visuals_count;
struct Marker_Visual_Data *visual_first;
struct Marker_Visual_Data *visual_last;
i32 visual_count;
};
struct Marker_Visuals_Data{
Marker_Visuals_Data *next;
Marker_Visuals_Data *prev;
struct Marker_Visual_Data{
Marker_Visual_Data *next;
Marker_Visual_Data *prev;
Managed_Object owner_object;
u32 slot_id;
u32 gen_id;
// "Look"
Marker_Visuals_Type type;
Marker_Visual_Type type;
u32 color;
u32 text_color;
Marker_Visuals_Text_Style text_style;
Marker_Visual_Text_Style text_style;
// "Take Rule"
Marker_Visuals_Take_Rule take_rule;
Marker_Visual_Take_Rule take_rule;
i32 one_past_last_take_index;
// "Priority"
Marker_Visuals_Priority_Level priority;
Marker_Visual_Priority_Level priority;
// "Key View ID"
View_ID key_view_id;
};
struct Marker_Visuals_Allocator{
Marker_Visuals_Data *free_first;
Marker_Visuals_Data *free_last;
struct Marker_Visual_Allocator{
Marker_Visual_Data *free_first;
Marker_Visual_Data *free_last;
i32 free_count;
i32 total_visual_count;
u32_Ptr_Table id_to_ptr_table;
@ -113,7 +113,7 @@ struct Dynamic_Memory_Bank{
struct Dynamic_Workspace{
Dynamic_Variable_Block var_block;
Dynamic_Memory_Bank mem_bank;
Marker_Visuals_Allocator visuals_allocator;
Marker_Visual_Allocator visual_allocator;
u32_Ptr_Table object_id_to_object_ptr;
u32 object_id_counter;
u32 visual_id_counter;

View File

@ -498,13 +498,13 @@ get_visual_markers(Partition *arena, Dynamic_Workspace *workspace,
node != 0;
node = node->next){
if (node->buffer_id != buffer_id) continue;
for (Marker_Visuals_Data *data = node->visuals_first;
for (Marker_Visual_Data *data = node->visual_first;
data != 0;
data = data->next){
if (data->type == BufferMarkersType_Invisible) continue;
if (data->type == VisualType_Invisible) continue;
if (data->key_view_id != 0 && data->key_view_id != view_id) continue;
Marker_Visuals_Type type = data->type;
Marker_Visual_Type type = data->type;
u32 color = data->color;
u32 text_color = data->text_color;
i32 take_count_per_step = data->take_rule.take_count_per_step;
@ -560,8 +560,8 @@ get_visual_markers(Partition *arena, Dynamic_Workspace *workspace,
}
}break;
case BufferMarkersType_CharacterHighlightRanges:
case BufferMarkersType_LineHighlightRanges:
case VisualType_CharacterHighlightRanges:
case VisualType_LineHighlightRanges:
{
i32 pos_pair[2] = {0};
i32 pair_index = 0;
@ -602,17 +602,17 @@ get_visual_markers(Partition *arena, Dynamic_Workspace *workspace,
}
internal i32
marker_type_to_segment_rank(Marker_Visuals_Type type){
marker_type_to_segment_rank(Marker_Visual_Type type){
switch (type){
case BufferMarkersType_LineHighlights:
case VisualType_LineHighlights:
{
return(1);
}break;
case BufferMarkersType_CharacterHighlightRanges:
case VisualType_CharacterHighlightRanges:
{
return(2);
}break;
case BufferMarkersType_LineHighlightRanges:
case VisualType_LineHighlightRanges:
{
return(3);
}break;
@ -970,7 +970,7 @@ render_loaded_file_in_view__inner(Models *models, Render_Target *target, View *v
line_markers.markers[visual_line_markers_scan_index].pos <= ind;
visual_line_markers_scan_index += 1){
Render_Marker *marker = &line_markers.markers[visual_line_markers_scan_index];
Assert(marker->type == BufferMarkersType_LineHighlights);
Assert(marker->type == VisualType_LineHighlights);
if (marker->priority > visual_line_markers_best_priority){
visual_line_markers_color = marker->color;
visual_line_markers_best_priority = marker->priority;
@ -1023,7 +1023,7 @@ render_loaded_file_in_view__inner(Models *models, Render_Target *target, View *v
visual_markers_scan_index += 1){
Render_Marker *marker = &character_markers.markers[visual_markers_scan_index];
switch (marker->type){
case BufferMarkersType_CharacterBlocks:
case VisualType_CharacterBlocks:
{
if (marker->priority > marker_highlight_best_priority){
marker_highlight_is_set = true;
@ -1033,7 +1033,7 @@ render_loaded_file_in_view__inner(Models *models, Render_Target *target, View *v
}
}break;
case BufferMarkersType_CharacterWireFrames:
case VisualType_CharacterWireFrames:
{
if (marker->priority > marker_wireframe_best_priority){
marker_wireframe = marker->color;
@ -1041,7 +1041,7 @@ render_loaded_file_in_view__inner(Models *models, Render_Target *target, View *v
}
}break;
case BufferMarkersType_CharacterIBars:
case VisualType_CharacterIBars:
{
if (marker->priority > marker_ibar_best_priority){
marker_ibar = marker->color;

View File

@ -209,7 +209,7 @@ enum{
};
struct Render_Marker{
Marker_Visuals_Type type;
Marker_Visual_Type type;
u32 color;
u32 text_color;
i32 pos;

View File

@ -184,6 +184,9 @@ generate_binding_list(char *code_directory, char *src_directory){
case key_mouse_right: key_str = "right click"; break;
case key_mouse_left_release: key_str = "left release"; break;
case key_mouse_right_release: key_str = "right release"; break;
case key_mouse_wheel: key_str = "mouse wheel"; break;
case key_mouse_move: key_str = "mouse move"; break;
case key_animate: key_str = "animate"; break;
case key_f1: key_str = "f1"; break;
case key_f2: key_str = "f2"; break;
case key_f3: key_str = "f3"; break;

View File

@ -64,3 +64,325 @@ The following bindings apply in all situations.
\ITEM \STYLE{code} <f14> \END 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.
\ITEM \STYLE{code} <f15> \END 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.
\ITEM \STYLE{code} <f16> \END 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.
\ITEM \STYLE{code} <mouse wheel> \END Reads the scroll wheel value from the mouse state and scrolls accordingly.
\END
\END
\SECTION{mapid-file}
The following bindings apply in general text files and most apply in code files, but some are overriden by other commands specific to code files.
\LIST
\ITEM \STYLE{code} <any character> \END Inserts whatever character was used to trigger this command.
\ITEM \STYLE{code} <left click> \END Sets the cursor position and mark to the mouse position.
\ITEM \STYLE{code} <left release> \END Sets the cursor position to the mouse position.
\ITEM \STYLE{code} <mouse move> \END If the mouse left button is pressed, sets the cursor position to the mouse position.
\ITEM \STYLE{code} <delete> \END Deletes the character to the right of the cursor.
\ITEM \STYLE{code} <shift delete> \END Deletes the character to the right of the cursor.
\ITEM \STYLE{code} <backspace> \END Deletes the character to the left of the cursor.
\ITEM \STYLE{code} <shift backspace> \END Deletes the character to the left of the cursor.
\ITEM \STYLE{code} <up> \END Moves the cursor up one line.
\ITEM \STYLE{code} <down> \END Moves the cursor down one line.
\ITEM \STYLE{code} <left> \END Moves the cursor one character to the left.
\ITEM \STYLE{code} <right> \END Moves the cursor one character to the right.
\ITEM \STYLE{code} <shift up> \END Moves the cursor up one line.
\ITEM \STYLE{code} <shift down> \END Moves the cursor down one line.
\ITEM \STYLE{code} <shift left> \END Moves the cursor one character to the left.
\ITEM \STYLE{code} <shift right> \END Moves the cursor one character to the right.
\ITEM \STYLE{code} <end> \END Seeks the cursor to the end of the visual line.
\ITEM \STYLE{code} <home> \END Seeks the cursor to the beginning of the visual line.
\ITEM \STYLE{code} <ctrl page up> \END Sets the cursor to the beginning of the file.
\ITEM \STYLE{code} <ctrl page down> \END Sets the cursor to the end of the file.
\ITEM \STYLE{code} <page up> \END Scrolls the view up one view height and moves the cursor up one view height.
\ITEM \STYLE{code} <page down> \END Scrolls the view down one view height and moves the cursor down one view height.
\ITEM \STYLE{code} <shift end> \END Seeks the cursor to the end of the visual line.
\ITEM \STYLE{code} <shift home> \END Seeks the cursor to the beginning of the visual line.
\ITEM \STYLE{code} <ctrlshift page up> \END Sets the cursor to the beginning of the file.
\ITEM \STYLE{code} <ctrlshift page down> \END Sets the cursor to the end of the file.
\ITEM \STYLE{code} <shift page up> \END Scrolls the view up one view height and moves the cursor up one view height.
\ITEM \STYLE{code} <shift page down> \END Scrolls the view down one view height and moves the cursor down one view height.
\ITEM \STYLE{code} <ctrl up> \END Seeks the cursor up to the next blank line and places it at the end of the line.
\ITEM \STYLE{code} <ctrl down> \END Seeks the cursor down to the next blank line and places it at the end of the line.
\ITEM \STYLE{code} <ctrl right> \END Seek right for the next boundary between whitespace and non-whitespace.
\ITEM \STYLE{code} <ctrl left> \END Seek left for the next boundary between whitespace and non-whitespace.
\ITEM \STYLE{code} <ctrlshift up> \END Seeks the cursor up to the next blank line and places it at the end of the line.
\ITEM \STYLE{code} <ctrlshift down> \END Seeks the cursor down to the next blank line and places it at the end of the line.
\ITEM \STYLE{code} <ctrlshift right> \END Seek right for the next boundary between whitespace and non-whitespace.
\ITEM \STYLE{code} <ctrlshift left> \END Seek left for the next boundary between whitespace and non-whitespace.
\ITEM \STYLE{code} <alt up> \END Swaps the line under the cursor with the line above it, and moves the cursor up with it.
\ITEM \STYLE{code} <alt down> \END Swaps the line under the cursor with the line below it, and moves the cursor down with it.
\ITEM \STYLE{code} <ctrl backspace> \END Delete characters between the cursor position and the first alphanumeric boundary to the left.
\ITEM \STYLE{code} <ctrl delete> \END Delete characters between the cursor position and the first alphanumeric boundary to the right.
\ITEM \STYLE{code} <alt backspace> \END Delete a single, whole token on or to the left of the cursor and post it to the clipboard.
\ITEM \STYLE{code} <alt delete> \END Delete a single, whole token on or to the right of the cursor and post it to the clipboard.
\ITEM \STYLE{code} <ctrl space> \END Sets the mark to the current position of the cursor.
\ITEM \STYLE{code} <ctrl a> \END Queries the user for two strings, and replaces all occurences of the first string in the range between the cursor and the mark with the second string.
\ITEM \STYLE{code} <ctrl c> \END Copy the text in the range from the cursor to the mark onto the clipboard.
\ITEM \STYLE{code} <ctrl d> \END Deletes the text in the range between the cursor and the mark.
\ITEM \STYLE{code} <ctrl D> \END Delete the line the on which the cursor sits.
\ITEM \STYLE{code} <ctrl e> \END Centers the view vertically on the line on which the cursor sits.
\ITEM \STYLE{code} <ctrl E> \END Sets the left size of the view near the x position of the cursor.
\ITEM \STYLE{code} <ctrl f> \END Begins an incremental search down through the current buffer for a user specified string.
\ITEM \STYLE{code} <ctrl F> \END Queries the user for a string and lists all exact case-sensitive matches found in all open buffers.
\ITEM \STYLE{code} <alt F> \END Queries the user for a string and lists all case-insensitive substring matches found in all open buffers.
\ITEM \STYLE{code} <ctrl g> \END Queries the user for a number, and jumps the cursor to the corresponding line.
\ITEM \STYLE{code} <ctrl G> \END Reads the string in the selected range and lists all exact case-sensitive mathces in all open buffers.
\ITEM \STYLE{code} <ctrl j> \END Opens a snippet lister for inserting whole pre-written snippets of text.
\ITEM \STYLE{code} <ctrl K> \END Kills the current buffer.
\ITEM \STYLE{code} <ctrl L> \END Create a copy of the line on which the cursor sits.
\ITEM \STYLE{code} <ctrl m> \END Swaps the position of the cursor and the mark.
\ITEM \STYLE{code} <ctrl O> \END Reopen the current buffer from the hard drive.
\ITEM \STYLE{code} <ctrl q> \END Queries the user for two strings, and incrementally replaces every occurence of the first string with the second string.
\ITEM \STYLE{code} <ctrl Q> \END Queries the user for a string, and incrementally replace every occurence of the word or token found at the cursor with the specified string.
\ITEM \STYLE{code} <alt q> \END Queries the user for a string, and incrementally replace every occurence of the string found in the selected range with the specified string.
\ITEM \STYLE{code} <ctrl r> \END Begins an incremental search up through the current buffer for a user specified string.
\ITEM \STYLE{code} <ctrl s> \END Saves the current buffer.
\ITEM \STYLE{code} <ctrl t> \END Begins an incremental search down through the current buffer for the word or token under the cursor.
\ITEM \STYLE{code} <ctrl T> \END Reads a token or word under the cursor and lists all exact case-sensitive mathces in all open buffers.
\ITEM \STYLE{code} <ctrl v> \END Paste from the top of clipboard and run auto-indent on the newly pasted text.
\ITEM \STYLE{code} <ctrl V> \END Paste the next item on the clipboard and run auto-indent on the newly pasted text.
\ITEM \STYLE{code} <ctrl x> \END Cut the text in the range from the cursor to the mark onto the clipboard.
\ITEM \STYLE{code} <ctrl y> \END Advances forewards through the undo history.
\ITEM \STYLE{code} <ctrl z> \END Advances backwards through the undo history.
\ITEM \STYLE{code} <ctrl 1> \END Set the other non-active panel to view the buffer that the active panel views, and switch to that panel.
\ITEM \STYLE{code} <ctrl 2> \END Set the other non-active panel to view the buffer that the active panel views, and switch to that panel.
\ITEM \STYLE{code} <return> \END If the buffer in the active view is writable, inserts a character, otherwise performs goto_jump_at_cursor.
\ITEM \STYLE{code} <shift return> \END If the buffer in the active view is writable, inserts a character, otherwise performs goto_jump_at_cursor_same_panel.
\ITEM \STYLE{code} <ctrl >> \END When executed on a buffer with jumps, creates a persistent lister for all the jumps
\ITEM \STYLE{code} <shift space> \END Inserts whatever character was used to trigger this command.
\END
\END
\SECTION{default-code-map}
The following commands only apply in files where the lexer (syntax highlighting) is turned on.
\LIST
\ITEM \STYLE{code} <ctrl right> \END Seek right for boundary between alphanumeric characters or camel case word and non-alphanumeric characters.
\ITEM \STYLE{code} <ctrl left> \END Seek left for boundary between alphanumeric characters or camel case word and non-alphanumeric characters.
\ITEM \STYLE{code} <return> \END Inserts a character and auto-indents the line on which the cursor sits.
\ITEM \STYLE{code} <shift return> \END Inserts a character and auto-indents the line on which the cursor sits.
\ITEM \STYLE{code} <}> \END Inserts a character and auto-indents the line on which the cursor sits.
\ITEM \STYLE{code} <)> \END Inserts a character and auto-indents the line on which the cursor sits.
\ITEM \STYLE{code} <]> \END Inserts a character and auto-indents the line on which the cursor sits.
\ITEM \STYLE{code} <;> \END Inserts a character and auto-indents the line on which the cursor sits.
\ITEM \STYLE{code} <#> \END Inserts a character and auto-indents the line on which the cursor sits.
\ITEM \STYLE{code} <tab> \END Iteratively tries completing the word to the left of the cursor with other words in open buffers that have the same prefix string.
\ITEM \STYLE{code} <ctrl tab> \END Auto-indents the range between the cursor and the mark.
\ITEM \STYLE{code} <shift tab> \END Auto-indents the line on which the cursor sits.
\ITEM \STYLE{code} <alt h> \END At the cursor, insert a '// HACK' comment, includes user name if it was specified in config.4coder.
\ITEM \STYLE{code} <alt r> \END At the cursor, insert a block comment.
\ITEM \STYLE{code} <alt t> \END At the cursor, insert a '// TODO' comment, includes user name if it was specified in config.4coder.
\ITEM \STYLE{code} <alt y> \END At the cursor, insert a '// NOTE' comment, includes user name if it was specified in config.4coder.
\ITEM \STYLE{code} <alt D> \END Queries user for string, lists all locations of strings that appear to define a type whose name matches the input string.
\ITEM \STYLE{code} <alt T> \END Reads a token or word under the cursor and lists all locations of strings that appear to define a type whose name matches it.
\ITEM \STYLE{code} <ctrl [> \END At the cursor, insert a '{' and '}' separated by a blank line.
\ITEM \STYLE{code} <ctrl {> \END At the cursor, insert a '{' and '};' separated by a blank line.
\ITEM \STYLE{code} <ctrl }> \END At the cursor, insert a '{' and '}break;' separated by a blank line.
\ITEM \STYLE{code} <alt [> \END Finds the scope enclosed by '{' '}' surrounding the cursor and puts the cursor and mark on the '{' and '}'.
\ITEM \STYLE{code} <alt ]> \END Finds the first scope started by '{' before the cursor and puts the cursor and mark on the '{' and '}'.
\ITEM \STYLE{code} <alt '> \END Finds the first scope started by '{' after the cursor and puts the cursor and mark on the '{' and '}'.
\ITEM \STYLE{code} <alt /> \END Wraps the code contained in the range between cursor and mark with a new curly brace scope.
\ITEM \STYLE{code} <alt -> \END Deletes the braces surrounding the currently selected scope. Leaves the contents within the scope.
\ITEM \STYLE{code} <alt j> \END If a scope is currently selected, and a statement or block statement is present below the current scope, the statement is moved into the scope.
\ITEM \STYLE{code} <alt i> \END Surround the range between the cursor and mark with an '#if 0' and an '#endif'
\ITEM \STYLE{code} <alt 1> \END Reads a filename from surrounding '"' characters and attempts to open the corresponding file.
\ITEM \STYLE{code} <alt 2> \END If the current file is a *.cpp or *.h, attempts to open the corresponding *.h or *.cpp file in the other view.
\ITEM \STYLE{code} <ctrl 0> \END At the cursor, insert a ' = {0};'.
\END
\END
\SECTION{default-lister-ui-map}
These commands apply in 'lister mode' such as when you open a file.
\LIST
\ITEM \STYLE{code} <any character> \END A lister mode command that dispatches to the lister's write character handler.
\ITEM \STYLE{code} <escape> \END A lister mode command that quits the list without executing any actions.
\ITEM \STYLE{code} <return> \END A lister mode command that activates the list's action on the highlighted item.
\ITEM \STYLE{code} <tab> \END A lister mode command that activates the list's action on the highlighted item.
\ITEM \STYLE{code} <backspace> \END A lister mode command that dispatches to the lister's backspace text field handler.
\ITEM \STYLE{code} <up> \END A lister mode command that dispatches to the lister's navigate up handler.
\ITEM \STYLE{code} <page up> \END A lister mode command that dispatches to the lister's navigate up handler.
\ITEM \STYLE{code} <down> \END A lister mode command that dispatches to the lister's navigate down handler.
\ITEM \STYLE{code} <page down> \END A lister mode command that dispatches to the lister's navigate down handler.
\ITEM \STYLE{code} <mouse wheel> \END A lister mode command that scrolls the list in response to the mouse wheel.
\ITEM \STYLE{code} <left click> \END A lister mode command that beings a click interaction with a list item under the mouse.
\ITEM \STYLE{code} <left release> \END A lister mode command that ends a click interaction with a list item under the mouse, possibly activating it.
\ITEM \STYLE{code} <mouse move> \END A lister mode command that updates the lists UI data.
\ITEM \STYLE{code} <animate> \END A lister mode command that updates the lists UI data.
\END
\END
\END
\SECTION{Map: mac-default}
\SECTION{mapid-global}
The following bindings apply in all situations.
\LIST
\ITEM \STYLE{code} <cmnd ,> \END Change the currently active panel, moving to the panel with the next highest view_id.
\ITEM \STYLE{code} <cmnd <> \END Change the currently active panel, moving to the panel with the next lowest view_id.
\ITEM \STYLE{code} <cmnd n> \END Interactively creates a new file.
\ITEM \STYLE{code} <cmnd o> \END Interactively open a file out of the file system.
\ITEM \STYLE{code} <ctrl o> \END Interactively opens a file in the other panel.
\ITEM \STYLE{code} <cmnd k> \END Interactively kill an open buffer.
\ITEM \STYLE{code} <cmnd i> \END Interactively switch to an open buffer.
\ITEM \STYLE{code} <cmnd h> \END Changes 4coder's hot directory to the root directory of the currently loaded project. With no loaded project nothing hapepns.
\ITEM \STYLE{code} <cmnd S> \END Saves all buffers marked dirty (showing the '*' indicator).
\ITEM \STYLE{code} <ctrl .> \END If the special build panel is open, makes the build panel the active panel.
\ITEM \STYLE{code} <ctrl ,> \END If the special build panel is open, closes it.
\ITEM \STYLE{code} <ctrl n> \END If a buffer containing jump locations has been locked in, goes to the next jump in the buffer, skipping sub jump locations.
\ITEM \STYLE{code} <ctrl N> \END If a buffer containing jump locations has been locked in, goes to the previous jump in the buffer, skipping sub jump locations.
\ITEM \STYLE{code} <ctrl M> \END If a buffer containing jump locations has been locked in, goes to the first jump in the buffer.
\ITEM \STYLE{code} <ctrl m> \END 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.
\ITEM \STYLE{code} <alt b> \END Toggles the visibility status of the current view's filebar.
\ITEM \STYLE{code} <ctrl z> \END Queries for an output buffer name and system command, runs the system command as a CLI and prints the output to the specified buffer.
\ITEM \STYLE{code} <ctrl Z> \END If the command execute_any_cli has already been used, this will execute a CLI reusing the most recent buffer name and command.
\ITEM \STYLE{code} <ctrl x> \END Opens an interactive list of all registered commands.
\ITEM \STYLE{code} <cmnd I> \END Creates a lister of locations that look like function definitions and declarations in the buffer.
\ITEM \STYLE{code} <ctrl E> \END Attempts to close 4coder.
\ITEM \STYLE{code} <f1> \END 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.
\ITEM \STYLE{code} <f2> \END 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.
\ITEM \STYLE{code} <f3> \END 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.
\ITEM \STYLE{code} <f4> \END 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.
\ITEM \STYLE{code} <f5> \END 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.
\ITEM \STYLE{code} <f6> \END 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.
\ITEM \STYLE{code} <f7> \END 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.
\ITEM \STYLE{code} <f8> \END 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.
\ITEM \STYLE{code} <f9> \END 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.
\ITEM \STYLE{code} <f10> \END 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.
\ITEM \STYLE{code} <f11> \END 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.
\ITEM \STYLE{code} <f12> \END 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.
\ITEM \STYLE{code} <f13> \END 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.
\ITEM \STYLE{code} <f14> \END 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.
\ITEM \STYLE{code} <f15> \END 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.
\ITEM \STYLE{code} <f16> \END 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.
\ITEM \STYLE{code} <mouse wheel> \END Reads the scroll wheel value from the mouse state and scrolls accordingly.
\END
\END
\SECTION{mapid-file}
The following bindings apply in general text files and most apply in code files, but some are overriden by other commands specific to code files.
\LIST
\ITEM \STYLE{code} <any character> \END Inserts whatever character was used to trigger this command.
\ITEM \STYLE{code} <alt any character> \END Inserts whatever character was used to trigger this command.
\ITEM \STYLE{code} <left click> \END Sets the cursor position and mark to the mouse position.
\ITEM \STYLE{code} <left release> \END Sets the cursor position to the mouse position.
\ITEM \STYLE{code} <mouse move> \END If the mouse left button is pressed, sets the cursor position to the mouse position.
\ITEM \STYLE{code} <delete> \END Deletes the character to the right of the cursor.
\ITEM \STYLE{code} <shift delete> \END Deletes the character to the right of the cursor.
\ITEM \STYLE{code} <backspace> \END Deletes the character to the left of the cursor.
\ITEM \STYLE{code} <shift backspace> \END Deletes the character to the left of the cursor.
\ITEM \STYLE{code} <up> \END Moves the cursor up one line.
\ITEM \STYLE{code} <down> \END Moves the cursor down one line.
\ITEM \STYLE{code} <left> \END Moves the cursor one character to the left.
\ITEM \STYLE{code} <right> \END Moves the cursor one character to the right.
\ITEM \STYLE{code} <shift up> \END Moves the cursor up one line.
\ITEM \STYLE{code} <shift down> \END Moves the cursor down one line.
\ITEM \STYLE{code} <shift left> \END Moves the cursor one character to the left.
\ITEM \STYLE{code} <shift right> \END Moves the cursor one character to the right.
\ITEM \STYLE{code} <end> \END Seeks the cursor to the end of the visual line.
\ITEM \STYLE{code} <home> \END Seeks the cursor to the beginning of the visual line.
\ITEM \STYLE{code} <ctrl page up> \END Sets the cursor to the beginning of the file.
\ITEM \STYLE{code} <ctrl page down> \END Sets the cursor to the end of the file.
\ITEM \STYLE{code} <page up> \END Scrolls the view up one view height and moves the cursor up one view height.
\ITEM \STYLE{code} <page down> \END Scrolls the view down one view height and moves the cursor down one view height.
\ITEM \STYLE{code} <shift end> \END Seeks the cursor to the end of the visual line.
\ITEM \STYLE{code} <shift home> \END Seeks the cursor to the beginning of the visual line.
\ITEM \STYLE{code} <ctrlshift page up> \END Sets the cursor to the beginning of the file.
\ITEM \STYLE{code} <ctrlshift page down> \END Sets the cursor to the end of the file.
\ITEM \STYLE{code} <shift page up> \END Scrolls the view up one view height and moves the cursor up one view height.
\ITEM \STYLE{code} <shift page down> \END Scrolls the view down one view height and moves the cursor down one view height.
\ITEM \STYLE{code} <cmnd up> \END Seeks the cursor up to the next blank line and places it at the end of the line.
\ITEM \STYLE{code} <cmnd down> \END Seeks the cursor down to the next blank line and places it at the end of the line.
\ITEM \STYLE{code} <cmnd right> \END Seek right for the next boundary between whitespace and non-whitespace.
\ITEM \STYLE{code} <cmnd left> \END Seek left for the next boundary between whitespace and non-whitespace.
\ITEM \STYLE{code} <cmndshift up> \END Seeks the cursor up to the next blank line and places it at the end of the line.
\ITEM \STYLE{code} <cmndshift down> \END Seeks the cursor down to the next blank line and places it at the end of the line.
\ITEM \STYLE{code} <cmndshift right> \END Seek right for the next boundary between whitespace and non-whitespace.
\ITEM \STYLE{code} <cmndshift left> \END Seek left for the next boundary between whitespace and non-whitespace.
\ITEM \STYLE{code} <alt up> \END Swaps the line under the cursor with the line above it, and moves the cursor up with it.
\ITEM \STYLE{code} <alt down> \END Swaps the line under the cursor with the line below it, and moves the cursor down with it.
\ITEM \STYLE{code} <cmnd backspace> \END Delete characters between the cursor position and the first alphanumeric boundary to the left.
\ITEM \STYLE{code} <cmnd delete> \END Delete characters between the cursor position and the first alphanumeric boundary to the right.
\ITEM \STYLE{code} <ctrl backspace> \END Delete a single, whole token on or to the left of the cursor and post it to the clipboard.
\ITEM \STYLE{code} <ctrl delete> \END Delete a single, whole token on or to the right of the cursor and post it to the clipboard.
\ITEM \STYLE{code} <cmnd /> \END Sets the mark to the current position of the cursor.
\ITEM \STYLE{code} <cmnd a> \END Queries the user for two strings, and replaces all occurences of the first string in the range between the cursor and the mark with the second string.
\ITEM \STYLE{code} <cmnd c> \END Copy the text in the range from the cursor to the mark onto the clipboard.
\ITEM \STYLE{code} <cmnd d> \END Deletes the text in the range between the cursor and the mark.
\ITEM \STYLE{code} <cmnd D> \END Delete the line the on which the cursor sits.
\ITEM \STYLE{code} <cmnd e> \END Centers the view vertically on the line on which the cursor sits.
\ITEM \STYLE{code} <cmnd E> \END Sets the left size of the view near the x position of the cursor.
\ITEM \STYLE{code} <cmnd f> \END Begins an incremental search down through the current buffer for a user specified string.
\ITEM \STYLE{code} <cmnd F> \END Queries the user for a string and lists all exact case-sensitive matches found in all open buffers.
\ITEM \STYLE{code} <ctrl F> \END Queries the user for a string and lists all case-insensitive substring matches found in all open buffers.
\ITEM \STYLE{code} <cmnd g> \END Queries the user for a number, and jumps the cursor to the corresponding line.
\ITEM \STYLE{code} <cmnd G> \END Reads the string in the selected range and lists all exact case-sensitive mathces in all open buffers.
\ITEM \STYLE{code} <cmnd K> \END Kills the current buffer.
\ITEM \STYLE{code} <cmnd L> \END Create a copy of the line on which the cursor sits.
\ITEM \STYLE{code} <cmnd m> \END Swaps the position of the cursor and the mark.
\ITEM \STYLE{code} <cmnd O> \END Reopen the current buffer from the hard drive.
\ITEM \STYLE{code} <cmnd q> \END Queries the user for two strings, and incrementally replaces every occurence of the first string with the second string.
\ITEM \STYLE{code} <cmnd Q> \END Queries the user for a string, and incrementally replace every occurence of the word or token found at the cursor with the specified string.
\ITEM \STYLE{code} <cmnd r> \END Begins an incremental search up through the current buffer for a user specified string.
\ITEM \STYLE{code} <cmnd s> \END Saves the current buffer.
\ITEM \STYLE{code} <cmnd t> \END Begins an incremental search down through the current buffer for the word or token under the cursor.
\ITEM \STYLE{code} <cmnd T> \END Reads a token or word under the cursor and lists all exact case-sensitive mathces in all open buffers.
\ITEM \STYLE{code} <cmnd v> \END Paste from the top of clipboard and run auto-indent on the newly pasted text.
\ITEM \STYLE{code} <cmnd V> \END Paste the next item on the clipboard and run auto-indent on the newly pasted text.
\ITEM \STYLE{code} <cmnd x> \END Cut the text in the range from the cursor to the mark onto the clipboard.
\ITEM \STYLE{code} <cmnd y> \END Advances forewards through the undo history.
\ITEM \STYLE{code} <cmnd z> \END Advances backwards through the undo history.
\ITEM \STYLE{code} <cmnd 1> \END Set the other non-active panel to view the buffer that the active panel views, and switch to that panel.
\ITEM \STYLE{code} <cmnd 2> \END Set the other non-active panel to view the buffer that the active panel views, and switch to that panel.
\ITEM \STYLE{code} <return> \END If the buffer in the active view is writable, inserts a character, otherwise performs goto_jump_at_cursor.
\ITEM \STYLE{code} <shift return> \END If the buffer in the active view is writable, inserts a character, otherwise performs goto_jump_at_cursor_same_panel.
\ITEM \STYLE{code} <cmnd >> \END When executed on a buffer with jumps, creates a persistent lister for all the jumps
\ITEM \STYLE{code} <shift space> \END Inserts whatever character was used to trigger this command.
\END
\END
\SECTION{default-code-map}
The following commands only apply in files where the lexer (syntax highlighting) is turned on.
\LIST
\ITEM \STYLE{code} <cmnd right> \END Seek right for boundary between alphanumeric characters or camel case word and non-alphanumeric characters.
\ITEM \STYLE{code} <cmnd left> \END Seek left for boundary between alphanumeric characters or camel case word and non-alphanumeric characters.
\ITEM \STYLE{code} <return> \END Inserts a character and auto-indents the line on which the cursor sits.
\ITEM \STYLE{code} <shift return> \END Inserts a character and auto-indents the line on which the cursor sits.
\ITEM \STYLE{code} <}> \END Inserts a character and auto-indents the line on which the cursor sits.
\ITEM \STYLE{code} <)> \END Inserts a character and auto-indents the line on which the cursor sits.
\ITEM \STYLE{code} <]> \END Inserts a character and auto-indents the line on which the cursor sits.
\ITEM \STYLE{code} <;> \END Inserts a character and auto-indents the line on which the cursor sits.
\ITEM \STYLE{code} <#> \END Inserts a character and auto-indents the line on which the cursor sits.
\ITEM \STYLE{code} <tab> \END Iteratively tries completing the word to the left of the cursor with other words in open buffers that have the same prefix string.
\ITEM \STYLE{code} <cmnd tab> \END Auto-indents the range between the cursor and the mark.
\ITEM \STYLE{code} <shift tab> \END Auto-indents the line on which the cursor sits.
\ITEM \STYLE{code} <ctrl h> \END At the cursor, insert a '// HACK' comment, includes user name if it was specified in config.4coder.
\ITEM \STYLE{code} <ctrl r> \END At the cursor, insert a block comment.
\ITEM \STYLE{code} <ctrl t> \END At the cursor, insert a '// TODO' comment, includes user name if it was specified in config.4coder.
\ITEM \STYLE{code} <ctrl y> \END At the cursor, insert a '// NOTE' comment, includes user name if it was specified in config.4coder.
\ITEM \STYLE{code} <ctrl D> \END Queries user for string, lists all locations of strings that appear to define a type whose name matches the input string.
\ITEM \STYLE{code} <ctrl T> \END Reads a token or word under the cursor and lists all locations of strings that appear to define a type whose name matches it.
\ITEM \STYLE{code} <cmnd [> \END At the cursor, insert a '{' and '}' separated by a blank line.
\ITEM \STYLE{code} <cmnd {> \END At the cursor, insert a '{' and '};' separated by a blank line.
\ITEM \STYLE{code} <cmnd }> \END At the cursor, insert a '{' and '}break;' separated by a blank line.
\ITEM \STYLE{code} <ctrl [> \END Finds the scope enclosed by '{' '}' surrounding the cursor and puts the cursor and mark on the '{' and '}'.
\ITEM \STYLE{code} <ctrl ]> \END Finds the first scope started by '{' before the cursor and puts the cursor and mark on the '{' and '}'.
\ITEM \STYLE{code} <ctrl '> \END Finds the first scope started by '{' after the cursor and puts the cursor and mark on the '{' and '}'.
\ITEM \STYLE{code} <ctrl /> \END Wraps the code contained in the range between cursor and mark with a new curly brace scope.
\ITEM \STYLE{code} <ctrl -> \END Deletes the braces surrounding the currently selected scope. Leaves the contents within the scope.
\ITEM \STYLE{code} <ctrl j> \END If a scope is currently selected, and a statement or block statement is present below the current scope, the statement is moved into the scope.
\ITEM \STYLE{code} <ctrl i> \END Surround the range between the cursor and mark with an '#if 0' and an '#endif'
\ITEM \STYLE{code} <ctrl 1> \END Reads a filename from surrounding '"' characters and attempts to open the corresponding file.
\ITEM \STYLE{code} <ctrl 2> \END If the current file is a *.cpp or *.h, attempts to open the corresponding *.h or *.cpp file in the other view.
\ITEM \STYLE{code} <cmnd 0> \END At the cursor, insert a ' = {0};'.
\END
\END
\SECTION{default-lister-ui-map}
These commands apply in 'lister mode' such as when you open a file.
\LIST
\ITEM \STYLE{code} <any character> \END A lister mode command that dispatches to the lister's write character handler.
\ITEM \STYLE{code} <escape> \END A lister mode command that quits the list without executing any actions.
\ITEM \STYLE{code} <return> \END A lister mode command that activates the list's action on the highlighted item.
\ITEM \STYLE{code} <tab> \END A lister mode command that activates the list's action on the highlighted item.
\ITEM \STYLE{code} <backspace> \END A lister mode command that dispatches to the lister's backspace text field handler.
\ITEM \STYLE{code} <up> \END A lister mode command that dispatches to the lister's navigate up handler.
\ITEM \STYLE{code} <page up> \END A lister mode command that dispatches to the lister's navigate up handler.
\ITEM \STYLE{code} <down> \END A lister mode command that dispatches to the lister's navigate down handler.
\ITEM \STYLE{code} <page down> \END A lister mode command that dispatches to the lister's navigate down handler.
\ITEM \STYLE{code} <mouse wheel> \END A lister mode command that scrolls the list in response to the mouse wheel.
\ITEM \STYLE{code} <left click> \END A lister mode command that beings a click interaction with a list item under the mouse.
\ITEM \STYLE{code} <left release> \END A lister mode command that ends a click interaction with a list item under the mouse, possibly activating it.
\ITEM \STYLE{code} <mouse move> \END A lister mode command that updates the lists UI data.
\ITEM \STYLE{code} <animate> \END A lister mode command that updates the lists UI data.
\END
\END
\END

View File

@ -3,15 +3,12 @@
{
Features
{
[] Performance of lots of highlighted rectangles on screen is pooooooooor, fix it.
[] Reload all out of sync files
[] Jump to Command Definition (useful for 4coder customization developers only)
[] Cleanup names in Marker_Visuals API
[] Declarative system for keyword direct coloring
}
Bugs
{
[] Before '.' name matches don't sort to the top like they're supposed to.
Repro Needed
{
}
@ -23,7 +20,78 @@
Documentation
{
[] ALL
[x] buffer_get_managed_scope
[x] view_get_managed_scope
[x] view_start_ui_mode
[x] view_end_ui_mode
[x] view_set_ui
[x] view_get_ui_copy
[x] create_user_managed_scope
[x] destroy_user_managed_scope
[x] get_global_managed_scope
[x] get_managed_scope_with_multiple_dependencies
[x] managed_scope_clear_contents
[x] clear_managed_scope_and_all_dependent_scopes
[x] managed_variable_create
[x] managed_variable_get_id
[x] managed_variable_create_or_get_id
[x] managed_variable_set
[x] managed_variable_get
[x] alloc_managed_memory_in_scope
[x] alloc_buffer_markers_on_buffer
[x] create_marker_visuals
[x] marker_visuals_set_look
[x] marker_visuals_set_take_rule
[x] marker_visuals_set_priority
[x] marker_visuals_set_view_key
[] destroy_marker_visuals
[] buffer_markers_get_attached_visuals_count
[] buffer_markers_get_attached_visuals
[] managed_object_get_item_size
[] managed_object_get_item_count
[] managed_object_get_type
[] managed_object_get_containing_scope
[] managed_object_free
[] managed_object_store_data
[] managed_object_load_data
[] get_theme_count
[] get_theme_name
[] change_theme_by_index
[] Buffer_Kill_Result
[] Range_Array
[] Managed_Object_Type
[] Managed_Scope
[] Managed_Variable_ID
[] Managed_Object
[] Marker_Visuals
[] Marker_Visuals_Type
[] Marker_Visuals_Symbolic_Color
[] Marker_Visuals_Text_Style
[] Marker_Visuals_Take_Rule
[] Marker_Visuals_Priority_Level
[] UI_Item_Type
[] UI_Activation_Level
[] UI_Coordinate_System
[] UI_Item
[] UI_Item_Node
[] UI_List
[] UI_Control
[] Buffer_Name_Conflict_Entry
[] string_interpret_escapes
}
}
[] Build 4.0.30
{
Features
{
[] Reload all out of sync files
[] Jump to Command Definition (useful for 4coder customization developers only)
}
Bugs
{
[] Texture binding changes too often problem.
}
}
@ -115,6 +183,8 @@ Change Log
[x] Colors pulled from color pallette
}
}
[x] Cleanup names in Marker_Visuals API
}
}