4coder Jamm 2

master
Allen Webster 2019-02-25 15:42:13 -08:00
parent 410b90d44c
commit 1428fc822f
40 changed files with 1557 additions and 1154 deletions

View File

@ -18,7 +18,7 @@
#include "4coder_lib/4cpp_lexer_types.h"
#include "4coder_API/4coder_version.h"
#include "4coder_API/4coder_keycodes.h"
#include "4coder_API/4coder_style.h"
#include "4coder_API/4coder_default_colors.h"
#include "4coder_API/4coder_types.h"
#include "4coder_generated/app_functions.h"

View File

@ -0,0 +1,58 @@
/*
* Colors with meanings built into the core.
*/
// TOP
enum Style_Tag{
Stag_NOOP = 0,
Stag_Bar = 1,
Stag_Bar_Active = 2,
Stag_Base = 3,
Stag_Pop1 = 4,
Stag_Pop2 = 5,
Stag_Back = 6,
Stag_Margin = 7,
Stag_Margin_Hover = 8,
Stag_Margin_Active = 9,
Stag_List_Item = 10,
Stag_List_Item_Hover = 11,
Stag_List_Item_Active = 12,
Stag_Cursor = 13,
Stag_At_Cursor = 14,
Stag_Highlight_Cursor_Line = 15,
Stag_Highlight = 16,
Stag_At_Highlight = 17,
Stag_Mark = 18,
Stag_Default = 19,
Stag_Comment = 20,
Stag_Keyword = 21,
Stag_Str_Constant = 22,
Stag_Char_Constant = 23,
Stag_Int_Constant = 24,
Stag_Float_Constant = 25,
Stag_Bool_Constant = 26,
Stag_Preproc = 27,
Stag_Include = 28,
Stag_Special_Character = 29,
Stag_Ghost_Character = 30,
Stag_Highlight_Junk = 31,
Stag_Highlight_White = 32,
Stag_Paste = 33,
Stag_Undo = 34,
Stag_Back_Cycle_1 = 35,
Stag_Back_Cycle_2 = 36,
Stag_Back_Cycle_3 = 37,
Stag_Back_Cycle_4 = 38,
Stag_Text_Cycle_1 = 39,
Stag_Text_Cycle_2 = 40,
Stag_Text_Cycle_3 = 41,
Stag_Text_Cycle_4 = 42,
Stag_COUNT = 43
};
#define FirstCustomColor Stag_COUNT
// BOTTOM

View File

@ -1,92 +0,0 @@
enum Style_Tag{
Stag_Bar = 0,
Stag_Bar_Active = 1,
Stag_Base = 2,
Stag_Pop1 = 3,
Stag_Pop2 = 4,
Stag_Back = 5,
Stag_Margin = 6,
Stag_Margin_Hover = 7,
Stag_Margin_Active = 8,
Stag_List_Item = 9,
Stag_List_Item_Hover = 10,
Stag_List_Item_Active = 11,
Stag_Cursor = 12,
Stag_At_Cursor = 13,
Stag_Highlight_Cursor_Line = 14,
Stag_Highlight = 15,
Stag_At_Highlight = 16,
Stag_Mark = 17,
Stag_Default = 18,
Stag_Comment = 19,
Stag_Keyword = 20,
Stag_Str_Constant = 21,
Stag_Char_Constant = 22,
Stag_Int_Constant = 23,
Stag_Float_Constant = 24,
Stag_Bool_Constant = 25,
Stag_Preproc = 26,
Stag_Include = 27,
Stag_Special_Character = 28,
Stag_Ghost_Character = 29,
Stag_Highlight_Junk = 30,
Stag_Highlight_White = 31,
Stag_Paste = 32,
Stag_Undo = 33,
Stag_Next_Undo = 34,
Stag_Back_Cycle_1 = 35,
Stag_Back_Cycle_2 = 36,
Stag_Back_Cycle_3 = 37,
Stag_Back_Cycle_4 = 38,
Stag_Text_Cycle_1 = 39,
Stag_Text_Cycle_2 = 40,
Stag_Text_Cycle_3 = 41,
Stag_Text_Cycle_4 = 42,
Stag_COUNT = 43
};
static char *style_tag_names[] = {
"Bar",
"Bar_Active",
"Base",
"Pop1",
"Pop2",
"Back",
"Margin",
"Margin_Hover",
"Margin_Active",
"List_Item",
"List_Item_Hover",
"List_Item_Active",
"Cursor",
"At_Cursor",
"Highlight_Cursor_Line",
"Highlight",
"At_Highlight",
"Mark",
"Default",
"Comment",
"Keyword",
"Str_Constant",
"Char_Constant",
"Int_Constant",
"Float_Constant",
"Bool_Constant",
"Preproc",
"Include",
"Special_Character",
"Ghost_Character",
"Highlight_Junk",
"Highlight_White",
"Paste",
"Undo",
"Next_Undo",
"Back_Cycle_1",
"Back_Cycle_2",
"Back_Cycle_3",
"Back_Cycle_4",
"Text_Cycle_1",
"Text_Cycle_2",
"Text_Cycle_3",
"Text_Cycle_4",
};

View File

@ -16,8 +16,13 @@
/* DOC(bool32 is an alias name to signal that an integer parameter or field is for true/false values.) */
TYPEDEF int32_t bool32;
/* DOC(int_color is an alias name to signal that an integer parameter or field is for a color value, colors are specified as 32 bit integers with 4 channels: 0xAARRGGBB. In some APIs if the alpha channel is zero, then the integer is a symbolic color with a special interpretation.) */
TYPEDEF uint32_t int_color;
/* DOC(argb_color is an alias name to signal that an integer parameter or field is for a color value,
colors are specified as 32 bit integers with 4 channels: 0xAARRGGBB.) */
TYPEDEF u32 argb_color;
TYPEDEF u32 int_color;
TYPEDEF u16 id_color;
/* DOC(Parse_Context_ID identifies a parse context, which is a guiding rule for the parser. Each buffer sets which parse context to use when it is parsed.) */
TYPEDEF uint32_t Parse_Context_ID;
@ -228,16 +233,25 @@ ENUM(uint32_t, Access_Flag){
AccessAll = 0xFF
};
/* DOC(A Dirty_State value describes whether changes have been made to a buffer or to an underlying file since the last sync time between the two. Saving a buffer to it's file or loading the buffer from the file both act as sync points.) */
/* DOC(A Dirty_State value describes whether changes have been made to a buffer or to an underlying
file since the last sync time between the two. Saving a buffer to it's file or loading the buffer
from the file both act as sync points.) */
ENUM(uint32_t, Dirty_State){
/* DOC(DirtyState_UpToDate indicates that there are no unsaved changes and the underlying system file still agrees with the buffer's state.) */
/* DOC(DirtyState_UpToDate indicates that there are no unsaved changes and the underlying
system file still agrees with the buffer's state.) */
DirtyState_UpToDate = 0,
/* DOC(DirtyState_UnsavedChanges indicates that there have been changes in the buffer since the last sync point.) */
/* DOC(DirtyState_UnsavedChanges indicates that there have been changes in the buffer since
the last sync point.) */
DirtyState_UnsavedChanges = 1,
/* DOC(DirtyState_UnsavedChanges indicates that the underlying file has been edited since the last sync point with the buffer.) */
DirtyState_UnloadedChanges = 2
/* DOC(DirtyState_UnsavedChanges indicates that the underlying file has been edited since
the last sync point .) */
DirtyState_UnloadedChanges = 2,
/* DOC(DirtyState_UnsavedChanges indicates that there have been changes in the buffer since
the last sync point and that the underlying file ahs been edited since the last sync point.) */
DirtyState_UnsavedChangesAndUnloadedChanges = 3,
};
/* DOC(A Seek_Boundary_Flag field specifies a set of "boundary" types used in seeks for the beginning or end of different types of words.) */
@ -389,14 +403,18 @@ STRUCT Mouse_State{
int8_t out_of_window;
/* DOC(The motion of the wheel. Zero indicates no motion. Positive indicates downard scrolling. Negative indicates upward scrolling. The magnitude corresponds to the number of pixels of scroll that would be applied at standard scroll speeds.) */
int32_t wheel;
/* DOC(X position of the mouse where the left of the window is x = 0, and x grows to the right.) */
int32_t x;
/* DOC(Y position of the mouse where the top of the window is y = 0, and y grows to downward.) */
int32_t y;
UNION{
STRUCT{
/* DOC(X position of the mouse where the left of the window is x = 0, and x grows to the right.) */
int32_t x;
/* DOC(Y position of the mouse where the top of the window is y = 0, and y grows to downward.) */
int32_t y;
};
/* DOC(TODO) */
Vec2_i32 p;
};
};
GLOBAL_VAR Mouse_State null_mouse_state = {};
/* DOC(Range describes an integer range typically used for ranges within a buffer. Ranges are not used to pass into the API, but this struct is used for returns.
Throughout the API ranges are thought of in the form [min,max) where max is "one past the end" of the range that is actually read/edited/modified.) */
@ -480,14 +498,26 @@ STRUCT Buffer_Identifier{
/* DOC(Describes the various coordinate locations associated with the view's scroll position within it's buffer.) */
STRUCT GUI_Scroll_Vars{
/* DOC(The current actual y position of the view scroll.) */
float scroll_y;
/* DOC(The target y position to which the view is moving. If scroll_y is not the same value, then it is still sliding to the target by the smooth scroll rule.) */
int32_t target_y;
/* DOC(The current actual x position of the view scroll.) */
float scroll_x;
/* DOC(The target x position to which the view is moving. If scroll_x is not the same value, then it is still sliding to the target by the smooth scroll rule.) */
int32_t target_x;
UNION{
STRUCT{
/* DOC(The current actual x position of the view scroll.) */
f32 scroll_x;
/* DOC(The current actual y position of the view scroll.) */
f32 scroll_y;
};
/* DOC(TODO) */
Vec2 scroll_p;
};
UNION{
STRUCT{
/* DOC(The target x position to which the view is moving. If scroll_x is not the same value, then it is still sliding to the target by the smooth scroll rule.) */
i32 target_x;
/* DOC(The target y position to which the view is moving. If scroll_y is not the same value, then it is still sliding to the target by the smooth scroll rule.) */
i32 target_y;
};
/* DOC(TODO) */
Vec2_i32 target_p;
};
};
/* DOC(The Buffer_Seek_Type is is used in a Buffer_Seek to identify which coordinates are suppose to be used for the seek.)
@ -767,12 +797,9 @@ ENUM(uint32_t, Marker_Visual_Symbolic_Color)
{
/* DOC(When default is used for text_color aspect, the text is unchanged from the coloring the core would apply to it. For all effects, the default value of the color aspect for all effects is the same as transparent. For convenience it is guaranteed this will always be the zero value, so that users may simply pass 0 to color aspects they do not wish to set.) */
SymbolicColor_Default = 0,
/* DOC(Since all symbolic color codes have their alpha channel set to zero, this code is reserved to get the effect one would get for using a tranparent 32-bit color.) */
SymbolicColor_Transparent = 1,
/* DOC(This flag bit-ored with a style tag will be reevaluated at render time to the color of the specific tag in the currently active palette. The macro SymbolicColorFromPalette(Stag_CODE) applies the bit-or to Stag_CODE. For example SymbolicColorFromPalette(Stag_Cursor) will always evaluate to the color of the current cursor. Note that this evaluation happens at render time, so that if the palette changes, the evaluated color will also change.) */
SymbolicColor__StagColorFlag = 0x00800000,
};
#define SymbolicColorFromPalette(x) ((x)|SymbolicColor__StagColorFlag)
/* DOC(Not implemented, but reserved for future use. Where this type is used in the API the value passed should always be zero for now.) */
ENUM(int32_t, Marker_Visual_Text_Style)
@ -836,10 +863,10 @@ ENUM(int8_t, UI_Activation_Level){
/* DOC(An enumeration of the coordinate systems in which an item's rectangle can be specified. This is not always a convenience feature as it means after scrolling the widget data does not necessarily needed to be updated, thus saving extra work. All coordiante systems are in pixels, with y increasing downward, and x increasing rightward.) */
ENUM(int8_t, UI_Coordinate_System){
/* DOC(The 'scrolled' coordiante system is effected by the scroll value of the view. If the y scroll value is at 100 and an item is placed with a vertical range from 50 to 90, the item is not visible. When the y scroll value is at 0, this coordinate system aligns with the view relative coordiante system.) */
UICoordinates_Scrolled = 0,
/* DOC(The 'view relative' coordiante system is only effected by the screen coordinates of the view. (0,0) is always the top left corner of space inside the view margin.) */
UICoordinates_ViewRelative = 1,
/* DOC(The 'view' coordiante system is effected by the scroll value of the view. If the y scroll value is at 100 and an item is placed with a vertical range from 50 to 90, the item is not visible. When the scroll value is at (0,0), this coordinate system aligns with the view relative coordiante system.) */
UICoordinates_ViewSpace = 0,
/* DOC(The 'panel' coordiante system is only effected by the screen coordinates of the panel. (0,0) is always the top left corner of space inside the panel margin.) */
UICoordinates_PanelSpace = 1,
UICoordinates_COUNT = 2,
};
@ -913,19 +940,19 @@ DOC_SEE(int_color)
*/
STRUCT Theme_Color{
/* DOC(The style slot in the style palette.) */
int32_t tag;
id_color tag;
/* DOC(The color in the slot.) */
int_color color;
argb_color color;
};
/*
DOC(Theme lists every color that makes up a standard color scheme.)
DOC_SEE(int_color)
*/
STRUCT Theme{
/* DOC(The colors array. Every style tag, beginning with "Stag", is an index into it's corresponding color in the array.) */
int_color colors[Stag_COUNT];
};
//STRUCT Theme{
/* DOC(The colors array. Every style tag, beginning with "Stag", is an index into it's corresponding color in the array.) */
//int_color colors[Stag_COUNT];
//};
/*
DOC(Available_Font contains a name for a font was detected at startup either in the local 4coder font folder, or by the system. An available font is not necessarily loaded yet, and may fail to load for various reasons even though it appearsin the available font list.)
@ -1134,15 +1161,18 @@ ENUM(int32_t, Special_Hook_ID){
special_hook_start,
/* DOC(TODO) */
special_hook_buffer_name_resolver,
/* DOC(TODO) */
special_hook_modify_color_table,
};
TYPEDEF_FUNC int32_t Command_Caller_Hook_Function(struct Application_Links *app, Generic_Command cmd);
#define COMMAND_CALLER_HOOK(name) int32_t name(struct Application_Links *app, Generic_Command cmd)
TYPEDEF_FUNC void Render_Callback(struct Application_Links *app);
TYPEDEF_FUNC void Render_Caller_Function(struct Application_Links *app, View_ID view_id, Range on_screen_range, Render_Callback *do_core_render);
TYPEDEF_FUNC void Render_Caller_Function(struct Application_Links *app, View_ID view_id, Range on_screen_range, i32 frame_index, f32 literal_dt, f32 animation_dt, Render_Callback *do_core_render);
#define RENDER_CALLER_SIG(name) \
void name(struct Application_Links *app, View_ID view_id, Range on_screen_range, Render_Callback *do_core_render)
void name(struct Application_Links *app, View_ID view_id, Range on_screen_range, \
i32 frame_index, f32 literal_dt, f32 animation_dt, Render_Callback *do_core_render)
TYPEDEF_FUNC int32_t Hook_Function(struct Application_Links *app);
#define HOOK_SIG(name) int32_t name(struct Application_Links *app)
@ -1160,6 +1190,14 @@ TYPEDEF_FUNC int32_t Scroll_Rule_Function(float target_x, float target_y, float
#define SCROLL_RULE_SIG(name) \
int32_t name(float target_x, float target_y, float *scroll_x, float *scroll_y, int32_t view_id, int32_t is_new_target, float dt)
STRUCT Color_Table{
argb_color *vals;
u32 count;
};
TYPEDEF_FUNC Color_Table Modify_Color_Table_Function(struct Application_Links *app, i32 frame_index, f32 literal_dt, f32 animation_dt);
#define MODIFY_COLOR_TABLE_SIG(name) Color_Table name(struct Application_Links *app, i32 frame_index, f32 literal_dt, f32 animation_dt)
STRUCT Buffer_Name_Conflict_Entry{
Buffer_ID buffer_id;
char *file_name;
@ -1197,9 +1235,7 @@ ENUM(int32_t, Binding_Unit_Type){
unit_hook
};
/*
DOC(Values for built in command maps.)
*/
/* DOC(Values for built in command maps.) */
ENUM(int32_t, Map_ID){
mapid_global = (1 << 24),
mapid_file,
@ -1209,8 +1245,7 @@ ENUM(int32_t, Map_ID){
/*
DOC(Describes a unit of information for setting up key bindings. A unit can set a key binding, switch the active map, set the inherited map, or set a hook.)
*/
DOC(Describes a unit of information for setting up key bindings. A unit can set a key binding, switch the active map, set the inherited map, or set a hook.) */
STRUCT Binding_Unit{
Binding_Unit_Type type;
UNION{
@ -1225,15 +1260,13 @@ STRUCT Binding_Unit{
typedef int32_t _Get_Version_Function(int32_t maj, int32_t min, int32_t patch);
#define _GET_VERSION_SIG(n) int32_t n(int32_t maj, int32_t min, int32_t patch)
STRUCT color_picker
{
STRUCT color_picker{
String title;
int_color *dest;
argb_color *dest;
bool32 *finished;
};
enum Found_String_Flag
{
enum Found_String_Flag{
FoundString_Sensitive = 0x1,
FoundString_Insensitive = 0x2,
FoundString_CleanEdges = 0x4,
@ -1241,8 +1274,7 @@ enum Found_String_Flag
FoundString_Straddled = 0x10,
};
STRUCT Found_String
{
STRUCT Found_String{
Found_String *next;
Buffer_ID buffer_id;
@ -1254,8 +1286,7 @@ STRUCT Found_String
};
// TODO(casey): If this sticks around, there should be a way to export add/remove/merge as inlines that are shared
STRUCT Found_String_List
{
STRUCT Found_String_List{
Found_String *first;
Found_String *last;
int32_t count;

View File

@ -533,6 +533,7 @@ print_message(Application_Links *app, char *str, int32_t len){
print_message(app, make_string(str, len));
}
#if 0
static void
create_theme(Application_Links *app, Theme *theme, char *name, int32_t len){
create_theme(app, theme, make_string(name, len));
@ -542,6 +543,7 @@ static void
change_theme(Application_Links *app, char *name, int32_t len){
change_theme(app, make_string(name, len));
}
#endif
static int32_t
directory_get_hot(Application_Links *app, char *out, int32_t capacity){

View File

@ -51,7 +51,8 @@ buffer_find_hard_start(Application_Links *app, Buffer_Summary *buffer, int32_t l
static Buffer_Batch_Edit
make_batch_from_indent_marks(Application_Links *app, Partition *arena, Buffer_Summary *buffer,
int32_t first_line, int32_t one_past_last_line, int32_t *indent_marks, Indent_Options opts){
int32_t first_line, int32_t one_past_last_line, int32_t *indent_marks,
Indent_Options opts){
int32_t *shifted_indent_marks = indent_marks - first_line;
int32_t edit_count = 0;
@ -125,8 +126,7 @@ set_line_indents(Application_Links *app, Partition *part, Buffer_Summary *buffer
first_line, one_past_last_line,
indent_marks, opts);
if (batch.edit_count > 0){
buffer_batch_edit(app, buffer,
batch.str, batch.str_len, batch.edits, batch.edit_count,
buffer_batch_edit(app, buffer, batch.str, batch.str_len, batch.edits, batch.edit_count,
BatchEdit_PreserveTokens);
}
}
@ -161,7 +161,6 @@ seek_matching_token_backwards(Cpp_Token_Array tokens, Cpp_Token *token,
static Indent_Anchor_Position
find_anchor_token(Application_Links *app, Buffer_Summary *buffer, Cpp_Token_Array tokens,
int32_t line_start, int32_t tab_width){
#if 1
// NOTE(allen): New implementation of find_anchor_token (4.0.26) revert if it is a problem.
Indent_Anchor_Position anchor = {};
@ -238,105 +237,6 @@ find_anchor_token(Application_Links *app, Buffer_Summary *buffer, Cpp_Token_Arra
}
}
return(anchor);
#else
// NOTE(allen): Old (4.0.25) implementation of find_anchor_token.
Indent_Anchor_Position anchor = {};
if (tokens.count != 0){
anchor.token = get_first_token_at_line(app, buffer, tokens, line_start);
if (anchor.token == 0){
anchor.token = tokens.tokens + (tokens.count - 1);
}
if (anchor.token > tokens.tokens){
--anchor.token;
for (; anchor.token > tokens.tokens; --anchor.token){
if (!(anchor.token->flags & CPP_TFLAG_PP_BODY)){
switch(anchor.token->type){
case CPP_TOKEN_BRACE_OPEN:
case CPP_TOKEN_BRACE_CLOSE:
goto out_of_loop;
}
}
}
out_of_loop:;
}
int32_t current_indent = 0;
int32_t found_safe_start_position = 0;
do{
int32_t line = buffer_get_line_number(app, buffer, anchor.token->start);
int32_t start = buffer_get_line_start(app, buffer, line);
Hard_Start_Result hard_start = buffer_find_hard_start(app, buffer, start, tab_width);
current_indent = hard_start.indent_pos;
Cpp_Token *start_token = get_first_token_at_line(app, buffer, tokens, line);
Cpp_Token *brace_token = anchor.token;
if (start_token->type == CPP_TOKEN_PARENTHESE_OPEN){
if (start_token == tokens.tokens){
found_safe_start_position = true;
}
else{
anchor.token = start_token - 1;
}
}
else{
int32_t close = 0;
for (anchor.token = brace_token;
anchor.token > start_token;
--anchor.token){
switch (anchor.token->type){
case CPP_TOKEN_PARENTHESE_CLOSE:
case CPP_TOKEN_BRACKET_CLOSE:
case CPP_TOKEN_BRACE_CLOSE:
{
close = anchor.token->type;
}goto out_of_loop2;
}
}
out_of_loop2:;
Cpp_Token_Type open_type = CPP_TOKEN_JUNK;
Cpp_Token_Type close_type = CPP_TOKEN_JUNK;
switch (close){
case 0:
{
anchor.token = start_token;
found_safe_start_position = true;
}break;
case CPP_TOKEN_PARENTHESE_CLOSE:
{
open_type = CPP_TOKEN_PARENTHESE_OPEN;
close_type = CPP_TOKEN_PARENTHESE_CLOSE;
}break;
case CPP_TOKEN_BRACKET_CLOSE:
{
open_type = CPP_TOKEN_BRACKET_OPEN;
close_type = CPP_TOKEN_BRACKET_CLOSE;
}break;
case CPP_TOKEN_BRACE_CLOSE:
{
open_type = CPP_TOKEN_BRACE_OPEN;
close_type = CPP_TOKEN_BRACE_CLOSE;
}break;
}
if (open_type != CPP_TOKEN_JUNK){
anchor.token = seek_matching_token_backwards(tokens, anchor.token - 1, open_type, close_type);
}
}
} while(found_safe_start_position == 0);
anchor.indentation = current_indent;
}
return(anchor);
#endif
}
static int32_t*
@ -452,9 +352,16 @@ get_indentation_marks(Application_Links *app, Partition *arena, Buffer_Summary *
}
else{
switch (token.type){
case CPP_TOKEN_BRACKET_CLOSE: this_indent -= tab_width; break;
case CPP_TOKEN_BRACE_CLOSE: this_indent -= tab_width; break;
case CPP_TOKEN_BRACE_OPEN: break;
case CPP_TOKEN_BRACKET_CLOSE:
{
this_indent -= tab_width;
}break;
case CPP_TOKEN_BRACE_CLOSE:
{
this_indent -= tab_width;
}break;
case CPP_TOKEN_BRACE_OPEN:
{}break;
default:
if (indent.current_indent > 0){
@ -507,14 +414,16 @@ get_indentation_marks(Application_Links *app, Partition *arena, Buffer_Summary *
}
}
}
if (this_indent < 0) this_indent = 0;
if (this_indent < 0){
this_indent = 0;
}
}
if (indent.paren_nesting > 0){
if (prev_token.type != CPP_TOKEN_PARENTHESE_OPEN){
int32_t level = indent.paren_nesting-1;
int32_t level = indent.paren_nesting - 1;
if (level >= ArrayCount(indent.paren_anchor_indent)){
level = ArrayCount(indent.paren_anchor_indent)-1;
level = ArrayCount(indent.paren_anchor_indent) - 1;
}
this_indent = indent.paren_anchor_indent[level];
}
@ -524,9 +433,9 @@ get_indentation_marks(Application_Links *app, Partition *arena, Buffer_Summary *
// after the open paren is on the next line.
if (indent.paren_nesting > 0){
if (prev_token.type == CPP_TOKEN_PARENTHESE_OPEN){
int32_t level = indent.paren_nesting-1;
int32_t level = indent.paren_nesting - 1;
if (level >= ArrayCount(indent.paren_anchor_indent)){
level = ArrayCount(indent.paren_anchor_indent)-1;
level = ArrayCount(indent.paren_anchor_indent) - 1;
}
indent.paren_anchor_indent[level] = this_indent;
}
@ -755,7 +664,7 @@ CUSTOM_DOC("Inserts a character and auto-indents the line on which the cursor si
if (in.key.character == '\n'){
flags |= AutoIndent_ExactAlignBlock;
}
buffer_auto_indent(app, &global_part, &buffer, view.cursor.pos, view.cursor.pos, DEF_TAB_WIDTH, DEFAULT_INDENT_FLAGS);
buffer_auto_indent(app, &global_part, &buffer, view.cursor.pos, view.cursor.pos, DEF_TAB_WIDTH, flags);
move_past_lead_whitespace(app, &view, &buffer);
}

View File

@ -180,25 +180,15 @@ CUSTOM_DOC("Sets the left size of the view near the x position of the cursor.")
}
static bool32
global_point_to_view_point(View_Summary *view, int32_t x, int32_t y, float *x_out, float *y_out){
view_space_from_screen_space_checked(Vec2_i32 p, Rect_i32 file_region, Vec2 scroll_p, Vec2 *p_out){
bool32 result = false;
i32_Rect region = view->file_region;
int32_t max_x = (region.x1 - region.x0);
int32_t max_y = (region.y1 - region.y0);
GUI_Scroll_Vars scroll_vars = view->scroll_vars;
int32_t rx = x - region.x0;
int32_t ry = y - region.y0;
if (ry >= 0 && rx >= 0 && rx < max_x && ry < max_y){
result = 1;
if (hit_check(file_region, p)){
*p_out = view_space_from_screen_space(V2(p), V2(file_region.p0), scroll_p);
result = true;
}
else{
*p_out = V2(0.f, 0.f);
}
*x_out = (float)rx + scroll_vars.scroll_x;
*y_out = (float)ry + scroll_vars.scroll_y;
return(result);
}
@ -207,10 +197,9 @@ CUSTOM_DOC("Sets the cursor position and mark to the mouse position.")
{
View_Summary view = get_active_view(app, AccessProtected);
Mouse_State mouse = get_mouse_state(app);
float rx = 0;
float ry = 0;
if (global_point_to_view_point(&view, mouse.x, mouse.y, &rx, &ry)){
view_set_cursor(app, &view, seek_xy(rx, ry, true, view.unwrapped_lines), true);
Vec2 p = {};
if (view_space_from_screen_space_checked(mouse.p, view.file_region, view.scroll_vars.scroll_p, &p)){
view_set_cursor(app, &view, seek_xy(p.x, p.y, true, view.unwrapped_lines), true);
view_set_mark(app, &view, seek_pos(view.cursor.pos));
}
}
@ -220,10 +209,9 @@ CUSTOM_DOC("Sets the cursor position to the mouse position.")
{
View_Summary view = get_active_view(app, AccessProtected);
Mouse_State mouse = get_mouse_state(app);
float rx = 0;
float ry = 0;
if (global_point_to_view_point(&view, mouse.x, mouse.y, &rx, &ry)){
view_set_cursor(app, &view, seek_xy(rx, ry, true, view.unwrapped_lines), true);
Vec2 p = {};
if (view_space_from_screen_space_checked(mouse.p, view.file_region, view.scroll_vars.scroll_p, &p)){
view_set_cursor(app, &view, seek_xy(p.x, p.y, true, view.unwrapped_lines), true);
}
no_mark_snap_to_cursor(app, view.view_id);
}
@ -234,10 +222,9 @@ CUSTOM_DOC("If the mouse left button is pressed, sets the cursor position to the
View_Summary view = get_active_view(app, AccessProtected);
Mouse_State mouse = get_mouse_state(app);
if (mouse.l){
float rx = 0;
float ry = 0;
if (global_point_to_view_point(&view, mouse.x, mouse.y, &rx, &ry)){
view_set_cursor(app, &view, seek_xy(rx, ry, true, view.unwrapped_lines), true);
Vec2 p = {};
if (view_space_from_screen_space_checked(mouse.p, view.file_region, view.scroll_vars.scroll_p, &p)){
view_set_cursor(app, &view, seek_xy(p.x, p.y, true, view.unwrapped_lines), true);
}
}
no_mark_snap_to_cursor(app, view.view_id);
@ -248,10 +235,9 @@ CUSTOM_DOC("Sets the mark position to the mouse position.")
{
View_Summary view = get_active_view(app, AccessProtected);
Mouse_State mouse = get_mouse_state(app);
float rx = 0;
float ry = 0;
if (global_point_to_view_point(&view, mouse.x, mouse.y, &rx, &ry)){
view_set_mark(app, &view, seek_xy(rx, ry, true, view.unwrapped_lines));
Vec2 p = {};
if (view_space_from_screen_space_checked(mouse.p, view.file_region, view.scroll_vars.scroll_p, &p)){
view_set_mark(app, &view, seek_xy(p.x, p.y, true, view.unwrapped_lines));
}
no_mark_snap_to_cursor(app, view.view_id);
}
@ -565,11 +551,16 @@ CUSTOM_DOC("Toggles the current buffer's line wrapping status.")
{
View_Summary view = get_active_view(app, AccessProtected);
Buffer_Summary buffer = get_buffer(app, view.buffer_id, AccessProtected);
bool32 unwrapped = view.unwrapped_lines;
buffer_set_setting(app, &buffer, BufferSetting_WrapLine, unwrapped);
}
CUSTOM_COMMAND_SIG(toggle_fps_meter)
CUSTOM_DOC("Toggles the visibility of the FPS performance meter")
{
show_fps_hud = !show_fps_hud;
}
CUSTOM_COMMAND_SIG(increase_line_wrap)
CUSTOM_DOC("Increases the current buffer's width for line wrapping.")
{
@ -745,8 +736,8 @@ isearch(Application_Links *app, bool32 start_reversed, String query_init, bool32
Marker_Visual visual = create_marker_visual(app, highlight);
marker_visual_set_effect(app, visual,
VisualType_CharacterHighlightRanges,
SymbolicColorFromPalette(Stag_Highlight),
SymbolicColorFromPalette(Stag_At_Highlight), 0);
Stag_Highlight,
Stag_At_Highlight, 0);
marker_visual_set_view_key(app, visual, view.view_id);
marker_visual_set_priority(app, visual, VisualPriority_Default + 1);
isearch__update_highlight(app, &view, highlight, match.start, match.end);
@ -982,8 +973,8 @@ query_replace_base(Application_Links *app, View_Summary *view, Buffer_Summary *b
Marker_Visual visual = create_marker_visual(app, highlight);
marker_visual_set_effect(app, visual,
VisualType_CharacterHighlightRanges,
SymbolicColorFromPalette(Stag_Highlight),
SymbolicColorFromPalette(Stag_At_Highlight), 0);
Stag_Highlight,
Stag_At_Highlight, 0);
marker_visual_set_view_key(app, visual, view->view_id);
cursor_is_hidden = true;
@ -1790,6 +1781,7 @@ CUSTOM_DOC("Advances forward through the undo history in the buffer containing t
////////////////////////////////
#if 0
CUSTOM_COMMAND_SIG(reload_themes)
CUSTOM_DOC("Loads all the theme files in the theme folder, replacing duplicates with the new theme data.")
{
@ -1812,6 +1804,7 @@ CUSTOM_DOC("Loads all the theme files in the theme folder, replacing duplicates
}
end_temp_memory(temp);
}
#endif
CUSTOM_COMMAND_SIG(open_in_other)
CUSTOM_DOC("Interactively opens a file in the other panel.")

View File

@ -319,60 +319,61 @@ operator*(f32 k, Vec4 a){
result.y = a.y * k;
result.z = a.z * k;
result.w = a.w * k;
return(result);}
return(result);
}
static Vec2&
operator+=(Vec2 &a, Vec2 b){
a = (a + b);
return a;
return(a);
}
static Vec3&
operator+=(Vec3 &a, Vec3 b){
a = (a + b);
return a;
return(a);
}
static Vec4&
operator+=(Vec4 &a, Vec4 b){
a = (a + b);
return a;
return(a);
}
static Vec2&
operator-=(Vec2 &a, Vec2 b){
a = (a - b);
return a;
return(a);
}
static Vec3&
operator-=(Vec3 &a, Vec3 b){
a = (a - b);
return a;
return(a);
}
static Vec4&
operator-=(Vec4 &a, Vec4 b){
a = (a - b);
return a;
return(a);
}
static Vec2&
operator*=(Vec2 &a, f32 k){
a = (a*k);
return a;
return(a);
}
static Vec3&
operator*=(Vec3 &a, f32 k){
a = (a*k);
return a;
return(a);
}
static Vec4&
operator*=(Vec4 &a, f32 k){
a = (a*k);
return a;
return(a);
}
static b32
@ -405,6 +406,167 @@ operator!=(Vec4 a, Vec4 b){
return(!(a.x == b.x && a.y == b.y && a.z == b.z && a.w == b.w));
}
static Vec2_i32
operator+(Vec2_i32 a, Vec2_i32 b){
Vec2_i32 result;
result.x = a.x + b.x;
result.y = a.y + b.y;
return(result);
}
static Vec3_i32
operator+(Vec3_i32 a, Vec3_i32 b){
Vec3_i32 result;
result.x = a.x + b.x;
result.y = a.y + b.y;
result.z = a.z + b.z;
return(result);
}
static Vec4_i32
operator+(Vec4_i32 a, Vec4_i32 b){
Vec4_i32 result;
result.x = a.x + b.x;
result.y = a.y + b.y;
result.z = a.z + b.z;
result.w = a.w + b.w;
return(result);
}
static Vec2_i32
operator-(Vec2_i32 a, Vec2_i32 b){
Vec2_i32 result;
result.x = a.x - b.x;
result.y = a.y - b.y;
return(result);
}
static Vec3_i32
operator-(Vec3_i32 a, Vec3_i32 b){
Vec3_i32 result;
result.x = a.x - b.x;
result.y = a.y - b.y;
result.z = a.z - b.z;
return(result);
}
static Vec4_i32
operator-(Vec4_i32 a, Vec4_i32 b){
Vec4_i32 result;
result.x = a.x - b.x;
result.y = a.y - b.y;
result.z = a.z - b.z;
result.w = a.w - b.w;
return(result);
}
static Vec2_i32
operator*(Vec2_i32 a, i32 k){
Vec2_i32 result;
result.x = a.x * k;
result.y = a.y * k;
return(result);
}
static Vec3_i32
operator*(Vec3_i32 a, i32 k){
Vec3_i32 result;
result.x = a.x * k;
result.y = a.y * k;
result.z = a.z * k;
return(result);
}
static Vec4_i32
operator*(Vec4_i32 a, i32 k){
Vec4_i32 result;
result.x = a.x * k;
result.y = a.y * k;
result.z = a.z * k;
result.w = a.w * k;
return(result);
}
static Vec2_i32
operator*(i32 k, Vec2_i32 a){
Vec2_i32 result;
result.x = a.x * k;
result.y = a.y * k;
return(result);
}
static Vec3_i32
operator*(i32 k, Vec3_i32 a){
Vec3_i32 result;
result.x = a.x * k;
result.y = a.y * k;
result.z = a.z * k;
return(result);
}
static Vec4_i32
operator*(i32 k, Vec4_i32 a){
Vec4_i32 result;
result.x = a.x * k;
result.y = a.y * k;
result.z = a.z * k;
result.w = a.w * k;
return(result);}
static Vec2_i32&
operator+=(Vec2_i32 &a, Vec2_i32 b){
a = (a + b);
return(a);
}
static Vec3_i32&
operator+=(Vec3_i32 &a, Vec3_i32 b){
a = (a + b);
return(a);
}
static Vec4_i32&
operator+=(Vec4_i32 &a, Vec4_i32 b){
a = (a + b);
return(a);
}
static Vec2_i32&
operator-=(Vec2_i32 &a, Vec2_i32 b){
a = (a - b);
return(a);
}
static Vec3_i32&
operator-=(Vec3_i32 &a, Vec3_i32 b){
a = (a - b);
return(a);
}
static Vec4_i32&
operator-=(Vec4_i32 &a, Vec4_i32 b){
a = (a - b);
return(a);
}
static Vec2_i32&
operator*=(Vec2_i32 &a, i32 k){
a = (a*k);
return(a);
}
static Vec3_i32&
operator*=(Vec3_i32 &a, i32 k){
a = (a*k);
return(a);
}
static Vec4_i32&
operator*=(Vec4_i32 &a, i32 k){
a = (a*k);
return(a);
}
static b32
operator==(Vec2_i32 a, Vec2_i32 b){
return(a.x == b.x && a.y == b.y);
@ -439,21 +601,21 @@ static f32
dot(Vec2 a, Vec2 b){
f32 result;
result = a.x*b.x + a.y*b.y;
return result;
return(result);
}
static f32
dot(Vec3 a, Vec3 b){
f32 result;
result = a.x*b.x + a.y*b.y + a.z*b.z;
return result;
return(result);
}
static f32
dot(Vec4 a, Vec4 b){
f32 result;
result = a.x*b.x + a.y*b.y + a.z*b.z + a.w*b.w;
return result;
return(result);
}
static Vec3
@ -462,7 +624,7 @@ cross(Vec3 a, Vec3 b){
result.x = a.y*b.z - b.y*a.z;
result.y = a.z*b.x - b.z*a.x;
result.z = a.x*b.y - b.x*a.y;
return result;
return(result);
}
static Vec2
@ -543,61 +705,6 @@ unlerp(f32 a, f32 x, f32 b){
return(r);
}
static f32
clamp(f32 a, f32 n, f32 z){
if (n < a){
n = a;
}
else if (n > z){
n = z;
}
return(n);
}
static i32
clamp(i32 a, i32 n, i32 z){
if (n < a){
n = a;
}
else if (n > z){
n = z;
}
return(n);
}
static i64
clamp(i64 a, i64 n, i64 z){
if (n < a){
n = a;
}
else if (n > z){
n = z;
}
return(n);
}
static u32
clamp(u32 a, u32 n, u32 z){
if (n < a){
n = a;
}
else if (n > z){
n = z;
}
return(n);
}
static u64
clamp(u64 a, u64 n, u64 z){
if (n < a){
n = a;
}
else if (n > z){
n = z;
}
return(n);
}
////////////////////////////////
// color
@ -618,7 +725,7 @@ color_blend(u32 a, f32 t, u32 b){
R.byte[2] = (u8)lerp(A.byte[2], t, B.byte[2]);
R.byte[3] = (u8)lerp(A.byte[3], t, B.byte[3]);
return R.comp;
return(R.comp);
}
static Vec3
@ -627,7 +734,7 @@ unpack_color3(u32 color){
result.r = ((color >> 16) & 0xFF) / 255.f;
result.g = ((color >> 8) & 0xFF) / 255.f;
result.b = ((color >> 0) & 0xFF) / 255.f;
return result;
return(result);
}
static Vec4
@ -637,7 +744,7 @@ unpack_color4(u32 color){
result.r = ((color >> 16) & 0xFF) / 255.f;
result.g = ((color >> 8) & 0xFF) / 255.f;
result.b = ((color >> 0) & 0xFF) / 255.f;
return result;
return(result);
}
static u32
@ -647,7 +754,7 @@ pack_color4(Vec4 color){
((u8)(color.r*255) << 16) |
((u8)(color.g*255) << 8) |
((u8)(color.b*255) << 0);
return result;
return(result);
}
static Vec4
@ -703,7 +810,7 @@ rgba_to_hsla(Vec4 rgba){
hsla.y = delta / (1.f - ABS(2.f*hsla.z - 1.f));
}
return hsla;
return(hsla);
}
static Vec4
@ -768,6 +875,14 @@ f32R(f32 l, f32 t, f32 r, f32 b){
return(rect);
}
static f32_Rect
f32R(Vec2 p0, Vec2 p1){
f32_Rect rect = {};
rect.p0 = p0;
rect.p1 = p1;
return(rect);
}
static f32_Rect
f32R(i32_Rect r){
f32_Rect rect = {};
@ -783,16 +898,36 @@ rect_equal(i32_Rect r1, i32_Rect r2){
return(r1.x0 == r2.x0 && r1.y0 == r2.y0 && r1.x1 == r2.x1 && r1.y1 == r2.y1);
}
static i32
static b32
hit_check(f32 x, f32 y, f32 x0, f32 y0, f32 x1, f32 y1){
return(x >= x0 && x < x1 && y >= y0 && y < y1);
}
static b32
hit_check(f32 x, f32 y, f32_Rect rect){
return(hit_check(x, y, rect.x0, rect.y0, rect.x1, rect.y1));
}
static b32
hit_check(Rect_f32 rect, Vec2_f32 p){
return(hit_check(p.x, p.y, rect.x0, rect.y0, rect.x1, rect.y1));
}
static b32
hit_check(i32 x, i32 y, i32 x0, i32 y0, i32 x1, i32 y1){
return(x >= x0 && x < x1 && y >= y0 && y < y1);
}
static i32
static b32
hit_check(i32 x, i32 y, i32_Rect rect){
return(hit_check(x, y, rect.x0, rect.y0, rect.x1, rect.y1));
}
static b32
hit_check(Rect_i32 rect, Vec2_i32 p){
return(hit_check(p.x, p.y, rect.x0, rect.y0, rect.x1, rect.y1));
}
static i32_Rect
get_inner_rect(i32_Rect outer, i32 margin){
i32_Rect r = {};

View File

@ -60,7 +60,9 @@ typedef double f64;
#define clamp_top(a,b) Min(a,b)
#define clamp_bottom(a,b) Max(a,b)
//#define clamp(a,x,b) Min(
#define clamp(a,x,b) (((a)>(x))?(a):(((b)<(x))?(b):(x)))
#define HasFlag(field,flag) ((field)&(flag))
////////////////////////////////

View File

@ -1508,6 +1508,7 @@ config_parse__file_name(Application_Links *app, Partition *arena,
return(parsed);
}
#if 0
static void
init_theme_zero(Theme *theme){
for (int32_t i = 0; i < Stag_COUNT; ++i){
@ -1568,6 +1569,7 @@ theme_parse__file_name(Application_Links *app, Partition *arena,
}
return(parsed);
}
#endif
////////////////////////////////
@ -1693,7 +1695,7 @@ load_config_and_apply(Application_Links *app, Partition *scratch, Config_Data *c
adjust_all_buffer_wrap_widths(app, config->default_wrap_width, config->default_min_base_width);
global_set_setting(app, GlobalSetting_LAltLCtrlIsAltGr, config->lalt_lctrl_is_altgr);
change_theme(app, config->default_theme_name.str, config->default_theme_name.size);
//change_theme(app, config->default_theme_name.str, config->default_theme_name.size);
highlight_line_at_cursor = config->highlight_line_at_cursor;
Face_Description description = {};
@ -1717,6 +1719,7 @@ load_config_and_apply(Application_Links *app, Partition *scratch, Config_Data *c
end_temp_memory(temp);
}
#if 0
static void
load_theme_file_into_live_set(Application_Links *app, Partition *scratch, char *file_name){
Temp_Memory temp = begin_temp_memory(scratch);
@ -1756,6 +1759,7 @@ load_folder_of_themes_into_live_set(Application_Links *app, Partition *scratch,
free_file_list(app, list);
}
}
#endif
// BOTTOM

View File

@ -247,11 +247,13 @@ struct Config_Data{
bool32 lalt_lctrl_is_altgr;
};
#if 0
struct Theme_Data{
char space[128];
String name;
Theme theme;
};
#endif
#endif

View File

@ -332,7 +332,9 @@ default_4coder_initialize(Application_Links *app, int32_t override_font_size, bo
String msg = make_lit_string(message);
print_message(app, msg.str, msg.size);
#if 0
load_folder_of_themes_into_live_set(app, &global_part, "themes");
#endif
load_config_and_apply(app, &global_part, &global_config, override_font_size, override_hinting);
view_rewrite_loc = managed_variable_create_or_get_id(app, "DEFAULT.rewrite" , 0);

View File

@ -53,6 +53,8 @@ static bool32 suppressing_mouse = false;
static bool32 cursor_is_hidden = false;
static b32 show_fps_hud = false;
enum{
FCoderMode_Original = 0,
FCoderMode_NotepadLike = 1,

View File

@ -116,8 +116,8 @@ COMMAND_CALLER_HOOK(default_command_caller){
}
struct Highlight_Record{
int32_t first;
int32_t one_past_last;
i32 first;
i32 one_past_last;
int_color color;
};
@ -168,8 +168,7 @@ mark_enclosures(Application_Links *app, Partition *scratch, Managed_Scope render
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,
buffer, pos, flags);
Range_Array ranges = get_enclosure_ranges(app, scratch, buffer, pos, flags);
if (ranges.count > 0){
int32_t marker_count = ranges.count*2;
@ -194,8 +193,8 @@ mark_enclosures(Application_Links *app, Partition *scratch, Managed_Scope render
i < color_count;
i += 1){
Marker_Visual visual = create_marker_visual(app, o);
int_color back = SymbolicColor_Transparent;
int_color fore = SymbolicColor_Default;
int_color back = 0;
int_color fore = 0;
if (back_colors != 0){
back = back_colors[color_index];
}
@ -215,6 +214,66 @@ mark_enclosures(Application_Links *app, Partition *scratch, Managed_Scope render
end_temp_memory(temp);
}
static argb_color default_colors[Stag_COUNT] = {};
MODIFY_COLOR_TABLE_SIG(default_modify_color_table){
if (default_colors[Stag_NOOP] == 0){
default_colors[Stag_NOOP] = 0xFFFF00FF;
default_colors[Stag_Back] = 0xFF0C0C0C;
default_colors[Stag_Margin] = 0xFF181818;
default_colors[Stag_Margin_Hover] = 0xFF252525;
default_colors[Stag_Margin_Active] = 0xFF323232;
default_colors[Stag_List_Item] = default_colors[Stag_Margin];
default_colors[Stag_List_Item_Hover] = default_colors[Stag_Margin_Hover];
default_colors[Stag_List_Item_Active] = default_colors[Stag_Margin_Active];
default_colors[Stag_Cursor] = 0xFF00EE00;
default_colors[Stag_Highlight] = 0xFFDDEE00;
default_colors[Stag_Mark] = 0xFF494949;
default_colors[Stag_Default] = 0xFF90B080;
default_colors[Stag_At_Cursor] = default_colors[Stag_Back];
default_colors[Stag_Highlight_Cursor_Line] = 0xFF1E1E1E;
default_colors[Stag_At_Highlight] = 0xFFFF44DD;
default_colors[Stag_Comment] = 0xFF2090F0;
default_colors[Stag_Keyword] = 0xFFD08F20;
default_colors[Stag_Str_Constant] = 0xFF50FF30;
default_colors[Stag_Char_Constant] = default_colors[Stag_Str_Constant];
default_colors[Stag_Int_Constant] = default_colors[Stag_Str_Constant];
default_colors[Stag_Float_Constant] = default_colors[Stag_Str_Constant];
default_colors[Stag_Bool_Constant] = default_colors[Stag_Str_Constant];
default_colors[Stag_Include] = default_colors[Stag_Str_Constant];
default_colors[Stag_Preproc] = default_colors[Stag_Default];
default_colors[Stag_Special_Character] = 0xFFFF0000;
default_colors[Stag_Ghost_Character] = 0xFF4E5E46;
default_colors[Stag_Paste] = 0xFFDDEE00;
default_colors[Stag_Undo] = 0xFF00DDEE;
default_colors[Stag_Highlight_Junk] = 0xFF3A0000;
default_colors[Stag_Highlight_White] = 0xFF003A3A;
default_colors[Stag_Bar] = 0xFF888888;
default_colors[Stag_Bar_Active] = 0xFF666666;
default_colors[Stag_Base] = 0xFF000000;
default_colors[Stag_Pop1] = 0xFF3C57DC;
default_colors[Stag_Pop2] = 0xFFFF0000;
default_colors[Stag_Back_Cycle_1] = 0x10A00000;
default_colors[Stag_Back_Cycle_2] = 0x0C00A000;
default_colors[Stag_Back_Cycle_3] = 0x0C0000A0;
default_colors[Stag_Back_Cycle_4] = 0x0CA0A000;
default_colors[Stag_Text_Cycle_1] = 0xFFA00000;
default_colors[Stag_Text_Cycle_2] = 0xFF00A000;
default_colors[Stag_Text_Cycle_3] = 0xFF0030B0;
default_colors[Stag_Text_Cycle_4] = 0xFFA0A000;
}
Color_Table color_table = {};
color_table.vals = default_colors;
color_table.count = ArrayCount(default_colors);
return(color_table);
}
RENDER_CALLER_SIG(default_render_caller){
View_Summary view = get_view(app, view_id, AccessAll);
Buffer_Summary buffer = get_buffer(app, view.buffer_id, AccessAll);
@ -230,11 +289,6 @@ RENDER_CALLER_SIG(default_render_caller){
// NOTE(allen): Scan for TODOs and NOTEs
{
Theme_Color colors[2];
colors[0].tag = Stag_Text_Cycle_2;
colors[1].tag = Stag_Text_Cycle_1;
get_theme_colors(app, colors, 2);
Temp_Memory temp = begin_temp_memory(scratch);
int32_t text_size = on_screen_range.one_past_last - on_screen_range.first;
char *text = push_array(scratch, char, text_size);
@ -247,7 +301,7 @@ RENDER_CALLER_SIG(default_render_caller){
Highlight_Record *record = push_array(scratch, Highlight_Record, 1);
record->first = i + on_screen_range.first;
record->one_past_last = record->first + 4;
record->color = colors[0].color;
record->color = Stag_COUNT + 1;
tail.str += 3;
tail.size -= 3;
i += 3;
@ -256,7 +310,7 @@ RENDER_CALLER_SIG(default_render_caller){
Highlight_Record *record = push_array(scratch, Highlight_Record, 1);
record->first = i + on_screen_range.first;
record->one_past_last = record->first + 4;
record->color = colors[1].color;
record->color = Stag_COUNT + 10;
tail.str += 3;
tail.size -= 3;
i += 3;
@ -282,9 +336,7 @@ RENDER_CALLER_SIG(default_render_caller){
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_Visual v = create_marker_visual(app, o);
marker_visual_set_effect(app, v,
VisualType_CharacterHighlightRanges,
SymbolicColor_Transparent, current_color, 0);
marker_visual_set_effect(app, v, VisualType_CharacterHighlightRanges, SymbolicColor_Default, current_color, 0);
marker_visual_set_priority(app, v, VisualPriority_Lowest);
end_temp_memory(marker_temp);
current_color = records[i].color;
@ -311,15 +363,6 @@ RENDER_CALLER_SIG(default_render_caller){
switch (fcoder_mode){
case FCoderMode_Original:
{
Theme_Color colors[2] = {};
colors[0].tag = Stag_Cursor;
colors[1].tag = Stag_Mark;
get_theme_colors(app, colors, 2);
int_color cursor_color = SymbolicColorFromPalette(Stag_Cursor);
int_color mark_color = SymbolicColorFromPalette(Stag_Mark);
int_color text_color = is_active_view?
SymbolicColorFromPalette(Stag_At_Cursor):SymbolicColorFromPalette(Stag_Default);
Marker_Visual_Take_Rule take_rule = {};
take_rule.first_index = 0;
take_rule.take_count_per_step = 1;
@ -328,14 +371,13 @@ RENDER_CALLER_SIG(default_render_caller){
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, text_color, 0);
int_color text_color = is_active_view?Stag_At_Cursor:Stag_Default;
marker_visual_set_effect(app, visual, type, Stag_Cursor, text_color, 0);
marker_visual_set_take_rule(app, visual, take_rule);
marker_visual_set_priority(app, visual, VisualPriority_Highest);
visual = create_marker_visual(app, cursor_and_mark);
marker_visual_set_effect(app, visual,
VisualType_CharacterWireFrames, mark_color, 0, 0);
marker_visual_set_effect(app, visual, VisualType_CharacterWireFrames, Stag_Mark, 0, 0);
take_rule.first_index = 1;
marker_visual_set_take_rule(app, visual, take_rule);
marker_visual_set_priority(app, visual, VisualPriority_Highest);
@ -343,12 +385,8 @@ RENDER_CALLER_SIG(default_render_caller){
case FCoderMode_NotepadLike:
{
Theme_Color colors[2] = {};
colors[0].tag = Stag_Cursor;
colors[1].tag = Stag_Highlight;
get_theme_colors(app, colors, 2);
int_color cursor_color = SymbolicColorFromPalette(Stag_Cursor);
int_color highlight_color = SymbolicColorFromPalette(Stag_Highlight);
int_color cursor_color = Stag_Cursor;
int_color highlight_color = Stag_Highlight;
Marker_Visual_Take_Rule take_rule = {};
take_rule.first_index = 0;
@ -363,7 +401,7 @@ RENDER_CALLER_SIG(default_render_caller){
if (view.cursor.pos != view.mark.pos){
visual = create_marker_visual(app, cursor_and_mark);
marker_visual_set_effect(app, visual, VisualType_CharacterHighlightRanges, highlight_color, SymbolicColorFromPalette(Stag_At_Highlight), 0);
marker_visual_set_effect(app, visual, VisualType_CharacterHighlightRanges, highlight_color, Stag_At_Highlight, 0);
take_rule.maximum_number_of_markers = 2;
marker_visual_set_take_rule(app, visual, take_rule);
marker_visual_set_priority(app, visual, VisualPriority_Highest);
@ -374,13 +412,9 @@ RENDER_CALLER_SIG(default_render_caller){
// NOTE(allen): Line highlight setup
if (highlight_line_at_cursor && is_active_view){
Theme_Color color = {};
color.tag = Stag_Highlight_Cursor_Line;
get_theme_colors(app, &color, 1);
uint32_t line_color = color.color;
uint32_t line_color = Stag_Highlight_Cursor_Line;
Marker_Visual visual = create_marker_visual(app, cursor_and_mark);
marker_visual_set_effect(app, visual, VisualType_LineHighlights,
line_color, 0, 0);
marker_visual_set_effect(app, visual, VisualType_LineHighlights, line_color, 0, 0);
Marker_Visual_Take_Rule take_rule = {};
take_rule.first_index = 0;
take_rule.take_count_per_step = 1;
@ -393,10 +427,7 @@ RENDER_CALLER_SIG(default_render_caller){
// NOTE(allen): Token highlight setup
bool32 do_token_highlight = false;
if (do_token_highlight){
Theme_Color color = {};
color.tag = Stag_Cursor;
get_theme_colors(app, &color, 1);
uint32_t token_color = (0x50 << 24) | (color.color&0xFFFFFF);
int_color token_color = 0x5000EE00;
uint32_t token_flags = BoundaryToken|BoundaryWhitespace;
int32_t pos0 = view.cursor.pos;
@ -410,7 +441,7 @@ RENDER_CALLER_SIG(default_render_caller){
range_markers[1].pos = pos2;
managed_object_store_data(app, token_highlight, 0, 2, range_markers);
Marker_Visual visual = create_marker_visual(app, token_highlight);
marker_visual_set_effect(app, visual, VisualType_CharacterHighlightRanges, token_color, SymbolicColorFromPalette(Stag_At_Highlight), 0);
marker_visual_set_effect(app, visual, VisualType_CharacterHighlightRanges, token_color, Stag_At_Highlight, 0);
}
}
}
@ -418,27 +449,13 @@ RENDER_CALLER_SIG(default_render_caller){
// NOTE(allen): Matching enclosure highlight setup
static const int32_t color_count = 4;
if (do_matching_enclosure_highlight){
Theme_Color theme_colors[color_count];
int_color colors[color_count];
for (int32_t i = 0; i < 4; i += 1){
theme_colors[i].tag = Stag_Back_Cycle_1 + i;
}
get_theme_colors(app, theme_colors, color_count);
for (int32_t i = 0; i < 4; i += 1){
colors[i] = theme_colors[i].color;
for (u16 i = 0; i < color_count; i += 1){
colors[i] = Stag_Back_Cycle_1 + i;
}
mark_enclosures(app, scratch, render_scope, &buffer, view.cursor.pos, FindScope_Brace, VisualType_LineHighlightRanges, colors, 0, color_count);
}
if (do_matching_paren_highlight){
Theme_Color theme_colors[color_count];
int_color colors[color_count];
for (int32_t i = 0; i < 4; i += 1){
theme_colors[i].tag = Stag_Text_Cycle_1 + i;
}
get_theme_colors(app, theme_colors, color_count);
for (int32_t i = 0; i < 4; i += 1){
colors[i] = theme_colors[i].color;
}
int32_t pos = view.cursor.pos;
if (buffer_get_char(app, &buffer, pos) == '('){
pos += 1;
@ -448,11 +465,85 @@ RENDER_CALLER_SIG(default_render_caller){
pos -= 1;
}
}
int_color colors[color_count];
for (u16 i = 0; i < color_count; i += 1){
colors[i] = Stag_Text_Cycle_1 + i;
}
mark_enclosures(app, scratch, render_scope, &buffer, pos, FindScope_Paren, VisualType_CharacterBlocks, 0, colors, color_count);
}
do_core_render(app);
// NOTE(allen): FPS HUD
if (show_fps_hud){
static const i32 history_depth = 10;
static f32 history_literal_dt[history_depth] = {};
static f32 history_animation_dt[history_depth] = {};
static i32 history_frame_index[history_depth] = {};
i32 wrapped_index = frame_index%history_depth;
history_literal_dt[wrapped_index] = literal_dt;
history_animation_dt[wrapped_index] = animation_dt;
history_frame_index[wrapped_index] = frame_index;
Rect_f32 hud_rect = f32R(view.render_region);
hud_rect.y0 = hud_rect.y1 - view.line_height*(f32)(history_depth);
draw_rectangle(app, hud_rect, 0xFF000000);
draw_rectangle_outline(app, hud_rect, 0xFFFFFFFF);
Face_ID font_id = 0;
get_face_id(app, 0, &font_id);
Vec2 p = hud_rect.p0;
Range ranges[2];
ranges[0].first = wrapped_index;
ranges[0].one_past_last = -1;
ranges[1].first = history_depth - 1;
ranges[1].one_past_last = wrapped_index;
for (i32 i = 0; i < 2; i += 1){
Range r = ranges[i];
for (i32 j = r.first; j > r.one_past_last; j -= 1, p.y += view.line_height){
f32 dts[2];
dts[0] = history_literal_dt[j];
dts[1] = history_animation_dt[j];
i32 frame_index = history_frame_index[j];
Arena arena = make_arena(app);
char space[256];
String str = make_fixed_width_string(space);
Fancy_String_List list = {};
push_fancy_string(&arena, &list, make_lit_string("FPS: "), fancy_from_rgba_color(1.f, 0.f, 1.f, 1.f));
push_fancy_string(&arena, &list, make_lit_string("["), fancy_from_rgba_color(0.f, 1.f, 0.f, 1.f));
{
str.size = 0;
append_int_to_str_left_pad(&str, frame_index, 6, ' ');
push_fancy_string(&arena, &list, str, fancy_from_rgba_color(1.f, 1.f, 1.f, 1.f));
}
push_fancy_string(&arena, &list, make_lit_string("]: "), fancy_from_rgba_color(0.f, 1.f, 0.f, 1.f));
for (i32 k = 0; k < 2; k += 1){
f32 dt = dts[k];
str.size = 0;
if (dt == 0.f){
append_padding(&str, '-', str.size + 10);
}
else{
append_int_to_str_left_pad(&str, round32(1.f/dt), 10, ' ');
}
push_fancy_string(&arena, &list, str, fancy_from_rgba_color(1.f, 1.f, 1.f, 1.f));
push_fancy_string(&arena, &list, make_lit_string(" | "), fancy_from_rgba_color(0.f, 1.f, 0.f, 1.f));
}
draw_fancy_string(app, font_id, list.first, p, Stag_Default, 0, 0, V2(1.f, 0.f));
arena_release_all(&arena);
}
}
}
managed_scope_clear_self_all_dependent_scopes(app, render_scope);
}
@ -855,9 +946,9 @@ OPEN_FILE_HOOK_SIG(default_end_file){
// extended to have access to the key presses soon.
INPUT_FILTER_SIG(default_suppress_mouse_filter){
if (suppressing_mouse){
*mouse = null_mouse_state;
mouse->x = -100;
mouse->y = -100;
memset(mouse, 0, sizeof(*mouse));
mouse->p.x = -100;
mouse->p.y = -100;
}
}
@ -964,6 +1055,7 @@ set_all_default_hooks(Bind_Helper *context){
set_input_filter(context, default_suppress_mouse_filter);
set_scroll_rule(context, smooth_scroll_rule);
set_buffer_name_resolver(context, default_buffer_name_resolution);
set_modify_color_table_hook(context, default_modify_color_table);
}
// BOTTOM

View File

@ -27,6 +27,7 @@
#include "4coder_ui_helper.h"
#include "4coder_helper.h"
#include "4coder_fancy.h"
#include "4coder_default_framework.h"
#include "4coder_mirror.h"
#include "4coder_config.h"
@ -46,6 +47,7 @@
#include "4coder_default_framework_variables.cpp"
#include "4coder_buffer_seek_constructors.cpp"
#include "4coder_helper.cpp"
#include "4coder_fancy.cpp"
#include "4coder_ui_helper.cpp"
#include "4coder_font_helper.cpp"
#include "4coder_config.cpp"

View File

@ -820,6 +820,7 @@ get_bindings(void *data, int32_t size){
set_scroll_rule(context, smooth_scroll_rule);
set_buffer_name_resolver(context, default_buffer_name_resolution);
set_modify_color_table_hook(context, default_modify_color_table);
default_keys(context);

125
4coder_fancy.cpp Normal file
View File

@ -0,0 +1,125 @@
/*
* Fancy string - immediate mode renderer for colored strings
*/
static Fancy_Color
blend_color(id_color a, f32 t, id_color b){
Fancy_Color result = {};
result.index_a = (u16)a;
result.index_b = (u16)b;
result.table_a = 1;
result.table_b = 1;
result.c_b = (u8)(clamp(0, 255.0f*t, 255.0f));
result.c_a = 255 - result.c_b;
return(result);
}
static Fancy_Color
single_color(id_color a){
Fancy_Color result = {};
result.index_a = (u16)a;
result.index_b = 0;
result.table_a = 1;
result.table_b = 0;
result.c_a = 255;
result.c_b = 0;
return(result);
}
static Fancy_Color
fancy_from_rgba_color(argb_color color){
Fancy_Color result = {};
result.rgba = color;
result.code = 0;
return(result);
}
static Fancy_Color
fancy_from_rgba_color(f32 r, f32 g, f32 b, f32 a){
Fancy_Color result = fancy_from_rgba_color(pack_color4(V4(r, g, b, a)));
return(result);
}
static Fancy_Color
fancy_resolve_to_rgba(Application_Links *app, Fancy_Color source){
if (source.code != 0){
Vec4 a = unpack_color4(finalize_color(app, source.index_a));
Vec4 b = unpack_color4(finalize_color(app, source.index_b));
f32 ca = (f32)source.c_a/255.0f;
f32 cb = (f32)source.c_b/255.0f;
Vec4 value = ca*a + cb*b;
source.rgba = pack_color4(value);
source.code = 0;
}
return(source);
}
static Fancy_Color
pass_through_fancy_color(void){
Fancy_Color result = {};
return(result);
}
static int_color
int_color_from(Application_Links *app, Fancy_Color source){
int_color result = {};
if ((source.c_a == 255) && (source.c_b == 0)){
result = source.index_a;
}
else{
source = fancy_resolve_to_rgba(app, source);
result = source.rgba;
}
return(result);
}
static bool32
is_valid(Fancy_Color source){
bool32 result = !((source.code == 0) && (source.rgba == 0));
return(result);
}
static Fancy_String *
push_fancy_string(Arena *arena, Fancy_String_List *list, String value, Fancy_Color fore){
Fancy_String *result = push_array(arena, Fancy_String, 1);
result->value = string_push_copy(arena, value);
result->fore = fore;
result->back = pass_through_fancy_color();
result->pre_margin = 0;
result->post_margin = 0;
result->next = 0;
if (list != 0){
list->last = (list->last ? list->last->next : list->first) = result;
}
return(result);
}
static Fancy_String *
push_fancy_string(Arena *arena, Fancy_String_List *list, String value){
return(push_fancy_string(arena, list, value, pass_through_fancy_color()));
}
static Vec2
draw_fancy_string(Application_Links *app, Face_ID font_id, Fancy_String *string, Vec2 P,
int_color fore, int_color back, u32 flags, Vec2 dP){
for (;string != 0;
string = string->next){
Face_ID use_font_id = (string->font_id) ? string->font_id : font_id;
int_color use_fore = is_valid(string->fore) ? int_color_from(app, string->fore) : fore;
f32 adv = get_string_advance(app, use_font_id, string->value);
// TODO(casey): need to fill the background here, but I don't know the line height,
// and I can't actually render filled shapes, so, like, I can't properly do dP :(
P += (string->pre_margin)*dP;
draw_string(app, use_font_id, string->value, P, use_fore, flags, dP);
P += (adv + string->post_margin)*dP;
}
return(P);
}

59
4coder_fancy.h Normal file
View File

@ -0,0 +1,59 @@
/*
* Fancy string - immediate mode renderer for colored strings
*/
// TOP
#if !defined(FCODER_FANCY_H)
#define FCODER_FANCY_H
/* TODO(casey): This warrants a lot of thought.
Since you want to be able to edit colors after they have already been stored away in
internal structures, you want to capture as much as possible where the colors came
from. In the current set-up, you can blend any two ids, but that's it. If you
go beyond that, it collapses down to just RGBA. Maybe there should be more than
that. It's hard to say. I don't know.
*/
struct Fancy_Color{
union{
struct{
id_color index_a;
id_color index_b;
};
u32 rgba;
};
union{
struct{
u8 table_a;
u8 table_b;
u8 c_a;
u8 c_b;
};
u32 code;
};
};
struct Fancy_String{
Fancy_String *next;
String value;
Face_ID font_id;
Fancy_Color fore;
Fancy_Color back;
f32 pre_margin;
f32 post_margin;
};
struct Fancy_String_List{
Fancy_String *first;
Fancy_String *last;
};
#endif
// BOTTOM

View File

@ -98,11 +98,6 @@ struct Application_Links;
#define START_QUERY_BAR_SIG(n) bool32 n(Application_Links *app, Query_Bar *bar, uint32_t flags)
#define END_QUERY_BAR_SIG(n) void n(Application_Links *app, Query_Bar *bar, uint32_t flags)
#define PRINT_MESSAGE_SIG(n) bool32 n(Application_Links *app, String message)
#define GET_THEME_COUNT_SIG(n) int32_t n(Application_Links *app)
#define GET_THEME_NAME_SIG(n) String n(Application_Links *app, struct Partition *arena, int32_t index)
#define CREATE_THEME_SIG(n) bool32 n(Application_Links *app, Theme *theme, String theme_name)
#define CHANGE_THEME_SIG(n) bool32 n(Application_Links *app, String theme_name)
#define CHANGE_THEME_BY_INDEX_SIG(n) bool32 n(Application_Links *app, int32_t index)
#define GET_LARGEST_FACE_ID_SIG(n) Face_ID n(Application_Links *app)
#define SET_GLOBAL_FACE_SIG(n) bool32 n(Application_Links *app, Face_ID id, bool32 apply_to_all_buffers)
#define BUFFER_HISTORY_GET_MAX_RECORD_INDEX_SIG(n) bool32 n(Application_Links *app, Buffer_ID buffer_id, History_Record_Index *index_out)
@ -124,6 +119,7 @@ struct Application_Links;
#define GET_AVAILABLE_FONT_SIG(n) Available_Font n(Application_Links *app, int32_t index)
#define SET_THEME_COLORS_SIG(n) void n(Application_Links *app, Theme_Color *colors, int32_t count)
#define GET_THEME_COLORS_SIG(n) void n(Application_Links *app, Theme_Color *colors, int32_t count)
#define FINALIZE_COLOR_SIG(n) argb_color n(Application_Links *app, int_color color)
#define GET_HOT_DIRECTORY_SIG(n) int32_t n(Application_Links *app, String *out, int32_t *required_size_out)
#define SET_HOT_DIRECTORY_SIG(n) bool32 n(Application_Links *app, String string)
#define GET_FILE_LIST_SIG(n) bool32 n(Application_Links *app, String directory, File_List *list_out)
@ -136,13 +132,14 @@ struct Application_Links;
#define DIRECTORY_CD_SIG(n) bool32 n(Application_Links *app, String *directory, String relative_path)
#define GET_4ED_PATH_SIG(n) bool32 n(Application_Links *app, String *path_out, int32_t *required_size_out)
#define SHOW_MOUSE_CURSOR_SIG(n) void n(Application_Links *app, Mouse_Cursor_Show_Type show)
#define SET_EDIT_FINISHED_HOOK_REPEAT_SPEED_SIG(n) bool32 n(Application_Links *app, u32 milliseconds)
#define SET_FULLSCREEN_SIG(n) bool32 n(Application_Links *app, bool32 full_screen)
#define IS_FULLSCREEN_SIG(n) bool32 n(Application_Links *app)
#define SEND_EXIT_SIGNAL_SIG(n) void n(Application_Links *app)
#define SET_WINDOW_TITLE_SIG(n) bool32 n(Application_Links *app, String title)
#define GET_MICROSECONDS_TIMESTAMP_SIG(n) Microsecond_Time_Stamp n(Application_Links *app)
#define DRAW_STRING_SIG(n) float n(Application_Links *app, Face_ID font_id, String str, Vec2 point, int_color color, u32 flags, Vec2 delta)
#define GET_STRING_ADVANCE_SIG(n) float n(Application_Links *app, Face_ID font_id, String str)
#define DRAW_STRING_SIG(n) Vec2 n(Application_Links *app, Face_ID font_id, String str, Vec2 point, int_color color, u32 flags, Vec2 delta)
#define GET_STRING_ADVANCE_SIG(n) f32 n(Application_Links *app, Face_ID font_id, String str)
#define DRAW_RECTANGLE_SIG(n) void n(Application_Links *app, f32_Rect rect, int_color color)
#define DRAW_RECTANGLE_OUTLINE_SIG(n) void n(Application_Links *app, f32_Rect rect, int_color color)
#define GET_DEFAULT_FONT_FOR_VIEW_SIG(n) Face_ID n(Application_Links *app, View_ID view_id)
@ -248,11 +245,6 @@ typedef GET_ACTIVE_QUERY_BARS_SIG(Get_Active_Query_Bars_Function);
typedef START_QUERY_BAR_SIG(Start_Query_Bar_Function);
typedef END_QUERY_BAR_SIG(End_Query_Bar_Function);
typedef PRINT_MESSAGE_SIG(Print_Message_Function);
typedef GET_THEME_COUNT_SIG(Get_Theme_Count_Function);
typedef GET_THEME_NAME_SIG(Get_Theme_Name_Function);
typedef CREATE_THEME_SIG(Create_Theme_Function);
typedef CHANGE_THEME_SIG(Change_Theme_Function);
typedef CHANGE_THEME_BY_INDEX_SIG(Change_Theme_By_Index_Function);
typedef GET_LARGEST_FACE_ID_SIG(Get_Largest_Face_ID_Function);
typedef SET_GLOBAL_FACE_SIG(Set_Global_Face_Function);
typedef BUFFER_HISTORY_GET_MAX_RECORD_INDEX_SIG(Buffer_History_Get_Max_Record_Index_Function);
@ -274,6 +266,7 @@ typedef GET_AVAILABLE_FONT_COUNT_SIG(Get_Available_Font_Count_Function);
typedef GET_AVAILABLE_FONT_SIG(Get_Available_Font_Function);
typedef SET_THEME_COLORS_SIG(Set_Theme_Colors_Function);
typedef GET_THEME_COLORS_SIG(Get_Theme_Colors_Function);
typedef FINALIZE_COLOR_SIG(Finalize_Color_Function);
typedef GET_HOT_DIRECTORY_SIG(Get_Hot_Directory_Function);
typedef SET_HOT_DIRECTORY_SIG(Set_Hot_Directory_Function);
typedef GET_FILE_LIST_SIG(Get_File_List_Function);
@ -286,6 +279,7 @@ typedef FILE_GET_ATTRIBUTES_SIG(File_Get_Attributes_Function);
typedef DIRECTORY_CD_SIG(Directory_CD_Function);
typedef GET_4ED_PATH_SIG(Get_4ed_Path_Function);
typedef SHOW_MOUSE_CURSOR_SIG(Show_Mouse_Cursor_Function);
typedef SET_EDIT_FINISHED_HOOK_REPEAT_SPEED_SIG(Set_Edit_Finished_Hook_Repeat_Speed_Function);
typedef SET_FULLSCREEN_SIG(Set_Fullscreen_Function);
typedef IS_FULLSCREEN_SIG(Is_Fullscreen_Function);
typedef SEND_EXIT_SIGNAL_SIG(Send_Exit_Signal_Function);
@ -400,11 +394,6 @@ Get_Active_Query_Bars_Function *get_active_query_bars;
Start_Query_Bar_Function *start_query_bar;
End_Query_Bar_Function *end_query_bar;
Print_Message_Function *print_message;
Get_Theme_Count_Function *get_theme_count;
Get_Theme_Name_Function *get_theme_name;
Create_Theme_Function *create_theme;
Change_Theme_Function *change_theme;
Change_Theme_By_Index_Function *change_theme_by_index;
Get_Largest_Face_ID_Function *get_largest_face_id;
Set_Global_Face_Function *set_global_face;
Buffer_History_Get_Max_Record_Index_Function *buffer_history_get_max_record_index;
@ -426,6 +415,7 @@ Get_Available_Font_Count_Function *get_available_font_count;
Get_Available_Font_Function *get_available_font;
Set_Theme_Colors_Function *set_theme_colors;
Get_Theme_Colors_Function *get_theme_colors;
Finalize_Color_Function *finalize_color;
Get_Hot_Directory_Function *get_hot_directory;
Set_Hot_Directory_Function *set_hot_directory;
Get_File_List_Function *get_file_list;
@ -438,6 +428,7 @@ File_Get_Attributes_Function *file_get_attributes;
Directory_CD_Function *directory_cd;
Get_4ed_Path_Function *get_4ed_path;
Show_Mouse_Cursor_Function *show_mouse_cursor;
Set_Edit_Finished_Hook_Repeat_Speed_Function *set_edit_finished_hook_repeat_speed;
Set_Fullscreen_Function *set_fullscreen;
Is_Fullscreen_Function *is_fullscreen;
Send_Exit_Signal_Function *send_exit_signal;
@ -551,11 +542,6 @@ Get_Active_Query_Bars_Function *get_active_query_bars_;
Start_Query_Bar_Function *start_query_bar_;
End_Query_Bar_Function *end_query_bar_;
Print_Message_Function *print_message_;
Get_Theme_Count_Function *get_theme_count_;
Get_Theme_Name_Function *get_theme_name_;
Create_Theme_Function *create_theme_;
Change_Theme_Function *change_theme_;
Change_Theme_By_Index_Function *change_theme_by_index_;
Get_Largest_Face_ID_Function *get_largest_face_id_;
Set_Global_Face_Function *set_global_face_;
Buffer_History_Get_Max_Record_Index_Function *buffer_history_get_max_record_index_;
@ -577,6 +563,7 @@ Get_Available_Font_Count_Function *get_available_font_count_;
Get_Available_Font_Function *get_available_font_;
Set_Theme_Colors_Function *set_theme_colors_;
Get_Theme_Colors_Function *get_theme_colors_;
Finalize_Color_Function *finalize_color_;
Get_Hot_Directory_Function *get_hot_directory_;
Set_Hot_Directory_Function *set_hot_directory_;
Get_File_List_Function *get_file_list_;
@ -589,6 +576,7 @@ File_Get_Attributes_Function *file_get_attributes_;
Directory_CD_Function *directory_cd_;
Get_4ed_Path_Function *get_4ed_path_;
Show_Mouse_Cursor_Function *show_mouse_cursor_;
Set_Edit_Finished_Hook_Repeat_Speed_Function *set_edit_finished_hook_repeat_speed_;
Set_Fullscreen_Function *set_fullscreen_;
Is_Fullscreen_Function *is_fullscreen_;
Send_Exit_Signal_Function *send_exit_signal_;
@ -710,11 +698,6 @@ app_links->get_active_query_bars_ = Get_Active_Query_Bars;\
app_links->start_query_bar_ = Start_Query_Bar;\
app_links->end_query_bar_ = End_Query_Bar;\
app_links->print_message_ = Print_Message;\
app_links->get_theme_count_ = Get_Theme_Count;\
app_links->get_theme_name_ = Get_Theme_Name;\
app_links->create_theme_ = Create_Theme;\
app_links->change_theme_ = Change_Theme;\
app_links->change_theme_by_index_ = Change_Theme_By_Index;\
app_links->get_largest_face_id_ = Get_Largest_Face_ID;\
app_links->set_global_face_ = Set_Global_Face;\
app_links->buffer_history_get_max_record_index_ = Buffer_History_Get_Max_Record_Index;\
@ -736,6 +719,7 @@ app_links->get_available_font_count_ = Get_Available_Font_Count;\
app_links->get_available_font_ = Get_Available_Font;\
app_links->set_theme_colors_ = Set_Theme_Colors;\
app_links->get_theme_colors_ = Get_Theme_Colors;\
app_links->finalize_color_ = Finalize_Color;\
app_links->get_hot_directory_ = Get_Hot_Directory;\
app_links->set_hot_directory_ = Set_Hot_Directory;\
app_links->get_file_list_ = Get_File_List;\
@ -748,6 +732,7 @@ app_links->file_get_attributes_ = File_Get_Attributes;\
app_links->directory_cd_ = Directory_CD;\
app_links->get_4ed_path_ = Get_4ed_Path;\
app_links->show_mouse_cursor_ = Show_Mouse_Cursor;\
app_links->set_edit_finished_hook_repeat_speed_ = Set_Edit_Finished_Hook_Repeat_Speed;\
app_links->set_fullscreen_ = Set_Fullscreen;\
app_links->is_fullscreen_ = Is_Fullscreen;\
app_links->send_exit_signal_ = Send_Exit_Signal;\
@ -861,11 +846,6 @@ static int32_t get_active_query_bars(Application_Links *app, View_ID view_id, in
static bool32 start_query_bar(Application_Links *app, Query_Bar *bar, uint32_t flags){return(app->start_query_bar(app, bar, flags));}
static void end_query_bar(Application_Links *app, Query_Bar *bar, uint32_t flags){(app->end_query_bar(app, bar, flags));}
static bool32 print_message(Application_Links *app, String message){return(app->print_message(app, message));}
static int32_t get_theme_count(Application_Links *app){return(app->get_theme_count(app));}
static String get_theme_name(Application_Links *app, struct Partition *arena, int32_t index){return(app->get_theme_name(app, arena, index));}
static bool32 create_theme(Application_Links *app, Theme *theme, String theme_name){return(app->create_theme(app, theme, theme_name));}
static bool32 change_theme(Application_Links *app, String theme_name){return(app->change_theme(app, theme_name));}
static bool32 change_theme_by_index(Application_Links *app, int32_t index){return(app->change_theme_by_index(app, index));}
static Face_ID get_largest_face_id(Application_Links *app){return(app->get_largest_face_id(app));}
static bool32 set_global_face(Application_Links *app, Face_ID id, bool32 apply_to_all_buffers){return(app->set_global_face(app, id, apply_to_all_buffers));}
static bool32 buffer_history_get_max_record_index(Application_Links *app, Buffer_ID buffer_id, History_Record_Index *index_out){return(app->buffer_history_get_max_record_index(app, buffer_id, index_out));}
@ -887,6 +867,7 @@ static int32_t get_available_font_count(Application_Links *app){return(app->get_
static Available_Font get_available_font(Application_Links *app, int32_t index){return(app->get_available_font(app, index));}
static void set_theme_colors(Application_Links *app, Theme_Color *colors, int32_t count){(app->set_theme_colors(app, colors, count));}
static void get_theme_colors(Application_Links *app, Theme_Color *colors, int32_t count){(app->get_theme_colors(app, colors, count));}
static argb_color finalize_color(Application_Links *app, int_color color){return(app->finalize_color(app, color));}
static int32_t get_hot_directory(Application_Links *app, String *out, int32_t *required_size_out){return(app->get_hot_directory(app, out, required_size_out));}
static bool32 set_hot_directory(Application_Links *app, String string){return(app->set_hot_directory(app, string));}
static bool32 get_file_list(Application_Links *app, String directory, File_List *list_out){return(app->get_file_list(app, directory, list_out));}
@ -899,13 +880,14 @@ static bool32 file_get_attributes(Application_Links *app, String file_name, File
static bool32 directory_cd(Application_Links *app, String *directory, String relative_path){return(app->directory_cd(app, directory, relative_path));}
static bool32 get_4ed_path(Application_Links *app, String *path_out, int32_t *required_size_out){return(app->get_4ed_path(app, path_out, required_size_out));}
static void show_mouse_cursor(Application_Links *app, Mouse_Cursor_Show_Type show){(app->show_mouse_cursor(app, show));}
static bool32 set_edit_finished_hook_repeat_speed(Application_Links *app, u32 milliseconds){return(app->set_edit_finished_hook_repeat_speed(app, milliseconds));}
static bool32 set_fullscreen(Application_Links *app, bool32 full_screen){return(app->set_fullscreen(app, full_screen));}
static bool32 is_fullscreen(Application_Links *app){return(app->is_fullscreen(app));}
static void send_exit_signal(Application_Links *app){(app->send_exit_signal(app));}
static bool32 set_window_title(Application_Links *app, String title){return(app->set_window_title(app, title));}
static Microsecond_Time_Stamp get_microseconds_timestamp(Application_Links *app){return(app->get_microseconds_timestamp(app));}
static float draw_string(Application_Links *app, Face_ID font_id, String str, Vec2 point, int_color color, u32 flags, Vec2 delta){return(app->draw_string(app, font_id, str, point, color, flags, delta));}
static float get_string_advance(Application_Links *app, Face_ID font_id, String str){return(app->get_string_advance(app, font_id, str));}
static Vec2 draw_string(Application_Links *app, Face_ID font_id, String str, Vec2 point, int_color color, u32 flags, Vec2 delta){return(app->draw_string(app, font_id, str, point, color, flags, delta));}
static f32 get_string_advance(Application_Links *app, Face_ID font_id, String str){return(app->get_string_advance(app, font_id, str));}
static void draw_rectangle(Application_Links *app, f32_Rect rect, int_color color){(app->draw_rectangle(app, rect, color));}
static void draw_rectangle_outline(Application_Links *app, f32_Rect rect, int_color color){(app->draw_rectangle_outline(app, rect, color));}
static Face_ID get_default_font_for_view(Application_Links *app, View_ID view_id){return(app->get_default_font_for_view(app, view_id));}
@ -1012,11 +994,6 @@ static int32_t get_active_query_bars(Application_Links *app, View_ID view_id, in
static bool32 start_query_bar(Application_Links *app, Query_Bar *bar, uint32_t flags){return(app->start_query_bar_(app, bar, flags));}
static void end_query_bar(Application_Links *app, Query_Bar *bar, uint32_t flags){(app->end_query_bar_(app, bar, flags));}
static bool32 print_message(Application_Links *app, String message){return(app->print_message_(app, message));}
static int32_t get_theme_count(Application_Links *app){return(app->get_theme_count_(app));}
static String get_theme_name(Application_Links *app, struct Partition *arena, int32_t index){return(app->get_theme_name_(app, arena, index));}
static bool32 create_theme(Application_Links *app, Theme *theme, String theme_name){return(app->create_theme_(app, theme, theme_name));}
static bool32 change_theme(Application_Links *app, String theme_name){return(app->change_theme_(app, theme_name));}
static bool32 change_theme_by_index(Application_Links *app, int32_t index){return(app->change_theme_by_index_(app, index));}
static Face_ID get_largest_face_id(Application_Links *app){return(app->get_largest_face_id_(app));}
static bool32 set_global_face(Application_Links *app, Face_ID id, bool32 apply_to_all_buffers){return(app->set_global_face_(app, id, apply_to_all_buffers));}
static bool32 buffer_history_get_max_record_index(Application_Links *app, Buffer_ID buffer_id, History_Record_Index *index_out){return(app->buffer_history_get_max_record_index_(app, buffer_id, index_out));}
@ -1038,6 +1015,7 @@ static int32_t get_available_font_count(Application_Links *app){return(app->get_
static Available_Font get_available_font(Application_Links *app, int32_t index){return(app->get_available_font_(app, index));}
static void set_theme_colors(Application_Links *app, Theme_Color *colors, int32_t count){(app->set_theme_colors_(app, colors, count));}
static void get_theme_colors(Application_Links *app, Theme_Color *colors, int32_t count){(app->get_theme_colors_(app, colors, count));}
static argb_color finalize_color(Application_Links *app, int_color color){return(app->finalize_color_(app, color));}
static int32_t get_hot_directory(Application_Links *app, String *out, int32_t *required_size_out){return(app->get_hot_directory_(app, out, required_size_out));}
static bool32 set_hot_directory(Application_Links *app, String string){return(app->set_hot_directory_(app, string));}
static bool32 get_file_list(Application_Links *app, String directory, File_List *list_out){return(app->get_file_list_(app, directory, list_out));}
@ -1050,13 +1028,14 @@ static bool32 file_get_attributes(Application_Links *app, String file_name, File
static bool32 directory_cd(Application_Links *app, String *directory, String relative_path){return(app->directory_cd_(app, directory, relative_path));}
static bool32 get_4ed_path(Application_Links *app, String *path_out, int32_t *required_size_out){return(app->get_4ed_path_(app, path_out, required_size_out));}
static void show_mouse_cursor(Application_Links *app, Mouse_Cursor_Show_Type show){(app->show_mouse_cursor_(app, show));}
static bool32 set_edit_finished_hook_repeat_speed(Application_Links *app, u32 milliseconds){return(app->set_edit_finished_hook_repeat_speed_(app, milliseconds));}
static bool32 set_fullscreen(Application_Links *app, bool32 full_screen){return(app->set_fullscreen_(app, full_screen));}
static bool32 is_fullscreen(Application_Links *app){return(app->is_fullscreen_(app));}
static void send_exit_signal(Application_Links *app){(app->send_exit_signal_(app));}
static bool32 set_window_title(Application_Links *app, String title){return(app->set_window_title_(app, title));}
static Microsecond_Time_Stamp get_microseconds_timestamp(Application_Links *app){return(app->get_microseconds_timestamp_(app));}
static float draw_string(Application_Links *app, Face_ID font_id, String str, Vec2 point, int_color color, u32 flags, Vec2 delta){return(app->draw_string_(app, font_id, str, point, color, flags, delta));}
static float get_string_advance(Application_Links *app, Face_ID font_id, String str){return(app->get_string_advance_(app, font_id, str));}
static Vec2 draw_string(Application_Links *app, Face_ID font_id, String str, Vec2 point, int_color color, u32 flags, Vec2 delta){return(app->draw_string_(app, font_id, str, point, color, flags, delta));}
static f32 get_string_advance(Application_Links *app, Face_ID font_id, String str){return(app->get_string_advance_(app, font_id, str));}
static void draw_rectangle(Application_Links *app, f32_Rect rect, int_color color){(app->draw_rectangle_(app, rect, color));}
static void draw_rectangle_outline(Application_Links *app, f32_Rect rect, int_color color){(app->draw_rectangle_outline_(app, rect, color));}
static Face_ID get_default_font_for_view(Application_Links *app, View_ID view_id){return(app->get_default_font_for_view_(app, view_id));}

View File

@ -2,7 +2,7 @@
#define command_id(c) (fcoder_metacmd_ID_##c)
#define command_metadata(c) (&fcoder_metacmd_table[command_id(c)])
#define command_metadata_by_id(id) (&fcoder_metacmd_table[id])
#define command_one_past_last_id 234
#define command_one_past_last_id 233
#if defined(CUSTOM_COMMAND_SIG)
#define PROC_LINKS(x,y) x
#else
@ -138,7 +138,6 @@ CUSTOM_COMMAND_SIG(newline_or_goto_position_same_panel_sticky);
CUSTOM_COMMAND_SIG(newline_or_goto_position_sticky);
CUSTOM_COMMAND_SIG(open_all_code);
CUSTOM_COMMAND_SIG(open_all_code_recursive);
CUSTOM_COMMAND_SIG(open_color_tweaker);
CUSTOM_COMMAND_SIG(open_file_in_quotes);
CUSTOM_COMMAND_SIG(open_in_other);
CUSTOM_COMMAND_SIG(open_long_braces);
@ -162,7 +161,6 @@ CUSTOM_COMMAND_SIG(query_replace_identifier);
CUSTOM_COMMAND_SIG(query_replace_selection);
CUSTOM_COMMAND_SIG(redo);
CUSTOM_COMMAND_SIG(redo_this_buffer);
CUSTOM_COMMAND_SIG(reload_themes);
CUSTOM_COMMAND_SIG(remap_interactive);
CUSTOM_COMMAND_SIG(rename_file_query);
CUSTOM_COMMAND_SIG(rename_parameter);
@ -219,6 +217,7 @@ CUSTOM_COMMAND_SIG(swap_buffers_between_panels);
CUSTOM_COMMAND_SIG(to_lowercase);
CUSTOM_COMMAND_SIG(to_uppercase);
CUSTOM_COMMAND_SIG(toggle_filebar);
CUSTOM_COMMAND_SIG(toggle_fps_meter);
CUSTOM_COMMAND_SIG(toggle_fullscreen);
CUSTOM_COMMAND_SIG(toggle_highlight_enclosing_scopes);
CUSTOM_COMMAND_SIG(toggle_highlight_line_at_cursor);
@ -254,77 +253,77 @@ char *source_name;
int32_t source_name_len;
int32_t line_number;
};
static Command_Metadata fcoder_metacmd_table[234] = {
static Command_Metadata fcoder_metacmd_table[233] = {
{ PROC_LINKS(allow_mouse, 0), "allow_mouse", 11, "Shows the mouse and causes all mouse input to be processed normally.", 68, "w:\\4ed\\code\\4coder_default_framework.cpp", 40, 250 },
{ PROC_LINKS(auto_tab_line_at_cursor, 0), "auto_tab_line_at_cursor", 23, "Auto-indents the line on which the cursor sits.", 47, "w:\\4ed\\code\\4coder_auto_indent.cpp", 34, 721 },
{ PROC_LINKS(auto_tab_range, 0), "auto_tab_range", 14, "Auto-indents the range between the cursor and the mark.", 55, "w:\\4ed\\code\\4coder_auto_indent.cpp", 34, 732 },
{ PROC_LINKS(auto_tab_whole_file, 0), "auto_tab_whole_file", 19, "Audo-indents the entire current buffer.", 39, "w:\\4ed\\code\\4coder_auto_indent.cpp", 34, 711 },
{ PROC_LINKS(auto_tab_line_at_cursor, 0), "auto_tab_line_at_cursor", 23, "Auto-indents the line on which the cursor sits.", 47, "w:\\4ed\\code\\4coder_auto_indent.cpp", 34, 630 },
{ PROC_LINKS(auto_tab_range, 0), "auto_tab_range", 14, "Auto-indents the range between the cursor and the mark.", 55, "w:\\4ed\\code\\4coder_auto_indent.cpp", 34, 641 },
{ PROC_LINKS(auto_tab_whole_file, 0), "auto_tab_whole_file", 19, "Audo-indents the entire current buffer.", 39, "w:\\4ed\\code\\4coder_auto_indent.cpp", 34, 620 },
{ PROC_LINKS(backspace_char, 0), "backspace_char", 14, "Deletes the character to the left of the cursor.", 48, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 101 },
{ PROC_LINKS(backspace_word, 0), "backspace_word", 14, "Delete characters between the cursor position and the first alphanumeric boundary to the left.", 94, "w:\\4ed\\code\\4coder_seek.cpp", 27, 1257 },
{ PROC_LINKS(basic_change_active_panel, 0), "basic_change_active_panel", 25, "Change the currently active panel, moving to the panel with the next highest view_id. Will not skipe the build panel if it is open.", 132, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 509 },
{ PROC_LINKS(basic_change_active_panel, 0), "basic_change_active_panel", 25, "Change the currently active panel, moving to the panel with the next highest view_id. Will not skipe the build panel if it is open.", 132, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 495 },
{ PROC_LINKS(build_in_build_panel, 0), "build_in_build_panel", 20, "Looks for a build.bat, build.sh, or makefile in the current and parent directories. Runs the first that it finds and prints the output to *compilation*. Puts the *compilation* buffer in a panel at the footer of the current view.", 230, "w:\\4ed\\code\\4coder_build_commands.cpp", 37, 187 },
{ PROC_LINKS(build_search, 0), "build_search", 12, "Looks for a build.bat, build.sh, or makefile in the current and parent directories. Runs the first that it finds and prints the output to *compilation*.", 153, "w:\\4ed\\code\\4coder_build_commands.cpp", 37, 155 },
{ PROC_LINKS(center_view, 0), "center_view", 11, "Centers the view vertically on the line on which the cursor sits.", 65, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 151 },
{ PROC_LINKS(change_active_panel, 0), "change_active_panel", 19, "Change the currently active panel, moving to the panel with the next highest view_id.", 85, "w:\\4ed\\code\\4coder_default_framework.cpp", 40, 152 },
{ PROC_LINKS(change_active_panel_backwards, 0), "change_active_panel_backwards", 29, "Change the currently active panel, moving to the panel with the next lowest view_id.", 84, "w:\\4ed\\code\\4coder_default_framework.cpp", 40, 162 },
{ PROC_LINKS(change_to_build_panel, 0), "change_to_build_panel", 21, "If the special build panel is open, makes the build panel the active panel.", 75, "w:\\4ed\\code\\4coder_build_commands.cpp", 37, 209 },
{ PROC_LINKS(clean_all_lines, 0), "clean_all_lines", 15, "Removes trailing whitespace from all lines in the current buffer.", 65, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 444 },
{ PROC_LINKS(click_set_cursor, 0), "click_set_cursor", 16, "Sets the cursor position to the mouse position.", 47, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 218 },
{ PROC_LINKS(click_set_cursor_and_mark, 0), "click_set_cursor_and_mark", 25, "Sets the cursor position and mark to the mouse position.", 56, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 205 },
{ PROC_LINKS(click_set_cursor_if_lbutton, 0), "click_set_cursor_if_lbutton", 27, "If the mouse left button is pressed, sets the cursor position to the mouse position.", 84, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 231 },
{ PROC_LINKS(click_set_mark, 0), "click_set_mark", 14, "Sets the mark position to the mouse position.", 45, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 246 },
{ PROC_LINKS(clean_all_lines, 0), "clean_all_lines", 15, "Removes trailing whitespace from all lines in the current buffer.", 65, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 430 },
{ PROC_LINKS(click_set_cursor, 0), "click_set_cursor", 16, "Sets the cursor position to the mouse position.", 47, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 207 },
{ PROC_LINKS(click_set_cursor_and_mark, 0), "click_set_cursor_and_mark", 25, "Sets the cursor position and mark to the mouse position.", 56, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 195 },
{ PROC_LINKS(click_set_cursor_if_lbutton, 0), "click_set_cursor_if_lbutton", 27, "If the mouse left button is pressed, sets the cursor position to the mouse position.", 84, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 219 },
{ PROC_LINKS(click_set_mark, 0), "click_set_mark", 14, "Sets the mark position to the mouse position.", 45, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 233 },
{ PROC_LINKS(close_all_code, 0), "close_all_code", 14, "Closes any buffer with a filename ending with an extension configured to be recognized as a code file type.", 107, "w:\\4ed\\code\\4coder_project_commands.cpp", 39, 1060 },
{ PROC_LINKS(close_build_panel, 0), "close_build_panel", 17, "If the special build panel is open, closes it.", 46, "w:\\4ed\\code\\4coder_build_commands.cpp", 37, 203 },
{ PROC_LINKS(close_panel, 0), "close_panel", 11, "Closes the currently active panel if it is not the only panel open.", 67, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 517 },
{ PROC_LINKS(command_lister, 0), "command_lister", 14, "Opens an interactive list of all registered commands.", 53, "w:\\4ed\\code\\4coder_lists.cpp", 28, 977 },
{ PROC_LINKS(close_panel, 0), "close_panel", 11, "Closes the currently active panel if it is not the only panel open.", 67, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 503 },
{ PROC_LINKS(command_lister, 0), "command_lister", 14, "Opens an interactive list of all registered commands.", 53, "w:\\4ed\\code\\4coder_lists.cpp", 28, 979 },
{ PROC_LINKS(comment_line, 0), "comment_line", 12, "Insert '//' at the beginning of the line after leading whitespace.", 66, "w:\\4ed\\code\\4coder_combined_write_commands.cpp", 46, 135 },
{ PROC_LINKS(comment_line_toggle, 0), "comment_line_toggle", 19, "Turns uncommented lines into commented lines and vice versa for comments starting with '//'.", 92, "w:\\4ed\\code\\4coder_combined_write_commands.cpp", 46, 159 },
{ PROC_LINKS(copy, 0), "copy", 4, "Copy the text in the range from the cursor to the mark onto the clipboard.", 74, "w:\\4ed\\code\\4coder_clipboard.cpp", 32, 26 },
{ PROC_LINKS(cursor_mark_swap, 0), "cursor_mark_swap", 16, "Swaps the position of the cursor and the mark.", 46, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 129 },
{ PROC_LINKS(cut, 0), "cut", 3, "Cut the text in the range from the cursor to the mark onto the clipboard.", 73, "w:\\4ed\\code\\4coder_clipboard.cpp", 32, 35 },
{ PROC_LINKS(decrease_face_size, 0), "decrease_face_size", 18, "Decrease the size of the face used by the current buffer.", 57, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 607 },
{ PROC_LINKS(decrease_line_wrap, 0), "decrease_line_wrap", 18, "Decrases the current buffer's width for line wrapping.", 54, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 584 },
{ PROC_LINKS(decrease_face_size, 0), "decrease_face_size", 18, "Decrease the size of the face used by the current buffer.", 57, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 598 },
{ PROC_LINKS(decrease_line_wrap, 0), "decrease_line_wrap", 18, "Decrases the current buffer's width for line wrapping.", 54, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 575 },
{ PROC_LINKS(delete_char, 0), "delete_char", 11, "Deletes the character to the right of the cursor.", 49, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 83 },
{ PROC_LINKS(delete_current_scope, 0), "delete_current_scope", 20, "Deletes the braces surrounding the currently selected scope. Leaves the contents within the scope.", 99, "w:\\4ed\\code\\4coder_scope_commands.cpp", 37, 512 },
{ PROC_LINKS(delete_file_query, 0), "delete_file_query", 17, "Deletes the file of the current buffer if 4coder has the appropriate access rights. Will ask the user for confirmation first.", 125, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1170 },
{ PROC_LINKS(delete_line, 0), "delete_line", 11, "Delete the line the on which the cursor sits.", 45, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1422 },
{ PROC_LINKS(delete_file_query, 0), "delete_file_query", 17, "Deletes the file of the current buffer if 4coder has the appropriate access rights. Will ask the user for confirmation first.", 125, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1161 },
{ PROC_LINKS(delete_line, 0), "delete_line", 11, "Delete the line the on which the cursor sits.", 45, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1413 },
{ PROC_LINKS(delete_range, 0), "delete_range", 12, "Deletes the text in the range between the cursor and the mark.", 62, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 139 },
{ PROC_LINKS(delete_word, 0), "delete_word", 11, "Delete characters between the cursor position and the first alphanumeric boundary to the right.", 95, "w:\\4ed\\code\\4coder_seek.cpp", 27, 1263 },
{ PROC_LINKS(duplicate_line, 0), "duplicate_line", 14, "Create a copy of the line on which the cursor sits.", 51, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1400 },
{ PROC_LINKS(eol_dosify, 0), "eol_dosify", 10, "Puts the buffer in DOS line ending mode.", 40, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 654 },
{ PROC_LINKS(eol_nixify, 0), "eol_nixify", 10, "Puts the buffer in NIX line ending mode.", 40, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 662 },
{ PROC_LINKS(duplicate_line, 0), "duplicate_line", 14, "Create a copy of the line on which the cursor sits.", 51, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1391 },
{ PROC_LINKS(eol_dosify, 0), "eol_dosify", 10, "Puts the buffer in DOS line ending mode.", 40, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 645 },
{ PROC_LINKS(eol_nixify, 0), "eol_nixify", 10, "Puts the buffer in NIX line ending mode.", 40, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 653 },
{ PROC_LINKS(execute_any_cli, 0), "execute_any_cli", 15, "Queries for an output buffer name and system command, runs the system command as a CLI and prints the output to the specified buffer.", 133, "w:\\4ed\\code\\4coder_system_command.cpp", 37, 23 },
{ PROC_LINKS(execute_previous_cli, 0), "execute_previous_cli", 20, "If the command execute_any_cli has already been used, this will execute a CLI reusing the most recent buffer name and command.", 126, "w:\\4ed\\code\\4coder_system_command.cpp", 37, 7 },
{ PROC_LINKS(exit_4coder, 0), "exit_4coder", 11, "Attempts to close 4coder.", 25, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 670 },
{ PROC_LINKS(exit_4coder, 0), "exit_4coder", 11, "Attempts to close 4coder.", 25, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 661 },
{ PROC_LINKS(goto_beginning_of_file, 0), "goto_beginning_of_file", 22, "Sets the cursor to the beginning of the file.", 45, "w:\\4ed\\code\\4coder_seek.cpp", 27, 1176 },
{ PROC_LINKS(goto_end_of_file, 0), "goto_end_of_file", 16, "Sets the cursor to the end of the file.", 39, "w:\\4ed\\code\\4coder_seek.cpp", 27, 1184 },
{ PROC_LINKS(goto_first_jump_direct, 0), "goto_first_jump_direct", 22, "If a buffer containing jump locations has been locked in, goes to the first jump in the buffer.", 95, "w:\\4ed\\code\\4coder_jump_direct.cpp", 34, 84 },
{ PROC_LINKS(goto_first_jump_same_panel_sticky, 0), "goto_first_jump_same_panel_sticky", 33, "If a buffer containing jump locations has been locked in, goes to the first jump in the buffer and views the buffer in the panel where the jump list was.", 153, "w:\\4ed\\code\\4coder_jump_sticky.cpp", 34, 551 },
{ PROC_LINKS(goto_first_jump_sticky, 0), "goto_first_jump_sticky", 22, "If a buffer containing jump locations has been locked in, goes to the first jump in the buffer.", 95, "w:\\4ed\\code\\4coder_jump_sticky.cpp", 34, 533 },
{ PROC_LINKS(goto_first_jump_same_panel_sticky, 0), "goto_first_jump_same_panel_sticky", 33, "If a buffer containing jump locations has been locked in, goes to the first jump in the buffer and views the buffer in the panel where the jump list was.", 153, "w:\\4ed\\code\\4coder_jump_sticky.cpp", 34, 547 },
{ PROC_LINKS(goto_first_jump_sticky, 0), "goto_first_jump_sticky", 22, "If a buffer containing jump locations has been locked in, goes to the first jump in the buffer.", 95, "w:\\4ed\\code\\4coder_jump_sticky.cpp", 34, 529 },
{ PROC_LINKS(goto_jump_at_cursor_direct, 0), "goto_jump_at_cursor_direct", 26, "If the cursor is found to be on a jump location, parses the jump location and brings up the file and position in another view and changes the active panel to the view containing the jump.", 187, "w:\\4ed\\code\\4coder_jump_direct.cpp", 34, 8 },
{ PROC_LINKS(goto_jump_at_cursor_same_panel_direct, 0), "goto_jump_at_cursor_same_panel_direct", 37, "If the cursor is found to be on a jump location, parses the jump location and brings up the file and position in this view, losing the compilation output or jump list..", 168, "w:\\4ed\\code\\4coder_jump_direct.cpp", 34, 29 },
{ PROC_LINKS(goto_jump_at_cursor_same_panel_sticky, 0), "goto_jump_at_cursor_same_panel_sticky", 37, "If the cursor is found to be on a jump location, parses the jump location and brings up the file and position in this view, losing the compilation output or jump list.", 167, "w:\\4ed\\code\\4coder_jump_sticky.cpp", 34, 377 },
{ PROC_LINKS(goto_jump_at_cursor_sticky, 0), "goto_jump_at_cursor_sticky", 26, "If the cursor is found to be on a jump location, parses the jump location and brings up the file and position in another view and changes the active panel to the view containing the jump.", 187, "w:\\4ed\\code\\4coder_jump_sticky.cpp", 34, 349 },
{ PROC_LINKS(goto_line, 0), "goto_line", 9, "Queries the user for a number, and jumps the cursor to the corresponding line.", 78, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 678 },
{ PROC_LINKS(goto_jump_at_cursor_same_panel_sticky, 0), "goto_jump_at_cursor_same_panel_sticky", 37, "If the cursor is found to be on a jump location, parses the jump location and brings up the file and position in this view, losing the compilation output or jump list.", 167, "w:\\4ed\\code\\4coder_jump_sticky.cpp", 34, 373 },
{ PROC_LINKS(goto_jump_at_cursor_sticky, 0), "goto_jump_at_cursor_sticky", 26, "If the cursor is found to be on a jump location, parses the jump location and brings up the file and position in another view and changes the active panel to the view containing the jump.", 187, "w:\\4ed\\code\\4coder_jump_sticky.cpp", 34, 345 },
{ PROC_LINKS(goto_line, 0), "goto_line", 9, "Queries the user for a number, and jumps the cursor to the corresponding line.", 78, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 669 },
{ PROC_LINKS(goto_next_jump_direct, 0), "goto_next_jump_direct", 21, "If a buffer containing jump locations has been locked in, goes to the next jump in the buffer, skipping sub jump locations.", 123, "w:\\4ed\\code\\4coder_jump_direct.cpp", 34, 48 },
{ PROC_LINKS(goto_next_jump_no_skips_direct, 0), "goto_next_jump_no_skips_direct", 30, "If a buffer containing jump locations has been locked in, goes to the next jump in the buffer, and does not skip sub jump locations.", 132, "w:\\4ed\\code\\4coder_jump_direct.cpp", 34, 66 },
{ PROC_LINKS(goto_next_jump_no_skips_sticky, 0), "goto_next_jump_no_skips_sticky", 30, "If a buffer containing jump locations has been locked in, goes to the next jump in the buffer, and does not skip sub jump locations.", 132, "w:\\4ed\\code\\4coder_jump_sticky.cpp", 34, 502 },
{ PROC_LINKS(goto_next_jump_sticky, 0), "goto_next_jump_sticky", 21, "If a buffer containing jump locations has been locked in, goes to the next jump in the buffer, skipping sub jump locations.", 123, "w:\\4ed\\code\\4coder_jump_sticky.cpp", 34, 472 },
{ PROC_LINKS(goto_next_jump_no_skips_sticky, 0), "goto_next_jump_no_skips_sticky", 30, "If a buffer containing jump locations has been locked in, goes to the next jump in the buffer, and does not skip sub jump locations.", 132, "w:\\4ed\\code\\4coder_jump_sticky.cpp", 34, 498 },
{ PROC_LINKS(goto_next_jump_sticky, 0), "goto_next_jump_sticky", 21, "If a buffer containing jump locations has been locked in, goes to the next jump in the buffer, skipping sub jump locations.", 123, "w:\\4ed\\code\\4coder_jump_sticky.cpp", 34, 468 },
{ PROC_LINKS(goto_prev_jump_direct, 0), "goto_prev_jump_direct", 21, "If a buffer containing jump locations has been locked in, goes to the previous jump in the buffer, skipping sub jump locations.", 127, "w:\\4ed\\code\\4coder_jump_direct.cpp", 34, 57 },
{ PROC_LINKS(goto_prev_jump_no_skips_direct, 0), "goto_prev_jump_no_skips_direct", 30, "If a buffer containing jump locations has been locked in, goes to the previous jump in the buffer, and does not skip sub jump locations.", 136, "w:\\4ed\\code\\4coder_jump_direct.cpp", 34, 75 },
{ PROC_LINKS(goto_prev_jump_no_skips_sticky, 0), "goto_prev_jump_no_skips_sticky", 30, "If a buffer containing jump locations has been locked in, goes to the previous jump in the buffer, and does not skip sub jump locations.", 136, "w:\\4ed\\code\\4coder_jump_sticky.cpp", 34, 518 },
{ PROC_LINKS(goto_prev_jump_sticky, 0), "goto_prev_jump_sticky", 21, "If a buffer containing jump locations has been locked in, goes to the previous jump in the buffer, skipping sub jump locations.", 127, "w:\\4ed\\code\\4coder_jump_sticky.cpp", 34, 488 },
{ PROC_LINKS(hide_filebar, 0), "hide_filebar", 12, "Sets the current view to hide it's filebar.", 43, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 547 },
{ PROC_LINKS(hide_scrollbar, 0), "hide_scrollbar", 14, "Sets the current view to hide it's scrollbar.", 45, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 533 },
{ PROC_LINKS(goto_prev_jump_no_skips_sticky, 0), "goto_prev_jump_no_skips_sticky", 30, "If a buffer containing jump locations has been locked in, goes to the previous jump in the buffer, and does not skip sub jump locations.", 136, "w:\\4ed\\code\\4coder_jump_sticky.cpp", 34, 514 },
{ PROC_LINKS(goto_prev_jump_sticky, 0), "goto_prev_jump_sticky", 21, "If a buffer containing jump locations has been locked in, goes to the previous jump in the buffer, skipping sub jump locations.", 127, "w:\\4ed\\code\\4coder_jump_sticky.cpp", 34, 484 },
{ PROC_LINKS(hide_filebar, 0), "hide_filebar", 12, "Sets the current view to hide it's filebar.", 43, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 533 },
{ PROC_LINKS(hide_scrollbar, 0), "hide_scrollbar", 14, "Sets the current view to hide it's scrollbar.", 45, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 519 },
{ PROC_LINKS(if0_off, 0), "if0_off", 7, "Surround the range between the cursor and mark with an '#if 0' and an '#endif'", 78, "w:\\4ed\\code\\4coder_combined_write_commands.cpp", 46, 79 },
{ PROC_LINKS(increase_face_size, 0), "increase_face_size", 18, "Increase the size of the face used by the current buffer.", 57, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 595 },
{ PROC_LINKS(increase_line_wrap, 0), "increase_line_wrap", 18, "Increases the current buffer's width for line wrapping.", 55, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 573 },
{ PROC_LINKS(increase_face_size, 0), "increase_face_size", 18, "Increase the size of the face used by the current buffer.", 57, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 586 },
{ PROC_LINKS(increase_line_wrap, 0), "increase_line_wrap", 18, "Increases the current buffer's width for line wrapping.", 55, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 564 },
{ PROC_LINKS(interactive_kill_buffer, 0), "interactive_kill_buffer", 23, "Interactively kill an open buffer.", 34, "w:\\4ed\\code\\4coder_lists.cpp", 28, 780 },
{ PROC_LINKS(interactive_new, 0), "interactive_new", 15, "Interactively creates a new file.", 33, "w:\\4ed\\code\\4coder_lists.cpp", 28, 890 },
{ PROC_LINKS(interactive_open, 0), "interactive_open", 16, "Interactively opens a file.", 27, "w:\\4ed\\code\\4coder_lists.cpp", 28, 922 },
{ PROC_LINKS(interactive_open_or_new, 0), "interactive_open_or_new", 23, "Interactively open a file out of the file system.", 49, "w:\\4ed\\code\\4coder_lists.cpp", 28, 852 },
{ PROC_LINKS(interactive_switch_buffer, 0), "interactive_switch_buffer", 25, "Interactively switch to an open buffer.", 39, "w:\\4ed\\code\\4coder_lists.cpp", 28, 761 },
{ PROC_LINKS(kill_buffer, 0), "kill_buffer", 11, "Kills the current buffer.", 25, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1592 },
{ PROC_LINKS(kill_buffer, 0), "kill_buffer", 11, "Kills the current buffer.", 25, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1583 },
{ PROC_LINKS(kill_rect, 0), "kill_rect", 9, "Delete characters in a rectangular region. Range testing is done by unwrapped-xy coordinates.", 93, "w:\\4ed\\code\\4coder_experiments.cpp", 34, 26 },
{ PROC_LINKS(left_adjust_view, 0), "left_adjust_view", 16, "Sets the left size of the view near the x position of the cursor.", 65, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 166 },
{ PROC_LINKS(list_all_functions_all_buffers, 0), "list_all_functions_all_buffers", 30, "Creates a jump list of lines from all buffers that appear to define or declare functions.", 89, "w:\\4ed\\code\\4coder_function_list.cpp", 36, 332 },
@ -359,42 +358,41 @@ static Command_Metadata fcoder_metacmd_table[234] = {
{ PROC_LINKS(lister__write_character__file_path, 0), "lister__write_character__file_path", 34, "A lister mode command that inserts a character into the text field of a file system list.", 89, "w:\\4ed\\code\\4coder_lists.cpp", 28, 193 },
{ PROC_LINKS(lister__write_character__fixed_list, 0), "lister__write_character__fixed_list", 35, "A lister mode command that handles input for the fixed sure to kill list.", 73, "w:\\4ed\\code\\4coder_lists.cpp", 28, 253 },
{ PROC_LINKS(load_project, 0), "load_project", 12, "Looks for a project.4coder file in the current directory and tries to load it. Looks in parent directories until a project file is found or there are no more parents.", 167, "w:\\4ed\\code\\4coder_project_commands.cpp", 39, 1083 },
{ PROC_LINKS(make_directory_query, 0), "make_directory_query", 20, "Queries the user for a name and creates a new directory with the given name.", 76, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1280 },
{ PROC_LINKS(make_directory_query, 0), "make_directory_query", 20, "Queries the user for a name and creates a new directory with the given name.", 76, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1271 },
{ PROC_LINKS(miblo_decrement_basic, 0), "miblo_decrement_basic", 21, "Decrement an integer under the cursor by one.", 45, "w:\\4ed\\code\\4coder_miblo_numbers.cpp", 36, 110 },
{ PROC_LINKS(miblo_decrement_time_stamp, 0), "miblo_decrement_time_stamp", 26, "Decrement a time stamp under the cursor by one second. (format [m]m:ss or h:mm:ss", 81, "w:\\4ed\\code\\4coder_miblo_numbers.cpp", 36, 383 },
{ PROC_LINKS(miblo_decrement_time_stamp_minute, 0), "miblo_decrement_time_stamp_minute", 33, "Decrement a time stamp under the cursor by one minute. (format [m]m:ss or h:mm:ss", 81, "w:\\4ed\\code\\4coder_miblo_numbers.cpp", 36, 395 },
{ PROC_LINKS(miblo_increment_basic, 0), "miblo_increment_basic", 21, "Increment an integer under the cursor by one.", 45, "w:\\4ed\\code\\4coder_miblo_numbers.cpp", 36, 94 },
{ PROC_LINKS(miblo_increment_time_stamp, 0), "miblo_increment_time_stamp", 26, "Increment a time stamp under the cursor by one second. (format [m]m:ss or h:mm:ss", 81, "w:\\4ed\\code\\4coder_miblo_numbers.cpp", 36, 377 },
{ PROC_LINKS(miblo_increment_time_stamp_minute, 0), "miblo_increment_time_stamp_minute", 33, "Increment a time stamp under the cursor by one minute. (format [m]m:ss or h:mm:ss", 81, "w:\\4ed\\code\\4coder_miblo_numbers.cpp", 36, 389 },
{ PROC_LINKS(mouse_wheel_change_face_size, 0), "mouse_wheel_change_face_size", 28, "Reads the state of the mouse wheel and uses it to either increase or decrease the face size.", 92, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 619 },
{ PROC_LINKS(mouse_wheel_scroll, 0), "mouse_wheel_scroll", 18, "Reads the scroll wheel value from the mouse state and scrolls accordingly.", 74, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 259 },
{ PROC_LINKS(move_down, 0), "move_down", 9, "Moves the cursor down one line.", 31, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 323 },
{ PROC_LINKS(move_down_10, 0), "move_down_10", 12, "Moves the cursor down ten lines.", 32, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 335 },
{ PROC_LINKS(move_down_textual, 0), "move_down_textual", 17, "Moves down to the next line of actual text, regardless of line wrapping.", 72, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 341 },
{ PROC_LINKS(move_left, 0), "move_left", 9, "Moves the cursor one character to the left.", 43, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 372 },
{ PROC_LINKS(move_line_down, 0), "move_line_down", 14, "Swaps the line under the cursor with the line below it, and moves the cursor down with it.", 90, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1377 },
{ PROC_LINKS(move_line_up, 0), "move_line_up", 12, "Swaps the line under the cursor with the line above it, and moves the cursor up with it.", 88, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1313 },
{ PROC_LINKS(move_right, 0), "move_right", 10, "Moves the cursor one character to the right.", 44, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 382 },
{ PROC_LINKS(move_up, 0), "move_up", 7, "Moves the cursor up one line.", 29, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 317 },
{ PROC_LINKS(move_up_10, 0), "move_up_10", 10, "Moves the cursor up ten lines.", 30, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 329 },
{ PROC_LINKS(mouse_wheel_change_face_size, 0), "mouse_wheel_change_face_size", 28, "Reads the state of the mouse wheel and uses it to either increase or decrease the face size.", 92, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 610 },
{ PROC_LINKS(mouse_wheel_scroll, 0), "mouse_wheel_scroll", 18, "Reads the scroll wheel value from the mouse state and scrolls accordingly.", 74, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 245 },
{ PROC_LINKS(move_down, 0), "move_down", 9, "Moves the cursor down one line.", 31, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 309 },
{ PROC_LINKS(move_down_10, 0), "move_down_10", 12, "Moves the cursor down ten lines.", 32, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 321 },
{ PROC_LINKS(move_down_textual, 0), "move_down_textual", 17, "Moves down to the next line of actual text, regardless of line wrapping.", 72, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 327 },
{ PROC_LINKS(move_left, 0), "move_left", 9, "Moves the cursor one character to the left.", 43, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 358 },
{ PROC_LINKS(move_line_down, 0), "move_line_down", 14, "Swaps the line under the cursor with the line below it, and moves the cursor down with it.", 90, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1368 },
{ PROC_LINKS(move_line_up, 0), "move_line_up", 12, "Swaps the line under the cursor with the line above it, and moves the cursor up with it.", 88, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1304 },
{ PROC_LINKS(move_right, 0), "move_right", 10, "Moves the cursor one character to the right.", 44, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 368 },
{ PROC_LINKS(move_up, 0), "move_up", 7, "Moves the cursor up one line.", 29, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 303 },
{ PROC_LINKS(move_up_10, 0), "move_up_10", 10, "Moves the cursor up ten lines.", 30, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 315 },
{ PROC_LINKS(multi_line_edit, 0), "multi_line_edit", 15, "Begin multi-line mode. In multi-line mode characters are inserted at every line between the mark and cursor. All characters are inserted at the same character offset into the line. This mode uses line_char coordinates.", 221, "w:\\4ed\\code\\4coder_experiments.cpp", 34, 117 },
{ PROC_LINKS(newline_or_goto_position_direct, 0), "newline_or_goto_position_direct", 31, "If the buffer in the active view is writable, inserts a character, otherwise performs goto_jump_at_cursor.", 106, "w:\\4ed\\code\\4coder_jump_direct.cpp", 34, 101 },
{ PROC_LINKS(newline_or_goto_position_same_panel_direct, 0), "newline_or_goto_position_same_panel_direct", 42, "If the buffer in the active view is writable, inserts a character, otherwise performs goto_jump_at_cursor_same_panel.", 117, "w:\\4ed\\code\\4coder_jump_direct.cpp", 34, 116 },
{ PROC_LINKS(newline_or_goto_position_same_panel_sticky, 0), "newline_or_goto_position_same_panel_sticky", 42, "If the buffer in the active view is writable, inserts a character, otherwise performs goto_jump_at_cursor_same_panel.", 117, "w:\\4ed\\code\\4coder_jump_sticky.cpp", 34, 588 },
{ PROC_LINKS(newline_or_goto_position_sticky, 0), "newline_or_goto_position_sticky", 31, "If the buffer in the active view is writable, inserts a character, otherwise performs goto_jump_at_cursor.", 106, "w:\\4ed\\code\\4coder_jump_sticky.cpp", 34, 574 },
{ PROC_LINKS(newline_or_goto_position_same_panel_sticky, 0), "newline_or_goto_position_same_panel_sticky", 42, "If the buffer in the active view is writable, inserts a character, otherwise performs goto_jump_at_cursor_same_panel.", 117, "w:\\4ed\\code\\4coder_jump_sticky.cpp", 34, 584 },
{ PROC_LINKS(newline_or_goto_position_sticky, 0), "newline_or_goto_position_sticky", 31, "If the buffer in the active view is writable, inserts a character, otherwise performs goto_jump_at_cursor.", 106, "w:\\4ed\\code\\4coder_jump_sticky.cpp", 34, 570 },
{ PROC_LINKS(open_all_code, 0), "open_all_code", 13, "Open all code in the current directory. File types are determined by extensions. An extension is considered code based on the extensions specified in 4coder.config.", 164, "w:\\4ed\\code\\4coder_project_commands.cpp", 39, 1067 },
{ PROC_LINKS(open_all_code_recursive, 0), "open_all_code_recursive", 23, "Works as open_all_code but also runs in all subdirectories.", 59, "w:\\4ed\\code\\4coder_project_commands.cpp", 39, 1074 },
{ PROC_LINKS(open_color_tweaker, 0), "open_color_tweaker", 18, "Opens the 4coder theme selector list.", 37, "w:\\4ed\\code\\4coder_lists.cpp", 28, 938 },
{ PROC_LINKS(open_file_in_quotes, 0), "open_file_in_quotes", 19, "Reads a filename from surrounding '\"' characters and attempts to open the corresponding file.", 94, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1499 },
{ PROC_LINKS(open_in_other, 0), "open_in_other", 13, "Interactively opens a file in the other panel.", 46, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1816 },
{ PROC_LINKS(open_file_in_quotes, 0), "open_file_in_quotes", 19, "Reads a filename from surrounding '\"' characters and attempts to open the corresponding file.", 94, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1490 },
{ PROC_LINKS(open_in_other, 0), "open_in_other", 13, "Interactively opens a file in the other panel.", 46, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1809 },
{ PROC_LINKS(open_long_braces, 0), "open_long_braces", 16, "At the cursor, insert a '{' and '}' separated by a blank line.", 62, "w:\\4ed\\code\\4coder_combined_write_commands.cpp", 46, 55 },
{ PROC_LINKS(open_long_braces_break, 0), "open_long_braces_break", 22, "At the cursor, insert a '{' and '}break;' separated by a blank line.", 68, "w:\\4ed\\code\\4coder_combined_write_commands.cpp", 46, 71 },
{ PROC_LINKS(open_long_braces_semicolon, 0), "open_long_braces_semicolon", 26, "At the cursor, insert a '{' and '};' separated by a blank line.", 63, "w:\\4ed\\code\\4coder_combined_write_commands.cpp", 46, 63 },
{ PROC_LINKS(open_matching_file_cpp, 0), "open_matching_file_cpp", 22, "If the current file is a *.cpp or *.h, attempts to open the corresponding *.h or *.cpp file in the other view.", 110, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1535 },
{ PROC_LINKS(open_matching_file_cpp, 0), "open_matching_file_cpp", 22, "If the current file is a *.cpp or *.h, attempts to open the corresponding *.h or *.cpp file in the other view.", 110, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1526 },
{ PROC_LINKS(open_panel_hsplit, 0), "open_panel_hsplit", 17, "Create a new panel by horizontally splitting the active panel.", 62, "w:\\4ed\\code\\4coder_default_framework.cpp", 40, 181 },
{ PROC_LINKS(open_panel_vsplit, 0), "open_panel_vsplit", 17, "Create a new panel by vertically splitting the active panel.", 60, "w:\\4ed\\code\\4coder_default_framework.cpp", 40, 172 },
{ PROC_LINKS(page_down, 0), "page_down", 9, "Scrolls the view down one view height and moves the cursor down one view height.", 80, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 361 },
{ PROC_LINKS(page_up, 0), "page_up", 7, "Scrolls the view up one view height and moves the cursor up one view height.", 76, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 352 },
{ PROC_LINKS(page_down, 0), "page_down", 9, "Scrolls the view down one view height and moves the cursor down one view height.", 80, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 347 },
{ PROC_LINKS(page_up, 0), "page_up", 7, "Scrolls the view up one view height and moves the cursor up one view height.", 76, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 338 },
{ PROC_LINKS(paste, 0), "paste", 5, "At the cursor, insert the text at the top of the clipboard.", 59, "w:\\4ed\\code\\4coder_clipboard.cpp", 32, 46 },
{ PROC_LINKS(paste_and_indent, 0), "paste_and_indent", 16, "Paste from the top of clipboard and run auto-indent on the newly pasted text.", 77, "w:\\4ed\\code\\4coder_clipboard.cpp", 32, 134 },
{ PROC_LINKS(paste_next, 0), "paste_next", 10, "If the previous command was paste or paste_next, replaces the paste range with the next text down on the clipboard, otherwise operates as the paste command.", 156, "w:\\4ed\\code\\4coder_clipboard.cpp", 32, 85 },
@ -403,26 +401,25 @@ static Command_Metadata fcoder_metacmd_table[234] = {
{ PROC_LINKS(project_command_lister, 0), "project_command_lister", 22, "Open a lister of all commands in the currently loaded project.", 62, "w:\\4ed\\code\\4coder_project_commands.cpp", 39, 1527 },
{ PROC_LINKS(project_fkey_command, 0), "project_fkey_command", 20, "Run an 'fkey command' configured in a project.4coder file. Determines the index of the 'fkey command' by which function key or numeric key was pressed to trigger the command.", 175, "w:\\4ed\\code\\4coder_project_commands.cpp", 39, 1090 },
{ PROC_LINKS(project_go_to_root_directory, 0), "project_go_to_root_directory", 28, "Changes 4coder's hot directory to the root directory of the currently loaded project. With no loaded project nothing hapepns.", 125, "w:\\4ed\\code\\4coder_project_commands.cpp", 39, 1113 },
{ PROC_LINKS(query_replace, 0), "query_replace", 13, "Queries the user for two strings, and incrementally replaces every occurence of the first string with the second string.", 120, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1054 },
{ PROC_LINKS(query_replace_identifier, 0), "query_replace_identifier", 24, "Queries the user for a string, and incrementally replace every occurence of the word or token found at the cursor with the specified string.", 140, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1078 },
{ PROC_LINKS(query_replace_selection, 0), "query_replace_selection", 23, "Queries the user for a string, and incrementally replace every occurence of the string found in the selected range with the specified string.", 141, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1096 },
{ PROC_LINKS(redo, 0), "redo", 4, "Advances forward through the undo history in the buffer containing the most recent regular edit.", 96, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1715 },
{ PROC_LINKS(redo_this_buffer, 0), "redo_this_buffer", 16, "Advances forwards through the undo history of the current buffer.", 65, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1629 },
{ PROC_LINKS(reload_themes, 0), "reload_themes", 13, "Loads all the theme files in the theme folder, replacing duplicates with the new theme data.", 92, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1793 },
{ PROC_LINKS(query_replace, 0), "query_replace", 13, "Queries the user for two strings, and incrementally replaces every occurence of the first string with the second string.", 120, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1045 },
{ PROC_LINKS(query_replace_identifier, 0), "query_replace_identifier", 24, "Queries the user for a string, and incrementally replace every occurence of the word or token found at the cursor with the specified string.", 140, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1069 },
{ PROC_LINKS(query_replace_selection, 0), "query_replace_selection", 23, "Queries the user for a string, and incrementally replace every occurence of the string found in the selected range with the specified string.", 141, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1087 },
{ PROC_LINKS(redo, 0), "redo", 4, "Advances forward through the undo history in the buffer containing the most recent regular edit.", 96, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1706 },
{ PROC_LINKS(redo_this_buffer, 0), "redo_this_buffer", 16, "Advances forwards through the undo history of the current buffer.", 65, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1620 },
{ PROC_LINKS(remap_interactive, 0), "remap_interactive", 17, "Switch to a named key binding map.", 34, "w:\\4ed\\code\\4coder_default_framework.cpp", 40, 300 },
{ PROC_LINKS(rename_file_query, 0), "rename_file_query", 17, "Queries the user for a new name and renames the file of the current buffer, altering the buffer's name too.", 107, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1236 },
{ PROC_LINKS(rename_file_query, 0), "rename_file_query", 17, "Queries the user for a new name and renames the file of the current buffer, altering the buffer's name too.", 107, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1227 },
{ PROC_LINKS(rename_parameter, 0), "rename_parameter", 16, "If the cursor is found to be on the name of a function parameter in the signature of a function definition, all occurences within the scope of the function will be replaced with a new provided string.", 200, "w:\\4ed\\code\\4coder_experiments.cpp", 34, 383 },
{ PROC_LINKS(reopen, 0), "reopen", 6, "Reopen the current buffer from the hard drive.", 46, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1607 },
{ PROC_LINKS(reopen, 0), "reopen", 6, "Reopen the current buffer from the hard drive.", 46, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1598 },
{ PROC_LINKS(replace_all_occurrences, 0), "replace_all_occurrences", 23, "Queries the user for two strings, and replaces all occurrences of the first string with the second string in all open buffers.", 126, "w:\\4ed\\code\\4coder_experiments.cpp", 34, 780 },
{ PROC_LINKS(replace_in_range, 0), "replace_in_range", 16, "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.", 150, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 933 },
{ PROC_LINKS(reverse_search, 0), "reverse_search", 14, "Begins an incremental search up through the current buffer for a user specified string.", 87, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 904 },
{ PROC_LINKS(reverse_search_identifier, 0), "reverse_search_identifier", 25, "Begins an incremental search up through the current buffer for the word or token under the cursor.", 98, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 922 },
{ PROC_LINKS(save, 0), "save", 4, "Saves the current buffer.", 25, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1599 },
{ PROC_LINKS(save_all_dirty_buffers, 0), "save_all_dirty_buffers", 22, "Saves all buffers marked dirty (showing the '*' indicator).", 59, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1140 },
{ PROC_LINKS(save_to_query, 0), "save_to_query", 13, "Queries the user for a file name and saves the contents of the current buffer, altering the buffer's name too.", 110, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1196 },
{ PROC_LINKS(replace_in_range, 0), "replace_in_range", 16, "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.", 150, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 924 },
{ PROC_LINKS(reverse_search, 0), "reverse_search", 14, "Begins an incremental search up through the current buffer for a user specified string.", 87, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 895 },
{ PROC_LINKS(reverse_search_identifier, 0), "reverse_search_identifier", 25, "Begins an incremental search up through the current buffer for the word or token under the cursor.", 98, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 913 },
{ PROC_LINKS(save, 0), "save", 4, "Saves the current buffer.", 25, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1590 },
{ PROC_LINKS(save_all_dirty_buffers, 0), "save_all_dirty_buffers", 22, "Saves all buffers marked dirty (showing the '*' indicator).", 59, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1131 },
{ PROC_LINKS(save_to_query, 0), "save_to_query", 13, "Queries the user for a file name and saves the contents of the current buffer, altering the buffer's name too.", 110, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1187 },
{ PROC_LINKS(scope_absorb_down, 0), "scope_absorb_down", 17, "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.", 143, "w:\\4ed\\code\\4coder_scope_commands.cpp", 37, 747 },
{ PROC_LINKS(search, 0), "search", 6, "Begins an incremental search down through the current buffer for a user specified string.", 89, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 897 },
{ PROC_LINKS(search_identifier, 0), "search_identifier", 17, "Begins an incremental search down through the current buffer for the word or token under the cursor.", 100, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 911 },
{ PROC_LINKS(search, 0), "search", 6, "Begins an incremental search down through the current buffer for a user specified string.", 89, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 888 },
{ PROC_LINKS(search_identifier, 0), "search_identifier", 17, "Begins an incremental search down through the current buffer for the word or token under the cursor.", 100, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 902 },
{ PROC_LINKS(seek_alphanumeric_left, 0), "seek_alphanumeric_left", 22, "Seek left for boundary between alphanumeric characters and non-alphanumeric characters.", 87, "w:\\4ed\\code\\4coder_seek.cpp", 27, 1237 },
{ PROC_LINKS(seek_alphanumeric_or_camel_left, 0), "seek_alphanumeric_or_camel_left", 31, "Seek left for boundary between alphanumeric characters or camel case word and non-alphanumeric characters.", 106, "w:\\4ed\\code\\4coder_seek.cpp", 27, 1249 },
{ PROC_LINKS(seek_alphanumeric_or_camel_right, 0), "seek_alphanumeric_or_camel_right", 32, "Seek right for boundary between alphanumeric characters or camel case word and non-alphanumeric characters.", 107, "w:\\4ed\\code\\4coder_seek.cpp", 27, 1243 },
@ -441,7 +438,7 @@ static Command_Metadata fcoder_metacmd_table[234] = {
{ PROC_LINKS(seek_whitespace_right, 0), "seek_whitespace_right", 21, "Seek right for the next boundary between whitespace and non-whitespace.", 71, "w:\\4ed\\code\\4coder_seek.cpp", 27, 1195 },
{ PROC_LINKS(seek_whitespace_up, 0), "seek_whitespace_up", 18, "Seeks the cursor up to the next blank line.", 43, "w:\\4ed\\code\\4coder_seek.cpp", 27, 1090 },
{ PROC_LINKS(seek_whitespace_up_end_line, 0), "seek_whitespace_up_end_line", 27, "Seeks the cursor up to the next blank line and places it at the end of the line.", 80, "w:\\4ed\\code\\4coder_seek.cpp", 27, 1154 },
{ PROC_LINKS(select_all, 0), "select_all", 10, "Puts the cursor at the top of the file, and the mark at the bottom of the file.", 79, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 392 },
{ PROC_LINKS(select_all, 0), "select_all", 10, "Puts the cursor at the top of the file, and the mark at the bottom of the file.", 79, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 378 },
{ PROC_LINKS(select_next_scope_absolute, 0), "select_next_scope_absolute", 26, "Finds the first scope started by '{' after the cursor and puts the cursor and mark on the '{' and '}'.", 102, "w:\\4ed\\code\\4coder_scope_commands.cpp", 37, 387 },
{ PROC_LINKS(select_prev_scope_absolute, 0), "select_prev_scope_absolute", 26, "Finds the first scope started by '{' before the cursor and puts the cursor and mark on the '{' and '}'.", 103, "w:\\4ed\\code\\4coder_scope_commands.cpp", 37, 407 },
{ PROC_LINKS(select_surrounding_scope, 0), "select_surrounding_scope", 24, "Finds the scope enclosed by '{' '}' surrounding the cursor and puts the cursor and mark on the '{' and '}'.", 107, "w:\\4ed\\code\\4coder_scope_commands.cpp", 37, 371 },
@ -455,31 +452,32 @@ static Command_Metadata fcoder_metacmd_table[234] = {
{ PROC_LINKS(setup_build_bat_and_sh, 0), "setup_build_bat_and_sh", 22, "Queries the user for several configuration options and initializes a new build batch script.", 92, "w:\\4ed\\code\\4coder_project_commands.cpp", 39, 1510 },
{ PROC_LINKS(setup_build_sh, 0), "setup_build_sh", 14, "Queries the user for several configuration options and initializes a new build shell script.", 92, "w:\\4ed\\code\\4coder_project_commands.cpp", 39, 1504 },
{ PROC_LINKS(setup_new_project, 0), "setup_new_project", 17, "Queries the user for several configuration options and initializes a new 4coder project with build scripts for every OS.", 120, "w:\\4ed\\code\\4coder_project_commands.cpp", 39, 1491 },
{ PROC_LINKS(show_filebar, 0), "show_filebar", 12, "Sets the current view to show it's filebar.", 43, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 540 },
{ PROC_LINKS(show_scrollbar, 0), "show_scrollbar", 14, "Sets the current view to show it's scrollbar.", 45, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 526 },
{ PROC_LINKS(show_filebar, 0), "show_filebar", 12, "Sets the current view to show it's filebar.", 43, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 526 },
{ PROC_LINKS(show_scrollbar, 0), "show_scrollbar", 14, "Sets the current view to show it's scrollbar.", 45, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 512 },
{ PROC_LINKS(snipe_token_or_word, 0), "snipe_token_or_word", 19, "Delete a single, whole token on or to the left of the cursor and post it to the clipboard.", 90, "w:\\4ed\\code\\4coder_seek.cpp", 27, 1269 },
{ PROC_LINKS(snipe_token_or_word_right, 0), "snipe_token_or_word_right", 25, "Delete a single, whole token on or to the right of the cursor and post it to the clipboard.", 91, "w:\\4ed\\code\\4coder_seek.cpp", 27, 1275 },
{ PROC_LINKS(snippet_lister, 0), "snippet_lister", 14, "Opens a snippet lister for inserting whole pre-written snippets of text.", 72, "w:\\4ed\\code\\4coder_combined_write_commands.cpp", 46, 248 },
{ PROC_LINKS(suppress_mouse, 0), "suppress_mouse", 14, "Hides the mouse and causes all mosue input (clicks, position, wheel) to be ignored.", 83, "w:\\4ed\\code\\4coder_default_framework.cpp", 40, 244 },
{ PROC_LINKS(swap_buffers_between_panels, 0), "swap_buffers_between_panels", 27, "Set the other non-active panel to view the buffer that the active panel views, and switch to that panel.", 104, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1559 },
{ PROC_LINKS(to_lowercase, 0), "to_lowercase", 12, "Converts all ascii text in the range between the cursor and the mark to lowercase.", 82, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 424 },
{ PROC_LINKS(to_uppercase, 0), "to_uppercase", 12, "Converts all ascii text in the range between the cursor and the mark to uppercase.", 82, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 404 },
{ PROC_LINKS(toggle_filebar, 0), "toggle_filebar", 14, "Toggles the visibility status of the current view's filebar.", 60, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 554 },
{ PROC_LINKS(swap_buffers_between_panels, 0), "swap_buffers_between_panels", 27, "Set the other non-active panel to view the buffer that the active panel views, and switch to that panel.", 104, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1550 },
{ PROC_LINKS(to_lowercase, 0), "to_lowercase", 12, "Converts all ascii text in the range between the cursor and the mark to lowercase.", 82, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 410 },
{ PROC_LINKS(to_uppercase, 0), "to_uppercase", 12, "Converts all ascii text in the range between the cursor and the mark to uppercase.", 82, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 390 },
{ PROC_LINKS(toggle_filebar, 0), "toggle_filebar", 14, "Toggles the visibility status of the current view's filebar.", 60, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 540 },
{ PROC_LINKS(toggle_fps_meter, 0), "toggle_fps_meter", 16, "Toggles the visibility of the FPS performance meter", 51, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 558 },
{ PROC_LINKS(toggle_fullscreen, 0), "toggle_fullscreen", 17, "Toggle fullscreen mode on or off. The change(s) do not take effect until the next frame.", 89, "w:\\4ed\\code\\4coder_default_framework.cpp", 40, 292 },
{ PROC_LINKS(toggle_highlight_enclosing_scopes, 0), "toggle_highlight_enclosing_scopes", 33, "In code files scopes surrounding the cursor are highlighted with distinguishing colors.", 87, "w:\\4ed\\code\\4coder_default_framework.cpp", 40, 280 },
{ PROC_LINKS(toggle_highlight_line_at_cursor, 0), "toggle_highlight_line_at_cursor", 31, "Toggles the line highlight at the cursor.", 41, "w:\\4ed\\code\\4coder_default_framework.cpp", 40, 274 },
{ PROC_LINKS(toggle_line_wrap, 0), "toggle_line_wrap", 16, "Toggles the current buffer's line wrapping status.", 50, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 563 },
{ PROC_LINKS(toggle_line_wrap, 0), "toggle_line_wrap", 16, "Toggles the current buffer's line wrapping status.", 50, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 549 },
{ PROC_LINKS(toggle_mouse, 0), "toggle_mouse", 12, "Toggles the mouse suppression mode, see suppress_mouse and allow_mouse.", 71, "w:\\4ed\\code\\4coder_default_framework.cpp", 40, 256 },
{ PROC_LINKS(toggle_paren_matching_helper, 0), "toggle_paren_matching_helper", 28, "In code files matching parentheses pairs are colored with distinguishing colors.", 80, "w:\\4ed\\code\\4coder_default_framework.cpp", 40, 286 },
{ PROC_LINKS(toggle_show_whitespace, 0), "toggle_show_whitespace", 22, "Toggles the current buffer's whitespace visibility status.", 58, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 647 },
{ PROC_LINKS(toggle_virtual_whitespace, 0), "toggle_virtual_whitespace", 25, "Toggles the current buffer's virtual whitespace status.", 55, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 636 },
{ PROC_LINKS(toggle_show_whitespace, 0), "toggle_show_whitespace", 22, "Toggles the current buffer's whitespace visibility status.", 58, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 638 },
{ PROC_LINKS(toggle_virtual_whitespace, 0), "toggle_virtual_whitespace", 25, "Toggles the current buffer's virtual whitespace status.", 55, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 627 },
{ PROC_LINKS(uncomment_line, 0), "uncomment_line", 14, "If present, delete '//' at the beginning of the line after leading whitespace.", 78, "w:\\4ed\\code\\4coder_combined_write_commands.cpp", 46, 147 },
{ PROC_LINKS(undo, 0), "undo", 4, "Advances backward through the undo history in the buffer containing the most recent regular edit.", 97, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1643 },
{ PROC_LINKS(undo_this_buffer, 0), "undo_this_buffer", 16, "Advances backwards through the undo history of the current buffer.", 66, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1617 },
{ PROC_LINKS(view_buffer_other_panel, 0), "view_buffer_other_panel", 23, "Set the other non-active panel to view the buffer that the active panel views, and switch to that panel.", 104, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1549 },
{ PROC_LINKS(undo, 0), "undo", 4, "Advances backward through the undo history in the buffer containing the most recent regular edit.", 97, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1634 },
{ PROC_LINKS(undo_this_buffer, 0), "undo_this_buffer", 16, "Advances backwards through the undo history of the current buffer.", 66, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1608 },
{ PROC_LINKS(view_buffer_other_panel, 0), "view_buffer_other_panel", 23, "Set the other non-active panel to view the buffer that the active panel views, and switch to that panel.", 104, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1540 },
{ PROC_LINKS(view_jump_list_with_lister, 0), "view_jump_list_with_lister", 26, "When executed on a buffer with jumps, creates a persistent lister for all the jumps", 83, "w:\\4ed\\code\\4coder_jump_lister.cpp", 34, 108 },
{ PROC_LINKS(word_complete, 0), "word_complete", 13, "Iteratively tries completing the word to the left of the cursor with other words in open buffers that have the same prefix string.", 130, "w:\\4ed\\code\\4coder_search.cpp", 29, 958 },
{ PROC_LINKS(write_and_auto_tab, 0), "write_and_auto_tab", 18, "Inserts a character and auto-indents the line on which the cursor sits.", 71, "w:\\4ed\\code\\4coder_auto_indent.cpp", 34, 744 },
{ PROC_LINKS(write_and_auto_tab, 0), "write_and_auto_tab", 18, "Inserts a character and auto-indents the line on which the cursor sits.", 71, "w:\\4ed\\code\\4coder_auto_indent.cpp", 34, 653 },
{ PROC_LINKS(write_block, 0), "write_block", 11, "At the cursor, insert a block comment.", 38, "w:\\4ed\\code\\4coder_combined_write_commands.cpp", 46, 103 },
{ PROC_LINKS(write_character, 0), "write_character", 15, "Inserts whatever character was used to trigger this command.", 60, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 67 },
{ PROC_LINKS(write_explicit_enum_flags, 0), "write_explicit_enum_flags", 25, "If the cursor is found to be on the '{' of an enum definition, the values of the enum will be filled in to give each a unique power of 2 value, starting from 1. Existing values are overwritten.", 194, "w:\\4ed\\code\\4coder_experiments.cpp", 34, 705 },
@ -619,109 +617,108 @@ static int32_t fcoder_metacmd_ID_newline_or_goto_position_same_panel_sticky = 12
static int32_t fcoder_metacmd_ID_newline_or_goto_position_sticky = 126;
static int32_t fcoder_metacmd_ID_open_all_code = 127;
static int32_t fcoder_metacmd_ID_open_all_code_recursive = 128;
static int32_t fcoder_metacmd_ID_open_color_tweaker = 129;
static int32_t fcoder_metacmd_ID_open_file_in_quotes = 130;
static int32_t fcoder_metacmd_ID_open_in_other = 131;
static int32_t fcoder_metacmd_ID_open_long_braces = 132;
static int32_t fcoder_metacmd_ID_open_long_braces_break = 133;
static int32_t fcoder_metacmd_ID_open_long_braces_semicolon = 134;
static int32_t fcoder_metacmd_ID_open_matching_file_cpp = 135;
static int32_t fcoder_metacmd_ID_open_panel_hsplit = 136;
static int32_t fcoder_metacmd_ID_open_panel_vsplit = 137;
static int32_t fcoder_metacmd_ID_page_down = 138;
static int32_t fcoder_metacmd_ID_page_up = 139;
static int32_t fcoder_metacmd_ID_paste = 140;
static int32_t fcoder_metacmd_ID_paste_and_indent = 141;
static int32_t fcoder_metacmd_ID_paste_next = 142;
static int32_t fcoder_metacmd_ID_paste_next_and_indent = 143;
static int32_t fcoder_metacmd_ID_place_in_scope = 144;
static int32_t fcoder_metacmd_ID_project_command_lister = 145;
static int32_t fcoder_metacmd_ID_project_fkey_command = 146;
static int32_t fcoder_metacmd_ID_project_go_to_root_directory = 147;
static int32_t fcoder_metacmd_ID_query_replace = 148;
static int32_t fcoder_metacmd_ID_query_replace_identifier = 149;
static int32_t fcoder_metacmd_ID_query_replace_selection = 150;
static int32_t fcoder_metacmd_ID_redo = 151;
static int32_t fcoder_metacmd_ID_redo_this_buffer = 152;
static int32_t fcoder_metacmd_ID_reload_themes = 153;
static int32_t fcoder_metacmd_ID_remap_interactive = 154;
static int32_t fcoder_metacmd_ID_rename_file_query = 155;
static int32_t fcoder_metacmd_ID_rename_parameter = 156;
static int32_t fcoder_metacmd_ID_reopen = 157;
static int32_t fcoder_metacmd_ID_replace_all_occurrences = 158;
static int32_t fcoder_metacmd_ID_replace_in_range = 159;
static int32_t fcoder_metacmd_ID_reverse_search = 160;
static int32_t fcoder_metacmd_ID_reverse_search_identifier = 161;
static int32_t fcoder_metacmd_ID_save = 162;
static int32_t fcoder_metacmd_ID_save_all_dirty_buffers = 163;
static int32_t fcoder_metacmd_ID_save_to_query = 164;
static int32_t fcoder_metacmd_ID_scope_absorb_down = 165;
static int32_t fcoder_metacmd_ID_search = 166;
static int32_t fcoder_metacmd_ID_search_identifier = 167;
static int32_t fcoder_metacmd_ID_seek_alphanumeric_left = 168;
static int32_t fcoder_metacmd_ID_seek_alphanumeric_or_camel_left = 169;
static int32_t fcoder_metacmd_ID_seek_alphanumeric_or_camel_right = 170;
static int32_t fcoder_metacmd_ID_seek_alphanumeric_right = 171;
static int32_t fcoder_metacmd_ID_seek_beginning_of_line = 172;
static int32_t fcoder_metacmd_ID_seek_beginning_of_textual_line = 173;
static int32_t fcoder_metacmd_ID_seek_end_of_line = 174;
static int32_t fcoder_metacmd_ID_seek_end_of_textual_line = 175;
static int32_t fcoder_metacmd_ID_seek_token_left = 176;
static int32_t fcoder_metacmd_ID_seek_token_right = 177;
static int32_t fcoder_metacmd_ID_seek_white_or_token_left = 178;
static int32_t fcoder_metacmd_ID_seek_white_or_token_right = 179;
static int32_t fcoder_metacmd_ID_seek_whitespace_down = 180;
static int32_t fcoder_metacmd_ID_seek_whitespace_down_end_line = 181;
static int32_t fcoder_metacmd_ID_seek_whitespace_left = 182;
static int32_t fcoder_metacmd_ID_seek_whitespace_right = 183;
static int32_t fcoder_metacmd_ID_seek_whitespace_up = 184;
static int32_t fcoder_metacmd_ID_seek_whitespace_up_end_line = 185;
static int32_t fcoder_metacmd_ID_select_all = 186;
static int32_t fcoder_metacmd_ID_select_next_scope_absolute = 187;
static int32_t fcoder_metacmd_ID_select_prev_scope_absolute = 188;
static int32_t fcoder_metacmd_ID_select_surrounding_scope = 189;
static int32_t fcoder_metacmd_ID_set_bindings_choose = 190;
static int32_t fcoder_metacmd_ID_set_bindings_default = 191;
static int32_t fcoder_metacmd_ID_set_bindings_mac_default = 192;
static int32_t fcoder_metacmd_ID_set_mark = 193;
static int32_t fcoder_metacmd_ID_set_mode_to_notepad_like = 194;
static int32_t fcoder_metacmd_ID_set_mode_to_original = 195;
static int32_t fcoder_metacmd_ID_setup_build_bat = 196;
static int32_t fcoder_metacmd_ID_setup_build_bat_and_sh = 197;
static int32_t fcoder_metacmd_ID_setup_build_sh = 198;
static int32_t fcoder_metacmd_ID_setup_new_project = 199;
static int32_t fcoder_metacmd_ID_show_filebar = 200;
static int32_t fcoder_metacmd_ID_show_scrollbar = 201;
static int32_t fcoder_metacmd_ID_snipe_token_or_word = 202;
static int32_t fcoder_metacmd_ID_snipe_token_or_word_right = 203;
static int32_t fcoder_metacmd_ID_snippet_lister = 204;
static int32_t fcoder_metacmd_ID_suppress_mouse = 205;
static int32_t fcoder_metacmd_ID_swap_buffers_between_panels = 206;
static int32_t fcoder_metacmd_ID_to_lowercase = 207;
static int32_t fcoder_metacmd_ID_to_uppercase = 208;
static int32_t fcoder_metacmd_ID_toggle_filebar = 209;
static int32_t fcoder_metacmd_ID_toggle_fullscreen = 210;
static int32_t fcoder_metacmd_ID_toggle_highlight_enclosing_scopes = 211;
static int32_t fcoder_metacmd_ID_toggle_highlight_line_at_cursor = 212;
static int32_t fcoder_metacmd_ID_toggle_line_wrap = 213;
static int32_t fcoder_metacmd_ID_toggle_mouse = 214;
static int32_t fcoder_metacmd_ID_toggle_paren_matching_helper = 215;
static int32_t fcoder_metacmd_ID_toggle_show_whitespace = 216;
static int32_t fcoder_metacmd_ID_toggle_virtual_whitespace = 217;
static int32_t fcoder_metacmd_ID_uncomment_line = 218;
static int32_t fcoder_metacmd_ID_undo = 219;
static int32_t fcoder_metacmd_ID_undo_this_buffer = 220;
static int32_t fcoder_metacmd_ID_view_buffer_other_panel = 221;
static int32_t fcoder_metacmd_ID_view_jump_list_with_lister = 222;
static int32_t fcoder_metacmd_ID_word_complete = 223;
static int32_t fcoder_metacmd_ID_write_and_auto_tab = 224;
static int32_t fcoder_metacmd_ID_write_block = 225;
static int32_t fcoder_metacmd_ID_write_character = 226;
static int32_t fcoder_metacmd_ID_write_explicit_enum_flags = 227;
static int32_t fcoder_metacmd_ID_write_explicit_enum_values = 228;
static int32_t fcoder_metacmd_ID_write_hack = 229;
static int32_t fcoder_metacmd_ID_write_note = 230;
static int32_t fcoder_metacmd_ID_write_todo = 231;
static int32_t fcoder_metacmd_ID_write_underscore = 232;
static int32_t fcoder_metacmd_ID_write_zero_struct = 233;
static int32_t fcoder_metacmd_ID_open_file_in_quotes = 129;
static int32_t fcoder_metacmd_ID_open_in_other = 130;
static int32_t fcoder_metacmd_ID_open_long_braces = 131;
static int32_t fcoder_metacmd_ID_open_long_braces_break = 132;
static int32_t fcoder_metacmd_ID_open_long_braces_semicolon = 133;
static int32_t fcoder_metacmd_ID_open_matching_file_cpp = 134;
static int32_t fcoder_metacmd_ID_open_panel_hsplit = 135;
static int32_t fcoder_metacmd_ID_open_panel_vsplit = 136;
static int32_t fcoder_metacmd_ID_page_down = 137;
static int32_t fcoder_metacmd_ID_page_up = 138;
static int32_t fcoder_metacmd_ID_paste = 139;
static int32_t fcoder_metacmd_ID_paste_and_indent = 140;
static int32_t fcoder_metacmd_ID_paste_next = 141;
static int32_t fcoder_metacmd_ID_paste_next_and_indent = 142;
static int32_t fcoder_metacmd_ID_place_in_scope = 143;
static int32_t fcoder_metacmd_ID_project_command_lister = 144;
static int32_t fcoder_metacmd_ID_project_fkey_command = 145;
static int32_t fcoder_metacmd_ID_project_go_to_root_directory = 146;
static int32_t fcoder_metacmd_ID_query_replace = 147;
static int32_t fcoder_metacmd_ID_query_replace_identifier = 148;
static int32_t fcoder_metacmd_ID_query_replace_selection = 149;
static int32_t fcoder_metacmd_ID_redo = 150;
static int32_t fcoder_metacmd_ID_redo_this_buffer = 151;
static int32_t fcoder_metacmd_ID_remap_interactive = 152;
static int32_t fcoder_metacmd_ID_rename_file_query = 153;
static int32_t fcoder_metacmd_ID_rename_parameter = 154;
static int32_t fcoder_metacmd_ID_reopen = 155;
static int32_t fcoder_metacmd_ID_replace_all_occurrences = 156;
static int32_t fcoder_metacmd_ID_replace_in_range = 157;
static int32_t fcoder_metacmd_ID_reverse_search = 158;
static int32_t fcoder_metacmd_ID_reverse_search_identifier = 159;
static int32_t fcoder_metacmd_ID_save = 160;
static int32_t fcoder_metacmd_ID_save_all_dirty_buffers = 161;
static int32_t fcoder_metacmd_ID_save_to_query = 162;
static int32_t fcoder_metacmd_ID_scope_absorb_down = 163;
static int32_t fcoder_metacmd_ID_search = 164;
static int32_t fcoder_metacmd_ID_search_identifier = 165;
static int32_t fcoder_metacmd_ID_seek_alphanumeric_left = 166;
static int32_t fcoder_metacmd_ID_seek_alphanumeric_or_camel_left = 167;
static int32_t fcoder_metacmd_ID_seek_alphanumeric_or_camel_right = 168;
static int32_t fcoder_metacmd_ID_seek_alphanumeric_right = 169;
static int32_t fcoder_metacmd_ID_seek_beginning_of_line = 170;
static int32_t fcoder_metacmd_ID_seek_beginning_of_textual_line = 171;
static int32_t fcoder_metacmd_ID_seek_end_of_line = 172;
static int32_t fcoder_metacmd_ID_seek_end_of_textual_line = 173;
static int32_t fcoder_metacmd_ID_seek_token_left = 174;
static int32_t fcoder_metacmd_ID_seek_token_right = 175;
static int32_t fcoder_metacmd_ID_seek_white_or_token_left = 176;
static int32_t fcoder_metacmd_ID_seek_white_or_token_right = 177;
static int32_t fcoder_metacmd_ID_seek_whitespace_down = 178;
static int32_t fcoder_metacmd_ID_seek_whitespace_down_end_line = 179;
static int32_t fcoder_metacmd_ID_seek_whitespace_left = 180;
static int32_t fcoder_metacmd_ID_seek_whitespace_right = 181;
static int32_t fcoder_metacmd_ID_seek_whitespace_up = 182;
static int32_t fcoder_metacmd_ID_seek_whitespace_up_end_line = 183;
static int32_t fcoder_metacmd_ID_select_all = 184;
static int32_t fcoder_metacmd_ID_select_next_scope_absolute = 185;
static int32_t fcoder_metacmd_ID_select_prev_scope_absolute = 186;
static int32_t fcoder_metacmd_ID_select_surrounding_scope = 187;
static int32_t fcoder_metacmd_ID_set_bindings_choose = 188;
static int32_t fcoder_metacmd_ID_set_bindings_default = 189;
static int32_t fcoder_metacmd_ID_set_bindings_mac_default = 190;
static int32_t fcoder_metacmd_ID_set_mark = 191;
static int32_t fcoder_metacmd_ID_set_mode_to_notepad_like = 192;
static int32_t fcoder_metacmd_ID_set_mode_to_original = 193;
static int32_t fcoder_metacmd_ID_setup_build_bat = 194;
static int32_t fcoder_metacmd_ID_setup_build_bat_and_sh = 195;
static int32_t fcoder_metacmd_ID_setup_build_sh = 196;
static int32_t fcoder_metacmd_ID_setup_new_project = 197;
static int32_t fcoder_metacmd_ID_show_filebar = 198;
static int32_t fcoder_metacmd_ID_show_scrollbar = 199;
static int32_t fcoder_metacmd_ID_snipe_token_or_word = 200;
static int32_t fcoder_metacmd_ID_snipe_token_or_word_right = 201;
static int32_t fcoder_metacmd_ID_snippet_lister = 202;
static int32_t fcoder_metacmd_ID_suppress_mouse = 203;
static int32_t fcoder_metacmd_ID_swap_buffers_between_panels = 204;
static int32_t fcoder_metacmd_ID_to_lowercase = 205;
static int32_t fcoder_metacmd_ID_to_uppercase = 206;
static int32_t fcoder_metacmd_ID_toggle_filebar = 207;
static int32_t fcoder_metacmd_ID_toggle_fps_meter = 208;
static int32_t fcoder_metacmd_ID_toggle_fullscreen = 209;
static int32_t fcoder_metacmd_ID_toggle_highlight_enclosing_scopes = 210;
static int32_t fcoder_metacmd_ID_toggle_highlight_line_at_cursor = 211;
static int32_t fcoder_metacmd_ID_toggle_line_wrap = 212;
static int32_t fcoder_metacmd_ID_toggle_mouse = 213;
static int32_t fcoder_metacmd_ID_toggle_paren_matching_helper = 214;
static int32_t fcoder_metacmd_ID_toggle_show_whitespace = 215;
static int32_t fcoder_metacmd_ID_toggle_virtual_whitespace = 216;
static int32_t fcoder_metacmd_ID_uncomment_line = 217;
static int32_t fcoder_metacmd_ID_undo = 218;
static int32_t fcoder_metacmd_ID_undo_this_buffer = 219;
static int32_t fcoder_metacmd_ID_view_buffer_other_panel = 220;
static int32_t fcoder_metacmd_ID_view_jump_list_with_lister = 221;
static int32_t fcoder_metacmd_ID_word_complete = 222;
static int32_t fcoder_metacmd_ID_write_and_auto_tab = 223;
static int32_t fcoder_metacmd_ID_write_block = 224;
static int32_t fcoder_metacmd_ID_write_character = 225;
static int32_t fcoder_metacmd_ID_write_explicit_enum_flags = 226;
static int32_t fcoder_metacmd_ID_write_explicit_enum_values = 227;
static int32_t fcoder_metacmd_ID_write_hack = 228;
static int32_t fcoder_metacmd_ID_write_note = 229;
static int32_t fcoder_metacmd_ID_write_todo = 230;
static int32_t fcoder_metacmd_ID_write_underscore = 231;
static int32_t fcoder_metacmd_ID_write_zero_struct = 232;
#endif

View File

@ -134,6 +134,15 @@ set_buffer_name_resolver(Bind_Helper *helper, Buffer_Name_Resolver_Function *fun
write_unit(helper, unit);
}
static void
set_modify_color_table_hook(Bind_Helper *helper, Modify_Color_Table_Function *func){
Binding_Unit unit = {};
unit.type = unit_hook;
unit.hook.hook_id = special_hook_modify_color_table;
unit.hook.func = (void*)func;
write_unit(helper, unit);
}
static void
set_new_file_hook(Bind_Helper *helper, Open_File_Hook_Function *func){
Binding_Unit unit = {};
@ -1314,6 +1323,16 @@ string_push_copy(Arena *arena, String str){
return(result);
}
static void
append_int_to_str_left_pad(String *str, i32 x, i32 minimum_width, char pad_char){
i32 length = int_to_str_size(x);
i32 left_over = minimum_width - length;
if (left_over > 0){
append_padding(str, pad_char, str->size + left_over);
}
append_int_to_str(str, x);
}
static bool32
lexer_keywords_default_init(Partition *arena, Cpp_Keyword_Table *kw_out, Cpp_Keyword_Table *pp_out){
bool32 success = false;
@ -1645,5 +1664,12 @@ condense_whitespace(String *a)
}
}
////////////////////////////////
static Vec2
draw_string(Application_Links *app, Face_ID font_id, String string, Vec2 p, int_color color){
return(draw_string(app, font_id, string, p, color, 0, V2(1.f, 0.f)));
}
// BOTTOM

View File

@ -154,12 +154,8 @@ init_marker_list(Application_Links *app, Partition *scratch, Heap *heap, Buffer_
managed_object_store_data(app, marker_handle, 0, total_jump_count, markers);
if (is_compilation_buffer){
Theme_Color color = {};
color.tag = Stag_Highlight_Junk;
get_theme_colors(app, &color, 1);
Marker_Visual visual = create_marker_visual(app, marker_handle);
marker_visual_set_effect(app, visual,
VisualType_LineHighlights, color.color, 0, 0);
marker_visual_set_effect(app, visual, VisualType_LineHighlights, Stag_Highlight_Junk, 0, 0);
}
end_temp_memory(marker_temp);

View File

@ -927,6 +927,7 @@ CUSTOM_DOC("Interactively opens a file.")
begin_integrated_lister__file_system_list(app, "Open:", activate_open, 0, 0, &view);
}
#if 0
static void
activate_select_theme(Application_Links *app, Partition *scratch, Heap *heap,
View_Summary *view, struct Lister_State *state,
@ -960,6 +961,7 @@ CUSTOM_DOC("Opens the 4coder theme selector list.")
end_temp_memory(temp);
}
#endif
////////////////////////////////

View File

@ -52,7 +52,7 @@ ui_list_to_ui_control(Partition *arena, UI_List *list){
UI_Item *item = &control.items[control.count++];
*item = node->fixed;
if (item->coordinates >= UICoordinates_COUNT){
item->coordinates = UICoordinates_Scrolled;
item->coordinates = UICoordinates_ViewSpace;
}
control.bounding_box[item->coordinates] = ui__rect_union(control.bounding_box[item->coordinates], item->rectangle);
}
@ -61,39 +61,46 @@ ui_list_to_ui_control(Partition *arena, UI_List *list){
static void
ui_control_set_top(UI_Control *control, int32_t top_y){
control->bounding_box[UICoordinates_Scrolled].y0 = top_y;
control->bounding_box[UICoordinates_ViewSpace].y0 = top_y;
}
static void
ui_control_set_bottom(UI_Control *control, int32_t bottom_y){
control->bounding_box[UICoordinates_Scrolled].y1 = bottom_y;
control->bounding_box[UICoordinates_ViewSpace].y1 = bottom_y;
}
static UI_Item*
ui_control_get_mouse_hit(UI_Control *control, Vec2_i32 view_p, Vec2_i32 panel_p){
UI_Item *result = 0;
int32_t count = control->count;
UI_Item *item = control->items + count - 1;
for (int32_t i = 0; i < count && result == 0; ++i, item -= 1){
i32_Rect r = item->rectangle;
switch (item->coordinates){
case UICoordinates_ViewSpace:
{
if (hit_check(r, view_p)){
result = item;
}
}break;
case UICoordinates_PanelSpace:
{
if (hit_check(r, panel_p)){
result = item;
}
}break;
}
}
return(result);
}
static UI_Item*
ui_control_get_mouse_hit(UI_Control *control,
int32_t mx_scrolled, int32_t my_scrolled,
int32_t mx_unscrolled, int32_t my_unscrolled){
int32_t count = control->count;
UI_Item *item = control->items + count - 1;
for (int32_t i = 0; i < count; ++i, item -= 1){
i32_Rect r = item->rectangle;
switch (item->coordinates){
case UICoordinates_Scrolled:
{
if (r.x0 <= mx_scrolled && mx_scrolled < r.x1 && r.y0 <= my_scrolled && my_scrolled < r.y1){
return(item);
}
}break;
case UICoordinates_ViewRelative:
{
if (r.x0 <= mx_unscrolled && mx_unscrolled < r.x1 && r.y0 <= my_unscrolled && my_unscrolled < r.y1){
return(item);
}
}break;
}
}
return(0);
return(ui_control_get_mouse_hit(control,
V2i32(mx_scrolled, my_scrolled),
V2i32(mx_unscrolled, my_unscrolled)));
}
////////////////////////////////
@ -138,52 +145,44 @@ view_set_vertical_focus(Application_Links *app, View_Summary *view,
}
}
static void
get_view_relative_points(int32_t x_window, int32_t y_window, View_Summary view,
int32_t *x_scrolled_out, int32_t *y_scrolled_out,
int32_t *x_view_out, int32_t *y_view_out){
int32_t x = x_window - view.file_region.x0;
int32_t y = y_window - view.file_region.y0;
if (x_scrolled_out != 0 && y_scrolled_out != 0){
*x_scrolled_out = x + (int32_t)view.scroll_vars.scroll_x;
*y_scrolled_out = y + (int32_t)view.scroll_vars.scroll_y;
}
if (x_view_out != 0 && y_view_out != 0){
*x_view_out = x;
*y_view_out = y;
}
static Vec2
view_space_from_screen_space(Vec2 p, Vec2 file_region_p0, Vec2 scroll_p){
return(p - file_region_p0 + scroll_p);
}
static void
get_view_relative_points_x(int32_t x_window, View_Summary view, int32_t *x_scrolled_out, int32_t *x_view_out){
int32_t y_ignore = 0;
get_view_relative_points(x_window, y_ignore, view,
x_scrolled_out, &y_ignore, x_view_out, &y_ignore);
static Vec2_i32
view_space_from_screen_space(Vec2_i32 p, Vec2_i32 file_region_p0, Vec2_i32 scroll_p){
return(p - file_region_p0 + scroll_p);
}
static void
get_view_relative_points_y(int32_t y_window, View_Summary view, int32_t *y_scrolled_out, int32_t *y_view_out){
int32_t x_ignore = 0;
get_view_relative_points(x_ignore, y_window, view,
&x_ignore, y_scrolled_out, &x_ignore, y_view_out);
static Vec2_i32
get_mouse_position_in_view_space(Mouse_State mouse, Vec2_i32 file_region_p0, Vec2_i32 scroll_p){
return(view_space_from_screen_space(mouse.p, file_region_p0, scroll_p));
}
static void
get_view_relative_mouse_positions(Mouse_State mouse, View_Summary view,
int32_t *x_scrolled_out, int32_t *y_scrolled_out,
int32_t *x_view_out, int32_t *y_view_out){
get_view_relative_points(mouse.x, mouse.y, view,
x_scrolled_out, y_scrolled_out,
x_view_out, y_view_out);
static Vec2_i32
get_mouse_position_in_view_space(Application_Links *app, Vec2_i32 file_region_p0, Vec2_i32 scroll_p){
return(get_mouse_position_in_view_space(get_mouse_state(app), file_region_p0, scroll_p));
}
static void
get_view_relative_mouse_positions(Application_Links *app, View_Summary view,
int32_t *x_scrolled_out, int32_t *y_scrolled_out,
int32_t *x_view_out, int32_t *y_view_out){
get_view_relative_mouse_positions(get_mouse_state(app), view,
x_scrolled_out, y_scrolled_out,
x_view_out, y_view_out);
static Vec2
panel_space_from_screen_space(Vec2 p, Vec2 file_region_p0){
return(p - file_region_p0);
}
static Vec2_i32
panel_space_from_screen_space(Vec2_i32 p, Vec2_i32 file_region_p0){
return(p - file_region_p0);
}
static Vec2_i32
get_mouse_position_in_panel_space(Mouse_State mouse, Vec2_i32 file_region_p0){
return(panel_space_from_screen_space(mouse.p, file_region_p0));
}
static Vec2_i32
get_mouse_position_in_panel_space(Application_Links *app, Vec2_i32 file_region_p0){
return(get_mouse_position_in_panel_space(get_mouse_state(app), file_region_p0));
}
////////////////////////////////
@ -229,12 +228,10 @@ lister_get_clicked_item(Application_Links *app, View_Summary *view, Partition *s
Temp_Memory temp = begin_temp_memory(scratch);
UI_Control control = view_get_ui_copy(app, view, scratch);
Mouse_State mouse = get_mouse_state(app);
int32_t mxs = 0;
int32_t mys = 0;
int32_t mxu = 0;
int32_t myu = 0;
get_view_relative_mouse_positions(mouse, *view, &mxs, &mys, &mxu, &myu);
UI_Item *clicked = ui_control_get_mouse_hit(&control, mxs, mys, mxu, myu);
Vec2_i32 region_p0 = view->file_region.p0;
Vec2_i32 m_view_space = get_mouse_position_in_view_space(mouse, region_p0, V2i32(view->scroll_vars.scroll_p));
Vec2_i32 m_panel_space = get_mouse_position_in_panel_space(mouse, region_p0);
UI_Item *clicked = ui_control_get_mouse_hit(&control, m_view_space, m_panel_space);
UI_Item result = {};
if (clicked != 0){
result = *clicked;
@ -278,10 +275,9 @@ lister_update_ui(Application_Links *app, Partition *scratch, View_Summary *view,
Temp_Memory full_temp = begin_temp_memory(scratch);
int32_t mx = 0;
int32_t my = 0;
refresh_view(app, view);
get_view_relative_mouse_positions(app, *view, &mx, &my, 0, 0);
Vec2_i32 view_m = get_mouse_position_in_view_space(app, view->file_region.p0,
V2i32(view->scroll_vars.scroll_p));
int32_t y_pos = text_field_height;
@ -355,13 +351,12 @@ lister_update_ui(Application_Links *app, Partition *scratch, View_Summary *view,
item.color_theme.index = node->index;
}
item.activation_level = UIActivation_None;
item.coordinates = UICoordinates_Scrolled;
item.coordinates = UICoordinates_ViewSpace;
item.user_data = node->user_data;
item.rectangle = item_rect;
UI_Item *item_ptr = ui_list_add_item(scratch, &list, item);
if (item_rect.x0 <= mx && mx < item_rect.x1 &&
item_rect.y0 <= my && my < item_rect.y1){
if (hit_check(item_rect, view_m)){
hovered_item = item_ptr;
}
if (state->item_index == item_index_counter){
@ -409,7 +404,7 @@ lister_update_ui(Application_Links *app, Partition *scratch, View_Summary *view,
UI_Item item = {};
item.type = UIType_TextField;
item.activation_level = UIActivation_Active;
item.coordinates = UICoordinates_ViewRelative;
item.coordinates = UICoordinates_PanelSpace;
item.text_field.query = state->lister.data.query;
item.text_field.string = state->lister.data.text_field;
item.user_data = 0;

331
4ed.cpp
View File

@ -392,6 +392,11 @@ interpret_binding_buffer(Models *models, void *buffer, i32 size){
models->buffer_name_resolver = (Buffer_Name_Resolver_Function*)unit->hook.func;
}break;
case special_hook_modify_color_table:
{
models->modify_color_table = (Modify_Color_Table_Function*)unit->hook.func;
}break;
case special_hook_input_filter:
{
models->input_filter = (Input_Filter_Function*)unit->hook.func;
@ -461,57 +466,65 @@ app_links_init(System_Functions *system, Application_Links *app_links, void *dat
// App Functions
internal void
app_hardcode_default_style(Models *models){
Style_Library *styles = &models->styles;
styles->count = 2;
styles->max = ArrayCount(models->styles.styles);
fill_hardcode_default_style(Color_Table color_table){
color_table.vals[Stag_Back] = 0xFF0C0C0C;
color_table.vals[Stag_Margin] = 0xFF181818;
color_table.vals[Stag_Margin_Hover] = 0xFF252525;
color_table.vals[Stag_Margin_Active] = 0xFF323232;
color_table.vals[Stag_List_Item] = color_table.vals[Stag_Margin];
color_table.vals[Stag_List_Item_Hover] = color_table.vals[Stag_Margin_Hover];
color_table.vals[Stag_List_Item_Active] = color_table.vals[Stag_Margin_Active];
color_table.vals[Stag_Cursor] = 0xFF00EE00;
color_table.vals[Stag_Highlight] = 0xFFDDEE00;
color_table.vals[Stag_Mark] = 0xFF494949;
color_table.vals[Stag_Default] = 0xFF90B080;
color_table.vals[Stag_At_Cursor] = color_table.vals[Stag_Back];
color_table.vals[Stag_Highlight_Cursor_Line] = 0xFF1E1E1E;
color_table.vals[Stag_At_Highlight] = 0xFFFF44DD;
color_table.vals[Stag_Comment] = 0xFF2090F0;
color_table.vals[Stag_Keyword] = 0xFFD08F20;
color_table.vals[Stag_Str_Constant] = 0xFF50FF30;
color_table.vals[Stag_Char_Constant] = color_table.vals[Stag_Str_Constant];
color_table.vals[Stag_Int_Constant] = color_table.vals[Stag_Str_Constant];
color_table.vals[Stag_Float_Constant] = color_table.vals[Stag_Str_Constant];
color_table.vals[Stag_Bool_Constant] = color_table.vals[Stag_Str_Constant];
color_table.vals[Stag_Include] = color_table.vals[Stag_Str_Constant];
color_table.vals[Stag_Preproc] = color_table.vals[Stag_Default];
color_table.vals[Stag_Special_Character] = 0xFFFF0000;
color_table.vals[Stag_Ghost_Character] = color_blend(color_table.vals[Stag_Default],
0.5f,
color_table.vals[Stag_Back]);
Style *style = styles->styles;
for (i32 i = 0; i < 2; i += 1, style += 1){
style->name = make_fixed_width_string(style->name_);
copy(&style->name, make_lit_string("4coder"));
terminate_with_null(&style->name);
style->theme.colors[Stag_Back] = 0xFF0C0C0C;
style->theme.colors[Stag_Margin] = 0xFF181818;
style->theme.colors[Stag_Margin_Hover] = 0xFF252525;
style->theme.colors[Stag_Margin_Active] = 0xFF323232;
style->theme.colors[Stag_List_Item] = style->theme.colors[Stag_Margin];
style->theme.colors[Stag_List_Item_Hover] = style->theme.colors[Stag_Margin_Hover];
style->theme.colors[Stag_List_Item_Active] = style->theme.colors[Stag_Margin_Active];
style->theme.colors[Stag_Cursor] = 0xFF00EE00;
style->theme.colors[Stag_Highlight] = 0xFFDDEE00;
style->theme.colors[Stag_Mark] = 0xFF494949;
style->theme.colors[Stag_Default] = 0xFF90B080;
style->theme.colors[Stag_At_Cursor] = style->theme.colors[Stag_Back];
style->theme.colors[Stag_Highlight_Cursor_Line] = 0xFF1E1E1E;
style->theme.colors[Stag_At_Highlight] = 0xFFFF44DD;
style->theme.colors[Stag_Comment] = 0xFF2090F0;
style->theme.colors[Stag_Keyword] = 0xFFD08F20;
style->theme.colors[Stag_Str_Constant] = 0xFF50FF30;
style->theme.colors[Stag_Char_Constant] = style->theme.colors[Stag_Str_Constant];
style->theme.colors[Stag_Int_Constant] = style->theme.colors[Stag_Str_Constant];
style->theme.colors[Stag_Float_Constant] = style->theme.colors[Stag_Str_Constant];
style->theme.colors[Stag_Bool_Constant] = style->theme.colors[Stag_Str_Constant];
style->theme.colors[Stag_Include] = style->theme.colors[Stag_Str_Constant];
style->theme.colors[Stag_Preproc] = style->theme.colors[Stag_Default];
style->theme.colors[Stag_Special_Character] = 0xFFFF0000;
style->theme.colors[Stag_Ghost_Character] = color_blend(style->theme.colors[Stag_Default],
0.5f,
style->theme.colors[Stag_Back]);
style->theme.colors[Stag_Paste] = 0xFFDDEE00;
style->theme.colors[Stag_Undo] = 0xFF00DDEE;
style->theme.colors[Stag_Highlight_Junk] = 0xff3a0000;
style->theme.colors[Stag_Highlight_White] = 0xff003a3a;
style->theme.colors[Stag_Bar] = 0xFF888888;
style->theme.colors[Stag_Bar_Active] = 0xFF666666;
style->theme.colors[Stag_Base] = 0xFF000000;
style->theme.colors[Stag_Pop1] = 0xFF3C57DC;
style->theme.colors[Stag_Pop2] = 0xFFFF0000;
}
color_table.vals[Stag_Paste] = 0xFFDDEE00;
color_table.vals[Stag_Undo] = 0xFF00DDEE;
color_table.vals[Stag_Highlight_Junk] = 0xff3a0000;
color_table.vals[Stag_Highlight_White] = 0xff003a3a;
color_table.vals[Stag_Bar] = 0xFF888888;
color_table.vals[Stag_Bar_Active] = 0xFF666666;
color_table.vals[Stag_Base] = 0xFF000000;
color_table.vals[Stag_Pop1] = 0xFF3C57DC;
color_table.vals[Stag_Pop2] = 0xFFFF0000;
color_table.vals[Stag_Back_Cycle_1] = 0x10A00000;
color_table.vals[Stag_Back_Cycle_2] = 0x0C00A000;
color_table.vals[Stag_Back_Cycle_3] = 0x0C0000A0;
color_table.vals[Stag_Back_Cycle_4] = 0x0CA0A000;
color_table.vals[Stag_Text_Cycle_1] = 0xFFA00000;
color_table.vals[Stag_Text_Cycle_2] = 0xFF00A000;
color_table.vals[Stag_Text_Cycle_3] = 0xFF0030B0;
color_table.vals[Stag_Text_Cycle_4] = 0xFFA0A000;
}
internal void
app_hardcode_default_style(Models *models){
Partition *part = &models->mem.part;
Color_Table color_table = {};
color_table.vals = push_array(part, u32, Stag_COUNT);
color_table.count = Stag_COUNT;
fill_hardcode_default_style(color_table);
models->fallback_color_table = color_table;
}
internal void
@ -758,7 +771,9 @@ launch_command_via_event(System_Functions *system, Application_Step_Result *app_
models->command_coroutine = app_launch_coroutine(system, &models->app_links, Co_Command, models->command_coroutine, &cmd_in, models->command_coroutine_flags);
models->prev_command = cmd_bind;
app_result->animating = true;
if (event.keycode != key_animate){
app_result->animating = true;
}
}
}
@ -927,6 +942,7 @@ App_Step_Sig(app_step){
Application_Step_Result app_result = {};
app_result.mouse_cursor_type = APP_MOUSE_CURSOR_DEFAULT;
app_result.lctrl_lalt_is_altgr = models->settings.lctrl_lalt_is_altgr;
models->animate_next_frame = false;
// NOTE(allen): per-frame update of models state
models->target = target;
@ -960,7 +976,7 @@ App_Step_Sig(app_step){
Editing_File *file = working_set_contains_canon(working_set, canon.name);
if (file != 0){
if (file->state.ignore_behind_os == 0){
file_set_dirty_flag(file, DirtyState_UnloadedChanges);
file_add_dirty_flag(file, DirtyState_UnloadedChanges);
}
else if (file->state.ignore_behind_os == 1){
file->state.ignore_behind_os = 2;
@ -985,43 +1001,6 @@ App_Step_Sig(app_step){
Vec2_i32 current_dim = V2i32(target->width, target->height);
layout_set_root_size(&models->layout, current_dim);
// NOTE(allen): First frame initialization
if (input->first_step){
// Open command line files.
char space[512];
String cl_file_name = make_fixed_width_string(space);
copy_ss(&cl_file_name, models->hot_directory.string);
i32 cl_file_name_len = cl_file_name.size;
for (i32 i = 0; i < models->settings.init_files_count; ++i){
cl_file_name.size = cl_file_name_len;
String file_name = {};
Editing_File_Name canon_name = {};
if (get_canon_name(system, make_string_slowly(models->settings.init_files[i]),
&canon_name)){
file_name = canon_name.name;
}
else{
append_sc(&cl_file_name, models->settings.init_files[i]);
file_name = cl_file_name;
}
Buffer_ID id = 0;
create_buffer(&models->app_links, file_name, 0, &id);
}
if (models->hook_start != 0){
char **files = models->settings.init_files;
i32 files_count = models->settings.init_files_count;
char **flags = models->settings.custom_flags;
i32 flags_count = models->settings.custom_flags_count;
models->hook_start(&models->app_links, files, files_count, flags, flags_count);
}
}
// NOTE(allen): update child processes
f32 dt = input->dt;
if (dt > 0){
@ -1110,9 +1089,9 @@ App_Step_Sig(app_step){
input->keys.keys[input->keys.count++] = mouse_event;
}
if (input->mouse.x != models->prev_x || input->mouse.y != models->prev_y){
b32 was_in_window = hit_check(models->prev_x, models->prev_y, i32R(0, 0, prev_dim.x, prev_dim.y));
b32 is_in_window = hit_check(input->mouse.x, input->mouse.y, i32R(0, 0, current_dim.x, current_dim.y));
if (input->mouse.p != models->prev_p){
b32 was_in_window = hit_check(i32R(0, 0, prev_dim.x, prev_dim.y), models->prev_p);
b32 is_in_window = hit_check(i32R(0, 0, current_dim.x, current_dim.y), input->mouse.p);
if (is_in_window || was_in_window){
mouse_event.keycode = key_mouse_move;
input->keys.keys[input->keys.count++] = mouse_event;
@ -1131,7 +1110,7 @@ App_Step_Sig(app_step){
Panel *mouse_panel = 0;
Panel *divider_panel = 0;
b32 mouse_in_margin = false;
Vec2_i32 mouse = V2i32(input->mouse.x, input->mouse.y);
Vec2_i32 mouse = input->mouse.p;
{
for (Panel *panel = layout_get_first_open_panel(layout);
panel != 0;
@ -1155,6 +1134,43 @@ App_Step_Sig(app_step){
}
}
// NOTE(allen): First frame initialization
if (input->first_step){
// Open command line files.
char space[512];
String cl_file_name = make_fixed_width_string(space);
copy_ss(&cl_file_name, models->hot_directory.string);
i32 cl_file_name_len = cl_file_name.size;
for (i32 i = 0; i < models->settings.init_files_count; ++i){
cl_file_name.size = cl_file_name_len;
String file_name = {};
Editing_File_Name canon_name = {};
if (get_canon_name(system, make_string_slowly(models->settings.init_files[i]),
&canon_name)){
file_name = canon_name.name;
}
else{
append_sc(&cl_file_name, models->settings.init_files[i]);
file_name = cl_file_name;
}
Buffer_ID id = 0;
create_buffer(&models->app_links, file_name, 0, &id);
}
if (models->hook_start != 0){
char **files = models->settings.init_files;
i32 files_count = models->settings.init_files_count;
char **flags = models->settings.custom_flags;
i32 flags_count = models->settings.custom_flags_count;
models->hook_start(&models->app_links, files, files_count, flags, flags_count);
}
}
// NOTE(allen): consume event stream
Key_Event_Data *key_ptr = input->keys.keys;
Key_Event_Data *key_end = key_ptr + input->keys.count;
@ -1235,7 +1251,10 @@ App_Step_Sig(app_step){
user_in.abort = ((abort_flags & event_flags) != 0);
models->command_coroutine = app_resume_coroutine(system, &models->app_links, Co_Command, command_coroutine, &user_in, models->command_coroutine_flags);
app_result.animating = true;
if (user_in.key.keycode != key_animate){
app_result.animating = true;
}
if (models->command_coroutine == 0){
init_query_set(&view->query_set);
}
@ -1300,7 +1319,7 @@ App_Step_Sig(app_step){
}
else{
scroll_vars = &view->ui_scroll;
i32 bottom = view->ui_control.bounding_box[UICoordinates_Scrolled].y1;
i32 bottom = view->ui_control.bounding_box[UICoordinates_ViewSpace].y1;
max_y = view_compute_max_target_y_from_bottom_y(view, (f32)bottom);
file_scroll = false;
}
@ -1342,46 +1361,57 @@ App_Step_Sig(app_step){
if (hook_file_edit_finished != 0){
Working_Set *working_set = &models->working_set;
if (working_set->edit_finished_list.next != &working_set->edit_finished_list){
if (working_set->time_of_next_edit_finished_signal == 0){
local_const u32 elapse_time = 1000;
working_set->time_of_next_edit_finished_signal = system->now_time() + (u64)(elapse_time - 5)*(u64)1000;
b32 trigger_hook = false;
u32 elapse_time = models->edit_finished_hook_repeat_speed;
if (elapse_time != 0){
trigger_hook = true;
}
else if (working_set->time_of_next_edit_finished_signal == 0){
u32 trigger_window_length = 0;
if (elapse_time > 5){
trigger_window_length = elapse_time - 5;
}
u64 trigger_time = system->now_time() + (u64)trigger_window_length*1000LLU;
working_set->time_of_next_edit_finished_signal = trigger_time;
system->wake_up_timer_set(working_set->edit_finished_timer, elapse_time);
}
else{
if (system->now_time() >= working_set->time_of_next_edit_finished_signal){
Partition *scratch = &models->mem.part;
Temp_Memory temp = begin_temp_memory(scratch);
Node *first = working_set->edit_finished_list.next;
Node *stop = &working_set->edit_finished_list;
Editing_File **file_ptrs = push_array(scratch, Editing_File*, 0);
for (Node *node = first;
node != stop;
node = node->next){
Editing_File **file_ptr = push_array(scratch, Editing_File*, 1);
*file_ptr = CastFromMember(Editing_File, edit_finished_mark_node, node);
}
i32 id_count = (i32)(push_array(scratch, Editing_File*, 0) - file_ptrs);
Buffer_ID *ids = push_array(scratch, Buffer_ID, id_count);
for (i32 i = 0; i < id_count; i += 1){
ids[i] = file_ptrs[i]->id.id;
}
working_set->do_not_mark_edits = true;
hook_file_edit_finished(&models->app_links, ids, id_count);
working_set->do_not_mark_edits = false;
for (i32 i = 0; i < id_count; i += 1){
block_zero_struct(&file_ptrs[i]->edit_finished_mark_node);
}
dll_init_sentinel(&working_set->edit_finished_list);
working_set->time_of_next_edit_finished_signal = 0;
end_temp_memory(temp);
else if (system->now_time() >= working_set->time_of_next_edit_finished_signal){
trigger_hook = true;
}
if (trigger_hook){
Partition *scratch = &models->mem.part;
Temp_Memory temp = begin_temp_memory(scratch);
Node *first = working_set->edit_finished_list.next;
Node *stop = &working_set->edit_finished_list;
Editing_File **file_ptrs = push_array(scratch, Editing_File*, 0);
for (Node *node = first;
node != stop;
node = node->next){
Editing_File **file_ptr = push_array(scratch, Editing_File*, 1);
*file_ptr = CastFromMember(Editing_File, edit_finished_mark_node, node);
}
i32 id_count = (i32)(push_array(scratch, Editing_File*, 0) - file_ptrs);
Buffer_ID *ids = push_array(scratch, Buffer_ID, id_count);
for (i32 i = 0; i < id_count; i += 1){
ids[i] = file_ptrs[i]->id.id;
}
working_set->do_not_mark_edits = true;
hook_file_edit_finished(&models->app_links, ids, id_count);
working_set->do_not_mark_edits = false;
for (i32 i = 0; i < id_count; i += 1){
block_zero_struct(&file_ptrs[i]->edit_finished_mark_node);
}
dll_init_sentinel(&working_set->edit_finished_list);
working_set->time_of_next_edit_finished_signal = 0;
end_temp_memory(temp);
}
}
}
@ -1403,7 +1433,26 @@ App_Step_Sig(app_step){
// NOTE(allen): rendering
{
begin_render_section(target, system);
f32 literal_dt = 0.f;
u64 now_usecond_stamp = system->now_time();
if (!input->first_step){
u64 elapsed_useconds = now_usecond_stamp - models->last_render_usecond_stamp;
literal_dt = (f32)((f64)(elapsed_useconds)/1000000.f);
}
models->last_render_usecond_stamp = now_usecond_stamp;
f32 animation_dt = 0.f;
if (models->animated_last_frame){
animation_dt = literal_dt;
}
Color_Table color_table = models->fallback_color_table;
if (models->modify_color_table != 0){
color_table = models->modify_color_table(&models->app_links, models->frame_counter, literal_dt, animation_dt);
}
models->color_table = color_table;
begin_render_section(target, system, models->frame_counter, literal_dt, animation_dt);
Panel *active_panel = layout_get_active_panel(layout);
View *active_view = active_panel->view;
@ -1416,9 +1465,10 @@ App_Step_Sig(app_step){
i32_Rect inner = panel->rect_inner;
View *view = panel->view;
Style *style = &models->styles.styles[0];
//Style *style = &models->styles.styles[0];
Color_Table color_table = models->color_table;
draw_rectangle(target, full, style->theme.colors[Stag_Back]);
draw_rectangle(target, full, color_table.vals[Stag_Back]);
File_Edit_Positions edit_pos = view_get_edit_pos(view);
GUI_Scroll_Vars *scroll_vars = &edit_pos.scroll;
@ -1430,13 +1480,13 @@ App_Step_Sig(app_step){
u32 margin_color = 0;
if (active){
margin_color = style->theme.colors[Stag_Margin_Active];
margin_color = color_table.vals[Stag_Margin_Active];
}
else if (panel == mouse_panel){
margin_color = style->theme.colors[Stag_Margin_Hover];
margin_color = color_table.vals[Stag_Margin_Hover];
}
else{
margin_color = style->theme.colors[Stag_Margin];
margin_color = color_table.vals[Stag_Margin];
}
draw_rectangle(target, i32R( full.x0, full.y0, full.x1, inner.y0), margin_color);
draw_rectangle(target, i32R( full.x0, inner.y1, full.x1, full.y1), margin_color);
@ -1474,10 +1524,11 @@ App_Step_Sig(app_step){
app_result.lctrl_lalt_is_altgr = models->settings.lctrl_lalt_is_altgr;
app_result.perform_kill = !models->keep_playing;
// TODO(allen): whenever something wants to animate it should set animate_next_frame now.
app_result.animating = app_result.animating || models->animate_next_frame;
// NOTE(allen): Update Frame to Frame States
models->prev_x = input->mouse.x;
models->prev_y = input->mouse.y;
models->prev_p = input->mouse.p;
models->animated_last_frame = app_result.animating;
models->frame_counter += 1;

View File

@ -69,11 +69,10 @@ fill_view_summary(System_Functions *system, View_Summary *view, View *vptr, Live
view->preferred_x = vptr->preferred_x;
i32_Rect view_region = vptr->panel->rect_inner;
view->view_region = view_region;
view->render_region = i32R(0, 0, rect_width(view_region), rect_height(view_region));
view->file_region = vptr->file_region;
view->view_region = vptr->panel->rect_inner;
i32_Rect file_region = vptr->file_region;
view->file_region = file_region;
view->render_region = i32R(0, 0, rect_width(file_region), rect_height(file_region));
if (vptr->ui_mode){
view->scroll_vars = vptr->ui_scroll;
}
@ -2096,6 +2095,10 @@ DOC_SEE(Full_Cursor)
Assert(file != 0);
if (buffer_api_check_file(file)){
*cursor_out = file_compute_cursor(models->system, file, seek);
if (file->settings.unwrapped_lines){
cursor_out->wrapped_x = cursor_out->unwrapped_x;
cursor_out->wrapped_y = cursor_out->unwrapped_y;
}
result = true;
}
}
@ -3334,7 +3337,8 @@ DOC(This call posts a string to the *messages* buffer.)
return(false);
}
API_EXPORT int32_t
#if 0
//API_EXPORT int32_t
Get_Theme_Count(Application_Links *app)
/*
DOC_RETURN(Returns the number of themes that currently exist in the core.)
@ -3344,7 +3348,7 @@ DOC_RETURN(Returns the number of themes that currently exist in the core.)
return(models->styles.count);
}
API_EXPORT String
//API_EXPORT String
Get_Theme_Name(Application_Links *app, struct Partition *arena, int32_t index)
/*
DOC_PARAM(arena, The arena which will be used to allocate the returned string.)
@ -3370,7 +3374,7 @@ DOC_RETURN(On success this call returns a string allocated on arena that is the
}
// TODO(allen): redocument
API_EXPORT bool32
//API_EXPORT bool32
Create_Theme(Application_Links *app, Theme *theme, String theme_name)
/*
DOC_PARAM(theme, The color data of the new theme.)
@ -3406,7 +3410,7 @@ DOC(This call creates a new theme. If the given name is already the name of a s
}
// TODO(allen): redocument
API_EXPORT bool32
//API_EXPORT bool32
Change_Theme(Application_Links *app, String theme_name)
/*
DOC_PARAM(name, The name parameter specifies the name of the theme to begin using; it need not be null terminated.)
@ -3429,7 +3433,7 @@ DOC(This call changes 4coder's color pallet to one of the built in themes.)
return(result);
}
API_EXPORT bool32
//API_EXPORT bool32
Change_Theme_By_Index(Application_Links *app, int32_t index)
/*
DOC_PARAM(index, The index parameter specifies the index of theme to begin using.)
@ -3446,6 +3450,7 @@ DOC_RETURN(Returns non-zero on success and zero on failure. This call fails whe
}
return(false);
}
#endif
API_EXPORT Face_ID
Get_Largest_Face_ID(Application_Links *app)
@ -3819,17 +3824,19 @@ DOC_RETURN(On success a valid Face_ID, otherwise returns zero.)
*/
{
Models *models = (Models*)app->cmd_context;
Face_ID id = 0;
bool32 result = false;
if (buffer_id != 0){
Editing_File *file = imp_get_file(models, buffer_id);
if (buffer_api_check_file(file)){
id = file->settings.font_id;
*face_id_out = file->settings.font_id;
result = true;
}
}
else{
id = models->global_font_id;
*face_id_out = models->global_font_id;
result = true;
}
return(id);
return(result);
}
API_EXPORT Face_ID
@ -3943,11 +3950,11 @@ DOC(For each struct in the array, the slot in the main color pallet specified by
DOC_SEE(Theme_Color)
*/{
Models *models = (Models*)app->cmd_context;
Style *style = &models->styles.styles[0];
Color_Table color_table = models->color_table;
Theme_Color *theme_color = colors;
for (i32 i = 0; i < count; ++i, ++theme_color){
if (theme_color->tag < Stag_COUNT){
style->theme.colors[theme_color->tag] = theme_color->color;
if (theme_color->tag < color_table.count){
color_table.vals[theme_color->tag] = theme_color->color;
}
}
}
@ -3961,18 +3968,24 @@ DOC(For each struct in the array, the color field of the struct is filled with t
DOC_SEE(Theme_Color)
*/{
Models *models = (Models*)app->cmd_context;
Style *style = &models->styles.styles[0];
Color_Table color_table = models->color_table;
Theme_Color *theme_color = colors;
for (i32 i = 0; i < count; ++i, ++theme_color){
if (theme_color->tag < Stag_COUNT){
theme_color->color = style->theme.colors[theme_color->tag];
}
else{
theme_color->color = 0xFF000000;
}
theme_color->color = finalize_color(color_table, theme_color->tag);
}
}
API_EXPORT argb_color
Finalize_Color(Application_Links *app, int_color color){
Models *models = (Models*)app->cmd_context;
Color_Table color_table = models->color_table;
u32 color_rgb = color;
if ((color & 0xFF000000) == 0){
color_rgb = color_table.vals[color % color_table.count];
}
return(color_rgb);
}
// TODO(allen): redocument
API_EXPORT int32_t
Get_Hot_Directory(Application_Links *app, String *out, int32_t *required_size_out)
@ -4165,6 +4178,13 @@ DOC_SEE(Mouse_Cursor_Show_Type)
models->system->show_mouse_cursor(show);
}
API_EXPORT bool32
Set_Edit_Finished_Hook_Repeat_Speed(Application_Links *app, u32 milliseconds){
Models *models = (Models*)app->cmd_context;
models->edit_finished_hook_repeat_speed = milliseconds;
return(true);
}
API_EXPORT bool32
Set_Fullscreen(Application_Links *app, bool32 full_screen)
/*
@ -4255,27 +4275,28 @@ draw_helper__view_space_to_screen_space(Models *models, f32_Rect rect){
// The render space is such that 0,0 is _always_ the top left corner of the renderable region of the view.
// To make text scroll with the buffer users should read the view's scroll position and subtract it first.
API_EXPORT float
API_EXPORT Vec2
Draw_String(Application_Links *app, Face_ID font_id, String str, Vec2 point, int_color color, u32 flags, Vec2 delta)
{
f32 result = 0.f;
Vec2 result = {};
Models *models = (Models*)app->cmd_context;
if (models->render_view == 0){
result = font_string_width(models->system, models->target, font_id, str);
f32 width = font_string_width(models->system, models->target, font_id, str);
result = delta*width;
}
else{
Style *style = &models->styles.styles[0];
Theme *theme_data = &style->theme;
Color_Table color_table = models->color_table;
//Style *style = &models->styles.styles[0];
//Theme *theme_data = &style->theme;
point = draw_helper__view_space_to_screen_space(models, point);
u32 actual_color = finalize_color(theme_data, color);
result = draw_string(models->system, models->target, font_id, str, point, actual_color, flags, delta);
u32 actual_color = finalize_color(color_table, color);
f32 width = draw_string(models->system, models->target, font_id, str, point, actual_color, flags, delta);
result = delta*width;
}
return(result);
}
API_EXPORT float
API_EXPORT f32
Get_String_Advance(Application_Links *app, Face_ID font_id, String str)
{
Models *models = (Models*)app->cmd_context;
@ -4287,12 +4308,12 @@ Draw_Rectangle(Application_Links *app, f32_Rect rect, int_color color)
{
Models *models = (Models*)app->cmd_context;
if (models->render_view != 0){
Style *style = &models->styles.styles[0];
Theme *theme_data = &style->theme;
Color_Table color_table = models->color_table;
//Style *style = &models->styles.styles[0];
//Theme *theme_data = &style->theme;
rect = draw_helper__view_space_to_screen_space(models, rect);
u32 actual_color = finalize_color(theme_data, color);
u32 actual_color = finalize_color(color_table, color);
draw_rectangle(models->target, rect, actual_color);
}
}
@ -4302,12 +4323,13 @@ Draw_Rectangle_Outline(Application_Links *app, f32_Rect rect, int_color color)
{
Models *models = (Models*)app->cmd_context;
if (models->render_view != 0){
Style *style = &models->styles.styles[0];
Theme *theme_data = &style->theme;
Color_Table color_table = models->color_table;
//Style *style = &models->styles.styles[0];
//Theme *theme_data = &style->theme;
rect = draw_helper__view_space_to_screen_space(models, rect);
u32 actual_color = finalize_color(theme_data, color);
u32 actual_color = finalize_color(color_table, color);
draw_rectangle_outline(models->target, rect, actual_color);
}
}
@ -4339,18 +4361,11 @@ DOC(Opens a color picker using the parameters in the supplied structure.)
system->open_color_picker(picker);
}
void system_schedule_step();
API_EXPORT void
Animate(Application_Links *app)
{
Models *models = (Models*)app->cmd_context;
System_Functions *system = models->system;
/* TODO(casey): Allen, I don't _really_ need system_schedule_step() here (which is what animate() does), I just need to know that somebody _will_ perform a system_schedule_step(), so multiple people all trying to do a step schedule can all be condensed into one... but it _looks_ like that is what already happens with system_schedule_step, since if it pushes multiple animate messages into the queue, they will all be consumed in a single frame, so it's fine, I think? But I of course don't know how it would work on other platforms, since I haven't looked at the Mac OS / Linux code.
The more "correct" way to make this work, I suspect, is to just make a way for me to set the app_result.animating flag to "true", but I don't know how I would go about doing that from here :(
*/
system->animate();
models->animate_next_frame = true;
}
// NOTE(casey): Find_All_In_Range_Insensitive is the only routine supplied, because anyone who would prefer case-sensitive can

View File

@ -34,13 +34,8 @@ struct Models{
Face_ID global_font_id;
Mapping mapping;
Command_Binding prev_command;
i32 prev_x;
i32 prev_y;
b32 animated_last_frame;
Coroutine_Head *command_coroutine;
u32 command_coroutine_flags[2];
@ -60,9 +55,10 @@ struct Models{
Input_Filter_Function *input_filter;
Scroll_Rule_Function *scroll_rule;
Buffer_Name_Resolver_Function *buffer_name_resolver;
Modify_Color_Table_Function *modify_color_table;
Style_Library styles;
u32 *palette;
Color_Table fallback_color_table;
Color_Table color_table;
Layout layout;
Working_Set working_set;
@ -79,8 +75,6 @@ struct Models{
Hot_Directory hot_directory;
Panel *prev_mouse_panel;
b32 keep_playing;
Key_Code user_up_key;
@ -92,13 +86,20 @@ struct Models{
char *title_space;
i32 title_capacity;
u32 edit_finished_hook_repeat_speed;
i32 frame_counter;
i32 previous_mouse_x;
i32 previous_mouse_y;
Panel *resizing_intermediate_panel;
b32 animate_next_frame;
// Last frame state
Vec2_i32 prev_p;
Panel *prev_mouse_panel;
b32 animated_last_frame;
u64 last_render_usecond_stamp;
// System Context
System_Functions *system;
struct App_Vars *vars;

View File

@ -56,7 +56,6 @@ struct Mem_Options{
#include "4ed_code_wrap.h"
#include "4ed_working_set.h"
#include "4ed_style.h"
#include "4ed_hot_directory.h"
#include "4ed_parse_context.h"
#include "4ed_cli.h"

View File

@ -19,9 +19,7 @@ edit_pre_state_change(System_Functions *system, Heap *heap, Models *models, Edit
}
file->state.still_lexing = 0;
}
if (file->state.dirty == DirtyState_UpToDate){
file_set_dirty_flag(file, DirtyState_UnsavedChanges);
}
file_add_dirty_flag(file, DirtyState_UnsavedChanges);
file_unmark_edit_finished(file);
Layout *layout = &models->layout;
for (Panel *panel = layout_get_first_open_panel(layout);

View File

@ -74,8 +74,8 @@ file_needs_save(Editing_File *file){
internal b32
file_can_save(Editing_File *file){
b32 result = false;
if (file->state.dirty == DirtyState_UnsavedChanges ||
file->state.dirty == DirtyState_UnloadedChanges){
if (HasFlag(file->state.dirty, DirtyState_UnsavedChanges) ||
HasFlag(file->state.dirty, DirtyState_UnloadedChanges)){
result = true;
}
return(result);
@ -106,15 +106,20 @@ file_set_to_loading(Editing_File *file){
}
internal void
file_set_dirty_flag(Editing_File *file, Dirty_State state){
file_add_dirty_flag(Editing_File *file, Dirty_State state){
if (!file->settings.unimportant){
file->state.dirty = state;
file->state.dirty |= state;
}
else{
file->state.dirty = DirtyState_UpToDate;
}
}
internal void
file_clear_dirty_flags(Editing_File *file){
file->state.dirty = DirtyState_UpToDate;
}
////////////////////////////////
internal b32
@ -189,7 +194,7 @@ save_file_to_name(System_Functions *system, Models *models, Editing_File *file,
file->attributes = new_attributes;
}
file_set_dirty_flag(file, DirtyState_UpToDate);
file_clear_dirty_flags(file);
if (used_heap){
heap_free(&mem->heap, data);
@ -440,7 +445,7 @@ file_create_from_string(System_Functions *system, Models *models, Editing_File *
if (buffer_size(&file->state.buffer) < val.size){
file->settings.dos_write_mode = true;
}
file_set_dirty_flag(file, DirtyState_UpToDate);
file_clear_dirty_flags(file);
file->attributes = attributes;
Face_ID font_id = models->global_font_id;

View File

@ -26,7 +26,8 @@ draw_change_clip(Render_Target *target, i32_Rect clip_box){
}
internal void
begin_render_section(Render_Target *target, System_Functions *system){
begin_render_section(Render_Target *target, System_Functions *system,
i32 frame_index, f32 literal_dt, f32 animation_dt){
target->clip_top = -1;
i32_Rect clip;
@ -37,7 +38,9 @@ begin_render_section(Render_Target *target, System_Functions *system){
draw_push_clip(target, clip);
target->buffer.pos = 0;
target->clear_color = 0xFFFF00FF;
target->frame_index = frame_index;
target->literal_dt = literal_dt;
target->animation_dt = animation_dt;
}
internal void

View File

@ -24,7 +24,7 @@ Render_Begin_Push_Sig(render_internal_begin_push, t, ptr, size){
memcpy(out, ptr, size);
}
else{
t->clear_color = 0xFF00FF00;
t->out_of_memory = true;
}
return(out);
}

View File

@ -20,13 +20,16 @@ struct Render_Free_Texture{
struct Render_Target{
i32_Rect clip_boxes[5];
i32 clip_top;
b32 clip_all;
b8 clip_all;
b8 out_of_memory;
i32 width;
i32 height;
i32 bound_texture;
u32 color;
u32 clear_color;
i32 frame_index;
f32 literal_dt;
f32 animation_dt;
Render_Free_Texture *free_texture_first;
Render_Free_Texture *free_texture_last;

View File

@ -1,34 +0,0 @@
/*
* Mr. 4th Dimention - Allen Webster
*
* 28.08.2015
*
* Styles for 4coder
*
*/
// TOP
#if !defined(FRED_STYLE_H)
#define FRED_STYLE_H
struct Style_Font{
Face_ID font_id;
};
struct Style{
char name_[32];
String name;
Theme theme;
};
struct Style_Library{
Style styles[64];
i32 count;
i32 max;
};
#endif
// BOTTOM

View File

@ -452,25 +452,17 @@ release_font_and_update_files(System_Functions *system, Models *models, Face_ID
////////////////////////////////
internal u32
finalize_color(Theme *theme_data, u32 color){
if ((color&SymbolicColor__StagColorFlag) && (color&0xFF000000) == 0){
u32 color_index = color&0x007FFFFF;
if (color_index < Stag_COUNT){
u32 *c = &theme_data->colors[color_index];
if (c != 0){
color = *c;
}
else{
color = 0;
}
}
internal argb_color
finalize_color(Color_Table color_table, int_color color){
argb_color color_argb = color;
if ((color & 0xFF000000) == 0){
color_argb = color_table.vals[color % color_table.count];
}
return(color);
return(color_argb);
}
internal void
get_visual_markers(Partition *arena, Dynamic_Workspace *workspace, Range range, Buffer_ID buffer_id, i32 view_index, Theme *theme_data){
get_visual_markers(Partition *arena, Dynamic_Workspace *workspace, Range range, Buffer_ID buffer_id, i32 view_index, Color_Table color_table){
View_ID view_id = view_index + 1;
for (Managed_Buffer_Markers_Header *node = workspace->buffer_markers_list.first;
node != 0;
@ -488,8 +480,15 @@ get_visual_markers(Partition *arena, Dynamic_Workspace *workspace, Range range,
i32 stride_size_from_last = step_stride_in_marker_count - take_count_per_step;
i32 priority = data->priority;
u32 color = finalize_color(theme_data, data->color);
u32 text_color = finalize_color(theme_data, data->text_color);
Render_Marker_Brush brush = {};
brush.color_noop = (data->color == 0);
brush.text_color_noop = (data->text_color == 0);
if (!brush.color_noop){
brush.color = finalize_color(color_table, data->color);
}
if (!brush.text_color_noop){
brush.text_color = finalize_color(color_table, data->text_color);
}
Marker *markers = (Marker*)(node + 1);
Assert(sizeof(*markers) == node->std_header.item_size);
@ -510,8 +509,7 @@ get_visual_markers(Partition *arena, Dynamic_Workspace *workspace, Range range,
Render_Marker *render_marker = push_array(arena, Render_Marker, 1);
render_marker->type = type;
render_marker->pos = marker->pos;
render_marker->color = color;
render_marker->text_color = text_color;
render_marker->brush = brush;
render_marker->one_past_last = marker->pos;
render_marker->priority = priority;
}
@ -548,8 +546,7 @@ get_visual_markers(Partition *arena, Dynamic_Workspace *workspace, Range range,
Render_Marker *render_marker = push_array(arena, Render_Marker, 1);
render_marker->type = type;
render_marker->pos = range_b.min;
render_marker->color = color;
render_marker->text_color = text_color;
render_marker->brush = brush;
render_marker->one_past_last = range_b.max;
render_marker->priority = priority;
}
@ -716,61 +713,81 @@ range_record_stack_get_insert_index(Render_Range_Record *records, i32 count, i32
}
internal u32
get_token_color(Style *style, Cpp_Token token){
get_token_color(Color_Table color_table, Cpp_Token token){
u32 result = 0;
if ((token.flags & CPP_TFLAG_IS_KEYWORD) != 0){
if (cpp_token_category_from_type(token.type) == CPP_TOKEN_CAT_BOOLEAN_CONSTANT){
result = style->theme.colors[Stag_Bool_Constant];
result = color_table.vals[Stag_Bool_Constant];
}
else{
result = style->theme.colors[Stag_Keyword];
result = color_table.vals[Stag_Keyword];
}
}
else if ((token.flags & CPP_TFLAG_PP_DIRECTIVE) != 0){
result = style->theme.colors[Stag_Preproc];
result = color_table.vals[Stag_Preproc];
}
else{
switch (token.type){
case CPP_TOKEN_COMMENT:
{
result = style->theme.colors[Stag_Comment];
result = color_table.vals[Stag_Comment];
}break;
case CPP_TOKEN_STRING_CONSTANT:
{
result = style->theme.colors[Stag_Str_Constant];
result = color_table.vals[Stag_Str_Constant];
}break;
case CPP_TOKEN_CHARACTER_CONSTANT:
{
result = style->theme.colors[Stag_Char_Constant];
result = color_table.vals[Stag_Char_Constant];
}break;
case CPP_TOKEN_INTEGER_CONSTANT:
{
result = style->theme.colors[Stag_Int_Constant];
result = color_table.vals[Stag_Int_Constant];
}break;
case CPP_TOKEN_FLOATING_CONSTANT:
{
result = style->theme.colors[Stag_Float_Constant];
result = color_table.vals[Stag_Float_Constant];
}break;
case CPP_PP_INCLUDE_FILE:
{
result = style->theme.colors[Stag_Include];
result = color_table.vals[Stag_Include];
}break;
default:
{
result = style->theme.colors[Stag_Default];
result = color_table.vals[Stag_Default];
}break;
}
}
return(result);
}
internal Render_Marker_Brush
render__get_brush_from_range_stack(Render_Range_Record *stack, i32 stack_top){
Render_Marker_Brush brush = {true, true};
Render_Range_Record *record = &stack[stack_top];
for (i32 i = stack_top; i >= 0; i -= 1, record -= 1){
if (brush.color_noop && !record->brush.color_noop){
brush.color_noop = false;
brush.color = record->brush.color;
}
if (brush.text_color_noop && !record->brush.text_color_noop){
brush.text_color_noop = false;
brush.text_color = record->brush.text_color;
}
if (!brush.color_noop && !brush.text_color_noop){
break;
}
}
return(brush);
}
internal void
render_loaded_file_in_view__inner(Models *models, Render_Target *target, View *view,
i32_Rect rect, Full_Cursor render_cursor, Range on_screen_range,
Buffer_Render_Item *items, i32 item_count){
Editing_File *file = view->file_data.file;
Partition *part = &models->mem.part;
Style *style = &models->styles.styles[0];
Color_Table color_table = models->color_table;
Assert(file != 0);
Assert(!file->is_dummy);
@ -788,9 +805,8 @@ render_loaded_file_in_view__inner(Models *models, Render_Target *target, View *v
Lifetime_Object *lifetime_object = file->lifetime_object;
Buffer_ID buffer_id = file->id.id;
i32 view_index = view_get_index(&models->live_set, view);
Theme *theme_data = &style->theme;
get_visual_markers(part, &lifetime_object->workspace, on_screen_range, buffer_id, view_index, theme_data);
get_visual_markers(part, &lifetime_object->workspace, on_screen_range, buffer_id, view_index, color_table);
i32 key_count = lifetime_object->key_count;
i32 key_index = 0;
@ -800,7 +816,7 @@ render_loaded_file_in_view__inner(Models *models, Render_Target *target, View *v
i32 local_count = clamp_top(lifetime_key_reference_per_node, key_count - key_index);
for (i32 i = 0; i < local_count; i += 1){
Lifetime_Key *key = node->keys[i];
get_visual_markers(part, &key->dynamic_workspace, on_screen_range, buffer_id, view_index, theme_data);
get_visual_markers(part, &key->dynamic_workspace, on_screen_range, buffer_id, view_index, color_table);
}
key_index += local_count;
}
@ -873,12 +889,12 @@ render_loaded_file_in_view__inner(Models *models, Render_Target *target, View *v
i32 visual_line_range_markers_scan_index = 0;
i32 token_i = 0;
u32 main_color = style->theme.colors[Stag_Default];
u32 special_color = style->theme.colors[Stag_Special_Character];
u32 ghost_color = style->theme.colors[Stag_Ghost_Character];
u32 main_color = color_table.vals[Stag_Default];
u32 special_color = color_table.vals[Stag_Special_Character];
u32 ghost_color = color_table.vals[Stag_Ghost_Character];
if (tokens_use){
Cpp_Get_Token_Result result = cpp_get_token(token_array, items->index);
main_color = get_token_color(style, token_array.tokens[result.token_index]);
main_color = get_token_color(color_table, token_array.tokens[result.token_index]);
token_i = result.token_index + 1;
}
@ -935,17 +951,17 @@ render_loaded_file_in_view__inner(Models *models, Render_Target *target, View *v
if (token_i < token_array.count){
if (ind >= token_array.tokens[token_i].start){
for (;token_i < token_array.count && ind >= token_array.tokens[token_i].start; ++token_i){
main_color = get_token_color(style, token_array.tokens[token_i]);
main_color = get_token_color(color_table, token_array.tokens[token_i]);
current_token = token_array.tokens[token_i];
}
}
else if (ind >= current_token.start + current_token.size){
main_color = style->theme.colors[Stag_Default];
main_color = color_table.vals[Stag_Default];
}
}
if (current_token.type == CPP_TOKEN_JUNK && ind >= current_token.start && ind < current_token.start + current_token.size){
highlight_color = style->theme.colors[Stag_Highlight_Junk];
highlight_color = color_table.vals[Stag_Highlight_Junk];
}
else{
highlight_color = 0;
@ -964,7 +980,7 @@ render_loaded_file_in_view__inner(Models *models, Render_Target *target, View *v
}
if (view->file_data.show_whitespace && highlight_color == 0 && codepoint_is_whitespace(item->codepoint)){
highlight_this_color = style->theme.colors[Stag_Highlight_White];
highlight_this_color = color_table.vals[Stag_Highlight_White];
}
else{
highlight_this_color = highlight_color;
@ -972,41 +988,40 @@ render_loaded_file_in_view__inner(Models *models, Render_Target *target, View *v
// NOTE(allen): Line marker color
if (is_new_line){
i32 visual_line_markers_best_priority = min_i32;
visual_line_markers_color = 0;
for (;visual_line_markers_scan_index < line_markers.count &&
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 == VisualType_LineHighlights);
if (marker->priority > visual_line_markers_best_priority){
visual_line_markers_color = marker->color;
visual_line_markers_best_priority = marker->priority;
}
}
// NOTE(allen): Line range marker color
for (;visual_line_range_markers_scan_index < line_range_markers.count &&
line_range_markers.markers[visual_line_range_markers_scan_index].pos <= ind;
visual_line_range_markers_scan_index += 1){
Render_Marker *marker = &line_range_markers.markers[visual_line_range_markers_scan_index];
Render_Range_Record range_record = {};
range_record.color = marker->color;
range_record.text_color = marker->text_color;
range_record.brush = marker->brush;
range_record.one_past_last = marker->one_past_last;
range_record.priority = marker->priority;
i32 insert_pos = range_record_stack_get_insert_index(line_range_stack, line_range_stack_top + 1, range_record.priority);
memmove(line_range_stack + insert_pos + 1,
line_range_stack + insert_pos,
sizeof(*line_range_stack)*(line_range_stack_top - insert_pos + 1));
memmove(line_range_stack + insert_pos + 1, line_range_stack + insert_pos, sizeof(*line_range_stack)*(line_range_stack_top - insert_pos + 1));
line_range_stack[insert_pos] = range_record;
line_range_stack_top += 1;
}
for (;line_range_stack_top >= 0 && ind > line_range_stack[line_range_stack_top].one_past_last;
line_range_stack_top -= 1);
if (visual_line_markers_color == 0 && line_range_stack_top >= 0){
visual_line_markers_color = line_range_stack[line_range_stack_top].color;
for (;line_range_stack_top >= 0 && ind > line_range_stack[line_range_stack_top].one_past_last; line_range_stack_top -= 1);
Render_Marker_Brush brush = render__get_brush_from_range_stack(line_range_stack, line_range_stack_top);
if (!brush.color_noop){
visual_line_markers_color = brush.color;
}
// NOTE(allen): Single line marker color
i32 visual_line_markers_best_priority = min_i32;
visual_line_markers_color = 0;
for (;visual_line_markers_scan_index < line_markers.count &&
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 == VisualType_LineHighlights);
if (marker->priority > visual_line_markers_best_priority){
if (!marker->brush.color_noop){
visual_line_markers_color = marker->brush.color;
visual_line_markers_best_priority = marker->priority;
}
}
}
}
@ -1017,6 +1032,7 @@ render_loaded_file_in_view__inner(Models *models, Render_Target *target, View *v
// NOTE(allen): Visual marker colors
i32 marker_highlight_best_priority = min_i32;
i32 marker_highlight_text_best_priority = min_i32;
u32 marker_highlight = 0;
u32 marker_highlight_text = 0;
@ -1026,6 +1042,32 @@ render_loaded_file_in_view__inner(Models *models, Render_Target *target, View *v
i32 marker_ibar_best_priority = min_i32;
u32 marker_ibar = 0;
// NOTE(allen): Highlight range marker color
for (;visual_range_markers_scan_index < range_markers.count &&
range_markers.markers[visual_range_markers_scan_index].pos <= ind;
visual_range_markers_scan_index += 1){
Render_Marker *marker = &range_markers.markers[visual_range_markers_scan_index];
Render_Range_Record range_record = {};
range_record.brush = marker->brush;
range_record.one_past_last = marker->one_past_last;
range_record.priority = marker->priority;
i32 insert_pos = range_record_stack_get_insert_index(range_stack, range_stack_top + 1, range_record.priority);
memmove(range_stack + insert_pos + 1, range_stack + insert_pos, sizeof(*range_stack)*(range_stack_top - insert_pos + 1));
range_stack[insert_pos] = range_record;
range_stack_top += 1;
}
for (;range_stack_top >= 0 && ind >= range_stack[range_stack_top].one_past_last; range_stack_top -= 1);
{
Render_Marker_Brush brush = render__get_brush_from_range_stack(range_stack, range_stack_top);
if (!brush.color_noop){
marker_highlight = brush.color;
}
if (!brush.text_color_noop){
marker_highlight_text = brush.text_color;
}
}
// NOTE(allen): Highlight single characters
for (;visual_markers_scan_index < character_markers.count &&
character_markers.markers[visual_markers_scan_index].pos <= ind;
visual_markers_scan_index += 1){
@ -1034,25 +1076,36 @@ render_loaded_file_in_view__inner(Models *models, Render_Target *target, View *v
case VisualType_CharacterBlocks:
{
if (marker->priority > marker_highlight_best_priority){
marker_highlight = marker->color;
marker_highlight_text = marker->text_color;
if (!marker->brush.color_noop){
marker_highlight = marker->brush.color;
}
marker_highlight_best_priority = marker->priority;
}
if (marker->priority > marker_highlight_text_best_priority){
if (!marker->brush.text_color_noop){
marker_highlight_text = marker->brush.text_color;
}
marker_highlight_text_best_priority = marker->priority;
}
}break;
case VisualType_CharacterWireFrames:
{
if (marker->priority > marker_wireframe_best_priority){
marker_wireframe = marker->color;
marker_wireframe_best_priority = marker->priority;
if (!marker->brush.color_noop){
marker_wireframe = marker->brush.color;
marker_wireframe_best_priority = marker->priority;
}
}
}break;
case VisualType_CharacterIBars:
{
if (marker->priority > marker_ibar_best_priority){
marker_ibar = marker->color;
marker_ibar_best_priority = marker->priority;
if (!marker->brush.color_noop){
marker_ibar = marker->brush.color;
marker_ibar_best_priority = marker->priority;
}
}
}break;
@ -1063,31 +1116,6 @@ render_loaded_file_in_view__inner(Models *models, Render_Target *target, View *v
}
}
// NOTE(allen): Highlight range marker color
for (;visual_range_markers_scan_index < range_markers.count &&
range_markers.markers[visual_range_markers_scan_index].pos <= ind;
visual_range_markers_scan_index += 1){
Render_Marker *marker = &range_markers.markers[visual_range_markers_scan_index];
Render_Range_Record range_record = {};
range_record.color = marker->color;
range_record.text_color = marker->text_color;
range_record.one_past_last = marker->one_past_last;
range_record.priority = marker->priority;
i32 insert_pos = range_record_stack_get_insert_index(range_stack, range_stack_top + 1, range_record.priority);
memmove(range_stack + insert_pos + 1,
range_stack + insert_pos,
sizeof(*range_stack)*(range_stack_top - insert_pos + 1));
range_stack[insert_pos] = range_record;
range_stack_top += 1;
}
for (;range_stack_top >= 0 && ind >= range_stack[range_stack_top].one_past_last;
range_stack_top -= 1);
if (range_stack_top >= 0 &&
range_stack[range_stack_top].priority > marker_highlight_best_priority){
marker_highlight = range_stack[range_stack_top].color;
marker_highlight_text = range_stack[range_stack_top].text_color;
}
// NOTE(allen): Perform highlight, wireframe, and ibar renders
u32 color_highlight = 0;
u32 color_wireframe = 0;
@ -1327,7 +1355,12 @@ render_loaded_file_in_view(System_Functions *system, View *view, Models *models,
models->render_range = on_screen_range;
models->render_items = items;
models->render_item_count = item_count;
models->render_caller(&models->app_links, view_id, on_screen_range, do_core_render);
i32 frame_index = target->frame_index;
f32 literal_dt = target->literal_dt;
f32 animation_dt = target->animation_dt;
models->render_caller(&models->app_links, view_id, on_screen_range,
frame_index, literal_dt, animation_dt, do_core_render);
models->render_view = 0;
}
else{

View File

@ -152,18 +152,23 @@ enum{
FileCreateFlag_ReadOnly = 1,
};
struct Render_Marker_Brush{
b8 color_noop;
b8 text_color_noop;
argb_color color;
argb_color text_color;
};
struct Render_Marker{
Marker_Visual_Type type;
u32 color;
u32 text_color;
Render_Marker_Brush brush;
i32 pos;
i32 one_past_last;
i32 priority;
};
struct Render_Range_Record{
u32 color;
u32 text_color;
Render_Marker_Brush brush;
i32 one_past_last;
i32 priority;
};

View File

@ -106,13 +106,13 @@ intbar_draw_string(System_Functions *system, Render_Target *target, File_Bar *ba
internal void
draw_file_bar(System_Functions *system, Render_Target *target, View *view, Models *models, Editing_File *file, i32_Rect rect){
File_Bar bar;
Style *style = &models->styles.styles[0];
File_Bar bar = {};
Color_Table color_table = models->color_table;
u32 back_color = style->theme.colors[Stag_Bar];
u32 base_color = style->theme.colors[Stag_Base];
u32 pop1_color = style->theme.colors[Stag_Pop1];
u32 pop2_color = style->theme.colors[Stag_Pop2];
u32 back_color = color_table.vals[Stag_Bar];
u32 base_color = color_table.vals[Stag_Base];
u32 pop1_color = color_table.vals[Stag_Pop1];
u32 pop2_color = color_table.vals[Stag_Pop2];
bar.rect = rect;
@ -174,21 +174,21 @@ draw_file_bar(System_Functions *system, Render_Target *target, View *view, Model
}
internal u32
get_margin_color(Style *style, i32 level){
u32 margin = 0xFFFFFFFF;
get_margin_color(Color_Table color_table, i32 level){
u32 margin = 0;
switch (level){
default:
case UIActivation_None:
{
margin = style->theme.colors[Stag_List_Item];
margin = color_table.vals[Stag_List_Item];
}break;
case UIActivation_Hover:
{
margin = style->theme.colors[Stag_List_Item_Hover];
margin = color_table.vals[Stag_List_Item_Hover];
}break;
case UIActivation_Active:
{
margin = style->theme.colors[Stag_List_Item_Active];
margin = color_table.vals[Stag_List_Item_Active];
}break;
}
return(margin);
@ -201,12 +201,11 @@ do_render_file_view(System_Functions *system, View *view, Models *models, GUI_Sc
Assert(file != 0);
i32 line_height = view->line_height;
Style *style = &models->styles.styles[0];
Color_Table color_table = models->color_table;
Face_ID font_id = file->settings.font_id;
char font_name_space[256];
String font_name = make_fixed_width_string(font_name_space);
font_name.size = system->font.get_name_by_id(font_id, font_name.str, font_name.memory_size);
Font_Pointers font = system->font.get_pointers_by_id(font_id);
if (!view->hide_file_bar){
i32_Rect top_bar_rect = {};
@ -228,9 +227,9 @@ do_render_file_view(System_Functions *system, View *view, Models *models, GUI_Sc
query_bar_rect.x1 = rect.x1;
query_bar_rect.y1 = rect.y0 + line_height + 2;
rect.y0 = query_bar_rect.y1;
u32 back_color = style->theme.colors[Stag_Back];
u32 text1_color = style->theme.colors[Stag_Default];
u32 text2_color = style->theme.colors[Stag_Pop1];
u32 back_color = color_table.vals[Stag_Back];
u32 text1_color = color_table.vals[Stag_Default];
u32 text2_color = color_table.vals[Stag_Pop1];
Vec2 p = V2(query_bar_rect.p0);
p.y += 2.f;
draw_rectangle(target, query_bar_rect, back_color);
@ -255,14 +254,14 @@ do_render_file_view(System_Functions *system, View *view, Models *models, GUI_Sc
f32_Rect item_rect = f32R(item->rectangle);
switch (item->coordinates){
case UICoordinates_Scrolled:
case UICoordinates_ViewSpace:
{
item_rect.x0 += rect_f32.x0 - ui_scroll.scroll_x;
item_rect.y0 += rect_f32.y0 - ui_scroll.scroll_y;
item_rect.x1 += rect_f32.x0 - ui_scroll.scroll_x;
item_rect.y1 += rect_f32.y0 - ui_scroll.scroll_y;
}break;
case UICoordinates_ViewRelative:
case UICoordinates_PanelSpace:
{
item_rect.x0 += rect_f32.x0;
item_rect.y0 += rect_f32.y0;
@ -275,10 +274,10 @@ do_render_file_view(System_Functions *system, View *view, Models *models, GUI_Sc
switch (item->type){
case UIType_Option:
{
u32 back = style->theme.colors[Stag_Back];
u32 text_color = style->theme.colors[Stag_Default];
u32 pop_color = style->theme.colors[Stag_Pop2];
u32 margin_color = get_margin_color(style, item->activation_level);
u32 back = color_table.vals[Stag_Back];
u32 text_color = color_table.vals[Stag_Default];
u32 pop_color = color_table.vals[Stag_Pop2];
u32 margin_color = get_margin_color(color_table, item->activation_level);
f32_Rect inner = get_inner_rect(item_rect, 3);
draw_rectangle(target, inner, back);
Vec2 p = V2(inner.p0) + V2(3.f, line_height*0.5f - 1.f);
@ -290,9 +289,9 @@ do_render_file_view(System_Functions *system, View *view, Models *models, GUI_Sc
case UIType_TextField:
{
u32 back = style->theme.colors[Stag_Back];
u32 text1 = style->theme.colors[Stag_Default];
u32 text2 = style->theme.colors[Stag_Pop1];
u32 back = color_table.vals[Stag_Back];
u32 text1 = color_table.vals[Stag_Default];
u32 text2 = color_table.vals[Stag_Pop1];
draw_rectangle(target, item_rect, back);
Vec2 p = V2(item_rect.p0) + V2(0.f, 2.f);
p.x += draw_string(system, target, font_id, item->text_field.query, p, text2);
@ -300,6 +299,11 @@ do_render_file_view(System_Functions *system, View *view, Models *models, GUI_Sc
p.x += draw_string(system, target, font_id, item->text_field.string, p, text1);
}break;
// TODO(allen): figure out how this should work again later
case UIType_ColorTheme:
{}break;
#if 0
case UIType_ColorTheme:
{
Style *style_preview = &models->styles.styles[item->color_theme.index];
@ -326,6 +330,7 @@ do_render_file_view(System_Functions *system, View *view, Models *models, GUI_Sc
draw_string(system, target, font_id, font_name, V2(font_x, p.y), text_color);
}
Font_Pointers font = system->font.get_pointers_by_id(font_id);
i32 height = font.metrics->height;
p = V2(inner.x0, p.y + (f32)height);
p.x += draw_string(system, target, font_id, "if", p, keyword_color);
@ -339,6 +344,7 @@ do_render_file_view(System_Functions *system, View *view, Models *models, GUI_Sc
p = V2(inner.x0, p.y + (f32)height);
draw_string(system, target, font_id, "[] () {}; * -> +-/ <>= ! && || % ^", p, text_color);
}break;
#endif
}
}
}

View File

@ -96,10 +96,7 @@ interpret_render_buffer(Render_Target *t, Partition *growable_scratch){
glLoadIdentity();
glOrtho(0, width, height, 0, -1, 1);
glScissor(0, 0, width, height);
{
Vec4 color = unpack_color4(t->clear_color);
glClearColor(color.r, color.g, color.b, color.a);
}
glClearColor(1.f, 0.f, 1.f, 1.f);
glClear(GL_COLOR_BUFFER_BIT);
glBindTexture(GL_TEXTURE_2D, 0);
@ -252,6 +249,13 @@ interpret_render_buffer(Render_Target *t, Partition *growable_scratch){
}
}
if (target.out_of_memory){
glScissor(0, 0, width, height);
glClearColor(0.f, 1.f, 0.f, 1.f);
glClear(GL_COLOR_BUFFER_BIT);
target.out_of_memory = false;
}
glFlush();
}

View File

@ -37,7 +37,7 @@
# include "4coder_lib/4coder_string.h"
# include "4coder_API/4coder_keycodes.h"
# include "4coder_API/4coder_style.h"
# include "4coder_API/4coder_default_colors.h"
# include "4coder_API/4coder_types.h"
#else
# include "4coder_default_bindings.cpp"
@ -101,8 +101,7 @@ struct Win32_Input_Chunk_Transient{
global Win32_Input_Chunk_Transient null_input_chunk_transient = {};
struct Win32_Input_Chunk_Persistent{
i32 mouse_x;
i32 mouse_y;
Vec2_i32 mouse;
Control_Keys controls;
b8 mouse_l;
b8 mouse_r;
@ -265,7 +264,7 @@ handle_type_ptr(void *ptr){
////////////////////////////////
void
internal void
system_schedule_step(){
PostMessage(win32vars.window_handle, WM_4coder_ANIMATE, 0, 0);
}
@ -1807,13 +1806,9 @@ win32_proc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam){
case WM_MOUSEMOVE:
{
i32 new_x = LOWORD(lParam);
i32 new_y = HIWORD(lParam);
if (new_x != win32vars.input_chunk.pers.mouse_x || new_y != win32vars.input_chunk.pers.mouse_y){
win32vars.input_chunk.pers.mouse_x = new_x;
win32vars.input_chunk.pers.mouse_y = new_y;
Vec2_i32 new_m = V2i32(LOWORD(lParam), HIWORD(lParam));
if (new_m != win32vars.input_chunk.pers.mouse){
win32vars.input_chunk.pers.mouse = new_m;
win32vars.got_useful_event = true;
}
}break;
@ -2297,8 +2292,7 @@ WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdS
win32vars.input_chunk.trans.out_of_window = true;
}
win32vars.input_chunk.pers.mouse_x = mouse_point.x;
win32vars.input_chunk.pers.mouse_y = mouse_point.y;
win32vars.input_chunk.pers.mouse = V2i32(mouse_point.x, mouse_point.y);
}
else{
win32vars.input_chunk.trans.out_of_window = true;
@ -2331,8 +2325,7 @@ WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdS
input.mouse.release_r = input_chunk.trans.mouse_r_release;
input.mouse.wheel = input_chunk.trans.mouse_wheel;
input.mouse.x = input_chunk.pers.mouse_x;
input.mouse.y = input_chunk.pers.mouse_y;
input.mouse.p = input_chunk.pers.mouse;
input.trying_to_kill = input_chunk.trans.trying_to_kill;

View File

@ -444,8 +444,7 @@ system_directory_exists(char *path){
//
internal int_color
swap_r_and_b(int_color a)
{
swap_r_and_b(int_color a){
int_color result = a & 0xff00ff00;
result |= ((a >> 16) & 0xff);
result |= ((a & 0xff) << 16);
@ -453,18 +452,18 @@ swap_r_and_b(int_color a)
}
internal int_color
int_color_from_colorref(COLORREF ref, int_color alpha_from)
{
int_color_from_colorref(COLORREF ref, int_color alpha_from){
int_color rgb = swap_r_and_b(ref & 0xffffff);
int_color result = ((0xff000000 & alpha_from) | rgb);
return(result);
}
void system_schedule_step();
internal void
system_schedule_step();
internal UINT_PTR CALLBACK
color_picker_hook(HWND Window, UINT Message, WPARAM WParam, LPARAM LParam)
{
color_picker_hook(HWND Window, UINT Message, WPARAM WParam, LPARAM LParam){
UINT_PTR result = 0;
switch(Message)
{