├── run_test.bat ├── apply.sh ├── apply.bat ├── custom ├── bin │ ├── setup_cl_x86.bat │ ├── detect_os.sh │ ├── setup_cl_x64.bat │ ├── build_metadata.bat │ ├── build_one_time.sh │ ├── buildsuper_x86-linux.sh │ ├── buildsuper_x64-linux.sh │ ├── buildsuper_x64-mac.sh │ ├── build_one_time.bat │ ├── build_metadata.sh │ ├── setup_cl_generic.bat │ ├── buildsuper_x64-win.bat │ └── buildsuper_x86-win.bat ├── 4coder_scope_commands.h ├── 4coder_build_commands.h ├── 4coder_jumping.h ├── 4coder_insertion.h ├── lexer_generator │ ├── 4coder_lex_gen_hand_written.h │ ├── 4coder_lex_gen_hand_written.cpp │ ├── pcg_basic.h │ └── pcg_basic.c ├── 4coder_combined_write_commands.h ├── 4coder_clipboard.h ├── 4coder_string_match.h ├── 4coder_config_grammar.txt ├── 4coder_system_helpers.cpp ├── 4coder_draw.h ├── 4coder_custom.cpp ├── 4coder_buffer_seek_constructors.cpp ├── 4coder_function_list.h ├── 4coder_delta_rule.h ├── 4coder_file.cpp ├── 4coder_auto_indent.h ├── 4coder_jump_lister.h ├── 4coder_profile_static_disable.cpp ├── 4coder_search_list.h ├── 4coder_search.h ├── 4coder_layout_rule.h ├── 4coder_app_links_allocator.cpp ├── 4coder_tutorial.h ├── 4coder_async_tasks.h ├── 4coder_version.h ├── 4coder_default_bindings.cpp ├── 4coder_profile.h ├── 4coder_malloc_allocator.cpp ├── 4coder_table.h ├── 4coder_jump_sticky.h ├── 4coder_system_types.h ├── 4coder_prj_v1.h ├── 4coder_system_allocator.cpp ├── 4coder_log.cpp ├── 4coder_audio.h ├── 4coder_profile_static_enable.cpp ├── 4coder_default_include.h ├── 4coder_search_list.cpp ├── 4coder_hash_functions.cpp ├── project_.4coder ├── 4coder_cli_command.cpp ├── 4coder_command_map.h ├── 4coder_codepoint_map.cpp ├── 4coder_default_colors.h ├── 4coder_profile_inspect.h ├── 4coder_jump_lister.cpp ├── 4coder_token.h ├── 4coder_variables.h ├── 4coder_code_index.h ├── 4coder_default_include.cpp ├── 4coder_keyboard_macro.cpp ├── 4coder_default_framework_variables.cpp ├── 4coder_code_index_listers.cpp ├── 4coder_lister_base.h ├── 4coder_log_parser.h ├── 4coder_project_commands.h ├── 4coder_default_framework.h ├── 4coder_font_helper.cpp ├── 4coder_doc_content_types.h ├── 4coder_insertion.cpp ├── 4coder_events.h ├── generated │ └── system_api_master_list.h ├── 4coder_string_match.cpp ├── 4coder_eol.cpp ├── 4coder_helper.h ├── 4coder_scope_commands.cpp ├── 4coder_dynamic_bindings.cpp └── 4coder_doc_commands.cpp ├── 4coder_qol_token.h ├── 4coder_qol_bview.h ├── 4coder_qol_lister.h ├── project.4coder ├── .github └── workflows │ └── main.yml ├── 4coder_qol_helper.h ├── 4coder_qol_colors.cpp ├── theme-qol.4coder ├── config.4coder ├── 4coder_qol_snippets.cpp ├── 4coder_qol.cpp ├── 4coder_qol_jumps.cpp ├── 4coder_qol_block.cpp ├── 4coder_qol_hooks.cpp └── 4coder_qol_bview.cpp /run_test.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | call ..\test_build\4ed.exe -------------------------------------------------------------------------------- /apply.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cp ./custom_4coder.* ../ 4 | cp ./custom_4coder.* ../4coder_qol/ 5 | -------------------------------------------------------------------------------- /apply.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | copy .\custom_4coder.* ..\custom_4coder.* 3 | copy .\custom_4coder.* ..\4coder_qol\custom_4coder.* -------------------------------------------------------------------------------- /custom/bin/setup_cl_x86.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | SET SCRIPTS_PATH=%~dp0 4 | "%SCRIPTS_PATH%\setup_cl_generic.bat" amd64_x86 5 | -------------------------------------------------------------------------------- /4coder_qol_token.h: -------------------------------------------------------------------------------- 1 | 2 | enum{ 3 | qol_TokenKind_Primitive = TokenBaseKind_COUNT, 4 | qol_TokenKind_Control, 5 | qol_TokenKind_Struct, 6 | }; 7 | -------------------------------------------------------------------------------- /custom/bin/detect_os.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | os="unknown" 4 | if [[ "$OSTYPE" == "darwin"* ]]; then 5 | echo "mac" 6 | elif [[ "$OSTYPE" == "linux-gnu" ]]; then 7 | echo "linux" 8 | fi 9 | -------------------------------------------------------------------------------- /custom/bin/setup_cl_x64.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | REM (allen): quit early if we already have cl 4 | where /q cl 5 | IF %ERRORLEVEL% == 0 (EXIT /b) 6 | 7 | SET SCRIPTS_PATH=%~dp0 8 | "%SCRIPTS_PATH%\setup_cl_generic.bat" amd64 9 | -------------------------------------------------------------------------------- /4coder_qol_bview.h: -------------------------------------------------------------------------------- 1 | 2 | global View_ID g_qol_b_view; 3 | global Buffer_ID g_qol_b_buffer; 4 | global f32 g_qol_cur_bot_height; 5 | global f32 g_qol_nxt_bot_height; 6 | 7 | function void qol_bview_set_buffer(Application_Links *app, Buffer_ID buffer); 8 | -------------------------------------------------------------------------------- /4coder_qol_lister.h: -------------------------------------------------------------------------------- 1 | 2 | function Lister_Result qol_run_lister(Application_Links *app, Lister *lister); 3 | function void qol_lister__backspace_text_field__default(Application_Links *app); 4 | function void qol_lister__backspace_text_field__file_path(Application_Links *app); -------------------------------------------------------------------------------- /custom/4coder_scope_commands.h: -------------------------------------------------------------------------------- 1 | /* 2 | 4coder_scope_commands.cpp - A set of commands and helpers relevant for scope level navigation and editing. 3 | */ 4 | 5 | // TOP 6 | 7 | #if !defined(FCODER_SCOPE_COMMANDS_H) 8 | #define FCODER_SCOPE_COMMANDS_H 9 | 10 | #endif 11 | 12 | // BOTTOM 13 | -------------------------------------------------------------------------------- /custom/4coder_build_commands.h: -------------------------------------------------------------------------------- 1 | /* 2 | 4coder_build_commands.h - Commands for building types. 3 | */ 4 | 5 | // TOP 6 | 7 | #if !defined(FCODER_BUILD_COMMANDS_H) 8 | #define FCODER_BUILD_COMMANDS_H 9 | 10 | function void comp_error(Application_Links *app, String_Const_u8 error_text); 11 | 12 | #endif 13 | 14 | // BOTTOM -------------------------------------------------------------------------------- /custom/4coder_jumping.h: -------------------------------------------------------------------------------- 1 | /* 2 | 4coder_jumping.h - Typesused when writing code to jump to locations and seek through jump lists. 3 | */ 4 | 5 | // TOP 6 | 7 | #if !defined(FCODER_JUMPING_H) 8 | #define FCODER_JUMPING_H 9 | 10 | typedef u32 Jump_Flag; 11 | enum{ 12 | JumpFlag_SkipSubs = 1, 13 | }; 14 | 15 | #endif 16 | 17 | // BOTTOM -------------------------------------------------------------------------------- /custom/4coder_insertion.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Serial inserts helpers 3 | */ 4 | 5 | // TOP 6 | 7 | #if !defined(FRED_INSERTION_H) 8 | #define FRED_INSERTION_H 9 | 10 | struct Buffer_Insertion{ 11 | Application_Links *app; 12 | Buffer_ID buffer; 13 | i64 at; 14 | b32 buffering; 15 | Cursor *cursor; 16 | Temp_Memory temp; 17 | }; 18 | 19 | #endif 20 | 21 | // BOTTOM 22 | -------------------------------------------------------------------------------- /custom/lexer_generator/4coder_lex_gen_hand_written.h: -------------------------------------------------------------------------------- 1 | #if !defined(FCODER_LEX_GEN_HAND_WRITTEN_TYPES) 2 | #define FCODER_LEX_GEN_HAND_WRITTEN_TYPES 3 | 4 | struct Lexeme_Table_Value{ 5 | Token_Base_Kind base_kind; 6 | u16 sub_kind; 7 | }; 8 | 9 | struct Lexeme_Table_Lookup{ 10 | b32 found_match; 11 | Token_Base_Kind base_kind; 12 | u16 sub_kind; 13 | }; 14 | 15 | #endif -------------------------------------------------------------------------------- /custom/4coder_combined_write_commands.h: -------------------------------------------------------------------------------- 1 | /* 2 | 4coder_combined_write_commands.cpp - Commands for writing text specialized for particular contexts. 3 | */ 4 | 5 | // TOP 6 | 7 | struct Snippet{ 8 | char *name; 9 | char *text; 10 | i32 cursor_offset; 11 | i32 mark_offset; 12 | }; 13 | 14 | struct Snippet_Array{ 15 | Snippet *snippets; 16 | i32 count; 17 | }; 18 | 19 | // BOTTOM 20 | -------------------------------------------------------------------------------- /custom/4coder_clipboard.h: -------------------------------------------------------------------------------- 1 | /* 2 | 4coder_clipboard.cpp - Copy paste commands and clipboard related setup. 3 | */ 4 | 5 | // TOP 6 | 7 | #ifndef FCODER_CLIPBOARD_H 8 | #define FCODER_CLIPBOARD_H 9 | 10 | struct Clipboard{ 11 | Arena arena; 12 | Heap heap; 13 | String_Const_u8 *clips; 14 | u32 clip_index; 15 | u32 clip_capacity; 16 | }; 17 | 18 | #endif //4CODER_CLIPBOARD_H 19 | 20 | // BOTTOM 21 | -------------------------------------------------------------------------------- /custom/4coder_string_match.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Mr. 4th Dimention - Allen Webster 3 | * 4 | * 30.07.2019 5 | * 6 | * Types for operating on the String_Match and String_Match_List types. 7 | * 8 | */ 9 | 10 | // TOP 11 | 12 | #if !defined(FCODER_STRING_MATCH_H) 13 | #define FCODER_STRING_MATCH_H 14 | 15 | typedef b32 Buffer_Predicate(Application_Links *app, Buffer_ID buffer); 16 | 17 | #endif 18 | 19 | // BOTTOM -------------------------------------------------------------------------------- /custom/4coder_config_grammar.txt: -------------------------------------------------------------------------------- 1 | sconfig := [version] {assignment} 2 | 3 | version := "version" "(" INTEGER ")" ";" 4 | assignment := lvalue "=" rvalue ";" 5 | lvalue := IDENTIFIER [ "[" INTEGER "]" ] 6 | rvalue := lvalue | BOOLEAN | INTEGER | FLOAT | STRING | CHARACTER | "{" compound_body 7 | compound_body := compound_element {"," compound_element} [","] "}" 8 | compound_element := ["." (IDENTIFIER | INTEGER) "="] rvalue 9 | -------------------------------------------------------------------------------- /custom/4coder_system_helpers.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * 4coder_system_types.h - Implementation of universal (cross platform) helpers 3 | */ 4 | 5 | // TOP 6 | 7 | Mutex_Lock::Mutex_Lock(System_Mutex m){ 8 | system_mutex_acquire(m); 9 | this->mutex = m; 10 | } 11 | 12 | Mutex_Lock::~Mutex_Lock(){ 13 | system_mutex_release(this->mutex); 14 | } 15 | 16 | Mutex_Lock::operator System_Mutex(){ 17 | return(this->mutex); 18 | } 19 | 20 | // BOTTOM 21 | -------------------------------------------------------------------------------- /custom/4coder_draw.h: -------------------------------------------------------------------------------- 1 | /* 2 | 4coder_draw.h - Layout and rendering types of standard UI pieces (including buffers) 3 | */ 4 | 5 | // TOP 6 | 7 | #if !defined(FCODER_DRAW_H) 8 | #define FCODER_DRAW_H 9 | 10 | struct Comment_Highlight_Pair{ 11 | String_Const_u8 needle; 12 | ARGB_Color color; 13 | }; 14 | 15 | typedef i32 Range_Highlight_Kind; 16 | enum{ 17 | RangeHighlightKind_LineHighlight, 18 | RangeHighlightKind_CharacterHighlight, 19 | }; 20 | 21 | #endif 22 | 23 | // BOTTOM 24 | -------------------------------------------------------------------------------- /custom/4coder_custom.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 4coder_custom.cpp 3 | */ 4 | 5 | // TOP 6 | 7 | extern "C" b32 8 | get_version(i32 maj, i32 min, i32 patch){ 9 | return(maj == MAJOR && min == MINOR && patch == PATCH); 10 | } 11 | 12 | extern "C" Custom_Layer_Init_Type* 13 | init_apis(API_VTable_custom *custom_vtable, API_VTable_system *system_vtable){ 14 | custom_api_read_vtable(custom_vtable); 15 | system_api_read_vtable(system_vtable); 16 | return(custom_layer_init); 17 | } 18 | 19 | // BOTTOM 20 | -------------------------------------------------------------------------------- /custom/4coder_buffer_seek_constructors.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Buffer seek descriptor constructors. 3 | */ 4 | 5 | // TOP 6 | 7 | static Buffer_Seek 8 | seek_pos(i64 pos){ 9 | Buffer_Seek result; 10 | result.type = buffer_seek_pos; 11 | result.pos = pos; 12 | return(result); 13 | } 14 | 15 | static Buffer_Seek 16 | seek_line_col(i64 line, i64 col){ 17 | Buffer_Seek result; 18 | result.type = buffer_seek_line_col; 19 | result.line = line; 20 | result.col = col; 21 | return(result); 22 | } 23 | 24 | // BOTTOM 25 | -------------------------------------------------------------------------------- /custom/4coder_function_list.h: -------------------------------------------------------------------------------- 1 | /* 2 | 4coder_function_list.cpp - Command for listing all functions in a C/C++ file in a jump list. 3 | */ 4 | 5 | // TOP 6 | 7 | #if !defined(FCODER_FUNCTION_LIST_H) 8 | #define FCODER_FUNCTION_LIST_H 9 | 10 | struct Function_Positions{ 11 | i64 sig_start_index; 12 | i64 sig_end_index; 13 | i64 open_paren_pos; 14 | }; 15 | 16 | struct Get_Positions_Results{ 17 | i64 positions_count; 18 | i64 next_token_index; 19 | b32 still_looping; 20 | }; 21 | 22 | #endif 23 | 24 | // BOTTOM 25 | -------------------------------------------------------------------------------- /custom/4coder_delta_rule.h: -------------------------------------------------------------------------------- 1 | /* 2 | 4coder_delta_rule.h - Types for built in delta rules and delta rule helpers. 3 | */ 4 | 5 | // TOP 6 | 7 | #if !defined(FCODER_DELTA_RULE_H) 8 | #define FCODER_DELTA_RULE_H 9 | 10 | union Delta_Context_Header{ 11 | Buffer_Point point; 12 | Vec2_f32 p; 13 | }; 14 | struct Buffer_Point_Delta_Result{ 15 | Buffer_Point point; 16 | b32 still_animating; 17 | }; 18 | struct Vec2_f32_Delta_Result{ 19 | Vec2_f32 p; 20 | b32 still_animating; 21 | }; 22 | 23 | struct Smooth_Step{ 24 | f32 p; 25 | f32 v; 26 | }; 27 | 28 | #endif 29 | 30 | // BOTTOM 31 | -------------------------------------------------------------------------------- /custom/4coder_file.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Mr. 4th Dimention - Allen Webster 3 | * 4 | * 03.10.2019 5 | * 6 | * Basic helpers for C std file handling. 7 | * 8 | */ 9 | 10 | // TOP 11 | 12 | #include 13 | 14 | function String_Const_u8 15 | data_from_file(Arena *arena, FILE *file){ 16 | String_Const_u8 result = {}; 17 | if (file != 0){ 18 | fseek(file, 0, SEEK_END); 19 | result.size = ftell(file); 20 | fseek(file, 0, SEEK_SET); 21 | result.str = push_array(arena, u8, result.size + 1); 22 | fread(result.str, 1, (size_t)result.size, file); 23 | result.str[result.size] = 0; 24 | } 25 | return(result); 26 | } 27 | 28 | // BOTTOM 29 | -------------------------------------------------------------------------------- /custom/bin/build_metadata.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | set code_home=%~dp0 4 | if %code_home:~-1%==\ (set code_home=%code_home:~0,-1%) 5 | 6 | set src=%1 7 | if "%src%" == "" set src=4coder_default_bindings.cpp 8 | 9 | set opts=/W4 /wd4310 /wd4100 /wd4201 /wd4505 /wd4996 /wd4127 /wd4510 /wd4512 /wd4610 /wd4390 /WX 10 | set opts=%opts% /GR- /EHa- /nologo /FC 11 | 12 | pushd ..\build 13 | set preproc_file=4coder_command_metadata.i 14 | set meta_macros=/DMETA_PASS 15 | cl /I"%code_home%" %opts% %debug% %code_home%\%src% /P /Fi%preproc_file% %meta_macros% 16 | cl %opts% ..\code\4coder_metadata_generator.cpp /Zi /Femetadata_generator 17 | metadata_generator -R "%code_home%" "%cd%\\%preproc_file%" 18 | 19 | popd 20 | -------------------------------------------------------------------------------- /custom/4coder_auto_indent.h: -------------------------------------------------------------------------------- 1 | /* 2 | 4coder_auto_indent.h - Auto-indentation types. 3 | */ 4 | 5 | // TOP 6 | 7 | #if !defined(FCODER_AUTO_INDENT_H) 8 | #define FCODER_AUTO_INDENT_H 9 | 10 | typedef u32 Indent_Flag; 11 | enum{ 12 | Indent_ClearLine = 0x1, 13 | Indent_UseTab = 0x2, 14 | Indent_FullTokens = 0x4, 15 | }; 16 | 17 | struct Nest{ 18 | Nest *next; 19 | Token_Base_Kind kind; 20 | i64 indent; 21 | }; 22 | 23 | struct Nest_Alloc{ 24 | Nest *free_nest; 25 | }; 26 | 27 | struct Indent_Line_Cache{ 28 | i64 where_token_starts; 29 | i64 line_number_for_cached_indent; 30 | i64 start_pos; 31 | i64 one_past_last_pos; 32 | Indent_Info indent_info; 33 | }; 34 | 35 | #endif 36 | 37 | // BOTTOM 38 | -------------------------------------------------------------------------------- /custom/4coder_jump_lister.h: -------------------------------------------------------------------------------- 1 | /* 2 | 4coder_jump_lister.h - Lister for jump buffers. 3 | */ 4 | 5 | // TOP 6 | 7 | #if !defined(FCODER_JUMP_LISTER_H) 8 | #define FCODER_JUMP_LISTER_H 9 | 10 | typedef i32 Jump_Lister_Activation_Rule; 11 | enum{ 12 | JumpListerActivation_OpenInUIView = 0, 13 | JumpListerActivation_OpenInTargetViewKeepUI = 1, 14 | JumpListerActivation_OpenInTargetViewCloseUI = 2, 15 | JumpListerActivation_OpenInNextViewKeepUI = 3, 16 | JumpListerActivation_OpenInNextViewCloseUI = 4, 17 | }; 18 | 19 | struct Jump_Lister_Parameters{ 20 | Buffer_ID list_buffer_id; 21 | Jump_Lister_Activation_Rule activation_rule; 22 | View_ID target_view_id; 23 | }; 24 | 25 | struct Jump_Lister_Result{ 26 | b32 success; 27 | i32 index; 28 | }; 29 | 30 | #endif 31 | 32 | // BOTTOM -------------------------------------------------------------------------------- /custom/bin/build_one_time.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # If any command errors, stop the script 4 | set -e 5 | 6 | # Set up directories 7 | ORIGINAL=$PWD 8 | ME="$(readlink -f "$0")" 9 | LOCATION="$(dirname "$ME")" 10 | cd $LOCATION 11 | cd .. 12 | CUSTOM_ROOT=$PWD 13 | cd $ORIGINAL 14 | 15 | target=$1 16 | if [ -z "$target" ] 17 | then 18 | echo error: no input file 19 | exit 1 20 | fi 21 | 22 | full_target=$target 23 | if [[ ${target:0:1} != "/" ]]; 24 | then 25 | full_target="$PWD/$target" 26 | fi 27 | 28 | dst=$2 29 | if [[ $dst == "" ]]; 30 | then 31 | dst=. 32 | fi 33 | 34 | debug=-g 35 | 36 | opts="-Wno-write-strings -Wno-null-dereference -Wno-comment -Wno-switch -Wno-missing-declarations -Wno-logical-op-parentheses -g -DOS_LINUX=1 -DOS_WINDOWS=0 -DOS_MAC=0" 37 | 38 | pushd $dst 39 | g++ -I"$CUSTOM_ROOT" $opts $full_target -o one_time 40 | popd 41 | -------------------------------------------------------------------------------- /custom/4coder_profile_static_disable.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * 4coder_profile_static_disable.cpp - Statically removes all profile posting code 3 | * that follows until the next 4coder_profile_static_enable.cpp 4 | */ 5 | 6 | // TOP 7 | 8 | #if defined(ProfileBlock) 9 | #undef ProfileBlock 10 | #undef ProfileScope 11 | #undef ProfileBlockNamed 12 | #undef ProfileScopeNamed 13 | 14 | #undef ProfileTLBlock 15 | #undef ProfileTLScope 16 | #undef ProfileTLBlockNamed 17 | #undef ProfileTLScopeNamed 18 | 19 | #undef ProfileCloseNow 20 | #endif 21 | 22 | #define ProfileBlock(T,N) 23 | #define ProfileScope(T,N) 24 | #define ProfileBlockNamed(T,N,M) 25 | #define ProfileScopeNamed(T,N,M) 26 | 27 | #define ProfileTLBlock(T,L,N) 28 | #define ProfileTLScope(T,L,N) 29 | #define ProfileTLBlockNamed(T,L,N,M) 30 | #define ProfileTLScopeNamed(T,L,N,M) 31 | 32 | #define ProfileCloseNow(O) 33 | 34 | // BOTTOM 35 | -------------------------------------------------------------------------------- /custom/4coder_search_list.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Mr. 4th Dimention - Allen Webster 3 | * 4 | * 01.10.2019 5 | * 6 | * Search list helper. 7 | * 8 | */ 9 | 10 | // TOP 11 | 12 | #if !defined(FRED_SEARCH_LIST_H) 13 | #define FRED_SEARCH_LIST_H 14 | 15 | //////////////////////////////// 16 | // NOTE(allen): Search List Builders 17 | 18 | function void def_search_add_path(Arena *arena, List_String_Const_u8 *list, String_Const_u8 path); 19 | function void def_search_list_add_system_path(Arena *arena, List_String_Const_u8 *list, System_Path_Code path); 20 | 21 | //////////////////////////////// 22 | // NOTE(allen): Search List Functions 23 | 24 | function String_Const_u8 def_search_get_full_path(Arena *arena, List_String_Const_u8 *list, String_Const_u8 file_name); 25 | function FILE *def_search_fopen(Arena *arena, List_String_Const_u8 *list, char *file_name, char *opt); 26 | 27 | #endif 28 | 29 | // BOTTOM 30 | -------------------------------------------------------------------------------- /custom/4coder_search.h: -------------------------------------------------------------------------------- 1 | /* 2 | 4coder_search.h - Types that are used in the search accross all buffers procedures. 3 | */ 4 | 5 | // TOP 6 | 7 | #if !defined(FCODER_SEARCH_H) 8 | #define FCODER_SEARCH_H 9 | 10 | typedef u32 List_All_Locations_Flag; 11 | enum{ 12 | ListAllLocationsFlag_CaseSensitive = 1, 13 | ListAllLocationsFlag_MatchSubstring = 2, 14 | }; 15 | 16 | struct Word_Complete_Iterator{ 17 | Application_Links *app; 18 | Arena *arena; 19 | 20 | b32 initialized; 21 | Range_i64 range; 22 | 23 | Temp_Memory arena_restore; 24 | Buffer_ID first_buffer; 25 | Buffer_ID current_buffer; 26 | b32 scan_all_buffers; 27 | String_Const_u8 needle; 28 | 29 | List_String_Const_u8 list; 30 | Node_String_Const_u8 *node; 31 | Table_Data_u64 already_used_table; 32 | }; 33 | 34 | struct Word_Complete_Menu{ 35 | Render_Caller_Function *prev_render_caller; 36 | Word_Complete_Iterator *it; 37 | String_Const_u8 options[8]; 38 | i32 count; 39 | }; 40 | 41 | #endif 42 | 43 | // BOTOTM 44 | -------------------------------------------------------------------------------- /custom/4coder_layout_rule.h: -------------------------------------------------------------------------------- 1 | /* 2 | 4coder_layout_rule.h - Built in layout rule types. 3 | */ 4 | 5 | // TOP 6 | 7 | #if !defined(FCODER_LAYOUT_RULE_H) 8 | #define FCODER_LAYOUT_RULE_H 9 | 10 | struct Newline_Layout_Vars{ 11 | i64 newline_character_index; 12 | b32 consuming_newline_characters; 13 | b32 prev_did_emit_newline; 14 | }; 15 | 16 | struct LefRig_TopBot_Layout_Vars{ 17 | Face_Advance_Map *advance_map; 18 | Face_Metrics *metrics; 19 | f32 tab_width; 20 | f32 line_to_text_shift; 21 | 22 | Vec2_f32 blank_dim; 23 | 24 | Vec2_f32 p; 25 | f32 line_y; 26 | f32 text_y; 27 | f32 width; 28 | }; 29 | 30 | struct Layout_Reflex{ 31 | Layout_Item_List *list; 32 | Buffer_ID buffer; 33 | f32 width; 34 | Face_ID face; 35 | }; 36 | 37 | typedef i32 Layout_Wrap_Kind; 38 | enum{ 39 | Layout_Unwrapped, 40 | Layout_Wrapped, 41 | }; 42 | 43 | typedef i32 Layout_Virtual_Indent; 44 | enum{ 45 | LayoutVirtualIndent_Off, 46 | LayoutVirtualIndent_On, 47 | }; 48 | 49 | #endif 50 | 51 | // BOTTOM 52 | -------------------------------------------------------------------------------- /custom/4coder_app_links_allocator.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * 4coder app links base allocator 3 | */ 4 | 5 | // TOP 6 | 7 | Scratch_Block::Scratch_Block(Application_Links *app){ 8 | Thread_Context *t = this->tctx = get_thread_context(app); 9 | this->arena = tctx_reserve(t); 10 | this->temp = begin_temp(this->arena); 11 | } 12 | 13 | Scratch_Block::Scratch_Block(Application_Links *app, Arena *a1){ 14 | Thread_Context *t = this->tctx = get_thread_context(app); 15 | this->arena = tctx_reserve(t, a1); 16 | this->temp = begin_temp(this->arena); 17 | } 18 | 19 | Scratch_Block::Scratch_Block(Application_Links *app, Arena *a1, Arena *a2){ 20 | Thread_Context *t = this->tctx = get_thread_context(app); 21 | this->arena = tctx_reserve(t, a1, a2); 22 | this->temp = begin_temp(this->arena); 23 | } 24 | 25 | Scratch_Block::Scratch_Block(Application_Links *app, Arena *a1, Arena *a2, Arena *a3){ 26 | Thread_Context *t = this->tctx = get_thread_context(app); 27 | this->arena = tctx_reserve(t, a1, a2, a3); 28 | this->temp = begin_temp(this->arena); 29 | } 30 | 31 | // BOTTOM 32 | -------------------------------------------------------------------------------- /project.4coder: -------------------------------------------------------------------------------- 1 | version(2); 2 | project_name = "4coder QOL"; 3 | 4 | indent_with_tabs = false; 5 | indent_width = 2; 6 | session_file = ".session.4coder"; 7 | 8 | patterns = { 9 | "*.c", 10 | "*.cpp", 11 | "*.h", 12 | "*.hpp", 13 | "*.m", 14 | "*.mm", 15 | "*.bat", 16 | "*.sh", 17 | "*.4coder", 18 | "*.txt", 19 | }; 20 | 21 | blacklist_patterns = { ".*", }; 22 | 23 | paths = { 24 | { .path = ".", .recursive = true, .relative = true, }, 25 | }; 26 | 27 | load_paths = { 28 | .win = paths, 29 | .mac = paths, 30 | .linux = paths, 31 | }; 32 | 33 | commands = { 34 | .run = { .win = "run_test.bat", .out = "*compilation*", .footer_panel=true, .save_dirty_files=true, .cursor_at_end=true, }, 35 | .build = { .win = "build.bat", .out = "*compilation*", .footer_panel=true, .save_dirty_files=true, .cursor_at_end=true, }, 36 | .debugger = { .win = "remedybg .", .out = "*compilation*", .footer_panel=true, .save_dirty_files=false, .cursor_at_end=false, }, 37 | }; 38 | 39 | fkey_command = { 40 | .F2 = "run", 41 | .F5 = "build", 42 | .F9 = "debugger", 43 | }; 44 | -------------------------------------------------------------------------------- /custom/4coder_tutorial.h: -------------------------------------------------------------------------------- 1 | /* 2 | 4coder_tutorial.h - Guided graphical tutorial system. 3 | */ 4 | 5 | // TOP 6 | 7 | #if !defined(FCODER_TUTORIAL_H) 8 | #define FCODER_TUTORIAL_H 9 | 10 | typedef i32 Tutorial_Action; 11 | enum{ 12 | TutorialAction_None, 13 | TutorialAction_Minimize, 14 | TutorialAction_Maximize, 15 | TutorialAction_Prev, 16 | TutorialAction_Next, 17 | TutorialAction_Index, 18 | TutorialAction_Exit, 19 | TutorialAction_Restart, 20 | }; 21 | 22 | struct Tutorial_Slide{ 23 | Fancy_Block long_details; 24 | Fancy_Line short_details; 25 | }; 26 | 27 | typedef Tutorial_Slide Tutorial_Slide_Function(Application_Links *app, Arena *arena); 28 | 29 | struct Tutorial_Desc{ 30 | Tutorial_Slide_Function *func; 31 | String_Const_u8 title; 32 | }; 33 | 34 | struct Tutorial_State{ 35 | b32 in_tutorial; 36 | View_ID view; 37 | Face_ID face; 38 | b32 is_active; 39 | Tutorial_Action hover_action; 40 | Tutorial_Action depressed_action; 41 | 42 | Tutorial_Desc *slides; 43 | i32 slide_count; 44 | i32 slide_index; 45 | i32 hover_index; 46 | }; 47 | 48 | #endif 49 | 50 | // BOTTOM 51 | -------------------------------------------------------------------------------- /custom/bin/buildsuper_x86-linux.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # If any command errors, stop the script 4 | set -e 5 | 6 | # Store the real CWD 7 | ME="$(readlink -f "$0")" 8 | LOCATION="$(dirname "$ME")" 9 | CODE_HOME="$(dirname "$LOCATION")" 10 | 11 | # Find the most reasonable candidate build file 12 | SOURCE="$1" 13 | if [ -z "$SOURCE" ]; then 14 | SOURCE="$(readlink -f "$CODE_HOME/4coder_default_bindings.cpp")" 15 | fi 16 | 17 | opts="-Wno-write-strings -Wno-null-dereference -Wno-comment -Wno-switch -Wno-missing-declarations -Wno-logical-op-parentheses -g -DOS_LINUX=1 -DOS_WINDOWS=0 -DOS_MAC=0" 18 | arch=-m32 19 | 20 | debug=-g 21 | 22 | preproc_file=4coder_command_metadata.i 23 | meta_macros="-DMETA_PASS" 24 | g++ -I"$CODE_HOME" $meta_macros $arch $opts $debug -std=c++11 "$SOURCE" -E -o $preproc_file 25 | g++ -I"$CODE_HOME" $opts $debug -std=c++11 "$CODE_HOME/4coder_metadata_generator.cpp" -o "$CODE_HOME/metadata_generator" 26 | "$CODE_HOME/metadata_generator" -R "$CODE_HOME" "$PWD/$preproc_file" 27 | 28 | g++ -I"$CODE_HOME" $arch $opts $debug -std=gnu++0x "$SOURCE" -shared -o custom_4coder.so -fPIC 29 | 30 | rm "$CODE_HOME/metadata_generator" 31 | rm $preproc_file 32 | -------------------------------------------------------------------------------- /custom/bin/buildsuper_x64-linux.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # If any command errors, stop the script 4 | set -e 5 | 6 | # Store the real CWD 7 | ME="$(readlink -f "$0")" 8 | LOCATION="$(dirname "$ME")" 9 | CODE_HOME="$(dirname "$LOCATION")" 10 | 11 | # Find the most reasonable candidate build file 12 | SOURCE="$1" 13 | if [ -z "$SOURCE" ]; then 14 | SOURCE="$(readlink -f "$CODE_HOME/4coder_default_bindings.cpp")" 15 | fi 16 | echo SOURCE = $SOURCE 17 | 18 | opts="-Wno-write-strings -Wno-null-dereference -Wno-comment -Wno-switch -Wno-missing-declarations -Wno-logical-op-parentheses -g -DOS_LINUX=1 -DOS_WINDOWS=0 -DOS_MAC=0" 19 | arch=-m64 20 | 21 | debug=-g 22 | 23 | preproc_file=4coder_command_metadata.i 24 | meta_macros="-DMETA_PASS" 25 | g++ -I"$CODE_HOME" $meta_macros $arch $opts $debug -std=c++11 "$SOURCE" -E -o $preproc_file 26 | g++ -I"$CODE_HOME" $opts $debug -std=c++11 "$CODE_HOME/4coder_metadata_generator.cpp" -o "$CODE_HOME/metadata_generator" 27 | "$CODE_HOME/metadata_generator" -R "$CODE_HOME" "$PWD/$preproc_file" 28 | 29 | g++ -I"$CODE_HOME" $arch $opts $debug -std=gnu++0x "$SOURCE" -shared -o custom_4coder.so -fPIC 30 | 31 | rm "$CODE_HOME/metadata_generator" 32 | rm $preproc_file 33 | -------------------------------------------------------------------------------- /custom/4coder_async_tasks.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 4coder_async_tasks.cpp - Types for the custom layer asynchronous task system. 3 | */ 4 | 5 | // TOP 6 | 7 | #if !defined(FCODER_ASYNC_TASKS_H) 8 | #define FCODER_ASYNC_TASKS_H 9 | 10 | typedef void Async_Task_Function_Type(struct Async_Context *actx, String_Const_u8 data); 11 | typedef u64 Async_Task; 12 | 13 | struct Async_Thread{ 14 | struct Async_System *async_system; 15 | System_Thread thread; 16 | struct Async_Node *node; 17 | Async_Task task; 18 | b32 cancel_signal; 19 | }; 20 | 21 | struct Async_Node{ 22 | union{ 23 | Async_Node *next; 24 | Node node; 25 | }; 26 | Async_Task task; 27 | Async_Thread *thread; 28 | Async_Task_Function_Type *func; 29 | String_Const_u8 data; 30 | }; 31 | 32 | struct Async_System{ 33 | void *cmd_context; 34 | 35 | Heap node_heap; 36 | Arena node_arena; 37 | System_Mutex mutex; 38 | System_Condition_Variable cv; 39 | System_Condition_Variable join_cv; 40 | Async_Task task_id_counter; 41 | Async_Node *free_nodes; 42 | Node task_sent; 43 | i32 task_count; 44 | 45 | Async_Thread thread; 46 | }; 47 | 48 | struct Async_Context{ 49 | Application_Links *app; 50 | Async_Thread *thread; 51 | }; 52 | 53 | #endif 54 | 55 | // BOTTOM 56 | -------------------------------------------------------------------------------- /custom/bin/buildsuper_x64-mac.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # If any command errors, stop the script 4 | set -e 5 | 6 | # Store the real CWD 7 | ME="$(realpath "$0")" 8 | LOCATION="$(dirname "$ME")" 9 | CODE_HOME="$(dirname "$LOCATION")" 10 | 11 | # Find the most reasonable candidate build file 12 | SOURCE="$1" 13 | if [ -z "$SOURCE" ]; then 14 | SOURCE="$(realpath "$CODE_HOME/4coder_default_bindings.cpp")" 15 | fi 16 | 17 | # NOTE(yuval): Removed -Wno-writable-strings as it is the same as -Wno-write-strings 18 | opts="-Wno-write-strings -Wno-null-dereference -Wno-comment -Wno-switch -Wno-missing-declarations -Wno-logical-op-parentheses -g -DOS_MAC=1 -DOS_WINDOWS=0 -DOS_LINUX=0" 19 | arch=-m64 20 | 21 | debug=-g 22 | 23 | preproc_file=4coder_command_metadata.i 24 | meta_macros="-DMETA_PASS" 25 | clang++ -I"$CODE_HOME" $meta_macros $arch $opts $debug -std=c++11 "$SOURCE" -E -o $preproc_file 26 | clang++ -I"$CODE_HOME" $opts $debug -std=c++11 "$CODE_HOME/4coder_metadata_generator.cpp" -o "$CODE_HOME/metadata_generator" 27 | "$CODE_HOME/metadata_generator" -R "$CODE_HOME" "$PWD/$preproc_file" 28 | 29 | clang++ -I"$CODE_HOME" $arch $opts $debug -std=c++11 "$SOURCE" -shared -o custom_4coder.so -fPIC 30 | 31 | rm "$CODE_HOME/metadata_generator" 32 | rm $preproc_file 33 | -------------------------------------------------------------------------------- /custom/4coder_version.h: -------------------------------------------------------------------------------- 1 | #define MAJOR 4 2 | #define MINOR 1 3 | #define PATCH 8 4 | 5 | // string 6 | #define VN__(a,b,c) #a "." #b "." #c 7 | #define VN_(a,b,c) VN__(a,b,c) 8 | #define VERSION_NUMBER VN_(MAJOR,MINOR,PATCH) 9 | #define VERSION_STRING "beta " VERSION_NUMBER 10 | 11 | #define ST__(s) #s 12 | #define ST_(s) ST__(s) 13 | #define MAJOR_STR ST_(MAJOR) 14 | #define MINOR_STR ST_(MINOR) 15 | #define PATCH_STR ST_(PATCH) 16 | 17 | #if defined(FRED_SUPER) 18 | #define VERSION_TYPE " super!" 19 | #else 20 | #define VERSION_TYPE 21 | #endif 22 | 23 | // string 24 | #define VN__(a,b,c) #a "." #b "." #c 25 | #define VN_(a,b,c) VN__(a,b,c) 26 | #define VERSION_NUMBER VN_(MAJOR,MINOR,PATCH) 27 | #define VERSION_STRING "beta " VERSION_NUMBER 28 | 29 | #define VERSION VERSION_STRING VERSION_TYPE 30 | 31 | #define WINDOW_NAME "4coder: " VERSION 32 | 33 | // long string 34 | #define L_VN__(a,b,c) L#a L"." L#b L"." L#c 35 | #define L_VN_(a,b,c) L_VN__(a,b,c) 36 | #define L_VERSION_NUMBER L_VN_(MAJOR,MINOR,PATCH) 37 | #define L_VERSION_STRING L"beta " L_VERSION_NUMBER 38 | 39 | #if defined(FRED_SUPER) 40 | #define L_VERSION_TYPE L" super!" 41 | #else 42 | #define L_VERSION_TYPE 43 | #endif 44 | 45 | #define L_VERSION L_VERSION_STRING L_VERSION_TYPE 46 | 47 | #define L_WINDOW_NAME L"4coder: " L_VERSION -------------------------------------------------------------------------------- /custom/bin/build_one_time.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | REM usage: