mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-06-14 08:02:23 -07:00
Merge tag 'v0.9.11-alpha' into odin
# Conflicts: # src/df/gfx/generated/df_gfx.meta.c
This commit is contained in:
@@ -43,7 +43,7 @@ if "%asan%"=="1" set auto_compile_flags=%auto_compile_flags% -fsanitize=add
|
||||
|
||||
:: --- Compile/Link Line Definitions ------------------------------------------
|
||||
set cl_common= /I..\src\ /I..\local\ /nologo /FC /Z7
|
||||
set clang_common= -I..\src\ -I..\local\ -gcodeview -fdiagnostics-absolute-paths -Wall -Wno-unknown-warning-option -Wno-missing-braces -Wno-unused-function -Wno-writable-strings -Wno-unused-value -Wno-unused-variable -Wno-unused-local-typedef -Wno-deprecated-register -Wno-deprecated-declarations -Wno-unused-but-set-variable -Wno-single-bit-bitfield-constant-conversion -Wno-compare-distinct-pointer-types -Xclang -flto-visibility-public-std -D_USE_MATH_DEFINES -Dstrdup=_strdup -Dgnu_printf=printf
|
||||
set clang_common= -I..\src\ -I..\local\ -gcodeview -fdiagnostics-absolute-paths -Wall -Wno-unknown-warning-option -Wno-missing-braces -Wno-unused-function -Wno-writable-strings -Wno-unused-value -Wno-unused-variable -Wno-unused-local-typedef -Wno-deprecated-register -Wno-deprecated-declarations -Wno-unused-but-set-variable -Wno-single-bit-bitfield-constant-conversion -Wno-compare-distinct-pointer-types -Wno-initializer-overrides -Wno-incompatible-pointer-types-discards-qualifiers -Xclang -flto-visibility-public-std -D_USE_MATH_DEFINES -Dstrdup=_strdup -Dgnu_printf=printf
|
||||
set cl_debug= call cl /Od /Ob1 /DBUILD_DEBUG=1 %cl_common% %auto_compile_flags%
|
||||
set cl_release= call cl /O2 /DBUILD_DEBUG=0 %cl_common% %auto_compile_flags%
|
||||
set clang_debug= call clang -g -O0 -DBUILD_DEBUG=1 %clang_common% %auto_compile_flags%
|
||||
|
||||
@@ -779,4 +779,9 @@ internal U64 ring_read(U8 *ring_base, U64 ring_size, U64 ring_pos, void *dst_dat
|
||||
#define ring_write_struct(ring_base, ring_size, ring_pos, ptr) ring_write((ring_base), (ring_size), (ring_pos), (ptr), sizeof(*(ptr)))
|
||||
#define ring_read_struct(ring_base, ring_size, ring_pos, ptr) ring_read((ring_base), (ring_size), (ring_pos), (ptr), sizeof(*(ptr)))
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Sorts
|
||||
|
||||
#define quick_sort(ptr, count, element_size, cmp_function) qsort((ptr), (count), (element_size), (int (*)(const void *, const void *))(cmp_function))
|
||||
|
||||
#endif // BASE_CORE_H
|
||||
|
||||
@@ -33,6 +33,9 @@ main_thread_base_entry_point(void (*entry_point)(CmdLine *cmdline), char **argum
|
||||
#if defined(TEXT_CACHE_H) && !defined(TXT_INIT_MANUAL)
|
||||
txt_init();
|
||||
#endif
|
||||
#if defined(MUTABLE_TEXT_H) && !defined(MTX_INIT_MANUAL)
|
||||
mtx_init();
|
||||
#endif
|
||||
#if defined(DASM_CACHE_H) && !defined(DASM_INIT_MANUAL)
|
||||
dasm_init();
|
||||
#endif
|
||||
@@ -42,9 +45,6 @@ main_thread_base_entry_point(void (*entry_point)(CmdLine *cmdline), char **argum
|
||||
#if defined(FUZZY_SEARCH_H) && !defined(FZY_INIT_MANUAL)
|
||||
fzy_init();
|
||||
#endif
|
||||
#if defined(TXTI_H) && !defined(TXTI_INIT_MANUAL)
|
||||
txti_init();
|
||||
#endif
|
||||
#if defined(DEMON_CORE_H) && !defined(DMN_INIT_MANUAL)
|
||||
dmn_init();
|
||||
#endif
|
||||
|
||||
@@ -22,6 +22,13 @@ di_hash_from_key(DI_Key *k)
|
||||
return hash;
|
||||
}
|
||||
|
||||
internal DI_Key
|
||||
di_key_zero(void)
|
||||
{
|
||||
DI_Key key = {0};
|
||||
return key;
|
||||
}
|
||||
|
||||
internal B32
|
||||
di_key_match(DI_Key *a, DI_Key *b)
|
||||
{
|
||||
|
||||
@@ -199,6 +199,7 @@ global RDI_Parsed di_rdi_parsed_nil = {0};
|
||||
|
||||
internal U64 di_hash_from_string(String8 string, StringMatchFlags match_flags);
|
||||
internal U64 di_hash_from_key(DI_Key *k);
|
||||
internal DI_Key di_key_zero(void);
|
||||
internal B32 di_key_match(DI_Key *a, DI_Key *b);
|
||||
internal DI_Key di_key_copy(Arena *arena, DI_Key *src);
|
||||
internal DI_Key di_normalized_key_from_key(Arena *arena, DI_Key *src);
|
||||
|
||||
+535
-308
File diff suppressed because it is too large
Load Diff
+97
-16
@@ -384,8 +384,6 @@ struct DF_CoreViewRuleSpec
|
||||
////////////////////////////////
|
||||
//~ rjf: Entity Types
|
||||
|
||||
typedef U32 DF_EntitySubKind;
|
||||
|
||||
typedef U32 DF_EntityFlags;
|
||||
enum
|
||||
{
|
||||
@@ -433,7 +431,6 @@ struct DF_Entity
|
||||
|
||||
// rjf: metadata
|
||||
DF_EntityKind kind;
|
||||
DF_EntitySubKind subkind;
|
||||
DF_EntityFlags flags;
|
||||
DF_EntityID id;
|
||||
U64 generation;
|
||||
@@ -559,6 +556,41 @@ struct DF_Unwind
|
||||
DF_UnwindFrameArray frames;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Line Info Types
|
||||
|
||||
typedef struct DF_Line DF_Line;
|
||||
struct DF_Line
|
||||
{
|
||||
DF_Handle file;
|
||||
TxtPt pt;
|
||||
Rng1U64 voff_range;
|
||||
DI_Key dbgi_key;
|
||||
};
|
||||
|
||||
typedef struct DF_LineNode DF_LineNode;
|
||||
struct DF_LineNode
|
||||
{
|
||||
DF_LineNode *next;
|
||||
DF_Line v;
|
||||
};
|
||||
|
||||
typedef struct DF_LineList DF_LineList;
|
||||
struct DF_LineList
|
||||
{
|
||||
DF_LineNode *first;
|
||||
DF_LineNode *last;
|
||||
U64 count;
|
||||
};
|
||||
|
||||
typedef struct DF_LineListArray DF_LineListArray;
|
||||
struct DF_LineListArray
|
||||
{
|
||||
DF_LineList *v;
|
||||
U64 count;
|
||||
DI_KeyList dbgi_keys;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Source <-> Disasm Types
|
||||
|
||||
@@ -621,6 +653,38 @@ struct DF_TextLineDasm2SrcInfoList
|
||||
U64 count;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Interaction Context Register Types
|
||||
|
||||
typedef struct DF_InteractRegs DF_InteractRegs;
|
||||
struct DF_InteractRegs
|
||||
{
|
||||
DF_Handle module;
|
||||
DF_Handle process;
|
||||
DF_Handle thread;
|
||||
U64 unwind_count;
|
||||
U64 inline_unwind_count;
|
||||
DF_Handle window;
|
||||
DF_Handle panel;
|
||||
DF_Handle view;
|
||||
DF_Handle file;
|
||||
TxtPt cursor;
|
||||
TxtPt mark;
|
||||
U128 text_key;
|
||||
TXT_LangKind lang_kind;
|
||||
Rng1U64 vaddr_range;
|
||||
Rng1U64 voff_range;
|
||||
DF_LineList lines;
|
||||
DI_Key dbgi_key;
|
||||
};
|
||||
|
||||
typedef struct DF_InteractRegsNode DF_InteractRegsNode;
|
||||
struct DF_InteractRegsNode
|
||||
{
|
||||
DF_InteractRegsNode *next;
|
||||
DF_InteractRegs v;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Evaluation Visualization Types
|
||||
|
||||
@@ -1170,10 +1234,18 @@ struct DF_State
|
||||
F32 dt;
|
||||
F32 seconds_til_autosave;
|
||||
|
||||
// rjf: interaction registers
|
||||
Arena *frame_arenas[2];
|
||||
DF_InteractRegsNode base_interact_regs;
|
||||
DF_InteractRegsNode *top_interact_regs;
|
||||
|
||||
// rjf: top-level command batch
|
||||
Arena *root_cmd_arena;
|
||||
DF_CmdList root_cmds;
|
||||
|
||||
// rjf: output log key
|
||||
U128 output_log_key;
|
||||
|
||||
// rjf: history cache
|
||||
DF_StateDeltaHistory *hist;
|
||||
|
||||
@@ -1242,7 +1314,6 @@ struct DF_State
|
||||
Arena *ctrl_msg_arena;
|
||||
CTRL_MsgList ctrl_msgs;
|
||||
U64 ctrl_exception_code_filters[(CTRL_ExceptionCodeKind_COUNT+63)/64];
|
||||
B32 ctrl_solo_stepping_mode;
|
||||
|
||||
// rjf: control thread ctrl -> user reading state
|
||||
CTRL_EntityStore *ctrl_entity_store;
|
||||
@@ -1294,7 +1365,6 @@ read_only global DF_Entity df_g_nil_entity =
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
|
||||
// rjf: allocationless, simple equipment
|
||||
{0},
|
||||
@@ -1367,7 +1437,6 @@ internal B32 df_expand_key_match(DF_ExpandKey a, DF_ExpandKey b);
|
||||
|
||||
//- rjf: table
|
||||
internal void df_expand_tree_table_init(Arena *arena, DF_ExpandTreeTable *table, U64 slot_count);
|
||||
internal void df_expand_tree_table_animate(DF_ExpandTreeTable *table, F32 dt);
|
||||
internal DF_ExpandNode *df_expand_node_from_key(DF_ExpandTreeTable *table, DF_ExpandKey key);
|
||||
internal B32 df_expand_key_is_set(DF_ExpandTreeTable *table, DF_ExpandKey key);
|
||||
internal void df_expand_set_expansion(Arena *arena, DF_ExpandTreeTable *table, DF_ExpandKey parent_key, DF_ExpandKey key, B32 expanded);
|
||||
@@ -1393,6 +1462,11 @@ internal String8 df_string_from_cfg_node_key(DF_CfgNode *node, String8 key, Stri
|
||||
internal DF_Inst df_single_inst_from_machine_code__x64(Arena *arena, U64 start_voff, String8 string);
|
||||
internal DF_Inst df_single_inst_from_machine_code(Arena *arena, Architecture arch, U64 start_voff, String8 string);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Debug Info Extraction Type Pure Functions
|
||||
|
||||
internal DF_LineList df_line_list_copy(Arena *arena, DF_LineList *list);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Control Flow Analysis Pure Functions
|
||||
|
||||
@@ -1461,9 +1535,6 @@ internal DF_EntityArray df_entity_array_from_list(Arena *arena, DF_EntityList *l
|
||||
internal DF_EntityFuzzyItemArray df_entity_fuzzy_item_array_from_entity_list_needle(Arena *arena, DF_EntityList *list, String8 needle);
|
||||
internal DF_EntityFuzzyItemArray df_entity_fuzzy_item_array_from_entity_array_needle(Arena *arena, DF_EntityArray *array, String8 needle);
|
||||
|
||||
//- rjf: entity -> text info
|
||||
internal TXTI_Handle df_txti_handle_from_entity(DF_Entity *entity);
|
||||
|
||||
//- rjf: full path building, from file/folder entities
|
||||
internal String8 df_full_path_from_entity(Arena *arena, DF_Entity *entity);
|
||||
|
||||
@@ -1584,16 +1655,20 @@ internal Rng1U64 df_vaddr_range_from_voff_range(DF_Entity *module, Rng1U64 voff_
|
||||
internal String8 df_symbol_name_from_dbgi_key_voff(Arena *arena, DI_Key *dbgi_key, U64 voff);
|
||||
internal String8 df_symbol_name_from_process_vaddr(Arena *arena, DF_Entity *process, U64 vaddr);
|
||||
|
||||
//- rjf: src -> voff lookups
|
||||
internal DF_TextLineSrc2DasmInfoListArray df_text_line_src2dasm_info_list_array_from_src_line_range(Arena *arena, DF_Entity *file, Rng1S64 line_num_range);
|
||||
|
||||
//- rjf: voff -> src lookups
|
||||
internal DF_TextLineDasm2SrcInfo df_text_line_dasm2src_info_from_dbgi_key_voff(DI_Key *dbgi_key, U64 voff, U64 inline_unwind_idx);
|
||||
|
||||
//- rjf: symbol -> voff lookups
|
||||
internal U64 df_voff_from_dbgi_key_symbol_name(DI_Key *dbgi_key, String8 symbol_name);
|
||||
internal U64 df_type_num_from_dbgi_key_name(DI_Key *dbgi_key, String8 name);
|
||||
|
||||
//- rjf: voff -> line info
|
||||
internal DF_LineList df_lines_from_dbgi_key_voff(Arena *arena, DI_Key *dbgi_key, U64 voff);
|
||||
|
||||
//- rjf: file:line -> line info
|
||||
internal DF_LineListArray df_lines_array_from_file_line_range(Arena *arena, DF_Entity *file, Rng1S64 line_num_range);
|
||||
internal DF_LineList df_lines_from_file_line_num(Arena *arena, DF_Entity *file, S64 line_num);
|
||||
|
||||
//- rjf: src -> voff lookups
|
||||
internal DF_TextLineSrc2DasmInfoListArray df_text_line_src2dasm_info_list_array_from_src_line_range(Arena *arena, DF_Entity *file, Rng1S64 line_num_range);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Process/Thread/Module Info Lookups
|
||||
|
||||
@@ -1687,11 +1762,17 @@ internal DF_EvalVizRow *df_eval_viz_row_list_push_new(Arena *arena, EVAL_ParseCt
|
||||
////////////////////////////////
|
||||
//~ rjf: Main State Accessors/Mutators
|
||||
|
||||
//- rjf: frame metadata
|
||||
//- rjf: frame data
|
||||
internal F32 df_dt(void);
|
||||
internal U64 df_frame_index(void);
|
||||
internal Arena *df_frame_arena(void);
|
||||
internal F64 df_time_in_seconds(void);
|
||||
|
||||
//- rjf: interaction registers
|
||||
internal DF_InteractRegs *df_interact_regs(void);
|
||||
internal DF_InteractRegs *df_push_interact_regs(void);
|
||||
internal DF_InteractRegs *df_pop_interact_regs(void);
|
||||
|
||||
//- rjf: undo/redo history
|
||||
internal DF_StateDeltaHistory *df_state_delta_history(void);
|
||||
|
||||
|
||||
@@ -30,9 +30,6 @@ DF_EntityKindTable:
|
||||
//- rjf: auto view rules
|
||||
{AutoViewRule auto_view_rule 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 "Label" Binoculars "Auto View Rule" }
|
||||
|
||||
//- rjf: text attachments
|
||||
{FlashMarker flash_marker 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 "Label" Null "Flash Marker" }
|
||||
|
||||
//- rjf: watch pins
|
||||
{WatchPin watch_pin 1 0 0 1 0 0 1 0 0 0 0 0 0 0 0 1 1 "Expression" Pin "Watch Pin" }
|
||||
|
||||
@@ -145,18 +142,14 @@ DF_CoreCmdTable:// | | |
|
||||
{RunToCursor 0 Null Nil 0 0 0 0 0 0 Play "run_to_cursor" "Run To Cursor" "Runs the selected thread to the current cursor." "" }
|
||||
{SetNextStatement 0 Null Nil 0 0 0 0 0 0 RightArrow "set_next_statement" "Set Next Statement" "Sets the selected thread's instruction pointer to the cursor's position." "" }
|
||||
|
||||
//- rjf: solo stepping mode
|
||||
{EnableSoloSteppingMode 0 Null Nil 0 0 0 0 0 0 Thread "enable_solo_stepping_mode" "Enable Solo Stepping Mode" "Enables 'solo stepping mode', which suspends all non-selected threads before stepping." "solo,stepping,mode,suspend" }
|
||||
{DisableSoloSteppingMode 0 Null Nil 0 0 0 0 0 0 Thread "disable_solo_stepping_mode" "Disable Solo Stepping Mode" "Disables 'solo stepping mode', which suspends all non-selected threads before stepping." "solo,stepping,mode,suspend" }
|
||||
|
||||
//- rjf: debug control context management operations
|
||||
{SelectThread 0 Entity Thread 0 0 0 0 0 1 Null "select_thread" "Select Thread" "Selects a thread." "" }
|
||||
{SelectThreadWindow 0 Entity Thread 0 0 0 0 0 1 Null "select_thread_window" "Select Thread On Window" "Selects a thread for the active window, overriding the global selected thread." "" }
|
||||
{SelectThreadView 0 Entity Thread 0 0 0 0 0 1 Null "select_thread_view" "Select Thread On View" "Selects a thread for the active view, overriding the global and per-window selected threads." "" }
|
||||
{SelectUnwind 1 Null Nil 0 0 0 0 0 0 Null "select_unwind" "Select Unwind" "Selects an unwind frame number for the selected thread." "" }
|
||||
{UpOneFrame 0 Null Nil 0 0 0 0 0 0 UpArrow "up_one_frame" "Up One Frame" "Selects the callstack frame above the currently selected." "" }
|
||||
{DownOneFrame 0 Null Nil 0 0 0 0 0 0 DownArrow "down_one_frame" "Down One Frame" "Selects the callstack frame below the currently selected." "" }
|
||||
{FreezeThread 0 Entity Thread 0 0 0 0 0 1 Locked "freeze_thread" "Freeze Thread" "Freezes the passed thread." "" }
|
||||
{UpOneFrame 0 Null Nil 0 0 0 0 0 0 UpArrow "up_one_frame" "Up One Frame" "Selects the call stack frame above the currently selected." "" }
|
||||
{DownOneFrame 0 Null Nil 0 0 0 0 0 0 DownArrow "down_one_frame" "Down One Frame" "Selects the call stack frame below the currently selected." "callstack,unwind" }
|
||||
{FreezeThread 0 Entity Thread 0 0 0 0 0 1 Locked "freeze_thread" "Freeze Thread" "Freezes the passed thread." "callstack,unwind" }
|
||||
{ThawThread 0 Entity Thread 0 0 0 0 0 1 Unlocked "thaw_thread" "Thaw Thread" "Thaws the passed thread." "" }
|
||||
{FreezeProcess 0 Entity Process 0 0 0 0 0 1 Locked "freeze_process" "Freeze Process" "Freezes the passed process." "" }
|
||||
{ThawProcess 0 Entity Process 0 0 0 0 0 1 Unlocked "thaw_process" "Thaw Process" "Thaws the passed process." "" }
|
||||
@@ -226,11 +219,13 @@ DF_CoreCmdTable:// | | |
|
||||
//- rjf: files
|
||||
{SetCurrentPath 1 Null Nil 0 0 0 0 0 0 FileOutline "set_current_path" "Set Current Path" "Sets the debugger's current path, which is used as a starting point when browsing for files." "" }
|
||||
{Open 0 FilePath Nil 1 0 0 0 0 1 FileOutline "open" "Open" "Opens a file." "code,source,file" }
|
||||
{Reload 0 Entity File 0 0 0 0 0 1 FileOutline "reload" "Reload" "Reloads a loaded file." "code,source,file,reload" }
|
||||
{ReloadActive 0 Null Nil 0 0 0 0 0 0 FileOutline "reload_active" "Reload Active File" "Reloads the active file." "code,source,file,reload" }
|
||||
{Switch 0 Entity File 0 0 0 0 0 1 FileOutline "switch" "Switch" "Switches to a loaded file." "code,source,file" }
|
||||
{SwitchToPartnerFile 0 Null Nil 0 0 0 0 0 0 FileOutline "switch_to_partner_file" "Switch To Partner File" "Switches to the focused file's partner; or from header to implementation or vice versa." "code,source,file" }
|
||||
|
||||
//- rjf: source <-> disasm
|
||||
{GoToDisassembly 0 Null Nil 0 0 0 0 0 0 Glasses "go_to_disassembly" "Go To Disassembly" "Goes to the disassembly, if any, for a given source code line." "code,source,disassembly,disasm" }
|
||||
{GoToSource 0 Null Nil 0 0 0 0 0 0 FileOutline "go_to_source" "Go To Source" "Goes to the source code, if any, for a given disassembly line." "code,source,disassembly,disasm" }
|
||||
|
||||
//- rjf: override file links
|
||||
{SetFileOverrideLinkSrc 1 Null Nil 0 0 0 0 0 0 Null "set_file_override_link_src" "Set File Override Link Source" "Sets the source path for an override file link." "" }
|
||||
{SetFileOverrideLinkDst 1 Null Nil 0 0 0 0 0 0 Null "set_file_override_link_dst" "Set File Override Link Destination" "Sets the destination path for an override file link." "" }
|
||||
@@ -384,7 +379,7 @@ DF_CoreCmdTable:// | | |
|
||||
{FilePathMap 0 Null Nil 0 0 0 0 0 0 FileOutline "file_path_map" "File Path Map" "Opens the file path mapping editor." "" }
|
||||
{AutoViewRules 0 Null Nil 0 0 0 0 0 0 Binoculars "auto_view_rules" "Auto View Rules" "Opens the auto view rule editor." "" }
|
||||
{Scheduler 0 Null Nil 0 0 0 0 0 0 Scheduler "scheduler" "Scheduler" "Opens the scheduler view, for process and thread controls." "threads,processes,targets" }
|
||||
{CallStack 0 Null Nil 0 0 0 0 0 0 Thread "call_stack" "Call Stack" "Opens the call stack view." "callstack,thread" }
|
||||
{CallStack 0 Null Nil 0 0 0 0 0 0 Thread "call_stack" "Call Stack" "Opens the call stack view." "callstack,thread,unwind" }
|
||||
{Modules 0 Null Nil 0 0 0 0 0 0 Module "modules" "Modules" "Opens the modules view." "" }
|
||||
{PendingEntity 1 Null Nil 0 0 0 0 0 0 FileOutline "pending_entity" "Pending Entity" "Opens a view which waits for the passed entity to be completely loaded, then replaces itself with a new view." "" }
|
||||
{Code 1 Null Nil 0 0 0 0 0 0 FileOutline "code" "Code" "Opens the code view for an already-loaded file." "" }
|
||||
@@ -401,7 +396,7 @@ DF_CoreCmdTable:// | | |
|
||||
{Breakpoints 0 Null Nil 0 0 0 0 0 0 CircleFilled "breakpoints" "Breakpoints" "Opens the breakpoints view." "" }
|
||||
{WatchPins 0 Null Nil 0 0 0 0 0 0 Pin "watch_pins" "Watch Pins" "Opens the watch pins view." "" }
|
||||
{ExceptionFilters 0 Null Nil 0 0 0 0 0 0 Gear "exception_filters" "Exception Filters" "Opens the exception filters view." "exceptions,filters" }
|
||||
{Theme 0 Null Nil 0 0 0 0 0 0 Palette "theme" "Theme" "Opens the theme view." "theme,color,scheme,palette" }
|
||||
{Settings 0 Null Nil 0 0 0 0 0 0 Gear "settings" "Settings" "Opens the settings view." "theme,color,scheme,options" }
|
||||
{PickFile 1 FilePath Nil 1 0 0 0 0 1 FileOutline "pick_file" "Pick File" "Opens the file browser to pick a file." "" }
|
||||
{PickFolder 1 FilePath Nil 0 1 0 0 0 1 FolderOpenFilled "pick_folder" "Pick Folder" "Opens the file browser to pick a folder." "" }
|
||||
{PickFileOrFolder 1 FilePath Nil 1 1 0 0 0 1 FileOutline "pick_file_or_folder" "Pick File/Folder" "Opens the file browser to pick a file or folder." "" }
|
||||
|
||||
@@ -32,7 +32,7 @@ Rng1U64 df_g_cmd_param_slot_range_table[24] =
|
||||
{OffsetOf(DF_CmdParams, inline_unwind_index), OffsetOf(DF_CmdParams, inline_unwind_index) + sizeof(U64)},
|
||||
};
|
||||
|
||||
DF_IconKind df_g_entity_kind_icon_kind_table[26] =
|
||||
DF_IconKind df_g_entity_kind_icon_kind_table[25] =
|
||||
{
|
||||
DF_IconKind_Null,
|
||||
DF_IconKind_Null,
|
||||
@@ -40,7 +40,6 @@ DF_IconKind_Machine,
|
||||
DF_IconKind_FileOutline,
|
||||
DF_IconKind_FileOutline,
|
||||
DF_IconKind_Binoculars,
|
||||
DF_IconKind_Null,
|
||||
DF_IconKind_Pin,
|
||||
DF_IconKind_CircleFilled,
|
||||
DF_IconKind_CircleFilled,
|
||||
@@ -62,7 +61,7 @@ DF_IconKind_Null,
|
||||
DF_IconKind_Null,
|
||||
};
|
||||
|
||||
String8 df_g_entity_kind_display_string_table[26] =
|
||||
String8 df_g_entity_kind_display_string_table[25] =
|
||||
{
|
||||
str8_lit_comp("Nil"),
|
||||
str8_lit_comp("Root"),
|
||||
@@ -70,7 +69,6 @@ str8_lit_comp("Machine"),
|
||||
str8_lit_comp("File"),
|
||||
str8_lit_comp("Override File Link"),
|
||||
str8_lit_comp("Auto View Rule"),
|
||||
str8_lit_comp("Flash Marker"),
|
||||
str8_lit_comp("Watch Pin"),
|
||||
str8_lit_comp("Breakpoint"),
|
||||
str8_lit_comp("Condition"),
|
||||
@@ -92,7 +90,7 @@ str8_lit_comp("Conversion Failure"),
|
||||
str8_lit_comp("EndedProcess"),
|
||||
};
|
||||
|
||||
String8 df_g_entity_kind_name_label_table[26] =
|
||||
String8 df_g_entity_kind_name_label_table[25] =
|
||||
{
|
||||
str8_lit_comp("Label"),
|
||||
str8_lit_comp("Label"),
|
||||
@@ -100,7 +98,6 @@ str8_lit_comp("Label"),
|
||||
str8_lit_comp("Label"),
|
||||
str8_lit_comp("Label"),
|
||||
str8_lit_comp("Label"),
|
||||
str8_lit_comp("Label"),
|
||||
str8_lit_comp("Expression"),
|
||||
str8_lit_comp("Label"),
|
||||
str8_lit_comp("Expression"),
|
||||
@@ -122,7 +119,7 @@ str8_lit_comp("Label"),
|
||||
str8_lit_comp("Label"),
|
||||
};
|
||||
|
||||
DF_EntityKindFlags df_g_entity_kind_flags_table[26] =
|
||||
DF_EntityKindFlags df_g_entity_kind_flags_table[25] =
|
||||
{
|
||||
(0*DF_EntityKindFlag_LeafMutationUserConfig | 0*DF_EntityKindFlag_LeafMutationProjectConfig | 0*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 0*DF_EntityKindFlag_TreeMutationProjectConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 0*DF_EntityKindFlag_NameIsCode | 0*DF_EntityKindFlag_UserDefinedLifetime),
|
||||
(0*DF_EntityKindFlag_LeafMutationUserConfig | 0*DF_EntityKindFlag_LeafMutationProjectConfig | 0*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 0*DF_EntityKindFlag_TreeMutationProjectConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 0*DF_EntityKindFlag_NameIsCode | 0*DF_EntityKindFlag_UserDefinedLifetime),
|
||||
@@ -130,7 +127,6 @@ DF_EntityKindFlags df_g_entity_kind_flags_table[26] =
|
||||
(0*DF_EntityKindFlag_LeafMutationUserConfig | 0*DF_EntityKindFlag_LeafMutationProjectConfig | 0*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 0*DF_EntityKindFlag_TreeMutationProjectConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 0*DF_EntityKindFlag_NameIsCode | 0*DF_EntityKindFlag_UserDefinedLifetime),
|
||||
(1*DF_EntityKindFlag_LeafMutationUserConfig | 0*DF_EntityKindFlag_LeafMutationProjectConfig | 0*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 0*DF_EntityKindFlag_TreeMutationProjectConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 0*DF_EntityKindFlag_NameIsCode | 0*DF_EntityKindFlag_UserDefinedLifetime),
|
||||
(0*DF_EntityKindFlag_LeafMutationUserConfig | 0*DF_EntityKindFlag_LeafMutationProjectConfig | 0*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 0*DF_EntityKindFlag_TreeMutationProjectConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 0*DF_EntityKindFlag_NameIsCode | 1*DF_EntityKindFlag_UserDefinedLifetime),
|
||||
(0*DF_EntityKindFlag_LeafMutationUserConfig | 0*DF_EntityKindFlag_LeafMutationProjectConfig | 0*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 0*DF_EntityKindFlag_TreeMutationProjectConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 0*DF_EntityKindFlag_NameIsCode | 0*DF_EntityKindFlag_UserDefinedLifetime),
|
||||
(0*DF_EntityKindFlag_LeafMutationUserConfig | 0*DF_EntityKindFlag_LeafMutationProjectConfig | 0*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 0*DF_EntityKindFlag_TreeMutationProjectConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 1*DF_EntityKindFlag_NameIsCode | 1*DF_EntityKindFlag_UserDefinedLifetime),
|
||||
(0*DF_EntityKindFlag_LeafMutationUserConfig | 1*DF_EntityKindFlag_LeafMutationProjectConfig | 1*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 0*DF_EntityKindFlag_TreeMutationProjectConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 0*DF_EntityKindFlag_NameIsCode | 1*DF_EntityKindFlag_UserDefinedLifetime),
|
||||
(0*DF_EntityKindFlag_LeafMutationUserConfig | 1*DF_EntityKindFlag_LeafMutationProjectConfig | 1*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 1*DF_EntityKindFlag_TreeMutationProjectConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 1*DF_EntityKindFlag_NameIsCode | 1*DF_EntityKindFlag_UserDefinedLifetime),
|
||||
@@ -152,7 +148,7 @@ DF_EntityKindFlags df_g_entity_kind_flags_table[26] =
|
||||
(0*DF_EntityKindFlag_LeafMutationUserConfig | 0*DF_EntityKindFlag_LeafMutationProjectConfig | 0*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 0*DF_EntityKindFlag_TreeMutationProjectConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 0*DF_EntityKindFlag_NameIsCode | 0*DF_EntityKindFlag_UserDefinedLifetime),
|
||||
};
|
||||
|
||||
DF_EntityOpFlags df_g_entity_kind_op_flags_table[26] =
|
||||
DF_EntityOpFlags df_g_entity_kind_op_flags_table[25] =
|
||||
{
|
||||
(0*DF_EntityOpFlag_Delete) | (0*DF_EntityOpFlag_Freeze) | (0*DF_EntityOpFlag_Edit) | (0*DF_EntityOpFlag_Rename) | (0*DF_EntityOpFlag_Enable) | (0*DF_EntityOpFlag_Condition) | (0*DF_EntityOpFlag_Duplicate),
|
||||
(0*DF_EntityOpFlag_Delete) | (0*DF_EntityOpFlag_Freeze) | (0*DF_EntityOpFlag_Edit) | (0*DF_EntityOpFlag_Rename) | (0*DF_EntityOpFlag_Enable) | (0*DF_EntityOpFlag_Condition) | (0*DF_EntityOpFlag_Duplicate),
|
||||
@@ -160,7 +156,6 @@ DF_EntityOpFlags df_g_entity_kind_op_flags_table[26] =
|
||||
(0*DF_EntityOpFlag_Delete) | (0*DF_EntityOpFlag_Freeze) | (0*DF_EntityOpFlag_Edit) | (0*DF_EntityOpFlag_Rename) | (0*DF_EntityOpFlag_Enable) | (0*DF_EntityOpFlag_Condition) | (0*DF_EntityOpFlag_Duplicate),
|
||||
(0*DF_EntityOpFlag_Delete) | (0*DF_EntityOpFlag_Freeze) | (0*DF_EntityOpFlag_Edit) | (0*DF_EntityOpFlag_Rename) | (0*DF_EntityOpFlag_Enable) | (0*DF_EntityOpFlag_Condition) | (0*DF_EntityOpFlag_Duplicate),
|
||||
(0*DF_EntityOpFlag_Delete) | (0*DF_EntityOpFlag_Freeze) | (0*DF_EntityOpFlag_Edit) | (0*DF_EntityOpFlag_Rename) | (0*DF_EntityOpFlag_Enable) | (0*DF_EntityOpFlag_Condition) | (0*DF_EntityOpFlag_Duplicate),
|
||||
(0*DF_EntityOpFlag_Delete) | (0*DF_EntityOpFlag_Freeze) | (0*DF_EntityOpFlag_Edit) | (0*DF_EntityOpFlag_Rename) | (0*DF_EntityOpFlag_Enable) | (0*DF_EntityOpFlag_Condition) | (0*DF_EntityOpFlag_Duplicate),
|
||||
(1*DF_EntityOpFlag_Delete) | (0*DF_EntityOpFlag_Freeze) | (0*DF_EntityOpFlag_Edit) | (1*DF_EntityOpFlag_Rename) | (0*DF_EntityOpFlag_Enable) | (0*DF_EntityOpFlag_Condition) | (1*DF_EntityOpFlag_Duplicate),
|
||||
(1*DF_EntityOpFlag_Delete) | (0*DF_EntityOpFlag_Freeze) | (0*DF_EntityOpFlag_Edit) | (1*DF_EntityOpFlag_Rename) | (1*DF_EntityOpFlag_Enable) | (1*DF_EntityOpFlag_Condition) | (1*DF_EntityOpFlag_Duplicate),
|
||||
(0*DF_EntityOpFlag_Delete) | (0*DF_EntityOpFlag_Freeze) | (0*DF_EntityOpFlag_Edit) | (0*DF_EntityOpFlag_Rename) | (0*DF_EntityOpFlag_Enable) | (0*DF_EntityOpFlag_Condition) | (0*DF_EntityOpFlag_Duplicate),
|
||||
@@ -214,7 +209,7 @@ DF_CoreCmdKind_Null,
|
||||
DF_CoreCmdKind_Null,
|
||||
};
|
||||
|
||||
DF_CmdSpecInfo df_g_core_cmd_kind_spec_info_table[222] =
|
||||
DF_CmdSpecInfo df_g_core_cmd_kind_spec_info_table[220] =
|
||||
{
|
||||
{ str8_lit_comp(""), str8_lit_comp(""), str8_lit_comp(""), str8_lit_comp(""), (DF_CmdSpecFlag_OmitFromLists*1), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Null},
|
||||
{ str8_lit_comp("exit"), str8_lit_comp("Exits the debugger."), str8_lit_comp("quit,close,abort"), str8_lit_comp("Exit"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_X},
|
||||
@@ -243,15 +238,13 @@ DF_CmdSpecInfo df_g_core_cmd_kind_spec_info_table[222] =
|
||||
{ str8_lit_comp("step_over"), str8_lit_comp("Steps once, always over function calls, for either line or instructions."), str8_lit_comp(""), str8_lit_comp("Step Over"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_StepOver},
|
||||
{ str8_lit_comp("run_to_cursor"), str8_lit_comp("Runs the selected thread to the current cursor."), str8_lit_comp(""), str8_lit_comp("Run To Cursor"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Play},
|
||||
{ str8_lit_comp("set_next_statement"), str8_lit_comp("Sets the selected thread's instruction pointer to the cursor's position."), str8_lit_comp(""), str8_lit_comp("Set Next Statement"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_RightArrow},
|
||||
{ str8_lit_comp("enable_solo_stepping_mode"), str8_lit_comp("Enables 'solo stepping mode', which suspends all non-selected threads before stepping."), str8_lit_comp("solo,stepping,mode,suspend"), str8_lit_comp("Enable Solo Stepping Mode"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Thread},
|
||||
{ str8_lit_comp("disable_solo_stepping_mode"), str8_lit_comp("Disables 'solo stepping mode', which suspends all non-selected threads before stepping."), str8_lit_comp("solo,stepping,mode,suspend"), str8_lit_comp("Disable Solo Stepping Mode"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Thread},
|
||||
{ str8_lit_comp("select_thread"), str8_lit_comp("Selects a thread."), str8_lit_comp(""), str8_lit_comp("Select Thread"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Entity, DF_EntityKind_Thread, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*1)}, DF_IconKind_Null},
|
||||
{ str8_lit_comp("select_thread_window"), str8_lit_comp("Selects a thread for the active window, overriding the global selected thread."), str8_lit_comp(""), str8_lit_comp("Select Thread On Window"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Entity, DF_EntityKind_Thread, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*1)}, DF_IconKind_Null},
|
||||
{ str8_lit_comp("select_thread_view"), str8_lit_comp("Selects a thread for the active view, overriding the global and per-window selected threads."), str8_lit_comp(""), str8_lit_comp("Select Thread On View"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Entity, DF_EntityKind_Thread, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*1)}, DF_IconKind_Null},
|
||||
{ str8_lit_comp("select_unwind"), str8_lit_comp("Selects an unwind frame number for the selected thread."), str8_lit_comp(""), str8_lit_comp("Select Unwind"), (DF_CmdSpecFlag_OmitFromLists*1), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Null},
|
||||
{ str8_lit_comp("up_one_frame"), str8_lit_comp("Selects the callstack frame above the currently selected."), str8_lit_comp(""), str8_lit_comp("Up One Frame"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_UpArrow},
|
||||
{ str8_lit_comp("down_one_frame"), str8_lit_comp("Selects the callstack frame below the currently selected."), str8_lit_comp(""), str8_lit_comp("Down One Frame"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_DownArrow},
|
||||
{ str8_lit_comp("freeze_thread"), str8_lit_comp("Freezes the passed thread."), str8_lit_comp(""), str8_lit_comp("Freeze Thread"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Entity, DF_EntityKind_Thread, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*1)}, DF_IconKind_Locked},
|
||||
{ str8_lit_comp("up_one_frame"), str8_lit_comp("Selects the call stack frame above the currently selected."), str8_lit_comp(""), str8_lit_comp("Up One Frame"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_UpArrow},
|
||||
{ str8_lit_comp("down_one_frame"), str8_lit_comp("Selects the call stack frame below the currently selected."), str8_lit_comp("callstack,unwind"), str8_lit_comp("Down One Frame"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_DownArrow},
|
||||
{ str8_lit_comp("freeze_thread"), str8_lit_comp("Freezes the passed thread."), str8_lit_comp("callstack,unwind"), str8_lit_comp("Freeze Thread"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Entity, DF_EntityKind_Thread, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*1)}, DF_IconKind_Locked},
|
||||
{ str8_lit_comp("thaw_thread"), str8_lit_comp("Thaws the passed thread."), str8_lit_comp(""), str8_lit_comp("Thaw Thread"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Entity, DF_EntityKind_Thread, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*1)}, DF_IconKind_Unlocked},
|
||||
{ str8_lit_comp("freeze_process"), str8_lit_comp("Freezes the passed process."), str8_lit_comp(""), str8_lit_comp("Freeze Process"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Entity, DF_EntityKind_Process, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*1)}, DF_IconKind_Locked},
|
||||
{ str8_lit_comp("thaw_process"), str8_lit_comp("Thaws the passed process."), str8_lit_comp(""), str8_lit_comp("Thaw Process"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Entity, DF_EntityKind_Process, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*1)}, DF_IconKind_Unlocked},
|
||||
@@ -299,10 +292,10 @@ DF_CmdSpecInfo df_g_core_cmd_kind_spec_info_table[222] =
|
||||
{ str8_lit_comp("tab_bar_bottom"), str8_lit_comp("Anchors a panel's tab bar to the bottom of the panel."), str8_lit_comp(""), str8_lit_comp("Anchor Tab Bar To Bottom"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_DownArrow},
|
||||
{ str8_lit_comp("set_current_path"), str8_lit_comp("Sets the debugger's current path, which is used as a starting point when browsing for files."), str8_lit_comp(""), str8_lit_comp("Set Current Path"), (DF_CmdSpecFlag_OmitFromLists*1), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_FileOutline},
|
||||
{ str8_lit_comp("open"), str8_lit_comp("Opens a file."), str8_lit_comp("code,source,file"), str8_lit_comp("Open"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_FilePath, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*1)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*1)}, DF_IconKind_FileOutline},
|
||||
{ str8_lit_comp("reload"), str8_lit_comp("Reloads a loaded file."), str8_lit_comp("code,source,file,reload"), str8_lit_comp("Reload"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Entity, DF_EntityKind_File, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*1)}, DF_IconKind_FileOutline},
|
||||
{ str8_lit_comp("reload_active"), str8_lit_comp("Reloads the active file."), str8_lit_comp("code,source,file,reload"), str8_lit_comp("Reload Active File"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_FileOutline},
|
||||
{ str8_lit_comp("switch"), str8_lit_comp("Switches to a loaded file."), str8_lit_comp("code,source,file"), str8_lit_comp("Switch"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Entity, DF_EntityKind_File, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*1)}, DF_IconKind_FileOutline},
|
||||
{ str8_lit_comp("switch_to_partner_file"), str8_lit_comp("Switches to the focused file's partner; or from header to implementation or vice versa."), str8_lit_comp("code,source,file"), str8_lit_comp("Switch To Partner File"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_FileOutline},
|
||||
{ str8_lit_comp("go_to_disassembly"), str8_lit_comp("Goes to the disassembly, if any, for a given source code line."), str8_lit_comp("code,source,disassembly,disasm"), str8_lit_comp("Go To Disassembly"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Glasses},
|
||||
{ str8_lit_comp("go_to_source"), str8_lit_comp("Goes to the source code, if any, for a given disassembly line."), str8_lit_comp("code,source,disassembly,disasm"), str8_lit_comp("Go To Source"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_FileOutline},
|
||||
{ str8_lit_comp("set_file_override_link_src"), str8_lit_comp("Sets the source path for an override file link."), str8_lit_comp(""), str8_lit_comp("Set File Override Link Source"), (DF_CmdSpecFlag_OmitFromLists*1), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Null},
|
||||
{ str8_lit_comp("set_file_override_link_dst"), str8_lit_comp("Sets the destination path for an override file link."), str8_lit_comp(""), str8_lit_comp("Set File Override Link Destination"), (DF_CmdSpecFlag_OmitFromLists*1), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Null},
|
||||
{ str8_lit_comp("set_file_replacement_path"), str8_lit_comp("Sets the path which should be used as the replacement for the passed file."), str8_lit_comp(""), str8_lit_comp("Set File Replacement Path"), (DF_CmdSpecFlag_OmitFromLists*1), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Null},
|
||||
@@ -413,7 +406,7 @@ DF_CmdSpecInfo df_g_core_cmd_kind_spec_info_table[222] =
|
||||
{ str8_lit_comp("file_path_map"), str8_lit_comp("Opens the file path mapping editor."), str8_lit_comp(""), str8_lit_comp("File Path Map"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_FileOutline},
|
||||
{ str8_lit_comp("auto_view_rules"), str8_lit_comp("Opens the auto view rule editor."), str8_lit_comp(""), str8_lit_comp("Auto View Rules"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Binoculars},
|
||||
{ str8_lit_comp("scheduler"), str8_lit_comp("Opens the scheduler view, for process and thread controls."), str8_lit_comp("threads,processes,targets"), str8_lit_comp("Scheduler"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Scheduler},
|
||||
{ str8_lit_comp("call_stack"), str8_lit_comp("Opens the call stack view."), str8_lit_comp("callstack,thread"), str8_lit_comp("Call Stack"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Thread},
|
||||
{ str8_lit_comp("call_stack"), str8_lit_comp("Opens the call stack view."), str8_lit_comp("callstack,thread,unwind"), str8_lit_comp("Call Stack"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Thread},
|
||||
{ str8_lit_comp("modules"), str8_lit_comp("Opens the modules view."), str8_lit_comp(""), str8_lit_comp("Modules"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Module},
|
||||
{ str8_lit_comp("pending_entity"), str8_lit_comp("Opens a view which waits for the passed entity to be completely loaded, then replaces itself with a new view."), str8_lit_comp(""), str8_lit_comp("Pending Entity"), (DF_CmdSpecFlag_OmitFromLists*1), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_FileOutline},
|
||||
{ str8_lit_comp("code"), str8_lit_comp("Opens the code view for an already-loaded file."), str8_lit_comp(""), str8_lit_comp("Code"), (DF_CmdSpecFlag_OmitFromLists*1), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_FileOutline},
|
||||
@@ -430,7 +423,7 @@ DF_CmdSpecInfo df_g_core_cmd_kind_spec_info_table[222] =
|
||||
{ str8_lit_comp("breakpoints"), str8_lit_comp("Opens the breakpoints view."), str8_lit_comp(""), str8_lit_comp("Breakpoints"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_CircleFilled},
|
||||
{ str8_lit_comp("watch_pins"), str8_lit_comp("Opens the watch pins view."), str8_lit_comp(""), str8_lit_comp("Watch Pins"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Pin},
|
||||
{ str8_lit_comp("exception_filters"), str8_lit_comp("Opens the exception filters view."), str8_lit_comp("exceptions,filters"), str8_lit_comp("Exception Filters"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Gear},
|
||||
{ str8_lit_comp("theme"), str8_lit_comp("Opens the theme view."), str8_lit_comp("theme,color,scheme,palette"), str8_lit_comp("Theme"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Palette},
|
||||
{ str8_lit_comp("settings"), str8_lit_comp("Opens the settings view."), str8_lit_comp("theme,color,scheme,options"), str8_lit_comp("Settings"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Gear},
|
||||
{ str8_lit_comp("pick_file"), str8_lit_comp("Opens the file browser to pick a file."), str8_lit_comp(""), str8_lit_comp("Pick File"), (DF_CmdSpecFlag_OmitFromLists*1), {DF_CmdParamSlot_FilePath, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*1)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*1)}, DF_IconKind_FileOutline},
|
||||
{ str8_lit_comp("pick_folder"), str8_lit_comp("Opens the file browser to pick a folder."), str8_lit_comp(""), str8_lit_comp("Pick Folder"), (DF_CmdSpecFlag_OmitFromLists*1), {DF_CmdParamSlot_FilePath, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*1)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*1)}, DF_IconKind_FolderOpenFilled},
|
||||
{ str8_lit_comp("pick_file_or_folder"), str8_lit_comp("Opens the file browser to pick a file or folder."), str8_lit_comp(""), str8_lit_comp("Pick File/Folder"), (DF_CmdSpecFlag_OmitFromLists*1), {DF_CmdParamSlot_FilePath, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*1)|(DF_CmdQueryFlag_AllowFolders*1)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*1)}, DF_IconKind_FileOutline},
|
||||
|
||||
@@ -23,7 +23,6 @@ DF_EntityKind_Machine,
|
||||
DF_EntityKind_File,
|
||||
DF_EntityKind_OverrideFileLink,
|
||||
DF_EntityKind_AutoViewRule,
|
||||
DF_EntityKind_FlashMarker,
|
||||
DF_EntityKind_WatchPin,
|
||||
DF_EntityKind_Breakpoint,
|
||||
DF_EntityKind_Condition,
|
||||
@@ -75,8 +74,6 @@ DF_CoreCmdKind_StepInto,
|
||||
DF_CoreCmdKind_StepOver,
|
||||
DF_CoreCmdKind_RunToCursor,
|
||||
DF_CoreCmdKind_SetNextStatement,
|
||||
DF_CoreCmdKind_EnableSoloSteppingMode,
|
||||
DF_CoreCmdKind_DisableSoloSteppingMode,
|
||||
DF_CoreCmdKind_SelectThread,
|
||||
DF_CoreCmdKind_SelectThreadWindow,
|
||||
DF_CoreCmdKind_SelectThreadView,
|
||||
@@ -131,10 +128,10 @@ DF_CoreCmdKind_TabBarTop,
|
||||
DF_CoreCmdKind_TabBarBottom,
|
||||
DF_CoreCmdKind_SetCurrentPath,
|
||||
DF_CoreCmdKind_Open,
|
||||
DF_CoreCmdKind_Reload,
|
||||
DF_CoreCmdKind_ReloadActive,
|
||||
DF_CoreCmdKind_Switch,
|
||||
DF_CoreCmdKind_SwitchToPartnerFile,
|
||||
DF_CoreCmdKind_GoToDisassembly,
|
||||
DF_CoreCmdKind_GoToSource,
|
||||
DF_CoreCmdKind_SetFileOverrideLinkSrc,
|
||||
DF_CoreCmdKind_SetFileOverrideLinkDst,
|
||||
DF_CoreCmdKind_SetFileReplacementPath,
|
||||
@@ -262,7 +259,7 @@ DF_CoreCmdKind_Disassembly,
|
||||
DF_CoreCmdKind_Breakpoints,
|
||||
DF_CoreCmdKind_WatchPins,
|
||||
DF_CoreCmdKind_ExceptionFilters,
|
||||
DF_CoreCmdKind_Theme,
|
||||
DF_CoreCmdKind_Settings,
|
||||
DF_CoreCmdKind_PickFile,
|
||||
DF_CoreCmdKind_PickFolder,
|
||||
DF_CoreCmdKind_PickFileOrFolder,
|
||||
@@ -1540,11 +1537,11 @@ struct {B32 *value_ptr; String8 name;} DEV_toggle_table[] =
|
||||
};
|
||||
C_LINKAGE_BEGIN
|
||||
extern Rng1U64 df_g_cmd_param_slot_range_table[24];
|
||||
extern DF_IconKind df_g_entity_kind_icon_kind_table[26];
|
||||
extern String8 df_g_entity_kind_display_string_table[26];
|
||||
extern String8 df_g_entity_kind_name_label_table[26];
|
||||
extern DF_EntityKindFlags df_g_entity_kind_flags_table[26];
|
||||
extern DF_EntityOpFlags df_g_entity_kind_op_flags_table[26];
|
||||
extern DF_IconKind df_g_entity_kind_icon_kind_table[25];
|
||||
extern String8 df_g_entity_kind_display_string_table[25];
|
||||
extern String8 df_g_entity_kind_name_label_table[25];
|
||||
extern DF_EntityKindFlags df_g_entity_kind_flags_table[25];
|
||||
extern DF_EntityOpFlags df_g_entity_kind_op_flags_table[25];
|
||||
extern String8 df_g_cfg_src_string_table[4];
|
||||
extern DF_CoreCmdKind df_g_cfg_src_load_cmd_kind_table[4];
|
||||
extern DF_CoreCmdKind df_g_cfg_src_write_cmd_kind_table[4];
|
||||
|
||||
+1541
-1441
File diff suppressed because it is too large
Load Diff
+70
-14
@@ -66,6 +66,16 @@ struct DF_KeyMapSlot
|
||||
DF_KeyMapNode *last;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Setting Types
|
||||
|
||||
typedef struct DF_SettingVal DF_SettingVal;
|
||||
struct DF_SettingVal
|
||||
{
|
||||
B32 set;
|
||||
S32 s32;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: View Functions
|
||||
|
||||
@@ -187,11 +197,10 @@ struct DF_View
|
||||
U64 loading_progress_v;
|
||||
U64 loading_progress_v_target;
|
||||
|
||||
// rjf: update flash animation state
|
||||
F32 flash_t;
|
||||
|
||||
// rjf: view state
|
||||
UI_ScrollPt2 scroll_pos;
|
||||
TxtPt cursor;
|
||||
TxtPt mark;
|
||||
|
||||
// rjf: ctrl context overrides
|
||||
DF_CtrlCtx ctrl_ctx_overrides;
|
||||
@@ -377,6 +386,24 @@ typedef enum DF_FontSlot
|
||||
}
|
||||
DF_FontSlot;
|
||||
|
||||
typedef enum DF_PaletteCode
|
||||
{
|
||||
DF_PaletteCode_Base,
|
||||
DF_PaletteCode_MenuBar,
|
||||
DF_PaletteCode_Floating,
|
||||
DF_PaletteCode_ImplicitButton,
|
||||
DF_PaletteCode_PlainButton,
|
||||
DF_PaletteCode_PositivePopButton,
|
||||
DF_PaletteCode_NegativePopButton,
|
||||
DF_PaletteCode_NeutralPopButton,
|
||||
DF_PaletteCode_ScrollBarButton,
|
||||
DF_PaletteCode_Tab,
|
||||
DF_PaletteCode_TabInactive,
|
||||
DF_PaletteCode_DropSiteOverlay,
|
||||
DF_PaletteCode_COUNT
|
||||
}
|
||||
DF_PaletteCode;
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: UI Helper & Widget Types
|
||||
|
||||
@@ -419,8 +446,8 @@ struct DF_CodeSliceParams
|
||||
DF_EntityList *line_bps;
|
||||
DF_EntityList *line_ips;
|
||||
DF_EntityList *line_pins;
|
||||
DF_TextLineDasm2SrcInfoList *line_dasm2src;
|
||||
DF_TextLineSrc2DasmInfoList *line_src2dasm;
|
||||
U64 *line_vaddrs;
|
||||
DF_LineList *line_infos;
|
||||
DI_KeyList relevant_dbgi_keys;
|
||||
|
||||
// rjf: visual parameters
|
||||
@@ -433,7 +460,6 @@ struct DF_CodeSliceParams
|
||||
F32 catchall_margin_width_px;
|
||||
F32 line_num_width_px;
|
||||
F32 line_text_max_width_px;
|
||||
DF_EntityList flash_ranges;
|
||||
F32 margin_float_off_px;
|
||||
};
|
||||
|
||||
@@ -536,21 +562,34 @@ struct DF_Window
|
||||
// rjf: view state delta history
|
||||
DF_StateDeltaHistory *view_state_hist;
|
||||
|
||||
// rjf: context menu info
|
||||
// rjf: dev interface state
|
||||
B32 dev_menu_is_open;
|
||||
|
||||
// rjf: menu bar state
|
||||
B32 menu_bar_focused;
|
||||
B32 menu_bar_focused_on_press;
|
||||
B32 menu_bar_key_held;
|
||||
B32 menu_bar_focus_press_started;
|
||||
UI_Key drop_completion_ctx_menu_key;
|
||||
DF_Handle drop_completion_entity;
|
||||
DF_Handle drop_completion_panel;
|
||||
|
||||
// rjf: code context menu state
|
||||
Arena *code_ctx_menu_arena;
|
||||
UI_Key code_ctx_menu_key;
|
||||
DF_Handle code_ctx_menu_file;
|
||||
U128 code_ctx_menu_text_key;
|
||||
TXT_LangKind code_ctx_menu_lang_kind;
|
||||
TxtRng code_ctx_menu_range;
|
||||
U64 code_ctx_menu_vaddr;
|
||||
DF_LineList code_ctx_menu_lines;
|
||||
|
||||
// rjf: entity context menu state
|
||||
UI_Key entity_ctx_menu_key;
|
||||
DF_Handle entity_ctx_menu_entity;
|
||||
U8 entity_ctx_menu_input_buffer[1024];
|
||||
U64 entity_ctx_menu_input_size;
|
||||
TxtPt entity_ctx_menu_input_cursor;
|
||||
TxtPt entity_ctx_menu_input_mark;
|
||||
|
||||
// rjf: tab context menu state
|
||||
UI_Key tab_ctx_menu_key;
|
||||
DF_Handle tab_ctx_menu_view;
|
||||
|
||||
@@ -587,6 +626,7 @@ struct DF_Window
|
||||
Vec2F32 hover_eval_spawn_pos;
|
||||
String8 hover_eval_string;
|
||||
|
||||
|
||||
// rjf: hover eval timer
|
||||
U64 hover_eval_first_frame_idx;
|
||||
U64 hover_eval_last_frame_idx;
|
||||
@@ -745,7 +785,11 @@ struct DF_GfxState
|
||||
Arena *cfg_code_font_path_arena;
|
||||
String8 cfg_main_font_path;
|
||||
String8 cfg_code_font_path;
|
||||
F_Tag cfg_font_tags[DF_FontSlot_COUNT];
|
||||
F_Tag cfg_font_tags[DF_FontSlot_COUNT]; // derivative from font paths
|
||||
UI_Palette cfg_palettes[DF_PaletteCode_COUNT]; // derivative from theme
|
||||
|
||||
// rjf: settings
|
||||
DF_SettingVal cfg_setting_vals[DF_CfgSrc_COUNT][DF_SettingCode_COUNT];
|
||||
|
||||
// rjf: icon texture
|
||||
R_Handle icon_texture;
|
||||
@@ -784,7 +828,8 @@ read_only global DF_View df_g_nil_view =
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
{0},
|
||||
{0},
|
||||
{0},
|
||||
{0},
|
||||
0,
|
||||
@@ -992,11 +1037,18 @@ internal DF_CmdSpecList df_cmd_spec_list_from_event_flags(Arena *arena, OS_Event
|
||||
internal Vec4F32 df_rgba_from_theme_color(DF_ThemeColor color);
|
||||
internal DF_ThemeColor df_theme_color_from_txt_token_kind(TXT_TokenKind kind);
|
||||
|
||||
//- rjf: code -> palette
|
||||
internal UI_Palette *df_palette_from_code(DF_PaletteCode code);
|
||||
|
||||
//- rjf: fonts/sizes
|
||||
internal F_Tag df_font_from_slot(DF_FontSlot slot);
|
||||
internal F32 df_font_size_from_slot(DF_Window *ws, DF_FontSlot slot);
|
||||
|
||||
//- rjf: settings
|
||||
internal DF_SettingVal df_setting_val_from_code(DF_SettingCode code);
|
||||
|
||||
//- rjf: config serialization
|
||||
internal int df_qsort_compare__cfg_string_bindings(DF_StringBindingPair *a, DF_StringBindingPair *b);
|
||||
internal String8List df_cfg_strings_from_gfx(Arena *arena, String8 root_path, DF_CfgSrc source);
|
||||
|
||||
////////////////////////////////
|
||||
@@ -1005,6 +1057,11 @@ internal String8List df_cfg_strings_from_gfx(Arena *arena, String8 root_path, DF
|
||||
internal String8 df_string_from_exception_code(U32 code);
|
||||
internal String8 df_stop_explanation_string_icon_from_ctrl_event(Arena *arena, CTRL_Event *event, DF_IconKind *icon_out);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: UI Building Helpers
|
||||
|
||||
#define DF_Palette(code) UI_Palette(df_palette_from_code(code))
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: UI Widgets: Fancy Buttons
|
||||
|
||||
@@ -1015,7 +1072,7 @@ internal void df_cmd_list_menu_buttons(DF_Window *ws, U64 count, DF_CoreCmdKind
|
||||
internal UI_Signal df_icon_button(DF_IconKind kind, FuzzyMatchRangeList *matches, String8 string);
|
||||
internal UI_Signal df_icon_buttonf(DF_IconKind kind, FuzzyMatchRangeList *matches, char *fmt, ...);
|
||||
internal void df_entity_tooltips(DF_Entity *entity);
|
||||
internal void df_entity_desc_button(DF_Window *ws, DF_Entity *entity, FuzzyMatchRangeList *name_matches, String8 fuzzy_query);
|
||||
internal UI_Signal df_entity_desc_button(DF_Window *ws, DF_Entity *entity, FuzzyMatchRangeList *name_matches, String8 fuzzy_query, B32 is_implicit);
|
||||
internal void df_entity_src_loc_button(DF_Window *ws, DF_Entity *entity, TxtPt point);
|
||||
|
||||
////////////////////////////////
|
||||
@@ -1027,7 +1084,6 @@ internal DF_CodeSliceSignal df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, E
|
||||
internal DF_CodeSliceSignal df_code_slicef(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_CodeSliceParams *params, TxtPt *cursor, TxtPt *mark, S64 *preferred_column, char *fmt, ...);
|
||||
|
||||
internal B32 df_do_txt_controls(TXT_TextInfo *info, String8 data, U64 line_count_per_page, TxtPt *cursor, TxtPt *mark, S64 *preferred_column);
|
||||
internal B32 df_do_txti_controls(TXTI_Handle handle, U64 line_count_per_page, TxtPt *cursor, TxtPt *mark, S64 *preferred_column);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: UI Widgets: Fancy Labels
|
||||
|
||||
+280
-291
@@ -176,6 +176,11 @@ DF_DefaultBindingTable:
|
||||
{ "log_marker" M ctrl shift alt }
|
||||
}
|
||||
|
||||
@data(DF_StringBindingPair) df_g_default_binding_table:
|
||||
{
|
||||
@expand(DF_DefaultBindingTable a) ```{str8_lit_comp("$(a.name)"), {OS_Key_$(a.key), 0 $(a.ctrl != 0 -> `|OS_EventFlag_Ctrl`) $(a.shift != 0 -> `|OS_EventFlag_Shift`) $(a.alt != 0 -> `|OS_EventFlag_Alt`)}}```;
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Binding Version Remap Table
|
||||
|
||||
@@ -189,6 +194,16 @@ DF_BindingVersionRemapTable:
|
||||
{"open_profile" "open_project"}
|
||||
}
|
||||
|
||||
@data(String8) df_g_binding_version_remap_old_name_table:
|
||||
{
|
||||
@expand(DF_BindingVersionRemapTable a) `str8_lit_comp("$(a.old_name)")`
|
||||
}
|
||||
|
||||
@data(String8) df_g_binding_version_remap_new_name_table:
|
||||
{
|
||||
@expand(DF_BindingVersionRemapTable a) `str8_lit_comp("$(a.new_name)")`
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Gfx Layer View Kinds
|
||||
|
||||
@@ -221,11 +236,30 @@ DF_GfxViewTable:
|
||||
{ Types "types" "Types" Null Binoculars 0 0 1 0 1 1 1 1 "Nearly identical to `Watch`, but automatically filled with all types within the selected thread's module. View rules can be edited, like in `Watch`, but unlike `Watch`, expressions cannot be edited or added to the table." }
|
||||
{ Procedures "procedures" "Procedures" Null Binoculars 0 0 1 0 1 1 1 1 "Nearly identical to `Watch`, but automatically filled with all procedures within the selected thread's module. View rules can be edited, like in `Watch`, but unlike `Watch`, expressions cannot be edited or added to the table." }
|
||||
{ Output "output" "Output" Null List 0 0 1 0 0 0 0 1 "Displays textual output from the selected thread's containing process." }
|
||||
{ Memory "memory" "Memory" Null Grid 0 0 1 1 0 0 0 1 "A familiar hex-editor-like interface for viewing memory of attached processes." }
|
||||
{ Memory "memory" "Memory" Null Grid 0 0 1 0 0 0 0 1 "A familiar hex-editor-like interface for viewing memory of attached processes." }
|
||||
{ Breakpoints "breakpoints" "Breakpoints" Null CircleFilled 0 0 1 0 1 0 1 1 "Displays a table of all breakpoints, containing information about each breakpoint's name, location, and hit count. Also contains per-breakpoint controls for enabling, deleting, or editing each breakpoint. For more information on breakpoints and their features, read the 'Breakpoints' section." }
|
||||
{ WatchPins "watch_pins" "Watch Pins" Null Pin 0 0 1 0 1 1 1 1 "Displays a table of all watch pins (watched expressions, like those found in `Watch`, but instead of being within a table, being pinned to some source code location, like breakpoints). This table contains each pin's name, location, and controls for editing or deleting each pin." }
|
||||
{ ExceptionFilters "exception_filters" "Exception Filters" Null Gear 0 0 1 0 1 0 1 1 "An interface which controls whether or not the debugger will halt attached processes upon encountering specific exception codes for the first time." }
|
||||
{ Theme "theme" "Theme" Null Palette 0 0 1 0 0 0 0 1 "An interface for modifying the colors used in the debugger's UI. Allows selecting a theme preset, loading a theme from a file, and modifying individual colors within a theme." }
|
||||
{ Settings "settings" "Settings" Null Gear 0 0 1 0 1 0 1 1 "An interface to modify general settings for the debugger's appearance and behavior." }
|
||||
}
|
||||
|
||||
@enum DF_GfxViewKind:
|
||||
{
|
||||
@expand(DF_GfxViewTable a) `$(a.name)`,
|
||||
COUNT,
|
||||
}
|
||||
|
||||
@gen
|
||||
{
|
||||
@expand(DF_GfxViewTable a) `DF_VIEW_SETUP_FUNCTION_DEF($(a.name));`;
|
||||
@expand(DF_GfxViewTable a) `DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF($(a.name));`;
|
||||
@expand(DF_GfxViewTable a) `DF_VIEW_CMD_FUNCTION_DEF($(a.name));`;
|
||||
@expand(DF_GfxViewTable a) `DF_VIEW_UI_FUNCTION_DEF($(a.name));`;
|
||||
}
|
||||
|
||||
@data(DF_ViewSpecInfo) df_g_gfx_view_kind_spec_info_table:
|
||||
{
|
||||
@expand(DF_GfxViewTable a) ```{(0|$(a.parameterized_by_entity)*DF_ViewSpecFlag_ParameterizedByEntity|$(a.project_specific)*DF_ViewSpecFlag_ProjectSpecific|$(a.can_serialize)*DF_ViewSpecFlag_CanSerialize|$(a.can_serialize_entity_path)*DF_ViewSpecFlag_CanSerializeEntityPath|$(a.can_filter)*DF_ViewSpecFlag_CanFilter|$(a.filter_is_code)*DF_ViewSpecFlag_FilterIsCode|$(a.typing_automatically_filters)*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("$(a.name_lower)"), str8_lit_comp("$(a.display_string)"), DF_NameKind_$(a.name_kind), DF_IconKind_$(a.icon), DF_VIEW_SETUP_FUNCTION_NAME($(a.name)), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME($(a.name)), DF_VIEW_CMD_FUNCTION_NAME($(a.name)), DF_VIEW_UI_FUNCTION_NAME($(a.name))}```;
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
@@ -243,6 +277,21 @@ DF_CmdParamSlot2ViewSpecMap:
|
||||
{String "symbol_lister" "function_breakpoint" }
|
||||
}
|
||||
|
||||
@data(DF_CmdParamSlot) df_g_cmd_param_slot_2_view_spec_src_map:
|
||||
{
|
||||
@expand(DF_CmdParamSlot2ViewSpecMap a) `DF_CmdParamSlot_$(a.slot)`
|
||||
}
|
||||
|
||||
@data(String8) df_g_cmd_param_slot_2_view_spec_dst_map:
|
||||
{
|
||||
@expand(DF_CmdParamSlot2ViewSpecMap a) `str8_lit_comp("$(a.view_spec)")`
|
||||
}
|
||||
|
||||
@data(String8) df_g_cmd_param_slot_2_view_spec_cmd_map:
|
||||
{
|
||||
@expand(DF_CmdParamSlot2ViewSpecMap a) `str8_lit_comp("$(a.opt_cmd_spec)")`
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Built-In Graphical View Rule Extensions
|
||||
//
|
||||
@@ -269,286 +318,6 @@ DF_GfxViewRuleTable:
|
||||
{"geo" - - x x x "Geometry" }
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Theme Tables
|
||||
|
||||
@table(name display_name name_lower)
|
||||
DF_ThemeColorTable:
|
||||
{
|
||||
{Null "Null" null }
|
||||
{PlainText "Plain Text" plain_text }
|
||||
{PlainBackground "Plain Background" plain_background }
|
||||
{PlainBorder "Plain Border" plain_border }
|
||||
{PlainOverlay "Plain Overlay" plain_overlay }
|
||||
{CodeDefault "Code (Default)" code_default }
|
||||
{CodeFunction "Code (Function)" code_function }
|
||||
{CodeType "Code (Type)" code_type }
|
||||
{CodeLocal "Code (Local)" code_local }
|
||||
{CodeRegister "Code (Register)" code_register }
|
||||
{CodeKeyword "Code (Keyword)" code_keyword }
|
||||
{CodeSymbol "Code (Symbol)" code_symbol }
|
||||
{CodeNumeric "Code (Numeric)" code_numeric }
|
||||
{CodeString "Code (String)" code_string }
|
||||
{CodeMeta "Code (Meta)" code_meta }
|
||||
{CodeComment "Code (Comment)" code_comment }
|
||||
{LineInfo0 "Line Info (0)" line_info_0 }
|
||||
{LineInfo1 "Line Info (1)" line_info_1 }
|
||||
{LineInfo2 "Line Info (2)" line_info_2 }
|
||||
{LineInfo3 "Line Info (3)" line_info_3 }
|
||||
{AltText "Alt Text" alt_text }
|
||||
{AltBackground "Alt Background" alt_background }
|
||||
{AltBorder "Alt Border" alt_border }
|
||||
{AltOverlay "Alt Overlay" alt_overlay }
|
||||
{TabInactive "Inactive Tab" tab_inactive }
|
||||
{TabActive "Active Tab" tab_active }
|
||||
{EntityBackground "Entity Background" entity_background }
|
||||
{QueryBar "Query Bar" query_bar }
|
||||
{WeakText "Weak Text" weak_text }
|
||||
{TextSelection "Text Selection" text_selection }
|
||||
{Cursor "Cursor" cursor }
|
||||
{Highlight0 "Highlight (0)" highlight_0 }
|
||||
{Highlight1 "Highlight (1)" highlight_1 }
|
||||
{SuccessText "Success Text" success_text }
|
||||
{SuccessBackground "Success Background" success_background }
|
||||
{SuccessBorder "Success Border" success_border }
|
||||
{FailureText "Failure Text" failure_text }
|
||||
{FailureBackground "Failure Background" failure_background }
|
||||
{FailureBorder "Failure Border" failure_border }
|
||||
{ActionText "Action Text" action_text }
|
||||
{ActionBackground "Action Background" action_background }
|
||||
{ActionBorder "Action Border" action_border }
|
||||
{DropSiteOverlay "Drop Site Overlay" drop_site_overlay }
|
||||
{Thread0 "Thread (0)" thread_0 }
|
||||
{Thread1 "Thread (1)" thread_1 }
|
||||
{Thread2 "Thread (2)" thread_2 }
|
||||
{Thread3 "Thread (3)" thread_3 }
|
||||
{Thread4 "Thread (4)" thread_4 }
|
||||
{Thread5 "Thread (5)" thread_5 }
|
||||
{Thread6 "Thread (6)" thread_6 }
|
||||
{Thread7 "Thread (7)" thread_7 }
|
||||
{ThreadUnwound "Thread (Unwound)" thread_unwound }
|
||||
{InactivePanelOverlay "Inactive Panel Overlay" inactive_panel_overlay }
|
||||
{DropShadow "Drop Shadow" drop_shadow }
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Theme Color Version Remap Table
|
||||
|
||||
@table(old_name new_name)
|
||||
DF_ThemeColorVersionRemapTable:
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Theme Presets
|
||||
|
||||
@table(name_upper name_lower display_string)
|
||||
DF_ThemePresetTable:
|
||||
{
|
||||
{ DefaultDark default_dark "Default (Dark)" }
|
||||
{ DefaultLight default_light "Default (Light)" }
|
||||
{ VSDark vs_dark "VS (Dark)" }
|
||||
{ VSLight vs_light "VS (Light)" }
|
||||
{ SolarizedDark solarized_dark "Solarized (Dark)" }
|
||||
{ SolarizedLight solarized_light "Solarized (Light)" }
|
||||
{ HandmadeHero handmade_hero "Handmade Hero" }
|
||||
{ FourCoder four_coder "4coder" }
|
||||
{ FarManager far_manager "Far Manager" }
|
||||
}
|
||||
|
||||
@table(name default_dark default_light vs_dark vs_light solarized_dark solarized_light handmade_hero four_coder far_manager)
|
||||
DF_ThemePresetColorTable:
|
||||
{
|
||||
(null 0xff00ffff 0xff00ffff 0xff00ffff 0xff00ffff 0xff00ffff 0xff00ffff 0xff00ffff 0xff00ffff 0xff00ffff )
|
||||
(plain_text 0xe5e5e5ff 0x383838ff 0xe5e5e5ff 0x1e1e1eff 0xe5e5e5ff 0x1e1e1eff 0xa08563ff 0x90b080ff 0x00ffffff )
|
||||
(plain_background 0x3333337f 0xedededfe 0x1e1e1eff 0xffffffff 0x002b36ff 0xfcf6e2ff 0x0c0c0cff 0x0c0c0cff 0x000082ff )
|
||||
(plain_border 0xffffff19 0x0000001d 0xffffff19 0xcccedb1d 0xffffff19 0xcccedb1d 0xffffff19 0x181818a0 0xffffff19 )
|
||||
(plain_overlay 0xffffff33 0x00000033 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 )
|
||||
(code_default 0xe5e5e5ff 0x282828ff 0xd4d4d4ff 0x000000ff 0x839496ff 0x74878cff 0xa08563ff 0x90b080ff 0x00ffffff )
|
||||
(code_function 0x7fcc99ff 0x2a7a45ff 0xdcdcaaff 0x74531fff 0x1c7dd1ff 0xc39d36ff 0xcc5735ff 0x7fcc99ff 0x49b2ffff )
|
||||
(code_type 0x66b2e5ff 0x2c688fff 0x4ec9b0ff 0x2b91afff 0x1c7dd1ff 0x66b2e5ff 0xd8a51dff 0x66b2e5ff 0x49b2ffff )
|
||||
(code_local 0xfe9548ff 0xfe9548ff 0xfe9548ff 0xfe9548ff 0xfe9548ff 0xfe9548ff 0xfe9548ff 0xfe9548ff 0xfe9548ff )
|
||||
(code_register 0xd45d90ff 0xd45d90ff 0xd45d90ff 0xd45d90ff 0xd45d90ff 0xd45d90ff 0xd45d90ff 0xd45d90ff 0xd45d90ff )
|
||||
(code_keyword 0xf7bf5eff 0xa47729ff 0x569cd6ff 0x0000ffff 0x63980fff 0xc39d36ff 0xac7b0bff 0xd08f20ff 0xff0000ff )
|
||||
(code_symbol 0x994c32ff 0x6c2d18ff 0xb4b4b4ff 0x000000ff 0x839496ff 0x2e5256ff 0x994c32ff 0x994c32ff 0xffffffff )
|
||||
(code_numeric 0x4ce54cff 0x2c7d2cff 0xb5cea8ff 0x000000ff 0xcb4b20ff 0x657b83ff 0x6b8e23ff 0x50ff30ff 0x2cff50ff )
|
||||
(code_string 0xe5cc66ff 0xcc5a0fff 0xd69d85ff 0xc11515ff 0x2aa198ff 0x5ab4a9ff 0x6b8e23ff 0x50ff30ff 0xe5cc66ff )
|
||||
(code_meta 0xe54c4cff 0x8a0c0cff 0x9b9b9bff 0x808080ff 0xe54c4cff 0xe54c4cff 0xdab98fff 0x50ff30ff 0xffff00ff )
|
||||
(code_comment 0x7f7f7fff 0x7f7f7fff 0x6a9955ff 0x008000ff 0x7f7f7fff 0xadafb2ff 0x686868ff 0x2090f0ff 0x7f7f7fff )
|
||||
(line_info_0 0x99503d3f 0x99503d3f 0x99503d3f 0x99503d3f 0x99503d3f 0x99503d3f 0x99503d3f 0x99503d3f 0x99503d3f )
|
||||
(line_info_1 0xfe82493f 0xfe82493f 0xfe82493f 0xfe82493f 0xfe82493f 0xfe82493f 0xfe82493f 0xfe82493f 0xfe82493f )
|
||||
(line_info_2 0xffba173f 0xffba173f 0xffba173f 0xffba173f 0xffba173f 0xffba173f 0xffba173f 0xffba173f 0xffba173f )
|
||||
(line_info_3 0xcefd693f 0xcefd693f 0xcefd693f 0xcefd693f 0xcefd693f 0xcefd693f 0xcefd693f 0xcefd693f 0xcefd693f )
|
||||
(alt_text 0xe5e5e5ff 0x535353ff 0xf1f1f1ff 0x535353ff 0xe5e5e5ff 0x535353ff 0xa08563ff 0x90b080ff 0x000000ff )
|
||||
(alt_background 0x42474c7f 0xfefefebc 0x1b1b1cff 0xfefefebc 0x002b36ff 0xfcf6e2ff 0x0c0c0cff 0x0c0c0cff 0x008184ff )
|
||||
(alt_border 0xffffff19 0xffffff19 0x333337ff 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 )
|
||||
(alt_overlay 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 )
|
||||
(tab_inactive 0x42474c7f 0x42474c7f 0x42474c7f 0x42474c7f 0x42474c7f 0x42474c7f 0x42474c7f 0x42474c7f 0x42474c7f )
|
||||
(tab_active 0xa87a4c99 0xc7a27dff 0x007accff 0x007accff 0x28515eff 0xa87a4c99 0xa87a4c99 0xa87a4c99 0xa87a4c99 )
|
||||
(entity_background 0x4293cc99 0x4293cc99 0x4293cc99 0x4293cc99 0x4293cc99 0x4293cc99 0x4293cc99 0x4293cc99 0x4293cc99 )
|
||||
(query_bar 0x8e2d4ccc 0xd76489cc 0x8e2d4ccc 0x8e2d4ccc 0x8e2d4ccc 0x8e2d4ccc 0x8e2d4ccc 0x8e2d4ccc 0x8e2d4ccc )
|
||||
(weak_text 0xffffff7f 0x0000007f 0xffffff7f 0x0000007f 0xffffff7f 0x0000007f 0xa08563af 0x90b080af 0xffffff7f )
|
||||
(text_selection 0x99ccff4c 0x7d98b34c 0x99ccff4c 0x7d98b34c 0x99ccff4c 0x7d98b34c 0x99ccff4c 0x99ccff4c 0x99ccff4c )
|
||||
(cursor 0x66e566e5 0x101010ff 0x66e566e5 0x101010ff 0x66e566e5 0x101010ff 0x66e566e5 0x66e566e5 0x66e566e5 )
|
||||
(highlight_0 0xb27219ff 0xb272189b 0xb27219ff 0xb27219ff 0xb27219ff 0xb27219ff 0xb27219ff 0xb27219ff 0xb27219ff )
|
||||
(highlight_1 0x327f19ff 0x327f19ff 0x327f19ff 0x327f19ff 0x327f19ff 0x327f19ff 0x327f19ff 0x327f19ff 0x327f19ff )
|
||||
(success_text 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff )
|
||||
(success_background 0x32b219ff 0x75db61ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff )
|
||||
(success_border 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 )
|
||||
(failure_text 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff )
|
||||
(failure_background 0xb23219ff 0xf27961ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff )
|
||||
(failure_border 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 )
|
||||
(action_text 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff )
|
||||
(action_background 0x327fb2ff 0x327fb2ff 0x327fb2ff 0x327fb2ff 0x327fb2ff 0x327fb2ff 0x327fb2ff 0x327fb2ff 0x327fb2ff )
|
||||
(action_border 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 )
|
||||
(drop_site_overlay 0xffffff0c 0xffffff0c 0xffffff0c 0xffffff0c 0xffffff0c 0xffffff0c 0xffffff0c 0xffffff0c 0xffffff0c )
|
||||
(thread_0 0xffcb7fff 0xad7c34ff 0xffcb7fff 0xad7c34ff 0xffcb7fff 0xad7c34ff 0xffcb7fff 0xffcb7fff 0xffcb7fff )
|
||||
(thread_1 0xb2ff65ff 0x639b2aff 0xb2ff65ff 0x639b2aff 0xb2ff65ff 0x639b2aff 0xb2ff65ff 0xb2ff65ff 0xb2ff65ff )
|
||||
(thread_2 0xff99e5ff 0xa94c91ff 0xff99e5ff 0xa94c91ff 0xff99e5ff 0xa94c91ff 0xff99e5ff 0xff99e5ff 0xff99e5ff )
|
||||
(thread_3 0x6598ffff 0x305398ff 0x6598ffff 0x305398ff 0x6598ffff 0x305398ff 0x6598ffff 0x6598ffff 0x6598ffff )
|
||||
(thread_4 0x65ffcbff 0x339574ff 0x65ffcbff 0x339574ff 0x65ffcbff 0x339574ff 0x65ffcbff 0x65ffcbff 0x65ffcbff )
|
||||
(thread_5 0xff9819ff 0xbf7416ff 0xff9819ff 0xbf7416ff 0xff9819ff 0xbf7416ff 0xff9819ff 0xff9819ff 0xff9819ff )
|
||||
(thread_6 0x9932ffff 0x57238bff 0x9932ffff 0x57238bff 0x9932ffff 0x57238bff 0x9932ffff 0x9932ffff 0x9932ffff )
|
||||
(thread_7 0x65ff4cff 0x2a7e1cff 0x65ff4cff 0x2a7e1cff 0x65ff4cff 0x2a7e1cff 0x65ff4cff 0x65ff4cff 0x65ff4cff )
|
||||
(thread_unwound 0xb2ccd8ff 0x236481ff 0xb2ccd8ff 0x236481ff 0xb2ccd8ff 0x236481ff 0xb2ccd8ff 0xb2ccd8ff 0xb2ccd8ff )
|
||||
(inactive_panel_overlay 0x0000003f 0x0000000d 0x0000003f 0x0000000d 0x0000003f 0x0000000d 0x0000003f 0x0000003f 0x0000003f )
|
||||
(drop_shadow 0x0000007f 0x0000003b 0x0000007f 0x0000003b 0x0000007f 0x0000003b 0x0000007f 0x0000007f 0x0000007f )
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Generators
|
||||
|
||||
//- rjf: enums
|
||||
|
||||
@enum DF_GfxViewKind:
|
||||
{
|
||||
@expand(DF_GfxViewTable a) `$(a.name)`,
|
||||
COUNT,
|
||||
}
|
||||
|
||||
@enum DF_ThemeColor:
|
||||
{
|
||||
@expand(DF_ThemeColorTable a) `$(a.name)`,
|
||||
COUNT,
|
||||
}
|
||||
|
||||
@enum DF_ThemePreset:
|
||||
{
|
||||
@expand(DF_ThemePresetTable a) `$(a.name)`,
|
||||
COUNT,
|
||||
}
|
||||
|
||||
//- rjf: theme preset color tables
|
||||
|
||||
@data(String8) df_g_theme_preset_display_string_table:
|
||||
{
|
||||
@expand(DF_ThemePresetTable a) `str8_lit_comp("$(a.display_string)")`,
|
||||
}
|
||||
|
||||
@data(String8) df_g_theme_preset_code_string_table:
|
||||
{
|
||||
@expand(DF_ThemePresetTable a) `str8_lit_comp("$(a.name_lower)")`,
|
||||
}
|
||||
|
||||
@data(Vec4F32) df_g_theme_preset_colors__default_dark:
|
||||
{
|
||||
@expand(DF_ThemePresetColorTable a) `rgba_from_u32_lit_comp($(a.default_dark))`,
|
||||
}
|
||||
|
||||
@data(Vec4F32) df_g_theme_preset_colors__default_light:
|
||||
{
|
||||
@expand(DF_ThemePresetColorTable a) `rgba_from_u32_lit_comp($(a.default_light))`,
|
||||
}
|
||||
|
||||
@data(Vec4F32) df_g_theme_preset_colors__vs_dark:
|
||||
{
|
||||
@expand(DF_ThemePresetColorTable a) `rgba_from_u32_lit_comp($(a.vs_dark))`,
|
||||
}
|
||||
|
||||
@data(Vec4F32) df_g_theme_preset_colors__vs_light:
|
||||
{
|
||||
@expand(DF_ThemePresetColorTable a) `rgba_from_u32_lit_comp($(a.vs_light))`,
|
||||
}
|
||||
|
||||
@data(Vec4F32) df_g_theme_preset_colors__solarized_dark:
|
||||
{
|
||||
@expand(DF_ThemePresetColorTable a) `rgba_from_u32_lit_comp($(a.solarized_dark))`,
|
||||
}
|
||||
|
||||
@data(Vec4F32) df_g_theme_preset_colors__solarized_light:
|
||||
{
|
||||
@expand(DF_ThemePresetColorTable a) `rgba_from_u32_lit_comp($(a.solarized_light))`,
|
||||
}
|
||||
|
||||
@data(Vec4F32) df_g_theme_preset_colors__handmade_hero:
|
||||
{
|
||||
@expand(DF_ThemePresetColorTable a) `rgba_from_u32_lit_comp($(a.handmade_hero))`,
|
||||
}
|
||||
|
||||
@data(Vec4F32) df_g_theme_preset_colors__four_coder:
|
||||
{
|
||||
@expand(DF_ThemePresetColorTable a) `rgba_from_u32_lit_comp($(a.four_coder))`,
|
||||
}
|
||||
|
||||
@data(Vec4F32) df_g_theme_preset_colors__far_manager:
|
||||
{
|
||||
@expand(DF_ThemePresetColorTable a) `rgba_from_u32_lit_comp($(a.far_manager))`;
|
||||
}
|
||||
|
||||
@data(`Vec4F32*`) df_g_theme_preset_colors_table:
|
||||
{
|
||||
@expand(DF_ThemePresetTable a) `df_g_theme_preset_colors__$(a.name_lower)`,
|
||||
}
|
||||
|
||||
//- rjf: cmd param slot -> view spec tables
|
||||
|
||||
@data(DF_CmdParamSlot) df_g_cmd_param_slot_2_view_spec_src_map:
|
||||
{
|
||||
@expand(DF_CmdParamSlot2ViewSpecMap a) `DF_CmdParamSlot_$(a.slot)`
|
||||
}
|
||||
|
||||
@data(String8) df_g_cmd_param_slot_2_view_spec_dst_map:
|
||||
{
|
||||
@expand(DF_CmdParamSlot2ViewSpecMap a) `str8_lit_comp("$(a.view_spec)")`
|
||||
}
|
||||
|
||||
@data(String8) df_g_cmd_param_slot_2_view_spec_cmd_map:
|
||||
{
|
||||
@expand(DF_CmdParamSlot2ViewSpecMap a) `str8_lit_comp("$(a.opt_cmd_spec)")`
|
||||
}
|
||||
|
||||
//- rjf: default bindings table
|
||||
|
||||
@data(DF_StringBindingPair) df_g_default_binding_table:
|
||||
{
|
||||
@expand(DF_DefaultBindingTable a) ```{str8_lit_comp("$(a.name)"), {OS_Key_$(a.key), 0 $(a.ctrl != 0 -> `|OS_EventFlag_Ctrl`) $(a.shift != 0 -> `|OS_EventFlag_Shift`) $(a.alt != 0 -> `|OS_EventFlag_Alt`)}}```;
|
||||
}
|
||||
|
||||
//- rjf: binding version remap tables
|
||||
|
||||
@data(String8) df_g_binding_version_remap_old_name_table:
|
||||
{
|
||||
@expand(DF_BindingVersionRemapTable a) `str8_lit_comp("$(a.old_name)")`
|
||||
}
|
||||
|
||||
@data(String8) df_g_binding_version_remap_new_name_table:
|
||||
{
|
||||
@expand(DF_BindingVersionRemapTable a) `str8_lit_comp("$(a.new_name)")`
|
||||
}
|
||||
|
||||
//- rjf: view hook forward declares
|
||||
|
||||
@gen
|
||||
{
|
||||
@expand(DF_GfxViewTable a) `DF_VIEW_SETUP_FUNCTION_DEF($(a.name));`;
|
||||
@expand(DF_GfxViewTable a) `DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF($(a.name));`;
|
||||
@expand(DF_GfxViewTable a) `DF_VIEW_CMD_FUNCTION_DEF($(a.name));`;
|
||||
@expand(DF_GfxViewTable a) `DF_VIEW_UI_FUNCTION_DEF($(a.name));`;
|
||||
}
|
||||
|
||||
//- rjf: gfx view rule function forward declares
|
||||
|
||||
@gen
|
||||
{
|
||||
``;
|
||||
@@ -570,7 +339,11 @@ DF_ThemePresetColorTable:
|
||||
`$(a.tu == "x" -> "DF_VIEW_UI_FUNCTION_DEF(" .. a.name_lower .. ");")`;
|
||||
}
|
||||
|
||||
//- rjf: gfx view rule tables
|
||||
@data(DF_ViewSpecInfo) @c_file df_g_gfx_view_rule_tab_view_spec_info_table:
|
||||
{
|
||||
@expand(DF_GfxViewRuleTable a)
|
||||
```$(a.tu == "x" -> '{ DF_ViewSpecFlag_CanSerialize|DF_ViewSpecFlag_CanSerializeQuery, str8_lit_comp("' .. a.string .. '_view_rule"), str8_lit_comp("' .. a.tab_display_string .. '"), DF_NameKind_Null, DF_IconKind_Binoculars, ' .. 'DF_VIEW_SETUP_FUNCTION_NAME(' .. a.string .. '), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(' .. a.string .. '), DF_VIEW_CMD_FUNCTION_NAME(' .. a.string .. '), DF_VIEW_UI_FUNCTION_NAME(' .. a.string .. ') }')```;
|
||||
}
|
||||
|
||||
@data(DF_GfxViewRuleSpecInfo) @c_file df_g_gfx_view_rule_spec_info_table:
|
||||
{
|
||||
@@ -578,20 +351,189 @@ DF_ThemePresetColorTable:
|
||||
```{ str8_lit_comp("$(a.string)"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*$(a.vr == "x"))|(DF_GfxViewRuleSpecInfoFlag_LineStringize*$(a.ls == "x"))|(DF_GfxViewRuleSpecInfoFlag_RowUI*$(a.ru == "x"))|(DF_GfxViewRuleSpecInfoFlag_BlockUI*$(a.bu == "x")), $(a.vr == "x" -> "DF_GFX_VIEW_RULE_VIZ_ROW_PROD_FUNCTION_NAME("..a.name_lower..")") $(a.vr != "x" -> 0), $(a.ls == "x" -> "DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_NAME("..a.name_lower..")") $(a.ls != "x" -> 0), $(a.ru == "x" -> "DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_NAME("..a.name_lower..")") $(a.ru != "x" -> 0), $(a.bu == "x" -> "DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_NAME("..a.name_lower..")") $(a.bu != "x" -> 0), str8_lit_comp("$(a.tu == 'x' -> a.string..'_view_rule')") }```;
|
||||
}
|
||||
|
||||
@data(DF_ViewSpecInfo) @c_file df_g_gfx_view_rule_tab_view_spec_info_table:
|
||||
////////////////////////////////
|
||||
//~ rjf: Theme Tables
|
||||
|
||||
@table(name_upper name_lower display_string)
|
||||
DF_ThemePresetTable:
|
||||
{
|
||||
@expand(DF_GfxViewRuleTable a)
|
||||
```$(a.tu == "x" -> '{ DF_ViewSpecFlag_CanSerialize|DF_ViewSpecFlag_CanSerializeQuery, str8_lit_comp("' .. a.string .. '_view_rule"), str8_lit_comp("' .. a.tab_display_string .. '"), DF_NameKind_Null, DF_IconKind_Binoculars, ' .. 'DF_VIEW_SETUP_FUNCTION_NAME(' .. a.string .. '), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(' .. a.string .. '), DF_VIEW_CMD_FUNCTION_NAME(' .. a.string .. '), DF_VIEW_UI_FUNCTION_NAME(' .. a.string .. ') }')```;
|
||||
{ DefaultDark default_dark "Default (Dark)" }
|
||||
{ DefaultLight default_light "Default (Light)" }
|
||||
{ VSDark vs_dark "VS (Dark)" }
|
||||
{ VSLight vs_light "VS (Light)" }
|
||||
{ SolarizedDark solarized_dark "Solarized (Dark)" }
|
||||
{ SolarizedLight solarized_light "Solarized (Light)" }
|
||||
{ HandmadeHero handmade_hero "Handmade Hero" }
|
||||
{ FourCoder four_coder "4coder" }
|
||||
{ FarManager far_manager "Far Manager" }
|
||||
}
|
||||
|
||||
//- rjf: default view spec info table
|
||||
|
||||
@data(DF_ViewSpecInfo) df_g_gfx_view_kind_spec_info_table:
|
||||
@table(name display_name name_lower default_dark default_light vs_dark vs_light solarized_dark solarized_light handmade_hero four_coder far_manager desc)
|
||||
DF_ThemeColorTable:
|
||||
{
|
||||
@expand(DF_GfxViewTable a) ```{(0|$(a.parameterized_by_entity)*DF_ViewSpecFlag_ParameterizedByEntity|$(a.project_specific)*DF_ViewSpecFlag_ProjectSpecific|$(a.can_serialize)*DF_ViewSpecFlag_CanSerialize|$(a.can_serialize_entity_path)*DF_ViewSpecFlag_CanSerializeEntityPath|$(a.can_filter)*DF_ViewSpecFlag_CanFilter|$(a.filter_is_code)*DF_ViewSpecFlag_FilterIsCode|$(a.typing_automatically_filters)*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("$(a.name_lower)"), str8_lit_comp("$(a.display_string)"), DF_NameKind_$(a.name_kind), DF_IconKind_$(a.icon), DF_VIEW_SETUP_FUNCTION_NAME($(a.name)), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME($(a.name)), DF_VIEW_CMD_FUNCTION_NAME($(a.name)), DF_VIEW_UI_FUNCTION_NAME($(a.name))}```;
|
||||
{Null "Null" null 0xff00ffff 0xff00ffff 0xff00ffff 0xff00ffff 0xff00ffff 0xff00ffff 0xff00ffff 0xff00ffff 0xff00ffff ""}
|
||||
|
||||
//- rjf: global ui colors
|
||||
{Text "Text" text 0xe5e5e5ff 0x4c4c4cff 0xe5e5e5ff 0x000000ff 0x999999ff 0x333333ff 0xa08462ff 0x90b080ff 0x00fefeff ""}
|
||||
{TextPositive "Text (Positive)" text_positive 0x4dc221ff 0x4d9e2eff 0x4dc221ff 0x4dc221ff 0x4dc221ff 0x4dc221ff 0x4dc221ff 0x4dc221ff 0x4dc221ff ""}
|
||||
{TextNegative "Text (Negative)" text_negative 0xc56452ff 0xbd371eff 0xc56452ff 0xc46451ff 0xc56452ff 0xc56452ff 0xc56452ff 0xc56452ff 0xc56452ff ""}
|
||||
{TextNeutral "Text (Neutral)" text_neutral 0x307eb2ff 0x0064a7ff 0x307eb2ff 0x307eb2ff 0x307eb2ff 0x307eb2ff 0x307eb2ff 0x307eb2ff 0x307eb2ff ""}
|
||||
{TextWeak "Text (Weak)" text_weak 0xa4a4a4fe 0x4c4c4cff 0xa4a4a4fe 0x0000007f 0x9999998a 0x818181ff 0x6e512eff 0x566e4bff 0x00a9a9ff ""}
|
||||
{Cursor "Cursor" cursor 0x8aff00ff 0x699830ff 0x8aff00ff 0x000000ff 0x8aff00ff 0x586e75ff 0x8aff00ff 0x8aff00ff 0x8aff00ff ""}
|
||||
{CursorInactive "Cursor (Inactive)" cursor_inactive 0xb23217ff 0xb23217ff 0xb23217ff 0xb23217ff 0xb23217ff 0xb23217ff 0xb23217ff 0xb23217ff 0xb23217ff ""}
|
||||
{Focus "Focus" focus 0xfda200ff 0x9c5900ff 0xfda200ff 0x002affff 0xfda200ff 0x92743dff 0xfda200ff 0xfda200ff 0x00fefeff ""}
|
||||
{Hover "Hover" hover 0xffffffff 0xffffffff 0xffffffff 0x000000ff 0xffffffff 0x747474ff 0xffffffff 0xffffffff 0xffffffff ""}
|
||||
{DropShadow "Drop Shadow" drop_shadow 0x0000007f 0x0000004c 0x0000007f 0xa3a3a37e 0x0000007f 0xc9bfa394 0x0000007f 0x0000007f 0x0000007f ""}
|
||||
{DisabledOverlay "Disabled Overlay" disabled_overlay 0x0000003f 0xa6a6a63f 0x0000003f 0x0000003f 0x0000003f 0xe4dac090 0x0000003f 0x0000003f 0x0000003f ""}
|
||||
{DropSiteOverlay "Drop Site Overlay" drop_site_overlay 0xffffff0c 0x4848480c 0xffffff0c 0x0000000c 0xffffff0c 0xffffff0c 0xffffff0c 0xffffff0c 0xffffff0c ""}
|
||||
{InactivePanelOverlay "Inactive Panel Overlay" inactive_panel_overlay 0x0000003f 0xa4a4a43f 0x0000003f 0xfefefe53 0x0000003f 0x0000001c 0x0000003f 0x0000003f 0x0000003f ""}
|
||||
{SelectionOverlay "Selection Overlay" selection_overlay 0x99ccff4c 0x003d7a48 0x99ccff4c 0x3d74ab4b 0x99ccff4c 0x678cb24c 0x99ccff4c 0x99ccff4c 0x99ccff4c ""}
|
||||
{HighlightOverlay "Highlight Overlay" highlight_overlay 0xffffff1e 0xffffff1e 0xffffff1e 0x0000001e 0xffffff1e 0xffffff1e 0xffffff1e 0xffffff1e 0xffffff1e ""}
|
||||
{HighlightOverlayError "Error Highlight Overlay" error_highlight_overlay 0x5f12005f 0xff30005f 0x5f12005f 0x5f12005f 0x5f12005f 0x5f12005f 0x5f12005f 0x5f12005f 0x5f12005f ""}
|
||||
|
||||
//- rjf: base ui container colors
|
||||
{BaseBackground "Base Background" base_background 0x1b1b1bfe 0xccccccfe 0x1b1b1bfe 0xfefefefe 0x002a35fe 0xfcf5e2fe 0x0c0c0cfe 0x0c0c0cfe 0x000081fe ""}
|
||||
{BaseBackgroundAlt "Base Background (Alternate)" base_background_alt 0x2b2b2bfe 0x2b2b2bfe 0x1b1b1bfe 0xe7e7e7fe 0x2b2b2bfe 0x2b2b2bfe 0x2b2b2bfe 0x2b2b2bfe 0x2b2b2bfe ""}
|
||||
{BaseBorder "Base Border" base_border 0x3f3f3ffe 0xa4a4a4fe 0x3f3f3ffe 0xb6b6b6ff 0xfefefe3a 0xbebaabfe 0x423525fe 0x3f3f3ffe 0x0000fffe ""}
|
||||
|
||||
//- rjf: menu bar ui container colors
|
||||
{MenuBarBackground "Menu Bar Background" menu_bar_background 0x3e4c577f 0xeaeaea7f 0x1b1b1bfd 0xffffff7f 0x00202bff 0xeee8d5ff 0x0c0c0cfe 0x0c0c0cfe 0x007d7dff ""}
|
||||
{MenuBarBackgroundAlt "Menu Bar Background (Alternate)" menu_bar_background_alt 0x3e4c577f 0x3e4c577f 0x1b1b1bfd 0xffffff7f 0x3e4c577f 0x3e4c577f 0x3e4c577f 0x3e4c577f 0x007d7dff ""}
|
||||
{MenuBarBorder "Menu Bar Border" menu_bar_border 0xffffff19 0xa4a4a4fe 0x3f3f3ffe 0xb6b6b6ff 0xffffff19 0xbebaabfe 0xffffff19 0xffffff19 0xfefefe00 ""}
|
||||
|
||||
//- rjf: floating ui container colors
|
||||
{FloatingBackground "Floating Background" floating_background 0x33333333 0xccccccc0 0x33333333 0xfefefec7 0x007fa14e 0xffffff7c 0x0c0c0c32 0x0c0c0c3e 0x007c7c55 ""}
|
||||
{FloatingBackgroundAlt "Floating Background (Alternate)" floating_background_alt 0x33333333 0x33333333 0x33333333 0x33333333 0x33333333 0x33333333 0x33333333 0x33333333 0x33333333 ""}
|
||||
{FloatingBorder "Floating Border" floating_border 0x3f3f3ffd 0xa4a4a4fe 0x3f3f3ffd 0xb6b6b6ff 0xfdfdfd3a 0xbebaabfe 0x423425fe 0x3f3f3ffd 0x00ffff55 ""}
|
||||
|
||||
//- rjf: ui element colors
|
||||
{ImplicitButtonBackground "Implicit Button Background" implicit_button_background 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 ""}
|
||||
{ImplicitButtonBorder "Implicit Button Border" implicit_button_border 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0xbdb9aa00 0x00000000 0x00000000 0x00000000 ""}
|
||||
{PlainButtonBackground "Plain Button Background" plain_button_background 0x1b1b1bfe 0x1b1b1bfe 0x1b1b1bfe 0x1b1b1bfe 0x1b1b1bfe 0x1b1b1bfe 0x1b1b1bfe 0x1b1b1bfe 0x1b1b1bfe ""}
|
||||
{PlainButtonBorder "Plain Button Border" plain_button_border 0x3f3f3ffe 0x3f3f3ffe 0x3f3f3ffe 0xb6b6b6ff 0xfefefe3a 0xbebaabfe 0x3f3f3ffe 0x3f3f3ffe 0x3f3f3ffe ""}
|
||||
{PositivePopButtonBackground "Positive Pop Button Background" positive_pop_button_background 0x2c5b36ff 0x65f534ff 0x2c5b36ff 0x84ce93ff 0x2c5b36ff 0xb6ddbeff 0x132e19ff 0x152f1bff 0x2c5b36ff ""}
|
||||
{PositivePopButtonBorder "Positive Pop Button Border" positive_pop_button_border 0x3f3f3ffd 0x3f3f3ffd 0x3f3f3ffd 0xb6b6b6ff 0xfefefe3a 0xbebaabfe 0x3f3f3ffd 0x3f3f3ffd 0x3f3f3ffd ""}
|
||||
{NegativePopButtonBackground "Negative Pop Button Background" negative_pop_button_background 0x803425ff 0xff694cff 0x803425ff 0xbd3e24ff 0x803425ff 0xf8b0a1ff 0x803425ff 0x43150cff 0x803425ff ""}
|
||||
{NegativePopButtonBorder "Negative Pop Button Border" negative_pop_button_border 0x3f3f3ffd 0x3f3f3ffd 0x3f3f3ffd 0xb6b6b6ff 0xfefefe3a 0xbebaabfe 0x3f3f3ffd 0x3f3f3ffd 0x3f3f3ffd ""}
|
||||
{NeutralPopButtonBackground "Neutral Pop Button Background" neutral_pop_button_background 0x355b6eff 0xa6becaff 0x355b6eff 0x6e9db5ff 0x355b6eff 0xb2d3e3ff 0x15445cff 0x1b323eff 0x933100ff ""}
|
||||
{NeutralPopButtonBorder "Neutral Pop Button Border" neutral_pop_button_border 0x3f3f3ffd 0xa6a6a6fd 0x3f3f3ffd 0xb6b6b6ff 0xfefefe3a 0xbebaabfe 0x3f3f3ffd 0x3f3f3ffd 0x3f3f3ffd ""}
|
||||
{ScrollBarButtonBackground "Scroll Bar Button Background" scroll_bar_button_background 0x2b2b2bfe 0xa9a9a9fe 0x2b2b2bfe 0xe8e8e8fe 0x005e77fe 0xe3dbc7fe 0x1f1f27fe 0x212721fe 0x007d7dff ""}
|
||||
{ScrollBarButtonBorder "Scroll Bar Button Border" scroll_bar_button_border 0x3f3f3ffe 0xc0c0c0fe 0x3f3f3ffe 0xb6b6b6ff 0xfefefe3a 0xbebaabfe 0xfefefe4d 0x3f3f3ffe 0x3f3f3ffe ""}
|
||||
{TabBackground "Tab Background" tab_background 0x6f5135fe 0xa98b6fff 0x0079ccff 0xfffffffe 0x005e77fe 0xfdf6e3ff 0x1f1f27fe 0x212721fe 0x007d7dff ""}
|
||||
{TabBorder "Tab Border" tab_border 0xfefefe4d 0xffffff4d 0xfefefe4d 0xb6b6b6ff 0xfefefe4d 0xbebaabfe 0xfefefe4d 0xfefefe4d 0xfefefe4d ""}
|
||||
{TabBackgroundInactive "Tab Background (Inactive)" tab_background_inactive 0x3e4c577f 0x8282827f 0xfefefe14 0xcdd4dc7f 0x3e4c577f 0xd4cfc0fe 0x131315ee 0x3a3a3a7f 0x3e4c577f ""}
|
||||
{TabBorderInactive "Tab Border (Inactive)" tab_border_inactive 0xffffff19 0xffffff19 0xffffff00 0xb6b6b6ff 0xffffff19 0xbebaabfe 0xffffff19 0x00000019 0xfefefe19 ""}
|
||||
|
||||
//- rjf: code colors
|
||||
{CodeDefault "Code (Default)" code_default 0xcbcbcbff 0x4d4d4dff 0xcbcbcbff 0x000000ff 0xcbcbcbff 0x657b83ff 0xa08462ff 0x90b080ff 0x00fefeff ""}
|
||||
{CodeSymbol "Code (Symbol)" code_symbol 0x42a2cffe 0x205670fe 0xdcdcaaff 0x000000ff 0xcb4a15ff 0xcb4a15ff 0xcc5634ff 0x42a2cffe 0x65b1ffff ""}
|
||||
{CodeType "Code (Type)" code_type 0xfec746ff 0x996b00ff 0x4ec9afff 0xa33700ff 0xcb4a15ff 0xcb4a15ff 0xd8a51bff 0xfd7c52ff 0xfec746ff ""}
|
||||
{CodeLocal "Code (Local)" code_local 0x98bc80ff 0x446a2bff 0x9cdbfeff 0x007666ff 0x98bc80ff 0x258ad2ff 0xc04047ff 0x98bc80ff 0x00ff00ff ""}
|
||||
{CodeRegister "Code (Register)" code_register 0xb7afd5ff 0x4c35a1ff 0xb7afd5ff 0xb7afd5ff 0xb7afd5ff 0x373345ff 0xb7afd5ff 0xb7afd5ff 0xb7afd5ff ""}
|
||||
{CodeKeyword "Code (Keyword)" code_keyword 0xb38d4cff 0x573700ff 0x569cd6ff 0x0000ffff 0x849803ff 0x586e75ff 0xac7a09ff 0xd08f1eff 0x00ffffff ""}
|
||||
{CodeDelimiterOperator "Code (Delimiters/Operators)" code_delimiter_operator 0x767676ff 0x767676ff 0x767676ff 0x767676ff 0x767676ff 0x767676ff 0xa08462ff 0x90b080ff 0xffffffff ""}
|
||||
{CodeNumeric "Code (Numeric)" code_numeric 0x98abb1ff 0x3f6e7dff 0xb5cea8ff 0x088658ff 0xd33582ff 0xd33482ef 0x698e21ff 0x4fff2eff 0x00ff00ff ""}
|
||||
{CodeNumericAltDigitGroup "Code (Numeric, Alt. Digit Group)" code_numeric_alt_digit_group 0x738287ff 0x1f4450ff 0x729360ff 0x0c3828ff 0x902559ff 0x8e2659ff 0x3a4e11ff 0x3ccd21ff 0x738287ff ""}
|
||||
{CodeString "Code (String)" code_string 0x98abb1ff 0x3c606bff 0xd59b85ff 0xa31414ff 0x1f9d91ff 0x29a198ff 0x6a8e22ff 0x4fff2eff 0x98abb1ff ""}
|
||||
{CodeMeta "Code (Meta)" code_meta 0xd96759ff 0xad3627ff 0xd59c85ff 0x0000ffff 0x839802ff 0xd96759ff 0xdab98fff 0xa0b8a0ff 0xff0000ff ""}
|
||||
{CodeComment "Code (Comment)" code_comment 0x717171ff 0x4b4b4bff 0x57a54aff 0x008000ff 0x556a6fff 0x93a1a1ff 0x686868ff 0x1e8fefff 0xffffffff ""}
|
||||
{CodeLineNumbers "Code Line Numbers" code_line_numbers 0x7f7f7fff 0x4b4b4bff 0x2a91afff 0x227893ff 0x566c73ff 0x227893ef 0xa08462ff 0x7e7e7ffe 0x007d7dff ""}
|
||||
{CodeLineNumbersSelected "Code Line Numbers (Selected)" code_line_numbers_selected 0xbebebeff 0x000000ff 0x9ddaecff 0x123d4bfe 0xa2aaacff 0x111e22ef 0xc8b399ff 0xbebebeff 0x00fefeff ""}
|
||||
|
||||
//- rjf: debugging colors
|
||||
{LineInfoBackground0 "Line Info Background 0" line_info_background_0 0x99503d3f 0x99503d3f 0x99503d3f 0x99503d3f 0x99503d3f 0x99503d3f 0x99503d3f 0x99503d3f 0x99503d3f ""}
|
||||
{LineInfoBackground1 "Line Info Background 1" line_info_background_1 0xfe82493f 0xfe82493f 0xfe82493f 0xfe82493f 0xfe82493f 0xfe82493f 0xfe82493f 0xfe82493f 0xfe82493f ""}
|
||||
{LineInfoBackground2 "Line Info Background 2" line_info_background_2 0xffba173f 0xffba173f 0xffba173f 0xffba173f 0xffba173f 0xffba173f 0xffba173f 0xffba173f 0xffba173f ""}
|
||||
{LineInfoBackground3 "Line Info Background 3" line_info_background_3 0xcefd693f 0xcefd693f 0xcefd693f 0xcefd693f 0xcefd693f 0xcefd693f 0xcefd693f 0xcefd693f 0xcefd693f ""}
|
||||
{LineInfoBackground4 "Line Info Background 4" line_info_background_4 0x99503d3f 0x99503d3f 0x99503d3f 0x99503d3f 0x99503d3f 0x99503d3f 0x99503d3f 0x99503d3f 0x99503d3f ""}
|
||||
{LineInfoBackground5 "Line Info Background 5" line_info_background_5 0xfe82493f 0xfe82493f 0xfe82493f 0xfe82493f 0xfe82493f 0xfe82493f 0xfe82493f 0xfe82493f 0xfe82493f ""}
|
||||
{LineInfoBackground6 "Line Info Background 6" line_info_background_6 0xffba173f 0xffba173f 0xffba173f 0xffba173f 0xffba173f 0xffba173f 0xffba173f 0xffba173f 0xffba173f ""}
|
||||
{LineInfoBackground7 "Line Info Background 7" line_info_background_7 0xcefd693f 0xcefd693f 0xcefd693f 0xcefd693f 0xcefd693f 0xcefd693f 0xcefd693f 0xcefd693f 0xcefd693f ""}
|
||||
{Thread0 "Thread 0" thread_0 0xffcb7fff 0x945800ff 0xffcb7fff 0x945800ff 0xffcb7fff 0x945800ff 0xffcb7fff 0xffcb7fff 0xffcb7fff ""}
|
||||
{Thread1 "Thread 1" thread_1 0xb2ff65ff 0x3f5b23ff 0xb2ff65ff 0x3f5b23ff 0xb2ff65ff 0x3f5b23ff 0xb2ff65ff 0xb2ff65ff 0xb2ff65ff ""}
|
||||
{Thread2 "Thread 2" thread_2 0xff99e5ff 0x642a55ff 0xff99e5ff 0x642a55ff 0xff99e5ff 0x642a55ff 0xff99e5ff 0xff99e5ff 0xff99e5ff ""}
|
||||
{Thread3 "Thread 3" thread_3 0x6598ffff 0x30456fff 0x6598ffff 0x30456fff 0x6598ffff 0x30456fff 0x6598ffff 0x6598ffff 0x6598ffff ""}
|
||||
{Thread4 "Thread 4" thread_4 0x65ffcbff 0x264f41ff 0x65ffcbff 0x264f41ff 0x65ffcbff 0x264f41ff 0x65ffcbff 0x65ffcbff 0x65ffcbff ""}
|
||||
{Thread5 "Thread 5" thread_5 0xff9819ff 0x736a5fff 0xff9819ff 0x736a5fff 0xff9819ff 0x736a5fff 0xff9819ff 0xff9819ff 0xff9819ff ""}
|
||||
{Thread6 "Thread 6" thread_6 0x9932ffff 0x472f5eff 0x9932ffff 0x472f5eff 0x9932ffff 0x472f5eff 0x9932ffff 0x9932ffff 0x9932ffff ""}
|
||||
{Thread7 "Thread 7" thread_7 0x65ff4cff 0x405d3bff 0x65ff4cff 0x405d3bff 0x65ff4cff 0x405d3bff 0x65ff4cff 0x65ff4cff 0x65ff4cff ""}
|
||||
{ThreadUnwound "Thread (Unwound)" thread_unwound 0xb2ccd8ff 0x49606aff 0xb2ccd8ff 0x49606aff 0xb2ccd8ff 0x49606aff 0xb2ccd8ff 0xb2ccd8ff 0xb2ccd8ff ""}
|
||||
{ThreadError "Thread (Error)" thread_error 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23218ff 0xb23219ff 0xb23219ff 0xb23219ff ""}
|
||||
{Breakpoint "Breakpoint" breakpoint 0xa72911ff 0xff2800ff 0xa72911ff 0xa72911ff 0xa72911ff 0xff684bff 0xa72911ff 0xa72911ff 0xff2800ff ""}
|
||||
}
|
||||
|
||||
//- rjf: theme color tables
|
||||
@table(old_name new_name)
|
||||
DF_ThemeColorVersionRemapTable:
|
||||
{
|
||||
{plain_text text}
|
||||
{plain_background base_background}
|
||||
{plain_border base_border}
|
||||
{plain_overlay drop_site_overlay}
|
||||
{code_function code_symbol}
|
||||
{code_symbol code_delimiter_operator}
|
||||
{code_numeric code_numeric_alt_digit_group}
|
||||
{line_info_0 line_info_background_0}
|
||||
{line_info_1 line_info_background_1}
|
||||
{line_info_2 line_info_background_2}
|
||||
{line_info_3 line_info_background_3}
|
||||
{alt_background menu_bar_background}
|
||||
{alt_border menu_bar_border}
|
||||
{tab_inactive tab_background_inactive}
|
||||
{tab_active tab_background}
|
||||
{weak_text text_weak}
|
||||
{text_selection selection}
|
||||
{cursor cursor}
|
||||
{highlight_0 focus}
|
||||
{success_background positive_pop_button_background}
|
||||
{failure_background negative_pop_button_background}
|
||||
{action_background neutral_pop_button_background}
|
||||
}
|
||||
|
||||
@enum DF_ThemeColor:
|
||||
{
|
||||
@expand(DF_ThemeColorTable a) `$(a.name)`,
|
||||
COUNT,
|
||||
}
|
||||
|
||||
@enum DF_ThemePreset:
|
||||
{
|
||||
@expand(DF_ThemePresetTable a) `$(a.name)`,
|
||||
COUNT,
|
||||
}
|
||||
|
||||
@data(String8) df_g_theme_preset_display_string_table:
|
||||
{
|
||||
@expand(DF_ThemePresetTable a) `str8_lit_comp("$(a.display_string)")`,
|
||||
}
|
||||
|
||||
@data(String8) df_g_theme_preset_code_string_table:
|
||||
{
|
||||
@expand(DF_ThemePresetTable a) `str8_lit_comp("$(a.name_lower)")`,
|
||||
}
|
||||
|
||||
@data(String8) df_g_theme_color_version_remap_old_name_table:
|
||||
{
|
||||
@expand(DF_ThemeColorVersionRemapTable a) `str8_lit_comp("$(a.old_name)")`
|
||||
}
|
||||
|
||||
@data(String8) df_g_theme_color_version_remap_new_name_table:
|
||||
{
|
||||
@expand(DF_ThemeColorVersionRemapTable a) `str8_lit_comp("$(a.new_name)")`
|
||||
}
|
||||
|
||||
@data(Vec4F32) df_g_theme_preset_colors__default_dark: {@expand(DF_ThemeColorTable a) `rgba_from_u32_lit_comp($(a.default_dark))`}
|
||||
@data(Vec4F32) df_g_theme_preset_colors__default_light: {@expand(DF_ThemeColorTable a) `rgba_from_u32_lit_comp($(a.default_light))`}
|
||||
@data(Vec4F32) df_g_theme_preset_colors__vs_dark: {@expand(DF_ThemeColorTable a) `rgba_from_u32_lit_comp($(a.vs_dark))`}
|
||||
@data(Vec4F32) df_g_theme_preset_colors__vs_light: {@expand(DF_ThemeColorTable a) `rgba_from_u32_lit_comp($(a.vs_light))`}
|
||||
@data(Vec4F32) df_g_theme_preset_colors__solarized_dark: {@expand(DF_ThemeColorTable a) `rgba_from_u32_lit_comp($(a.solarized_dark))`,}
|
||||
@data(Vec4F32) df_g_theme_preset_colors__solarized_light:{@expand(DF_ThemeColorTable a) `rgba_from_u32_lit_comp($(a.solarized_light))`,}
|
||||
@data(Vec4F32) df_g_theme_preset_colors__handmade_hero: {@expand(DF_ThemeColorTable a) `rgba_from_u32_lit_comp($(a.handmade_hero))`,}
|
||||
@data(Vec4F32) df_g_theme_preset_colors__four_coder: {@expand(DF_ThemeColorTable a) `rgba_from_u32_lit_comp($(a.four_coder))`,}
|
||||
@data(Vec4F32) df_g_theme_preset_colors__far_manager: {@expand(DF_ThemeColorTable a) `rgba_from_u32_lit_comp($(a.far_manager))`;}
|
||||
@data(`Vec4F32*`) df_g_theme_preset_colors_table:
|
||||
{
|
||||
@expand(DF_ThemePresetTable a) `df_g_theme_preset_colors__$(a.name_lower)`,
|
||||
}
|
||||
|
||||
@data(String8) df_g_theme_color_display_string_table:
|
||||
{
|
||||
@@ -603,6 +545,53 @@ DF_ThemePresetColorTable:
|
||||
@expand(DF_ThemeColorTable a) `str8_lit_comp("$(a.name_lower)")`
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Settings
|
||||
|
||||
@table(name name_lower display_string default_s32 s32_min s32_max)
|
||||
DF_SettingTable:
|
||||
{
|
||||
{HoverAnimations hover_animations "Hover Animations" 1 0 1 }
|
||||
{PressAnimations press_animations "Press Animations" 1 0 1 }
|
||||
{FocusAnimations focus_animations "Focus Animations" 1 0 1 }
|
||||
{TooltipAnimations tooltip_animations "Tooltip Animations" 1 0 1 }
|
||||
{MenuAnimations menu_animations "Menu Animations" 1 0 1 }
|
||||
{ScrollingAnimations scrolling_animations "Scrolling Animations" 1 0 1 }
|
||||
{BackgroundBlur background_blur "Background Blur" 1 0 1 }
|
||||
{ThreadLines thread_lines "Thread Lines" 1 0 1 }
|
||||
{BreakpointLines breakpoint_lines "Breakpoint Lines" 1 0 1 }
|
||||
{ThreadGlow thread_glow "Thread Glow" 1 0 1 }
|
||||
{BreakpointGlow breakpoint_glow "Breakpoint Glow" 1 0 1 }
|
||||
{OpaqueBackgrounds opaque_backgrounds "Opaque Backgrounds" 0 0 1 }
|
||||
{TabWidth tab_width "Tab Width" 4 1 32 }
|
||||
}
|
||||
|
||||
@enum DF_SettingCode:
|
||||
{
|
||||
@expand(DF_SettingTable a) `$(a.name)`,
|
||||
COUNT
|
||||
}
|
||||
|
||||
@data(String8) df_g_setting_code_display_string_table:
|
||||
{
|
||||
@expand(DF_SettingTable a) `str8_lit_comp("$(a.display_string)")`
|
||||
}
|
||||
|
||||
@data(String8) df_g_setting_code_lower_string_table:
|
||||
{
|
||||
@expand(DF_SettingTable a) `str8_lit_comp("$(a.name_lower)")`
|
||||
}
|
||||
|
||||
@data(DF_SettingVal) df_g_setting_code_default_val_table:
|
||||
{
|
||||
@expand(DF_SettingTable a) `{1, $(a.default_s32)}`
|
||||
}
|
||||
|
||||
@data(Rng1S32) df_g_setting_code_s32_range_table:
|
||||
{
|
||||
@expand(DF_SettingTable a) `{$(a.s32_min), $(a.s32_max)}`
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Help/Docs/README
|
||||
|
||||
|
||||
+21
-21
@@ -908,13 +908,13 @@ DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_DEF(rgba)
|
||||
text_box = ui_build_box_from_key(UI_BoxFlag_DrawText, ui_key_zero());
|
||||
D_FancyStringList fancy_strings = {0};
|
||||
{
|
||||
D_FancyString open_paren = {ui_top_font(), str8_lit("("), ui_top_text_color(), ui_top_font_size(), 0, 0};
|
||||
D_FancyString comma = {ui_top_font(), str8_lit(", "), ui_top_text_color(), ui_top_font_size(), 0, 0};
|
||||
D_FancyString open_paren = {ui_top_font(), str8_lit("("), ui_top_palette()->text, ui_top_font_size(), 0, 0};
|
||||
D_FancyString comma = {ui_top_font(), str8_lit(", "), ui_top_palette()->text, ui_top_font_size(), 0, 0};
|
||||
D_FancyString r_fstr = {ui_top_font(), push_str8f(scratch.arena, "%.2f", rgba.x), v4f32(1.f, 0.25f, 0.25f, 1.f), ui_top_font_size(), 4.f, 0};
|
||||
D_FancyString g_fstr = {ui_top_font(), push_str8f(scratch.arena, "%.2f", rgba.y), v4f32(0.25f, 1.f, 0.25f, 1.f), ui_top_font_size(), 4.f, 0};
|
||||
D_FancyString b_fstr = {ui_top_font(), push_str8f(scratch.arena, "%.2f", rgba.z), v4f32(0.25f, 0.25f, 1.f, 1.f), ui_top_font_size(), 4.f, 0};
|
||||
D_FancyString a_fstr = {ui_top_font(), push_str8f(scratch.arena, "%.2f", rgba.w), v4f32(1.f, 1.f, 1.f, 1.f), ui_top_font_size(), 4.f, 0};
|
||||
D_FancyString clse_paren = {ui_top_font(), str8_lit(")"), ui_top_text_color(), ui_top_font_size(), 0, 0};
|
||||
D_FancyString clse_paren = {ui_top_font(), str8_lit(")"), ui_top_palette()->text, ui_top_font_size(), 0, 0};
|
||||
d_fancy_string_list_push(scratch.arena, &fancy_strings, &open_paren);
|
||||
d_fancy_string_list_push(scratch.arena, &fancy_strings, &r_fstr);
|
||||
d_fancy_string_list_push(scratch.arena, &fancy_strings, &comma);
|
||||
@@ -925,7 +925,7 @@ DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_DEF(rgba)
|
||||
d_fancy_string_list_push(scratch.arena, &fancy_strings, &a_fstr);
|
||||
d_fancy_string_list_push(scratch.arena, &fancy_strings, &clse_paren);
|
||||
}
|
||||
ui_box_equip_display_fancy_strings(text_box, 0, &fancy_strings);
|
||||
ui_box_equip_display_fancy_strings(text_box, &fancy_strings);
|
||||
}
|
||||
|
||||
//- rjf: build color box
|
||||
@@ -935,7 +935,7 @@ DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_DEF(rgba)
|
||||
color_box = ui_build_box_from_stringf(UI_BoxFlag_Clickable, "color_box");
|
||||
UI_Parent(color_box) UI_PrefHeight(ui_em(1.875f, 1.f)) UI_Padding(ui_pct(1, 0))
|
||||
{
|
||||
UI_BackgroundColor(rgba) UI_CornerRadius(ui_top_font_size()*0.5f)
|
||||
UI_Palette(ui_build_palette(ui_top_palette(), .background = rgba)) UI_CornerRadius(ui_top_font_size()*0.5f)
|
||||
ui_build_box_from_key(UI_BoxFlag_DrawBackground|UI_BoxFlag_DrawBorder, ui_key_zero());
|
||||
}
|
||||
}
|
||||
@@ -993,7 +993,7 @@ DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(rgba)
|
||||
UI_Signal h_sig = ui_hue_pickerf(&hsva.x, hsva.y, hsva.z, "hue_picker");
|
||||
commit = commit || ui_released(h_sig);
|
||||
}
|
||||
UI_PrefWidth(ui_children_sum(1)) UI_Column UI_PrefWidth(ui_text_dim(10, 1)) UI_Font(df_font_from_slot(DF_FontSlot_Code)) UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText))
|
||||
UI_PrefWidth(ui_children_sum(1)) UI_Column UI_PrefWidth(ui_text_dim(10, 1)) UI_Font(df_font_from_slot(DF_FontSlot_Code)) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak)
|
||||
{
|
||||
ui_labelf("Hex");
|
||||
ui_labelf("R");
|
||||
@@ -1105,9 +1105,10 @@ DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(text)
|
||||
String8 data = {0};
|
||||
TXT_TextInfo info = {0};
|
||||
TXT_LineTokensSlice line_tokens_slice = {0};
|
||||
U128 text_key = {0};
|
||||
{
|
||||
U128 text_hash = {0};
|
||||
U128 text_key = ctrl_hash_store_key_from_process_vaddr_range(process->ctrl_machine_id, process->ctrl_handle, vaddr_range, 1);
|
||||
text_key = ctrl_hash_store_key_from_process_vaddr_range(process->ctrl_machine_id, process->ctrl_handle, vaddr_range, 1);
|
||||
info = txt_text_info_from_key_lang(txt_scope, text_key, top.lang, &text_hash);
|
||||
data = hs_data_from_hash(hs_scope, text_hash);
|
||||
line_tokens_slice = txt_line_tokens_slice_from_info_data_line_range(scratch.arena, &info, data, r1s64(1, info.lines_count));
|
||||
@@ -1126,8 +1127,8 @@ DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(text)
|
||||
code_slice_params.line_bps = push_array(scratch.arena, DF_EntityList, info.lines_count);
|
||||
code_slice_params.line_ips = push_array(scratch.arena, DF_EntityList, info.lines_count);
|
||||
code_slice_params.line_pins = push_array(scratch.arena, DF_EntityList, info.lines_count);
|
||||
code_slice_params.line_dasm2src = push_array(scratch.arena, DF_TextLineDasm2SrcInfoList, info.lines_count);
|
||||
code_slice_params.line_src2dasm = push_array(scratch.arena, DF_TextLineSrc2DasmInfoList, info.lines_count);
|
||||
code_slice_params.line_vaddrs = push_array(scratch.arena, U64, info.lines_count);
|
||||
code_slice_params.line_infos = push_array(scratch.arena, DF_LineList, info.lines_count);
|
||||
for(U64 line_idx = 0; line_idx < info.lines_count; line_idx += 1)
|
||||
{
|
||||
code_slice_params.line_text[line_idx] = str8_substr(data, info.lines_ranges[line_idx]);
|
||||
@@ -1136,7 +1137,7 @@ DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(text)
|
||||
}
|
||||
code_slice_params.font = df_font_from_slot(DF_FontSlot_Code);
|
||||
code_slice_params.font_size = ui_top_font_size();
|
||||
code_slice_params.tab_size = f_column_size_from_tag_size(code_slice_params.font, code_slice_params.font_size)*4.f;
|
||||
code_slice_params.tab_size = f_column_size_from_tag_size(code_slice_params.font, code_slice_params.font_size)*df_setting_val_from_code(DF_SettingCode_TabWidth).s32;
|
||||
code_slice_params.line_height_px = ui_top_font_size()*1.5f;
|
||||
code_slice_params.priority_margin_width_px = 0;
|
||||
code_slice_params.catchall_margin_width_px = 0;
|
||||
@@ -1265,11 +1266,12 @@ DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(disasm)
|
||||
DASM_Info dasm_info = dasm_info_from_key_params(dasm_scope, dasm_key, &dasm_params, &data_hash);
|
||||
String8 dasm_text_data = {0};
|
||||
TXT_TextInfo dasm_text_info = {0};
|
||||
TXT_LangKind lang_kind = TXT_LangKind_DisasmX64Intel;
|
||||
for(U64 rewind_idx = 0; rewind_idx < 2; rewind_idx += 1)
|
||||
{
|
||||
U128 dasm_text_hash = hs_hash_from_key(dasm_info.text_key, rewind_idx);
|
||||
dasm_text_data = hs_data_from_hash(hs_scope, dasm_text_hash);
|
||||
dasm_text_info = txt_text_info_from_hash_lang(txt_scope, dasm_text_hash, TXT_LangKind_DisasmX64Intel);
|
||||
dasm_text_info = txt_text_info_from_hash_lang(txt_scope, dasm_text_hash, lang_kind);
|
||||
if(dasm_text_info.lines_count != 0)
|
||||
{
|
||||
break;
|
||||
@@ -1288,8 +1290,8 @@ DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(disasm)
|
||||
code_slice_params.line_bps = push_array(scratch.arena, DF_EntityList, dasm_text_info.lines_count);
|
||||
code_slice_params.line_ips = push_array(scratch.arena, DF_EntityList, dasm_text_info.lines_count);
|
||||
code_slice_params.line_pins = push_array(scratch.arena, DF_EntityList, dasm_text_info.lines_count);
|
||||
code_slice_params.line_dasm2src = push_array(scratch.arena, DF_TextLineDasm2SrcInfoList, dasm_text_info.lines_count);
|
||||
code_slice_params.line_src2dasm = push_array(scratch.arena, DF_TextLineSrc2DasmInfoList, dasm_text_info.lines_count);
|
||||
code_slice_params.line_vaddrs = push_array(scratch.arena, U64, dasm_text_info.lines_count);
|
||||
code_slice_params.line_infos = push_array(scratch.arena, DF_LineList, dasm_text_info.lines_count);
|
||||
for(U64 line_idx = 0; line_idx < dasm_text_info.lines_count; line_idx += 1)
|
||||
{
|
||||
code_slice_params.line_text[line_idx] = str8_substr(dasm_text_data, dasm_info.insts.v[line_idx].text_range);
|
||||
@@ -1298,7 +1300,7 @@ DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(disasm)
|
||||
}
|
||||
code_slice_params.font = df_font_from_slot(DF_FontSlot_Code);
|
||||
code_slice_params.font_size = ui_top_font_size();
|
||||
code_slice_params.tab_size = f_column_size_from_tag_size(code_slice_params.font, code_slice_params.font_size)*4.f;
|
||||
code_slice_params.tab_size = f_column_size_from_tag_size(code_slice_params.font, code_slice_params.font_size)*df_setting_val_from_code(DF_SettingCode_TabWidth).s32;
|
||||
code_slice_params.line_height_px = ui_top_font_size()*1.5f;
|
||||
code_slice_params.priority_margin_width_px = 0;
|
||||
code_slice_params.catchall_margin_width_px = 0;
|
||||
@@ -1440,7 +1442,7 @@ df_vr_bitmap_topology_info_from_cfg(DI_Scope *scope, DF_CtrlCtx *ctrl_ctx, EVAL_
|
||||
internal UI_BOX_CUSTOM_DRAW(df_vr_bitmap_box_draw)
|
||||
{
|
||||
DF_VR_BitmapBoxDrawData *draw_data = (DF_VR_BitmapBoxDrawData *)user_data;
|
||||
Vec4F32 bg_color = box->background_color;
|
||||
Vec4F32 bg_color = box->palette->background;
|
||||
d_img(box->rect, draw_data->src, draw_data->texture, v4f32(1, 1, 1, 1), 0, 0, 0);
|
||||
if(draw_data->loaded_t < 0.98f)
|
||||
{
|
||||
@@ -1461,8 +1463,7 @@ internal UI_BOX_CUSTOM_DRAW(df_vr_bitmap_box_draw)
|
||||
d_rect(box->rect, v4f32(bg_color.x*bg_color.w, bg_color.y*bg_color.w, bg_color.z*bg_color.w, 1.f-draw_data->loaded_t), 0, 0, 0);
|
||||
if(draw_data->hovered)
|
||||
{
|
||||
Vec4F32 indicator_color = df_rgba_from_theme_color(DF_ThemeColor_PlainBorder);
|
||||
indicator_color.w = 1.f;
|
||||
Vec4F32 indicator_color = v4f32(1, 1, 1, 1);
|
||||
d_rect(pad_2f32(r2f32p(box->rect.x0 + draw_data->mouse_px.x*draw_data->ui_per_bmp_px,
|
||||
box->rect.y0 + draw_data->mouse_px.y*draw_data->ui_per_bmp_px,
|
||||
box->rect.x0 + draw_data->mouse_px.x*draw_data->ui_per_bmp_px + draw_data->ui_per_bmp_px,
|
||||
@@ -1489,7 +1490,7 @@ DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_DEF(bitmap)
|
||||
U64 base_vaddr = value_eval.imm_u64 ? value_eval.imm_u64 : value_eval.offset;
|
||||
DF_BitmapTopologyInfo topology = df_vr_bitmap_topology_info_from_cfg(scope, ctrl_ctx, parse_ctx, macro_map, cfg);
|
||||
U64 expected_size = topology.width*topology.height*r_tex2d_format_bytes_per_pixel_table[topology.fmt];
|
||||
UI_Font(df_font_from_slot(DF_FontSlot_Code)) UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText))
|
||||
UI_Font(df_font_from_slot(DF_FontSlot_Code)) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak)
|
||||
ui_labelf("0x%I64x -> Bitmap (%I64u x %I64u)", base_vaddr, topology.width, topology.height);
|
||||
}
|
||||
|
||||
@@ -1615,7 +1616,7 @@ internal UI_BOX_CUSTOM_DRAW(df_bitmap_view_canvas_box_draw)
|
||||
Rng2F32 rect_cvs = df_bitmap_view_state__canvas_from_screen_rect(bvs, rect_scrn, rect_scrn);
|
||||
F32 grid_cell_size_cvs = box->font_size*10.f;
|
||||
F32 grid_line_thickness_px = Max(2.f, box->font_size*0.1f);
|
||||
Vec4F32 grid_line_color = df_rgba_from_theme_color(DF_ThemeColor_WeakText);
|
||||
Vec4F32 grid_line_color = df_rgba_from_theme_color(DF_ThemeColor_TextWeak);
|
||||
for(EachEnumVal(Axis2, axis))
|
||||
{
|
||||
for(F32 v = rect_cvs.p0.v[axis] - mod_f32(rect_cvs.p0.v[axis], grid_cell_size_cvs);
|
||||
@@ -1847,7 +1848,6 @@ internal UI_BOX_CUSTOM_DRAW(df_vr_geo_box_draw)
|
||||
{
|
||||
DF_VR_GeoBoxDrawData *draw_data = (DF_VR_GeoBoxDrawData *)user_data;
|
||||
DF_VR_GeoState *state = df_view_rule_block_user_state(draw_data->key, DF_VR_GeoState);
|
||||
Vec4F32 bg_color = box->background_color;
|
||||
|
||||
// rjf: get clip
|
||||
Rng2F32 clip = box->rect;
|
||||
@@ -1895,7 +1895,7 @@ DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_DEF(geo)
|
||||
{
|
||||
DF_Eval value_eval = df_value_mode_eval_from_eval(parse_ctx->type_graph, parse_ctx->rdi, ctrl_ctx, eval);
|
||||
U64 base_vaddr = value_eval.imm_u64 ? value_eval.imm_u64 : value_eval.offset;
|
||||
UI_Font(df_font_from_slot(DF_FontSlot_Code)) UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText))
|
||||
UI_Font(df_font_from_slot(DF_FontSlot_Code)) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak)
|
||||
ui_labelf("0x%I64x -> Geometry", base_vaddr);
|
||||
}
|
||||
|
||||
|
||||
+2201
-2808
File diff suppressed because it is too large
Load Diff
+74
-16
@@ -359,18 +359,30 @@ struct DF_WatchViewState
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Code @view_types
|
||||
//~ rjf: Code, Output @view_types
|
||||
|
||||
typedef U32 DF_CodeViewFlags;
|
||||
enum
|
||||
{
|
||||
DF_CodeViewFlag_StickToBottom = (1<<0),
|
||||
};
|
||||
|
||||
typedef U32 DF_CodeViewBuildFlags;
|
||||
enum
|
||||
{
|
||||
DF_CodeViewBuildFlag_Margins = (1<<0),
|
||||
DF_CodeViewBuildFlag_All = 0xffffffff,
|
||||
};
|
||||
|
||||
typedef struct DF_CodeViewState DF_CodeViewState;
|
||||
struct DF_CodeViewState
|
||||
{
|
||||
// rjf: stable state
|
||||
B32 initialized;
|
||||
TxtPt cursor;
|
||||
TxtPt mark;
|
||||
S64 preferred_column;
|
||||
B32 drifted_for_search;
|
||||
DF_Handle pick_file_override_target;
|
||||
DF_CodeViewFlags flags;
|
||||
|
||||
// rjf: per-frame command info
|
||||
S64 goto_line_num;
|
||||
@@ -387,24 +399,12 @@ struct DF_CodeViewState
|
||||
typedef struct DF_DisasmViewState DF_DisasmViewState;
|
||||
struct DF_DisasmViewState
|
||||
{
|
||||
// rjf: stable state
|
||||
B32 initialized;
|
||||
DF_Handle process;
|
||||
U64 base_vaddr;
|
||||
TxtPt cursor;
|
||||
TxtPt mark;
|
||||
S64 preferred_column;
|
||||
B32 drifted_for_search;
|
||||
DASM_StyleFlags style_flags;
|
||||
|
||||
// rjf: per-frame command info
|
||||
S64 goto_line_num;
|
||||
U64 goto_vaddr;
|
||||
B32 center_cursor;
|
||||
B32 contain_cursor;
|
||||
Arena *find_text_arena;
|
||||
String8 find_text_fwd;
|
||||
String8 find_text_bwd;
|
||||
DF_CodeViewState cv;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
@@ -434,6 +434,56 @@ struct DF_MemoryViewState
|
||||
B32 contain_cursor;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Settings @view_types
|
||||
|
||||
typedef enum DF_SettingsItemKind
|
||||
{
|
||||
DF_SettingsItemKind_CategoryHeader,
|
||||
DF_SettingsItemKind_Setting,
|
||||
DF_SettingsItemKind_ThemeColor,
|
||||
DF_SettingsItemKind_ThemePreset,
|
||||
DF_SettingsItemKind_COUNT
|
||||
}
|
||||
DF_SettingsItemKind;
|
||||
|
||||
typedef struct DF_SettingsItem DF_SettingsItem;
|
||||
struct DF_SettingsItem
|
||||
{
|
||||
DF_SettingsItemKind kind;
|
||||
String8 kind_string;
|
||||
String8 string;
|
||||
FuzzyMatchRangeList kind_string_matches;
|
||||
FuzzyMatchRangeList string_matches;
|
||||
DF_IconKind icon_kind;
|
||||
DF_SettingCode code;
|
||||
DF_ThemeColor color;
|
||||
DF_ThemePreset preset;
|
||||
DF_SettingsItemKind category;
|
||||
};
|
||||
|
||||
typedef struct DF_SettingsItemNode DF_SettingsItemNode;
|
||||
struct DF_SettingsItemNode
|
||||
{
|
||||
DF_SettingsItemNode *next;
|
||||
DF_SettingsItem v;
|
||||
};
|
||||
|
||||
typedef struct DF_SettingsItemList DF_SettingsItemList;
|
||||
struct DF_SettingsItemList
|
||||
{
|
||||
DF_SettingsItemNode *first;
|
||||
DF_SettingsItemNode *last;
|
||||
U64 count;
|
||||
};
|
||||
|
||||
typedef struct DF_SettingsItemArray DF_SettingsItemArray;
|
||||
struct DF_SettingsItemArray
|
||||
{
|
||||
DF_SettingsItem *v;
|
||||
U64 count;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Quick Sort Comparisons
|
||||
|
||||
@@ -445,6 +495,7 @@ internal int df_qsort_compare_file_info__size(DF_FileInfo *a, DF_FileInfo *b);
|
||||
internal int df_qsort_compare_process_info(DF_ProcessInfo *a, DF_ProcessInfo *b);
|
||||
internal int df_qsort_compare_cmd_lister__strength(DF_CmdListerItem *a, DF_CmdListerItem *b);
|
||||
internal int df_qsort_compare_entity_lister__strength(DF_EntityListerItem *a, DF_EntityListerItem *b);
|
||||
internal int df_qsort_compare_settings_item(DF_SettingsItem *a, DF_SettingsItem *b);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Command Lister
|
||||
@@ -467,6 +518,13 @@ internal DF_EntityListerItemList df_entity_lister_item_list_from_needle(Arena *a
|
||||
internal DF_EntityListerItemArray df_entity_lister_item_array_from_list(Arena *arena, DF_EntityListerItemList list);
|
||||
internal void df_entity_lister_item_array_sort_by_strength__in_place(DF_EntityListerItemArray array);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Code Views
|
||||
|
||||
internal void df_code_view_init(DF_CodeViewState *cv, DF_View *view);
|
||||
internal void df_code_view_cmds(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewState *cv, DF_CmdList *cmds, String8 text_data, TXT_TextInfo *text_info, DASM_InstArray *dasm_insts, Rng1U64 dasm_vaddr_range, DI_Key dasm_dbgi_key);
|
||||
internal void df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewState *cv, DF_CodeViewBuildFlags flags, Rng2F32 rect, String8 text_data, TXT_TextInfo *text_info, DASM_InstArray *dasm_insts, Rng1U64 dasm_vaddr_range, DI_Key dasm_dbgi_key);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Watch Views
|
||||
|
||||
|
||||
+1051
-703
File diff suppressed because it is too large
Load Diff
@@ -38,55 +38,76 @@ DF_GfxViewKind_Memory,
|
||||
DF_GfxViewKind_Breakpoints,
|
||||
DF_GfxViewKind_WatchPins,
|
||||
DF_GfxViewKind_ExceptionFilters,
|
||||
DF_GfxViewKind_Theme,
|
||||
DF_GfxViewKind_Settings,
|
||||
DF_GfxViewKind_COUNT,
|
||||
} DF_GfxViewKind;
|
||||
|
||||
typedef enum DF_ThemeColor
|
||||
{
|
||||
DF_ThemeColor_Null,
|
||||
DF_ThemeColor_PlainText,
|
||||
DF_ThemeColor_PlainBackground,
|
||||
DF_ThemeColor_PlainBorder,
|
||||
DF_ThemeColor_PlainOverlay,
|
||||
DF_ThemeColor_Text,
|
||||
DF_ThemeColor_TextPositive,
|
||||
DF_ThemeColor_TextNegative,
|
||||
DF_ThemeColor_TextNeutral,
|
||||
DF_ThemeColor_TextWeak,
|
||||
DF_ThemeColor_Cursor,
|
||||
DF_ThemeColor_CursorInactive,
|
||||
DF_ThemeColor_Focus,
|
||||
DF_ThemeColor_Hover,
|
||||
DF_ThemeColor_DropShadow,
|
||||
DF_ThemeColor_DisabledOverlay,
|
||||
DF_ThemeColor_DropSiteOverlay,
|
||||
DF_ThemeColor_InactivePanelOverlay,
|
||||
DF_ThemeColor_SelectionOverlay,
|
||||
DF_ThemeColor_HighlightOverlay,
|
||||
DF_ThemeColor_HighlightOverlayError,
|
||||
DF_ThemeColor_BaseBackground,
|
||||
DF_ThemeColor_BaseBackgroundAlt,
|
||||
DF_ThemeColor_BaseBorder,
|
||||
DF_ThemeColor_MenuBarBackground,
|
||||
DF_ThemeColor_MenuBarBackgroundAlt,
|
||||
DF_ThemeColor_MenuBarBorder,
|
||||
DF_ThemeColor_FloatingBackground,
|
||||
DF_ThemeColor_FloatingBackgroundAlt,
|
||||
DF_ThemeColor_FloatingBorder,
|
||||
DF_ThemeColor_ImplicitButtonBackground,
|
||||
DF_ThemeColor_ImplicitButtonBorder,
|
||||
DF_ThemeColor_PlainButtonBackground,
|
||||
DF_ThemeColor_PlainButtonBorder,
|
||||
DF_ThemeColor_PositivePopButtonBackground,
|
||||
DF_ThemeColor_PositivePopButtonBorder,
|
||||
DF_ThemeColor_NegativePopButtonBackground,
|
||||
DF_ThemeColor_NegativePopButtonBorder,
|
||||
DF_ThemeColor_NeutralPopButtonBackground,
|
||||
DF_ThemeColor_NeutralPopButtonBorder,
|
||||
DF_ThemeColor_ScrollBarButtonBackground,
|
||||
DF_ThemeColor_ScrollBarButtonBorder,
|
||||
DF_ThemeColor_TabBackground,
|
||||
DF_ThemeColor_TabBorder,
|
||||
DF_ThemeColor_TabBackgroundInactive,
|
||||
DF_ThemeColor_TabBorderInactive,
|
||||
DF_ThemeColor_CodeDefault,
|
||||
DF_ThemeColor_CodeFunction,
|
||||
DF_ThemeColor_CodeSymbol,
|
||||
DF_ThemeColor_CodeType,
|
||||
DF_ThemeColor_CodeLocal,
|
||||
DF_ThemeColor_CodeRegister,
|
||||
DF_ThemeColor_CodeKeyword,
|
||||
DF_ThemeColor_CodeSymbol,
|
||||
DF_ThemeColor_CodeDelimiterOperator,
|
||||
DF_ThemeColor_CodeNumeric,
|
||||
DF_ThemeColor_CodeNumericAltDigitGroup,
|
||||
DF_ThemeColor_CodeString,
|
||||
DF_ThemeColor_CodeMeta,
|
||||
DF_ThemeColor_CodeComment,
|
||||
DF_ThemeColor_LineInfo0,
|
||||
DF_ThemeColor_LineInfo1,
|
||||
DF_ThemeColor_LineInfo2,
|
||||
DF_ThemeColor_LineInfo3,
|
||||
DF_ThemeColor_AltText,
|
||||
DF_ThemeColor_AltBackground,
|
||||
DF_ThemeColor_AltBorder,
|
||||
DF_ThemeColor_AltOverlay,
|
||||
DF_ThemeColor_TabInactive,
|
||||
DF_ThemeColor_TabActive,
|
||||
DF_ThemeColor_EntityBackground,
|
||||
DF_ThemeColor_QueryBar,
|
||||
DF_ThemeColor_WeakText,
|
||||
DF_ThemeColor_TextSelection,
|
||||
DF_ThemeColor_Cursor,
|
||||
DF_ThemeColor_Highlight0,
|
||||
DF_ThemeColor_Highlight1,
|
||||
DF_ThemeColor_SuccessText,
|
||||
DF_ThemeColor_SuccessBackground,
|
||||
DF_ThemeColor_SuccessBorder,
|
||||
DF_ThemeColor_FailureText,
|
||||
DF_ThemeColor_FailureBackground,
|
||||
DF_ThemeColor_FailureBorder,
|
||||
DF_ThemeColor_ActionText,
|
||||
DF_ThemeColor_ActionBackground,
|
||||
DF_ThemeColor_ActionBorder,
|
||||
DF_ThemeColor_DropSiteOverlay,
|
||||
DF_ThemeColor_CodeLineNumbers,
|
||||
DF_ThemeColor_CodeLineNumbersSelected,
|
||||
DF_ThemeColor_LineInfoBackground0,
|
||||
DF_ThemeColor_LineInfoBackground1,
|
||||
DF_ThemeColor_LineInfoBackground2,
|
||||
DF_ThemeColor_LineInfoBackground3,
|
||||
DF_ThemeColor_LineInfoBackground4,
|
||||
DF_ThemeColor_LineInfoBackground5,
|
||||
DF_ThemeColor_LineInfoBackground6,
|
||||
DF_ThemeColor_LineInfoBackground7,
|
||||
DF_ThemeColor_Thread0,
|
||||
DF_ThemeColor_Thread1,
|
||||
DF_ThemeColor_Thread2,
|
||||
@@ -96,8 +117,8 @@ DF_ThemeColor_Thread5,
|
||||
DF_ThemeColor_Thread6,
|
||||
DF_ThemeColor_Thread7,
|
||||
DF_ThemeColor_ThreadUnwound,
|
||||
DF_ThemeColor_InactivePanelOverlay,
|
||||
DF_ThemeColor_DropShadow,
|
||||
DF_ThemeColor_ThreadError,
|
||||
DF_ThemeColor_Breakpoint,
|
||||
DF_ThemeColor_COUNT,
|
||||
} DF_ThemeColor;
|
||||
|
||||
@@ -115,6 +136,24 @@ DF_ThemePreset_FarManager,
|
||||
DF_ThemePreset_COUNT,
|
||||
} DF_ThemePreset;
|
||||
|
||||
typedef enum DF_SettingCode
|
||||
{
|
||||
DF_SettingCode_HoverAnimations,
|
||||
DF_SettingCode_PressAnimations,
|
||||
DF_SettingCode_FocusAnimations,
|
||||
DF_SettingCode_TooltipAnimations,
|
||||
DF_SettingCode_MenuAnimations,
|
||||
DF_SettingCode_ScrollingAnimations,
|
||||
DF_SettingCode_BackgroundBlur,
|
||||
DF_SettingCode_ThreadLines,
|
||||
DF_SettingCode_BreakpointLines,
|
||||
DF_SettingCode_ThreadGlow,
|
||||
DF_SettingCode_BreakpointGlow,
|
||||
DF_SettingCode_OpaqueBackgrounds,
|
||||
DF_SettingCode_TabWidth,
|
||||
DF_SettingCode_COUNT,
|
||||
} DF_SettingCode;
|
||||
|
||||
DF_VIEW_SETUP_FUNCTION_DEF(Null);
|
||||
DF_VIEW_SETUP_FUNCTION_DEF(Empty);
|
||||
DF_VIEW_SETUP_FUNCTION_DEF(GettingStarted);
|
||||
@@ -145,7 +184,7 @@ DF_VIEW_SETUP_FUNCTION_DEF(Memory);
|
||||
DF_VIEW_SETUP_FUNCTION_DEF(Breakpoints);
|
||||
DF_VIEW_SETUP_FUNCTION_DEF(WatchPins);
|
||||
DF_VIEW_SETUP_FUNCTION_DEF(ExceptionFilters);
|
||||
DF_VIEW_SETUP_FUNCTION_DEF(Theme);
|
||||
DF_VIEW_SETUP_FUNCTION_DEF(Settings);
|
||||
DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(Null);
|
||||
DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(Empty);
|
||||
DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(GettingStarted);
|
||||
@@ -176,7 +215,7 @@ DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(Memory);
|
||||
DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(Breakpoints);
|
||||
DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(WatchPins);
|
||||
DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(ExceptionFilters);
|
||||
DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(Theme);
|
||||
DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(Settings);
|
||||
DF_VIEW_CMD_FUNCTION_DEF(Null);
|
||||
DF_VIEW_CMD_FUNCTION_DEF(Empty);
|
||||
DF_VIEW_CMD_FUNCTION_DEF(GettingStarted);
|
||||
@@ -207,7 +246,7 @@ DF_VIEW_CMD_FUNCTION_DEF(Memory);
|
||||
DF_VIEW_CMD_FUNCTION_DEF(Breakpoints);
|
||||
DF_VIEW_CMD_FUNCTION_DEF(WatchPins);
|
||||
DF_VIEW_CMD_FUNCTION_DEF(ExceptionFilters);
|
||||
DF_VIEW_CMD_FUNCTION_DEF(Theme);
|
||||
DF_VIEW_CMD_FUNCTION_DEF(Settings);
|
||||
DF_VIEW_UI_FUNCTION_DEF(Null);
|
||||
DF_VIEW_UI_FUNCTION_DEF(Empty);
|
||||
DF_VIEW_UI_FUNCTION_DEF(GettingStarted);
|
||||
@@ -238,7 +277,7 @@ DF_VIEW_UI_FUNCTION_DEF(Memory);
|
||||
DF_VIEW_UI_FUNCTION_DEF(Breakpoints);
|
||||
DF_VIEW_UI_FUNCTION_DEF(WatchPins);
|
||||
DF_VIEW_UI_FUNCTION_DEF(ExceptionFilters);
|
||||
DF_VIEW_UI_FUNCTION_DEF(Theme);
|
||||
DF_VIEW_UI_FUNCTION_DEF(Settings);
|
||||
|
||||
DF_GFX_VIEW_RULE_VIZ_ROW_PROD_FUNCTION_DEF(list);
|
||||
DF_GFX_VIEW_RULE_VIZ_ROW_PROD_FUNCTION_DEF(only);
|
||||
@@ -281,27 +320,33 @@ DF_VIEW_UI_FUNCTION_DEF(bitmap);
|
||||
DF_VIEW_UI_FUNCTION_DEF(odin_map);
|
||||
DF_VIEW_UI_FUNCTION_DEF(geo);
|
||||
C_LINKAGE_BEGIN
|
||||
extern String8 df_g_theme_preset_display_string_table[9];
|
||||
extern String8 df_g_theme_preset_code_string_table[9];
|
||||
extern Vec4F32 df_g_theme_preset_colors__default_dark[54];
|
||||
extern Vec4F32 df_g_theme_preset_colors__default_light[54];
|
||||
extern Vec4F32 df_g_theme_preset_colors__vs_dark[54];
|
||||
extern Vec4F32 df_g_theme_preset_colors__vs_light[54];
|
||||
extern Vec4F32 df_g_theme_preset_colors__solarized_dark[54];
|
||||
extern Vec4F32 df_g_theme_preset_colors__solarized_light[54];
|
||||
extern Vec4F32 df_g_theme_preset_colors__handmade_hero[54];
|
||||
extern Vec4F32 df_g_theme_preset_colors__four_coder[54];
|
||||
extern Vec4F32 df_g_theme_preset_colors__far_manager[54];
|
||||
extern Vec4F32* df_g_theme_preset_colors_table[9];
|
||||
extern DF_CmdParamSlot df_g_cmd_param_slot_2_view_spec_src_map[7];
|
||||
extern String8 df_g_cmd_param_slot_2_view_spec_dst_map[7];
|
||||
extern String8 df_g_cmd_param_slot_2_view_spec_cmd_map[7];
|
||||
extern DF_StringBindingPair df_g_default_binding_table[105];
|
||||
extern String8 df_g_binding_version_remap_old_name_table[5];
|
||||
extern String8 df_g_binding_version_remap_new_name_table[5];
|
||||
extern DF_ViewSpecInfo df_g_gfx_view_kind_spec_info_table[31];
|
||||
extern String8 df_g_theme_color_display_string_table[54];
|
||||
extern String8 df_g_theme_color_cfg_string_table[54];
|
||||
extern DF_CmdParamSlot df_g_cmd_param_slot_2_view_spec_src_map[7];
|
||||
extern String8 df_g_cmd_param_slot_2_view_spec_dst_map[7];
|
||||
extern String8 df_g_cmd_param_slot_2_view_spec_cmd_map[7];
|
||||
extern String8 df_g_theme_preset_display_string_table[9];
|
||||
extern String8 df_g_theme_preset_code_string_table[9];
|
||||
extern String8 df_g_theme_color_version_remap_old_name_table[22];
|
||||
extern String8 df_g_theme_color_version_remap_new_name_table[22];
|
||||
extern Vec4F32 df_g_theme_preset_colors__default_dark[75];
|
||||
extern Vec4F32 df_g_theme_preset_colors__default_light[75];
|
||||
extern Vec4F32 df_g_theme_preset_colors__vs_dark[75];
|
||||
extern Vec4F32 df_g_theme_preset_colors__vs_light[75];
|
||||
extern Vec4F32 df_g_theme_preset_colors__solarized_dark[75];
|
||||
extern Vec4F32 df_g_theme_preset_colors__solarized_light[75];
|
||||
extern Vec4F32 df_g_theme_preset_colors__handmade_hero[75];
|
||||
extern Vec4F32 df_g_theme_preset_colors__four_coder[75];
|
||||
extern Vec4F32 df_g_theme_preset_colors__far_manager[75];
|
||||
extern Vec4F32* df_g_theme_preset_colors_table[9];
|
||||
extern String8 df_g_theme_color_display_string_table[75];
|
||||
extern String8 df_g_theme_color_cfg_string_table[75];
|
||||
extern String8 df_g_setting_code_display_string_table[13];
|
||||
extern String8 df_g_setting_code_lower_string_table[13];
|
||||
extern DF_SettingVal df_g_setting_code_default_val_table[13];
|
||||
extern Rng1S32 df_g_setting_code_s32_range_table[13];
|
||||
read_only global U8 df_g_icon_font_bytes__data[] =
|
||||
{
|
||||
0x00,0x01,0x00,0x00,0x00,0x0f,0x00,0x80,0x00,0x03,0x00,0x70,0x47,0x53,0x55,0x42,0x20,0x8b,0x25,0x7a,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x54,0x4f,0x53,0x2f,0x32,0x56,0x44,0x49,0xa0,0x00,0x00,0x01,0x50,0x00,0x00,0x00,0x60,0x63,0x6d,0x61,0x70,0x2a,0x09,0xe2,0xc2,0x00,0x00,0x01,0xb0,0x00,0x00,0x05,0xec,0x63,0x76,0x74,0x20,
|
||||
|
||||
+28
-13
@@ -87,7 +87,7 @@ d_string_from_fancy_string_list(Arena *arena, D_FancyStringList *list)
|
||||
}
|
||||
|
||||
internal D_FancyRunList
|
||||
d_fancy_run_list_from_fancy_string_list(Arena *arena, F32 tab_size_px, D_FancyStringList *strs)
|
||||
d_fancy_run_list_from_fancy_string_list(Arena *arena, F32 tab_size_px, F_RunFlags flags, D_FancyStringList *strs)
|
||||
{
|
||||
ProfBeginFunction();
|
||||
D_FancyRunList run_list = {0};
|
||||
@@ -95,7 +95,7 @@ d_fancy_run_list_from_fancy_string_list(Arena *arena, F32 tab_size_px, D_FancySt
|
||||
for(D_FancyStringNode *n = strs->first; n != 0; n = n->next)
|
||||
{
|
||||
D_FancyRunNode *dst_n = push_array(arena, D_FancyRunNode, 1);
|
||||
dst_n->v.run = f_push_run_from_string(arena, n->v.font, n->v.size, base_align_px, tab_size_px, 0, n->v.string);
|
||||
dst_n->v.run = f_push_run_from_string(arena, n->v.font, n->v.size, base_align_px, tab_size_px, flags, n->v.string);
|
||||
dst_n->v.color = n->v.color;
|
||||
dst_n->v.underline_thickness = n->v.underline_thickness;
|
||||
dst_n->v.strikethrough_thickness = n->v.strikethrough_thickness;
|
||||
@@ -104,6 +104,11 @@ d_fancy_run_list_from_fancy_string_list(Arena *arena, F32 tab_size_px, D_FancySt
|
||||
run_list.dim.x += dst_n->v.run.dim.x;
|
||||
run_list.dim.y = Max(run_list.dim.y, dst_n->v.run.dim.y);
|
||||
base_align_px += dst_n->v.run.dim.x;
|
||||
if(n->next != 0)
|
||||
{
|
||||
run_list.dim.x -= dst_n->v.run.end_pad;
|
||||
base_align_px -= dst_n->v.run.end_pad;
|
||||
}
|
||||
}
|
||||
ProfEnd();
|
||||
return run_list;
|
||||
@@ -307,6 +312,7 @@ d_blur(Rng2F32 rect, F32 blur_size, F32 corner_radius)
|
||||
R_Pass *pass = r_pass_from_kind(arena, &bucket->passes, R_PassKind_Blur);
|
||||
R_PassParams_Blur *params = pass->params_blur;
|
||||
params->rect = rect;
|
||||
params->clip = d_top_clip();
|
||||
params->blur_size = blur_size;
|
||||
params->corner_radii[Corner_00] = corner_radius;
|
||||
params->corner_radii[Corner_01] = corner_radius;
|
||||
@@ -469,9 +475,15 @@ d_truncated_fancy_run_list(Vec2F32 p, D_FancyRunList *list, F32 max_x, F_Run tra
|
||||
for(D_FancyRunNode *n = list->first; n != 0; n = n->next)
|
||||
{
|
||||
D_FancyRun *fr = &n->v;
|
||||
Rng1F32 pixel_range = {0};
|
||||
{
|
||||
pixel_range.min = 100000;
|
||||
pixel_range.max = 0;
|
||||
}
|
||||
F_Piece *piece_first = fr->run.pieces.v;
|
||||
F_Piece *piece_opl = piece_first + fr->run.pieces.count;
|
||||
F32 pre_advance = advance;
|
||||
F32 last_piece_end_pad = 0;
|
||||
last_color = fr->color;
|
||||
for(F_Piece *piece = piece_first;
|
||||
piece < piece_opl;
|
||||
@@ -499,14 +511,17 @@ d_truncated_fancy_run_list(Vec2F32 p, D_FancyRunList *list, F32 max_x, F_Run tra
|
||||
//d_rect(dst, v4f32(1, 0, 0, 1), 0, 1.f, 0.f);
|
||||
}
|
||||
advance += piece->advance;
|
||||
last_piece_end_pad = ((F32)piece->offset.x+(F32)dim_2s16(piece->subrect).x) - piece->advance;
|
||||
pixel_range.min = Min(pre_advance, pixel_range.min);
|
||||
pixel_range.max = Max(advance, pixel_range.max);
|
||||
}
|
||||
if(fr->underline_thickness > 0)
|
||||
{
|
||||
d_rect(r2f32p(p.x+pre_advance,
|
||||
d_rect(r2f32p(p.x + pixel_range.min + 1.f,
|
||||
p.y+fr->run.descent+fr->run.descent/8,
|
||||
p.x+advance + (advance-pre_advance)/8,
|
||||
p.x + pixel_range.max + last_piece_end_pad/2,
|
||||
p.y+fr->run.descent+fr->run.descent/8+fr->underline_thickness),
|
||||
fr->color, 0, 0, 1.f);
|
||||
fr->color, 0, 0, 0.8f);
|
||||
}
|
||||
if(fr->strikethrough_thickness > 0)
|
||||
{
|
||||
@@ -722,44 +737,44 @@ d_truncated_text_run(Vec2F32 p, Vec4F32 color, F32 max_x, F_Run text_run, F_Run
|
||||
}
|
||||
|
||||
internal void
|
||||
d_text(F_Tag font, F32 size, F32 base_align_px, F32 tab_size_px, Vec2F32 p, Vec4F32 color, String8 string)
|
||||
d_text(F_Tag font, F32 size, F32 base_align_px, F32 tab_size_px, F_RunFlags flags, Vec2F32 p, Vec4F32 color, String8 string)
|
||||
{
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
F_Run run = f_push_run_from_string(scratch.arena, font, size, base_align_px, tab_size_px, 0, string);
|
||||
F_Run run = f_push_run_from_string(scratch.arena, font, size, base_align_px, tab_size_px, flags, string);
|
||||
d_text_run(p, color, run);
|
||||
scratch_end(scratch);
|
||||
}
|
||||
|
||||
internal void
|
||||
d_textf(F_Tag font, F32 size, F32 base_align_px, F32 tab_size_px, Vec2F32 p, Vec4F32 color, char *fmt, ...)
|
||||
d_textf(F_Tag font, F32 size, F32 base_align_px, F32 tab_size_px, F_RunFlags flags, Vec2F32 p, Vec4F32 color, char *fmt, ...)
|
||||
{
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
String8 string = push_str8fv(scratch.arena, fmt, args);
|
||||
va_end(args);
|
||||
d_text(font, size, base_align_px, tab_size_px, p, color, string);
|
||||
d_text(font, size, base_align_px, tab_size_px, flags, p, color, string);
|
||||
scratch_end(scratch);
|
||||
}
|
||||
|
||||
internal void
|
||||
d_truncated_text(F_Tag font, F32 size, F32 base_align_px, F32 tab_size_px, Vec2F32 p, Vec4F32 color, F32 max_x, String8 string)
|
||||
d_truncated_text(F_Tag font, F32 size, F32 base_align_px, F32 tab_size_px, F_RunFlags flags, Vec2F32 p, Vec4F32 color, F32 max_x, String8 string)
|
||||
{
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
F_Run run = f_push_run_from_string(scratch.arena, font, size, base_align_px, tab_size_px, 0, string);
|
||||
F_Run run = f_push_run_from_string(scratch.arena, font, size, base_align_px, tab_size_px, flags, string);
|
||||
F_Run ellipses_run = f_push_run_from_string(scratch.arena, font, size, base_align_px, tab_size_px, 0, str8_lit("..."));
|
||||
d_truncated_text_run(p, color, max_x, run, ellipses_run);
|
||||
scratch_end(scratch);
|
||||
}
|
||||
|
||||
internal void
|
||||
d_truncated_textf(F_Tag font, F32 size, F32 base_align_px, F32 tab_size_px, Vec2F32 p, Vec4F32 color, F32 max_x, char *fmt, ...)
|
||||
d_truncated_textf(F_Tag font, F32 size, F32 base_align_px, F32 tab_size_px, F_RunFlags flags, Vec2F32 p, Vec4F32 color, F32 max_x, char *fmt, ...)
|
||||
{
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
String8 string = push_str8f(scratch.arena, fmt, args);
|
||||
d_truncated_text(font, size, base_align_px, tab_size_px, p, color, max_x, string);
|
||||
d_truncated_text(font, size, base_align_px, tab_size_px, flags, p, color, max_x, string);
|
||||
va_end(args);
|
||||
scratch_end(scratch);
|
||||
}
|
||||
|
||||
+5
-5
@@ -111,7 +111,7 @@ internal U64 d_hash_from_string(String8 string);
|
||||
internal void d_fancy_string_list_push(Arena *arena, D_FancyStringList *list, D_FancyString *str);
|
||||
internal void d_fancy_string_list_concat_in_place(D_FancyStringList *dst, D_FancyStringList *to_push);
|
||||
internal String8 d_string_from_fancy_string_list(Arena *arena, D_FancyStringList *list);
|
||||
internal D_FancyRunList d_fancy_run_list_from_fancy_string_list(Arena *arena, F32 tab_size_px, D_FancyStringList *strs);
|
||||
internal D_FancyRunList d_fancy_run_list_from_fancy_string_list(Arena *arena, F32 tab_size_px, F_RunFlags flags, D_FancyStringList *strs);
|
||||
internal D_FancyRunList d_fancy_run_list_copy(Arena *arena, D_FancyRunList *src);
|
||||
|
||||
////////////////////////////////
|
||||
@@ -187,9 +187,9 @@ internal void d_truncated_fancy_run_list(Vec2F32 p, D_FancyRunList *list, F32 ma
|
||||
internal void d_truncated_fancy_run_fuzzy_matches(Vec2F32 p, D_FancyRunList *list, F32 max_x, FuzzyMatchRangeList *ranges, Vec4F32 color);
|
||||
internal void d_text_run(Vec2F32 p, Vec4F32 color, F_Run run);
|
||||
internal void d_truncated_text_run(Vec2F32 p, Vec4F32 color, F32 max_x, F_Run text_run, F_Run trailer_run);
|
||||
internal void d_text(F_Tag font, F32 size, F32 base_align_px, F32 tab_size_px, Vec2F32 p, Vec4F32 color, String8 string);
|
||||
internal void d_textf(F_Tag font, F32 size, F32 base_align_px, F32 tab_size_px, Vec2F32 p, Vec4F32 color, char *fmt, ...);
|
||||
internal void d_truncated_text(F_Tag font, F32 size, F32 base_align_px, F32 tab_size_px, Vec2F32 p, Vec4F32 color, F32 max_x, String8 string);
|
||||
internal void d_truncated_textf(F_Tag font, F32 size, F32 base_align_px, F32 tab_size_px, Vec2F32 p, Vec4F32 color, F32 max_x, char *fmt, ...);
|
||||
internal void d_text(F_Tag font, F32 size, F32 base_align_px, F32 tab_size_px, F_RunFlags flags, Vec2F32 p, Vec4F32 color, String8 string);
|
||||
internal void d_textf(F_Tag font, F32 size, F32 base_align_px, F32 tab_size_px, F_RunFlags flags, Vec2F32 p, Vec4F32 color, char *fmt, ...);
|
||||
internal void d_truncated_text(F_Tag font, F32 size, F32 base_align_px, F32 tab_size_px, F_RunFlags flags, Vec2F32 p, Vec4F32 color, F32 max_x, String8 string);
|
||||
internal void d_truncated_textf(F_Tag font, F32 size, F32 base_align_px, F32 tab_size_px, F_RunFlags flags, Vec2F32 p, Vec4F32 color, F32 max_x, char *fmt, ...);
|
||||
|
||||
#endif // DRAW_H
|
||||
|
||||
@@ -93,6 +93,7 @@ eval_string2num_map_insert(Arena *arena, EVAL_String2NumMap *map, String8 string
|
||||
SLLQueuePush_N(map->first, map->last, node, order_next);
|
||||
node->string = push_str8_copy(arena, string);
|
||||
node->num = num;
|
||||
map->node_count += 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,6 +122,41 @@ eval_num_from_string(EVAL_String2NumMap *map, String8 string)
|
||||
return num;
|
||||
}
|
||||
|
||||
internal EVAL_String2NumMapNodeArray
|
||||
eval_string2num_map_node_array_from_map(Arena *arena, EVAL_String2NumMap *map)
|
||||
{
|
||||
EVAL_String2NumMapNodeArray result = {0};
|
||||
result.count = map->node_count;
|
||||
result.v = push_array(arena, EVAL_String2NumMapNode *, result.count);
|
||||
U64 idx = 0;
|
||||
for(EVAL_String2NumMapNode *n = map->first; n != 0; n = n->order_next, idx += 1)
|
||||
{
|
||||
result.v[idx] = n;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
internal int
|
||||
eval_string2num_map_node_qsort_compare__num_ascending(EVAL_String2NumMapNode **a, EVAL_String2NumMapNode **b)
|
||||
{
|
||||
int result = 0;
|
||||
if(a[0]->num < b[0]->num)
|
||||
{
|
||||
result = -1;
|
||||
}
|
||||
else if(a[0]->num > b[0]->num)
|
||||
{
|
||||
result = +1;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
internal void
|
||||
eval_string2num_map_node_array_sort__in_place(EVAL_String2NumMapNodeArray *array)
|
||||
{
|
||||
quick_sort(array->v, array->count, sizeof(array->v[0]), eval_string2num_map_node_qsort_compare__num_ascending);
|
||||
}
|
||||
|
||||
//- rjf: string -> expr
|
||||
|
||||
internal EVAL_String2ExprMap
|
||||
|
||||
@@ -144,6 +144,13 @@ struct EVAL_String2NumMapNode
|
||||
U64 num;
|
||||
};
|
||||
|
||||
typedef struct EVAL_String2NumMapNodeArray EVAL_String2NumMapNodeArray;
|
||||
struct EVAL_String2NumMapNodeArray
|
||||
{
|
||||
EVAL_String2NumMapNode **v;
|
||||
U64 count;
|
||||
};
|
||||
|
||||
typedef struct EVAL_String2NumMapSlot EVAL_String2NumMapSlot;
|
||||
struct EVAL_String2NumMapSlot
|
||||
{
|
||||
@@ -155,6 +162,7 @@ typedef struct EVAL_String2NumMap EVAL_String2NumMap;
|
||||
struct EVAL_String2NumMap
|
||||
{
|
||||
U64 slots_count;
|
||||
U64 node_count;
|
||||
EVAL_String2NumMapSlot *slots;
|
||||
EVAL_String2NumMapNode *first;
|
||||
EVAL_String2NumMapNode *last;
|
||||
@@ -210,6 +218,9 @@ internal void eval_error_list_concat_in_place(EVAL_ErrorList *dst, EVAL_ErrorLis
|
||||
internal EVAL_String2NumMap eval_string2num_map_make(Arena *arena, U64 slot_count);
|
||||
internal void eval_string2num_map_insert(Arena *arena, EVAL_String2NumMap *map, String8 string, U64 num);
|
||||
internal U64 eval_num_from_string(EVAL_String2NumMap *map, String8 string);
|
||||
internal EVAL_String2NumMapNodeArray eval_string2num_map_node_array_from_map(Arena *arena, EVAL_String2NumMap *map);
|
||||
internal int eval_string2num_map_node_qsort_compare__num_ascending(EVAL_String2NumMapNode **a, EVAL_String2NumMapNode **b);
|
||||
internal void eval_string2num_map_node_array_sort__in_place(EVAL_String2NumMapNodeArray *array);
|
||||
|
||||
//- rjf: string -> expr
|
||||
internal EVAL_String2ExprMap eval_string2expr_map_make(Arena *arena, U64 slot_count);
|
||||
|
||||
+36
-24
@@ -520,16 +520,18 @@ f_piece_array_copy(Arena *arena, F_PieceArray *src)
|
||||
//~ rjf: Rasterization Cache
|
||||
|
||||
internal F_Hash2StyleRasterCacheNode *
|
||||
f_hash2style_from_tag_size(F_Tag tag, F32 size)
|
||||
f_hash2style_from_tag_size_flags(F_Tag tag, F32 size, F_RunFlags flags)
|
||||
{
|
||||
//- rjf: tag * size -> style hash
|
||||
U64 style_hash = {0};
|
||||
{
|
||||
F64 size_f64 = size;
|
||||
U64 buffer[] =
|
||||
{
|
||||
tag.u64[0],
|
||||
tag.u64[1],
|
||||
(U64)round_f32(size),
|
||||
*(U64 *)(&size_f64),
|
||||
(U64)flags,
|
||||
};
|
||||
style_hash = f_little_hash_from_string(str8((U8 *)buffer, sizeof(buffer)));
|
||||
}
|
||||
@@ -574,11 +576,12 @@ f_push_run_from_string(Arena *arena, F_Tag tag, F32 size, F32 base_align_px, F32
|
||||
ProfBeginFunction();
|
||||
|
||||
//- rjf: map tag/size to style node
|
||||
F_Hash2StyleRasterCacheNode *hash2style_node = f_hash2style_from_tag_size(tag, size);
|
||||
F_Hash2StyleRasterCacheNode *hash2style_node = f_hash2style_from_tag_size_flags(tag, size, flags);
|
||||
|
||||
//- rjf: decode string & produce run pieces
|
||||
F_PieceChunkList piece_chunks = {0};
|
||||
Vec2F32 dim = {0};
|
||||
F32 last_piece_end_pad = 0;
|
||||
B32 font_handle_mapped_on_miss = 0;
|
||||
FP_Handle font_handle = {0};
|
||||
U64 piece_substring_start_idx = 0;
|
||||
@@ -686,7 +689,11 @@ f_push_run_from_string(Arena *arena, F_Tag tag, F32 size, F32 base_align_px, F32
|
||||
}
|
||||
|
||||
// rjf: call into font provider to rasterize this substring
|
||||
FP_RasterResult raster = fp_raster(scratch.arena, font_handle, round_f32(size), FP_RasterMode_Sharp, piece_substring);
|
||||
FP_RasterResult raster = {0};
|
||||
if(size > 0)
|
||||
{
|
||||
raster = fp_raster(scratch.arena, font_handle, floor_f32(size), (flags & F_RunFlag_Smooth) ? FP_RasterMode_Smooth : FP_RasterMode_Sharp, piece_substring);
|
||||
}
|
||||
|
||||
// rjf: allocate portion of an atlas to upload the rasterization
|
||||
S16 chosen_atlas_num = 0;
|
||||
@@ -762,6 +769,7 @@ f_push_run_from_string(Arena *arena, F_Tag tag, F32 size, F32 base_align_px, F32
|
||||
if(info != 0)
|
||||
{
|
||||
info->subrect = chosen_atlas_region;
|
||||
info->bounding_box = raster.bounding_box;
|
||||
info->atlas_num = chosen_atlas_num;
|
||||
info->raster_dim = raster.atlas_dim;
|
||||
info->advance = raster.advance;
|
||||
@@ -814,7 +822,9 @@ f_push_run_from_string(Arena *arena, F_Tag tag, F32 size, F32 base_align_px, F32
|
||||
}
|
||||
base_align_px += advance;
|
||||
dim.x += piece->advance;
|
||||
dim.y = Max(dim.y, dim_2s16(piece->subrect).y);
|
||||
dim.y = Max(dim.y, info->raster_dim.y);
|
||||
last_piece_end_pad = ((F32)piece->offset.x+(F32)dim_2s16(info->bounding_box).x) - piece->advance;
|
||||
last_piece_end_pad = ClampBot(0, last_piece_end_pad);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -832,6 +842,8 @@ f_push_run_from_string(Arena *arena, F_Tag tag, F32 size, F32 base_align_px, F32
|
||||
run.pieces = f_piece_array_from_chunk_list(arena, &piece_chunks);
|
||||
}
|
||||
run.dim = dim;
|
||||
run.dim.x += last_piece_end_pad;
|
||||
run.end_pad = last_piece_end_pad;
|
||||
run.ascent = hash2style_node->ascent;
|
||||
run.descent = hash2style_node->descent;
|
||||
}
|
||||
@@ -991,29 +1003,29 @@ f_column_size_from_tag_size(F_Tag tag, F32 size)
|
||||
internal U64
|
||||
f_char_pos_from_tag_size_string_p(F_Tag tag, F32 size, F32 base_align_px, F32 tab_size_px, String8 string, F32 p)
|
||||
{
|
||||
ProfBeginFunction();
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
U64 result = 0;
|
||||
U64 best_offset = 0;
|
||||
F32 best_distance = -1.f;
|
||||
F32 x = 0;
|
||||
for(U64 char_idx = 0; char_idx <= string.size; char_idx += 1)
|
||||
U64 best_offset_bytes = 0;
|
||||
F32 best_offset_px = inf32();
|
||||
U64 offset_bytes = 0;
|
||||
F32 offset_px = 0.f;
|
||||
F_Run run = f_push_run_from_string(scratch.arena, tag, size, base_align_px, tab_size_px, 0, string);
|
||||
for(U64 idx = 0; idx <= run.pieces.count; idx += 1)
|
||||
{
|
||||
F32 this_char_distance = abs_f32(p - x);
|
||||
if(this_char_distance < best_distance || best_distance < 0.f)
|
||||
F32 this_piece_offset_px = abs_f32(offset_px - p);
|
||||
if(this_piece_offset_px < best_offset_px)
|
||||
{
|
||||
best_offset = char_idx;
|
||||
best_distance = this_char_distance;
|
||||
best_offset_bytes = offset_bytes;
|
||||
best_offset_px = this_piece_offset_px;
|
||||
}
|
||||
if(char_idx < string.size)
|
||||
if(idx < run.pieces.count)
|
||||
{
|
||||
x += f_dim_from_tag_size_string(tag, size, base_align_px, tab_size_px, str8_substr(string, r1u64(char_idx, char_idx+1))).x;
|
||||
F_Piece *piece = &run.pieces.v[idx];
|
||||
offset_px += piece->advance;
|
||||
offset_bytes += piece->decode_size;
|
||||
}
|
||||
}
|
||||
result = best_offset;
|
||||
scratch_end(scratch);
|
||||
ProfEnd();
|
||||
return result;
|
||||
return best_offset_bytes;
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
@@ -1026,10 +1038,10 @@ f_metrics_from_tag_size(F_Tag tag, F32 size)
|
||||
FP_Metrics metrics = f_fp_metrics_from_tag(tag);
|
||||
F_Metrics result = {0};
|
||||
{
|
||||
result.ascent = size * metrics.ascent / metrics.design_units_per_em;
|
||||
result.descent = size * metrics.descent / metrics.design_units_per_em;
|
||||
result.line_gap = size * metrics.line_gap / metrics.design_units_per_em;
|
||||
result.capital_height = size * metrics.capital_height / metrics.design_units_per_em;
|
||||
result.ascent = floor_f32(size) * metrics.ascent / metrics.design_units_per_em;
|
||||
result.descent = floor_f32(size) * metrics.descent / metrics.design_units_per_em;
|
||||
result.line_gap = floor_f32(size) * metrics.line_gap / metrics.design_units_per_em;
|
||||
result.capital_height = floor_f32(size) * metrics.capital_height / metrics.design_units_per_em;
|
||||
}
|
||||
ProfEnd();
|
||||
return result;
|
||||
|
||||
@@ -71,6 +71,7 @@ struct F_Run
|
||||
{
|
||||
F_PieceArray pieces;
|
||||
Vec2F32 dim;
|
||||
F32 end_pad;
|
||||
F32 ascent;
|
||||
F32 descent;
|
||||
};
|
||||
@@ -102,6 +103,7 @@ typedef struct F_RasterCacheInfo F_RasterCacheInfo;
|
||||
struct F_RasterCacheInfo
|
||||
{
|
||||
Rng2S16 subrect;
|
||||
Rng2S16 bounding_box;
|
||||
Vec2S16 raster_dim;
|
||||
S16 atlas_num;
|
||||
F32 advance;
|
||||
@@ -247,7 +249,7 @@ internal F_PieceArray f_piece_array_copy(Arena *arena, F_PieceArray *src);
|
||||
////////////////////////////////
|
||||
//~ rjf: Rasterization Cache
|
||||
|
||||
internal F_Hash2StyleRasterCacheNode *f_hash2style_from_tag_size(F_Tag tag, F32 size);
|
||||
internal F_Hash2StyleRasterCacheNode *f_hash2style_from_tag_size_flags(F_Tag tag, F32 size, F_RunFlags flags);
|
||||
internal F_Run f_push_run_from_string(Arena *arena, F_Tag tag, F32 size, F32 base_align_px, F32 tab_size_px, F_RunFlags flags, String8 string);
|
||||
internal String8List f_wrapped_string_lines_from_font_size_string_max(Arena *arena, F_Tag font, F32 size, F32 base_align_px, F32 tab_size_px, String8 string, F32 max);
|
||||
internal Vec2F32 f_dim_from_tag_size_string(F_Tag tag, F32 size, F32 base_align_px, F32 tab_size_px, String8 string);
|
||||
|
||||
@@ -172,7 +172,15 @@ fp_init(void)
|
||||
}
|
||||
|
||||
//- rjf: make dwrite factory
|
||||
error = DWriteCreateFactory(DWRITE_FACTORY_TYPE_SHARED, &IID_IDWriteFactory, (void **)&fp_dwrite_state->factory);
|
||||
error = DWriteCreateFactory(DWRITE_FACTORY_TYPE_SHARED, &IID_IDWriteFactory2, (void **)&fp_dwrite_state->factory);
|
||||
if(error == S_OK)
|
||||
{
|
||||
fp_dwrite_state->dwrite2_is_supported = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
error = DWriteCreateFactory(DWRITE_FACTORY_TYPE_SHARED, &IID_IDWriteFactory, (void **)&fp_dwrite_state->factory);
|
||||
}
|
||||
|
||||
//- rjf: register static data font "loader" interface
|
||||
error = IDWriteFactory_RegisterFontFileLoader(fp_dwrite_state->factory, (IDWriteFontFileLoader *)&fp_dwrite_static_data_font_file_loader);
|
||||
@@ -182,28 +190,58 @@ fp_init(void)
|
||||
|
||||
//- rjf: make sharp rendering params
|
||||
{
|
||||
FLOAT gamma = 1.f;
|
||||
FLOAT gamma = IDWriteRenderingParams_GetGamma(fp_dwrite_state->base_rendering_params);
|
||||
FLOAT enhanced_contrast = IDWriteRenderingParams_GetEnhancedContrast(fp_dwrite_state->base_rendering_params);
|
||||
// FLOAT clear_type_level = fp_dwrite_state->base_rendering_params->GetClearTypeLevel();
|
||||
error = IDWriteFactory_CreateCustomRenderingParams(fp_dwrite_state->factory, gamma,
|
||||
enhanced_contrast,
|
||||
2.f,
|
||||
DWRITE_PIXEL_GEOMETRY_FLAT,
|
||||
DWRITE_RENDERING_MODE_GDI_NATURAL,
|
||||
&fp_dwrite_state->rendering_params[FP_RasterMode_Sharp]);
|
||||
if(fp_dwrite_state->dwrite2_is_supported)
|
||||
{
|
||||
error = IDWriteFactory2_CreateCustomRenderingParams2((IDWriteFactory2 *)fp_dwrite_state->factory,
|
||||
gamma,
|
||||
enhanced_contrast,
|
||||
enhanced_contrast,
|
||||
0.f,
|
||||
DWRITE_PIXEL_GEOMETRY_FLAT,
|
||||
DWRITE_RENDERING_MODE_GDI_NATURAL,
|
||||
DWRITE_GRID_FIT_MODE_ENABLED,
|
||||
(IDWriteRenderingParams2 **)&fp_dwrite_state->rendering_params[FP_RasterMode_Sharp]);
|
||||
}
|
||||
else
|
||||
{
|
||||
error = IDWriteFactory_CreateCustomRenderingParams(fp_dwrite_state->factory,
|
||||
gamma,
|
||||
enhanced_contrast,
|
||||
0.f,
|
||||
DWRITE_PIXEL_GEOMETRY_FLAT,
|
||||
DWRITE_RENDERING_MODE_GDI_NATURAL,
|
||||
&fp_dwrite_state->rendering_params[FP_RasterMode_Sharp]);
|
||||
}
|
||||
}
|
||||
|
||||
//- rjf: make smooth rendering params
|
||||
{
|
||||
FLOAT gamma = 1.f;
|
||||
FLOAT enhanced_contrast = IDWriteRenderingParams_GetEnhancedContrast(fp_dwrite_state->base_rendering_params);
|
||||
// FLOAT clear_type_level = fp_dwrite_state->base_rendering_params->GetClearTypeLevel();
|
||||
error = IDWriteFactory_CreateCustomRenderingParams(fp_dwrite_state->factory, gamma,
|
||||
enhanced_contrast,
|
||||
2.f,
|
||||
DWRITE_PIXEL_GEOMETRY_FLAT,
|
||||
DWRITE_RENDERING_MODE_NATURAL_SYMMETRIC,
|
||||
&fp_dwrite_state->rendering_params[FP_RasterMode_Smooth]);
|
||||
FLOAT enhanced_contrast = 0.f;
|
||||
if(fp_dwrite_state->dwrite2_is_supported)
|
||||
{
|
||||
error = IDWriteFactory2_CreateCustomRenderingParams2((IDWriteFactory2 *)fp_dwrite_state->factory,
|
||||
gamma,
|
||||
enhanced_contrast,
|
||||
enhanced_contrast,
|
||||
0.f,
|
||||
DWRITE_PIXEL_GEOMETRY_FLAT,
|
||||
DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL_SYMMETRIC,
|
||||
DWRITE_GRID_FIT_MODE_DISABLED,
|
||||
(IDWriteRenderingParams2 **)&fp_dwrite_state->rendering_params[FP_RasterMode_Smooth]);
|
||||
}
|
||||
else
|
||||
{
|
||||
error = IDWriteFactory_CreateCustomRenderingParams(fp_dwrite_state->factory,
|
||||
gamma,
|
||||
enhanced_contrast,
|
||||
0.f,
|
||||
DWRITE_PIXEL_GEOMETRY_FLAT,
|
||||
DWRITE_RENDERING_MODE_NATURAL_SYMMETRIC,
|
||||
&fp_dwrite_state->rendering_params[FP_RasterMode_Smooth]);
|
||||
}
|
||||
}
|
||||
|
||||
//- rjf: make dwrite gdi interop
|
||||
@@ -414,8 +452,8 @@ fp_raster(Arena *arena, FP_Handle font_handle, F32 size, FP_RasterMode mode, Str
|
||||
// rjf: fill basics
|
||||
result.atlas_dim = atlas_dim;
|
||||
result.atlas = push_array_no_zero(arena, U8, atlas_dim.x*atlas_dim.y*4);
|
||||
result.advance = advance;
|
||||
result.height = bounding_box.bottom + 1.f;
|
||||
result.advance = floor_f32(advance);
|
||||
result.bounding_box = r2s16p(bounding_box.left, bounding_box.top, bounding_box.right, bounding_box.bottom);
|
||||
|
||||
// rjf: fill atlas
|
||||
{
|
||||
|
||||
@@ -88,6 +88,12 @@ typedef enum DWRITE_FONT_FACE_TYPE {
|
||||
DWRITE_FONT_FACE_TYPE_TRUETYPE_COLLECTION = 2,
|
||||
} DWRITE_FONT_FACE_TYPE;
|
||||
|
||||
typedef enum DWRITE_GRID_FIT_MODE {
|
||||
DWRITE_GRID_FIT_MODE_DEFAULT = 0,
|
||||
DWRITE_GRID_FIT_MODE_DISABLED = 1,
|
||||
DWRITE_GRID_FIT_MODE_ENABLED = 2,
|
||||
} DWRITE_GRID_FIT_MODE;
|
||||
|
||||
//- rjf: interfaces
|
||||
|
||||
typedef struct IDWriteFactory { struct { void* tbl[]; }* v; } IDWriteFactory;
|
||||
@@ -173,13 +179,15 @@ static inline HRESULT IDWriteFactory_CreateRenderingPa
|
||||
static inline HRESULT IDWriteFactory_CreateCustomRenderingParams (IDWriteFactory* this_, FLOAT gamma, FLOAT enhancedContrast, FLOAT clearTypeLevel, DWRITE_PIXEL_GEOMETRY pixelGeometry, DWRITE_RENDERING_MODE renderingMode, IDWriteRenderingParams** renderingParams) { return ((HRESULT (WINAPI*)(IDWriteFactory*, FLOAT, FLOAT, FLOAT, DWRITE_PIXEL_GEOMETRY, DWRITE_RENDERING_MODE, IDWriteRenderingParams**))this_->v->tbl[12])(this_, gamma, enhancedContrast, clearTypeLevel, pixelGeometry, renderingMode, renderingParams); }
|
||||
static inline HRESULT IDWriteFactory_GetGdiInterop (IDWriteFactory* this_, IDWriteGdiInterop** gdiInterop) { return ((HRESULT (WINAPI*)(IDWriteFactory*, IDWriteGdiInterop**))this_->v->tbl[17])(this_, gdiInterop); }
|
||||
static inline HRESULT IDWriteFactory_CreateCustomFontFileReference (IDWriteFactory* this_, const void* fontFileReferenceKey, UINT32 fontFileReferenceKeySize, IDWriteFontFileLoader* fontFileLoader, IDWriteFontFile** fontFile) { return ((HRESULT (WINAPI*)(IDWriteFactory*, const void*, UINT32, IDWriteFontFileLoader*, IDWriteFontFile**))this_->v->tbl[8])(this_, fontFileReferenceKey, fontFileReferenceKeySize, fontFileLoader, fontFile); }
|
||||
static inline FLOAT IDWriteRenderingParams_GetEnhancedContrast (IDWriteRenderingParams* this__) { return ((FLOAT (WINAPI*)(IDWriteRenderingParams*))this__->v->tbl[4])(this__); }
|
||||
static inline HRESULT IDWriteFactory_CreateFontFileReference (IDWriteFactory* this_, const WCHAR* filePath, const FILETIME* lastWriteTime, IDWriteFontFile** fontFile) { return ((HRESULT (WINAPI*)(IDWriteFactory*, const WCHAR*, const FILETIME*, IDWriteFontFile**))this_->v->tbl[7])(this_, filePath, lastWriteTime, fontFile); }
|
||||
static inline HRESULT IDWriteFactory_CreateFontFace (IDWriteFactory* this_, DWRITE_FONT_FACE_TYPE fontFaceType, UINT32 numberOfFiles, IDWriteFontFile** fontFiles, UINT32 faceIndex, DWRITE_FONT_SIMULATIONS fontFaceSimulationFlags, IDWriteFontFace** fontFace) { return ((HRESULT (WINAPI*)(IDWriteFactory*, DWRITE_FONT_FACE_TYPE, UINT32, IDWriteFontFile**, UINT32, DWRITE_FONT_SIMULATIONS, IDWriteFontFace**))this_->v->tbl[9])(this_, fontFaceType, numberOfFiles, fontFiles, faceIndex, fontFaceSimulationFlags, fontFace); }
|
||||
static inline HRESULT IDWriteFactory2_CreateCustomRenderingParams2 (IDWriteFactory2* this, FLOAT gamma, FLOAT enhancedContrast, FLOAT grayscaleEnhancedContrast, FLOAT clearTypeLevel, DWRITE_PIXEL_GEOMETRY pixelGeometry, DWRITE_RENDERING_MODE renderingMode, DWRITE_GRID_FIT_MODE gridFitMode, IDWriteRenderingParams2** renderingParams) { return ((HRESULT (WINAPI*)(IDWriteFactory2*, FLOAT, FLOAT, FLOAT, FLOAT, DWRITE_PIXEL_GEOMETRY, DWRITE_RENDERING_MODE, DWRITE_GRID_FIT_MODE, IDWriteRenderingParams2**))this->v->tbl[29])(this, gamma, enhancedContrast, grayscaleEnhancedContrast, clearTypeLevel, pixelGeometry, renderingMode, gridFitMode, renderingParams); }
|
||||
static inline FLOAT IDWriteRenderingParams_GetEnhancedContrast (IDWriteRenderingParams* this_) { return ((FLOAT (WINAPI*)(IDWriteRenderingParams*))this_->v->tbl[4])(this_); }
|
||||
static inline FLOAT IDWriteRenderingParams_GetGamma (IDWriteRenderingParams* this_) { return ((FLOAT (WINAPI*)(IDWriteRenderingParams*))this_->v->tbl[3])(this_); }
|
||||
static inline HRESULT IDWriteGdiInterop_CreateBitmapRenderTarget (IDWriteGdiInterop* this_, HDC hdc, UINT32 width, UINT32 height, IDWriteBitmapRenderTarget** renderTarget) { return ((HRESULT (WINAPI*)(IDWriteGdiInterop*, HDC, UINT32, UINT32, IDWriteBitmapRenderTarget**))this_->v->tbl[7])(this_, hdc, width, height, renderTarget); }
|
||||
static inline HRESULT IDWriteBitmapRenderTarget_SetPixelsPerDip (IDWriteBitmapRenderTarget* this_, FLOAT pixelsPerDip) { return ((HRESULT (WINAPI*)(IDWriteBitmapRenderTarget*, FLOAT))this_->v->tbl[6])(this_, pixelsPerDip); }
|
||||
static inline HDC IDWriteBitmapRenderTarget_GetMemoryDC (IDWriteBitmapRenderTarget* this_) { return ((HDC (WINAPI*)(IDWriteBitmapRenderTarget*))this_->v->tbl[4])(this_); }
|
||||
static inline HRESULT IDWriteBitmapRenderTarget_DrawGlyphRun (IDWriteBitmapRenderTarget* this_, FLOAT baselineOriginX, FLOAT baselineOriginY, DWRITE_MEASURING_MODE measuringMode, const DWRITE_GLYPH_RUN* glyphRun, IDWriteRenderingParams* renderingParams, COLORREF textColor, RECT* blackBoxRect) { return ((HRESULT (WINAPI*)(IDWriteBitmapRenderTarget*, FLOAT, FLOAT, DWRITE_MEASURING_MODE, const DWRITE_GLYPH_RUN*, IDWriteRenderingParams*, COLORREF, RECT*))this_->v->tbl[3])(this_, baselineOriginX, baselineOriginY, measuringMode, glyphRun, renderingParams, textColor, blackBoxRect); }
|
||||
static inline HRESULT IDWriteFactory_CreateFontFileReference (IDWriteFactory* this_, const WCHAR* filePath, const FILETIME* lastWriteTime, IDWriteFontFile** fontFile) { return ((HRESULT (WINAPI*)(IDWriteFactory*, const WCHAR*, const FILETIME*, IDWriteFontFile**))this_->v->tbl[7])(this_, filePath, lastWriteTime, fontFile); }
|
||||
static inline HRESULT IDWriteFactory_CreateFontFace (IDWriteFactory* this_, DWRITE_FONT_FACE_TYPE fontFaceType, UINT32 numberOfFiles, IDWriteFontFile** fontFiles, UINT32 faceIndex, DWRITE_FONT_SIMULATIONS fontFaceSimulationFlags, IDWriteFontFace** fontFace) { return ((HRESULT (WINAPI*)(IDWriteFactory*, DWRITE_FONT_FACE_TYPE, UINT32, IDWriteFontFile**, UINT32, DWRITE_FONT_SIMULATIONS, IDWriteFontFace**))this_->v->tbl[9])(this_, fontFaceType, numberOfFiles, fontFiles, faceIndex, fontFaceSimulationFlags, fontFace); }
|
||||
static inline UINT32 IDWriteFontFace_Release (IDWriteFontFace* this_) { return ((UINT32 (WINAPI*)(IDWriteFontFace*))this_->v->tbl[2])(this_); }
|
||||
static inline void IDWriteFontFace_GetMetrics (IDWriteFontFace* this_, DWRITE_FONT_METRICS* fontFaceMetrics) { ((void (WINAPI*)(IDWriteFontFace*, DWRITE_FONT_METRICS*))this_->v->tbl[8])(this_, fontFaceMetrics); }
|
||||
static inline UINT32 IDWriteFontFile_Release (IDWriteFontFile* this_) { return ((UINT32 (WINAPI*)(IDWriteFontFile*))this_->v->tbl[2])(this_); }
|
||||
@@ -244,6 +252,7 @@ typedef struct FP_DWrite_State FP_DWrite_State;
|
||||
struct FP_DWrite_State
|
||||
{
|
||||
Arena *arena;
|
||||
B32 dwrite2_is_supported;
|
||||
IDWriteFactory *factory;
|
||||
IDWriteRenderingParams *base_rendering_params;
|
||||
IDWriteRenderingParams *rendering_params[FP_RasterMode_COUNT];
|
||||
|
||||
@@ -39,7 +39,7 @@ struct FP_RasterResult
|
||||
Vec2S16 atlas_dim;
|
||||
void *atlas;
|
||||
F32 advance;
|
||||
S16 height;
|
||||
Rng2S16 bounding_box;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
|
||||
@@ -517,7 +517,7 @@ fzy_search_thread__entry_point(void *p)
|
||||
//- rjf: sort item array
|
||||
if(items.count != 0 && query.size != 0)
|
||||
{
|
||||
qsort(items.v, items.count, sizeof(FZY_Item), (int (*)(const void *, const void *))fzy_qsort_compare_items);
|
||||
quick_sort(items.v, items.count, sizeof(FZY_Item), fzy_qsort_compare_items);
|
||||
}
|
||||
|
||||
//- rjf: commit to cache - busyloop on scope touches
|
||||
|
||||
@@ -14,7 +14,10 @@ internal U128
|
||||
hs_hash_from_data(String8 data)
|
||||
{
|
||||
U128 u128 = {0};
|
||||
blake2b((U8 *)&u128.u64[0], sizeof(u128), data.str, data.size, 0, 0);
|
||||
if(data.size != 0)
|
||||
{
|
||||
blake2b((U8 *)&u128.u64[0], sizeof(u128), data.str, data.size, 0, 0);
|
||||
}
|
||||
return u128;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,142 @@
|
||||
// Copyright (c) 2024 Epic Games Tools
|
||||
// Licensed under the MIT license (https://opensource.org/license/mit/)
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Main Layer Initialization
|
||||
|
||||
internal void
|
||||
mtx_init(void)
|
||||
{
|
||||
Arena *arena = arena_alloc();
|
||||
mtx_shared = push_array(arena, MTX_Shared, 1);
|
||||
mtx_shared->arena = arena;
|
||||
mtx_shared->slots_count = 256;
|
||||
mtx_shared->stripes_count = Min(mtx_shared->slots_count, os_logical_core_count());
|
||||
mtx_shared->slots = push_array(arena, MTX_Slot, mtx_shared->slots_count);
|
||||
mtx_shared->stripes = push_array(arena, MTX_Stripe, mtx_shared->stripes_count);
|
||||
for(U64 idx = 0; idx < mtx_shared->stripes_count; idx += 1)
|
||||
{
|
||||
mtx_shared->stripes[idx].arena = arena_alloc();
|
||||
mtx_shared->stripes[idx].rw_mutex = os_rw_mutex_alloc();
|
||||
}
|
||||
mtx_shared->mut_threads_count = Min(os_logical_core_count(), 4);
|
||||
mtx_shared->mut_threads = push_array(arena, MTX_MutThread, mtx_shared->mut_threads_count);
|
||||
for(U64 idx = 0; idx < mtx_shared->mut_threads_count; idx += 1)
|
||||
{
|
||||
mtx_shared->mut_threads[idx].ring_size = KB(64);
|
||||
mtx_shared->mut_threads[idx].ring_base = push_array_no_zero(arena, U8, mtx_shared->mut_threads[idx].ring_size);
|
||||
mtx_shared->mut_threads[idx].cv = os_condition_variable_alloc();
|
||||
mtx_shared->mut_threads[idx].mutex = os_mutex_alloc();
|
||||
mtx_shared->mut_threads[idx].thread = os_launch_thread(mtx_mut_thread__entry_point, &mtx_shared->mut_threads[idx], 0);
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Buffer Operations
|
||||
|
||||
internal void
|
||||
mtx_push_op(U128 buffer_key, MTX_Op op)
|
||||
{
|
||||
MTX_MutThread *thread = &mtx_shared->mut_threads[buffer_key.u64[1]%mtx_shared->mut_threads_count];
|
||||
mtx_enqueue_op(thread, buffer_key, op);
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Mutation Threads
|
||||
|
||||
internal void
|
||||
mtx_enqueue_op(MTX_MutThread *thread, U128 buffer_key, MTX_Op op)
|
||||
{
|
||||
// TODO(rjf): if op.replace is too big, need to split into multiple edits
|
||||
OS_MutexScope(thread->mutex) for(;;)
|
||||
{
|
||||
U64 unconsumed_size = thread->ring_write_pos - thread->ring_read_pos;
|
||||
U64 available_size = thread->ring_size - unconsumed_size;
|
||||
if(available_size >= sizeof(buffer_key) + sizeof(op.range) + sizeof(op.replace.size) + op.replace.size)
|
||||
{
|
||||
thread->ring_write_pos += ring_write_struct(thread->ring_base, thread->ring_size, thread->ring_write_pos, &buffer_key);
|
||||
thread->ring_write_pos += ring_write_struct(thread->ring_base, thread->ring_size, thread->ring_write_pos, &op.range);
|
||||
thread->ring_write_pos += ring_write_struct(thread->ring_base, thread->ring_size, thread->ring_write_pos, &op.replace.size);
|
||||
thread->ring_write_pos += ring_write(thread->ring_base, thread->ring_size, thread->ring_write_pos, op.replace.str, op.replace.size);
|
||||
thread->ring_write_pos += 7;
|
||||
thread->ring_write_pos -= thread->ring_write_pos%8;
|
||||
break;
|
||||
}
|
||||
os_condition_variable_wait(thread->cv, thread->mutex, max_U64);
|
||||
}
|
||||
os_condition_variable_broadcast(thread->cv);
|
||||
}
|
||||
|
||||
internal void
|
||||
mtx_dequeue_op(Arena *arena, MTX_MutThread *thread, U128 *buffer_key_out, MTX_Op *op_out)
|
||||
{
|
||||
OS_MutexScope(thread->mutex) for(;;)
|
||||
{
|
||||
U64 unconsumed_size = thread->ring_write_pos - thread->ring_read_pos;
|
||||
if(unconsumed_size >= sizeof(*buffer_key_out) + sizeof(op_out->range) + sizeof(op_out->replace.size))
|
||||
{
|
||||
thread->ring_read_pos += ring_read_struct(thread->ring_base, thread->ring_size, thread->ring_read_pos, buffer_key_out);
|
||||
thread->ring_read_pos += ring_read_struct(thread->ring_base, thread->ring_size, thread->ring_read_pos, &op_out->range);
|
||||
thread->ring_read_pos += ring_read_struct(thread->ring_base, thread->ring_size, thread->ring_read_pos, &op_out->replace.size);
|
||||
op_out->replace.str = push_array_no_zero(arena, U8, op_out->replace.size);
|
||||
thread->ring_read_pos += ring_read(thread->ring_base, thread->ring_size, thread->ring_read_pos, op_out->replace.str, op_out->replace.size);
|
||||
thread->ring_read_pos += 7;
|
||||
thread->ring_read_pos -= thread->ring_read_pos%8;
|
||||
break;
|
||||
}
|
||||
os_condition_variable_wait(thread->cv, thread->mutex, max_U64);
|
||||
}
|
||||
os_condition_variable_broadcast(thread->cv);
|
||||
}
|
||||
|
||||
internal void
|
||||
mtx_mut_thread__entry_point(void *p)
|
||||
{
|
||||
MTX_MutThread *mut_thread = (MTX_MutThread *)p;
|
||||
ThreadNameF("[mtx] mut thread #%I64u", (U64)(mut_thread - mtx_shared->mut_threads));
|
||||
for(;;)
|
||||
{
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
HS_Scope *hs_scope = hs_scope_open();
|
||||
|
||||
//- rjf: get next op
|
||||
U128 buffer_key = {0};
|
||||
MTX_Op op = {0};
|
||||
mtx_dequeue_op(scratch.arena, mut_thread, &buffer_key, &op);
|
||||
|
||||
//- rjf: get buffer's current data
|
||||
U128 hash = hs_hash_from_key(buffer_key, 0);
|
||||
String8 data = hs_data_from_hash(hs_scope, hash);
|
||||
|
||||
//- rjf: clamp op by data
|
||||
op.range.min = Min(op.range.min, data.size);
|
||||
op.range.max = Min(op.range.max, data.size);
|
||||
|
||||
//- rjf: construct new buffer
|
||||
if(op.range.max != op.range.min || op.replace.size != 0)
|
||||
{
|
||||
U64 new_data_size = data.size + op.replace.size - dim_1u64(op.range);
|
||||
Arena *arena = arena_alloc__sized(new_data_size + ARENA_HEADER_SIZE, new_data_size + ARENA_HEADER_SIZE);
|
||||
U8 *new_data_base = push_array_no_zero(arena, U8, new_data_size);
|
||||
String8 pre_replace_data = str8_substr(data, r1u64(0, op.range.min));
|
||||
String8 post_replace_data = str8_substr(data, r1u64(op.range.max, data.size));
|
||||
if(pre_replace_data.size != 0)
|
||||
{
|
||||
MemoryCopy(new_data_base+0, pre_replace_data.str, pre_replace_data.size);
|
||||
}
|
||||
if(op.replace.size != 0)
|
||||
{
|
||||
MemoryCopy(new_data_base+pre_replace_data.size, op.replace.str, op.replace.size);
|
||||
}
|
||||
if(post_replace_data.size != 0)
|
||||
{
|
||||
MemoryCopy(new_data_base+pre_replace_data.size+op.replace.size, post_replace_data.str, post_replace_data.size);
|
||||
}
|
||||
String8 new_data = str8(new_data_base, new_data_size);
|
||||
hs_submit_data(buffer_key, &arena, new_data);
|
||||
}
|
||||
|
||||
hs_scope_close(hs_scope);
|
||||
scratch_end(scratch);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
// Copyright (c) 2024 Epic Games Tools
|
||||
// Licensed under the MIT license (https://opensource.org/license/mit/)
|
||||
|
||||
#ifndef MUTABLE_TEXT_H
|
||||
#define MUTABLE_TEXT_H
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Cache Types
|
||||
|
||||
typedef struct MTX_Node MTX_Node;
|
||||
struct MTX_Node
|
||||
{
|
||||
MTX_Node *next;
|
||||
MTX_Node *prev;
|
||||
U128 key;
|
||||
};
|
||||
|
||||
typedef struct MTX_Slot MTX_Slot;
|
||||
struct MTX_Slot
|
||||
{
|
||||
MTX_Node *first;
|
||||
MTX_Node *last;
|
||||
};
|
||||
|
||||
typedef struct MTX_Stripe MTX_Stripe;
|
||||
struct MTX_Stripe
|
||||
{
|
||||
Arena *arena;
|
||||
MTX_Node *free_node;
|
||||
OS_Handle rw_mutex;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Mutation Thread Types
|
||||
|
||||
typedef struct MTX_Op MTX_Op;
|
||||
struct MTX_Op
|
||||
{
|
||||
Rng1U64 range;
|
||||
String8 replace;
|
||||
};
|
||||
|
||||
typedef struct MTX_MutThread MTX_MutThread;
|
||||
struct MTX_MutThread
|
||||
{
|
||||
U64 ring_size;
|
||||
U8 *ring_base;
|
||||
U64 ring_read_pos;
|
||||
U64 ring_write_pos;
|
||||
OS_Handle cv;
|
||||
OS_Handle mutex;
|
||||
OS_Handle thread;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Shared State
|
||||
|
||||
typedef struct MTX_Shared MTX_Shared;
|
||||
struct MTX_Shared
|
||||
{
|
||||
Arena *arena;
|
||||
|
||||
// rjf: buffer cache
|
||||
U64 slots_count;
|
||||
U64 stripes_count;
|
||||
MTX_Slot *slots;
|
||||
MTX_Stripe *stripes;
|
||||
|
||||
// rjf: mut threads
|
||||
U64 mut_threads_count;
|
||||
MTX_MutThread *mut_threads;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Globals
|
||||
|
||||
global MTX_Shared *mtx_shared = 0;
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Main Layer Initialization
|
||||
|
||||
internal void mtx_init(void);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Buffer Operations
|
||||
|
||||
internal void mtx_push_op(U128 buffer_key, MTX_Op op);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Mutation Threads
|
||||
|
||||
internal void mtx_enqueue_op(MTX_MutThread *thread, U128 buffer_key, MTX_Op op);
|
||||
internal void mtx_dequeue_op(Arena *arena, MTX_MutThread *thread, U128 *buffer_key_out, MTX_Op *op_out);
|
||||
internal void mtx_mut_thread__entry_point(void *p);
|
||||
|
||||
#endif // MUTABLE_TEXT_H
|
||||
+6
-1
@@ -170,8 +170,13 @@ internal F32 os_caret_blink_time(void);
|
||||
internal F32 os_default_refresh_rate(void);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: @os_hooks Native Messages & Panics (Implemented Per-OS)
|
||||
//~ rjf: @os_hooks Native User-Facing Graphical Messages (Implemented Per-OS)
|
||||
|
||||
internal void os_graphical_message(B32 error, String8 title, String8 message);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: @os_hooks Shell Operations
|
||||
|
||||
internal void os_show_in_filesystem_ui(String8 path);
|
||||
|
||||
#endif // OS_GRAPHICAL_H
|
||||
|
||||
@@ -240,9 +240,17 @@ os_granular_sleep_enabled(void)
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: @os_hooks Native Messages & Panics (Implemented Per-OS)
|
||||
//~ rjf: @os_hooks Native User-Facing Graphical Messages (Implemented Per-OS)
|
||||
|
||||
internal void
|
||||
os_graphical_message(B32 error, String8 title, String8 message)
|
||||
{
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: @os_hooks Shell Operations
|
||||
|
||||
internal void
|
||||
os_show_in_filesystem_ui(String8 path)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -1421,7 +1421,7 @@ os_default_refresh_rate(void)
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: @os_hooks Native Messages & Panics (Implemented Per-OS)
|
||||
//~ rjf: @os_hooks Native User-Facing Graphical Messages (Implemented Per-OS)
|
||||
|
||||
internal void
|
||||
os_graphical_message(B32 error, String8 title, String8 message)
|
||||
@@ -1432,3 +1432,30 @@ os_graphical_message(B32 error, String8 title, String8 message)
|
||||
MessageBoxW(0, (WCHAR *)message16.str, (WCHAR *)title16.str, MB_OK|(!!error*MB_ICONERROR));
|
||||
scratch_end(scratch);
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: @os_hooks Shell Operations
|
||||
|
||||
internal void
|
||||
os_show_in_filesystem_ui(String8 path)
|
||||
{
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
String8 path_copy = push_str8_copy(scratch.arena, path);
|
||||
for(U64 idx = 0; idx < path_copy.size; idx += 1)
|
||||
{
|
||||
if(path_copy.str[idx] == '/')
|
||||
{
|
||||
path_copy.str[idx] = '\\';
|
||||
}
|
||||
}
|
||||
String16 path16 = str16_from_8(scratch.arena, path_copy);
|
||||
SFGAOF flags = 0;
|
||||
PIDLIST_ABSOLUTE list = 0;
|
||||
if(path16.size != 0 && SUCCEEDED(SHParseDisplayName(path16.str, 0, &list, 0, &flags)))
|
||||
{
|
||||
HRESULT hr = SHOpenFolderAndSelectItems(list, 0, 0, 0);
|
||||
CoTaskMemFree(list);
|
||||
(void)hr;
|
||||
}
|
||||
scratch_end(scratch);
|
||||
}
|
||||
|
||||
+6
-13
@@ -77,14 +77,6 @@ update_and_render(OS_Handle repaint_window_handle, void *user_data)
|
||||
//
|
||||
F32 dt = 1.f/target_hz;
|
||||
|
||||
//////////////////////////////
|
||||
//- rjf: last frame before sleep -> disable txti change detection
|
||||
//
|
||||
if(df_gfx_state->num_frames_requested == 0)
|
||||
{
|
||||
txti_set_external_change_detection_enabled(0);
|
||||
}
|
||||
|
||||
//////////////////////////////
|
||||
//- rjf: get events from the OS
|
||||
//
|
||||
@@ -94,11 +86,6 @@ update_and_render(OS_Handle repaint_window_handle, void *user_data)
|
||||
events = os_get_events(scratch.arena, df_gfx_state->num_frames_requested == 0);
|
||||
}
|
||||
|
||||
//////////////////////////////
|
||||
//- rjf: enable txti change detection
|
||||
//
|
||||
txti_set_external_change_detection_enabled(1);
|
||||
|
||||
//////////////////////////////
|
||||
//- rjf: begin measuring actual per-frame work
|
||||
//
|
||||
@@ -343,7 +330,13 @@ update_and_render(OS_Handle repaint_window_handle, void *user_data)
|
||||
d_begin_frame();
|
||||
for(DF_Window *w = df_gfx_state->first_window; w != 0; w = w->next)
|
||||
{
|
||||
df_push_interact_regs();
|
||||
df_window_update_and_render(scratch.arena, w, &cmds);
|
||||
DF_InteractRegs *window_regs = df_pop_interact_regs();
|
||||
if(os_window_is_focused(w->os))
|
||||
{
|
||||
MemoryCopyStruct(df_interact_regs(), window_regs);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+122
-100
@@ -4,20 +4,28 @@
|
||||
////////////////////////////////
|
||||
//~ rjf: Frontend/UI Pass Tasks
|
||||
//
|
||||
// [ ] mouse-driven way to complete file/folder selection, or more generally
|
||||
// query completion
|
||||
// [ ] display threads at their last exception address, rather than current
|
||||
// rip, if applicable
|
||||
//
|
||||
// [ ] auto-scroll output window
|
||||
// [ ] inline breakpoint hit_count
|
||||
// [ ] to count hit counts, resolve all bps to addresses, check addresses
|
||||
// against stopper thread's
|
||||
// [ ] editing multiple bindings for commands
|
||||
// [ ] theme lister -> fonts & font sizes
|
||||
// [ ] "Browse..." buttons should adopt a more relevant starting search path,
|
||||
// if possible
|
||||
// [ ] move breakpoints to being a global thing, not nested to particular files
|
||||
// [ ] visualize all breakpoints everywhere - source view should show up in
|
||||
// disasm, disasm should show up in source view, function should show up in
|
||||
// both, etc.
|
||||
// [ ] ** Function breakpoints should show up in the source listing. Without
|
||||
// them being visible, it is confusing when you run and you stop there,
|
||||
// because you're like "wait why did it stop" and then you later remember
|
||||
// that's because there was a function breakpoint there.
|
||||
//
|
||||
// [ ] n-row table selection, in watch window & other UIs, multi-selection
|
||||
// ctrl+C
|
||||
//
|
||||
// [ ] theme colors -> more explicit about e.g. opaque backgrounds vs. floating
|
||||
// & scrollbars etc.
|
||||
// [ ] target/breakpoint/watch-pin reordering
|
||||
// [ ] visualize remapped files (via path map)
|
||||
// [ ] theme lister -> fonts & font sizes
|
||||
//
|
||||
// [ ] font lister
|
||||
// [ ] per-panel font size overrides
|
||||
//
|
||||
@@ -31,45 +39,36 @@
|
||||
// that you use to tag them. Just some way that would make it easier to
|
||||
// focus on your own threads.
|
||||
//
|
||||
// [ ] it would be nice to have "show in explorer" for right click on source
|
||||
// file tab (opens explorer & selects the file)
|
||||
//
|
||||
// [ ] what's up with decimal number coloring where every group of 3 are in
|
||||
// different color? can I turn it off? And why sometimes digits in number
|
||||
// start with brighter color, but sometimes with darker - shouldn't it
|
||||
// always have the same color ordering?
|
||||
// [ ] "concept key stack"; basically, any point in UI builder path has a stack
|
||||
// of active "concept keys", which can be used to e.g. build context menus
|
||||
// automatically (could just be a per-box attachment; right-click any
|
||||
// point, search up the tree and see the concept keys)
|
||||
// [ ] ui_next_event(...), built-in focus filtering, no need to manually check
|
||||
// if(ui_is_focus_active())
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Hot, High Priority Tasks (Complete Unusability, Crashes, Fire-Worthy)
|
||||
//
|
||||
// [ ] asan stepping breakage
|
||||
// [ ] "Browse..." buttons should adopt a more relevant starting search path,
|
||||
// if possible
|
||||
// [ ] PDB files distributed with the build are not found by DbgHelp!!!
|
||||
// [ ] Jai compiler debugging crash
|
||||
//
|
||||
// [ ] Jump table thunks, on code w/o /INCREMENTAL:NO
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Hot, Medium Priority Tasks (Low-Hanging-Fruit Features, UI Jank, Cleanup)
|
||||
//
|
||||
// [ ] Setting the code_font/main_font values to a font name doesn't work.
|
||||
// Should probably make note that you have to set it to a path to a TTF,
|
||||
// since that's not normally how Windows fonts work.
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Hot, Medium Priority Tasks (Low-Hanging-Fruit Features, UI Jank, Cleanup)
|
||||
//
|
||||
// [ ] "root" concept in hash store, which buckets keys & allows usage code to
|
||||
// jettison a collection of keys in retained mode fashion
|
||||
//
|
||||
// [ ] Jeff Notes
|
||||
// [ ] highlighted text & ctrl+f -> auto-fill search query
|
||||
// [ ] double-click any part of frame in callstack view -> snap to function
|
||||
// [ ] sort locals by appearance in source code (or maybe just debug info)
|
||||
// [ ] sum view rule
|
||||
// [ ] plot view rule
|
||||
// [ ] histogram view rule
|
||||
// [ ] max view rule
|
||||
// [ ] min view rule
|
||||
// [ ] double click on procedure in procedures tab to jump to source
|
||||
//
|
||||
// [ ] filesystem drag/drop support
|
||||
// [ ] double-click vs. single-click for folder navigation, see if we can infer
|
||||
@@ -89,6 +88,10 @@
|
||||
// sense once I use the debugger more, but I just thought I'd make a note
|
||||
// to say that I was confused about it after reading the manual, so
|
||||
// perhaps you could elaborate a little more on it in there.
|
||||
// [ ] It wasn't clear to me how you save a user or project file. I can see
|
||||
// how to load them, but not how you save them. Obviously I can just copy
|
||||
// the files myself in the shell, but it seemed weird that there was no
|
||||
// "save" option in the menus.
|
||||
//
|
||||
// [ ] Right-clicking on a thread in the Scheduler window pops up a context
|
||||
// menu, but you can't actually see it because the tooltip for the thread
|
||||
@@ -100,11 +103,6 @@
|
||||
// actual items (ie., it doesn't resize the listing based on what's
|
||||
// actually visible)
|
||||
//
|
||||
// [ ] ** Function breakpoints should show up in the source listing. Without
|
||||
// them being visible, it is confusing when you run and you stop there,
|
||||
// because you're like "wait why did it stop" and then you later remember
|
||||
// that's because there was a function breakpoint there.
|
||||
//
|
||||
// [ ] ** One very nice feature of RemedyBG that I use all the time is the
|
||||
// ability to put "$err, hr" into the watch window, which will just show
|
||||
// the value of GetLastError() as a string. This is super useful for
|
||||
@@ -114,10 +112,6 @@
|
||||
// [ ] lock icon
|
||||
// [ ] "rotation arrow" icon next to executables
|
||||
//
|
||||
// [ ] Using the word "symbol" in "Code (Symbol)" seems like a bad idea, since
|
||||
// you're referring to non-identifier characters, but in a debugger
|
||||
// "symbol" usually means something defined in the debug information.
|
||||
//
|
||||
// [ ] I LOVE ALT-W to add watch under cursor, but I would prefer to have it
|
||||
// add what's under the MOUSE cursor instead of the keyboard cursor. Can
|
||||
// we get a command for that so I can bind ALT-W to that instead?
|
||||
@@ -127,23 +121,6 @@
|
||||
// color to white (or the inverse of the background color, or whatever) so
|
||||
// that the user can see what things on the screen use that theme color.
|
||||
//
|
||||
// [ ] I couldn't figure out how to affect the "dim" color in constants that
|
||||
// have alternating bright/dim letters to show sections of a number. Is
|
||||
// this in the theme colors somewhere?
|
||||
//
|
||||
// [ ] ** Scrollbars are barely visible for me, for some reason. I could not
|
||||
// find anything in the theme that would fill them with a solid, bright
|
||||
// color. Instead they are just a thin outline and the same color as the
|
||||
// scroll bar background.
|
||||
//
|
||||
// [ ] Many of the UI elements, like the menus, would like better if they had
|
||||
// a little bit of margin. Having the text right next to the edges, and
|
||||
// with no line spacing, makes it harder to read things quickly.
|
||||
//
|
||||
// [ ] Menus take too long to show up. I would prefer it if they were instant.
|
||||
// The animation doesn't really provide any useful cues, since I know
|
||||
// where the menu came from.
|
||||
//
|
||||
// [ ] Theme window should include font scaling. I was able to find the
|
||||
// command for increasing the font scale, but I imagine most people
|
||||
// wouldn't think to look there.
|
||||
@@ -153,47 +130,13 @@
|
||||
// [ ] It'd be nice to have a "goto byte" option for source views, for jumping
|
||||
// to error messages that are byte-based instead of line-based.
|
||||
//
|
||||
// [ ] Pressing the left mouse button on the menu bar and dragging does not
|
||||
// move through the menus as expected - instead, it opens the one you
|
||||
// clicked down on, then does nothing until you release, at which point it
|
||||
// opens the menu you released on.
|
||||
// [ ] Similarly, pressing the left mouse button on a menu and dragging to an
|
||||
// item, then releasing, does not trigger that item as expected. Instead,
|
||||
// it is a nop, and it waits for you to click again on the item.
|
||||
//
|
||||
// [ ] I found the "context menu" convention to be confusing. For example, if
|
||||
// I left-click on a tab, it selects the tab. If I right-click on a tab,
|
||||
// it opens the context menu. However, if I left-click on a module, it
|
||||
// opens the context window. It seems like maybe menus should be right,
|
||||
// and left should do the default action, more consistently?
|
||||
//
|
||||
// [ ] It wasn't clear to me how you save a user or project file. I can see
|
||||
// how to load them, but not how you save them. Obviously I can just copy
|
||||
// the files myself in the shell, but it seemed weird that there was no
|
||||
// "save" option in the menus.
|
||||
//
|
||||
// [ ] @feature debug info overrides (both path-based AND module-based)
|
||||
// [ ] configure tab size
|
||||
// [ ] auto-scroll output window
|
||||
//
|
||||
// [ ] C++ virtual inheritance member visualization in watch window
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Hot, Low Priority Tasks (UI Opinions, Less-Serious Jank, Preferences, Cleanup)
|
||||
//
|
||||
// [ ] ** In the call stack, I would like to be able to click quickly and move
|
||||
// around the stack. Right now, you can do that with the first and third
|
||||
// column, but the second column drops down a context menu. Since right
|
||||
// click is already for context menus, can it not just be that double-
|
||||
// clicking any column jumps to that stack frame?
|
||||
//
|
||||
// [ ] ** I find it really hard to read the code with the heavyweight lines
|
||||
// running through it for breakpoints and stepping and things. Is there a
|
||||
// way to turn the lines off? AFAICT they are based on thread and
|
||||
// breakpoint color, so you can't really control the line drawing? I might
|
||||
// be fine with them, but they would have to be much more light (like
|
||||
// alpha 0.1 or something)
|
||||
//
|
||||
// [ ] The hex format for color values in the config file was a real
|
||||
// mindbender. It's prefixed with "0x", so I was assuming it was either
|
||||
// Windows Big Endian (0xAARRGGBB) or Mac Little Endian (0xAABBGGRR). To
|
||||
@@ -205,16 +148,6 @@
|
||||
// that is "page up" / "page down", but here it is "smooth scroll upward"
|
||||
// / "smooth scroll downward" for some reason?
|
||||
//
|
||||
// [ ] Hitting ESC during a color picker drag should abort the color picking
|
||||
// and revert to the previous color. Currently, it just accepts the last
|
||||
// drag result as the new color.
|
||||
//
|
||||
// [ ] It was not clear to me why a small "tab picker" appeared when I got to
|
||||
// a certain number of tabs. It seemed to appear even if the tabs were
|
||||
// quite large, and there was no need to a drop-down menu to pick them. It
|
||||
// feels like either it should always be there, or it should only show up
|
||||
// if at least one tab gets small enough to have its name cut off?
|
||||
//
|
||||
// [ ] can it ignore stepping into _RTC_CheckStackVars generated functions?
|
||||
// [ ] mouse back button should make view to go back after I double clicked
|
||||
// on function to open it
|
||||
@@ -225,19 +158,23 @@
|
||||
// [ ] default font size is too small for me - not only source code, but
|
||||
// menus/tab/watch names (which don't resize). Maybe you could query
|
||||
// Windows for initial font size?
|
||||
// [ ] zooming behaves very strangely - sometimes it zooms source code,
|
||||
// sometimes both source code and menu/tab/watch font size, sometimes
|
||||
// just menu/tab/watch font size not source size.
|
||||
// [ ] icon fonts glyphs sometimes disappear for specific font size, but they
|
||||
// reappear if you go +1 higher or -1 lower. Mostly red triangle in watch
|
||||
// values for "unknown identifier". But also yellow arrow in call stack
|
||||
// disappears if font size gets too large.
|
||||
// [ ] undo close tab would be nice. If not for everything, then at least
|
||||
// just for source files
|
||||
// [ ] Jump table thunks, on code w/o /INCREMENTAL:NO
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Hot, Feature Tasks (Not really "low priority" but less urgent than fixes)
|
||||
//
|
||||
// [ ] @eval_upgrade
|
||||
// [ ] new eval system; support strings, many address spaces, many debug
|
||||
// infos, wide/async transforms (e.g. diff(blob1, blob2))
|
||||
// [ ] collapse frontend visualization systems - source view, disasm view,
|
||||
// callstack, modules, scheduler, should *all* be flavors of watch view
|
||||
//
|
||||
// [ ] Fancy View Rules
|
||||
// [ ] table column boundaries should be checked against *AFTER* table
|
||||
// contents, not before
|
||||
@@ -388,6 +325,91 @@
|
||||
// path - must invalidate naturally when new filetime occurs)
|
||||
// [x] rdi file regeneration too strict
|
||||
// [x] raddbg jai.exe my_file.jai -- foobar -> raddbg consumes `--` incorrectly
|
||||
// [x] mouse-driven way to complete file/folder selection, or more generally
|
||||
// query completion
|
||||
// [x] it would be nice to have "show in explorer" for right click on source
|
||||
// file tab (opens explorer & selects the file)
|
||||
// [x] asan stepping breakage
|
||||
// [x] what's up with decimal number coloring where every group of 3 are in
|
||||
// different color? can I turn it off? And why sometimes digits in number
|
||||
// start with brighter color, but sometimes with darker - shouldn't it
|
||||
// always have the same color ordering?
|
||||
// [x] fix tabs-on-bottom positioning
|
||||
// [x] colors: consistent tooltip styles (colors, font flags, etc.)
|
||||
// [x] colors: scroll bars
|
||||
// [x] colors: watch window navigation visuals
|
||||
// [x] floating source view margin background/placement
|
||||
// [x] "interaction root", or "group" ui_key, or something; used for menu bar interactions
|
||||
// [x] theme colors -> more explicit about e.g. opaque backgrounds vs. floating
|
||||
// & scrollbars etc.
|
||||
// [x] Pressing the left mouse button on the menu bar and dragging does not
|
||||
// move through the menus as expected - instead, it opens the one you
|
||||
// clicked down on, then does nothing until you release, at which point it
|
||||
// opens the menu you released on.
|
||||
// [x] Similarly, pressing the left mouse button on a menu and dragging to an
|
||||
// item, then releasing, does not trigger that item as expected. Instead,
|
||||
// it is a nop, and it waits for you to click again on the item.
|
||||
// [x] Using the word "symbol" in "Code (Symbol)" seems like a bad idea, since
|
||||
// you're referring to non-identifier characters, but in a debugger
|
||||
// "symbol" usually means something defined in the debug information.
|
||||
// [x] I couldn't figure out how to affect the "dim" color in constants that
|
||||
// have alternating bright/dim letters to show sections of a number. Is
|
||||
// this in the theme colors somewhere?
|
||||
//
|
||||
// [x] ** Scrollbars are barely visible for me, for some reason. I could not
|
||||
// find anything in the theme that would fill them with a solid, bright
|
||||
// color. Instead they are just a thin outline and the same color as the
|
||||
// scroll bar background.
|
||||
//
|
||||
// [x] Many of the UI elements, like the menus, would like better if they had
|
||||
// a little bit of margin. Having the text right next to the edges, and
|
||||
// with no line spacing, makes it harder to read things quickly.
|
||||
// [x] colors: memory view
|
||||
// [x] Hitting ESC during a color picker drag should abort the color picking
|
||||
// and revert to the previous color. Currently, it just accepts the last
|
||||
// drag result as the new color.
|
||||
// [x] It was not clear to me why a small "tab picker" appeared when I got to
|
||||
// a certain number of tabs. It seemed to appear even if the tabs were
|
||||
// quite large, and there was no need to a drop-down menu to pick them. It
|
||||
// feels like either it should always be there, or it should only show up
|
||||
// if at least one tab gets small enough to have its name cut off?
|
||||
// [x] I found the "context menu" convention to be confusing. For example, if
|
||||
// I left-click on a tab, it selects the tab. If I right-click on a tab,
|
||||
// it opens the context menu. However, if I left-click on a module, it
|
||||
// opens the context window. It seems like maybe menus should be right,
|
||||
// and left should do the default action, more consistently?
|
||||
//
|
||||
// [x] double click on procedure in procedures tab to jump to source
|
||||
// [x] highlighted text & ctrl+f -> auto-fill search query
|
||||
// [x] double-click any part of frame in callstack view -> snap to function
|
||||
// [x] Menus take too long to show up. I would prefer it if they were instant.
|
||||
// The animation doesn't really provide any useful cues, since I know
|
||||
// where the menu came from.
|
||||
// [x] user settings (ui & functionality - generally need a story for it)
|
||||
// [x] hover animations
|
||||
// [x] press animations
|
||||
// [x] focus animations
|
||||
// [x] tooltip animations
|
||||
// [x] context menu animations
|
||||
// [x] scrolling animations
|
||||
// [x] background blur
|
||||
// [x] tab width
|
||||
// [x] ** In the call stack, I would like to be able to click quickly and move
|
||||
// around the stack. Right now, you can do that with the first and third
|
||||
// column, but the second column drops down a context menu. Since right
|
||||
// click is already for context menus, can it not just be that double-
|
||||
// clicking any column jumps to that stack frame?
|
||||
//
|
||||
// [x] ** I find it really hard to read the code with the heavyweight lines
|
||||
// running through it for breakpoints and stepping and things. Is there a
|
||||
// way to turn the lines off? AFAICT they are based on thread and
|
||||
// breakpoint color, so you can't really control the line drawing? I might
|
||||
// be fine with them, but they would have to be much more light (like
|
||||
// alpha 0.1 or something)
|
||||
// [x] zooming behaves very strangely - sometimes it zooms source code,
|
||||
// sometimes both source code and menu/tab/watch font size, sometimes
|
||||
// just menu/tab/watch font size not source size.
|
||||
// [x] colors: fill out rest of theme presets for new theme setup
|
||||
|
||||
#ifndef RADDBG_H
|
||||
#define RADDBG_H
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
#define BUILD_VERSION_MAJOR 0
|
||||
#define BUILD_VERSION_MINOR 9
|
||||
#define BUILD_VERSION_PATCH 10
|
||||
#define BUILD_VERSION_PATCH 11
|
||||
#define BUILD_RELEASE_PHASE_STRING_LITERAL "ALPHA"
|
||||
#define BUILD_TITLE "The RAD Debugger"
|
||||
#define OS_FEATURE_GRAPHICAL 1
|
||||
@@ -36,8 +36,8 @@
|
||||
#include "hash_store/hash_store.h"
|
||||
#include "file_stream/file_stream.h"
|
||||
#include "text_cache/text_cache.h"
|
||||
#include "mutable_text/mutable_text.h"
|
||||
#include "path/path.h"
|
||||
#include "txti/txti.h"
|
||||
#include "coff/coff.h"
|
||||
#include "pe/pe.h"
|
||||
#include "codeview/codeview.h"
|
||||
@@ -76,8 +76,8 @@
|
||||
#include "hash_store/hash_store.c"
|
||||
#include "file_stream/file_stream.c"
|
||||
#include "text_cache/text_cache.c"
|
||||
#include "mutable_text/mutable_text.c"
|
||||
#include "path/path.c"
|
||||
#include "txti/txti.c"
|
||||
#include "coff/coff.c"
|
||||
#include "pe/pe.c"
|
||||
#include "codeview/codeview.c"
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
#define BUILD_VERSION_MAJOR 0
|
||||
#define BUILD_VERSION_MINOR 9
|
||||
#define BUILD_VERSION_PATCH 10
|
||||
#define BUILD_VERSION_PATCH 11
|
||||
#define BUILD_RELEASE_PHASE_STRING_LITERAL "ALPHA"
|
||||
#define BUILD_TITLE "rdi_breakpad_from_pdb"
|
||||
#define BUILD_CONSOLE_INTERFACE 1
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
#define BUILD_VERSION_MAJOR 0
|
||||
#define BUILD_VERSION_MINOR 9
|
||||
#define BUILD_VERSION_PATCH 10
|
||||
#define BUILD_VERSION_PATCH 11
|
||||
#define BUILD_RELEASE_PHASE_STRING_LITERAL "ALPHA"
|
||||
#define BUILD_TITLE "rdi_dump"
|
||||
#define BUILD_CONSOLE_INTERFACE 1
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
#define BUILD_VERSION_MAJOR 0
|
||||
#define BUILD_VERSION_MINOR 9
|
||||
#define BUILD_VERSION_PATCH 10
|
||||
#define BUILD_VERSION_PATCH 11
|
||||
#define BUILD_RELEASE_PHASE_STRING_LITERAL "ALPHA"
|
||||
#define BUILD_TITLE "rdi_from_dwarf"
|
||||
#define BUILD_CONSOLE_INTERFACE 1
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
#define BUILD_VERSION_MAJOR 0
|
||||
#define BUILD_VERSION_MINOR 9
|
||||
#define BUILD_VERSION_PATCH 10
|
||||
#define BUILD_VERSION_PATCH 11
|
||||
#define BUILD_RELEASE_PHASE_STRING_LITERAL "ALPHA"
|
||||
#define BUILD_TITLE "rdi_from_pdb"
|
||||
#define BUILD_CONSOLE_INTERFACE 1
|
||||
@@ -64,7 +64,7 @@ entry_point(CmdLine *cmdline)
|
||||
{
|
||||
fprintf(stderr, "--- rdi_from_pdb --------------------------------------------------------------\n\n");
|
||||
|
||||
fprintf(stderr, "This utility converts debug information from PDBs into the RAD Debug Info.\n");
|
||||
fprintf(stderr, "This utility converts debug information from PDBs into the RAD Debug Info\n");
|
||||
fprintf(stderr, "format. The following arguments are accepted:\n\n");
|
||||
|
||||
fprintf(stderr, "--exe:<path> [optional] Specifies the path of the executable file for which the\n");
|
||||
|
||||
@@ -1335,6 +1335,36 @@ r_window_submit(OS_Handle window, R_Handle window_equip, R_PassList *passes)
|
||||
{ sizeof(R_D3D11_Uniforms_BlurPass) / 16, sizeof(uniforms.kernel) / 16 },
|
||||
};
|
||||
|
||||
// rjf: setup scissor rect
|
||||
{
|
||||
Rng2F32 clip = params->clip;
|
||||
D3D11_RECT rect = {0};
|
||||
{
|
||||
if(clip.x0 == 0 && clip.y0 == 0 && clip.x1 == 0 && clip.y1 == 0)
|
||||
{
|
||||
rect.left = 0;
|
||||
rect.right = (LONG)wnd->last_resolution.x;
|
||||
rect.top = 0;
|
||||
rect.bottom = (LONG)wnd->last_resolution.y;
|
||||
}
|
||||
else if(clip.x0 > clip.x1 || clip.y0 > clip.y1)
|
||||
{
|
||||
rect.left = 0;
|
||||
rect.right = 0;
|
||||
rect.top = 0;
|
||||
rect.bottom = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
rect.left = (LONG)clip.x0;
|
||||
rect.right = (LONG)clip.x1;
|
||||
rect.top = (LONG)clip.y0;
|
||||
rect.bottom = (LONG)clip.y1;
|
||||
}
|
||||
}
|
||||
d_ctx->lpVtbl->RSSetScissorRects(d_ctx, 1, &rect);
|
||||
}
|
||||
|
||||
// rjf: for unsetting srv
|
||||
ID3D11ShaderResourceView* srv = 0;
|
||||
|
||||
|
||||
@@ -151,6 +151,7 @@ typedef struct R_PassParams_Blur R_PassParams_Blur;
|
||||
struct R_PassParams_Blur
|
||||
{
|
||||
Rng2F32 rect;
|
||||
Rng2F32 clip;
|
||||
F32 blur_size;
|
||||
F32 corner_radii[Corner_COUNT];
|
||||
};
|
||||
|
||||
+232
-8
@@ -420,10 +420,66 @@ txt_token_array_from_string__c_cpp(Arena *arena, U64 *bytes_processed_counter, S
|
||||
break;
|
||||
}
|
||||
}
|
||||
txt_token_chunk_list_push(scratch.arena, &tokens, 4096, &token);
|
||||
}
|
||||
|
||||
// rjf: push
|
||||
txt_token_chunk_list_push(scratch.arena, &tokens, 4096, &token);
|
||||
// rjf: split symbols by maximum-munch-rule
|
||||
else if(token.kind == TXT_TokenKind_Symbol)
|
||||
{
|
||||
read_only local_persist String8 c_cpp_multichar_symbol_strings[] =
|
||||
{
|
||||
str8_lit_comp("<<"),
|
||||
str8_lit_comp(">>"),
|
||||
str8_lit_comp("<="),
|
||||
str8_lit_comp(">="),
|
||||
str8_lit_comp("=="),
|
||||
str8_lit_comp("!="),
|
||||
str8_lit_comp("&&"),
|
||||
str8_lit_comp("||"),
|
||||
str8_lit_comp("|="),
|
||||
str8_lit_comp("&="),
|
||||
str8_lit_comp("^="),
|
||||
str8_lit_comp("~="),
|
||||
str8_lit_comp("+="),
|
||||
str8_lit_comp("-="),
|
||||
str8_lit_comp("*="),
|
||||
str8_lit_comp("/="),
|
||||
str8_lit_comp("%="),
|
||||
str8_lit_comp("<<="),
|
||||
str8_lit_comp(">>="),
|
||||
str8_lit_comp("->"),
|
||||
};
|
||||
String8 token_string = str8_substr(string, r1u64(active_token_start_idx, idx+ender_pad));
|
||||
for(U64 off = 0, next_off = token_string.size; off < token_string.size; off = next_off)
|
||||
{
|
||||
B32 found = 0;
|
||||
for(U64 idx = 0; idx < ArrayCount(c_cpp_multichar_symbol_strings); idx += 1)
|
||||
{
|
||||
if(str8_match(str8_substr(string, r1u64(off, off+c_cpp_multichar_symbol_strings[idx].size)),
|
||||
c_cpp_multichar_symbol_strings[idx],
|
||||
0))
|
||||
{
|
||||
found = 1;
|
||||
next_off = off + c_cpp_multichar_symbol_strings[idx].size;
|
||||
TXT_Token token = {TXT_TokenKind_Symbol, r1u64(active_token_start_idx+off, active_token_start_idx+next_off)};
|
||||
txt_token_chunk_list_push(scratch.arena, &tokens, 4096, &token);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(!found)
|
||||
{
|
||||
next_off = off+1;
|
||||
TXT_Token token = {TXT_TokenKind_Symbol, r1u64(active_token_start_idx+off, active_token_start_idx+next_off)};
|
||||
txt_token_chunk_list_push(scratch.arena, &tokens, 4096, &token);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// rjf: all other tokens
|
||||
else
|
||||
{
|
||||
txt_token_chunk_list_push(scratch.arena, &tokens, 4096, &token);
|
||||
}
|
||||
|
||||
// rjf: increment by ender padding
|
||||
idx += ender_pad;
|
||||
@@ -650,10 +706,66 @@ txt_token_array_from_string__odin(Arena *arena, U64 *bytes_processed_counter, St
|
||||
break;
|
||||
}
|
||||
}
|
||||
txt_token_chunk_list_push(scratch.arena, &tokens, 4096, &token);
|
||||
}
|
||||
|
||||
// rjf: push
|
||||
txt_token_chunk_list_push(scratch.arena, &tokens, 4096, &token);
|
||||
// rjf: split symbols by maximum-munch-rule
|
||||
else if(token.kind == TXT_TokenKind_Symbol)
|
||||
{
|
||||
read_only local_persist String8 odin_multichar_symbol_strings[] =
|
||||
{
|
||||
str8_lit_comp("<<"),
|
||||
str8_lit_comp(">>"),
|
||||
str8_lit_comp("<="),
|
||||
str8_lit_comp(">="),
|
||||
str8_lit_comp("=="),
|
||||
str8_lit_comp("!="),
|
||||
str8_lit_comp("&&"),
|
||||
str8_lit_comp("||"),
|
||||
str8_lit_comp("|="),
|
||||
str8_lit_comp("&="),
|
||||
str8_lit_comp("^="),
|
||||
str8_lit_comp("~="),
|
||||
str8_lit_comp("+="),
|
||||
str8_lit_comp("-="),
|
||||
str8_lit_comp("*="),
|
||||
str8_lit_comp("/="),
|
||||
str8_lit_comp("%="),
|
||||
str8_lit_comp("<<="),
|
||||
str8_lit_comp(">>="),
|
||||
str8_lit_comp("->"),
|
||||
};
|
||||
String8 token_string = str8_substr(string, r1u64(active_token_start_idx, idx+ender_pad));
|
||||
for(U64 off = 0, next_off = token_string.size; off < token_string.size; off = next_off)
|
||||
{
|
||||
B32 found = 0;
|
||||
for(U64 idx = 0; idx < ArrayCount(odin_multichar_symbol_strings); idx += 1)
|
||||
{
|
||||
if(str8_match(str8_substr(string, r1u64(off, off+odin_multichar_symbol_strings[idx].size)),
|
||||
odin_multichar_symbol_strings[idx],
|
||||
0))
|
||||
{
|
||||
found = 1;
|
||||
next_off = off + odin_multichar_symbol_strings[idx].size;
|
||||
TXT_Token token = {TXT_TokenKind_Symbol, r1u64(active_token_start_idx+off, active_token_start_idx+next_off)};
|
||||
txt_token_chunk_list_push(scratch.arena, &tokens, 4096, &token);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(!found)
|
||||
{
|
||||
next_off = off+1;
|
||||
TXT_Token token = {TXT_TokenKind_Symbol, r1u64(active_token_start_idx+off, active_token_start_idx+next_off)};
|
||||
txt_token_chunk_list_push(scratch.arena, &tokens, 4096, &token);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// rjf: all other tokens
|
||||
else
|
||||
{
|
||||
txt_token_chunk_list_push(scratch.arena, &tokens, 4096, &token);
|
||||
}
|
||||
|
||||
// rjf: increment by ender padding
|
||||
idx += ender_pad;
|
||||
@@ -879,10 +991,66 @@ txt_token_array_from_string__jai(Arena *arena, U64 *bytes_processed_counter, Str
|
||||
break;
|
||||
}
|
||||
}
|
||||
txt_token_chunk_list_push(scratch.arena, &tokens, 4096, &token);
|
||||
}
|
||||
|
||||
// rjf: push
|
||||
txt_token_chunk_list_push(scratch.arena, &tokens, 4096, &token);
|
||||
// rjf: split symbols by maximum-munch-rule
|
||||
else if(token.kind == TXT_TokenKind_Symbol)
|
||||
{
|
||||
read_only local_persist String8 jai_multichar_symbol_strings[] =
|
||||
{
|
||||
str8_lit_comp("<<"),
|
||||
str8_lit_comp(">>"),
|
||||
str8_lit_comp("<="),
|
||||
str8_lit_comp(">="),
|
||||
str8_lit_comp("=="),
|
||||
str8_lit_comp("!="),
|
||||
str8_lit_comp("&&"),
|
||||
str8_lit_comp("||"),
|
||||
str8_lit_comp("|="),
|
||||
str8_lit_comp("&="),
|
||||
str8_lit_comp("^="),
|
||||
str8_lit_comp("~="),
|
||||
str8_lit_comp("+="),
|
||||
str8_lit_comp("-="),
|
||||
str8_lit_comp("*="),
|
||||
str8_lit_comp("/="),
|
||||
str8_lit_comp("%="),
|
||||
str8_lit_comp("<<="),
|
||||
str8_lit_comp(">>="),
|
||||
str8_lit_comp("->"),
|
||||
};
|
||||
String8 token_string = str8_substr(string, r1u64(active_token_start_idx, idx+ender_pad));
|
||||
for(U64 off = 0, next_off = token_string.size; off < token_string.size; off = next_off)
|
||||
{
|
||||
B32 found = 0;
|
||||
for(U64 idx = 0; idx < ArrayCount(jai_multichar_symbol_strings); idx += 1)
|
||||
{
|
||||
if(str8_match(str8_substr(string, r1u64(off, off+jai_multichar_symbol_strings[idx].size)),
|
||||
jai_multichar_symbol_strings[idx],
|
||||
0))
|
||||
{
|
||||
found = 1;
|
||||
next_off = off + jai_multichar_symbol_strings[idx].size;
|
||||
TXT_Token token = {TXT_TokenKind_Symbol, r1u64(active_token_start_idx+off, active_token_start_idx+next_off)};
|
||||
txt_token_chunk_list_push(scratch.arena, &tokens, 4096, &token);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(!found)
|
||||
{
|
||||
next_off = off+1;
|
||||
TXT_Token token = {TXT_TokenKind_Symbol, r1u64(active_token_start_idx+off, active_token_start_idx+next_off)};
|
||||
txt_token_chunk_list_push(scratch.arena, &tokens, 4096, &token);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// rjf: all other tokens
|
||||
else
|
||||
{
|
||||
txt_token_chunk_list_push(scratch.arena, &tokens, 4096, &token);
|
||||
}
|
||||
|
||||
// rjf: increment by ender padding
|
||||
idx += ender_pad;
|
||||
@@ -1114,10 +1282,66 @@ txt_token_array_from_string__zig(Arena *arena, U64 *bytes_processed_counter, Str
|
||||
break;
|
||||
}
|
||||
}
|
||||
txt_token_chunk_list_push(scratch.arena, &tokens, 4096, &token);
|
||||
}
|
||||
|
||||
// rjf: push
|
||||
txt_token_chunk_list_push(scratch.arena, &tokens, 4096, &token);
|
||||
// rjf: split symbols by maximum-munch-rule
|
||||
else if(token.kind == TXT_TokenKind_Symbol)
|
||||
{
|
||||
read_only local_persist String8 zig_multichar_symbol_strings[] =
|
||||
{
|
||||
str8_lit_comp("<<"),
|
||||
str8_lit_comp(">>"),
|
||||
str8_lit_comp("<="),
|
||||
str8_lit_comp(">="),
|
||||
str8_lit_comp("=="),
|
||||
str8_lit_comp("!="),
|
||||
str8_lit_comp("&&"),
|
||||
str8_lit_comp("||"),
|
||||
str8_lit_comp("|="),
|
||||
str8_lit_comp("&="),
|
||||
str8_lit_comp("^="),
|
||||
str8_lit_comp("~="),
|
||||
str8_lit_comp("+="),
|
||||
str8_lit_comp("-="),
|
||||
str8_lit_comp("*="),
|
||||
str8_lit_comp("/="),
|
||||
str8_lit_comp("%="),
|
||||
str8_lit_comp("<<="),
|
||||
str8_lit_comp(">>="),
|
||||
str8_lit_comp("->"),
|
||||
};
|
||||
String8 token_string = str8_substr(string, r1u64(active_token_start_idx, idx+ender_pad));
|
||||
for(U64 off = 0, next_off = token_string.size; off < token_string.size; off = next_off)
|
||||
{
|
||||
B32 found = 0;
|
||||
for(U64 idx = 0; idx < ArrayCount(zig_multichar_symbol_strings); idx += 1)
|
||||
{
|
||||
if(str8_match(str8_substr(string, r1u64(off, off+zig_multichar_symbol_strings[idx].size)),
|
||||
zig_multichar_symbol_strings[idx],
|
||||
0))
|
||||
{
|
||||
found = 1;
|
||||
next_off = off + zig_multichar_symbol_strings[idx].size;
|
||||
TXT_Token token = {TXT_TokenKind_Symbol, r1u64(active_token_start_idx+off, active_token_start_idx+next_off)};
|
||||
txt_token_chunk_list_push(scratch.arena, &tokens, 4096, &token);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(!found)
|
||||
{
|
||||
next_off = off+1;
|
||||
TXT_Token token = {TXT_TokenKind_Symbol, r1u64(active_token_start_idx+off, active_token_start_idx+next_off)};
|
||||
txt_token_chunk_list_push(scratch.arena, &tokens, 4096, &token);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// rjf: all other tokens
|
||||
else
|
||||
{
|
||||
txt_token_chunk_list_push(scratch.arena, &tokens, 4096, &token);
|
||||
}
|
||||
|
||||
// rjf: increment by ender padding
|
||||
idx += ender_pad;
|
||||
|
||||
-895
@@ -1,895 +0,0 @@
|
||||
// Copyright (c) 2024 Epic Games Tools
|
||||
// Licensed under the MIT license (https://opensource.org/license/mit/)
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Main Layer Initialization
|
||||
|
||||
internal void
|
||||
txti_init(void)
|
||||
{
|
||||
Arena *arena = arena_alloc();
|
||||
txti_state = push_array(arena, TXTI_State, 1);
|
||||
txti_state->arena = arena;
|
||||
txti_state->entity_map.slots_count = 1024;
|
||||
txti_state->entity_map.slots = push_array(txti_state->arena, TXTI_EntitySlot, txti_state->entity_map.slots_count);
|
||||
txti_state->entity_map_stripes.count = 64;
|
||||
txti_state->entity_map_stripes.v = push_array(txti_state->arena, TXTI_Stripe, txti_state->entity_map_stripes.count);
|
||||
for(U64 idx = 0; idx < txti_state->entity_map_stripes.count; idx += 1)
|
||||
{
|
||||
txti_state->entity_map_stripes.v[idx].arena = arena_alloc();
|
||||
txti_state->entity_map_stripes.v[idx].cv = os_condition_variable_alloc();
|
||||
txti_state->entity_map_stripes.v[idx].rw_mutex = os_rw_mutex_alloc();
|
||||
}
|
||||
txti_state->mut_thread_count = Clamp(1, os_logical_core_count(), 4);
|
||||
txti_state->mut_threads = push_array(txti_state->arena, TXTI_MutThread, txti_state->mut_thread_count);
|
||||
for(U64 idx = 0; idx < txti_state->mut_thread_count; idx += 1)
|
||||
{
|
||||
TXTI_MutThread *thread = &txti_state->mut_threads[idx];
|
||||
thread->msg_arena = arena_alloc();
|
||||
thread->msg_mutex = os_mutex_alloc();
|
||||
thread->msg_cv = os_condition_variable_alloc();
|
||||
thread->thread = os_launch_thread(txti_mut_thread_entry_point, (void *)idx, 0);
|
||||
}
|
||||
txti_state->detector_thread = os_launch_thread(txti_detector_thread_entry_point, 0, 0);
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Basic Helpers
|
||||
|
||||
internal U64
|
||||
txti_hash_from_string(String8 string)
|
||||
{
|
||||
U64 result = 5381;
|
||||
for(U64 i = 0; i < string.size; i += 1)
|
||||
{
|
||||
result = ((result << 5) + result) + string.str[i];
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Message Type Functions
|
||||
|
||||
internal void
|
||||
txti_msg_list_push(Arena *arena, TXTI_MsgList *msgs, TXTI_Msg *msg)
|
||||
{
|
||||
TXTI_MsgNode *node = push_array(arena, TXTI_MsgNode, 1);
|
||||
MemoryCopyStruct(&node->v, msg);
|
||||
SLLQueuePush(msgs->first, msgs->last, node);
|
||||
msgs->count += 1;
|
||||
}
|
||||
|
||||
internal void
|
||||
txti_msg_list_concat_in_place(TXTI_MsgList *dst, TXTI_MsgList *src)
|
||||
{
|
||||
if(dst->last == 0)
|
||||
{
|
||||
MemoryCopyStruct(dst, src);
|
||||
}
|
||||
else if(src->first)
|
||||
{
|
||||
dst->last->next = src->first;
|
||||
dst->last = src->last;
|
||||
dst->count += src->count;
|
||||
}
|
||||
MemoryZeroStruct(src);
|
||||
}
|
||||
|
||||
internal TXTI_MsgList
|
||||
txti_msg_list_deep_copy(Arena *arena, TXTI_MsgList *src)
|
||||
{
|
||||
TXTI_MsgList dst = {0};
|
||||
for(TXTI_MsgNode *src_n = src->first; src_n != 0; src_n = src_n->next)
|
||||
{
|
||||
TXTI_MsgNode *dst_n = push_array(arena, TXTI_MsgNode, 1);
|
||||
SLLQueuePush(dst.first, dst.last, dst_n);
|
||||
dst.count += 1;
|
||||
MemoryCopyStruct(&dst_n->v, &src_n->v);
|
||||
dst_n->v.string = push_str8_copy(arena, src_n->v.string);
|
||||
}
|
||||
return dst;
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Entities API
|
||||
|
||||
//- rjf: opening entities & correllation w/ path
|
||||
|
||||
internal TXTI_Handle
|
||||
txti_handle_from_path(String8 path)
|
||||
{
|
||||
TXTI_Handle handle = {0};
|
||||
{
|
||||
// rjf: path -> hash * slot *stripe
|
||||
U64 hash = txti_hash_from_string(path);
|
||||
U64 slot_idx = hash%txti_state->entity_map.slots_count;
|
||||
U64 stripe_idx = slot_idx%txti_state->entity_map_stripes.count;
|
||||
TXTI_EntitySlot *slot = &txti_state->entity_map.slots[slot_idx];
|
||||
TXTI_Stripe *stripe = &txti_state->entity_map_stripes.v[stripe_idx];
|
||||
|
||||
// rjf: determine if entity exists (shared lock)
|
||||
TXTI_Entity *found_entity = 0;
|
||||
OS_MutexScopeR(stripe->rw_mutex)
|
||||
{
|
||||
for(TXTI_Entity *entity = slot->first; entity != 0; entity = entity->next)
|
||||
{
|
||||
if(str8_match(entity->path, path, 0))
|
||||
{
|
||||
found_entity = entity;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(found_entity != 0)
|
||||
{
|
||||
handle.u64[0] = hash;
|
||||
handle.u64[1] = found_entity->id;
|
||||
}
|
||||
}
|
||||
|
||||
// rjf: if entity does not exist -> exclusive lock & check again -- if still
|
||||
// does not exist, then build it
|
||||
if(found_entity == 0) OS_MutexScopeW(stripe->rw_mutex)
|
||||
{
|
||||
for(TXTI_Entity *entity = slot->first; entity != 0; entity = entity->next)
|
||||
{
|
||||
if(str8_match(entity->path, path, 0))
|
||||
{
|
||||
found_entity = entity;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(found_entity == 0)
|
||||
{
|
||||
TXTI_Entity *entity = push_array(stripe->arena, TXTI_Entity, 1);
|
||||
entity->path = push_str8_copy(stripe->arena, path);
|
||||
entity->id = ins_atomic_u64_inc_eval(&txti_state->entity_id_gen);
|
||||
for(U64 idx = 0; idx < TXTI_ENTITY_BUFFER_COUNT; idx += 1)
|
||||
{
|
||||
TXTI_Buffer *buffer = &entity->buffers[idx];
|
||||
buffer->data_arena = arena_alloc__sized(GB(32), KB(64));
|
||||
buffer->analysis_arena = arena_alloc__sized(GB(32), KB(64));
|
||||
buffer->data_arena->align = 1;
|
||||
}
|
||||
SLLQueuePush(slot->first, slot->last, entity);
|
||||
found_entity = entity;
|
||||
}
|
||||
handle.u64[0] = hash;
|
||||
handle.u64[1] = found_entity->id;
|
||||
}
|
||||
}
|
||||
return handle;
|
||||
}
|
||||
|
||||
//- rjf: buffer introspection
|
||||
|
||||
internal TXTI_BufferInfo
|
||||
txti_buffer_info_from_handle(Arena *arena, TXTI_Handle handle)
|
||||
{
|
||||
TXTI_BufferInfo result = {0};
|
||||
U64 hash = handle.u64[0];
|
||||
U64 id = handle.u64[1];
|
||||
U64 slot_idx = hash%txti_state->entity_map.slots_count;
|
||||
U64 stripe_idx = slot_idx%txti_state->entity_map_stripes.count;
|
||||
TXTI_EntitySlot *slot = &txti_state->entity_map.slots[slot_idx];
|
||||
TXTI_Stripe *stripe = &txti_state->entity_map_stripes.v[stripe_idx];
|
||||
OS_MutexScopeR(stripe->rw_mutex)
|
||||
{
|
||||
TXTI_Entity *entity = 0;
|
||||
for(TXTI_Entity *e = slot->first; e != 0; e = e->next)
|
||||
{
|
||||
if(e->id == id)
|
||||
{
|
||||
entity = e;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(entity != 0)
|
||||
{
|
||||
TXTI_Buffer *buffer = &entity->buffers[entity->buffer_apply_gen%TXTI_ENTITY_BUFFER_COUNT];
|
||||
result.path = push_str8_copy(arena, entity->path);
|
||||
result.timestamp = entity->timestamp;
|
||||
result.line_end_kind = entity->line_end_kind;
|
||||
result.total_line_count = buffer->lines_count;
|
||||
result.max_line_size = buffer->lines_max_size;
|
||||
result.mut_gen = entity->mut_gen;
|
||||
result.buffer_apply_gen = entity->buffer_apply_gen;
|
||||
result.bytes_processed = ins_atomic_u64_eval(&entity->bytes_processed);
|
||||
result.bytes_to_process = ins_atomic_u64_eval(&entity->bytes_to_process);
|
||||
}
|
||||
}
|
||||
result.total_line_count = Max(1, result.total_line_count);
|
||||
return result;
|
||||
}
|
||||
|
||||
internal TXTI_Slice
|
||||
txti_slice_from_handle_line_range(Arena *arena, TXTI_Handle handle, Rng1S64 line_range)
|
||||
{
|
||||
ProfBeginFunction();
|
||||
TXTI_Slice result = {0};
|
||||
Temp scratch = scratch_begin(&arena, 1);
|
||||
U64 hash = handle.u64[0];
|
||||
U64 id = handle.u64[1];
|
||||
U64 slot_idx = hash%txti_state->entity_map.slots_count;
|
||||
U64 stripe_idx = slot_idx%txti_state->entity_map_stripes.count;
|
||||
TXTI_EntitySlot *slot = &txti_state->entity_map.slots[slot_idx];
|
||||
TXTI_Stripe *stripe = &txti_state->entity_map_stripes.v[stripe_idx];
|
||||
OS_MutexScopeR(stripe->rw_mutex)
|
||||
{
|
||||
TXTI_Entity *entity = 0;
|
||||
for(TXTI_Entity *e = slot->first; e != 0; e = e->next)
|
||||
{
|
||||
if(e->id == id)
|
||||
{
|
||||
entity = e;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(entity != 0)
|
||||
{
|
||||
TXTI_Buffer *buffer = &entity->buffers[entity->buffer_apply_gen%TXTI_ENTITY_BUFFER_COUNT];
|
||||
Rng1S64 line_range_clamped = r1s64(Clamp(1, line_range.min, (S64)buffer->lines_count), Clamp(1, line_range.max, (S64)buffer->lines_count));
|
||||
|
||||
// rjf: allocate output arrays
|
||||
result.line_count = (U64)dim_1s64(line_range_clamped)+1;
|
||||
result.line_text = push_array(arena, String8, result.line_count);
|
||||
result.line_ranges = push_array(arena, Rng1U64, result.line_count);
|
||||
result.line_tokens = push_array(arena, TXT_TokenArray, result.line_count);
|
||||
|
||||
// rjf: fill line ranges & text
|
||||
U64 line_slice_idx = 0;
|
||||
U64 line_buffer_idx = line_range_clamped.min-1;
|
||||
ProfScope("fill line ranges & text")
|
||||
for(S64 line_num = line_range_clamped.min;
|
||||
line_num <= line_range_clamped.max && line_buffer_idx < buffer->lines_count;
|
||||
line_num += 1,
|
||||
line_slice_idx += 1,
|
||||
line_buffer_idx += 1)
|
||||
{
|
||||
Rng1U64 range = buffer->lines_ranges[line_buffer_idx];
|
||||
String8 line_text_internal = str8_substr(buffer->data, range);
|
||||
result.line_ranges[line_slice_idx] = range;
|
||||
result.line_text[line_slice_idx] = push_str8_copy(arena, line_text_internal);
|
||||
}
|
||||
|
||||
// rjf: binary search to find first token
|
||||
TXT_Token *tokens_first = 0;
|
||||
ProfScope("binary search to find first token")
|
||||
{
|
||||
Rng1U64 slice_range = r1u64(result.line_ranges[0].min, result.line_ranges[result.line_count-1].max);
|
||||
U64 min_idx = 0;
|
||||
U64 opl_idx = buffer->tokens.count;
|
||||
for(;;)
|
||||
{
|
||||
U64 mid_idx = (opl_idx+min_idx)/2;
|
||||
if(mid_idx >= opl_idx)
|
||||
{
|
||||
break;
|
||||
}
|
||||
TXT_Token *mid_token = &buffer->tokens.v[mid_idx];
|
||||
if(mid_token->range.min > slice_range.max)
|
||||
{
|
||||
opl_idx = mid_idx;
|
||||
}
|
||||
else if(mid_token->range.max < slice_range.min)
|
||||
{
|
||||
min_idx = mid_idx;
|
||||
}
|
||||
else if(tokens_first == 0 || mid_token->range.min < tokens_first->range.min)
|
||||
{
|
||||
tokens_first = mid_token;
|
||||
opl_idx = mid_idx;
|
||||
}
|
||||
if(mid_idx == min_idx && mid_idx+1 == opl_idx)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// rjf: grab per-line tokens
|
||||
TXT_TokenList *line_tokens_lists = push_array(scratch.arena, TXT_TokenList, result.line_count);
|
||||
if(tokens_first != 0) ProfScope("grab per-line tokens")
|
||||
{
|
||||
TXT_Token *tokens_opl = buffer->tokens.v+buffer->tokens.count;
|
||||
U64 line_slice_idx = 0;
|
||||
for(TXT_Token *token = tokens_first; token < tokens_opl && line_slice_idx < result.line_count;)
|
||||
{
|
||||
if(token->range.min < result.line_ranges[line_slice_idx].max)
|
||||
{
|
||||
if(token->range.max > result.line_ranges[line_slice_idx].min)
|
||||
{
|
||||
txt_token_list_push(scratch.arena, &line_tokens_lists[line_slice_idx], token);
|
||||
}
|
||||
B32 need_token_advance = 0;
|
||||
B32 need_line_advance = 0;
|
||||
if(token->range.max >= result.line_ranges[line_slice_idx].max)
|
||||
{
|
||||
need_line_advance = 1;
|
||||
}
|
||||
if(token->range.max <= result.line_ranges[line_slice_idx].max)
|
||||
{
|
||||
need_token_advance += 1;
|
||||
}
|
||||
if(need_line_advance) { line_slice_idx += 1; }
|
||||
if(need_token_advance) { token += 1; }
|
||||
}
|
||||
else
|
||||
{
|
||||
line_slice_idx += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// rjf: bake per-line tokens to arrays
|
||||
for(U64 line_slice_idx = 0; line_slice_idx < result.line_count; line_slice_idx += 1)
|
||||
{
|
||||
result.line_tokens[line_slice_idx] = txt_token_array_from_list(arena, &line_tokens_lists[line_slice_idx]);
|
||||
}
|
||||
}
|
||||
}
|
||||
scratch_end(scratch);
|
||||
ProfEnd();
|
||||
return result;
|
||||
}
|
||||
|
||||
internal String8
|
||||
txti_string_from_handle_txt_rng(Arena *arena, TXTI_Handle handle, TxtRng range)
|
||||
{
|
||||
String8 result = {0};
|
||||
Temp scratch = scratch_begin(&arena, 1);
|
||||
{
|
||||
Rng1S64 line_range = r1s64(ClampBot(1, range.min.line), ClampBot(1, range.max.line));
|
||||
TXTI_BufferInfo info = txti_buffer_info_from_handle(scratch.arena, handle);
|
||||
TXTI_Slice slice = txti_slice_from_handle_line_range(scratch.arena, handle, line_range);
|
||||
String8List line_strings = {0};
|
||||
for(U64 line_idx = 0; line_idx < slice.line_count; line_idx += 1)
|
||||
{
|
||||
String8 line_text = slice.line_text[line_idx];
|
||||
if(line_idx == slice.line_count-1)
|
||||
{
|
||||
line_text = str8_prefix(line_text, range.max.column-1);
|
||||
}
|
||||
if(line_idx == 0)
|
||||
{
|
||||
line_text = str8_skip(line_text, range.min.column-1);
|
||||
}
|
||||
str8_list_push(scratch.arena, &line_strings, line_text);
|
||||
}
|
||||
StringJoin join = {0};
|
||||
switch(info.line_end_kind)
|
||||
{
|
||||
default:
|
||||
case TXT_LineEndKind_LF:{join.sep = str8_lit("\n");}break;
|
||||
case TXT_LineEndKind_CRLF:{join.sep = str8_lit("\r\n");}break;
|
||||
}
|
||||
result = str8_list_join(arena, &line_strings, &join);
|
||||
}
|
||||
scratch_end(scratch);
|
||||
return result;
|
||||
}
|
||||
|
||||
internal String8
|
||||
txti_string_from_handle_line_num(Arena *arena, TXTI_Handle handle, S64 line_num)
|
||||
{
|
||||
String8 result = {0};
|
||||
TXTI_Slice slice = txti_slice_from_handle_line_range(arena, handle, r1s64(line_num, line_num));
|
||||
if(slice.line_count != 0)
|
||||
{
|
||||
result = slice.line_text[0];
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
internal Rng1U64
|
||||
txti_expr_range_from_line_off_range_string_tokens(U64 off, Rng1U64 line_range, String8 line_text, TXT_TokenArray *line_tokens)
|
||||
{
|
||||
Rng1U64 result = {0};
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
{
|
||||
// rjf: unpack line info
|
||||
TXT_Token *line_tokens_first = line_tokens->v;
|
||||
TXT_Token *line_tokens_opl = line_tokens->v+line_tokens->count;
|
||||
|
||||
// rjf: find token containing `off`
|
||||
TXT_Token *pt_token = 0;
|
||||
for(TXT_Token *token = line_tokens_first;
|
||||
token < line_tokens_opl;
|
||||
token += 1)
|
||||
{
|
||||
if(contains_1u64(token->range, off))
|
||||
{
|
||||
Rng1U64 token_range_clamped = intersect_1u64(line_range, token->range);
|
||||
String8 token_string = str8_substr(line_text, r1u64(token_range_clamped.max - line_range.min, token_range_clamped.max - line_range.min));
|
||||
B32 token_ender = 0;
|
||||
switch(token->kind)
|
||||
{
|
||||
default:{}break;
|
||||
case TXT_TokenKind_Symbol:
|
||||
{
|
||||
token_ender = (str8_match(token_string, str8_lit("]"), 0));
|
||||
}break;
|
||||
case TXT_TokenKind_Identifier:
|
||||
case TXT_TokenKind_Keyword:
|
||||
case TXT_TokenKind_String:
|
||||
case TXT_TokenKind_Meta:
|
||||
{
|
||||
token_ender = 1;
|
||||
}break;
|
||||
}
|
||||
if(token_ender)
|
||||
{
|
||||
pt_token = token;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// rjf: found token containing `off`? -> mark that as our initial range
|
||||
if(pt_token != 0)
|
||||
{
|
||||
result = pt_token->range;
|
||||
}
|
||||
|
||||
// rjf: walk back from pt_token - try to find plausible start of expression
|
||||
if(pt_token != 0)
|
||||
{
|
||||
B32 walkback_done = 0;
|
||||
S32 nest = 0;
|
||||
for(TXT_Token *wb_token = pt_token;
|
||||
wb_token >= line_tokens_first && walkback_done == 0;
|
||||
wb_token -= 1)
|
||||
{
|
||||
Rng1U64 wb_token_range_clamped = intersect_1u64(line_range, wb_token->range);
|
||||
String8 wb_token_string = str8_substr(line_text, r1u64(wb_token_range_clamped.min - line_range.min, wb_token_range_clamped.max - line_range.min));
|
||||
B32 include_wb_token = 0;
|
||||
switch(wb_token->kind)
|
||||
{
|
||||
default:{}break;
|
||||
case TXT_TokenKind_Symbol:
|
||||
{
|
||||
B32 is_scope_resolution = str8_match(wb_token_string, str8_lit("::"), 0);
|
||||
B32 is_dot = str8_match(wb_token_string, str8_lit("."), 0);
|
||||
B32 is_arrow = str8_match(wb_token_string, str8_lit("->"), 0);
|
||||
B32 is_open_bracket = str8_match(wb_token_string, str8_lit("["), 0);
|
||||
B32 is_close_bracket = str8_match(wb_token_string, str8_lit("]"), 0);
|
||||
nest -= !!(is_open_bracket);
|
||||
nest += !!(is_close_bracket);
|
||||
if(is_scope_resolution ||
|
||||
is_dot ||
|
||||
is_arrow ||
|
||||
is_open_bracket||
|
||||
is_close_bracket)
|
||||
{
|
||||
include_wb_token = 1;
|
||||
}
|
||||
}break;
|
||||
case TXT_TokenKind_Identifier:
|
||||
{
|
||||
include_wb_token = 1;
|
||||
}break;
|
||||
}
|
||||
if(include_wb_token)
|
||||
{
|
||||
result = union_1u64(result, wb_token->range);
|
||||
}
|
||||
else if(nest == 0)
|
||||
{
|
||||
walkback_done = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
scratch_end(scratch);
|
||||
return result;
|
||||
}
|
||||
|
||||
internal TxtRng
|
||||
txti_expr_range_from_handle_pt(TXTI_Handle handle, TxtPt pt)
|
||||
{
|
||||
TxtRng result = {0};
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
TXTI_Slice slice = txti_slice_from_handle_line_range(scratch.arena, handle, r1s64(pt.line, pt.line));
|
||||
if(slice.line_count != 0)
|
||||
{
|
||||
// rjf: unpack line info
|
||||
String8 line_text = slice.line_text[0];
|
||||
Rng1U64 line_range = slice.line_ranges[0];
|
||||
TXT_TokenArray line_tokens = slice.line_tokens[0];
|
||||
TXT_Token *line_tokens_first = line_tokens.v;
|
||||
TXT_Token *line_tokens_opl = line_tokens.v+line_tokens.count;
|
||||
U64 pt_off = line_range.min + (pt.column-1);
|
||||
|
||||
// rjf: grab offset range of expression
|
||||
Rng1U64 expr_off_rng = txti_expr_range_from_line_off_range_string_tokens(pt_off, line_range, line_text, &line_tokens);
|
||||
|
||||
// rjf: convert offset range into text range
|
||||
result = txt_rng(txt_pt(pt.line, 1+(expr_off_rng.min-line_range.min)), txt_pt(pt.line, 1+(expr_off_rng.max-line_range.min)));
|
||||
}
|
||||
scratch_end(scratch);
|
||||
return result;
|
||||
}
|
||||
|
||||
//- rjf: buffer mutations
|
||||
|
||||
internal void
|
||||
txti_reload(TXTI_Handle handle, String8 path)
|
||||
{
|
||||
U64 hash = handle.u64[0];
|
||||
U64 id = handle.u64[1];
|
||||
U64 mut_thread_idx = id%txti_state->mut_thread_count;
|
||||
TXTI_MutThread *mut_thread = &txti_state->mut_threads[mut_thread_idx];
|
||||
OS_MutexScope(mut_thread->msg_mutex)
|
||||
{
|
||||
TXTI_MsgNode *node = push_array(mut_thread->msg_arena, TXTI_MsgNode, 1);
|
||||
TXTI_Msg *msg = &node->v;
|
||||
msg->kind = TXTI_MsgKind_Reload;
|
||||
msg->handle = handle;
|
||||
msg->string = push_str8_copy(mut_thread->msg_arena, path);
|
||||
SLLQueuePush(mut_thread->msg_list.first, mut_thread->msg_list.last, node);
|
||||
mut_thread->msg_list.count += 1;
|
||||
}
|
||||
os_condition_variable_broadcast(mut_thread->msg_cv);
|
||||
}
|
||||
|
||||
internal void
|
||||
txti_append(TXTI_Handle handle, String8 string)
|
||||
{
|
||||
U64 hash = handle.u64[0];
|
||||
U64 id = handle.u64[1];
|
||||
U64 mut_thread_idx = id%txti_state->mut_thread_count;
|
||||
TXTI_MutThread *mut_thread = &txti_state->mut_threads[mut_thread_idx];
|
||||
OS_MutexScope(mut_thread->msg_mutex)
|
||||
{
|
||||
TXTI_MsgNode *node = push_array(mut_thread->msg_arena, TXTI_MsgNode, 1);
|
||||
TXTI_Msg *msg = &node->v;
|
||||
msg->kind = TXTI_MsgKind_Append;
|
||||
msg->handle = handle;
|
||||
msg->string = push_str8_copy(mut_thread->msg_arena, string);
|
||||
SLLQueuePush(mut_thread->msg_list.first, mut_thread->msg_list.last, node);
|
||||
mut_thread->msg_list.count += 1;
|
||||
}
|
||||
os_condition_variable_broadcast(mut_thread->msg_cv);
|
||||
}
|
||||
|
||||
//- rjf: buffer external change detection enabling/disabling
|
||||
|
||||
internal void
|
||||
txti_set_external_change_detection_enabled(B32 enabled)
|
||||
{
|
||||
U64 enabled_u64 = (U64)enabled;
|
||||
ins_atomic_u64_eval_assign(&txti_state->detector_thread_enabled, enabled_u64);
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Mutator Threads
|
||||
|
||||
internal void
|
||||
txti_mut_thread_entry_point(void *p)
|
||||
{
|
||||
U64 mut_thread_idx = (U64)p;
|
||||
ThreadNameF("[txti] mut #%I64u", mut_thread_idx);
|
||||
TXTI_MutThread *mut_thread = &txti_state->mut_threads[mut_thread_idx];
|
||||
for(;;)
|
||||
{
|
||||
//- rjf: begin
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
|
||||
//- rjf: pull messages
|
||||
TXTI_MsgList msgs = {0};
|
||||
OS_MutexScope(mut_thread->msg_mutex) for(;;)
|
||||
{
|
||||
if(mut_thread->msg_list.count != 0)
|
||||
{
|
||||
msgs = txti_msg_list_deep_copy(scratch.arena, &mut_thread->msg_list);
|
||||
MemoryZeroStruct(&mut_thread->msg_list);
|
||||
arena_clear(mut_thread->msg_arena);
|
||||
break;
|
||||
}
|
||||
os_condition_variable_wait(mut_thread->msg_cv, mut_thread->msg_mutex, max_U64);
|
||||
}
|
||||
|
||||
//- rjf: process msgs
|
||||
for(TXTI_MsgNode *msg_n = msgs.first; msg_n != 0; msg_n = msg_n->next) ProfScope("process msg")
|
||||
{
|
||||
//- rjf: unpack message
|
||||
TXTI_Msg *msg = &msg_n->v;
|
||||
U64 hash = msg->handle.u64[0];
|
||||
U64 id = msg->handle.u64[1];
|
||||
U64 slot_idx = hash%txti_state->entity_map.slots_count;
|
||||
U64 stripe_idx = slot_idx%txti_state->entity_map_stripes.count;
|
||||
TXTI_EntitySlot *slot = &txti_state->entity_map.slots[slot_idx];
|
||||
TXTI_Stripe *stripe = &txti_state->entity_map_stripes.v[stripe_idx];
|
||||
|
||||
//- rjf: load file if we need it
|
||||
B32 load_valid = 0;
|
||||
String8 file_contents = {0};
|
||||
TXT_LangKind lang_kind = TXT_LangKind_Null;
|
||||
U64 timestamp = 0;
|
||||
if(msg->kind == TXTI_MsgKind_Reload) ProfScope("reload file")
|
||||
{
|
||||
FileProperties pre_load_props = os_properties_from_file_path(msg->string);
|
||||
OS_Handle file = os_file_open(OS_AccessFlag_Read|OS_AccessFlag_ShareRead|OS_AccessFlag_ShareWrite, msg->string);
|
||||
file_contents = os_string_from_file_range(scratch.arena, file, r1u64(0, pre_load_props.size));
|
||||
lang_kind = txt_lang_kind_from_extension(str8_skip_last_dot(msg->string));
|
||||
os_file_close(file);
|
||||
FileProperties post_load_props = os_properties_from_file_path(msg->string);
|
||||
load_valid = (post_load_props.modified == pre_load_props.modified);
|
||||
if(load_valid)
|
||||
{
|
||||
timestamp = pre_load_props.modified;
|
||||
}
|
||||
}
|
||||
|
||||
//- rjf: nonzero lang kind -> unpack lang info
|
||||
TXT_LangLexFunctionType *lex_function = txt_lex_function_from_lang_kind(lang_kind);
|
||||
|
||||
//- rjf: detect line end kind
|
||||
TXT_LineEndKind line_end_kind = TXT_LineEndKind_Null;
|
||||
if(load_valid)
|
||||
{
|
||||
U64 lf_count = 0;
|
||||
U64 cr_count = 0;
|
||||
for(U64 idx = 0; idx < file_contents.size && idx < 1024; idx += 1)
|
||||
{
|
||||
if(file_contents.str[idx] == '\r')
|
||||
{
|
||||
cr_count += 1;
|
||||
}
|
||||
if(file_contents.str[idx] == '\n')
|
||||
{
|
||||
lf_count += 1;
|
||||
}
|
||||
}
|
||||
if(cr_count >= lf_count/2 && lf_count >= 1)
|
||||
{
|
||||
line_end_kind = TXT_LineEndKind_CRLF;
|
||||
}
|
||||
else if(lf_count >= 1)
|
||||
{
|
||||
line_end_kind = TXT_LineEndKind_LF;
|
||||
}
|
||||
}
|
||||
|
||||
//- rjf: obtain initial buffer_apply_gen, reset byte processing counters
|
||||
U64 initial_buffer_apply_gen = 0;
|
||||
ProfScope("obtain initial buffer_apply_gen") OS_MutexScopeR(stripe->rw_mutex)
|
||||
{
|
||||
TXTI_Entity *entity = 0;
|
||||
for(TXTI_Entity *e = slot->first; e != 0; e = e->next)
|
||||
{
|
||||
if(e->id == id)
|
||||
{
|
||||
entity = e;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(entity != 0)
|
||||
{
|
||||
initial_buffer_apply_gen = entity->buffer_apply_gen;
|
||||
if(msg->kind == TXTI_MsgKind_Reload)
|
||||
{
|
||||
ins_atomic_u64_eval_assign(&entity->bytes_processed, 0);
|
||||
ins_atomic_u64_eval_assign(&entity->bytes_to_process, file_contents.size + !!lex_function*file_contents.size);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//- rjf: apply edits
|
||||
ProfScope("apply edits")
|
||||
{
|
||||
for(U64 buffer_apply_idx = 0;
|
||||
buffer_apply_idx < TXTI_ENTITY_BUFFER_COUNT;
|
||||
buffer_apply_idx += 1)
|
||||
ProfScope("apply edit #%i", (int)buffer_apply_idx)
|
||||
{
|
||||
// rjf: last buffer we're going to edit? -> bump buffer_apply_gen,
|
||||
// so that before we touch this last buffer, all readers of this
|
||||
// entity will get the already-modified buffers.
|
||||
if(buffer_apply_idx == TXTI_ENTITY_BUFFER_COUNT-1)
|
||||
{
|
||||
ProfScope("exclusive lock -> buffer swap") OS_MutexScopeW(stripe->rw_mutex)
|
||||
{
|
||||
TXTI_Entity *entity = 0;
|
||||
for(TXTI_Entity *e = slot->first; e != 0; e = e->next)
|
||||
{
|
||||
if(e->id == id)
|
||||
{
|
||||
entity = e;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(entity != 0)
|
||||
{
|
||||
entity->buffer_apply_gen += 1;
|
||||
if(line_end_kind != TXT_LineEndKind_Null)
|
||||
{
|
||||
entity->line_end_kind = line_end_kind;
|
||||
}
|
||||
if(lang_kind != TXT_LangKind_Null)
|
||||
{
|
||||
entity->lang_kind = lang_kind;
|
||||
}
|
||||
if(timestamp != 0)
|
||||
{
|
||||
entity->timestamp = timestamp;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// rjf: apply edit to this buffer.
|
||||
//
|
||||
// NOTE(rjf): all edits can apply *with a shared mutex lock*,
|
||||
// because only the mutator thread for this buffer can touch the
|
||||
// non-currently-viewable buffers. we only need to have an
|
||||
// exclusive lock to bump the buffer_apply_gen (to change the
|
||||
// actively viewable buffer).
|
||||
//
|
||||
ProfScope("apply edit") OS_MutexScopeR(stripe->rw_mutex)
|
||||
{
|
||||
TXTI_Entity *entity = 0;
|
||||
for(TXTI_Entity *e = slot->first; e != 0; e = e->next)
|
||||
{
|
||||
if(e->id == id)
|
||||
{
|
||||
entity = e;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(entity != 0)
|
||||
{
|
||||
TXTI_Buffer *buffer = &entity->buffers[(initial_buffer_apply_gen+1+buffer_apply_idx)%TXTI_ENTITY_BUFFER_COUNT];
|
||||
|
||||
// rjf: clear old analysis data
|
||||
arena_clear(buffer->analysis_arena);
|
||||
buffer->lines_count = 0;
|
||||
buffer->lines_ranges = 0;
|
||||
buffer->lines_max_size = 0;
|
||||
MemoryZeroStruct(&buffer->tokens);
|
||||
|
||||
// rjf: perform edit to buffer data
|
||||
switch(msg->kind)
|
||||
{
|
||||
default:{}break;
|
||||
|
||||
// rjf: replace range
|
||||
case TXTI_MsgKind_Append: ProfScope("append")
|
||||
{
|
||||
U8 *append_data_buffer = push_array_no_zero(buffer->data_arena, U8, msg->string.size);
|
||||
MemoryCopy(append_data_buffer, msg->string.str, msg->string.size);
|
||||
buffer->data.size += msg->string.size;
|
||||
if(buffer->data.str == 0 && msg->string.size != 0)
|
||||
{
|
||||
buffer->data.str = append_data_buffer;
|
||||
}
|
||||
}break;
|
||||
|
||||
// rjf: reload from disk
|
||||
case TXTI_MsgKind_Reload: ProfScope("reload")
|
||||
{
|
||||
arena_clear(buffer->data_arena);
|
||||
if(file_contents.size != 0)
|
||||
{
|
||||
buffer->data = push_str8_copy(buffer->data_arena, file_contents);
|
||||
}
|
||||
else
|
||||
{
|
||||
MemoryZeroStruct(&buffer->data);
|
||||
}
|
||||
}break;
|
||||
}
|
||||
|
||||
// rjf: parse & store line range info
|
||||
ProfScope("parse & store line range info")
|
||||
{
|
||||
// rjf: count # of lines
|
||||
U64 line_count = 1;
|
||||
U64 byte_process_start_idx = 0;
|
||||
for(U64 idx = 0; idx < buffer->data.size; idx += 1)
|
||||
{
|
||||
if(buffer_apply_idx == 0 && idx-byte_process_start_idx >= 1000)
|
||||
{
|
||||
ins_atomic_u64_add_eval(&entity->bytes_processed, (idx-byte_process_start_idx));
|
||||
byte_process_start_idx = idx;
|
||||
}
|
||||
if(buffer->data.str[idx] == '\n' || buffer->data.str[idx] == '\r')
|
||||
{
|
||||
line_count += 1;
|
||||
if(buffer->data.str[idx] == '\r')
|
||||
{
|
||||
idx += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// rjf: allocate & store line ranges
|
||||
ProfScope("allocate & store line ranges")
|
||||
{
|
||||
buffer->lines_count = line_count;
|
||||
buffer->lines_ranges = push_array_no_zero(buffer->analysis_arena, Rng1U64, buffer->lines_count);
|
||||
U64 line_idx = 0;
|
||||
U64 line_start_idx = 0;
|
||||
for(U64 idx = 0; idx <= buffer->data.size; idx += 1)
|
||||
{
|
||||
if(idx == buffer->data.size || buffer->data.str[idx] == '\n' || buffer->data.str[idx] == '\r')
|
||||
{
|
||||
Rng1U64 line_range = r1u64(line_start_idx, idx);
|
||||
U64 line_size = dim_1u64(line_range);
|
||||
buffer->lines_ranges[line_idx] = line_range;
|
||||
buffer->lines_max_size = Max(buffer->lines_max_size, line_size);
|
||||
line_idx += 1;
|
||||
line_start_idx = idx+1;
|
||||
if(idx < buffer->data.size && buffer->data.str[idx] == '\r')
|
||||
{
|
||||
line_start_idx += 1;
|
||||
idx += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// rjf: lex file contents
|
||||
if(lex_function != 0) ProfScope("lex text")
|
||||
{
|
||||
buffer->tokens = lex_function(buffer->analysis_arena, buffer_apply_idx == 0 ? &entity->bytes_processed : 0, buffer->data);
|
||||
}
|
||||
|
||||
// rjf: mark final process counter
|
||||
if(buffer_apply_idx == 0)
|
||||
{
|
||||
ins_atomic_u64_eval_assign(&entity->bytes_processed, entity->bytes_to_process);
|
||||
}
|
||||
|
||||
// rjf: mark task completion
|
||||
if(buffer_apply_idx == TXTI_ENTITY_BUFFER_COUNT-1)
|
||||
{
|
||||
ins_atomic_u64_eval_assign(&entity->working_count, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//- rjf: end
|
||||
scratch_end(scratch);
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Detector Thread
|
||||
|
||||
internal void
|
||||
txti_detector_thread_entry_point(void *p)
|
||||
{
|
||||
ThreadNameF("[txti] detector");
|
||||
for(;;)
|
||||
{
|
||||
if(ins_atomic_u64_eval(&txti_state->detector_thread_enabled))
|
||||
{
|
||||
U64 slots_per_stripe = txti_state->entity_map.slots_count/txti_state->entity_map_stripes.count;
|
||||
for(U64 stripe_idx = 0; stripe_idx < txti_state->entity_map_stripes.count; stripe_idx += 1)
|
||||
{
|
||||
TXTI_Stripe *stripe = &txti_state->entity_map_stripes.v[stripe_idx];
|
||||
OS_MutexScopeR(stripe->rw_mutex) for(U64 slot_in_stripe_idx = 0; slot_in_stripe_idx < slots_per_stripe; slot_in_stripe_idx += 1)
|
||||
{
|
||||
U64 slot_idx = stripe_idx*slots_per_stripe + slot_in_stripe_idx;
|
||||
TXTI_EntitySlot *slot = &txti_state->entity_map.slots[slot_idx];
|
||||
for(TXTI_Entity *entity = slot->first; entity != 0; entity = entity->next)
|
||||
{
|
||||
FileProperties props = os_properties_from_file_path(entity->path);
|
||||
U64 entity_timestamp = entity->timestamp;
|
||||
if(props.modified != entity_timestamp && ins_atomic_u64_eval(&entity->working_count) == 0)
|
||||
{
|
||||
TXTI_Handle handle = {txti_hash_from_string(entity->path), entity->id};
|
||||
txti_reload(handle, entity->path);
|
||||
ins_atomic_u64_inc_eval(&entity->working_count);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
os_sleep_milliseconds(100);
|
||||
}
|
||||
}
|
||||
-286
@@ -1,286 +0,0 @@
|
||||
// Copyright (c) 2024 Epic Games Tools
|
||||
// Licensed under the MIT license (https://opensource.org/license/mit/)
|
||||
|
||||
#ifndef TXTI_H
|
||||
#define TXTI_H
|
||||
|
||||
////////////////////////////////
|
||||
//~ NOTE(rjf): Text Info Layer Overview (8/30/2023)
|
||||
//
|
||||
// This layer's purpose is to provide access to a mutable cache of parsed
|
||||
// information about textual data, backed by filesystem contents. This
|
||||
// cache associates unique handles (`TXTI_Handle`) with "entities", where
|
||||
// entities contain information about textual contents of each line, how many
|
||||
// lines of text the entity contains, and the tokenization of each line.
|
||||
//
|
||||
// While it is generally correct for a debugger to only provide read-only UIs
|
||||
// for text viewing (so that the user does not mistakenly modify a buffer and
|
||||
// continue debugging with it, even if the line or symbol info is no longer
|
||||
// reflective of the source code), there are cases where read/write buffers are
|
||||
// useful, and so this layer needs to support that, and the disabling of writes
|
||||
// can remain as a high-level UI decision (rather than a lack of capability of
|
||||
// the debugger). Mutable buffers may be used for editing config files (or
|
||||
// otherwise any files that are not relevant to actively-used debug info),
|
||||
// or debug logs.
|
||||
//
|
||||
// This layer is also responsible for hot-reloading changed files from disk,
|
||||
// *and* for reporting conflicts, if a buffer was mutated within the process,
|
||||
// but was also modified on disk.
|
||||
//
|
||||
// In order to avoid hanging UI while larger files are being edited or lexed,
|
||||
// all buffer loading, mutation, & parsing happen on "mutator threads". These
|
||||
// threads consume messages (`TXTI_Msg`), which command them to reload a file
|
||||
// from disk, or to replace textual ranges in a buffer. After completing those
|
||||
// operations, the buffer is lexed/parsed.
|
||||
//
|
||||
// Entities have *two* buffer data structures -- this allows a mutator thread
|
||||
// to apply edits to one while the other can be read by user threads. For each
|
||||
// editing operation, the mutator threads apply identical operations in a
|
||||
// *rotation-based* order. If the currently-viewable buffer is slot 0, the edit
|
||||
// will first be applied to slot 1, and before edits are reflected in slot 0,
|
||||
// the mutator thread will bump a "buffer mutation counter", such that before
|
||||
// any edits are made to slot 0, the viewable buffer is changed to being within
|
||||
// slot *1*.
|
||||
//
|
||||
// Importantly, entities map to a *unique* mutator thread -- it is not possible
|
||||
// for multiple mutator threads to be attempting to write to the same entity at
|
||||
// the same time, as this could not produce meaningful or coherent results.
|
||||
// This way, all edits to each entity are applied serially.
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Handle Type
|
||||
|
||||
typedef struct TXTI_Handle TXTI_Handle;
|
||||
struct TXTI_Handle
|
||||
{
|
||||
U64 u64[2];
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Buffer Entity Types
|
||||
|
||||
#define TXTI_ENTITY_BUFFER_COUNT 2
|
||||
|
||||
typedef struct TXTI_Buffer TXTI_Buffer;
|
||||
struct TXTI_Buffer
|
||||
{
|
||||
// rjf: arenas
|
||||
Arena *data_arena;
|
||||
Arena *analysis_arena;
|
||||
|
||||
// rjf: raw textual data
|
||||
String8 data;
|
||||
|
||||
// rjf: line range info
|
||||
U64 lines_count;
|
||||
Rng1U64 *lines_ranges;
|
||||
U64 lines_max_size;
|
||||
|
||||
// rjf: tokens
|
||||
TXT_TokenArray tokens;
|
||||
};
|
||||
|
||||
typedef struct TXTI_Entity TXTI_Entity;
|
||||
struct TXTI_Entity
|
||||
{
|
||||
// rjf: top-level info
|
||||
TXTI_Entity *next;
|
||||
String8 path;
|
||||
U64 id;
|
||||
U64 timestamp;
|
||||
U64 mut_gen;
|
||||
|
||||
// rjf: metadata
|
||||
TXT_LineEndKind line_end_kind;
|
||||
TXT_LangKind lang_kind;
|
||||
U64 bytes_processed;
|
||||
U64 bytes_to_process;
|
||||
U64 working_count;
|
||||
|
||||
// rjf: double-buffered mutable text buffers
|
||||
U64 buffer_apply_gen;
|
||||
TXTI_Buffer buffers[TXTI_ENTITY_BUFFER_COUNT];
|
||||
};
|
||||
|
||||
typedef struct TXTI_EntitySlot TXTI_EntitySlot;
|
||||
struct TXTI_EntitySlot
|
||||
{
|
||||
TXTI_Entity *first;
|
||||
TXTI_Entity *last;
|
||||
};
|
||||
|
||||
typedef struct TXTI_EntityMap TXTI_EntityMap;
|
||||
struct TXTI_EntityMap
|
||||
{
|
||||
U64 slots_count;
|
||||
TXTI_EntitySlot *slots;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Striped Access Types
|
||||
|
||||
typedef struct TXTI_Stripe TXTI_Stripe;
|
||||
struct TXTI_Stripe
|
||||
{
|
||||
Arena *arena;
|
||||
OS_Handle cv;
|
||||
OS_Handle rw_mutex;
|
||||
};
|
||||
|
||||
typedef struct TXTI_StripeTable TXTI_StripeTable;
|
||||
struct TXTI_StripeTable
|
||||
{
|
||||
U64 count;
|
||||
TXTI_Stripe *v;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Entity Introspection Result Types
|
||||
|
||||
typedef struct TXTI_BufferInfo TXTI_BufferInfo;
|
||||
struct TXTI_BufferInfo
|
||||
{
|
||||
String8 path;
|
||||
U64 timestamp;
|
||||
TXT_LineEndKind line_end_kind;
|
||||
TXT_LangKind lang_kind;
|
||||
U64 total_line_count;
|
||||
U64 last_line_size;
|
||||
U64 max_line_size;
|
||||
U64 mut_gen;
|
||||
U64 buffer_apply_gen;
|
||||
U64 bytes_processed;
|
||||
U64 bytes_to_process;
|
||||
};
|
||||
|
||||
typedef struct TXTI_Slice TXTI_Slice;
|
||||
struct TXTI_Slice
|
||||
{
|
||||
U64 line_count;
|
||||
String8 *line_text;
|
||||
Rng1U64 *line_ranges;
|
||||
TXT_TokenArray *line_tokens;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: User -> Mutator Thread Messages
|
||||
|
||||
typedef enum TXTI_MsgKind
|
||||
{
|
||||
TXTI_MsgKind_Null,
|
||||
TXTI_MsgKind_Append,
|
||||
TXTI_MsgKind_Reload,
|
||||
TXTI_MsgKind_COUNT
|
||||
}
|
||||
TXTI_MsgKind;
|
||||
|
||||
typedef struct TXTI_Msg TXTI_Msg;
|
||||
struct TXTI_Msg
|
||||
{
|
||||
TXTI_MsgKind kind;
|
||||
TXTI_Handle handle;
|
||||
String8 string;
|
||||
};
|
||||
|
||||
typedef struct TXTI_MsgNode TXTI_MsgNode;
|
||||
struct TXTI_MsgNode
|
||||
{
|
||||
TXTI_MsgNode *next;
|
||||
TXTI_Msg v;
|
||||
};
|
||||
|
||||
typedef struct TXTI_MsgList TXTI_MsgList;
|
||||
struct TXTI_MsgList
|
||||
{
|
||||
TXTI_MsgNode *first;
|
||||
TXTI_MsgNode *last;
|
||||
U64 count;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Central State
|
||||
|
||||
typedef struct TXTI_MutThread TXTI_MutThread;
|
||||
struct TXTI_MutThread
|
||||
{
|
||||
OS_Handle thread;
|
||||
Arena *msg_arena;
|
||||
TXTI_MsgList msg_list;
|
||||
OS_Handle msg_mutex;
|
||||
OS_Handle msg_cv;
|
||||
};
|
||||
|
||||
typedef struct TXTI_State TXTI_State;
|
||||
struct TXTI_State
|
||||
{
|
||||
// rjf: arena
|
||||
Arena *arena;
|
||||
|
||||
// rjf: entities state
|
||||
TXTI_EntityMap entity_map;
|
||||
TXTI_StripeTable entity_map_stripes;
|
||||
U64 entity_id_gen;
|
||||
|
||||
// rjf: mutator threads
|
||||
U64 mut_thread_count;
|
||||
TXTI_MutThread *mut_threads;
|
||||
|
||||
// rjf: detector thread
|
||||
U64 detector_thread_enabled;
|
||||
OS_Handle detector_thread;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Globals
|
||||
|
||||
global TXTI_State *txti_state = 0;
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Main Layer Initialization
|
||||
|
||||
internal void txti_init(void);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Basic Helpers
|
||||
|
||||
internal U64 txti_hash_from_string(String8 string);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Message Type Functions
|
||||
|
||||
internal void txti_msg_list_push(Arena *arena, TXTI_MsgList *msgs, TXTI_Msg *msg);
|
||||
internal void txti_msg_list_concat_in_place(TXTI_MsgList *dst, TXTI_MsgList *src);
|
||||
internal TXTI_MsgList txti_msg_list_deep_copy(Arena *arena, TXTI_MsgList *src);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Entities API
|
||||
|
||||
//- rjf: opening entities & correllation w/ path
|
||||
internal TXTI_Handle txti_handle_from_path(String8 path);
|
||||
|
||||
//- rjf: buffer introspection
|
||||
internal TXTI_BufferInfo txti_buffer_info_from_handle(Arena *arena, TXTI_Handle handle);
|
||||
internal TXTI_Slice txti_slice_from_handle_line_range(Arena *arena, TXTI_Handle handle, Rng1S64 line_range);
|
||||
internal String8 txti_string_from_handle_txt_rng(Arena *arena, TXTI_Handle handle, TxtRng range);
|
||||
internal String8 txti_string_from_handle_line_num(Arena *arena, TXTI_Handle handle, S64 line_num);
|
||||
internal Rng1U64 txti_expr_range_from_line_off_range_string_tokens(U64 off, Rng1U64 line_range, String8 line_text, TXT_TokenArray *line_tokens);
|
||||
internal TxtRng txti_expr_range_from_handle_pt(TXTI_Handle handle, TxtPt pt);
|
||||
|
||||
//- rjf: buffer mutations
|
||||
internal void txti_reload(TXTI_Handle handle, String8 path);
|
||||
internal void txti_append(TXTI_Handle handle, String8 string);
|
||||
|
||||
//- rjf: buffer external change detection enabling/disabling
|
||||
internal void txti_set_external_change_detection_enabled(B32 enabled);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Mutator Threads
|
||||
|
||||
internal void txti_mut_thread_entry_point(void *p);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Detector Thread
|
||||
|
||||
internal void txti_detector_thread_entry_point(void *p);
|
||||
|
||||
#endif //TXTI_H
|
||||
@@ -1056,7 +1056,7 @@ tg_data_members_from_graph_rdi_key(Arena *arena, TG_Graph *graph, RDI_Parsed *rd
|
||||
//- rjf: sort array by offset if needed
|
||||
if(members_need_offset_sort)
|
||||
{
|
||||
qsort(members.v, members.count, sizeof(TG_Member), (int (*)(const void *, const void *))tg_qsort_compare_members_offset);
|
||||
quick_sort(members.v, members.count, sizeof(TG_Member), tg_qsort_compare_members_offset);
|
||||
}
|
||||
|
||||
//- rjf: find all padding instances
|
||||
@@ -1114,7 +1114,7 @@ tg_data_members_from_graph_rdi_key(Arena *arena, TG_Graph *graph, RDI_Parsed *rd
|
||||
padding_member->kind = TG_MemberKind_Padding;
|
||||
padding_member->type_key = tg_cons_type_make(graph, TG_Kind_Array, tg_key_basic(TG_Kind_U8), n->size);
|
||||
padding_member->off = n->off;
|
||||
padding_member->name = str8_lit("[padding]");
|
||||
padding_member->name = str8_lit("padding");
|
||||
padding_idx += 1;
|
||||
}
|
||||
members = new_members;
|
||||
|
||||
+18
-36
@@ -16,17 +16,14 @@
|
||||
#define UI_FocusHot(v) DeferLoop(ui_push_focus_hot(v), ui_pop_focus_hot())
|
||||
#define UI_FocusActive(v) DeferLoop(ui_push_focus_active(v), ui_pop_focus_active())
|
||||
#define UI_FastpathCodepoint(v) DeferLoop(ui_push_fastpath_codepoint(v), ui_pop_fastpath_codepoint())
|
||||
#define UI_GroupKey(v) DeferLoop(ui_push_group_key(v), ui_pop_group_key())
|
||||
#define UI_Transparency(v) DeferLoop(ui_push_transparency(v), ui_pop_transparency())
|
||||
#define UI_BackgroundColor(v) DeferLoop(ui_push_background_color(v), ui_pop_background_color())
|
||||
#define UI_TextColor(v) DeferLoop(ui_push_text_color(v), ui_pop_text_color())
|
||||
#define UI_BorderColor(v) DeferLoop(ui_push_border_color(v), ui_pop_border_color())
|
||||
#define UI_OverlayColor(v) DeferLoop(ui_push_overlay_color(v), ui_pop_overlay_color())
|
||||
#define UI_TextSelectColor(v) DeferLoop(ui_push_text_select_color(v), ui_pop_text_select_color())
|
||||
#define UI_TextCursorColor(v) DeferLoop(ui_push_text_cursor_color(v), ui_pop_text_cursor_color())
|
||||
#define UI_Palette(v) DeferLoop(ui_push_palette(v), ui_pop_palette())
|
||||
#define UI_Squish(v) DeferLoop(ui_push_squish(v), ui_pop_squish())
|
||||
#define UI_HoverCursor(v) DeferLoop(ui_push_hover_cursor(v), ui_pop_hover_cursor())
|
||||
#define UI_Font(v) DeferLoop(ui_push_font(v), ui_pop_font())
|
||||
#define UI_FontSize(v) DeferLoop(ui_push_font_size(v), ui_pop_font_size())
|
||||
#define UI_RunFlags(v) DeferLoop(ui_push_run_flags(v), ui_pop_run_flags())
|
||||
#define UI_TabSize(v) DeferLoop(ui_push_tab_size(v), ui_pop_tab_size())
|
||||
#define UI_CornerRadius00(v) DeferLoop(ui_push_corner_radius_00(v), ui_pop_corner_radius_00())
|
||||
#define UI_CornerRadius01(v) DeferLoop(ui_push_corner_radius_01(v), ui_pop_corner_radius_01())
|
||||
@@ -48,17 +45,14 @@ internal UI_BoxFlags ui_top_flags(void) { UI_StackTopImpl(ui_state, Flags, flags
|
||||
internal UI_FocusKind ui_top_focus_hot(void) { UI_StackTopImpl(ui_state, FocusHot, focus_hot) }
|
||||
internal UI_FocusKind ui_top_focus_active(void) { UI_StackTopImpl(ui_state, FocusActive, focus_active) }
|
||||
internal U32 ui_top_fastpath_codepoint(void) { UI_StackTopImpl(ui_state, FastpathCodepoint, fastpath_codepoint) }
|
||||
internal UI_Key ui_top_group_key(void) { UI_StackTopImpl(ui_state, GroupKey, group_key) }
|
||||
internal F32 ui_top_transparency(void) { UI_StackTopImpl(ui_state, Transparency, transparency) }
|
||||
internal Vec4F32 ui_top_background_color(void) { UI_StackTopImpl(ui_state, BackgroundColor, background_color) }
|
||||
internal Vec4F32 ui_top_text_color(void) { UI_StackTopImpl(ui_state, TextColor, text_color) }
|
||||
internal Vec4F32 ui_top_border_color(void) { UI_StackTopImpl(ui_state, BorderColor, border_color) }
|
||||
internal Vec4F32 ui_top_overlay_color(void) { UI_StackTopImpl(ui_state, OverlayColor, overlay_color) }
|
||||
internal Vec4F32 ui_top_text_select_color(void) { UI_StackTopImpl(ui_state, TextSelectColor, text_select_color) }
|
||||
internal Vec4F32 ui_top_text_cursor_color(void) { UI_StackTopImpl(ui_state, TextCursorColor, text_cursor_color) }
|
||||
internal UI_Palette* ui_top_palette(void) { UI_StackTopImpl(ui_state, Palette, palette) }
|
||||
internal F32 ui_top_squish(void) { UI_StackTopImpl(ui_state, Squish, squish) }
|
||||
internal OS_Cursor ui_top_hover_cursor(void) { UI_StackTopImpl(ui_state, HoverCursor, hover_cursor) }
|
||||
internal F_Tag ui_top_font(void) { UI_StackTopImpl(ui_state, Font, font) }
|
||||
internal F32 ui_top_font_size(void) { UI_StackTopImpl(ui_state, FontSize, font_size) }
|
||||
internal F_RunFlags ui_top_run_flags(void) { UI_StackTopImpl(ui_state, RunFlags, run_flags) }
|
||||
internal F32 ui_top_tab_size(void) { UI_StackTopImpl(ui_state, TabSize, tab_size) }
|
||||
internal F32 ui_top_corner_radius_00(void) { UI_StackTopImpl(ui_state, CornerRadius00, corner_radius_00) }
|
||||
internal F32 ui_top_corner_radius_01(void) { UI_StackTopImpl(ui_state, CornerRadius01, corner_radius_01) }
|
||||
@@ -79,17 +73,14 @@ internal UI_BoxFlags ui_bottom_flags(void) { UI_StackBottomImpl(ui_state, Flags,
|
||||
internal UI_FocusKind ui_bottom_focus_hot(void) { UI_StackBottomImpl(ui_state, FocusHot, focus_hot) }
|
||||
internal UI_FocusKind ui_bottom_focus_active(void) { UI_StackBottomImpl(ui_state, FocusActive, focus_active) }
|
||||
internal U32 ui_bottom_fastpath_codepoint(void) { UI_StackBottomImpl(ui_state, FastpathCodepoint, fastpath_codepoint) }
|
||||
internal UI_Key ui_bottom_group_key(void) { UI_StackBottomImpl(ui_state, GroupKey, group_key) }
|
||||
internal F32 ui_bottom_transparency(void) { UI_StackBottomImpl(ui_state, Transparency, transparency) }
|
||||
internal Vec4F32 ui_bottom_background_color(void) { UI_StackBottomImpl(ui_state, BackgroundColor, background_color) }
|
||||
internal Vec4F32 ui_bottom_text_color(void) { UI_StackBottomImpl(ui_state, TextColor, text_color) }
|
||||
internal Vec4F32 ui_bottom_border_color(void) { UI_StackBottomImpl(ui_state, BorderColor, border_color) }
|
||||
internal Vec4F32 ui_bottom_overlay_color(void) { UI_StackBottomImpl(ui_state, OverlayColor, overlay_color) }
|
||||
internal Vec4F32 ui_bottom_text_select_color(void) { UI_StackBottomImpl(ui_state, TextSelectColor, text_select_color) }
|
||||
internal Vec4F32 ui_bottom_text_cursor_color(void) { UI_StackBottomImpl(ui_state, TextCursorColor, text_cursor_color) }
|
||||
internal UI_Palette* ui_bottom_palette(void) { UI_StackBottomImpl(ui_state, Palette, palette) }
|
||||
internal F32 ui_bottom_squish(void) { UI_StackBottomImpl(ui_state, Squish, squish) }
|
||||
internal OS_Cursor ui_bottom_hover_cursor(void) { UI_StackBottomImpl(ui_state, HoverCursor, hover_cursor) }
|
||||
internal F_Tag ui_bottom_font(void) { UI_StackBottomImpl(ui_state, Font, font) }
|
||||
internal F32 ui_bottom_font_size(void) { UI_StackBottomImpl(ui_state, FontSize, font_size) }
|
||||
internal F_RunFlags ui_bottom_run_flags(void) { UI_StackBottomImpl(ui_state, RunFlags, run_flags) }
|
||||
internal F32 ui_bottom_tab_size(void) { UI_StackBottomImpl(ui_state, TabSize, tab_size) }
|
||||
internal F32 ui_bottom_corner_radius_00(void) { UI_StackBottomImpl(ui_state, CornerRadius00, corner_radius_00) }
|
||||
internal F32 ui_bottom_corner_radius_01(void) { UI_StackBottomImpl(ui_state, CornerRadius01, corner_radius_01) }
|
||||
@@ -110,17 +101,14 @@ internal UI_BoxFlags ui_push_flags(UI_BoxFlags v) { UI_StackPushImpl(ui_state, F
|
||||
internal UI_FocusKind ui_push_focus_hot(UI_FocusKind v) { UI_StackPushImpl(ui_state, FocusHot, focus_hot, UI_FocusKind, v) }
|
||||
internal UI_FocusKind ui_push_focus_active(UI_FocusKind v) { UI_StackPushImpl(ui_state, FocusActive, focus_active, UI_FocusKind, v) }
|
||||
internal U32 ui_push_fastpath_codepoint(U32 v) { UI_StackPushImpl(ui_state, FastpathCodepoint, fastpath_codepoint, U32, v) }
|
||||
internal UI_Key ui_push_group_key(UI_Key v) { UI_StackPushImpl(ui_state, GroupKey, group_key, UI_Key, v) }
|
||||
internal F32 ui_push_transparency(F32 v) { UI_StackPushImpl(ui_state, Transparency, transparency, F32, v) }
|
||||
internal Vec4F32 ui_push_background_color(Vec4F32 v) { UI_StackPushImpl(ui_state, BackgroundColor, background_color, Vec4F32, v) }
|
||||
internal Vec4F32 ui_push_text_color(Vec4F32 v) { UI_StackPushImpl(ui_state, TextColor, text_color, Vec4F32, v) }
|
||||
internal Vec4F32 ui_push_border_color(Vec4F32 v) { UI_StackPushImpl(ui_state, BorderColor, border_color, Vec4F32, v) }
|
||||
internal Vec4F32 ui_push_overlay_color(Vec4F32 v) { UI_StackPushImpl(ui_state, OverlayColor, overlay_color, Vec4F32, v) }
|
||||
internal Vec4F32 ui_push_text_select_color(Vec4F32 v) { UI_StackPushImpl(ui_state, TextSelectColor, text_select_color, Vec4F32, v) }
|
||||
internal Vec4F32 ui_push_text_cursor_color(Vec4F32 v) { UI_StackPushImpl(ui_state, TextCursorColor, text_cursor_color, Vec4F32, v) }
|
||||
internal UI_Palette* ui_push_palette(UI_Palette* v) { UI_StackPushImpl(ui_state, Palette, palette, UI_Palette* , v) }
|
||||
internal F32 ui_push_squish(F32 v) { UI_StackPushImpl(ui_state, Squish, squish, F32, v) }
|
||||
internal OS_Cursor ui_push_hover_cursor(OS_Cursor v) { UI_StackPushImpl(ui_state, HoverCursor, hover_cursor, OS_Cursor, v) }
|
||||
internal F_Tag ui_push_font(F_Tag v) { UI_StackPushImpl(ui_state, Font, font, F_Tag, v) }
|
||||
internal F32 ui_push_font_size(F32 v) { UI_StackPushImpl(ui_state, FontSize, font_size, F32, v) }
|
||||
internal F_RunFlags ui_push_run_flags(F_RunFlags v) { UI_StackPushImpl(ui_state, RunFlags, run_flags, F_RunFlags, v) }
|
||||
internal F32 ui_push_tab_size(F32 v) { UI_StackPushImpl(ui_state, TabSize, tab_size, F32, v) }
|
||||
internal F32 ui_push_corner_radius_00(F32 v) { UI_StackPushImpl(ui_state, CornerRadius00, corner_radius_00, F32, v) }
|
||||
internal F32 ui_push_corner_radius_01(F32 v) { UI_StackPushImpl(ui_state, CornerRadius01, corner_radius_01, F32, v) }
|
||||
@@ -141,17 +129,14 @@ internal UI_BoxFlags ui_pop_flags(void) { UI_StackPopImpl(ui_state, Flags, flags
|
||||
internal UI_FocusKind ui_pop_focus_hot(void) { UI_StackPopImpl(ui_state, FocusHot, focus_hot) }
|
||||
internal UI_FocusKind ui_pop_focus_active(void) { UI_StackPopImpl(ui_state, FocusActive, focus_active) }
|
||||
internal U32 ui_pop_fastpath_codepoint(void) { UI_StackPopImpl(ui_state, FastpathCodepoint, fastpath_codepoint) }
|
||||
internal UI_Key ui_pop_group_key(void) { UI_StackPopImpl(ui_state, GroupKey, group_key) }
|
||||
internal F32 ui_pop_transparency(void) { UI_StackPopImpl(ui_state, Transparency, transparency) }
|
||||
internal Vec4F32 ui_pop_background_color(void) { UI_StackPopImpl(ui_state, BackgroundColor, background_color) }
|
||||
internal Vec4F32 ui_pop_text_color(void) { UI_StackPopImpl(ui_state, TextColor, text_color) }
|
||||
internal Vec4F32 ui_pop_border_color(void) { UI_StackPopImpl(ui_state, BorderColor, border_color) }
|
||||
internal Vec4F32 ui_pop_overlay_color(void) { UI_StackPopImpl(ui_state, OverlayColor, overlay_color) }
|
||||
internal Vec4F32 ui_pop_text_select_color(void) { UI_StackPopImpl(ui_state, TextSelectColor, text_select_color) }
|
||||
internal Vec4F32 ui_pop_text_cursor_color(void) { UI_StackPopImpl(ui_state, TextCursorColor, text_cursor_color) }
|
||||
internal UI_Palette* ui_pop_palette(void) { UI_StackPopImpl(ui_state, Palette, palette) }
|
||||
internal F32 ui_pop_squish(void) { UI_StackPopImpl(ui_state, Squish, squish) }
|
||||
internal OS_Cursor ui_pop_hover_cursor(void) { UI_StackPopImpl(ui_state, HoverCursor, hover_cursor) }
|
||||
internal F_Tag ui_pop_font(void) { UI_StackPopImpl(ui_state, Font, font) }
|
||||
internal F32 ui_pop_font_size(void) { UI_StackPopImpl(ui_state, FontSize, font_size) }
|
||||
internal F_RunFlags ui_pop_run_flags(void) { UI_StackPopImpl(ui_state, RunFlags, run_flags) }
|
||||
internal F32 ui_pop_tab_size(void) { UI_StackPopImpl(ui_state, TabSize, tab_size) }
|
||||
internal F32 ui_pop_corner_radius_00(void) { UI_StackPopImpl(ui_state, CornerRadius00, corner_radius_00) }
|
||||
internal F32 ui_pop_corner_radius_01(void) { UI_StackPopImpl(ui_state, CornerRadius01, corner_radius_01) }
|
||||
@@ -172,17 +157,14 @@ internal UI_BoxFlags ui_set_next_flags(UI_BoxFlags v) { UI_StackSetNextImpl(ui_s
|
||||
internal UI_FocusKind ui_set_next_focus_hot(UI_FocusKind v) { UI_StackSetNextImpl(ui_state, FocusHot, focus_hot, UI_FocusKind, v) }
|
||||
internal UI_FocusKind ui_set_next_focus_active(UI_FocusKind v) { UI_StackSetNextImpl(ui_state, FocusActive, focus_active, UI_FocusKind, v) }
|
||||
internal U32 ui_set_next_fastpath_codepoint(U32 v) { UI_StackSetNextImpl(ui_state, FastpathCodepoint, fastpath_codepoint, U32, v) }
|
||||
internal UI_Key ui_set_next_group_key(UI_Key v) { UI_StackSetNextImpl(ui_state, GroupKey, group_key, UI_Key, v) }
|
||||
internal F32 ui_set_next_transparency(F32 v) { UI_StackSetNextImpl(ui_state, Transparency, transparency, F32, v) }
|
||||
internal Vec4F32 ui_set_next_background_color(Vec4F32 v) { UI_StackSetNextImpl(ui_state, BackgroundColor, background_color, Vec4F32, v) }
|
||||
internal Vec4F32 ui_set_next_text_color(Vec4F32 v) { UI_StackSetNextImpl(ui_state, TextColor, text_color, Vec4F32, v) }
|
||||
internal Vec4F32 ui_set_next_border_color(Vec4F32 v) { UI_StackSetNextImpl(ui_state, BorderColor, border_color, Vec4F32, v) }
|
||||
internal Vec4F32 ui_set_next_overlay_color(Vec4F32 v) { UI_StackSetNextImpl(ui_state, OverlayColor, overlay_color, Vec4F32, v) }
|
||||
internal Vec4F32 ui_set_next_text_select_color(Vec4F32 v) { UI_StackSetNextImpl(ui_state, TextSelectColor, text_select_color, Vec4F32, v) }
|
||||
internal Vec4F32 ui_set_next_text_cursor_color(Vec4F32 v) { UI_StackSetNextImpl(ui_state, TextCursorColor, text_cursor_color, Vec4F32, v) }
|
||||
internal UI_Palette* ui_set_next_palette(UI_Palette* v) { UI_StackSetNextImpl(ui_state, Palette, palette, UI_Palette* , v) }
|
||||
internal F32 ui_set_next_squish(F32 v) { UI_StackSetNextImpl(ui_state, Squish, squish, F32, v) }
|
||||
internal OS_Cursor ui_set_next_hover_cursor(OS_Cursor v) { UI_StackSetNextImpl(ui_state, HoverCursor, hover_cursor, OS_Cursor, v) }
|
||||
internal F_Tag ui_set_next_font(F_Tag v) { UI_StackSetNextImpl(ui_state, Font, font, F_Tag, v) }
|
||||
internal F32 ui_set_next_font_size(F32 v) { UI_StackSetNextImpl(ui_state, FontSize, font_size, F32, v) }
|
||||
internal F_RunFlags ui_set_next_run_flags(F_RunFlags v) { UI_StackSetNextImpl(ui_state, RunFlags, run_flags, F_RunFlags, v) }
|
||||
internal F32 ui_set_next_tab_size(F32 v) { UI_StackSetNextImpl(ui_state, TabSize, tab_size, F32, v) }
|
||||
internal F32 ui_set_next_corner_radius_00(F32 v) { UI_StackSetNextImpl(ui_state, CornerRadius00, corner_radius_00, F32, v) }
|
||||
internal F32 ui_set_next_corner_radius_01(F32 v) { UI_StackSetNextImpl(ui_state, CornerRadius01, corner_radius_01, F32, v) }
|
||||
|
||||
+33
-66
@@ -18,17 +18,14 @@ typedef struct UI_FlagsNode UI_FlagsNode; struct UI_FlagsNode{UI_FlagsNode *next
|
||||
typedef struct UI_FocusHotNode UI_FocusHotNode; struct UI_FocusHotNode{UI_FocusHotNode *next; UI_FocusKind v;};
|
||||
typedef struct UI_FocusActiveNode UI_FocusActiveNode; struct UI_FocusActiveNode{UI_FocusActiveNode *next; UI_FocusKind v;};
|
||||
typedef struct UI_FastpathCodepointNode UI_FastpathCodepointNode; struct UI_FastpathCodepointNode{UI_FastpathCodepointNode *next; U32 v;};
|
||||
typedef struct UI_GroupKeyNode UI_GroupKeyNode; struct UI_GroupKeyNode{UI_GroupKeyNode *next; UI_Key v;};
|
||||
typedef struct UI_TransparencyNode UI_TransparencyNode; struct UI_TransparencyNode{UI_TransparencyNode *next; F32 v;};
|
||||
typedef struct UI_BackgroundColorNode UI_BackgroundColorNode; struct UI_BackgroundColorNode{UI_BackgroundColorNode *next; Vec4F32 v;};
|
||||
typedef struct UI_TextColorNode UI_TextColorNode; struct UI_TextColorNode{UI_TextColorNode *next; Vec4F32 v;};
|
||||
typedef struct UI_BorderColorNode UI_BorderColorNode; struct UI_BorderColorNode{UI_BorderColorNode *next; Vec4F32 v;};
|
||||
typedef struct UI_OverlayColorNode UI_OverlayColorNode; struct UI_OverlayColorNode{UI_OverlayColorNode *next; Vec4F32 v;};
|
||||
typedef struct UI_TextSelectColorNode UI_TextSelectColorNode; struct UI_TextSelectColorNode{UI_TextSelectColorNode *next; Vec4F32 v;};
|
||||
typedef struct UI_TextCursorColorNode UI_TextCursorColorNode; struct UI_TextCursorColorNode{UI_TextCursorColorNode *next; Vec4F32 v;};
|
||||
typedef struct UI_PaletteNode UI_PaletteNode; struct UI_PaletteNode{UI_PaletteNode *next; UI_Palette* v;};
|
||||
typedef struct UI_SquishNode UI_SquishNode; struct UI_SquishNode{UI_SquishNode *next; F32 v;};
|
||||
typedef struct UI_HoverCursorNode UI_HoverCursorNode; struct UI_HoverCursorNode{UI_HoverCursorNode *next; OS_Cursor v;};
|
||||
typedef struct UI_FontNode UI_FontNode; struct UI_FontNode{UI_FontNode *next; F_Tag v;};
|
||||
typedef struct UI_FontSizeNode UI_FontSizeNode; struct UI_FontSizeNode{UI_FontSizeNode *next; F32 v;};
|
||||
typedef struct UI_RunFlagsNode UI_RunFlagsNode; struct UI_RunFlagsNode{UI_RunFlagsNode *next; F_RunFlags v;};
|
||||
typedef struct UI_TabSizeNode UI_TabSizeNode; struct UI_TabSizeNode{UI_TabSizeNode *next; F32 v;};
|
||||
typedef struct UI_CornerRadius00Node UI_CornerRadius00Node; struct UI_CornerRadius00Node{UI_CornerRadius00Node *next; F32 v;};
|
||||
typedef struct UI_CornerRadius01Node UI_CornerRadius01Node; struct UI_CornerRadius01Node{UI_CornerRadius01Node *next; F32 v;};
|
||||
@@ -52,17 +49,14 @@ UI_FlagsNode flags_nil_stack_top;\
|
||||
UI_FocusHotNode focus_hot_nil_stack_top;\
|
||||
UI_FocusActiveNode focus_active_nil_stack_top;\
|
||||
UI_FastpathCodepointNode fastpath_codepoint_nil_stack_top;\
|
||||
UI_GroupKeyNode group_key_nil_stack_top;\
|
||||
UI_TransparencyNode transparency_nil_stack_top;\
|
||||
UI_BackgroundColorNode background_color_nil_stack_top;\
|
||||
UI_TextColorNode text_color_nil_stack_top;\
|
||||
UI_BorderColorNode border_color_nil_stack_top;\
|
||||
UI_OverlayColorNode overlay_color_nil_stack_top;\
|
||||
UI_TextSelectColorNode text_select_color_nil_stack_top;\
|
||||
UI_TextCursorColorNode text_cursor_color_nil_stack_top;\
|
||||
UI_PaletteNode palette_nil_stack_top;\
|
||||
UI_SquishNode squish_nil_stack_top;\
|
||||
UI_HoverCursorNode hover_cursor_nil_stack_top;\
|
||||
UI_FontNode font_nil_stack_top;\
|
||||
UI_FontSizeNode font_size_nil_stack_top;\
|
||||
UI_RunFlagsNode run_flags_nil_stack_top;\
|
||||
UI_TabSizeNode tab_size_nil_stack_top;\
|
||||
UI_CornerRadius00Node corner_radius_00_nil_stack_top;\
|
||||
UI_CornerRadius01Node corner_radius_01_nil_stack_top;\
|
||||
@@ -85,17 +79,14 @@ state->flags_nil_stack_top.v = 0;\
|
||||
state->focus_hot_nil_stack_top.v = UI_FocusKind_Null;\
|
||||
state->focus_active_nil_stack_top.v = UI_FocusKind_Null;\
|
||||
state->fastpath_codepoint_nil_stack_top.v = 0;\
|
||||
state->group_key_nil_stack_top.v = ui_key_zero();\
|
||||
state->transparency_nil_stack_top.v = 0;\
|
||||
state->background_color_nil_stack_top.v = v4f32(1, 0, 1, 1);\
|
||||
state->text_color_nil_stack_top.v = v4f32(1, 0, 1, 1);\
|
||||
state->border_color_nil_stack_top.v = v4f32(1, 0, 1, 1);\
|
||||
state->overlay_color_nil_stack_top.v = v4f32(1, 0, 1, 1);\
|
||||
state->text_select_color_nil_stack_top.v = v4f32(1, 0, 1, 1);\
|
||||
state->text_cursor_color_nil_stack_top.v = v4f32(1, 0, 1, 1);\
|
||||
state->palette_nil_stack_top.v = &ui_g_nil_palette;\
|
||||
state->squish_nil_stack_top.v = 0;\
|
||||
state->hover_cursor_nil_stack_top.v = OS_Cursor_Pointer;\
|
||||
state->font_nil_stack_top.v = f_tag_zero();\
|
||||
state->font_size_nil_stack_top.v = 24.f;\
|
||||
state->run_flags_nil_stack_top.v = 0;\
|
||||
state->tab_size_nil_stack_top.v = 24.f*4.f;\
|
||||
state->corner_radius_00_nil_stack_top.v = 0;\
|
||||
state->corner_radius_01_nil_stack_top.v = 0;\
|
||||
@@ -120,17 +111,14 @@ struct { UI_FlagsNode *top; UI_BoxFlags bottom_val; UI_FlagsNode *free; B32 auto
|
||||
struct { UI_FocusHotNode *top; UI_FocusKind bottom_val; UI_FocusHotNode *free; B32 auto_pop; } focus_hot_stack;\
|
||||
struct { UI_FocusActiveNode *top; UI_FocusKind bottom_val; UI_FocusActiveNode *free; B32 auto_pop; } focus_active_stack;\
|
||||
struct { UI_FastpathCodepointNode *top; U32 bottom_val; UI_FastpathCodepointNode *free; B32 auto_pop; } fastpath_codepoint_stack;\
|
||||
struct { UI_GroupKeyNode *top; UI_Key bottom_val; UI_GroupKeyNode *free; B32 auto_pop; } group_key_stack;\
|
||||
struct { UI_TransparencyNode *top; F32 bottom_val; UI_TransparencyNode *free; B32 auto_pop; } transparency_stack;\
|
||||
struct { UI_BackgroundColorNode *top; Vec4F32 bottom_val; UI_BackgroundColorNode *free; B32 auto_pop; } background_color_stack;\
|
||||
struct { UI_TextColorNode *top; Vec4F32 bottom_val; UI_TextColorNode *free; B32 auto_pop; } text_color_stack;\
|
||||
struct { UI_BorderColorNode *top; Vec4F32 bottom_val; UI_BorderColorNode *free; B32 auto_pop; } border_color_stack;\
|
||||
struct { UI_OverlayColorNode *top; Vec4F32 bottom_val; UI_OverlayColorNode *free; B32 auto_pop; } overlay_color_stack;\
|
||||
struct { UI_TextSelectColorNode *top; Vec4F32 bottom_val; UI_TextSelectColorNode *free; B32 auto_pop; } text_select_color_stack;\
|
||||
struct { UI_TextCursorColorNode *top; Vec4F32 bottom_val; UI_TextCursorColorNode *free; B32 auto_pop; } text_cursor_color_stack;\
|
||||
struct { UI_PaletteNode *top; UI_Palette* bottom_val; UI_PaletteNode *free; B32 auto_pop; } palette_stack;\
|
||||
struct { UI_SquishNode *top; F32 bottom_val; UI_SquishNode *free; B32 auto_pop; } squish_stack;\
|
||||
struct { UI_HoverCursorNode *top; OS_Cursor bottom_val; UI_HoverCursorNode *free; B32 auto_pop; } hover_cursor_stack;\
|
||||
struct { UI_FontNode *top; F_Tag bottom_val; UI_FontNode *free; B32 auto_pop; } font_stack;\
|
||||
struct { UI_FontSizeNode *top; F32 bottom_val; UI_FontSizeNode *free; B32 auto_pop; } font_size_stack;\
|
||||
struct { UI_RunFlagsNode *top; F_RunFlags bottom_val; UI_RunFlagsNode *free; B32 auto_pop; } run_flags_stack;\
|
||||
struct { UI_TabSizeNode *top; F32 bottom_val; UI_TabSizeNode *free; B32 auto_pop; } tab_size_stack;\
|
||||
struct { UI_CornerRadius00Node *top; F32 bottom_val; UI_CornerRadius00Node *free; B32 auto_pop; } corner_radius_00_stack;\
|
||||
struct { UI_CornerRadius01Node *top; F32 bottom_val; UI_CornerRadius01Node *free; B32 auto_pop; } corner_radius_01_stack;\
|
||||
@@ -153,17 +141,14 @@ state->flags_stack.top = &state->flags_nil_stack_top; state->flags_stack.bottom_
|
||||
state->focus_hot_stack.top = &state->focus_hot_nil_stack_top; state->focus_hot_stack.bottom_val = UI_FocusKind_Null; state->focus_hot_stack.free = 0; state->focus_hot_stack.auto_pop = 0;\
|
||||
state->focus_active_stack.top = &state->focus_active_nil_stack_top; state->focus_active_stack.bottom_val = UI_FocusKind_Null; state->focus_active_stack.free = 0; state->focus_active_stack.auto_pop = 0;\
|
||||
state->fastpath_codepoint_stack.top = &state->fastpath_codepoint_nil_stack_top; state->fastpath_codepoint_stack.bottom_val = 0; state->fastpath_codepoint_stack.free = 0; state->fastpath_codepoint_stack.auto_pop = 0;\
|
||||
state->group_key_stack.top = &state->group_key_nil_stack_top; state->group_key_stack.bottom_val = ui_key_zero(); state->group_key_stack.free = 0; state->group_key_stack.auto_pop = 0;\
|
||||
state->transparency_stack.top = &state->transparency_nil_stack_top; state->transparency_stack.bottom_val = 0; state->transparency_stack.free = 0; state->transparency_stack.auto_pop = 0;\
|
||||
state->background_color_stack.top = &state->background_color_nil_stack_top; state->background_color_stack.bottom_val = v4f32(1, 0, 1, 1); state->background_color_stack.free = 0; state->background_color_stack.auto_pop = 0;\
|
||||
state->text_color_stack.top = &state->text_color_nil_stack_top; state->text_color_stack.bottom_val = v4f32(1, 0, 1, 1); state->text_color_stack.free = 0; state->text_color_stack.auto_pop = 0;\
|
||||
state->border_color_stack.top = &state->border_color_nil_stack_top; state->border_color_stack.bottom_val = v4f32(1, 0, 1, 1); state->border_color_stack.free = 0; state->border_color_stack.auto_pop = 0;\
|
||||
state->overlay_color_stack.top = &state->overlay_color_nil_stack_top; state->overlay_color_stack.bottom_val = v4f32(1, 0, 1, 1); state->overlay_color_stack.free = 0; state->overlay_color_stack.auto_pop = 0;\
|
||||
state->text_select_color_stack.top = &state->text_select_color_nil_stack_top; state->text_select_color_stack.bottom_val = v4f32(1, 0, 1, 1); state->text_select_color_stack.free = 0; state->text_select_color_stack.auto_pop = 0;\
|
||||
state->text_cursor_color_stack.top = &state->text_cursor_color_nil_stack_top; state->text_cursor_color_stack.bottom_val = v4f32(1, 0, 1, 1); state->text_cursor_color_stack.free = 0; state->text_cursor_color_stack.auto_pop = 0;\
|
||||
state->palette_stack.top = &state->palette_nil_stack_top; state->palette_stack.bottom_val = &ui_g_nil_palette; state->palette_stack.free = 0; state->palette_stack.auto_pop = 0;\
|
||||
state->squish_stack.top = &state->squish_nil_stack_top; state->squish_stack.bottom_val = 0; state->squish_stack.free = 0; state->squish_stack.auto_pop = 0;\
|
||||
state->hover_cursor_stack.top = &state->hover_cursor_nil_stack_top; state->hover_cursor_stack.bottom_val = OS_Cursor_Pointer; state->hover_cursor_stack.free = 0; state->hover_cursor_stack.auto_pop = 0;\
|
||||
state->font_stack.top = &state->font_nil_stack_top; state->font_stack.bottom_val = f_tag_zero(); state->font_stack.free = 0; state->font_stack.auto_pop = 0;\
|
||||
state->font_size_stack.top = &state->font_size_nil_stack_top; state->font_size_stack.bottom_val = 24.f; state->font_size_stack.free = 0; state->font_size_stack.auto_pop = 0;\
|
||||
state->run_flags_stack.top = &state->run_flags_nil_stack_top; state->run_flags_stack.bottom_val = 0; state->run_flags_stack.free = 0; state->run_flags_stack.auto_pop = 0;\
|
||||
state->tab_size_stack.top = &state->tab_size_nil_stack_top; state->tab_size_stack.bottom_val = 24.f*4.f; state->tab_size_stack.free = 0; state->tab_size_stack.auto_pop = 0;\
|
||||
state->corner_radius_00_stack.top = &state->corner_radius_00_nil_stack_top; state->corner_radius_00_stack.bottom_val = 0; state->corner_radius_00_stack.free = 0; state->corner_radius_00_stack.auto_pop = 0;\
|
||||
state->corner_radius_01_stack.top = &state->corner_radius_01_nil_stack_top; state->corner_radius_01_stack.bottom_val = 0; state->corner_radius_01_stack.free = 0; state->corner_radius_01_stack.auto_pop = 0;\
|
||||
@@ -186,17 +171,14 @@ if(state->flags_stack.auto_pop) { ui_pop_flags(); state->flags_stack.auto_pop =
|
||||
if(state->focus_hot_stack.auto_pop) { ui_pop_focus_hot(); state->focus_hot_stack.auto_pop = 0; }\
|
||||
if(state->focus_active_stack.auto_pop) { ui_pop_focus_active(); state->focus_active_stack.auto_pop = 0; }\
|
||||
if(state->fastpath_codepoint_stack.auto_pop) { ui_pop_fastpath_codepoint(); state->fastpath_codepoint_stack.auto_pop = 0; }\
|
||||
if(state->group_key_stack.auto_pop) { ui_pop_group_key(); state->group_key_stack.auto_pop = 0; }\
|
||||
if(state->transparency_stack.auto_pop) { ui_pop_transparency(); state->transparency_stack.auto_pop = 0; }\
|
||||
if(state->background_color_stack.auto_pop) { ui_pop_background_color(); state->background_color_stack.auto_pop = 0; }\
|
||||
if(state->text_color_stack.auto_pop) { ui_pop_text_color(); state->text_color_stack.auto_pop = 0; }\
|
||||
if(state->border_color_stack.auto_pop) { ui_pop_border_color(); state->border_color_stack.auto_pop = 0; }\
|
||||
if(state->overlay_color_stack.auto_pop) { ui_pop_overlay_color(); state->overlay_color_stack.auto_pop = 0; }\
|
||||
if(state->text_select_color_stack.auto_pop) { ui_pop_text_select_color(); state->text_select_color_stack.auto_pop = 0; }\
|
||||
if(state->text_cursor_color_stack.auto_pop) { ui_pop_text_cursor_color(); state->text_cursor_color_stack.auto_pop = 0; }\
|
||||
if(state->palette_stack.auto_pop) { ui_pop_palette(); state->palette_stack.auto_pop = 0; }\
|
||||
if(state->squish_stack.auto_pop) { ui_pop_squish(); state->squish_stack.auto_pop = 0; }\
|
||||
if(state->hover_cursor_stack.auto_pop) { ui_pop_hover_cursor(); state->hover_cursor_stack.auto_pop = 0; }\
|
||||
if(state->font_stack.auto_pop) { ui_pop_font(); state->font_stack.auto_pop = 0; }\
|
||||
if(state->font_size_stack.auto_pop) { ui_pop_font_size(); state->font_size_stack.auto_pop = 0; }\
|
||||
if(state->run_flags_stack.auto_pop) { ui_pop_run_flags(); state->run_flags_stack.auto_pop = 0; }\
|
||||
if(state->tab_size_stack.auto_pop) { ui_pop_tab_size(); state->tab_size_stack.auto_pop = 0; }\
|
||||
if(state->corner_radius_00_stack.auto_pop) { ui_pop_corner_radius_00(); state->corner_radius_00_stack.auto_pop = 0; }\
|
||||
if(state->corner_radius_01_stack.auto_pop) { ui_pop_corner_radius_01(); state->corner_radius_01_stack.auto_pop = 0; }\
|
||||
@@ -218,17 +200,14 @@ internal UI_BoxFlags ui_top_flags(void);
|
||||
internal UI_FocusKind ui_top_focus_hot(void);
|
||||
internal UI_FocusKind ui_top_focus_active(void);
|
||||
internal U32 ui_top_fastpath_codepoint(void);
|
||||
internal UI_Key ui_top_group_key(void);
|
||||
internal F32 ui_top_transparency(void);
|
||||
internal Vec4F32 ui_top_background_color(void);
|
||||
internal Vec4F32 ui_top_text_color(void);
|
||||
internal Vec4F32 ui_top_border_color(void);
|
||||
internal Vec4F32 ui_top_overlay_color(void);
|
||||
internal Vec4F32 ui_top_text_select_color(void);
|
||||
internal Vec4F32 ui_top_text_cursor_color(void);
|
||||
internal UI_Palette* ui_top_palette(void);
|
||||
internal F32 ui_top_squish(void);
|
||||
internal OS_Cursor ui_top_hover_cursor(void);
|
||||
internal F_Tag ui_top_font(void);
|
||||
internal F32 ui_top_font_size(void);
|
||||
internal F_RunFlags ui_top_run_flags(void);
|
||||
internal F32 ui_top_tab_size(void);
|
||||
internal F32 ui_top_corner_radius_00(void);
|
||||
internal F32 ui_top_corner_radius_01(void);
|
||||
@@ -249,17 +228,14 @@ internal UI_BoxFlags ui_bottom_flags(void);
|
||||
internal UI_FocusKind ui_bottom_focus_hot(void);
|
||||
internal UI_FocusKind ui_bottom_focus_active(void);
|
||||
internal U32 ui_bottom_fastpath_codepoint(void);
|
||||
internal UI_Key ui_bottom_group_key(void);
|
||||
internal F32 ui_bottom_transparency(void);
|
||||
internal Vec4F32 ui_bottom_background_color(void);
|
||||
internal Vec4F32 ui_bottom_text_color(void);
|
||||
internal Vec4F32 ui_bottom_border_color(void);
|
||||
internal Vec4F32 ui_bottom_overlay_color(void);
|
||||
internal Vec4F32 ui_bottom_text_select_color(void);
|
||||
internal Vec4F32 ui_bottom_text_cursor_color(void);
|
||||
internal UI_Palette* ui_bottom_palette(void);
|
||||
internal F32 ui_bottom_squish(void);
|
||||
internal OS_Cursor ui_bottom_hover_cursor(void);
|
||||
internal F_Tag ui_bottom_font(void);
|
||||
internal F32 ui_bottom_font_size(void);
|
||||
internal F_RunFlags ui_bottom_run_flags(void);
|
||||
internal F32 ui_bottom_tab_size(void);
|
||||
internal F32 ui_bottom_corner_radius_00(void);
|
||||
internal F32 ui_bottom_corner_radius_01(void);
|
||||
@@ -280,17 +256,14 @@ internal UI_BoxFlags ui_push_flags(UI_BoxFlags v);
|
||||
internal UI_FocusKind ui_push_focus_hot(UI_FocusKind v);
|
||||
internal UI_FocusKind ui_push_focus_active(UI_FocusKind v);
|
||||
internal U32 ui_push_fastpath_codepoint(U32 v);
|
||||
internal UI_Key ui_push_group_key(UI_Key v);
|
||||
internal F32 ui_push_transparency(F32 v);
|
||||
internal Vec4F32 ui_push_background_color(Vec4F32 v);
|
||||
internal Vec4F32 ui_push_text_color(Vec4F32 v);
|
||||
internal Vec4F32 ui_push_border_color(Vec4F32 v);
|
||||
internal Vec4F32 ui_push_overlay_color(Vec4F32 v);
|
||||
internal Vec4F32 ui_push_text_select_color(Vec4F32 v);
|
||||
internal Vec4F32 ui_push_text_cursor_color(Vec4F32 v);
|
||||
internal UI_Palette* ui_push_palette(UI_Palette* v);
|
||||
internal F32 ui_push_squish(F32 v);
|
||||
internal OS_Cursor ui_push_hover_cursor(OS_Cursor v);
|
||||
internal F_Tag ui_push_font(F_Tag v);
|
||||
internal F32 ui_push_font_size(F32 v);
|
||||
internal F_RunFlags ui_push_run_flags(F_RunFlags v);
|
||||
internal F32 ui_push_tab_size(F32 v);
|
||||
internal F32 ui_push_corner_radius_00(F32 v);
|
||||
internal F32 ui_push_corner_radius_01(F32 v);
|
||||
@@ -311,17 +284,14 @@ internal UI_BoxFlags ui_pop_flags(void);
|
||||
internal UI_FocusKind ui_pop_focus_hot(void);
|
||||
internal UI_FocusKind ui_pop_focus_active(void);
|
||||
internal U32 ui_pop_fastpath_codepoint(void);
|
||||
internal UI_Key ui_pop_group_key(void);
|
||||
internal F32 ui_pop_transparency(void);
|
||||
internal Vec4F32 ui_pop_background_color(void);
|
||||
internal Vec4F32 ui_pop_text_color(void);
|
||||
internal Vec4F32 ui_pop_border_color(void);
|
||||
internal Vec4F32 ui_pop_overlay_color(void);
|
||||
internal Vec4F32 ui_pop_text_select_color(void);
|
||||
internal Vec4F32 ui_pop_text_cursor_color(void);
|
||||
internal UI_Palette* ui_pop_palette(void);
|
||||
internal F32 ui_pop_squish(void);
|
||||
internal OS_Cursor ui_pop_hover_cursor(void);
|
||||
internal F_Tag ui_pop_font(void);
|
||||
internal F32 ui_pop_font_size(void);
|
||||
internal F_RunFlags ui_pop_run_flags(void);
|
||||
internal F32 ui_pop_tab_size(void);
|
||||
internal F32 ui_pop_corner_radius_00(void);
|
||||
internal F32 ui_pop_corner_radius_01(void);
|
||||
@@ -342,17 +312,14 @@ internal UI_BoxFlags ui_set_next_flags(UI_BoxFlags v);
|
||||
internal UI_FocusKind ui_set_next_focus_hot(UI_FocusKind v);
|
||||
internal UI_FocusKind ui_set_next_focus_active(UI_FocusKind v);
|
||||
internal U32 ui_set_next_fastpath_codepoint(U32 v);
|
||||
internal UI_Key ui_set_next_group_key(UI_Key v);
|
||||
internal F32 ui_set_next_transparency(F32 v);
|
||||
internal Vec4F32 ui_set_next_background_color(Vec4F32 v);
|
||||
internal Vec4F32 ui_set_next_text_color(Vec4F32 v);
|
||||
internal Vec4F32 ui_set_next_border_color(Vec4F32 v);
|
||||
internal Vec4F32 ui_set_next_overlay_color(Vec4F32 v);
|
||||
internal Vec4F32 ui_set_next_text_select_color(Vec4F32 v);
|
||||
internal Vec4F32 ui_set_next_text_cursor_color(Vec4F32 v);
|
||||
internal UI_Palette* ui_set_next_palette(UI_Palette* v);
|
||||
internal F32 ui_set_next_squish(F32 v);
|
||||
internal OS_Cursor ui_set_next_hover_cursor(OS_Cursor v);
|
||||
internal F_Tag ui_set_next_font(F_Tag v);
|
||||
internal F32 ui_set_next_font_size(F32 v);
|
||||
internal F_RunFlags ui_set_next_run_flags(F_RunFlags v);
|
||||
internal F32 ui_set_next_tab_size(F32 v);
|
||||
internal F32 ui_set_next_corner_radius_00(F32 v);
|
||||
internal F32 ui_set_next_corner_radius_01(F32 v);
|
||||
|
||||
+28
-31
@@ -7,59 +7,56 @@
|
||||
UI_StackTable:
|
||||
{
|
||||
//- rjf: parents
|
||||
{ Parent parent `UI_Box *` `&ui_g_nil_box` }
|
||||
{ Parent parent `UI_Box *` `&ui_g_nil_box` }
|
||||
|
||||
//- rjf: layout params
|
||||
{ ChildLayoutAxis child_layout_axis Axis2 `Axis2_X` }
|
||||
{ ChildLayoutAxis child_layout_axis Axis2 `Axis2_X` }
|
||||
|
||||
//- rjf: size/position
|
||||
{ FixedX fixed_x F32 0 }
|
||||
{ FixedY fixed_y F32 0 }
|
||||
{ FixedWidth fixed_width F32 0 }
|
||||
{ FixedHeight fixed_height F32 0 }
|
||||
{ PrefWidth pref_width UI_Size `ui_px(250.f, 1.f)`}
|
||||
{ PrefHeight pref_height UI_Size `ui_px(30.f, 1.f)` }
|
||||
{ FixedX fixed_x F32 0 }
|
||||
{ FixedY fixed_y F32 0 }
|
||||
{ FixedWidth fixed_width F32 0 }
|
||||
{ FixedHeight fixed_height F32 0 }
|
||||
{ PrefWidth pref_width UI_Size `ui_px(250.f, 1.f)` }
|
||||
{ PrefHeight pref_height UI_Size `ui_px(30.f, 1.f)` }
|
||||
|
||||
//- rjf: flags
|
||||
{ Flags flags UI_BoxFlags 0 }
|
||||
{ Flags flags UI_BoxFlags 0 }
|
||||
|
||||
//- rjf: interaction
|
||||
{ FocusHot focus_hot UI_FocusKind UI_FocusKind_Null }
|
||||
{ FocusActive focus_active UI_FocusKind UI_FocusKind_Null }
|
||||
{ FastpathCodepoint fastpath_codepoint U32 0 }
|
||||
{ FocusHot focus_hot UI_FocusKind UI_FocusKind_Null }
|
||||
{ FocusActive focus_active UI_FocusKind UI_FocusKind_Null }
|
||||
{ FastpathCodepoint fastpath_codepoint U32 0 }
|
||||
{ GroupKey group_key UI_Key `ui_key_zero()` }
|
||||
|
||||
//- rjf: colors
|
||||
{ Transparency transparency F32 0 }
|
||||
{ BackgroundColor background_color Vec4F32 `v4f32(1, 0, 1, 1)`}
|
||||
{ TextColor text_color Vec4F32 `v4f32(1, 0, 1, 1)`}
|
||||
{ BorderColor border_color Vec4F32 `v4f32(1, 0, 1, 1)`}
|
||||
{ OverlayColor overlay_color Vec4F32 `v4f32(1, 0, 1, 1)`}
|
||||
{ TextSelectColor text_select_color Vec4F32 `v4f32(1, 0, 1, 1)`}
|
||||
{ TextCursorColor text_cursor_color Vec4F32 `v4f32(1, 0, 1, 1)`}
|
||||
{ Transparency transparency F32 0 }
|
||||
{ Palette palette `UI_Palette* ` `&ui_g_nil_palette` }
|
||||
|
||||
//- rjf: squish
|
||||
{ Squish squish F32 0 }
|
||||
{ Squish squish F32 0 }
|
||||
|
||||
//- rjf: hover cursor
|
||||
{ HoverCursor hover_cursor OS_Cursor OS_Cursor_Pointer }
|
||||
{ HoverCursor hover_cursor OS_Cursor OS_Cursor_Pointer }
|
||||
|
||||
//- rjf: font
|
||||
{ Font font F_Tag `f_tag_zero()` }
|
||||
{ FontSize font_size F32 24.f }
|
||||
{ TabSize tab_size F32 `24.f*4.f` }
|
||||
{ Font font F_Tag `f_tag_zero()` }
|
||||
{ FontSize font_size F32 24.f }
|
||||
{ RunFlags run_flags F_RunFlags 0 }
|
||||
{ TabSize tab_size F32 `24.f*4.f` }
|
||||
|
||||
//- rjf: corner radii
|
||||
{ CornerRadius00 corner_radius_00 F32 0 }
|
||||
{ CornerRadius01 corner_radius_01 F32 0 }
|
||||
{ CornerRadius10 corner_radius_10 F32 0 }
|
||||
{ CornerRadius11 corner_radius_11 F32 0 }
|
||||
{ CornerRadius00 corner_radius_00 F32 0 }
|
||||
{ CornerRadius01 corner_radius_01 F32 0 }
|
||||
{ CornerRadius10 corner_radius_10 F32 0 }
|
||||
{ CornerRadius11 corner_radius_11 F32 0 }
|
||||
|
||||
//- rjf: blur size
|
||||
{ BlurSize blur_size F32 0 }
|
||||
{ BlurSize blur_size F32 0 }
|
||||
|
||||
//- rjf: text parameters
|
||||
{ TextPadding text_padding F32 2 }
|
||||
{ TextAlignment text_alignment UI_TextAlign UI_TextAlign_Left }
|
||||
{ TextPadding text_padding F32 2 }
|
||||
{ TextAlignment text_alignment UI_TextAlign UI_TextAlign_Left }
|
||||
}
|
||||
|
||||
//- rjf: declaring stack node types
|
||||
|
||||
+54
-48
@@ -4,20 +4,24 @@
|
||||
////////////////////////////////
|
||||
//~ rjf: Basic Widgets
|
||||
|
||||
internal UI_Signal
|
||||
ui_spacer(UI_Size size)
|
||||
internal void
|
||||
ui_divider(UI_Size size)
|
||||
{
|
||||
UI_Box *parent = ui_top_parent();
|
||||
ui_set_next_pref_size(parent->child_layout_axis, size);
|
||||
UI_Box *box = ui_build_box_from_string(0, str8_lit(""));
|
||||
UI_Signal interact = ui_signal_from_box(box);
|
||||
return interact;
|
||||
ui_set_next_child_layout_axis(parent->child_layout_axis);
|
||||
UI_Box *box = ui_build_box_from_key(0, ui_key_zero());
|
||||
UI_Parent(box) UI_PrefSize(parent->child_layout_axis, ui_pct(1, 0))
|
||||
{
|
||||
ui_build_box_from_key(UI_BoxFlag_DrawSideBottom, ui_key_zero());
|
||||
ui_build_box_from_key(0, ui_key_zero());
|
||||
}
|
||||
}
|
||||
|
||||
internal UI_Signal
|
||||
ui_label(String8 string)
|
||||
{
|
||||
UI_Box *box = ui_build_box_from_string(UI_BoxFlag_DrawText, str8_lit(""));
|
||||
UI_Box *box = ui_build_box_from_string(UI_BoxFlag_DrawText, str8_zero());
|
||||
ui_box_equip_display_string(box, string);
|
||||
UI_Signal interact = ui_signal_from_box(box);
|
||||
return interact;
|
||||
@@ -120,8 +124,6 @@ typedef struct UI_LineEditDrawData UI_LineEditDrawData;
|
||||
struct UI_LineEditDrawData
|
||||
{
|
||||
String8 edited_string;
|
||||
Vec4F32 cursor_color;
|
||||
Vec4F32 select_color;
|
||||
TxtPt cursor;
|
||||
TxtPt mark;
|
||||
};
|
||||
@@ -132,9 +134,9 @@ internal UI_BOX_CUSTOM_DRAW(ui_line_edit_draw)
|
||||
F_Tag font = box->font;
|
||||
F32 font_size = box->font_size;
|
||||
F32 tab_size = box->tab_size;
|
||||
Vec4F32 cursor_color = draw_data->cursor_color;
|
||||
Vec4F32 cursor_color = box->palette->colors[UI_ColorCode_Cursor];
|
||||
cursor_color.w *= box->parent->parent->focus_active_t;
|
||||
Vec4F32 select_color = draw_data->select_color;
|
||||
Vec4F32 select_color = box->palette->colors[UI_ColorCode_Selection];
|
||||
select_color.w *= (box->parent->parent->focus_active_t*0.2f + 0.8f);
|
||||
Vec2F32 text_position = ui_box_text_position(box);
|
||||
String8 edited_string = draw_data->edited_string;
|
||||
@@ -261,8 +263,6 @@ ui_line_edit(TxtPt *cursor, TxtPt *mark, U8 *edit_buffer, U64 edit_buffer_size,
|
||||
draw_data->edited_string = push_str8_copy(ui_build_arena(), edit_string);
|
||||
draw_data->cursor = *cursor;
|
||||
draw_data->mark = *mark;
|
||||
draw_data->cursor_color = ui_top_text_cursor_color();
|
||||
draw_data->select_color = ui_top_text_select_color();
|
||||
ui_box_equip_display_string(editstr_box, edit_string);
|
||||
ui_box_equip_custom_draw(editstr_box, ui_line_edit_draw, draw_data);
|
||||
mouse_pt = txt_pt(1, 1+ui_box_char_pos_from_xy(editstr_box, ui_mouse()));
|
||||
@@ -403,37 +403,6 @@ ui_imagef(R_Handle texture, R_Tex2DSampleKind sample_kind, Rng2F32 region, Vec4F
|
||||
////////////////////////////////
|
||||
//~ rjf: Special Buttons
|
||||
|
||||
internal UI_Signal
|
||||
ui_close_button(String8 string)
|
||||
{
|
||||
ui_set_next_background_color(v4f32(0.6f, 0.2f, 0.1f, 1.f));
|
||||
ui_set_next_text_color(v4f32(1, 1, 1, 1));
|
||||
ui_set_next_hover_cursor(OS_Cursor_HandPoint);
|
||||
ui_set_next_text_alignment(UI_TextAlign_Center);
|
||||
UI_Box *box = ui_build_box_from_string(UI_BoxFlag_Clickable|
|
||||
UI_BoxFlag_DrawBackground|
|
||||
UI_BoxFlag_DrawBorder|
|
||||
UI_BoxFlag_DrawText|
|
||||
UI_BoxFlag_DrawHotEffects|
|
||||
UI_BoxFlag_DrawActiveEffects,
|
||||
string);
|
||||
UI_Signal interact = ui_signal_from_box(box);
|
||||
return interact;
|
||||
}
|
||||
|
||||
internal UI_Signal
|
||||
ui_close_buttonf(char *fmt, ...)
|
||||
{
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
String8 string = push_str8fv(scratch.arena, fmt, args);
|
||||
va_end(args);
|
||||
UI_Signal sig = ui_close_button(string);
|
||||
scratch_end(scratch);
|
||||
return sig;
|
||||
}
|
||||
|
||||
internal UI_Signal
|
||||
ui_expander(B32 is_expanded, String8 string)
|
||||
{
|
||||
@@ -513,7 +482,8 @@ ui_do_color_tooltip_hsv(Vec3F32 hsv)
|
||||
{
|
||||
UI_PrefWidth(ui_em(22.f, 1.f)) UI_PrefHeight(ui_em(6.f, 1.f)) UI_Row UI_Padding(ui_pct(1, 0))
|
||||
{
|
||||
UI_BackgroundColor(v4f32(rgb.x, rgb.y, rgb.z, 1)) UI_CornerRadius(4.f)
|
||||
UI_Palette(ui_build_palette(ui_top_palette(), .background = v4f32(rgb.x, rgb.y, rgb.z, 1.f)))
|
||||
UI_CornerRadius(4.f)
|
||||
UI_PrefWidth(ui_em(6.f, 1.f)) UI_PrefHeight(ui_em(6.f, 1.f))
|
||||
ui_build_box_from_string(UI_BoxFlag_DrawBorder|UI_BoxFlag_DrawBackground, str8_lit(""));
|
||||
}
|
||||
@@ -551,7 +521,8 @@ ui_do_color_tooltip_hsva(Vec4F32 hsva)
|
||||
{
|
||||
UI_PrefWidth(ui_em(22.f, 1.f)) UI_PrefHeight(ui_em(6.f, 1.f)) UI_Row UI_Padding(ui_pct(1, 0))
|
||||
{
|
||||
UI_BackgroundColor(rgba) UI_CornerRadius(4.f)
|
||||
UI_Palette(ui_build_palette(ui_top_palette(), .background = rgba))
|
||||
UI_CornerRadius(4.f)
|
||||
UI_PrefWidth(ui_em(6.f, 1.f)) UI_PrefHeight(ui_em(6.f, 1.f))
|
||||
ui_build_box_from_string(UI_BoxFlag_DrawBorder|UI_BoxFlag_DrawBackground, str8_lit(""));
|
||||
}
|
||||
@@ -643,6 +614,18 @@ ui_sat_val_picker(F32 hue, F32 *out_sat, F32 *out_val, String8 string)
|
||||
*out_sat = Clamp(0, *out_sat, 1);
|
||||
*out_val = Clamp(0, *out_val, 1);
|
||||
ui_do_color_tooltip_hsv(v3f32(hue, *out_sat, *out_val));
|
||||
if(ui_pressed(sig))
|
||||
{
|
||||
Vec2F32 data = v2f32(*out_sat, *out_val);
|
||||
ui_store_drag_struct(&data);
|
||||
}
|
||||
if(ui_slot_press(UI_EventActionSlot_Cancel))
|
||||
{
|
||||
Vec2F32 data = *ui_get_drag_struct(Vec2F32);
|
||||
*out_sat = data.x;
|
||||
*out_val = data.y;
|
||||
ui_kill_action();
|
||||
}
|
||||
}
|
||||
|
||||
// rjf: fill draw data
|
||||
@@ -738,6 +721,15 @@ ui_hue_picker(F32 *out_hue, F32 sat, F32 val, String8 string)
|
||||
*out_hue = (ui_mouse().y - box->rect.y0) / dim.y;
|
||||
*out_hue = Clamp(0, *out_hue, 1);
|
||||
ui_do_color_tooltip_hsv(v3f32(*out_hue, sat, val));
|
||||
if(ui_pressed(sig))
|
||||
{
|
||||
ui_store_drag_struct(out_hue);
|
||||
}
|
||||
if(ui_slot_press(UI_EventActionSlot_Cancel))
|
||||
{
|
||||
*out_hue = *ui_get_drag_struct(F32);
|
||||
ui_kill_action();
|
||||
}
|
||||
}
|
||||
|
||||
// rjf: fill draw data
|
||||
@@ -816,6 +808,15 @@ ui_alpha_picker(F32 *out_alpha, String8 string)
|
||||
F32 drag_pct = (ui_mouse().y - box->rect.y0) / dim.y;
|
||||
drag_pct = Clamp(0, drag_pct, 1);
|
||||
*out_alpha = 1-drag_pct;
|
||||
if(ui_pressed(sig))
|
||||
{
|
||||
ui_store_drag_struct(out_alpha);
|
||||
}
|
||||
if(ui_slot_press(UI_EventActionSlot_Cancel))
|
||||
{
|
||||
*out_alpha = *ui_get_drag_struct(F32);
|
||||
ui_kill_action();
|
||||
}
|
||||
}
|
||||
|
||||
// rjf: fill draw data
|
||||
@@ -907,11 +908,13 @@ ui_pane_beginf(Rng2F32 rect, char *fmt, ...)
|
||||
return box;
|
||||
}
|
||||
|
||||
internal void
|
||||
internal UI_Signal
|
||||
ui_pane_end(void)
|
||||
{
|
||||
ui_pop_pref_width();
|
||||
ui_pop_parent();
|
||||
UI_Box *box = ui_pop_parent();
|
||||
UI_Signal sig = ui_signal_from_box(box);
|
||||
return sig;
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
@@ -1097,7 +1100,6 @@ ui_table_vector_end(void)
|
||||
internal UI_Box *
|
||||
ui_table_cell_begin(void)
|
||||
{
|
||||
UI_Box *vector = ui_top_parent();
|
||||
U64 column_idx = ui_ts_cell_idx;
|
||||
F32 width_pct = column_idx < ui_ts_col_pct_count ? ui_ts_col_pcts_stable[column_idx] : 1.f;
|
||||
return ui_table_cell_sized_begin(ui_pct(width_pct, 0));
|
||||
@@ -1210,6 +1212,8 @@ ui_scroll_list_item_from_row(UI_ScrollListRowBlockArray *blocks, U64 row)
|
||||
internal UI_ScrollPt
|
||||
ui_scroll_bar(Axis2 axis, UI_Size off_axis_size, UI_ScrollPt pt, Rng1S64 idx_range, S64 view_num_indices)
|
||||
{
|
||||
ui_push_palette(ui_state->widget_palette_info.scrollbar_palette);
|
||||
|
||||
//- rjf: unpack
|
||||
S64 idx_range_dim = Max(dim_1s64(idx_range), 1);
|
||||
|
||||
@@ -1327,6 +1331,8 @@ ui_scroll_bar(Axis2 axis, UI_Size off_axis_size, UI_ScrollPt pt, Rng1S64 idx_ran
|
||||
ui_scroll_pt_target_idx(&new_pt, new_idx);
|
||||
}
|
||||
}
|
||||
|
||||
ui_pop_palette();
|
||||
return new_pt;
|
||||
}
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ struct UI_ScrollListSignal
|
||||
////////////////////////////////
|
||||
//~ rjf: Basic Widgets
|
||||
|
||||
internal UI_Signal ui_spacer(UI_Size size);
|
||||
internal void ui_divider(UI_Size size);
|
||||
internal UI_Signal ui_label(String8 string);
|
||||
internal UI_Signal ui_labelf(char *fmt, ...);
|
||||
internal void ui_label_multiline(F32 max, String8 string);
|
||||
@@ -89,8 +89,6 @@ internal UI_Signal ui_imagef(R_Handle texture, R_Tex2DSampleKind sample_kind, Rn
|
||||
////////////////////////////////
|
||||
//~ rjf: Special Buttons
|
||||
|
||||
internal UI_Signal ui_close_button(String8 string);
|
||||
internal UI_Signal ui_close_buttonf(char *fmt, ...);
|
||||
internal UI_Signal ui_expander(B32 is_expanded, String8 string);
|
||||
internal UI_Signal ui_expanderf(B32 is_expanded, char *fmt, ...);
|
||||
internal UI_Signal ui_sort_header(B32 sorting, B32 ascending, String8 string);
|
||||
@@ -132,7 +130,7 @@ internal void ui_named_column_end(void);
|
||||
|
||||
internal UI_Box *ui_pane_begin(Rng2F32 rect, String8 string);
|
||||
internal UI_Box *ui_pane_beginf(Rng2F32 rect, char *fmt, ...);
|
||||
internal void ui_pane_end(void);
|
||||
internal UI_Signal ui_pane_end(void);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Tables
|
||||
|
||||
+125
-120
@@ -720,7 +720,7 @@ ui_box_from_key(UI_Key key)
|
||||
//~ rjf: Top-Level Building API
|
||||
|
||||
internal void
|
||||
ui_begin_build(OS_Handle window, UI_EventList *events, UI_IconInfo *icon_info, F32 real_dt, F32 animation_dt)
|
||||
ui_begin_build(OS_Handle window, UI_EventList *events, UI_IconInfo *icon_info, UI_WidgetPaletteInfo *widget_palette_info, UI_AnimationInfo *animation_info, F32 real_dt, F32 animation_dt)
|
||||
{
|
||||
//- rjf: reset per-build ui state
|
||||
{
|
||||
@@ -758,6 +758,8 @@ ui_begin_build(OS_Handle window, UI_EventList *events, UI_IconInfo *icon_info, F
|
||||
{
|
||||
ui_state->icon_info.icon_kind_text_map[icon_kind] = push_str8_copy(ui_build_arena(), icon_info->icon_kind_text_map[icon_kind]);
|
||||
}
|
||||
MemoryCopyStruct(&ui_state->widget_palette_info, widget_palette_info);
|
||||
MemoryCopyStruct(&ui_state->animation_info, animation_info);
|
||||
}
|
||||
|
||||
//- rjf: do default navigation
|
||||
@@ -963,26 +965,6 @@ ui_begin_build(OS_Handle window, UI_EventList *events, UI_IconInfo *icon_info, F
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//- rjf: some child has the active focus -> detect events which will cause an external focus commit
|
||||
// (e.g. clicking outside of a line edit)
|
||||
if(!ui_key_match(ui_key_zero(), nav_root->default_nav_focus_active_key))
|
||||
{
|
||||
UI_Box *active_box = ui_box_from_key(nav_root->default_nav_focus_active_key);
|
||||
if(!ui_box_is_nil(active_box))
|
||||
{
|
||||
for(UI_EventNode *n = events->first; n != 0; n = n->next)
|
||||
{
|
||||
UI_Event *event = &n->v;
|
||||
if(event->kind == UI_EventKind_Press &&
|
||||
event->key == OS_Key_LeftMouseButton &&
|
||||
!contains_2f32(active_box->rect, ui_mouse()))
|
||||
{
|
||||
ui_state->external_focus_commit = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
ui_state->default_nav_root_key = ui_key_zero();
|
||||
@@ -1219,13 +1201,13 @@ ui_end_build(void)
|
||||
F32 slow_rate = 1 - pow_f32(2, (-30.f * ui_state->animation_dt));
|
||||
F32 slug_rate = 1 - pow_f32(2, (-15.f * ui_state->animation_dt));
|
||||
F32 slaf_rate = 1 - pow_f32(2, (-8.f * ui_state->animation_dt));
|
||||
ui_state->ctx_menu_open_t += ((F32)!!ui_state->ctx_menu_open - ui_state->ctx_menu_open_t) * vast_rate;
|
||||
ui_state->ctx_menu_open_t += ((F32)!!ui_state->ctx_menu_open - ui_state->ctx_menu_open_t) * (ui_state->animation_info.flags & UI_AnimationInfoFlag_ContextMenuAnimations ? vast_rate : 1);
|
||||
ui_state->is_animating = (ui_state->is_animating || abs_f32((F32)!!ui_state->ctx_menu_open - ui_state->ctx_menu_open_t) > 0.01f);
|
||||
if(ui_state->ctx_menu_open_t >= 0.99f && ui_state->ctx_menu_open)
|
||||
{
|
||||
ui_state->ctx_menu_open_t = 1.f;
|
||||
}
|
||||
ui_state->tooltip_open_t += ((F32)!!ui_state->tooltip_open - ui_state->tooltip_open_t) * vast_rate;
|
||||
ui_state->tooltip_open_t += ((F32)!!ui_state->tooltip_open - ui_state->tooltip_open_t) * (ui_state->animation_info.flags & UI_AnimationInfoFlag_TooltipAnimations ? vast_rate : 1);
|
||||
ui_state->is_animating = (ui_state->is_animating || abs_f32((F32)!!ui_state->tooltip_open - ui_state->tooltip_open_t) > 0.01f);
|
||||
if(ui_state->tooltip_open_t >= 0.99f && ui_state->tooltip_open)
|
||||
{
|
||||
@@ -1247,10 +1229,10 @@ ui_end_build(void)
|
||||
B32 is_focus_active_disabled = !!(box->flags & UI_BoxFlag_FocusActiveDisabled);
|
||||
|
||||
// rjf: determine rates
|
||||
F32 hot_rate = fast_rate;
|
||||
F32 active_rate = fast_rate;
|
||||
F32 disabled_rate = slow_rate;
|
||||
F32 focus_rate = (is_focus_hot || is_focus_active) ? fast_rate : fast_rate;
|
||||
F32 hot_rate = (ui_state->animation_info.flags & UI_AnimationInfoFlag_HotAnimations ? fast_rate : 1);
|
||||
F32 active_rate = (ui_state->animation_info.flags & UI_AnimationInfoFlag_ActiveAnimations ? fast_rate : 1);
|
||||
F32 disabled_rate = (ui_state->animation_info.flags & UI_AnimationInfoFlag_HotAnimations ? slow_rate : 1);
|
||||
F32 focus_rate = (ui_state->animation_info.flags & UI_AnimationInfoFlag_FocusAnimations ? fast_rate : 1);
|
||||
|
||||
// rjf: determine animating status
|
||||
B32 box_is_animating = 0;
|
||||
@@ -1436,13 +1418,13 @@ ui_end_build(void)
|
||||
String8 box_display_string = ui_box_display_string(b);
|
||||
Vec2F32 text_pos = ui_box_text_position(b);
|
||||
Vec2F32 drawn_text_dim = b->display_string_runs.dim;
|
||||
B32 text_is_truncated = (drawn_text_dim.x + text_pos.x > rect.x1);
|
||||
B32 text_is_truncated = (drawn_text_dim.x + text_pos.x >= rect.x1);
|
||||
B32 mouse_is_hovering = contains_2f32(r2f32p(text_pos.x,
|
||||
rect.y0,
|
||||
Min(text_pos.x+drawn_text_dim.x, rect.x1),
|
||||
rect.y1),
|
||||
ui_state->mouse);
|
||||
if(text_is_truncated && mouse_is_hovering)
|
||||
if(text_is_truncated && mouse_is_hovering && !(b->flags & UI_BoxFlag_DisableTruncatedHover))
|
||||
{
|
||||
if(!str8_match(box_display_string, ui_state->string_hover_string, 0))
|
||||
{
|
||||
@@ -1744,11 +1726,11 @@ ui_layout_position__in_place_rec(UI_Box *root, Axis2 axis)
|
||||
{
|
||||
child->fixed_position_animated = child->fixed_position;
|
||||
}
|
||||
child->rect.p0.v[axis] = root->rect.p0.v[axis] + child->fixed_position_animated.v[axis] - !(child->flags&(UI_BoxFlag_SkipViewOffX<<axis))*root->view_off.v[axis];
|
||||
child->rect.p0.v[axis] = root->rect.p0.v[axis] + child->fixed_position_animated.v[axis] - !(child->flags&(UI_BoxFlag_SkipViewOffX<<axis))*floor_f32(root->view_off.v[axis]);
|
||||
}
|
||||
else
|
||||
{
|
||||
child->rect.p0.v[axis] = root->rect.p0.v[axis] + child->fixed_position.v[axis] - !(child->flags&(UI_BoxFlag_SkipViewOffX<<axis))*root->view_off.v[axis];
|
||||
child->rect.p0.v[axis] = root->rect.p0.v[axis] + child->fixed_position.v[axis] - !(child->flags&(UI_BoxFlag_SkipViewOffX<<axis))*floor_f32(root->view_off.v[axis]);
|
||||
}
|
||||
child->rect.p1.v[axis] = child->rect.p0.v[axis] + child->fixed_size.v[axis];
|
||||
child->rect.p0.x = floorf(child->rect.p0.x);
|
||||
@@ -1792,6 +1774,18 @@ ui_layout_root(UI_Box *root, Axis2 axis)
|
||||
////////////////////////////////
|
||||
//~ rjf: Box Building API
|
||||
|
||||
//- rjf: spacers
|
||||
|
||||
internal UI_Signal
|
||||
ui_spacer(UI_Size size)
|
||||
{
|
||||
UI_Box *parent = ui_top_parent();
|
||||
ui_set_next_pref_size(parent->child_layout_axis, size);
|
||||
UI_Box *box = ui_build_box_from_key(0, ui_key_zero());
|
||||
UI_Signal interact = ui_signal_from_box(box);
|
||||
return interact;
|
||||
}
|
||||
|
||||
//- rjf: tooltips
|
||||
|
||||
internal void
|
||||
@@ -1801,11 +1795,15 @@ ui_tooltip_begin_base(void)
|
||||
ui_push_parent(ui_root_from_state(ui_state));
|
||||
ui_push_parent(ui_state->tooltip_root);
|
||||
ui_push_flags(0);
|
||||
ui_push_run_flags(0);
|
||||
ui_push_palette(ui_bottom_palette());
|
||||
}
|
||||
|
||||
internal void
|
||||
ui_tooltip_end_base(void)
|
||||
{
|
||||
ui_pop_palette();
|
||||
ui_pop_run_flags();
|
||||
ui_pop_flags();
|
||||
ui_pop_parent();
|
||||
ui_pop_parent();
|
||||
@@ -1815,6 +1813,7 @@ internal void
|
||||
ui_tooltip_begin(void)
|
||||
{
|
||||
ui_tooltip_begin_base();
|
||||
ui_push_palette(ui_state->widget_palette_info.tooltip_palette);
|
||||
ui_set_next_squish(0.25f-ui_state->tooltip_open_t*0.25f);
|
||||
ui_set_next_transparency(1-ui_state->tooltip_open_t);
|
||||
UI_Flags(UI_BoxFlag_DrawBorder|UI_BoxFlag_DrawBackground|UI_BoxFlag_DrawBackgroundBlur|UI_BoxFlag_DrawDropShadow)
|
||||
@@ -1822,11 +1821,11 @@ ui_tooltip_begin(void)
|
||||
UI_PrefHeight(ui_children_sum(1))
|
||||
UI_CornerRadius(ui_top_font_size()*0.25f)
|
||||
ui_column_begin();
|
||||
UI_PrefWidth(ui_px(0, 1)) ui_spacer(ui_em(0.5f, 1.f));
|
||||
UI_PrefWidth(ui_px(0, 1)) ui_spacer(ui_em(1.f, 1.f));
|
||||
UI_PrefWidth(ui_children_sum(1))
|
||||
UI_PrefHeight(ui_children_sum(1))
|
||||
ui_row_begin();
|
||||
UI_PrefHeight(ui_px(0, 1)) ui_spacer(ui_em(0.5f, 1.f));
|
||||
UI_PrefHeight(ui_px(0, 1)) ui_spacer(ui_em(1.f, 1.f));
|
||||
UI_PrefWidth(ui_children_sum(1))
|
||||
UI_PrefHeight(ui_children_sum(1))
|
||||
ui_column_begin();
|
||||
@@ -1842,10 +1841,11 @@ ui_tooltip_end(void)
|
||||
ui_pop_pref_width();
|
||||
ui_pop_pref_height();
|
||||
ui_column_end();
|
||||
UI_PrefHeight(ui_px(0, 1)) ui_spacer(ui_em(0.5f, 1.f));
|
||||
UI_PrefHeight(ui_px(0, 1)) ui_spacer(ui_em(1.f, 1.f));
|
||||
ui_row_end();
|
||||
UI_PrefWidth(ui_px(0, 1)) ui_spacer(ui_em(0.5f, 1.f));
|
||||
UI_PrefWidth(ui_px(0, 1)) ui_spacer(ui_em(1.f, 1.f));
|
||||
ui_column_end();
|
||||
ui_pop_palette();
|
||||
ui_tooltip_end_base();
|
||||
}
|
||||
|
||||
@@ -1879,31 +1879,40 @@ ui_begin_ctx_menu(UI_Key key)
|
||||
{
|
||||
ui_push_parent(ui_root_from_state(ui_state));
|
||||
ui_push_parent(ui_state->ctx_menu_root);
|
||||
B32 result = ui_key_match(key, ui_state->ctx_menu_key) && ui_state->ctx_menu_open;
|
||||
if(result != 0)
|
||||
ui_push_pref_width(ui_bottom_pref_width());
|
||||
ui_push_pref_height(ui_bottom_pref_height());
|
||||
ui_push_focus_hot(UI_FocusKind_Root);
|
||||
ui_push_focus_active(UI_FocusKind_Root);
|
||||
ui_push_palette(ui_state->widget_palette_info.ctx_menu_palette);
|
||||
B32 is_open = ui_key_match(key, ui_state->ctx_menu_key) && ui_state->ctx_menu_open;
|
||||
if(is_open != 0)
|
||||
{
|
||||
ui_state->ctx_menu_touched_this_frame = 1;
|
||||
ui_state->ctx_menu_root->flags |= UI_BoxFlag_RoundChildrenByParent;
|
||||
ui_state->ctx_menu_root->flags |= UI_BoxFlag_DrawBackgroundBlur;
|
||||
ui_state->ctx_menu_root->flags |= UI_BoxFlag_DrawBackground;
|
||||
ui_state->ctx_menu_root->flags |= UI_BoxFlag_DisableFocusOverlay;
|
||||
ui_state->ctx_menu_root->flags |= UI_BoxFlag_DrawBorder;
|
||||
ui_state->ctx_menu_root->flags |= UI_BoxFlag_Clip;
|
||||
ui_state->ctx_menu_root->flags |= UI_BoxFlag_Clickable;
|
||||
ui_state->ctx_menu_root->corner_radii[Corner_00] = ui_state->ctx_menu_root->corner_radii[Corner_01] = ui_state->ctx_menu_root->corner_radii[Corner_10] = ui_state->ctx_menu_root->corner_radii[Corner_11] = ui_top_font_size()*0.25f;
|
||||
ui_state->ctx_menu_root->background_color = ui_top_background_color();
|
||||
ui_state->ctx_menu_root->border_color = ui_top_border_color();
|
||||
ui_state->ctx_menu_root->palette = ui_top_palette();
|
||||
ui_state->ctx_menu_root->blur_size = ui_top_blur_size();
|
||||
ui_spacer(ui_em(1.f, 1.f));
|
||||
}
|
||||
ui_push_pref_width(ui_bottom_pref_width());
|
||||
ui_push_pref_height(ui_bottom_pref_height());
|
||||
ui_push_focus_hot(UI_FocusKind_Root);
|
||||
ui_push_focus_active(UI_FocusKind_Root);
|
||||
return result;
|
||||
ui_state->is_in_open_ctx_menu = is_open;
|
||||
return is_open;
|
||||
}
|
||||
|
||||
internal void
|
||||
ui_end_ctx_menu(void)
|
||||
{
|
||||
if(ui_state->is_in_open_ctx_menu)
|
||||
{
|
||||
ui_state->is_in_open_ctx_menu = 0;
|
||||
ui_spacer(ui_em(1.f, 1.f));
|
||||
}
|
||||
ui_pop_palette();
|
||||
ui_pop_focus_active();
|
||||
ui_pop_focus_hot();
|
||||
ui_pop_pref_width();
|
||||
@@ -2037,6 +2046,29 @@ ui_set_auto_focus_hot_key(UI_Key key)
|
||||
}
|
||||
}
|
||||
|
||||
//- rjf: palette forming
|
||||
|
||||
internal UI_Palette *
|
||||
ui_build_palette_(UI_Palette *base, UI_Palette *overrides)
|
||||
{
|
||||
UI_Palette *palette = push_array(ui_build_arena(), UI_Palette, 1);
|
||||
if(base != 0)
|
||||
{
|
||||
MemoryCopyStruct(palette, base);
|
||||
}
|
||||
for(EachEnumVal(UI_ColorCode, code))
|
||||
{
|
||||
if(overrides->colors[code].x != 0 ||
|
||||
overrides->colors[code].y != 0 ||
|
||||
overrides->colors[code].z != 0 ||
|
||||
overrides->colors[code].w != 0)
|
||||
{
|
||||
palette->colors[code] = overrides->colors[code];
|
||||
}
|
||||
}
|
||||
return palette;
|
||||
}
|
||||
|
||||
//- rjf: box node construction
|
||||
|
||||
internal UI_Box *
|
||||
@@ -2111,6 +2143,7 @@ ui_build_box_from_key(UI_BoxFlags flags, UI_Key key)
|
||||
box->key = key;
|
||||
box->flags = flags|ui_state->flags_stack.top->v;
|
||||
box->fastpath_codepoint = ui_state->fastpath_codepoint_stack.top->v;
|
||||
box->group_key = ui_state->group_key_stack.top->v;
|
||||
|
||||
if(ui_is_focus_active() && (box->flags & UI_BoxFlag_DefaultFocusNav) && ui_key_match(ui_state->default_nav_root_key, ui_key_zero()))
|
||||
{
|
||||
@@ -2181,13 +2214,11 @@ ui_build_box_from_key(UI_BoxFlags flags, UI_Key key)
|
||||
|
||||
box->text_align = ui_state->text_alignment_stack.top->v;
|
||||
box->child_layout_axis = ui_state->child_layout_axis_stack.top->v;
|
||||
box->background_color = ui_state->background_color_stack.top->v;
|
||||
box->text_color = ui_state->text_color_stack.top->v;
|
||||
box->border_color = ui_state->border_color_stack.top->v;
|
||||
box->overlay_color = ui_state->overlay_color_stack.top->v;
|
||||
box->palette = ui_state->palette_stack.top->v;
|
||||
box->font = ui_state->font_stack.top->v;
|
||||
box->font_size = ui_state->font_size_stack.top->v;
|
||||
box->tab_size = ui_state->tab_size_stack.top->v;
|
||||
box->run_flags = ui_state->run_flags_stack.top->v;
|
||||
box->corner_radii[Corner_00] = ui_state->corner_radius_00_stack.top->v;
|
||||
box->corner_radii[Corner_01] = ui_state->corner_radius_01_stack.top->v;
|
||||
box->corner_radii[Corner_10] = ui_state->corner_radius_10_stack.top->v;
|
||||
@@ -2271,12 +2302,13 @@ ui_box_equip_display_string(UI_Box *box, String8 string)
|
||||
ProfBeginFunction();
|
||||
box->string = push_str8_copy(ui_build_arena(), string);
|
||||
box->flags |= UI_BoxFlag_HasDisplayString;
|
||||
UI_ColorCode text_color_code = (box->flags & UI_BoxFlag_DrawTextWeak ? UI_ColorCode_TextWeak : UI_ColorCode_Text);
|
||||
if(box->flags & UI_BoxFlag_DrawText && (box->fastpath_codepoint == 0 || !(box->flags & UI_BoxFlag_DrawTextFastpathCodepoint)))
|
||||
{
|
||||
String8 display_string = ui_box_display_string(box);
|
||||
D_FancyStringNode fancy_string_n = {0, {box->font, display_string, box->text_color, box->font_size, 0, 0}};
|
||||
D_FancyStringNode fancy_string_n = {0, {box->font, display_string, box->palette->colors[text_color_code], box->font_size, 0, 0}};
|
||||
D_FancyStringList fancy_strings = {&fancy_string_n, &fancy_string_n, 1};
|
||||
box->display_string_runs = d_fancy_run_list_from_fancy_string_list(ui_build_arena(), box->tab_size, &fancy_strings);
|
||||
box->display_string_runs = d_fancy_run_list_from_fancy_string_list(ui_build_arena(), box->tab_size, box->run_flags, &fancy_strings);
|
||||
}
|
||||
else if(box->flags & UI_BoxFlag_DrawText && box->flags & UI_BoxFlag_DrawTextFastpathCodepoint && box->fastpath_codepoint != 0)
|
||||
{
|
||||
@@ -2287,17 +2319,17 @@ ui_box_equip_display_string(UI_Box *box, String8 string)
|
||||
U64 fpcp_pos = str8_find_needle(display_string, 0, fpcp, StringMatchFlag_CaseInsensitive);
|
||||
if(fpcp_pos < display_string.size)
|
||||
{
|
||||
D_FancyStringNode pst_fancy_string_n = {0, {box->font, str8_skip(display_string, fpcp_pos+fpcp.size), box->text_color, box->font_size, 0, 0}};
|
||||
D_FancyStringNode cdp_fancy_string_n = {&pst_fancy_string_n, {box->font, str8_substr(display_string, r1u64(fpcp_pos, fpcp_pos+fpcp.size)), box->text_color, box->font_size, 4.f, 0}};
|
||||
D_FancyStringNode pre_fancy_string_n = {&cdp_fancy_string_n, {box->font, str8_prefix(display_string, fpcp_pos), box->text_color, box->font_size, 0, 0}};
|
||||
D_FancyStringNode pst_fancy_string_n = {0, {box->font, str8_skip(display_string, fpcp_pos+fpcp.size), box->palette->colors[text_color_code], box->font_size, 0, 0}};
|
||||
D_FancyStringNode cdp_fancy_string_n = {&pst_fancy_string_n, {box->font, str8_substr(display_string, r1u64(fpcp_pos, fpcp_pos+fpcp.size)), box->palette->colors[text_color_code], box->font_size, 3.f, 0}};
|
||||
D_FancyStringNode pre_fancy_string_n = {&cdp_fancy_string_n, {box->font, str8_prefix(display_string, fpcp_pos), box->palette->colors[text_color_code], box->font_size, 0, 0}};
|
||||
D_FancyStringList fancy_strings = {&pre_fancy_string_n, &pst_fancy_string_n, 3};
|
||||
box->display_string_runs = d_fancy_run_list_from_fancy_string_list(ui_build_arena(), box->tab_size, &fancy_strings);
|
||||
box->display_string_runs = d_fancy_run_list_from_fancy_string_list(ui_build_arena(), box->tab_size, box->run_flags, &fancy_strings);
|
||||
}
|
||||
else
|
||||
{
|
||||
D_FancyStringNode fancy_string_n = {0, {box->font, display_string, box->text_color, box->font_size, 0, 0}};
|
||||
D_FancyStringNode fancy_string_n = {0, {box->font, display_string, box->palette->colors[UI_ColorCode_Text], box->font_size, 0, 0}};
|
||||
D_FancyStringList fancy_strings = {&fancy_string_n, &fancy_string_n, 1};
|
||||
box->display_string_runs = d_fancy_run_list_from_fancy_string_list(ui_build_arena(), box->tab_size, &fancy_strings);
|
||||
box->display_string_runs = d_fancy_run_list_from_fancy_string_list(ui_build_arena(), box->tab_size, box->run_flags, &fancy_strings);
|
||||
}
|
||||
scratch_end(scratch);
|
||||
}
|
||||
@@ -2305,11 +2337,11 @@ ui_box_equip_display_string(UI_Box *box, String8 string)
|
||||
}
|
||||
|
||||
internal void
|
||||
ui_box_equip_display_fancy_strings(UI_Box *box, F32 tab_size, D_FancyStringList *strings)
|
||||
ui_box_equip_display_fancy_strings(UI_Box *box, D_FancyStringList *strings)
|
||||
{
|
||||
box->flags |= UI_BoxFlag_HasDisplayString;
|
||||
box->string = d_string_from_fancy_string_list(ui_build_arena(), strings);
|
||||
box->display_string_runs = d_fancy_run_list_from_fancy_string_list(ui_build_arena(), tab_size, strings);
|
||||
box->display_string_runs = d_fancy_run_list_from_fancy_string_list(ui_build_arena(), box->tab_size, box->run_flags, strings);
|
||||
}
|
||||
|
||||
internal inline void
|
||||
@@ -2368,7 +2400,7 @@ ui_box_text_position(UI_Box *box)
|
||||
F_Tag font = box->font;
|
||||
F32 font_size = box->font_size;
|
||||
F_Metrics font_metrics = f_metrics_from_tag_size(font, font_size);
|
||||
result.y = ceil_f32((box->rect.p0.y + box->rect.p1.y)/2.f + (font_metrics.capital_height/2) - font_metrics.line_gap/2);
|
||||
result.y = floor_f32((box->rect.p0.y + box->rect.p1.y)/2.f + (font_metrics.capital_height/2) - font_metrics.line_gap/2);
|
||||
switch(box->text_align)
|
||||
{
|
||||
default:
|
||||
@@ -2378,14 +2410,14 @@ ui_box_text_position(UI_Box *box)
|
||||
}break;
|
||||
case UI_TextAlign_Center:
|
||||
{
|
||||
Vec2F32 advance = box->display_string_runs.dim;
|
||||
result.x = floor_f32((box->rect.p0.x + box->rect.p1.x)/2 - advance.x/2 - 1.f);
|
||||
Vec2F32 text_dim = box->display_string_runs.dim;
|
||||
result.x = round_f32((box->rect.p0.x + box->rect.p1.x)/2 - text_dim.x/2) - 1.f;
|
||||
result.x = ClampBot(result.x, box->rect.x0);
|
||||
}break;
|
||||
case UI_TextAlign_Right:
|
||||
{
|
||||
Vec2F32 advance = box->display_string_runs.dim;
|
||||
result.x = (box->rect.p1.x) - 1.f - advance.x;
|
||||
Vec2F32 text_dim = box->display_string_runs.dim;
|
||||
result.x = round_f32((box->rect.p1.x) - text_dim.x);
|
||||
result.x = ClampBot(result.x, box->rect.x0);
|
||||
}break;
|
||||
}
|
||||
@@ -2406,63 +2438,6 @@ ui_box_char_pos_from_xy(UI_Box *box, Vec2F32 xy)
|
||||
////////////////////////////////
|
||||
//~ rjf: Box Interaction
|
||||
|
||||
//- rjf: single-line string editing
|
||||
|
||||
internal B32
|
||||
ui_do_single_line_string_edits(TxtPt *cursor, TxtPt *mark, U64 string_max, String8 *out_string)
|
||||
{
|
||||
B32 change = 0;
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
UI_EventList *events = ui_events();
|
||||
for(UI_EventNode *n = events->first, *next = 0; n != 0; n = next)
|
||||
{
|
||||
next = n->next;
|
||||
|
||||
// rjf: do not consume anything that doesn't fit a single-line's operations
|
||||
if((n->v.kind != UI_EventKind_Edit && n->v.kind != UI_EventKind_Navigate && n->v.kind != UI_EventKind_Text) || n->v.delta_2s32.y != 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// rjf: map this action to an op
|
||||
B32 taken = 0;
|
||||
UI_TxtOp op = ui_single_line_txt_op_from_event(scratch.arena, &n->v, *out_string, *cursor, *mark);
|
||||
|
||||
// rjf: perform replace range
|
||||
if(!txt_pt_match(op.range.min, op.range.max) || op.replace.size != 0)
|
||||
{
|
||||
taken = 1;
|
||||
String8 new_string = ui_push_string_replace_range(scratch.arena, *out_string, r1s64(op.range.min.column, op.range.max.column), op.replace);
|
||||
new_string.size = Min(string_max, new_string.size);
|
||||
MemoryCopy(out_string->str, new_string.str, new_string.size);
|
||||
out_string->size = new_string.size;
|
||||
}
|
||||
|
||||
// rjf: perform copy
|
||||
if(op.flags & UI_TxtOpFlag_Copy)
|
||||
{
|
||||
taken = 1;
|
||||
os_set_clipboard_text(op.copy);
|
||||
}
|
||||
|
||||
// rjf: commit op's changed cursor & mark to caller-provided state
|
||||
taken = taken || (!txt_pt_match(*cursor, op.cursor) || !txt_pt_match(*mark, op.mark));
|
||||
*cursor = op.cursor;
|
||||
*mark = op.mark;
|
||||
|
||||
// rjf: consume event
|
||||
if(taken)
|
||||
{
|
||||
ui_eat_event(events, n);
|
||||
change = 1;
|
||||
}
|
||||
}
|
||||
scratch_end(scratch);
|
||||
return change;
|
||||
}
|
||||
|
||||
//- rjf: general box interaction path
|
||||
|
||||
internal UI_Signal
|
||||
ui_signal_from_box(UI_Box *box)
|
||||
{
|
||||
@@ -2798,6 +2773,26 @@ ui_signal_from_box(UI_Box *box)
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////
|
||||
//- rjf: mouse is over this box's rect, currently-active-key has the same group key? -> set hot/active key
|
||||
//
|
||||
if(box->flags & UI_BoxFlag_MouseClickable &&
|
||||
contains_2f32(rect, ui_state->mouse) &&
|
||||
!contains_2f32(blacklist_rect, ui_state->mouse) &&
|
||||
!ui_key_match(ui_key_zero(), box->group_key))
|
||||
{
|
||||
for(EachEnumVal(UI_MouseButtonKind, k))
|
||||
{
|
||||
UI_Box *active_box = ui_box_from_key(ui_state->active_box_key[k]);
|
||||
if(ui_key_match(box->group_key, active_box->group_key))
|
||||
{
|
||||
ui_state->hot_box_key = box->key;
|
||||
ui_state->active_box_key[k] = box->key;
|
||||
sig.f |= UI_SignalFlag_Hovering|(UI_SignalFlag_Dragging<<k);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////
|
||||
//- rjf: mouse is over this box's rect, drop site, no other drop hot key? -> set drop hot key
|
||||
//
|
||||
@@ -2890,6 +2885,16 @@ ui_pop_rect(void)
|
||||
return popped;
|
||||
}
|
||||
|
||||
internal void
|
||||
ui_set_next_rect(Rng2F32 rect)
|
||||
{
|
||||
Vec2F32 size = dim_2f32(rect);
|
||||
ui_set_next_fixed_x(rect.x0);
|
||||
ui_set_next_fixed_y(rect.y0);
|
||||
ui_set_next_fixed_width(size.x);
|
||||
ui_set_next_fixed_height(size.y);
|
||||
}
|
||||
|
||||
internal UI_Size
|
||||
ui_push_pref_size(Axis2 axis, UI_Size v)
|
||||
{
|
||||
|
||||
+157
-88
@@ -195,6 +195,72 @@ struct UI_Size
|
||||
F32 strictness;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Palettes
|
||||
|
||||
typedef enum UI_ColorCode
|
||||
{
|
||||
UI_ColorCode_Null,
|
||||
UI_ColorCode_Background,
|
||||
UI_ColorCode_Text,
|
||||
UI_ColorCode_TextWeak,
|
||||
UI_ColorCode_Border,
|
||||
UI_ColorCode_Overlay,
|
||||
UI_ColorCode_Cursor,
|
||||
UI_ColorCode_Selection,
|
||||
UI_ColorCode_COUNT
|
||||
}
|
||||
UI_ColorCode;
|
||||
|
||||
typedef struct UI_Palette UI_Palette;
|
||||
struct UI_Palette
|
||||
{
|
||||
union
|
||||
{
|
||||
Vec4F32 colors[UI_ColorCode_COUNT];
|
||||
struct
|
||||
{
|
||||
Vec4F32 null;
|
||||
Vec4F32 background;
|
||||
Vec4F32 text;
|
||||
Vec4F32 text_weak;
|
||||
Vec4F32 border;
|
||||
Vec4F32 overlay;
|
||||
Vec4F32 cursor;
|
||||
Vec4F32 selection;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
typedef struct UI_WidgetPaletteInfo UI_WidgetPaletteInfo;
|
||||
struct UI_WidgetPaletteInfo
|
||||
{
|
||||
UI_Palette *tooltip_palette;
|
||||
UI_Palette *ctx_menu_palette;
|
||||
UI_Palette *scrollbar_palette;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Animation Info
|
||||
|
||||
typedef U32 UI_AnimationInfoFlags;
|
||||
enum
|
||||
{
|
||||
UI_AnimationInfoFlag_HotAnimations = (1<<0),
|
||||
UI_AnimationInfoFlag_ActiveAnimations = (1<<1),
|
||||
UI_AnimationInfoFlag_FocusAnimations = (1<<2),
|
||||
UI_AnimationInfoFlag_TooltipAnimations = (1<<3),
|
||||
UI_AnimationInfoFlag_ContextMenuAnimations = (1<<4),
|
||||
UI_AnimationInfoFlag_ScrollingAnimations = (1<<5),
|
||||
UI_AnimationInfoFlag_All = 0xffffffff,
|
||||
};
|
||||
|
||||
typedef struct UI_AnimationInfo UI_AnimationInfo;
|
||||
struct UI_AnimationInfo
|
||||
{
|
||||
UI_AnimationInfoFlags flags;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Scroll Positions
|
||||
|
||||
@@ -252,53 +318,56 @@ typedef U64 UI_BoxFlags;
|
||||
# define UI_BoxFlag_DefaultFocusNavY (UI_BoxFlags)(1ull<<14)
|
||||
# define UI_BoxFlag_DefaultFocusEdit (UI_BoxFlags)(1ull<<15)
|
||||
# define UI_BoxFlag_FocusNavSkip (UI_BoxFlags)(1ull<<16)
|
||||
# define UI_BoxFlag_Disabled (UI_BoxFlags)(1ull<<17)
|
||||
# define UI_BoxFlag_DisableTruncatedHover (UI_BoxFlags)(1ull<<17)
|
||||
# define UI_BoxFlag_Disabled (UI_BoxFlags)(1ull<<18)
|
||||
|
||||
//- rjf: layout
|
||||
# define UI_BoxFlag_FloatingX (UI_BoxFlags)(1ull<<18)
|
||||
# define UI_BoxFlag_FloatingY (UI_BoxFlags)(1ull<<19)
|
||||
# define UI_BoxFlag_FixedWidth (UI_BoxFlags)(1ull<<20)
|
||||
# define UI_BoxFlag_FixedHeight (UI_BoxFlags)(1ull<<21)
|
||||
# define UI_BoxFlag_AllowOverflowX (UI_BoxFlags)(1ull<<22)
|
||||
# define UI_BoxFlag_AllowOverflowY (UI_BoxFlags)(1ull<<23)
|
||||
# define UI_BoxFlag_SkipViewOffX (UI_BoxFlags)(1ull<<24)
|
||||
# define UI_BoxFlag_SkipViewOffY (UI_BoxFlags)(1ull<<25)
|
||||
# define UI_BoxFlag_FloatingX (UI_BoxFlags)(1ull<<19)
|
||||
# define UI_BoxFlag_FloatingY (UI_BoxFlags)(1ull<<20)
|
||||
# define UI_BoxFlag_FixedWidth (UI_BoxFlags)(1ull<<21)
|
||||
# define UI_BoxFlag_FixedHeight (UI_BoxFlags)(1ull<<22)
|
||||
# define UI_BoxFlag_AllowOverflowX (UI_BoxFlags)(1ull<<23)
|
||||
# define UI_BoxFlag_AllowOverflowY (UI_BoxFlags)(1ull<<24)
|
||||
# define UI_BoxFlag_SkipViewOffX (UI_BoxFlags)(1ull<<25)
|
||||
# define UI_BoxFlag_SkipViewOffY (UI_BoxFlags)(1ull<<26)
|
||||
|
||||
//- rjf: appearance / animation
|
||||
# define UI_BoxFlag_DrawDropShadow (UI_BoxFlags)(1ull<<26)
|
||||
# define UI_BoxFlag_DrawBackgroundBlur (UI_BoxFlags)(1ull<<27)
|
||||
# define UI_BoxFlag_DrawBackground (UI_BoxFlags)(1ull<<28)
|
||||
# define UI_BoxFlag_DrawBorder (UI_BoxFlags)(1ull<<29)
|
||||
# define UI_BoxFlag_DrawSideTop (UI_BoxFlags)(1ull<<30)
|
||||
# define UI_BoxFlag_DrawSideBottom (UI_BoxFlags)(1ull<<31)
|
||||
# define UI_BoxFlag_DrawSideLeft (UI_BoxFlags)(1ull<<32)
|
||||
# define UI_BoxFlag_DrawSideRight (UI_BoxFlags)(1ull<<33)
|
||||
# define UI_BoxFlag_DrawText (UI_BoxFlags)(1ull<<34)
|
||||
# define UI_BoxFlag_DrawTextFastpathCodepoint (UI_BoxFlags)(1ull<<35)
|
||||
# define UI_BoxFlag_DrawHotEffects (UI_BoxFlags)(1ull<<36)
|
||||
# define UI_BoxFlag_DrawActiveEffects (UI_BoxFlags)(1ull<<37)
|
||||
# define UI_BoxFlag_DrawOverlay (UI_BoxFlags)(1ull<<38)
|
||||
# define UI_BoxFlag_DrawBucket (UI_BoxFlags)(1ull<<39)
|
||||
# define UI_BoxFlag_Clip (UI_BoxFlags)(1ull<<40)
|
||||
# define UI_BoxFlag_AnimatePosX (UI_BoxFlags)(1ull<<41)
|
||||
# define UI_BoxFlag_AnimatePosY (UI_BoxFlags)(1ull<<42)
|
||||
# define UI_BoxFlag_DisableTextTrunc (UI_BoxFlags)(1ull<<43)
|
||||
# define UI_BoxFlag_DisableIDString (UI_BoxFlags)(1ull<<44)
|
||||
# define UI_BoxFlag_DisableFocusViz (UI_BoxFlags)(1ull<<45)
|
||||
# define UI_BoxFlag_RequireFocusBackground (UI_BoxFlags)(1ull<<46)
|
||||
# define UI_BoxFlag_HasDisplayString (UI_BoxFlags)(1ull<<47)
|
||||
# define UI_BoxFlag_HasFuzzyMatchRanges (UI_BoxFlags)(1ull<<48)
|
||||
# define UI_BoxFlag_RoundChildrenByParent (UI_BoxFlags)(1ull<<49)
|
||||
# define UI_BoxFlag_DrawDropShadow (UI_BoxFlags)(1ull<<27)
|
||||
# define UI_BoxFlag_DrawBackgroundBlur (UI_BoxFlags)(1ull<<28)
|
||||
# define UI_BoxFlag_DrawBackground (UI_BoxFlags)(1ull<<29)
|
||||
# define UI_BoxFlag_DrawBorder (UI_BoxFlags)(1ull<<30)
|
||||
# define UI_BoxFlag_DrawSideTop (UI_BoxFlags)(1ull<<31)
|
||||
# define UI_BoxFlag_DrawSideBottom (UI_BoxFlags)(1ull<<32)
|
||||
# define UI_BoxFlag_DrawSideLeft (UI_BoxFlags)(1ull<<33)
|
||||
# define UI_BoxFlag_DrawSideRight (UI_BoxFlags)(1ull<<34)
|
||||
# define UI_BoxFlag_DrawText (UI_BoxFlags)(1ull<<35)
|
||||
# define UI_BoxFlag_DrawTextFastpathCodepoint (UI_BoxFlags)(1ull<<36)
|
||||
# define UI_BoxFlag_DrawTextWeak (UI_BoxFlags)(1ull<<37)
|
||||
# define UI_BoxFlag_DrawHotEffects (UI_BoxFlags)(1ull<<38)
|
||||
# define UI_BoxFlag_DrawActiveEffects (UI_BoxFlags)(1ull<<39)
|
||||
# define UI_BoxFlag_DrawOverlay (UI_BoxFlags)(1ull<<40)
|
||||
# define UI_BoxFlag_DrawBucket (UI_BoxFlags)(1ull<<41)
|
||||
# define UI_BoxFlag_Clip (UI_BoxFlags)(1ull<<42)
|
||||
# define UI_BoxFlag_AnimatePosX (UI_BoxFlags)(1ull<<43)
|
||||
# define UI_BoxFlag_AnimatePosY (UI_BoxFlags)(1ull<<44)
|
||||
# define UI_BoxFlag_DisableTextTrunc (UI_BoxFlags)(1ull<<45)
|
||||
# define UI_BoxFlag_DisableIDString (UI_BoxFlags)(1ull<<46)
|
||||
# define UI_BoxFlag_DisableFocusBorder (UI_BoxFlags)(1ull<<47)
|
||||
# define UI_BoxFlag_DisableFocusOverlay (UI_BoxFlags)(1ull<<48)
|
||||
# define UI_BoxFlag_HasDisplayString (UI_BoxFlags)(1ull<<49)
|
||||
# define UI_BoxFlag_HasFuzzyMatchRanges (UI_BoxFlags)(1ull<<50)
|
||||
# define UI_BoxFlag_RoundChildrenByParent (UI_BoxFlags)(1ull<<51)
|
||||
|
||||
//- rjf: bundles
|
||||
# define UI_BoxFlag_Clickable (UI_BoxFlag_MouseClickable|UI_BoxFlag_KeyboardClickable)
|
||||
# define UI_BoxFlag_DefaultFocusNav (UI_BoxFlag_DefaultFocusNavX|UI_BoxFlag_DefaultFocusNavY|UI_BoxFlag_DefaultFocusEdit)
|
||||
# define UI_BoxFlag_Floating (UI_BoxFlag_FloatingX|UI_BoxFlag_FloatingY)
|
||||
# define UI_BoxFlag_FixedSize (UI_BoxFlag_FixedWidth|UI_BoxFlag_FixedHeight)
|
||||
# define UI_BoxFlag_AllowOverflow (UI_BoxFlag_AllowOverflowX|UI_BoxFlag_AllowOverflowY)
|
||||
# define UI_BoxFlag_AnimatePos (UI_BoxFlag_AnimatePosX|UI_BoxFlag_AnimatePosY)
|
||||
# define UI_BoxFlag_ViewScroll (UI_BoxFlag_ViewScrollX|UI_BoxFlag_ViewScrollY)
|
||||
# define UI_BoxFlag_ViewClamp (UI_BoxFlag_ViewClampX|UI_BoxFlag_ViewClampY)
|
||||
# define UI_BoxFlag_Clickable (UI_BoxFlag_MouseClickable|UI_BoxFlag_KeyboardClickable)
|
||||
# define UI_BoxFlag_DefaultFocusNav (UI_BoxFlag_DefaultFocusNavX|UI_BoxFlag_DefaultFocusNavY|UI_BoxFlag_DefaultFocusEdit)
|
||||
# define UI_BoxFlag_Floating (UI_BoxFlag_FloatingX|UI_BoxFlag_FloatingY)
|
||||
# define UI_BoxFlag_FixedSize (UI_BoxFlag_FixedWidth|UI_BoxFlag_FixedHeight)
|
||||
# define UI_BoxFlag_AllowOverflow (UI_BoxFlag_AllowOverflowX|UI_BoxFlag_AllowOverflowY)
|
||||
# define UI_BoxFlag_AnimatePos (UI_BoxFlag_AnimatePosX|UI_BoxFlag_AnimatePosY)
|
||||
# define UI_BoxFlag_ViewScroll (UI_BoxFlag_ViewScrollX|UI_BoxFlag_ViewScrollY)
|
||||
# define UI_BoxFlag_ViewClamp (UI_BoxFlag_ViewClampX|UI_BoxFlag_ViewClampY)
|
||||
# define UI_BoxFlag_DisableFocusEffects (UI_BoxFlag_DisableFocusBorder|UI_BoxFlag_DisableFocusOverlay)
|
||||
//}
|
||||
|
||||
typedef struct UI_Box UI_Box;
|
||||
@@ -327,16 +396,15 @@ struct UI_Box
|
||||
Axis2 child_layout_axis;
|
||||
OS_Cursor hover_cursor;
|
||||
U32 fastpath_codepoint;
|
||||
UI_Key group_key;
|
||||
D_Bucket *draw_bucket;
|
||||
UI_BoxCustomDrawFunctionType *custom_draw;
|
||||
void *custom_draw_user_data;
|
||||
Vec4F32 background_color;
|
||||
Vec4F32 text_color;
|
||||
Vec4F32 border_color;
|
||||
Vec4F32 overlay_color;
|
||||
UI_Palette *palette;
|
||||
F_Tag font;
|
||||
F32 font_size;
|
||||
F32 tab_size;
|
||||
F_RunFlags run_flags;
|
||||
F32 corner_radii[Corner_COUNT];
|
||||
F32 blur_size;
|
||||
F32 transparency;
|
||||
@@ -512,6 +580,9 @@ struct UI_State
|
||||
U64 box_table_size;
|
||||
UI_BoxHashSlot *box_table;
|
||||
|
||||
//- rjf: build state machine state
|
||||
B32 is_in_open_ctx_menu;
|
||||
|
||||
//- rjf: build phase output
|
||||
UI_Box *root;
|
||||
UI_Box *tooltip_root;
|
||||
@@ -524,11 +595,12 @@ struct UI_State
|
||||
|
||||
//- rjf: build parameters
|
||||
UI_IconInfo icon_info;
|
||||
UI_WidgetPaletteInfo widget_palette_info;
|
||||
UI_AnimationInfo animation_info;
|
||||
OS_Handle window;
|
||||
UI_EventList *events;
|
||||
Vec2F32 mouse;
|
||||
F32 animation_dt;
|
||||
B32 external_focus_commit;
|
||||
|
||||
//- rjf: user interaction state
|
||||
UI_Key hot_box_key;
|
||||
@@ -604,6 +676,11 @@ internal UI_Size ui_size(UI_SizeKind kind, F32 value, F32 strictness);
|
||||
#define ui_pct(value, strictness) ui_size(UI_SizeKind_ParentPct, value, strictness)
|
||||
#define ui_children_sum(strictness) ui_size(UI_SizeKind_ChildrenSum, 0.f, strictness)
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Color Scheme Type Functions
|
||||
|
||||
read_only global UI_Palette ui_g_nil_palette = {0};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Scroll Point Type Functions
|
||||
|
||||
@@ -684,7 +761,7 @@ internal UI_Box * ui_box_from_key(UI_Key key);
|
||||
////////////////////////////////
|
||||
//~ rjf: Top-Level Building API
|
||||
|
||||
internal void ui_begin_build(OS_Handle window, UI_EventList *events, UI_IconInfo *icon_info, F32 real_dt, F32 animation_dt);
|
||||
internal void ui_begin_build(OS_Handle window, UI_EventList *events, UI_IconInfo *icon_info, UI_WidgetPaletteInfo *widget_palette_info, UI_AnimationInfo *animation_info, F32 real_dt, F32 animation_dt);
|
||||
internal void ui_end_build(void);
|
||||
internal void ui_calc_sizes_standalone__in_place_rec(UI_Box *root, Axis2 axis);
|
||||
internal void ui_calc_sizes_upwards_dependent__in_place_rec(UI_Box *root, Axis2 axis);
|
||||
@@ -696,6 +773,9 @@ internal void ui_layout_root(UI_Box *root, Axis2 axis);
|
||||
////////////////////////////////
|
||||
//~ rjf: Box Tree Building API
|
||||
|
||||
//- rjf: spacers
|
||||
internal UI_Signal ui_spacer(UI_Size size);
|
||||
|
||||
//- rjf: tooltips
|
||||
internal void ui_tooltip_begin_base(void);
|
||||
internal void ui_tooltip_end_base(void);
|
||||
@@ -720,6 +800,10 @@ internal B32 ui_is_key_auto_focus_hot(UI_Key key);
|
||||
internal void ui_set_auto_focus_active_key(UI_Key key);
|
||||
internal void ui_set_auto_focus_hot_key(UI_Key key);
|
||||
|
||||
//- rjf: palette forming
|
||||
internal UI_Palette * ui_build_palette_(UI_Palette *base, UI_Palette *overrides);
|
||||
#define ui_build_palette(base, ...) ui_build_palette_((base), &(UI_Palette){.text = v4f32(0, 0, 0, 0), __VA_ARGS__})
|
||||
|
||||
//- rjf: box node construction
|
||||
internal UI_Box * ui_build_box_from_key(UI_BoxFlags flags, UI_Key key);
|
||||
internal UI_Key ui_active_seed_key(void);
|
||||
@@ -728,7 +812,7 @@ internal UI_Box * ui_build_box_from_stringf(UI_BoxFlags flags, char *fm
|
||||
|
||||
//- rjf: box node equipment
|
||||
internal inline void ui_box_equip_display_string(UI_Box *box, String8 string);
|
||||
internal inline void ui_box_equip_display_fancy_strings(UI_Box *box, F32 tab_size, D_FancyStringList *strings);
|
||||
internal inline void ui_box_equip_display_fancy_strings(UI_Box *box, D_FancyStringList *strings);
|
||||
internal inline void ui_box_equip_display_string_fancy_runs(UI_Box *box, String8 string, D_FancyRunList *runs);
|
||||
internal inline void ui_box_equip_fuzzy_match_ranges(UI_Box *box, FuzzyMatchRangeList *matches);
|
||||
internal inline void ui_box_equip_draw_bucket(UI_Box *box, D_Bucket *bucket);
|
||||
@@ -742,10 +826,6 @@ internal U64 ui_box_char_pos_from_xy(UI_Box *box, Vec2F32 xy);
|
||||
////////////////////////////////
|
||||
//~ rjf: User Interaction
|
||||
|
||||
//- rjf: single-line string editing
|
||||
internal B32 ui_do_single_line_string_edits(TxtPt *cursor, TxtPt *mark, U64 string_max, String8 *out_string);
|
||||
|
||||
//- rjf: general box interaction path
|
||||
internal UI_Signal ui_signal_from_box(UI_Box *box);
|
||||
|
||||
////////////////////////////////
|
||||
@@ -764,17 +844,15 @@ internal UI_BoxFlags ui_top_flags(void);
|
||||
internal UI_FocusKind ui_top_focus_hot(void);
|
||||
internal UI_FocusKind ui_top_focus_active(void);
|
||||
internal U32 ui_top_fastpath_codepoint(void);
|
||||
internal UI_Key ui_top_group_key(void);
|
||||
internal F32 ui_top_transparency(void);
|
||||
internal Vec4F32 ui_top_background_color(void);
|
||||
internal Vec4F32 ui_top_text_color(void);
|
||||
internal Vec4F32 ui_top_border_color(void);
|
||||
internal Vec4F32 ui_top_overlay_color(void);
|
||||
internal Vec4F32 ui_top_text_select_color(void);
|
||||
internal Vec4F32 ui_top_text_cursor_color(void);
|
||||
internal UI_Palette* ui_top_palette(void);
|
||||
internal F32 ui_top_squish(void);
|
||||
internal OS_Cursor ui_top_hover_cursor(void);
|
||||
internal F_Tag ui_top_font(void);
|
||||
internal F32 ui_top_font_size(void);
|
||||
internal F_RunFlags ui_top_run_flags(void);
|
||||
internal F32 ui_top_tab_size(void);
|
||||
internal F32 ui_top_corner_radius_00(void);
|
||||
internal F32 ui_top_corner_radius_01(void);
|
||||
internal F32 ui_top_corner_radius_10(void);
|
||||
@@ -794,17 +872,15 @@ internal UI_BoxFlags ui_bottom_flags(void);
|
||||
internal UI_FocusKind ui_bottom_focus_hot(void);
|
||||
internal UI_FocusKind ui_bottom_focus_active(void);
|
||||
internal U32 ui_bottom_fastpath_codepoint(void);
|
||||
internal UI_Key ui_bottom_group_key(void);
|
||||
internal F32 ui_bottom_transparency(void);
|
||||
internal Vec4F32 ui_bottom_background_color(void);
|
||||
internal Vec4F32 ui_bottom_text_color(void);
|
||||
internal Vec4F32 ui_bottom_border_color(void);
|
||||
internal Vec4F32 ui_bottom_overlay_color(void);
|
||||
internal Vec4F32 ui_bottom_text_select_color(void);
|
||||
internal Vec4F32 ui_bottom_text_cursor_color(void);
|
||||
internal UI_Palette* ui_bottom_palette(void);
|
||||
internal F32 ui_bottom_squish(void);
|
||||
internal OS_Cursor ui_bottom_hover_cursor(void);
|
||||
internal F_Tag ui_bottom_font(void);
|
||||
internal F32 ui_bottom_font_size(void);
|
||||
internal F_RunFlags ui_bottom_run_flags(void);
|
||||
internal F32 ui_bottom_tab_size(void);
|
||||
internal F32 ui_bottom_corner_radius_00(void);
|
||||
internal F32 ui_bottom_corner_radius_01(void);
|
||||
internal F32 ui_bottom_corner_radius_10(void);
|
||||
@@ -824,17 +900,15 @@ internal UI_BoxFlags ui_push_flags(UI_BoxFlags v);
|
||||
internal UI_FocusKind ui_push_focus_hot(UI_FocusKind v);
|
||||
internal UI_FocusKind ui_push_focus_active(UI_FocusKind v);
|
||||
internal U32 ui_push_fastpath_codepoint(U32 v);
|
||||
internal UI_Key ui_push_group_key(UI_Key v);
|
||||
internal F32 ui_push_transparency(F32 v);
|
||||
internal Vec4F32 ui_push_background_color(Vec4F32 v);
|
||||
internal Vec4F32 ui_push_text_color(Vec4F32 v);
|
||||
internal Vec4F32 ui_push_border_color(Vec4F32 v);
|
||||
internal Vec4F32 ui_push_overlay_color(Vec4F32 v);
|
||||
internal Vec4F32 ui_push_text_select_color(Vec4F32 v);
|
||||
internal Vec4F32 ui_push_text_cursor_color(Vec4F32 v);
|
||||
internal UI_Palette* ui_push_palette(UI_Palette* v);
|
||||
internal F32 ui_push_squish(F32 v);
|
||||
internal OS_Cursor ui_push_hover_cursor(OS_Cursor v);
|
||||
internal F_Tag ui_push_font(F_Tag v);
|
||||
internal F32 ui_push_font_size(F32 v);
|
||||
internal F_RunFlags ui_push_run_flags(F_RunFlags v);
|
||||
internal F32 ui_push_tab_size(F32 v);
|
||||
internal F32 ui_push_corner_radius_00(F32 v);
|
||||
internal F32 ui_push_corner_radius_01(F32 v);
|
||||
internal F32 ui_push_corner_radius_10(F32 v);
|
||||
@@ -854,17 +928,15 @@ internal UI_BoxFlags ui_pop_flags(void);
|
||||
internal UI_FocusKind ui_pop_focus_hot(void);
|
||||
internal UI_FocusKind ui_pop_focus_active(void);
|
||||
internal U32 ui_pop_fastpath_codepoint(void);
|
||||
internal UI_Key ui_pop_group_key(void);
|
||||
internal F32 ui_pop_transparency(void);
|
||||
internal Vec4F32 ui_pop_background_color(void);
|
||||
internal Vec4F32 ui_pop_text_color(void);
|
||||
internal Vec4F32 ui_pop_border_color(void);
|
||||
internal Vec4F32 ui_pop_overlay_color(void);
|
||||
internal Vec4F32 ui_pop_text_select_color(void);
|
||||
internal Vec4F32 ui_pop_text_cursor_color(void);
|
||||
internal UI_Palette* ui_pop_palette(void);
|
||||
internal F32 ui_pop_squish(void);
|
||||
internal OS_Cursor ui_pop_hover_cursor(void);
|
||||
internal F_Tag ui_pop_font(void);
|
||||
internal F32 ui_pop_font_size(void);
|
||||
internal F_RunFlags ui_pop_run_flags(void);
|
||||
internal F32 ui_pop_tab_size(void);
|
||||
internal F32 ui_pop_corner_radius_00(void);
|
||||
internal F32 ui_pop_corner_radius_01(void);
|
||||
internal F32 ui_pop_corner_radius_10(void);
|
||||
@@ -884,17 +956,15 @@ internal UI_BoxFlags ui_set_next_flags(UI_BoxFlags v);
|
||||
internal UI_FocusKind ui_set_next_focus_hot(UI_FocusKind v);
|
||||
internal UI_FocusKind ui_set_next_focus_active(UI_FocusKind v);
|
||||
internal U32 ui_set_next_fastpath_codepoint(U32 v);
|
||||
internal UI_Key ui_set_next_group_key(UI_Key v);
|
||||
internal F32 ui_set_next_transparency(F32 v);
|
||||
internal Vec4F32 ui_set_next_background_color(Vec4F32 v);
|
||||
internal Vec4F32 ui_set_next_text_color(Vec4F32 v);
|
||||
internal Vec4F32 ui_set_next_border_color(Vec4F32 v);
|
||||
internal Vec4F32 ui_set_next_overlay_color(Vec4F32 v);
|
||||
internal Vec4F32 ui_set_next_text_select_color(Vec4F32 v);
|
||||
internal Vec4F32 ui_set_next_text_cursor_color(Vec4F32 v);
|
||||
internal UI_Palette* ui_set_next_palette(UI_Palette* v);
|
||||
internal F32 ui_set_next_squish(F32 v);
|
||||
internal OS_Cursor ui_set_next_hover_cursor(OS_Cursor v);
|
||||
internal F_Tag ui_set_next_font(F_Tag v);
|
||||
internal F32 ui_set_next_font_size(F32 v);
|
||||
internal F_RunFlags ui_set_next_run_flags(F_RunFlags v);
|
||||
internal F32 ui_set_next_tab_size(F32 v);
|
||||
internal F32 ui_set_next_corner_radius_00(F32 v);
|
||||
internal F32 ui_set_next_corner_radius_01(F32 v);
|
||||
internal F32 ui_set_next_corner_radius_10(F32 v);
|
||||
@@ -906,6 +976,7 @@ internal UI_TextAlign ui_set_next_text_alignment(UI_TextAlign v);
|
||||
//- rjf: helpers
|
||||
internal Rng2F32 ui_push_rect(Rng2F32 rect);
|
||||
internal Rng2F32 ui_pop_rect(void);
|
||||
internal void ui_set_next_rect(Rng2F32 rect);
|
||||
internal UI_Size ui_push_pref_size(Axis2 axis, UI_Size v);
|
||||
internal UI_Size ui_pop_pref_size(Axis2 axis);
|
||||
internal UI_Size ui_set_next_pref_size(Axis2 axis, UI_Size v);
|
||||
@@ -928,17 +999,14 @@ internal void ui_pop_corner_radius(void);
|
||||
#define UI_FocusHot(v) DeferLoop(ui_push_focus_hot(v), ui_pop_focus_hot())
|
||||
#define UI_FocusActive(v) DeferLoop(ui_push_focus_active(v), ui_pop_focus_active())
|
||||
#define UI_FastpathCodepoint(v) DeferLoop(ui_push_fastpath_codepoint(v), ui_pop_fastpath_codepoint())
|
||||
#define UI_GroupKey(v) DeferLoop(ui_push_group_key(v), ui_pop_group_key())
|
||||
#define UI_Transparency(v) DeferLoop(ui_push_transparency(v), ui_pop_transparency())
|
||||
#define UI_BackgroundColor(v) DeferLoop(ui_push_background_color(v), ui_pop_background_color())
|
||||
#define UI_TextColor(v) DeferLoop(ui_push_text_color(v), ui_pop_text_color())
|
||||
#define UI_BorderColor(v) DeferLoop(ui_push_border_color(v), ui_pop_border_color())
|
||||
#define UI_OverlayColor(v) DeferLoop(ui_push_overlay_color(v), ui_pop_overlay_color())
|
||||
#define UI_TextSelectColor(v) DeferLoop(ui_push_text_select_color(v), ui_pop_text_select_color())
|
||||
#define UI_TextCursorColor(v) DeferLoop(ui_push_text_cursor_color(v), ui_pop_text_cursor_color())
|
||||
#define UI_Palette(v) DeferLoop(ui_push_palette(v), ui_pop_palette())
|
||||
#define UI_Squish(v) DeferLoop(ui_push_squish(v), ui_pop_squish())
|
||||
#define UI_HoverCursor(v) DeferLoop(ui_push_hover_cursor(v), ui_pop_hover_cursor())
|
||||
#define UI_Font(v) DeferLoop(ui_push_font(v), ui_pop_font())
|
||||
#define UI_FontSize(v) DeferLoop(ui_push_font_size(v), ui_pop_font_size())
|
||||
#define UI_RunFlags(v) DeferLoop(ui_push_run_flags(v), ui_pop_run_flags())
|
||||
#define UI_TabSize(v) DeferLoop(ui_push_tab_size(v), ui_pop_tab_size())
|
||||
#define UI_CornerRadius00(v) DeferLoop(ui_push_corner_radius_00(v), ui_pop_corner_radius_00())
|
||||
#define UI_CornerRadius01(v) DeferLoop(ui_push_corner_radius_01(v), ui_pop_corner_radius_01())
|
||||
@@ -955,6 +1023,7 @@ internal void ui_pop_corner_radius(void);
|
||||
#define UI_PrefSize(axis, v) DeferLoop(ui_push_pref_size((axis), (v)), ui_pop_pref_size(axis))
|
||||
#define UI_CornerRadius(v) DeferLoop(ui_push_corner_radius(v), ui_pop_corner_radius())
|
||||
#define UI_Focus(kind) DeferLoop((ui_push_focus_hot(kind), ui_push_focus_active(kind)), (ui_pop_focus_hot(), ui_pop_focus_active()))
|
||||
#define UI_FlagsAdd(v) DeferLoop(ui_push_flags(ui_top_flags()|(v)), ui_pop_flags())
|
||||
|
||||
//- rjf: tooltip
|
||||
#define UI_TooltipBase DeferLoop(ui_tooltip_begin_base(), ui_tooltip_end_base())
|
||||
|
||||
Reference in New Issue
Block a user