From b76c605eba83ceb347e6caf901e77b668ecae586 Mon Sep 17 00:00:00 2001 From: Ryan Fleury Date: Thu, 20 Jun 2024 07:35:59 -0700 Subject: [PATCH 01/47] sort locals by debug info order; still likely not sufficient for all the options, but at least marginally better & introduces the sorting path --- src/base/base_core.h | 5 +++++ src/df/core/df_core.c | 2 +- src/df/gfx/df_gfx.c | 4 ++-- src/df/gfx/df_views.c | 24 ++++++++++++---------- src/eval/eval_core.c | 36 +++++++++++++++++++++++++++++++++ src/eval/eval_core.h | 11 ++++++++++ src/fuzzy_search/fuzzy_search.c | 2 +- src/type_graph/type_graph.c | 2 +- 8 files changed, 70 insertions(+), 16 deletions(-) diff --git a/src/base/base_core.h b/src/base/base_core.h index cb8904bc..e815c3f0 100644 --- a/src/base/base_core.h +++ b/src/base/base_core.h @@ -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 diff --git a/src/df/core/df_core.c b/src/df/core/df_core.c index 92adeccf..f908dab3 100644 --- a/src/df/core/df_core.c +++ b/src/df/core/df_core.c @@ -955,7 +955,7 @@ df_qsort_compare_cmd_spec__run_counter(DF_CmdSpec **a, DF_CmdSpec **b) internal void df_cmd_spec_array_sort_by_run_counter__in_place(DF_CmdSpecArray array) { - qsort(array.v, array.count, sizeof(DF_CmdSpec *), (int (*)(const void *, const void *))df_qsort_compare_cmd_spec__run_counter); + quick_sort(array.v, array.count, sizeof(DF_CmdSpec *), df_qsort_compare_cmd_spec__run_counter); } internal DF_Handle diff --git a/src/df/gfx/df_gfx.c b/src/df/gfx/df_gfx.c index ee7bfa06..7e1165ad 100644 --- a/src/df/gfx/df_gfx.c +++ b/src/df/gfx/df_gfx.c @@ -8966,7 +8966,7 @@ df_autocomp_lister_item_qsort_compare(DF_AutoCompListerItem *a, DF_AutoCompListe internal void df_autocomp_lister_item_array_sort__in_place(DF_AutoCompListerItemArray *array) { - qsort(array->v, array->count, sizeof(array->v[0]), (int (*)(const void*, const void*))df_autocomp_lister_item_qsort_compare); + quick_sort(array->v, array->count, sizeof(array->v[0]), df_autocomp_lister_item_qsort_compare); } internal String8 @@ -9568,7 +9568,7 @@ df_cfg_strings_from_gfx(Arena *arena, String8 root_path, DF_CfgSrc source) string_binding_pair_count += 1; } } - qsort(string_binding_pairs, string_binding_pair_count, sizeof(DF_StringBindingPair), (int (*)(const void *, const void *))df_qsort_compare__cfg_string_bindings); + quick_sort(string_binding_pairs, string_binding_pair_count, sizeof(DF_StringBindingPair), df_qsort_compare__cfg_string_bindings); if(string_binding_pair_count != 0) { str8_list_push(arena, &strs, str8_lit("/// keybindings ///////////////////////////////////////////////////////////////\n")); diff --git a/src/df/gfx/df_views.c b/src/df/gfx/df_views.c index 123ee7c7..94e318e3 100644 --- a/src/df/gfx/df_views.c +++ b/src/df/gfx/df_views.c @@ -211,7 +211,7 @@ df_cmd_lister_item_array_from_list(Arena *arena, DF_CmdListerItemList list) internal void df_cmd_lister_item_array_sort_by_strength__in_place(DF_CmdListerItemArray array) { - qsort(array.v, array.count, sizeof(DF_CmdListerItem), (int (*)(const void *, const void *))df_qsort_compare_cmd_lister__strength); + quick_sort(array.v, array.count, sizeof(DF_CmdListerItem), df_qsort_compare_cmd_lister__strength); } //////////////////////////////// @@ -314,7 +314,7 @@ df_process_info_array_from_list(Arena *arena, DF_ProcessInfoList list) internal void df_process_info_array_sort_by_strength__in_place(DF_ProcessInfoArray array) { - qsort(array.v, array.count, sizeof(DF_ProcessInfo), (int (*)(const void *, const void *))df_qsort_compare_process_info); + quick_sort(array.v, array.count, sizeof(DF_ProcessInfo), df_qsort_compare_process_info); } //////////////////////////////// @@ -366,7 +366,7 @@ 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) { - qsort(array.v, array.count, sizeof(DF_EntityListerItem), (int (*)(const void *, const void *))df_qsort_compare_entity_lister__strength); + quick_sort(array.v, array.count, sizeof(DF_EntityListerItem), df_qsort_compare_entity_lister__strength); } //////////////////////////////// @@ -617,15 +617,17 @@ df_eval_viz_block_list_from_watch_view_state(Arena *arena, DI_Scope *di_scope, F // case DF_WatchViewFillKind_Locals: { - U64 num = 1; - for(EVAL_String2NumMapNode *n = parse_ctx->locals_map->first; n != 0; n = n->order_next, num += 1) + EVAL_String2NumMapNodeArray nodes = eval_string2num_map_node_array_from_map(scratch.arena, parse_ctx->locals_map); + eval_string2num_map_node_array_sort__in_place(&nodes); + for(U64 idx = 0; idx < nodes.count; idx += 1) { + EVAL_String2NumMapNode *n = nodes.v[idx]; String8 root_expr_string = n->string; FuzzyMatchRangeList matches = fuzzy_match_find(arena, filter, root_expr_string); if(matches.count == matches.needle_part_count) { DF_ExpandKey parent_key = df_expand_key_make(5381, 0); - DF_ExpandKey key = df_expand_key_make(df_hash_from_expand_key(parent_key), num); + DF_ExpandKey key = df_expand_key_make(df_hash_from_expand_key(parent_key), idx+1); DF_EvalVizBlockList root_blocks = df_eval_viz_block_list_from_eval_view_expr_keys(arena, di_scope, ctrl_ctx, parse_ctx, macro_map, eval_view, root_expr_string, parent_key, key); df_eval_viz_block_list_concat__in_place(&blocks, &root_blocks); } @@ -2588,24 +2590,24 @@ DF_VIEW_UI_FUNCTION_DEF(FileSystem) { if(path_query.search.size != 0) { - qsort(new_files, new_file_count, sizeof(DF_FileInfo), (int (*)(const void *, const void *))df_qsort_compare_file_info__default_filtered); + quick_sort(new_files, new_file_count, sizeof(DF_FileInfo), df_qsort_compare_file_info__default_filtered); } else { - qsort(new_files, new_file_count, sizeof(DF_FileInfo), (int (*)(const void *, const void *))df_qsort_compare_file_info__default); + quick_sort(new_files, new_file_count, sizeof(DF_FileInfo), df_qsort_compare_file_info__default); } }break; case DF_FileSortKind_Filename: { - qsort(new_files, new_file_count, sizeof(DF_FileInfo), (int (*)(const void *, const void *))df_qsort_compare_file_info__filename); + quick_sort(new_files, new_file_count, sizeof(DF_FileInfo), df_qsort_compare_file_info__filename); }break; case DF_FileSortKind_LastModified: { - qsort(new_files, new_file_count, sizeof(DF_FileInfo), (int (*)(const void *, const void *))df_qsort_compare_file_info__last_modified); + quick_sort(new_files, new_file_count, sizeof(DF_FileInfo), df_qsort_compare_file_info__last_modified); }break; case DF_FileSortKind_Size: { - qsort(new_files, new_file_count, sizeof(DF_FileInfo), (int (*)(const void *, const void *))df_qsort_compare_file_info__size); + quick_sort(new_files, new_file_count, sizeof(DF_FileInfo), df_qsort_compare_file_info__size); }break; } diff --git a/src/eval/eval_core.c b/src/eval/eval_core.c index 791579bf..3a237afe 100644 --- a/src/eval/eval_core.c +++ b/src/eval/eval_core.c @@ -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 diff --git a/src/eval/eval_core.h b/src/eval/eval_core.h index 662dc26e..8f2f0c85 100644 --- a/src/eval/eval_core.h +++ b/src/eval/eval_core.h @@ -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); diff --git a/src/fuzzy_search/fuzzy_search.c b/src/fuzzy_search/fuzzy_search.c index 7744e2f0..0b6e5c1d 100644 --- a/src/fuzzy_search/fuzzy_search.c +++ b/src/fuzzy_search/fuzzy_search.c @@ -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 diff --git a/src/type_graph/type_graph.c b/src/type_graph/type_graph.c index fbf96b33..21fb143c 100644 --- a/src/type_graph/type_graph.c +++ b/src/type_graph/type_graph.c @@ -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 From c60d3aab22d3a5b4f5826823d4983ba5c2785fc6 Mon Sep 17 00:00:00 2001 From: Ryan Fleury Date: Thu, 20 Jun 2024 08:02:01 -0700 Subject: [PATCH 02/47] mouse-driven ui path for query completion; show-in-explorer ui for tab ctx menu --- src/df/gfx/df_gfx.c | 49 ++++++++++++++++++++++----------- src/os/gfx/os_gfx.h | 7 ++++- src/os/gfx/stub/os_gfx_stub.c | 10 ++++++- src/os/gfx/win32/os_gfx_win32.c | 29 ++++++++++++++++++- src/raddbg/raddbg.h | 13 ++++----- 5 files changed, 81 insertions(+), 27 deletions(-) diff --git a/src/df/gfx/df_gfx.c b/src/df/gfx/df_gfx.c index 7e1165ad..e4f95684 100644 --- a/src/df/gfx/df_gfx.c +++ b/src/df/gfx/df_gfx.c @@ -4341,6 +4341,18 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) } } + // rjf: show in explorer + if(entity->kind == DF_EntityKind_File) + { + UI_Signal sig = df_icon_buttonf(DF_IconKind_FolderClosedFilled, 0, "Show In Explorer"); + if(ui_clicked(sig)) + { + String8 full_path = df_full_path_from_entity(scratch.arena, entity); + os_show_in_filesystem_ui(full_path); + ui_ctx_menu_close(); + } + } + // rjf: filter controls if(view->spec->info.flags & DF_ViewSpecFlag_CanFilter) { @@ -5770,6 +5782,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) } //- rjf: build query text input + B32 query_completed = 0; UI_Parent(query_container_box) UI_WidthFill UI_PrefHeight(ui_px(query_line_edit_height, 1.f)) UI_Focus(UI_FocusKind_On) @@ -5807,6 +5820,13 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) ws->query_view_selected = 1; } } + UI_PrefWidth(ui_em(5.f, 1.f)) UI_Focus(UI_FocusKind_Off) + { + if(ui_clicked(df_icon_buttonf(DF_IconKind_RightArrow, 0, "##complete_query"))) + { + query_completed = 1; + } + } } } @@ -5825,25 +5845,22 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) DF_CmdParams params = df_cmd_params_from_window(ws); df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_CancelQuery)); } - if(ui_is_focus_active()) + if((ui_is_focus_active() && ui_slot_press(UI_EventActionSlot_Accept)) || query_completed) { - if(ui_slot_press(UI_EventActionSlot_Accept)) + Temp scratch = scratch_begin(&arena, 1); + DF_View *view = ws->query_view_stack_top; + DF_CmdParams params = df_cmd_params_from_window(ws); + DF_CtrlCtx ctrl_ctx = df_ctrl_ctx_from_view(ws, view); + String8 error = df_cmd_params_apply_spec_query(scratch.arena, &ctrl_ctx, ¶ms, ws->query_cmd_spec, str8(view->query_buffer, view->query_string_size)); + df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_CompleteQuery)); + if(error.size != 0) { - Temp scratch = scratch_begin(&arena, 1); - DF_View *view = ws->query_view_stack_top; - DF_CmdParams params = df_cmd_params_from_window(ws); - DF_CtrlCtx ctrl_ctx = df_ctrl_ctx_from_view(ws, view); - String8 error = df_cmd_params_apply_spec_query(scratch.arena, &ctrl_ctx, ¶ms, ws->query_cmd_spec, str8(view->query_buffer, view->query_string_size)); - df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_CompleteQuery)); - if(error.size != 0) - { - DF_CmdParams p = df_cmd_params_from_window(ws); - p.string = error; - df_cmd_params_mark_slot(&p, DF_CmdParamSlot_String); - df_push_cmd__root(&p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_Error)); - } - scratch_end(scratch); + DF_CmdParams p = df_cmd_params_from_window(ws); + p.string = error; + df_cmd_params_mark_slot(&p, DF_CmdParamSlot_String); + df_push_cmd__root(&p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_Error)); } + scratch_end(scratch); } //- rjf: take fallthrough interaction in query view diff --git a/src/os/gfx/os_gfx.h b/src/os/gfx/os_gfx.h index 962820a1..4bd72b99 100644 --- a/src/os/gfx/os_gfx.h +++ b/src/os/gfx/os_gfx.h @@ -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 diff --git a/src/os/gfx/stub/os_gfx_stub.c b/src/os/gfx/stub/os_gfx_stub.c index 00128628..06e3a4fc 100644 --- a/src/os/gfx/stub/os_gfx_stub.c +++ b/src/os/gfx/stub/os_gfx_stub.c @@ -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) +{ +} diff --git a/src/os/gfx/win32/os_gfx_win32.c b/src/os/gfx/win32/os_gfx_win32.c index f10e93ac..97442948 100644 --- a/src/os/gfx/win32/os_gfx_win32.c +++ b/src/os/gfx/win32/os_gfx_win32.c @@ -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); +} diff --git a/src/raddbg/raddbg.h b/src/raddbg/raddbg.h index 091623e3..66b1ca74 100644 --- a/src/raddbg/raddbg.h +++ b/src/raddbg/raddbg.h @@ -4,11 +4,6 @@ //////////////////////////////// //~ 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 -// // [ ] editing multiple bindings for commands // [ ] n-row table selection, in watch window & other UIs, multi-selection // ctrl+C @@ -16,6 +11,7 @@ // [ ] 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 @@ -31,9 +27,6 @@ // 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 @@ -388,6 +381,10 @@ // 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) #ifndef RADDBG_H #define RADDBG_H From ce1f54a9311ccaf6a2145510b3e45308de426d68 Mon Sep 17 00:00:00 2001 From: Ryan Fleury Date: Thu, 20 Jun 2024 09:06:35 -0700 Subject: [PATCH 03/47] notes --- src/raddbg/raddbg.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/raddbg/raddbg.h b/src/raddbg/raddbg.h index 66b1ca74..e8535ad1 100644 --- a/src/raddbg/raddbg.h +++ b/src/raddbg/raddbg.h @@ -35,14 +35,11 @@ //////////////////////////////// //~ 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 -// // [ ] 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. @@ -227,6 +224,7 @@ // 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) @@ -385,6 +383,7 @@ // 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 #ifndef RADDBG_H #define RADDBG_H From 3b27abd5c7db3283892ec4f9bd2bd2101eb7334b Mon Sep 17 00:00:00 2001 From: Ryan Fleury Date: Thu, 20 Jun 2024 15:28:48 -0700 Subject: [PATCH 04/47] first pass at new theme color table, scheme-based ui color specification --- src/df/core/df_core.c | 9 - src/df/core/df_core.mdesk | 2 - src/df/core/generated/df_core.meta.c | 4 +- src/df/core/generated/df_core.meta.h | 2 - src/df/gfx/df_gfx.c | 1173 ++++++++--------- src/df/gfx/df_gfx.h | 31 +- src/df/gfx/df_gfx.mdesk | 518 ++++---- src/df/gfx/df_view_rules.c | 22 +- src/df/gfx/df_views.c | 1064 +++++++-------- src/df/gfx/generated/df_gfx.meta.c | 1787 ++++++++++++++++---------- src/df/gfx/generated/df_gfx.meta.h | 135 +- src/ui/generated/ui.meta.c | 42 +- src/ui/generated/ui.meta.h | 77 +- src/ui/ui.mdesk | 57 +- src/ui/ui_basic_widgets.c | 45 +- src/ui/ui_basic_widgets.h | 2 - src/ui/ui_core.c | 110 +- src/ui/ui_core.h | 136 +- 18 files changed, 2754 insertions(+), 2462 deletions(-) diff --git a/src/df/core/df_core.c b/src/df/core/df_core.c index f908dab3..13127f51 100644 --- a/src/df/core/df_core.c +++ b/src/df/core/df_core.c @@ -7886,15 +7886,6 @@ df_core_begin_frame(Arena *arena, DF_CmdList *cmds, F32 dt) } } }break; - case DF_CoreCmdKind_Reload: - { - DF_Entity *file = df_entity_from_handle(params.entity); - if(file->kind == DF_EntityKind_File) - { - TXTI_Handle txti_handle = df_txti_handle_from_entity(file); - txti_reload(txti_handle, df_full_path_from_entity(scratch.arena, file)); - } - }break; //- rjf: config path saving/loading/applying case DF_CoreCmdKind_OpenRecentProject: diff --git a/src/df/core/df_core.mdesk b/src/df/core/df_core.mdesk index 2b9d6ca5..8197011b 100644 --- a/src/df/core/df_core.mdesk +++ b/src/df/core/df_core.mdesk @@ -226,8 +226,6 @@ 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" } diff --git a/src/df/core/generated/df_core.meta.c b/src/df/core/generated/df_core.meta.c index 156803d1..2d769713 100644 --- a/src/df/core/generated/df_core.meta.c +++ b/src/df/core/generated/df_core.meta.c @@ -214,7 +214,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}, @@ -299,8 +299,6 @@ 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("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}, diff --git a/src/df/core/generated/df_core.meta.h b/src/df/core/generated/df_core.meta.h index 4f1f86a0..2fce54de 100644 --- a/src/df/core/generated/df_core.meta.h +++ b/src/df/core/generated/df_core.meta.h @@ -131,8 +131,6 @@ 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_SetFileOverrideLinkSrc, diff --git a/src/df/gfx/df_gfx.c b/src/df/gfx/df_gfx.c index e4f95684..329aee90 100644 --- a/src/df/gfx/df_gfx.c +++ b/src/df/gfx/df_gfx.c @@ -2120,32 +2120,6 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) df_cmd_list_push(arena, cmds, &p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_PendingEntity)); } }break; - case DF_CoreCmdKind_Reload: - { - DF_Entity *file = df_entity_from_handle(params.entity); - for(DF_Panel *panel = ws->root_panel; !df_panel_is_nil(panel); panel = df_panel_rec_df_pre(panel).next) - { - DF_View *view = df_selected_tab_from_panel(panel); - DF_Entity *view_entity = df_entity_from_handle(view->entity); - if(view_entity == file) - { - view->flash_t = 1.f; - } - } - }break; - case DF_CoreCmdKind_ReloadActive: - { - DF_Panel *panel = df_panel_from_handle(params.panel); - DF_View *view = df_selected_tab_from_panel(panel); - DF_Entity *entity = df_entity_from_handle(view->entity); - if(entity->kind == DF_EntityKind_File) - { - DF_CmdParams p = df_cmd_params_from_view(ws, panel, view); - p.entity = df_handle_from_entity(entity); - df_cmd_params_mark_slot(&p, DF_CmdParamSlot_Entity); - df_push_cmd__root(&p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_Reload)); - } - }break; case DF_CoreCmdKind_Switch: { B32 already_opened = 0; @@ -3483,11 +3457,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) ui_push_font_size(main_font_size); ui_push_pref_width(ui_em(20.f, 1)); ui_push_pref_height(ui_em(2.5f, 1.f)); - ui_push_background_color(df_rgba_from_theme_color(DF_ThemeColor_PlainBackground)); - ui_push_text_color(df_rgba_from_theme_color(DF_ThemeColor_PlainText)); - ui_push_border_color(df_rgba_from_theme_color(DF_ThemeColor_PlainBorder)); - ui_push_text_select_color(df_rgba_from_theme_color(DF_ThemeColor_TextSelection)); - ui_push_text_cursor_color(df_rgba_from_theme_color(DF_ThemeColor_Cursor)); + ui_push_scheme(df_ui_color_scheme_from_code(DF_UIColorSchemeCode_Default)); ui_push_blur_size(10.f); } @@ -3533,8 +3503,11 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) UI_Size main_width = ui_top_pref_width(); UI_Size main_height = ui_top_pref_height(); UI_TextAlign main_text_align = ui_top_text_alignment(); - ui_set_next_background_color(df_rgba_from_theme_color(DF_ThemeColor_TabActive)); - UI_Tooltip UI_PrefWidth(main_width) UI_PrefHeight(main_height) UI_TextAlignment(main_text_align) + DF_UIColorScheme(DF_UIColorSchemeCode_TabActive) + UI_Tooltip + UI_PrefWidth(main_width) + UI_PrefHeight(main_height) + UI_TextAlignment(main_text_align) { ui_set_next_pref_width(ui_em(60.f, 1.f)); ui_set_next_pref_height(ui_em(40.f, 1.f)); @@ -3547,10 +3520,10 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) DF_CtrlCtx ctrl_ctx = df_ctrl_ctx_from_view(ws, view); String8 display_name = df_display_string_from_view(scratch.arena, ctrl_ctx, view); DF_IconKind icon_kind = df_icon_kind_from_view(view); - UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText)) - UI_Font(df_font_from_slot(DF_FontSlot_Icons)) + UI_Font(df_font_from_slot(DF_FontSlot_Icons)) UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Icons)) UI_PrefWidth(ui_em(2.5f, 1.f)) + UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_label(df_g_icon_kind_text_table[icon_kind]); ui_label(display_name); } @@ -3576,9 +3549,9 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) { String8 display_name = df_display_string_from_entity(scratch.arena, entity); DF_IconKind icon_kind = df_g_entity_kind_icon_kind_table[entity->kind]; - UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText)) - UI_Font(df_font_from_slot(DF_FontSlot_Icons)) + UI_Font(df_font_from_slot(DF_FontSlot_Icons)) UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Icons)) + UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_label(df_g_icon_kind_text_table[icon_kind]); ui_label(display_name); } @@ -3591,10 +3564,9 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) //- rjf: entity drop completion ctx menu // { - UI_BackgroundColor(df_rgba_from_theme_color(DF_ThemeColor_AltBackground)) - UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_AltText)) - UI_BorderColor(df_rgba_from_theme_color(DF_ThemeColor_AltBorder)) - UI_CtxMenu(ws->drop_completion_ctx_menu_key) UI_PrefWidth(ui_em(30.f, 1.f)) + DF_UIColorScheme(DF_UIColorSchemeCode_Floating) + UI_CtxMenu(ws->drop_completion_ctx_menu_key) + UI_PrefWidth(ui_em(30.f, 1.f)) { DF_Entity *entity = df_entity_from_handle(ws->drop_completion_entity); DF_Panel *panel = df_panel_from_handle(ws->drop_completion_panel); @@ -3743,9 +3715,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) //////////////////////////// //- rjf: universal ctx menus // - UI_BackgroundColor(df_rgba_from_theme_color(DF_ThemeColor_AltBackground)) - UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_AltText)) - UI_BorderColor(df_rgba_from_theme_color(DF_ThemeColor_AltBorder)) + DF_UIColorScheme(DF_UIColorSchemeCode_Floating) { Temp scratch = scratch_begin(&arena, 1); @@ -3776,18 +3746,18 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) UI_PrefWidth(ui_em(2.f*1.5f, 1.f)) UI_PrefHeight(ui_pct(1, 0)) UI_TextAlignment(UI_TextAlign_Center) - UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText)) + UI_Flags(UI_BoxFlag_DrawTextWeak) ui_label(df_g_icon_kind_text_table[entity_icon]); UI_PrefWidth(ui_text_dim(10, 1)) - UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText)) + UI_Flags(UI_BoxFlag_DrawTextWeak) ui_label(df_g_entity_kind_display_string_table[entity->kind]); { - Vec4F32 entity_color = ui_top_text_color(); + UI_ColorScheme *scheme = ui_top_scheme(); if(entity->flags & DF_EntityFlag_HasColor) { - entity_color = df_rgba_from_entity(entity); + scheme = ui_fork_top_color_scheme(.text = df_rgba_from_entity(entity)); } - UI_TextColor(entity_color) + UI_Scheme(scheme) UI_PrefWidth(ui_text_dim(10, 1)) UI_Font((kind_flags & DF_EntityKindFlag_NameIsCode) ? df_font_from_slot(DF_FontSlot_Code) : ui_top_font()) ui_label(display_name); @@ -3963,11 +3933,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) if(op_flags & DF_EntityOpFlag_Freeze) { B32 is_frozen = df_entity_is_frozen(entity); - Vec4F32 color = df_rgba_from_theme_color(is_frozen ? DF_ThemeColor_FailureBackground : DF_ThemeColor_SuccessBackground); - color.x *= 0.7f; - color.y *= 0.7f; - color.z *= 0.7f; - ui_set_next_background_color(color); + ui_set_next_scheme(df_ui_color_scheme_from_code(is_frozen ? DF_UIColorSchemeCode_SpecialNegative : DF_UIColorSchemeCode_SpecialPositive)); if(is_frozen && ui_clicked(df_icon_buttonf(DF_IconKind_Locked, 0, "Thaw###freeze_thaw"))) { DF_CmdParams params = df_cmd_params_from_window(ws); @@ -4236,8 +4202,8 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) UI_CornerRadius(ui_em(0.3f, 1.f).value) for(U64 preset_idx = 0; preset_idx < ArrayCount(presets); preset_idx += 1) { - ui_set_next_background_color(presets[preset_idx]); ui_set_next_hover_cursor(OS_Cursor_HandPoint); + ui_set_next_scheme(ui_fork_top_color_scheme(.background = presets[preset_idx])); UI_Box *box = ui_build_box_from_stringf(UI_BoxFlag_DrawBackground| UI_BoxFlag_DrawBorder| UI_BoxFlag_Clickable| @@ -4313,7 +4279,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) UI_PrefWidth(ui_em(3.f, 1.f)) UI_PrefHeight(ui_pct(1, 0)) UI_TextAlignment(UI_TextAlign_Center) - UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText)) + UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_label(df_g_icon_kind_text_table[view_icon]); UI_PrefWidth(ui_text_dim(10, 1)) ui_label(display_name); } @@ -4403,12 +4369,12 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) { Vec2F32 window_dim = dim_2f32(window_rect); UI_Box *bg_box = &ui_g_nil_box; - UI_Rect(window_rect) UI_ChildLayoutAxis(Axis2_X) UI_Focus(UI_FocusKind_On) + UI_Rect(window_rect) + UI_ChildLayoutAxis(Axis2_X) + UI_Focus(UI_FocusKind_On) + UI_BlurSize(10*df_gfx_state->confirm_t) + DF_UIColorScheme(DF_UIColorSchemeCode_Floating) { - Vec4F32 bg_color = ui_top_background_color(); - bg_color.w *= df_gfx_state->confirm_t; - ui_set_next_blur_size(10*df_gfx_state->confirm_t); - ui_set_next_background_color(bg_color); bg_box = ui_build_box_from_stringf(UI_BoxFlag_FixedSize|UI_BoxFlag_Floating|UI_BoxFlag_Clickable|UI_BoxFlag_Scroll|UI_BoxFlag_DefaultFocusNav|UI_BoxFlag_DrawBackgroundBlur|UI_BoxFlag_DrawBackground, "###confirm_popup_%p", ws); } if(df_gfx_state->confirm_active) UI_Parent(bg_box) @@ -4417,15 +4383,13 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) UI_WidthFill UI_PrefHeight(ui_children_sum(1.f)) UI_Column UI_Padding(ui_pct(1, 0)) { UI_FontSize(ui_top_font_size()*2.f) UI_PrefHeight(ui_em(3.f, 1.f)) ui_label(df_gfx_state->confirm_title); - UI_PrefHeight(ui_em(3.f, 1.f)) UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText)) ui_label(df_gfx_state->confirm_msg); + UI_PrefHeight(ui_em(3.f, 1.f)) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_label(df_gfx_state->confirm_msg); ui_spacer(ui_em(1.5f, 1.f)); UI_Row UI_Padding(ui_pct(1.f, 0.f)) UI_WidthFill UI_PrefHeight(ui_em(5.f, 1.f)) { UI_CornerRadius00(ui_top_font_size()*0.25f) UI_CornerRadius01(ui_top_font_size()*0.25f) - UI_BackgroundColor(df_rgba_from_theme_color(DF_ThemeColor_ActionBackground)) - UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_ActionText)) - UI_BorderColor(df_rgba_from_theme_color(DF_ThemeColor_ActionBorder)) + DF_UIColorScheme(DF_UIColorSchemeCode_SpecialNeutral) if(ui_clicked(ui_buttonf("OK")) || (ui_key_match(bg_box->default_nav_focus_hot_key, ui_key_zero()) && ui_slot_press(UI_EventActionSlot_Accept))) { DF_CmdParams p = df_cmd_params_zero(); @@ -4702,7 +4666,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) } UI_Font(df_font_from_slot(DF_FontSlot_Main)) UI_PrefWidth(ui_text_dim(10, 1)) - UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText)) + UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_label(item->kind_string); } UI_Signal item_sig = ui_signal_from_box(item_box); @@ -4743,9 +4707,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) os_window_push_custom_edges(ws->os, window_edge_px); os_window_push_custom_title_bar(ws->os, dim_2f32(top_bar_rect).y); ui_set_next_flags(UI_BoxFlag_DefaultFocusNav); - UI_BackgroundColor(df_rgba_from_theme_color(DF_ThemeColor_AltBackground)) - UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_AltText)) - UI_BorderColor(df_rgba_from_theme_color(DF_ThemeColor_AltBorder)) + DF_UIColorScheme(DF_UIColorSchemeCode_MenuBar) UI_Focus((ws->menu_bar_focused && window_is_focused && !ui_any_ctx_menu_is_open() && !hover_eval_is_open) ? UI_FocusKind_On : UI_FocusKind_Null) UI_Pane(top_bar_rect, str8_lit("###top_bar")) UI_WidthFill UI_Row @@ -4930,15 +4892,14 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) for(DF_EntityNode *n = targets_list.first; n != 0; n = n->next) { DF_Entity *target = n->entity; - Vec4F32 color = ui_top_text_color(); + UI_ColorScheme *scheme = ui_top_scheme(); if(target->flags & DF_EntityFlag_HasColor) { - color = df_rgba_from_entity(target); + scheme = ui_fork_top_color_scheme(.text = df_rgba_from_entity(target)); } String8 target_name = df_display_string_from_entity(scratch.arena, target); UI_Signal sig = {0}; - UI_TextColor(color) - sig = df_icon_buttonf(DF_IconKind_Target, 0, "%S##%p", target_name, target); + UI_Scheme(scheme) sig = df_icon_buttonf(DF_IconKind_Target, 0, "%S##%p", target_name, target); if(ui_clicked(sig)) { DF_CmdParams params = df_cmd_params_from_window(ws); @@ -4988,7 +4949,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) UI_Key help_menu_key = ui_key_from_string(ui_key_zero(), str8_lit("_help_menu_key_")); UI_CtxMenu(help_menu_key) UI_PrefWidth(ui_em(60.f, 1.f)) { - UI_Row UI_TextAlignment(UI_TextAlign_Center) UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText)) + UI_Row UI_TextAlignment(UI_TextAlign_Center) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_label(str8_lit(BUILD_TITLE_STRING_LITERAL)); UI_PrefHeight(ui_children_sum(1)) UI_Row UI_Padding(ui_pct(1, 0)) { @@ -5006,8 +4967,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) { ui_labelf("Search for commands by pressing "); DF_CmdSpec *spec = df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_RunCommand); - UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_PlainText)) - UI_Flags(UI_BoxFlag_DrawBorder) + UI_Flags(UI_BoxFlag_DrawBorder) UI_TextAlignment(UI_TextAlign_Center) df_cmd_binding_button(spec); } @@ -5132,7 +5092,8 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) ui_spacer(ui_em(0.75f, 1)); // rjf: conversion task visualization - UI_PrefWidth(ui_text_dim(10, 1)) UI_HeightFill UI_BackgroundColor(df_rgba_from_theme_color(DF_ThemeColor_Highlight1)) + UI_PrefWidth(ui_text_dim(10, 1)) UI_HeightFill + DF_UIColorScheme(DF_UIColorSchemeCode_SpecialNeutral) { Temp scratch = scratch_begin(&arena, 1); DF_EntityList tasks = df_query_cached_entity_list_with_kind(DF_EntityKind_ConversionTask); @@ -5161,250 +5122,255 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) //- rjf: center column UI_PrefWidth(ui_children_sum(1.f)) UI_Row - { - // rjf: fast-paths UI_PrefWidth(ui_em(2.25f, 1)) - UI_Font(df_font_from_slot(DF_FontSlot_Icons)) - UI_FontSize(ui_top_font_size()*0.85f) + UI_Font(df_font_from_slot(DF_FontSlot_Icons)) + UI_FontSize(ui_top_font_size()*0.85f) + { + Temp scratch = scratch_begin(&arena, 1); + DF_EntityList targets = df_push_active_target_list(scratch.arena); + DF_EntityList processes = df_query_cached_entity_list_with_kind(DF_EntityKind_Process); + B32 have_targets = targets.count != 0; + B32 can_send_signal = !df_ctrl_targets_running(); + B32 can_play = (have_targets && (can_send_signal || df_ctrl_last_run_frame_idx()+4 > df_frame_index())); + B32 can_pause = (!can_send_signal); + B32 can_stop = (processes.count != 0); + B32 can_step = (processes.count != 0 && can_send_signal); + + //- rjf: play button + if(can_play || !have_targets || processes.count == 0) + UI_TextAlignment(UI_TextAlign_Center) + UI_Flags((can_play ? 0 : UI_BoxFlag_Disabled)) + DF_UIColorScheme(DF_UIColorSchemeCode_SpecialPositive) { - Temp scratch = scratch_begin(&arena, 1); - DF_EntityList targets = df_push_active_target_list(scratch.arena); - DF_EntityList processes = df_query_cached_entity_list_with_kind(DF_EntityKind_Process); - B32 have_targets = targets.count != 0; - B32 can_send_signal = !df_ctrl_targets_running(); - B32 can_play = (have_targets && (can_send_signal || df_ctrl_last_run_frame_idx()+4 > df_frame_index())); - B32 can_pause = (!can_send_signal); - B32 can_stop = (processes.count != 0); - B32 can_step = (processes.count != 0 && can_send_signal); - - if(can_play || !have_targets || - processes.count == 0) UI_TextAlignment(UI_TextAlign_Center) UI_Flags((can_play ? 0 : UI_BoxFlag_Disabled)) + UI_Signal sig = ui_button(df_g_icon_kind_text_table[DF_IconKind_Play]); + os_window_push_custom_title_bar_client_area(ws->os, sig.box->rect); + if(ui_hovering(sig) && !can_play) { - ui_set_next_text_color(v4f32(0.3f, 0.8f, 0.2f, 1.f)); - UI_Signal sig = ui_button(df_g_icon_kind_text_table[DF_IconKind_Play]); - os_window_push_custom_title_bar_client_area(ws->os, sig.box->rect); - if(ui_hovering(sig) && !can_play) + UI_Tooltip + UI_Font(df_font_from_slot(DF_FontSlot_Main)) + UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Main)) + ui_labelf("Disabled: %s", have_targets ? "Targets are currently running" : "No active targets exist"); + } + if(ui_hovering(sig) && can_play) + { + UI_Tooltip + UI_Font(df_font_from_slot(DF_FontSlot_Main)) + UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Main)) { - UI_Tooltip - UI_Font(df_font_from_slot(DF_FontSlot_Main)) - UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Main)) - ui_labelf("Disabled: %s", have_targets ? "Targets are currently running" : "No active targets exist"); - } - if(ui_hovering(sig) && can_play) - { - UI_Tooltip - UI_Font(df_font_from_slot(DF_FontSlot_Main)) - UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Main)) + if(can_stop) { - if(can_stop) + ui_labelf("Resume all processes"); + } + else + { + ui_labelf("Launch all active targets:"); + for(DF_EntityNode *n = targets.first; n != 0; n = n->next) { - ui_labelf("Resume all processes"); + String8 target_display_name = df_display_string_from_entity(scratch.arena, n->entity); + ui_label(target_display_name); } - else + } + } + } + if(ui_clicked(sig)) + { + DF_CmdParams params = df_cmd_params_from_window(ws); + df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_Run)); + } + } + + //- rjf: restart button + if(!can_play && processes.count != 0) UI_TextAlignment(UI_TextAlign_Center) + DF_UIColorScheme(DF_UIColorSchemeCode_SpecialPositive) + { + UI_Signal sig = ui_button(df_g_icon_kind_text_table[DF_IconKind_Redo]); + os_window_push_custom_title_bar_client_area(ws->os, sig.box->rect); + if(ui_hovering(sig)) + { + UI_Tooltip + UI_Font(df_font_from_slot(DF_FontSlot_Main)) + UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Main)) + { + ui_labelf("Restart all running targets:"); + { + DF_EntityList processes = df_query_cached_entity_list_with_kind(DF_EntityKind_Process); + for(DF_EntityNode *n = processes.first; n != 0; n = n->next) { - ui_labelf("Launch all active targets:"); - for(DF_EntityNode *n = targets.first; n != 0; n = n->next) + DF_Entity *process = n->entity; + DF_Entity *target = df_entity_from_handle(process->entity_handle); + if(!df_entity_is_nil(target)) { - String8 target_display_name = df_display_string_from_entity(scratch.arena, n->entity); + String8 target_display_name = df_display_string_from_entity(scratch.arena, target); ui_label(target_display_name); } } } } - if(ui_clicked(sig)) - { - DF_CmdParams params = df_cmd_params_from_window(ws); - df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_Run)); - } } - - if(!can_play && processes.count != 0) UI_TextAlignment(UI_TextAlign_Center) + if(ui_clicked(sig)) { - ui_set_next_text_color(v4f32(0.3f, 0.8f, 0.2f, 1.f)); - UI_Signal sig = ui_button(df_g_icon_kind_text_table[DF_IconKind_Redo]); - os_window_push_custom_title_bar_client_area(ws->os, sig.box->rect); - if(ui_hovering(sig)) - { - UI_Tooltip - UI_Font(df_font_from_slot(DF_FontSlot_Main)) - UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Main)) - { - ui_labelf("Restart all running targets:"); - { - DF_EntityList processes = df_query_cached_entity_list_with_kind(DF_EntityKind_Process); - for(DF_EntityNode *n = processes.first; n != 0; n = n->next) - { - DF_Entity *process = n->entity; - DF_Entity *target = df_entity_from_handle(process->entity_handle); - if(!df_entity_is_nil(target)) - { - String8 target_display_name = df_display_string_from_entity(scratch.arena, target); - ui_label(target_display_name); - } - } - } - } - } - if(ui_clicked(sig)) - { - DF_CmdParams params = df_cmd_params_from_window(ws); - df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_Restart)); - } + DF_CmdParams params = df_cmd_params_from_window(ws); + df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_Restart)); } - - UI_TextAlignment(UI_TextAlign_Center) UI_Flags(can_pause ? 0 : UI_BoxFlag_Disabled) - { - ui_set_next_text_color(v4f32(0.3f, 0.5f, 0.8f, 1.f)); - UI_Signal sig = ui_button(df_g_icon_kind_text_table[DF_IconKind_Pause]); - os_window_push_custom_title_bar_client_area(ws->os, sig.box->rect); - if(ui_hovering(sig) && !can_pause) - { - UI_Tooltip - UI_Font(df_font_from_slot(DF_FontSlot_Main)) - UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Main)) - ui_labelf("Disabled: Already halted"); - } - if(ui_hovering(sig) && can_pause) - { - UI_Tooltip - UI_Font(df_font_from_slot(DF_FontSlot_Main)) - UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Main)) - ui_labelf("Halt all target processes"); - } - if(ui_clicked(sig)) - { - DF_CmdParams params = df_cmd_params_from_window(ws); - df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_Halt)); - } - } - - UI_TextAlignment(UI_TextAlign_Center) UI_Flags(can_stop ? 0 : UI_BoxFlag_Disabled) - { - UI_Signal sig = {0}; - { - ui_set_next_text_color(v4f32(0.8f, 0.4f, 0.2f, 1.f)); - sig = ui_button(df_g_icon_kind_text_table[DF_IconKind_Stop]); - os_window_push_custom_title_bar_client_area(ws->os, sig.box->rect); - } - if(ui_hovering(sig) && !can_stop) - { - UI_Tooltip - UI_Font(df_font_from_slot(DF_FontSlot_Main)) - UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Main)) - ui_labelf("Disabled: No processes are running"); - } - if(ui_hovering(sig) && can_stop) - { - UI_Tooltip - UI_Font(df_font_from_slot(DF_FontSlot_Main)) - UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Main)) - ui_labelf("Kill all target processes"); - } - if(ui_clicked(sig)) - { - DF_CmdParams params = df_cmd_params_from_window(ws); - df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_Kill)); - } - } - - UI_TextAlignment(UI_TextAlign_Center) UI_Flags(can_step ? 0 : UI_BoxFlag_Disabled) - { - UI_Signal sig = ui_button(df_g_icon_kind_text_table[DF_IconKind_StepOver]); - os_window_push_custom_title_bar_client_area(ws->os, sig.box->rect); - if(ui_hovering(sig) && !can_step && can_pause) - { - UI_Tooltip - UI_Font(df_font_from_slot(DF_FontSlot_Main)) - UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Main)) - ui_labelf("Disabled: Running"); - } - if(ui_hovering(sig) && !can_step && !can_stop) - { - UI_Tooltip - UI_Font(df_font_from_slot(DF_FontSlot_Main)) - UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Main)) - ui_labelf("Disabled: No processes are running"); - } - if(ui_hovering(sig) && can_step) - { - UI_Tooltip - UI_Font(df_font_from_slot(DF_FontSlot_Main)) - UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Main)) - ui_labelf("Step Over"); - } - if(ui_clicked(sig)) - { - DF_CmdParams params = df_cmd_params_from_window(ws); - df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_StepOver)); - } - } - - UI_TextAlignment(UI_TextAlign_Center) UI_Flags(can_step ? 0 : UI_BoxFlag_Disabled) - { - UI_Signal sig = ui_button(df_g_icon_kind_text_table[DF_IconKind_StepInto]); - os_window_push_custom_title_bar_client_area(ws->os, sig.box->rect); - if(ui_hovering(sig) && !can_step && can_pause) - { - UI_Tooltip - UI_Font(df_font_from_slot(DF_FontSlot_Main)) - UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Main)) - ui_labelf("Disabled: Running"); - } - if(ui_hovering(sig) && !can_step && !can_stop) - { - UI_Tooltip - UI_Font(df_font_from_slot(DF_FontSlot_Main)) - UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Main)) - ui_labelf("Disabled: No processes are running"); - } - if(ui_hovering(sig) && can_step) - { - UI_Tooltip - UI_Font(df_font_from_slot(DF_FontSlot_Main)) - UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Main)) - ui_labelf("Step Into"); - } - if(ui_clicked(sig)) - { - DF_CmdParams params = df_cmd_params_from_window(ws); - df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_StepInto)); - } - } - - UI_TextAlignment(UI_TextAlign_Center) UI_Flags(can_step ? 0 : UI_BoxFlag_Disabled) - { - UI_Signal sig = ui_button(df_g_icon_kind_text_table[DF_IconKind_StepOut]); - os_window_push_custom_title_bar_client_area(ws->os, sig.box->rect); - if(ui_hovering(sig) && !can_step && can_pause) - { - UI_Tooltip - UI_Font(df_font_from_slot(DF_FontSlot_Main)) - UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Main)) - ui_labelf("Disabled: Running"); - } - if(ui_hovering(sig) && !can_step && !can_stop) - { - UI_Tooltip - UI_Font(df_font_from_slot(DF_FontSlot_Main)) - UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Main)) - ui_labelf("Disabled: No processes are running"); - } - if(ui_hovering(sig) && can_step) - { - UI_Tooltip - UI_Font(df_font_from_slot(DF_FontSlot_Main)) - UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Main)) - ui_labelf("Step Out"); - } - if(ui_clicked(sig)) - { - DF_CmdParams params = df_cmd_params_from_window(ws); - df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_StepOut)); - } - } - - scratch_end(scratch); } + + //- rjf: pause button + UI_TextAlignment(UI_TextAlign_Center) UI_Flags(can_pause ? 0 : UI_BoxFlag_Disabled) + DF_UIColorScheme(DF_UIColorSchemeCode_SpecialNeutral) + { + UI_Signal sig = ui_button(df_g_icon_kind_text_table[DF_IconKind_Pause]); + os_window_push_custom_title_bar_client_area(ws->os, sig.box->rect); + if(ui_hovering(sig) && !can_pause) + { + UI_Tooltip + UI_Font(df_font_from_slot(DF_FontSlot_Main)) + UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Main)) + ui_labelf("Disabled: Already halted"); + } + if(ui_hovering(sig) && can_pause) + { + UI_Tooltip + UI_Font(df_font_from_slot(DF_FontSlot_Main)) + UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Main)) + ui_labelf("Halt all target processes"); + } + if(ui_clicked(sig)) + { + DF_CmdParams params = df_cmd_params_from_window(ws); + df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_Halt)); + } + } + + //- rjf: stop button + UI_TextAlignment(UI_TextAlign_Center) UI_Flags(can_stop ? 0 : UI_BoxFlag_Disabled) + DF_UIColorScheme(DF_UIColorSchemeCode_SpecialNegative) + { + UI_Signal sig = {0}; + { + sig = ui_button(df_g_icon_kind_text_table[DF_IconKind_Stop]); + os_window_push_custom_title_bar_client_area(ws->os, sig.box->rect); + } + if(ui_hovering(sig) && !can_stop) + { + UI_Tooltip + UI_Font(df_font_from_slot(DF_FontSlot_Main)) + UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Main)) + ui_labelf("Disabled: No processes are running"); + } + if(ui_hovering(sig) && can_stop) + { + UI_Tooltip + UI_Font(df_font_from_slot(DF_FontSlot_Main)) + UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Main)) + ui_labelf("Kill all target processes"); + } + if(ui_clicked(sig)) + { + DF_CmdParams params = df_cmd_params_from_window(ws); + df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_Kill)); + } + } + + //- rjf: step over button + UI_TextAlignment(UI_TextAlign_Center) UI_Flags(can_step ? 0 : UI_BoxFlag_Disabled) + { + UI_Signal sig = ui_button(df_g_icon_kind_text_table[DF_IconKind_StepOver]); + os_window_push_custom_title_bar_client_area(ws->os, sig.box->rect); + if(ui_hovering(sig) && !can_step && can_pause) + { + UI_Tooltip + UI_Font(df_font_from_slot(DF_FontSlot_Main)) + UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Main)) + ui_labelf("Disabled: Running"); + } + if(ui_hovering(sig) && !can_step && !can_stop) + { + UI_Tooltip + UI_Font(df_font_from_slot(DF_FontSlot_Main)) + UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Main)) + ui_labelf("Disabled: No processes are running"); + } + if(ui_hovering(sig) && can_step) + { + UI_Tooltip + UI_Font(df_font_from_slot(DF_FontSlot_Main)) + UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Main)) + ui_labelf("Step Over"); + } + if(ui_clicked(sig)) + { + DF_CmdParams params = df_cmd_params_from_window(ws); + df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_StepOver)); + } + } + + //- rjf: step into button + UI_TextAlignment(UI_TextAlign_Center) UI_Flags(can_step ? 0 : UI_BoxFlag_Disabled) + { + UI_Signal sig = ui_button(df_g_icon_kind_text_table[DF_IconKind_StepInto]); + os_window_push_custom_title_bar_client_area(ws->os, sig.box->rect); + if(ui_hovering(sig) && !can_step && can_pause) + { + UI_Tooltip + UI_Font(df_font_from_slot(DF_FontSlot_Main)) + UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Main)) + ui_labelf("Disabled: Running"); + } + if(ui_hovering(sig) && !can_step && !can_stop) + { + UI_Tooltip + UI_Font(df_font_from_slot(DF_FontSlot_Main)) + UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Main)) + ui_labelf("Disabled: No processes are running"); + } + if(ui_hovering(sig) && can_step) + { + UI_Tooltip + UI_Font(df_font_from_slot(DF_FontSlot_Main)) + UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Main)) + ui_labelf("Step Into"); + } + if(ui_clicked(sig)) + { + DF_CmdParams params = df_cmd_params_from_window(ws); + df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_StepInto)); + } + } + + //- rjf: step out button + UI_TextAlignment(UI_TextAlign_Center) UI_Flags(can_step ? 0 : UI_BoxFlag_Disabled) + { + UI_Signal sig = ui_button(df_g_icon_kind_text_table[DF_IconKind_StepOut]); + os_window_push_custom_title_bar_client_area(ws->os, sig.box->rect); + if(ui_hovering(sig) && !can_step && can_pause) + { + UI_Tooltip + UI_Font(df_font_from_slot(DF_FontSlot_Main)) + UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Main)) + ui_labelf("Disabled: Running"); + } + if(ui_hovering(sig) && !can_step && !can_stop) + { + UI_Tooltip + UI_Font(df_font_from_slot(DF_FontSlot_Main)) + UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Main)) + ui_labelf("Disabled: No processes are running"); + } + if(ui_hovering(sig) && can_step) + { + UI_Tooltip + UI_Font(df_font_from_slot(DF_FontSlot_Main)) + UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Main)) + ui_labelf("Step Out"); + } + if(ui_clicked(sig)) + { + DF_CmdParams params = df_cmd_params_from_window(ws); + df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_StepOut)); + } + } + + scratch_end(scratch); } //- rjf: right column @@ -5415,9 +5381,8 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) ui_spacer(ui_pct(1, 0)); // rjf: loaded user viz - if(do_user_prof) + if(do_user_prof) DF_UIColorScheme(DF_UIColorSchemeCode_SpecialNeutral) { - ui_set_next_background_color(df_rgba_from_theme_color(DF_ThemeColor_Highlight1)); ui_set_next_pref_width(ui_children_sum(1)); ui_set_next_child_layout_axis(Axis2_X); ui_set_next_hover_cursor(OS_Cursor_HandPoint); @@ -5451,9 +5416,8 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) } // rjf: loaded project viz - if(do_user_prof) + if(do_user_prof) DF_UIColorScheme(DF_UIColorSchemeCode_SpecialNeutral) { - ui_set_next_background_color(df_rgba_from_theme_color(DF_ThemeColor_Highlight0)); ui_set_next_pref_width(ui_children_sum(1)); ui_set_next_child_layout_axis(Axis2_X); ui_set_next_hover_cursor(OS_Cursor_HandPoint); @@ -5499,7 +5463,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) max_sig = df_icon_buttonf(DF_IconKind_Window, 0, "##maximize"); } UI_PrefWidth(ui_px(button_dim*2, 1.f)) - UI_BackgroundColor(df_rgba_from_theme_color(DF_ThemeColor_FailureBackground)) + DF_UIColorScheme(DF_UIColorSchemeCode_SpecialNegative) { cls_sig = df_icon_buttonf(DF_IconKind_X, 0, "##close"); } @@ -5531,7 +5495,10 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) { B32 is_running = df_ctrl_targets_running() && df_ctrl_last_run_frame_idx() < df_frame_index(); CTRL_Event stop_event = df_ctrl_last_stop_event(); - Vec4F32 color = df_rgba_from_theme_color(DF_ThemeColor_Highlight0); + UI_ColorScheme *positive_scheme = df_ui_color_scheme_from_code(DF_UIColorSchemeCode_SpecialPositive); + UI_ColorScheme *running_scheme = df_ui_color_scheme_from_code(DF_UIColorSchemeCode_SpecialNeutral); + UI_ColorScheme *negative_scheme = df_ui_color_scheme_from_code(DF_UIColorSchemeCode_SpecialNegative); + UI_ColorScheme *scheme = running_scheme; if(!is_running) { switch(stop_event.cause) @@ -5539,26 +5506,32 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) default: case CTRL_EventCause_Finished: { - color = df_rgba_from_theme_color(DF_ThemeColor_Highlight1); + scheme = positive_scheme; }break; case CTRL_EventCause_UserBreakpoint: case CTRL_EventCause_InterruptedByException: case CTRL_EventCause_InterruptedByTrap: case CTRL_EventCause_InterruptedByHalt: { - color = df_rgba_from_theme_color(DF_ThemeColor_FailureBackground); + scheme = negative_scheme; }break; } } if(ws->error_t > 0.01f) { - Vec4F32 failure_bg = df_rgba_from_theme_color(DF_ThemeColor_FailureBackground); - color.x += (failure_bg.x-color.x)*ws->error_t; - color.y += (failure_bg.y-color.y)*ws->error_t; - color.z += (failure_bg.z-color.z)*ws->error_t; - color.w += (failure_bg.w-color.w)*ws->error_t; + UI_ColorScheme *blended_scheme = push_array(ui_build_arena(), UI_ColorScheme, 1); + MemoryCopyStruct(blended_scheme, scheme); + for(EachEnumVal(UI_ColorCode, code)) + { + for(U64 idx = 0; idx < 4; idx += 1) + { + blended_scheme->colors[code].v[idx] += (negative_scheme->colors[code].v[idx] - blended_scheme->colors[code].v[idx]) * ws->error_t; + } + } + scheme = blended_scheme; } - UI_Flags(UI_BoxFlag_DrawBackground) UI_BackgroundColor(color) UI_CornerRadius(0) + UI_Flags(UI_BoxFlag_DrawBackground) UI_CornerRadius(0) + UI_Scheme(scheme) UI_Pane(bottom_bar_rect, str8_lit("###bottom_bar")) UI_WidthFill UI_Row UI_Flags(0) { @@ -5611,7 +5584,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) UI_Flags(UI_BoxFlag_DrawBackground) UI_TextAlignment(UI_TextAlign_Center) UI_CornerRadius(4) - UI_BackgroundColor(df_rgba_from_theme_color(DF_ThemeColor_Highlight0)) + DF_UIColorScheme(DF_UIColorSchemeCode_SpecialNeutral) ui_labelf("Currently rebinding \"%S\" hotkey", df_gfx_state->bind_change_cmd_spec->info.display_name); } @@ -5620,13 +5593,9 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) { ws->error_t -= df_dt()/8.f; df_gfx_request_frame(); - Vec4F32 tx_color = df_rgba_from_theme_color(DF_ThemeColor_FailureText); - F32 alpha_factor = Max(ws->error_t, 0.2f); - tx_color.w *= alpha_factor; String8 error_string = str8(ws->error_buffer, ws->error_string_size); if(error_string.size != 0) { - ui_set_next_text_color(tx_color); ui_set_next_pref_width(ui_children_sum(1)); UI_CornerRadius(4) UI_Row @@ -5873,7 +5842,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) } //- rjf: build darkening overlay for rest of screen - UI_BackgroundColor(mix_4f32(df_rgba_from_theme_color(DF_ThemeColor_InactivePanelOverlay), v4f32(0, 0, 0, 0), 1-ws->query_view_selected_t)) + UI_Scheme(ui_fork_top_color_scheme(.background = mix_4f32(df_rgba_from_theme_color(DF_ThemeColor_InactivePanelOverlay), v4f32(0, 0, 0, 0), 1-ws->query_view_selected_t))) UI_Rect(window_rect) { ui_build_box_from_key(UI_BoxFlag_DrawBackground, ui_key_zero()); @@ -5931,6 +5900,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) if(build_hover_eval && ws->hover_eval_string.size != 0 && hover_eval_is_open) UI_Font(df_font_from_slot(DF_FontSlot_Code)) UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Main)) + DF_UIColorScheme(DF_UIColorSchemeCode_Floating) { Temp scratch = scratch_begin(&arena, 1); DI_Scope *scope = di_scope_open(); @@ -5999,7 +5969,6 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) ui_set_next_fixed_y(ws->hover_eval_spawn_pos.y); ui_set_next_pref_width(ui_em(80.f, 1.f)); ui_set_next_pref_height(ui_px(hover_eval_container_height, 1.f)); - ui_set_next_background_color(df_rgba_from_theme_color(DF_ThemeColor_AltBackground)); ui_set_next_corner_radius_00(0); ui_set_next_corner_radius_01(corner_radius); ui_set_next_corner_radius_10(corner_radius); @@ -6077,8 +6046,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) if(!(row->flags & DF_EvalVizRowFlag_CanExpand)) { UI_PrefWidth(ui_em(1.5f, 1)) - UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText)) - UI_Flags(UI_BoxFlag_DrawSideLeft*(row->depth>0)) + UI_Flags(UI_BoxFlag_DrawSideLeft*(row->depth>0) | UI_BoxFlag_DrawTextWeak) UI_Font(ui_icon_font()) ui_label(df_g_icon_kind_text_table[DF_IconKind_Dot]); } @@ -6092,7 +6060,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) { Vec4F32 rgba = df_rgba_from_theme_color(DF_ThemeColor_Highlight0); rgba.w *= 0.2f; - ui_set_next_background_color(rgba); + ui_set_next_scheme(ui_fork_top_color_scheme(.background = rgba)); } UI_Signal sig = df_line_editf(DF_LineEditFlag_CodeContents| DF_LineEditFlag_DisplayStringIsCode| @@ -6119,7 +6087,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) { Vec4F32 rgba = df_rgba_from_theme_color(DF_ThemeColor_Highlight0); rgba.w *= 0.2f; - ui_set_next_background_color(rgba); + ui_set_next_scheme(ui_fork_top_color_scheme(.background = rgba)); ui_set_next_flags(UI_BoxFlag_DrawBackground); } df_code_label(1.f, 1, df_rgba_from_theme_color(DF_ThemeColor_CodeDefault), row->display_value); @@ -6275,7 +6243,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) ui_set_next_child_layout_axis(axis2_flip(axis)); if(ui_key_match(key, ui_drop_hot_key())) { - ui_set_next_border_color(df_rgba_from_theme_color(DF_ThemeColor_Highlight0)); + ui_set_next_scheme(ui_fork_top_color_scheme(.border = df_rgba_from_theme_color(DF_ThemeColor_Highlight0))); } site_box_viz = ui_build_box_from_key(UI_BoxFlag_DrawBackground| UI_BoxFlag_DrawBorder| @@ -6302,9 +6270,8 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) future_split_rect.p1.v[axis] += drop_site_major_dim_px; future_split_rect.p0.v[axis2_flip(axis)] = panel_rect.p0.v[axis2_flip(axis)]; future_split_rect.p1.v[axis2_flip(axis)] = panel_rect.p1.v[axis2_flip(axis)]; - UI_Rect(future_split_rect) + UI_Rect(future_split_rect) DF_UIColorScheme(DF_UIColorSchemeCode_DropSite) { - ui_set_next_background_color(df_rgba_from_theme_color(DF_ThemeColor_DropSiteOverlay)); ui_build_box_from_key(UI_BoxFlag_DrawBackground, ui_key_zero()); } } @@ -6361,7 +6328,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) ui_set_next_child_layout_axis(axis2_flip(split_axis)); if(ui_key_match(key, ui_drop_hot_key())) { - ui_set_next_border_color(df_rgba_from_theme_color(DF_ThemeColor_Highlight0)); + ui_set_next_scheme(ui_fork_top_color_scheme(.border = df_rgba_from_theme_color(DF_ThemeColor_Highlight0))); } site_box_viz = ui_build_box_from_key(UI_BoxFlag_DrawBackground| UI_BoxFlag_DrawBorder| @@ -6388,9 +6355,8 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) future_split_rect.p1.v[split_axis] += drop_site_major_dim_px; future_split_rect.p0.v[axis2_flip(split_axis)] = child_rect.p0.v[axis2_flip(split_axis)]; future_split_rect.p1.v[axis2_flip(split_axis)] = child_rect.p1.v[axis2_flip(split_axis)]; - UI_Rect(future_split_rect) + UI_Rect(future_split_rect) DF_UIColorScheme(DF_UIColorSchemeCode_DropSite) { - ui_set_next_background_color(df_rgba_from_theme_color(DF_ThemeColor_DropSiteOverlay)); ui_build_box_from_key(UI_BoxFlag_DrawBackground, ui_key_zero()); } } @@ -6665,7 +6631,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) ui_set_next_child_layout_axis(axis2_flip(split_axis)); if(ui_key_match(key, ui_drop_hot_key())) { - ui_set_next_border_color(df_rgba_from_theme_color(DF_ThemeColor_Highlight0)); + ui_set_next_scheme(ui_fork_top_color_scheme(.border = df_rgba_from_theme_color(DF_ThemeColor_Highlight0))); } site_box_viz = ui_build_box_from_key(UI_BoxFlag_DrawBackground| UI_BoxFlag_DrawBorder| @@ -6679,11 +6645,11 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) ui_set_next_child_layout_axis(split_axis); UI_Box *row_or_column = ui_build_box_from_key(0, ui_key_zero()); UI_Parent(row_or_column) UI_Padding(ui_px(padding, 1.f)) { - if(split_side == Side_Min) { ui_set_next_flags(UI_BoxFlag_DrawBackground); ui_set_next_background_color(df_rgba_from_theme_color(DF_ThemeColor_DropSiteOverlay)); } - ui_build_box_from_key(UI_BoxFlag_DrawBorder, ui_key_zero()); + if(split_side == Side_Min) { ui_set_next_flags(UI_BoxFlag_DrawBackground); } + DF_UIColorScheme(DF_UIColorSchemeCode_DropSite) ui_build_box_from_key(UI_BoxFlag_DrawBorder, ui_key_zero()); ui_spacer(ui_px(padding, 1.f)); - if(split_side == Side_Max) { ui_set_next_flags(UI_BoxFlag_DrawBackground); ui_set_next_background_color(df_rgba_from_theme_color(DF_ThemeColor_DropSiteOverlay)); } - ui_build_box_from_key(UI_BoxFlag_DrawBorder, ui_key_zero()); + if(split_side == Side_Max) { ui_set_next_flags(UI_BoxFlag_DrawBackground); } + DF_UIColorScheme(DF_UIColorSchemeCode_DropSite) ui_build_box_from_key(UI_BoxFlag_DrawBorder, ui_key_zero()); } } } @@ -6693,9 +6659,8 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) { ui_set_next_child_layout_axis(split_axis); UI_Box *row_or_column = ui_build_box_from_key(0, ui_key_zero()); - UI_Parent(row_or_column) UI_Padding(ui_px(padding, 1.f)) + UI_Parent(row_or_column) UI_Padding(ui_px(padding, 1.f)) DF_UIColorScheme(DF_UIColorSchemeCode_DropSite) { - ui_set_next_background_color(df_rgba_from_theme_color(DF_ThemeColor_DropSiteOverlay)); ui_build_box_from_key(UI_BoxFlag_DrawBorder|UI_BoxFlag_DrawBackground, ui_key_zero()); } } @@ -6737,9 +6702,8 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) Vec2F32 panel_center = center_2f32(panel_rect); future_split_rect.v[side_flip(split_side)].v[split_axis] = panel_center.v[split_axis]; } - UI_Rect(future_split_rect) + UI_Rect(future_split_rect) DF_UIColorScheme(DF_UIColorSchemeCode_DropSite) { - ui_set_next_background_color(df_rgba_from_theme_color(DF_ThemeColor_DropSiteOverlay)); ui_build_box_from_key(UI_BoxFlag_DrawBackground, ui_key_zero()); } } @@ -6784,7 +6748,8 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) } UI_Parent(filter_box) UI_WidthFill UI_HeightFill { - UI_PrefWidth(ui_em(2.f, 1.f)) UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText)) + UI_PrefWidth(ui_em(2.f, 1.f)) + UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_Font(df_font_from_slot(DF_FontSlot_Icons)) ui_label(df_g_icon_kind_text_table[DF_IconKind_Find]); UI_PrefWidth(ui_text_dim(10, 1)) @@ -6824,10 +6789,6 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) UI_Rect(content_rect) UI_ChildLayoutAxis(Axis2_Y) UI_CornerRadius(0) UI_Focus(UI_FocusKind_On) { UI_Key panel_key = df_ui_key_from_panel(panel); - if(ws->focused_panel != panel) - { - ui_set_next_overlay_color(df_rgba_from_theme_color(DF_ThemeColor_InactivePanelOverlay)); - } panel_box = ui_build_box_from_key(UI_BoxFlag_MouseClickable| UI_BoxFlag_Clip| UI_BoxFlag_DrawBorder| @@ -6836,29 +6797,6 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) panel_key); } - ////////////////////////// - //- rjf: flash animation for stable view - // - UI_Parent(panel_box) - { - DF_View *view = df_selected_tab_from_panel(panel); - if(view->flash_t >= 0.001f) - { - UI_Box *panel_box = ui_top_parent(); - Rng2F32 panel_rect = panel_box->rect; - Vec2F32 panel_rect_dim = dim_2f32(panel_rect); - Vec4F32 color = df_rgba_from_theme_color(DF_ThemeColor_Highlight0); - color.w *= view->flash_t; - color.w *= 0.35f; - ui_set_next_fixed_x(0); - ui_set_next_fixed_y(0); - ui_set_next_fixed_width(panel_rect_dim.x); - ui_set_next_fixed_height(panel_rect_dim.y); - ui_set_next_background_color(color); - ui_build_box_from_key(UI_BoxFlag_DrawBackground|UI_BoxFlag_FloatingX|UI_BoxFlag_FloatingY, ui_key_zero()); - } - } - ////////////////////////// //- rjf: loading animation for stable view // @@ -6879,7 +6817,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) // rjf: colors Vec4F32 bg_color = v4f32(0.1f, 0.1f, 0.1f, 1); - Vec4F32 bd_color = df_rgba_from_theme_color(DF_ThemeColor_PlainBorder); + Vec4F32 bd_color = df_rgba_from_theme_color(DF_ThemeColor_FloatingBorder); Vec4F32 hl_color = df_rgba_from_theme_color(DF_ThemeColor_Highlight0); bg_color.w *= view->loading_t; bd_color.w *= view->loading_t; @@ -6911,7 +6849,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) { F64 pct_done_f64 = ((F64)view->loading_progress_v/(F64)view->loading_progress_v_target); F32 pct_done = (F32)pct_done_f64; - ui_set_next_background_color(v4f32(1, 1, 1, 0.2f*view->loading_t)); + ui_set_next_scheme(ui_fork_top_color_scheme(.background = v4f32(1, 1, 1, 0.2f*view->loading_t))); ui_set_next_fixed_x(indicator_region_rect.x0); ui_set_next_fixed_y(indicator_region_rect.y0); ui_set_next_fixed_width(dim_2f32(indicator_region_rect).x*pct_done); @@ -6920,7 +6858,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) } // rjf: fill - ui_set_next_background_color(hl_color); + ui_set_next_scheme(ui_fork_top_color_scheme(.background = hl_color)); ui_set_next_fixed_x(indicator_rect.x0); ui_set_next_fixed_y(indicator_rect.y0); ui_set_next_fixed_width(dim_2f32(indicator_rect).x); @@ -6928,8 +6866,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) ui_build_box_from_key(UI_BoxFlag_DrawBackground|UI_BoxFlag_FloatingX|UI_BoxFlag_FloatingY, ui_key_zero()); // rjf: animated bar - ui_set_next_background_color(bg_color); - ui_set_next_border_color(bd_color); + ui_set_next_scheme(ui_fork_top_color_scheme(.border = bd_color, .background = bg_color)); ui_set_next_fixed_x(indicator_region_rect.x0); ui_set_next_fixed_y(indicator_region_rect.y0); ui_set_next_fixed_width(dim_2f32(indicator_region_rect).x); @@ -6941,7 +6878,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) // rjf: build background UI_WidthFill UI_HeightFill { - ui_set_next_background_color(bg_color); + ui_set_next_scheme(ui_fork_top_color_scheme(.background = bg_color)); ui_set_next_blur_size(10.f*view->loading_t); ui_build_box_from_key(UI_BoxFlag_DrawBackground|UI_BoxFlag_DrawBackgroundBlur|UI_BoxFlag_FloatingX|UI_BoxFlag_FloatingY, ui_key_zero()); } @@ -7091,9 +7028,9 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) UI_PrefWidth(ui_em(9.f, 0.2f)) UI_Column { ui_spacer(ui_em(0.2f, 1.f)); - UI_BackgroundColor(df_rgba_from_theme_color(DF_ThemeColor_DropSiteOverlay)) - UI_CornerRadius00(corner_radius) + UI_CornerRadius00(corner_radius) UI_CornerRadius10(corner_radius) + DF_UIColorScheme(DF_UIColorSchemeCode_DropSite) { ui_build_box_from_key(UI_BoxFlag_DrawBackground|UI_BoxFlag_DrawBorder, ui_key_zero()); } @@ -7118,7 +7055,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) UI_Box *tab_column_box = ui_build_box_from_stringf(!is_changing_panel_boundaries*UI_BoxFlag_AnimatePosX, "tab_column_%p", view); // rjf: build tab container box - UI_Parent(tab_column_box) UI_PrefHeight(ui_px(tab_bar_vheight, 1)) + UI_Parent(tab_column_box) UI_PrefHeight(ui_px(tab_bar_vheight, 1)) DF_UIColorScheme(view_is_selected ? DF_UIColorSchemeCode_TabActive : DF_UIColorSchemeCode_TabInactive) { if((!view_is_selected && panel->tab_side == Side_Min) || (view_is_selected && panel->tab_side == Side_Max)) @@ -7129,14 +7066,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) { ui_spacer(ui_px(1.f, 1.f)); } - Vec4F32 bg_color = df_rgba_from_theme_color(view_is_selected ? DF_ThemeColor_TabActive : DF_ThemeColor_TabInactive); - if(view_is_selected && panel != ws->focused_panel) - { - bg_color.w *= 0.5f; - } ui_set_next_hover_cursor(OS_Cursor_HandPoint); - ui_set_next_background_color(bg_color); - ui_set_next_border_color(mix_4f32(v4f32(bg_color.x, bg_color.y, bg_color.z, bg_color.w), v4f32(1, 1, 1, 0.2f), 0.5f)); UI_Box *tab_box = ui_build_box_from_stringf(UI_BoxFlag_DrawHotEffects| UI_BoxFlag_DrawBackground| UI_BoxFlag_DrawBorder| @@ -7152,7 +7082,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) { if(icon_kind != DF_IconKind_Null) { - UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText)) + UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_Font(df_font_from_slot(DF_FontSlot_Icons)) UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Icons)) UI_TextAlignment(UI_TextAlign_Center) @@ -7170,7 +7100,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) { df_font_from_slot(DF_FontSlot_Main), label, - df_rgba_from_theme_color(view_is_selected ? DF_ThemeColor_PlainText : DF_ThemeColor_WeakText), + ui_top_scheme()->colors[UI_ColorCode_Text], ui_top_font_size(), }; d_fancy_string_list_push(scratch.arena, &fstrs, &view_title); @@ -7190,7 +7120,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) { df_font_from_slot(DF_FontSlot_Code), str8(view->query_buffer, view->query_string_size), - df_rgba_from_theme_color(DF_ThemeColor_WeakText), + ui_top_scheme()->colors[UI_ColorCode_TextWeak], ui_top_font_size(), }; d_fancy_string_list_push(scratch.arena, &fstrs, &query); @@ -7202,15 +7132,12 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) } else { - UI_TextColor(df_rgba_from_theme_color(view_is_selected ? DF_ThemeColor_PlainText : DF_ThemeColor_WeakText)) - UI_PrefWidth(ui_text_dim(10, 0)) - ui_label(label); + UI_PrefWidth(ui_text_dim(10, 0)) ui_label(label); } } UI_PrefWidth(ui_em(2.35f, 1.f)) UI_TextAlignment(UI_TextAlign_Center) UI_Font(df_font_from_slot(DF_FontSlot_Icons)) UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Icons)*0.75f) - UI_BackgroundColor(v4f32(0, 0, 0, 0)) UI_CornerRadius00(0) UI_CornerRadius01(0) { @@ -7280,7 +7207,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) UI_CornerRadius(tab_bar_vheight/2.f) UI_Font(df_font_from_slot(DF_FontSlot_Icons)) UI_FontSize(ui_top_font_size()*0.75f) - UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText)) + UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_HoverCursor(OS_Cursor_HandPoint) { UI_Box *add_new_box = ui_build_box_from_stringf(UI_BoxFlag_DrawBackground| @@ -7350,12 +7277,11 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) // rjf: vis DF_Panel *drag_panel = df_panel_from_handle(df_g_drag_drop_payload.panel); - if(!df_view_is_nil(view) && - active_drop_site != 0 && - (panel != drag_panel || 1)) + if(!df_view_is_nil(view) && active_drop_site != 0) { - tab_bar_box->flags |= UI_BoxFlag_DrawOverlay; - tab_bar_box->overlay_color = df_rgba_from_theme_color(DF_ThemeColor_DropSiteOverlay); + UI_Scheme(ui_push_color_scheme(.background = df_rgba_from_theme_color(DF_ThemeColor_DropSiteOverlay))) + UI_Rect(tab_bar_rect) + ui_build_box_from_key(UI_BoxFlag_DrawBackground, ui_key_zero()); } // rjf: drop @@ -7413,8 +7339,8 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) { // rjf: vis { - panel_box->flags |= UI_BoxFlag_DrawOverlay; - panel_box->overlay_color = df_rgba_from_theme_color(DF_ThemeColor_DropSiteOverlay); + UI_Scheme(ui_push_color_scheme(.background = df_rgba_from_theme_color(DF_ThemeColor_DropSiteOverlay))) UI_Rect(content_rect) + ui_build_box_from_key(UI_BoxFlag_DrawBackground, ui_key_zero()); } // rjf: drop @@ -7482,7 +7408,6 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) for(DF_View *view = list_first; !df_view_is_nil(view); view = view->next) { if(abs_f32(view->loading_t_target - view->loading_t) > 0.01f || - abs_f32(0 - view->flash_t) > 0.01f || abs_f32(view->scroll_pos.x.off) > 0.01f || abs_f32(view->scroll_pos.y.off) > 0.01f || abs_f32(view->is_filtering_t - (F32)!!view->is_filtering)) @@ -7494,7 +7419,6 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) df_gfx_request_frame(); } view->loading_t += (view->loading_t_target - view->loading_t) * rate; - view->flash_t += (0 - view->flash_t) * rate; view->is_filtering_t += ((F32)!!view->is_filtering - view->is_filtering_t) * fast_rate; view->scroll_pos.x.off -= view->scroll_pos.x.off*fast_rate; view->scroll_pos.y.off -= view->scroll_pos.y.off*fast_rate; @@ -7646,13 +7570,13 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) //- rjf: draw background color { - Vec4F32 bg_color = df_rgba_from_theme_color(DF_ThemeColor_PlainBackground); + Vec4F32 bg_color = df_rgba_from_theme_color(DF_ThemeColor_DefaultBackground); d_rect(os_client_rect_from_window(ws->os), bg_color, 0, 0, 0); } //- rjf: draw window border { - Vec4F32 color = df_rgba_from_theme_color(DF_ThemeColor_PlainBorder); + Vec4F32 color = df_rgba_from_theme_color(DF_ThemeColor_DefaultBorder); d_rect(os_client_rect_from_window(ws->os), color, 0, 1.f, 0.5f); } @@ -7714,7 +7638,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) { // rjf: main rectangle { - R_Rect2DInst *inst = d_rect(pad_2f32(box->rect, 1.5f), box->background_color, 0, 0, 1.f); + R_Rect2DInst *inst = d_rect(pad_2f32(box->rect, 1.5f), box->scheme->colors[UI_ColorCode_Background], 0, 0, 1.f); MemoryCopyArray(inst->corner_radii, box->corner_radii); } @@ -7819,7 +7743,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) d_truncated_fancy_run_list(text_position, &box->display_string_runs, max_x, ellipses_run); if(box->flags & UI_BoxFlag_HasFuzzyMatchRanges) { - Vec4F32 match_color = df_rgba_from_theme_color(DF_ThemeColor_Cursor); + Vec4F32 match_color = df_rgba_from_theme_color(DF_ThemeColor_Highlight0); match_color.w *= 0.25f; d_truncated_fancy_run_fuzzy_matches(text_position, &box->display_string_runs, max_x, &box->fuzzy_match_ranges, match_color); } @@ -7910,7 +7834,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) // rjf: draw border if(b->flags & UI_BoxFlag_DrawBorder) { - R_Rect2DInst *inst = d_rect(pad_2f32(b->rect, 1), b->border_color, 0, 1.f, 1.f); + R_Rect2DInst *inst = d_rect(pad_2f32(b->rect, 1), b->scheme->colors[UI_ColorCode_Border], 0, 1.f, 1.f); MemoryCopyArray(inst->corner_radii, b->corner_radii); // rjf: hover effect @@ -7935,19 +7859,19 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) F32 softness = 0.5f; if(b->flags & UI_BoxFlag_DrawSideTop) { - d_rect(r2f32p(r.x0, r.y0-half_thickness, r.x1, r.y0+half_thickness), b->border_color, 0, 0, softness); + d_rect(r2f32p(r.x0, r.y0-half_thickness, r.x1, r.y0+half_thickness), b->scheme->colors[UI_ColorCode_Border], 0, 0, softness); } if(b->flags & UI_BoxFlag_DrawSideBottom) { - d_rect(r2f32p(r.x0, r.y1-half_thickness, r.x1, r.y1+half_thickness), b->border_color, 0, 0, softness); + d_rect(r2f32p(r.x0, r.y1-half_thickness, r.x1, r.y1+half_thickness), b->scheme->colors[UI_ColorCode_Border], 0, 0, softness); } if(b->flags & UI_BoxFlag_DrawSideLeft) { - d_rect(r2f32p(r.x0-half_thickness, r.y0, r.x0+half_thickness, r.y1), b->border_color, 0, 0, softness); + d_rect(r2f32p(r.x0-half_thickness, r.y0, r.x0+half_thickness, r.y1), b->scheme->colors[UI_ColorCode_Border], 0, 0, softness); } if(b->flags & UI_BoxFlag_DrawSideRight) { - d_rect(r2f32p(r.x1-half_thickness, r.y0, r.x1+half_thickness, r.y1), b->border_color, 0, 0, softness); + d_rect(r2f32p(r.x1-half_thickness, r.y0, r.x1+half_thickness, r.y1), b->scheme->colors[UI_ColorCode_Border], 0, 0, softness); } } @@ -7977,7 +7901,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) // rjf: draw focus active vis if(b->flags & UI_BoxFlag_Clickable && !(b->flags & UI_BoxFlag_DisableFocusViz) && b->focus_active_t > 0.01f) { - Vec4F32 color = df_rgba_from_theme_color(DF_ThemeColor_Highlight0); + Vec4F32 color = df_rgba_from_theme_color(DF_ThemeColor_FocusActive); color.w *= b->focus_active_t; R_Rect2DInst *inst = d_rect(pad_2f32(b->rect, 1.f), color, 0, 2.f, 1.f); inst->colors[Corner_10] = inst->colors[Corner_01] = inst->colors[Corner_11] = v4f32(color.x, color.y, color.z, color.w/3.f); @@ -7987,38 +7911,18 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) // rjf: draw focus active disabled vis if(b->flags & UI_BoxFlag_Clickable && !(b->flags & UI_BoxFlag_DisableFocusViz) && b->focus_active_disabled_t > 0.01f) { - Vec4F32 color = df_rgba_from_theme_color(DF_ThemeColor_FailureBackground); + Vec4F32 color = df_rgba_from_theme_color(DF_ThemeColor_FocusInactive); color.w *= b->focus_active_disabled_t; R_Rect2DInst *inst = d_rect(pad_2f32(b->rect, 1.f), color, 0, 2.f, 1.f); inst->colors[Corner_10] = inst->colors[Corner_01] = inst->colors[Corner_11] = v4f32(color.x, color.y, color.z, color.w/3.f); MemoryCopyArray(inst->corner_radii, b->corner_radii); } - // rjf: draw overlay - if(b->flags & UI_BoxFlag_DrawOverlay && b->overlay_color.w > 0.05f) - { - R_Rect2DInst *inst = d_rect(b->rect, b->overlay_color, 0, 0, 1); - MemoryCopyArray(inst->corner_radii, b->corner_radii); - } - // rjf: disabled overlay if(b->disabled_t >= 0.005f) { - // rhp: disabled overlay color blends from plain background and inactive panel overlay - Vec4F32 bg = df_rgba_from_theme_color(DF_ThemeColor_PlainBackground); - Vec4F32 ov = df_rgba_from_theme_color(DF_ThemeColor_InactivePanelOverlay); - Vec4F32 color = {0}; - color.x = bg.x * bg.w + ov.x * ov.w * (1.0f - bg.w); - color.y = bg.y * bg.w + ov.y * ov.w * (1.0f - bg.w); - color.z = bg.z * bg.w + ov.z * ov.w * (1.0f - bg.w); - color.w = bg.w + ov.w * (1.0f - bg.w); - if (1.0f - color.w < 0.01f) - { - color.x *= color.w; - color.y *= color.w; - color.z *= color.w; - } - color.w = 0.60f * b->disabled_t; + Vec4F32 color = df_rgba_from_theme_color(DF_ThemeColor_DisabledOverlay); + color.w *= b->disabled_t; R_Rect2DInst *inst = d_rect(b->rect, color, 0, 0, 1); MemoryCopyArray(inst->corner_radii, b->corner_radii); } @@ -8064,7 +7968,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) //- rjf: draw border/overlay color to signify error if(ws->error_t > 0.01f) { - Vec4F32 color = df_rgba_from_theme_color(DF_ThemeColor_FailureBackground); + Vec4F32 color = df_rgba_from_theme_color(DF_ThemeColor_SpecialNegativeBackground); color.w *= ws->error_t; Rng2F32 rect = os_client_rect_from_window(ws->os); d_rect(pad_2f32(rect, 24.f), color, 0, 16.f, 12.f); @@ -9353,11 +9257,20 @@ df_theme_color_from_txt_token_kind(TXT_TokenKind kind) case TXT_TokenKind_String: {color = DF_ThemeColor_CodeString;}break; case TXT_TokenKind_Meta: {color = DF_ThemeColor_CodeMeta;}break; case TXT_TokenKind_Comment:{color = DF_ThemeColor_CodeComment;}break; - case TXT_TokenKind_Symbol: {color = DF_ThemeColor_CodeSymbol;}break; + case TXT_TokenKind_Symbol: {color = DF_ThemeColor_CodeDelimiterOperator;}break; } return color; } +//- rjf: code -> ui color scheme + +internal UI_ColorScheme * +df_ui_color_scheme_from_code(DF_UIColorSchemeCode code) +{ + UI_ColorScheme *result = &df_gfx_state->cfg_ui_color_schemes[code]; + return result; +} + //- rjf: fonts/sizes internal F_Tag @@ -9862,20 +9775,33 @@ df_cmd_binding_button(DF_CmdSpec *spec) } } + //- rjf: form color scheme + UI_ColorScheme *scheme = ui_top_scheme(); + if(has_conflicts || (df_gfx_state->bind_change_active && df_gfx_state->bind_change_cmd_spec == spec)) + { + scheme = push_array(ui_build_arena(), UI_ColorScheme, 1); + MemoryCopyStruct(scheme, ui_top_scheme()); + if(has_conflicts) + { + scheme->colors[UI_ColorCode_Text] = df_rgba_from_theme_color(DF_ThemeColor_DefaultTextNegative); + } + if(df_gfx_state->bind_change_active && df_gfx_state->bind_change_cmd_spec == spec) + { + scheme->colors[UI_ColorCode_Border] = df_rgba_from_theme_color(DF_ThemeColor_Highlight1); + scheme->colors[UI_ColorCode_Background] = df_rgba_from_theme_color(DF_ThemeColor_Highlight1); + scheme->colors[UI_ColorCode_Background].w *= 0.25f; + } + } + //- rjf: build box ui_set_next_hover_cursor(OS_Cursor_HandPoint); ui_set_next_text_alignment(UI_TextAlign_Center); + ui_set_next_scheme(scheme); UI_Box *box = ui_build_box_from_stringf(UI_BoxFlag_DrawText| UI_BoxFlag_Clickable| UI_BoxFlag_DrawActiveEffects, "%S###bind_btn_%p", keybinding_str, spec); - //- rjf: has conflicts => red - if(has_conflicts) - { - box->text_color = df_rgba_from_theme_color(DF_ThemeColor_FailureBackground); - } - //- rjf: interaction UI_Signal sig = ui_signal_from_box(box); { @@ -9912,16 +9838,6 @@ df_cmd_binding_button(DF_CmdSpec *spec) } } - //- rjf: activity vis - if(df_gfx_state->bind_change_active && df_gfx_state->bind_change_cmd_spec == spec) - { - box->flags |= UI_BoxFlag_DrawBorder|UI_BoxFlag_DrawBackground; - box->border_color = df_rgba_from_theme_color(DF_ThemeColor_Highlight1); - Vec4F32 bg_color = df_rgba_from_theme_color(DF_ThemeColor_Highlight1); - bg_color.w *= 0.25f; - box->background_color = bg_color; - } - scratch_end(scratch); } @@ -9953,7 +9869,7 @@ df_cmd_spec_button(DF_CmdSpec *spec) UI_Font(df_font_from_slot(DF_FontSlot_Icons)) UI_PrefWidth(ui_em(2.f, 1.f)) UI_TextAlignment(UI_TextAlign_Center) - UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText)) + UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) { ui_label(df_g_icon_kind_text_table[canonical_icon]); } @@ -9964,7 +9880,7 @@ df_cmd_spec_button(DF_CmdSpec *spec) UI_FastpathCodepoint(box->fastpath_codepoint) ui_label(spec->info.display_name); ui_spacer(ui_pct(1, 0)); - UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText)) + UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_FastpathCodepoint(0) { df_cmd_binding_button(spec); @@ -10016,11 +9932,10 @@ df_icon_button(DF_IconKind kind, FuzzyMatchRangeList *matches, String8 string) ui_spacer(ui_pct(1, 0)); } UI_TextAlignment(UI_TextAlign_Center) - UI_Flags(UI_BoxFlag_DisableTextTrunc) UI_Font(df_font_from_slot(DF_FontSlot_Icons)) UI_PrefWidth(ui_em(2.f, 1.f)) UI_PrefHeight(ui_pct(1, 0)) - UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText)) + UI_FlagsAdd(UI_BoxFlag_DisableTextTrunc|UI_BoxFlag_DrawTextWeak) ui_label(df_g_icon_kind_text_table[kind]); if(display_string.size != 0) { @@ -10061,7 +9976,7 @@ df_entity_tooltips(DF_Entity *entity) Temp scratch = scratch_begin(0, 0); switch(entity->kind) { - default:break; + default:{}break; case DF_EntityKind_File: UI_Tooltip UI_PrefWidth(ui_text_dim(10, 1)) { @@ -10080,8 +9995,7 @@ df_entity_tooltips(DF_Entity *entity) { if(entity->flags & DF_EntityFlag_HasColor) { - Vec4F32 color = df_rgba_from_entity(entity); - ui_set_next_text_color(color); + ui_set_next_scheme(ui_fork_top_color_scheme(.text = df_rgba_from_entity(entity))); } UI_PrefWidth(ui_text_dim(10, 1)) ui_label(display_string); } @@ -10095,7 +10009,7 @@ df_entity_tooltips(DF_Entity *entity) String8 explanation = df_stop_explanation_string_icon_from_ctrl_event(scratch.arena, &stop_event, &icon_kind); if(explanation.size != 0) { - UI_PrefWidth(ui_children_sum(1)) UI_Row UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_FailureBackground)) + UI_PrefWidth(ui_children_sum(1)) UI_Row DF_UIColorScheme(DF_UIColorSchemeCode_DefaultNegative) { UI_PrefWidth(ui_em(1.5f, 1.f)) UI_Font(df_font_from_slot(DF_FontSlot_Icons)) ui_label(df_g_icon_kind_text_table[icon_kind]); UI_PrefWidth(ui_text_dim(10, 1)) ui_label(explanation); @@ -10106,12 +10020,12 @@ df_entity_tooltips(DF_Entity *entity) ui_spacer(ui_em(1.5f, 1.f)); UI_PrefWidth(ui_children_sum(1)) UI_Row { - UI_PrefWidth(ui_em(18.f, 1.f)) UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText)) ui_labelf("TID: "); + UI_PrefWidth(ui_em(18.f, 1.f)) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_labelf("TID: "); UI_PrefWidth(ui_text_dim(10, 1)) ui_labelf("%i", pid_or_tid); } UI_PrefWidth(ui_children_sum(1)) UI_Row { - UI_PrefWidth(ui_em(18.f, 1.f)) UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText)) ui_labelf("Architecture: "); + UI_PrefWidth(ui_em(18.f, 1.f)) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_labelf("Architecture: "); UI_PrefWidth(ui_text_dim(10, 1)) ui_label(arch_str); } ui_spacer(ui_em(1.5f, 1.f)); @@ -10141,21 +10055,21 @@ df_entity_tooltips(DF_Entity *entity) } UI_PrefWidth(ui_children_sum(1)) UI_Row { - UI_Font(df_font_from_slot(DF_FontSlot_Code)) UI_PrefWidth(ui_em(18.f, 1.f)) UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText)) ui_labelf("0x%I64x", rip_vaddr); + UI_Font(df_font_from_slot(DF_FontSlot_Code)) UI_PrefWidth(ui_em(18.f, 1.f)) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_labelf("0x%I64x", rip_vaddr); if(info.size != 0) { - UI_Font(df_font_from_slot(DF_FontSlot_Code)) UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText)) UI_PrefWidth(ui_text_dim(10, 1)) ui_label(info); + UI_Font(df_font_from_slot(DF_FontSlot_Code)) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_PrefWidth(ui_text_dim(10, 1)) ui_label(info); } if(name.size != 0) { UI_Font(df_font_from_slot(DF_FontSlot_Code))UI_PrefWidth(ui_text_dim(10, 1)) { - df_code_label(1.f, 0, df_rgba_from_theme_color(DF_ThemeColor_CodeFunction), name); + df_code_label(1.f, 0, df_rgba_from_theme_color(DF_ThemeColor_CodeProcedure), name); } } else { - UI_Font(df_font_from_slot(DF_FontSlot_Code)) UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText)) UI_PrefWidth(ui_text_dim(10, 1)) ui_labelf("[??? in %S]", module_name); + UI_Font(df_font_from_slot(DF_FontSlot_Code)) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_PrefWidth(ui_text_dim(10, 1)) ui_labelf("[??? in %S]", module_name); } } } @@ -10166,8 +10080,7 @@ df_entity_tooltips(DF_Entity *entity) { if(entity->flags & DF_EntityFlag_HasColor) { - Vec4F32 color = df_rgba_from_entity(entity); - ui_set_next_text_color(color); + ui_set_next_scheme(ui_fork_top_color_scheme(.text = df_rgba_from_entity(entity))); } String8 display_string = df_display_string_from_entity(scratch.arena, entity); UI_PrefWidth(ui_text_dim(10, 1)) ui_label(display_string); @@ -10178,14 +10091,14 @@ df_entity_tooltips(DF_Entity *entity) { stop_condition = str8_lit("true"); } - UI_PrefWidth(ui_em(12.f, 1.f)) UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText)) ui_labelf("Stop Condition: "); + UI_PrefWidth(ui_em(12.f, 1.f)) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_labelf("Stop Condition: "); UI_PrefWidth(ui_text_dim(10, 1)) UI_Font(df_font_from_slot(DF_FontSlot_Code)) df_code_label(1.f, 1, df_rgba_from_theme_color(DF_ThemeColor_CodeDefault), stop_condition); } UI_PrefWidth(ui_children_sum(1)) UI_Row { U64 hit_count = entity->u64; String8 hit_count_text = str8_from_u64(scratch.arena, hit_count, 10, 0, 0); - UI_PrefWidth(ui_em(12.f, 1.f)) UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText)) ui_labelf("Hit Count: "); + UI_PrefWidth(ui_em(12.f, 1.f)) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_labelf("Hit Count: "); UI_PrefWidth(ui_text_dim(10, 1)) UI_Font(df_font_from_slot(DF_FontSlot_Code)) df_code_label(1.f, 1, df_rgba_from_theme_color(DF_ThemeColor_CodeDefault), hit_count_text); } }break; @@ -10195,8 +10108,7 @@ df_entity_tooltips(DF_Entity *entity) { if(entity->flags & DF_EntityFlag_HasColor) { - Vec4F32 color = df_rgba_from_entity(entity); - ui_set_next_text_color(color); + ui_set_next_scheme(ui_fork_top_color_scheme(.text = df_rgba_from_entity(entity))); } String8 display_string = df_display_string_from_entity(scratch.arena, entity); UI_PrefWidth(ui_text_dim(10, 1)) df_code_label(1.f, 1, df_rgba_from_theme_color(DF_ThemeColor_CodeDefault), display_string); @@ -10210,24 +10122,16 @@ df_entity_desc_button(DF_Window *ws, DF_Entity *entity, FuzzyMatchRangeList *nam { ProfBeginFunction(); Temp scratch = scratch_begin(0, 0); + UI_ColorScheme *scheme = ui_top_scheme(); if(entity->kind == DF_EntityKind_Thread) { DF_CtrlCtx ctrl_ctx = df_ctrl_ctx_from_window(ws); CTRL_Event stop_event = df_ctrl_last_stop_event(); DF_Entity *stopped_thread = df_entity_from_ctrl_handle(stop_event.machine_id, stop_event.entity); DF_Entity *selected_thread = df_entity_from_handle(ctrl_ctx.thread); - B32 do_special_color = 0; - Vec4F32 special_color = {0}; if(selected_thread == entity) { - Vec4F32 color = ui_top_background_color(); - Vec4F32 highlight_color = df_rgba_from_theme_color(DF_ThemeColor_SuccessBackground); - color.x += (highlight_color.x - color.x) * 0.5f; - color.y += (highlight_color.y - color.y) * 0.5f; - color.z += (highlight_color.z - color.z) * 0.5f; - color.w += (highlight_color.w - color.w) * 0.5f; - special_color = color; - do_special_color = 1; + scheme = df_ui_color_scheme_from_code(DF_UIColorSchemeCode_SpecialNeutral); } if(stopped_thread == entity && (stop_event.cause == CTRL_EventCause_UserBreakpoint || @@ -10235,31 +10139,19 @@ df_entity_desc_button(DF_Window *ws, DF_Entity *entity, FuzzyMatchRangeList *nam stop_event.cause == CTRL_EventCause_InterruptedByTrap || stop_event.cause == CTRL_EventCause_InterruptedByHalt)) { - Vec4F32 color = ui_top_background_color(); - Vec4F32 highlight_color = df_rgba_from_theme_color(DF_ThemeColor_FailureBackground); - color.x += (highlight_color.x - color.x) * 0.5f; - color.y += (highlight_color.y - color.y) * 0.5f; - color.z += (highlight_color.z - color.z) * 0.5f; - color.w += (highlight_color.w - color.w) * 0.5f; - special_color = color; - do_special_color = 1; - } - if(do_special_color) - { - ui_set_next_background_color(special_color); + scheme = df_ui_color_scheme_from_code(DF_UIColorSchemeCode_SpecialNegative); } } if(entity->cfg_src == DF_CfgSrc_CommandLine) { - Vec4F32 bg_color = mix_4f32(ui_top_background_color(), df_rgba_from_theme_color(DF_ThemeColor_Highlight0), 0.25f); - ui_set_next_background_color(bg_color); + scheme = df_ui_color_scheme_from_code(DF_UIColorSchemeCode_SpecialNeutral); } else if(entity->kind == DF_EntityKind_Target && entity->b32 != 0) { - Vec4F32 bg_color = mix_4f32(ui_top_background_color(), df_rgba_from_theme_color(DF_ThemeColor_Highlight1), 0.25f); - ui_set_next_background_color(bg_color); + scheme = df_ui_color_scheme_from_code(DF_UIColorSchemeCode_DefaultPositive); } ui_set_next_hover_cursor(OS_Cursor_HandPoint); + ui_set_next_scheme(scheme); UI_Box *box = ui_build_box_from_stringf(UI_BoxFlag_Clickable| UI_BoxFlag_DrawBorder| UI_BoxFlag_DrawBackground| @@ -10273,32 +10165,30 @@ df_entity_desc_button(DF_Window *ws, DF_Entity *entity, FuzzyMatchRangeList *nam DF_EntityKindFlags kind_flags = df_g_entity_kind_flags_table[entity->kind]; DF_EntityOpFlags op_flags = df_g_entity_kind_op_flags_table[entity->kind]; DF_IconKind icon = df_g_entity_kind_icon_kind_table[entity->kind]; - Vec4F32 entity_color = df_rgba_from_theme_color(DF_ThemeColor_PlainText); - Vec4F32 entity_color_weak = df_rgba_from_theme_color(DF_ThemeColor_WeakText); + Vec4F32 entity_color = scheme->colors[UI_ColorCode_Text]; + Vec4F32 entity_color_weak = scheme->colors[UI_ColorCode_TextWeak]; if(entity->flags & DF_EntityFlag_HasColor) { entity_color = df_rgba_from_entity(entity); entity_color_weak = entity_color; entity_color_weak.w *= 0.5f; } - UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText)) - UI_TextAlignment(UI_TextAlign_Center) + UI_TextAlignment(UI_TextAlign_Center) UI_Font(df_font_from_slot(DF_FontSlot_Icons)) UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Icons)) UI_PrefWidth(ui_em(1.875f, 1.f)) + UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_label(df_g_icon_kind_text_table[icon]); if(entity->cfg_src == DF_CfgSrc_CommandLine) { - UI_TextColor(entity_color_weak) - UI_TextAlignment(UI_TextAlign_Center) + UI_TextAlignment(UI_TextAlign_Center) UI_PrefWidth(ui_em(1.875f, 1.f)) { UI_Box *info_box = &ui_g_nil_box; UI_Font(df_font_from_slot(DF_FontSlot_Icons)) UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Icons)) - UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_Highlight0)) { - info_box = ui_build_box_from_stringf(UI_BoxFlag_DrawText|UI_BoxFlag_Clickable, "%S###%p_temp_info", df_g_icon_kind_text_table[DF_IconKind_Info], entity); + info_box = ui_build_box_from_stringf(UI_BoxFlag_DrawText|UI_BoxFlag_DrawTextWeak|UI_BoxFlag_Clickable, "%S###%p_temp_info", df_g_icon_kind_text_table[DF_IconKind_Info], entity); } UI_Signal info_sig = ui_signal_from_box(info_box); if(ui_hovering(info_sig)) UI_Tooltip @@ -10308,7 +10198,7 @@ df_entity_desc_button(DF_Window *ws, DF_Entity *entity, FuzzyMatchRangeList *nam } } String8 label = df_display_string_from_entity(scratch.arena, entity); - UI_TextColor(entity_color) + UI_Scheme(ui_fork_top_color_scheme(.text = entity_color)) UI_Font(kind_flags&DF_EntityKindFlag_NameIsCode ? df_font_from_slot(DF_FontSlot_Code) : ui_top_font()) { UI_Signal label_sig = ui_label(label); @@ -10317,16 +10207,19 @@ df_entity_desc_button(DF_Window *ws, DF_Entity *entity, FuzzyMatchRangeList *nam ui_box_equip_fuzzy_match_ranges(label_sig.box, name_matches); } } - if(entity->kind == DF_EntityKind_Target) UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText)) UI_FontSize(ui_top_font_size()*0.95f) + if(entity->kind == DF_EntityKind_Target) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_FontSize(ui_top_font_size()*0.95f) { DF_Entity *args = df_entity_child_from_kind(entity, DF_EntityKind_Arguments); ui_label(args->name); } - if(op_flags & DF_EntityOpFlag_Enable && entity->b32 == 0) UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText)) UI_FontSize(ui_top_font_size()*0.95f) UI_HeightFill + if(op_flags & DF_EntityOpFlag_Enable && entity->b32 == 0) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_FontSize(ui_top_font_size()*0.95f) UI_HeightFill { ui_label(str8_lit("(Disabled)")); } - if(entity->kind == DF_EntityKind_Thread) UI_FontSize(ui_top_font_size()*0.75f) UI_Font(df_font_from_slot(DF_FontSlot_Code)) UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_CodeFunction)) + if(entity->kind == DF_EntityKind_Thread) + UI_FontSize(ui_top_font_size()*0.75f) + UI_Font(df_font_from_slot(DF_FontSlot_Code)) + UI_Scheme(ui_fork_top_color_scheme(.text = df_rgba_from_theme_color(DF_ThemeColor_CodeProcedure))) { CTRL_Unwind unwind = df_query_cached_unwind_from_thread(entity); DF_Entity *process = df_entity_ancestor_from_kind(entity, DF_EntityKind_Process); @@ -10350,7 +10243,7 @@ df_entity_desc_button(DF_Window *ws, DF_Entity *entity, FuzzyMatchRangeList *nam } if(idx != 0) { - UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText)) UI_PrefWidth(ui_em(2.f, 1.f)) ui_label(str8_lit(">")); + UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_PrefWidth(ui_em(2.f, 1.f)) ui_label(str8_lit(">")); } UI_PrefWidth(ui_text_dim(10.f, 0.f)) { @@ -10360,7 +10253,7 @@ df_entity_desc_button(DF_Window *ws, DF_Entity *entity, FuzzyMatchRangeList *nam idx += 1; if(idx == limit) { - UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText)) UI_PrefWidth(ui_text_dim(10.f, 1.f)) ui_label(str8_lit("> ...")); + UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_PrefWidth(ui_text_dim(10.f, 1.f)) ui_label(str8_lit("> ...")); } } } @@ -10433,7 +10326,7 @@ df_entity_src_loc_button(DF_Window *ws, DF_Entity *entity, TxtPt point) UI_Parent(box) UI_PrefWidth(ui_text_dim(10, 0)) { DF_IconKind icon = df_g_entity_kind_icon_kind_table[entity->kind]; - UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText)) + UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_TextAlignment(UI_TextAlign_Center) UI_Font(df_font_from_slot(DF_FontSlot_Icons)) UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Icons)) @@ -10529,10 +10422,7 @@ internal UI_BOX_CUSTOM_DRAW(df_thread_box_draw_extensions) if(u->is_frozen) { F32 lock_icon_off = ui_top_font_size()*0.2f; - Vec4F32 lock_icon_color = df_rgba_from_theme_color(DF_ThemeColor_FailureBackground); - lock_icon_color.x += (1 - lock_icon_color.x) * 0.3f; - lock_icon_color.y += (1 - lock_icon_color.y) * 0.3f; - lock_icon_color.z += (1 - lock_icon_color.z) * 0.3f; + Vec4F32 lock_icon_color = df_rgba_from_theme_color(DF_ThemeColor_DefaultTextNegative); d_text(ui_icon_font(), box->font_size, 0, 0, v2f32((box->rect.x0 + box->rect.x1)/2 + lock_icon_off/2, @@ -10619,10 +10509,10 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ B32 ctrlified = (os_get_event_flags() & OS_EventFlag_Ctrl); Vec4F32 code_line_bgs[] = { - df_rgba_from_theme_color(DF_ThemeColor_LineInfo0), - df_rgba_from_theme_color(DF_ThemeColor_LineInfo1), - df_rgba_from_theme_color(DF_ThemeColor_LineInfo2), - df_rgba_from_theme_color(DF_ThemeColor_LineInfo3), + df_rgba_from_theme_color(DF_ThemeColor_LineInfoBackground0), + df_rgba_from_theme_color(DF_ThemeColor_LineInfoBackground1), + df_rgba_from_theme_color(DF_ThemeColor_LineInfoBackground2), + df_rgba_from_theme_color(DF_ThemeColor_LineInfoBackground3), }; ////////////////////////////// @@ -10661,8 +10551,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ { if(n->entity == stopper_thread && (stop_event.cause == CTRL_EventCause_InterruptedByTrap || stop_event.cause == CTRL_EventCause_InterruptedByException)) { - line_bg_colors[line_idx] = df_rgba_from_theme_color(DF_ThemeColor_FailureBackground); - line_bg_colors[line_idx].w *= 0.25f; + line_bg_colors[line_idx] = df_rgba_from_theme_color(DF_ThemeColor_CodeBackgroundNegative); } } } @@ -10768,7 +10657,6 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ { DF_EntityList line_ips = params->line_ips[line_idx]; ui_set_next_hover_cursor(OS_Cursor_HandPoint); - ui_set_next_background_color(v4f32(0, 0, 0, 0)); UI_Box *line_margin_box = ui_build_box_from_stringf(UI_BoxFlag_Clickable*!!(params->flags & DF_CodeSliceFlag_Clickable)|UI_BoxFlag_DrawBackground|UI_BoxFlag_DrawActiveEffects, "line_margin_%I64x", line_num); UI_Parent(line_margin_box) { @@ -10800,7 +10688,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ stop_event.cause == CTRL_EventCause_InterruptedByTrap || stop_event.cause == CTRL_EventCause_InterruptedByException)) { - color = df_rgba_from_theme_color(DF_ThemeColor_FailureBackground); + color = df_rgba_from_theme_color(DF_ThemeColor_ThreadError); } else if(thread->flags & DF_EntityFlag_HasColor) { @@ -10822,7 +10710,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ ui_set_next_font_size(params->font_size); ui_set_next_pref_width(ui_pct(1, 0)); ui_set_next_pref_height(ui_pct(1, 0)); - ui_set_next_text_color(color); + ui_set_next_scheme(ui_fork_top_color_scheme(.text = color)); ui_set_next_text_alignment(UI_TextAlign_Center); UI_Key thread_box_key = ui_key_from_stringf(top_container_box->key, "###ip_%p", thread); UI_Box *thread_box = ui_build_box_from_key(UI_BoxFlag_DisableTextTrunc| @@ -10933,7 +10821,6 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ DF_EntityList line_bps = params->line_bps[line_idx]; DF_EntityList line_pins = params->line_pins[line_idx]; ui_set_next_hover_cursor(OS_Cursor_HandPoint); - ui_set_next_background_color(v4f32(0, 0, 0, 0)); UI_Box *line_margin_box = ui_build_box_from_stringf(UI_BoxFlag_Clickable*!!(params->flags & DF_CodeSliceFlag_Clickable)|UI_BoxFlag_DrawBackground|UI_BoxFlag_DrawActiveEffects, "line_margin_%I64x", line_num); UI_Parent(line_margin_box) { @@ -10965,7 +10852,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ stop_event.cause == CTRL_EventCause_InterruptedByTrap || stop_event.cause == CTRL_EventCause_InterruptedByException)) { - color = df_rgba_from_theme_color(DF_ThemeColor_FailureBackground); + color = df_rgba_from_theme_color(DF_ThemeColor_ThreadError); } else if(thread->flags & DF_EntityFlag_HasColor) { @@ -10987,7 +10874,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ ui_set_next_font_size(params->font_size); ui_set_next_pref_width(ui_pct(1, 0)); ui_set_next_pref_height(ui_pct(1, 0)); - ui_set_next_text_color(color); + ui_set_next_scheme(ui_fork_top_color_scheme(.text = color)); ui_set_next_text_alignment(UI_TextAlign_Center); UI_Key thread_box_key = ui_key_from_stringf(top_container_box->key, "###ip_%p", thread); UI_Box *thread_box = ui_build_box_from_key(UI_BoxFlag_DisableTextTrunc| @@ -11079,7 +10966,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ for(DF_EntityNode *n = line_bps.first; n != 0; n = n->next) { DF_Entity *bp = n->entity; - Vec4F32 bp_color = df_rgba_from_theme_color(DF_ThemeColor_FailureBackground); + Vec4F32 bp_color = df_rgba_from_theme_color(DF_ThemeColor_Breakpoint); if(bp->flags & DF_EntityFlag_HasColor) { bp_color = df_rgba_from_entity(bp); @@ -11110,7 +10997,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ ui_set_next_font(df_font_from_slot(DF_FontSlot_Icons)); ui_set_next_font_size(params->font_size * 1.f); ui_set_next_hover_cursor(OS_Cursor_HandPoint); - ui_set_next_text_color(bp_color); + ui_set_next_scheme(ui_fork_top_color_scheme(.text = bp_color)); ui_set_next_text_alignment(UI_TextAlign_Center); UI_Box *bp_box = ui_build_box_from_stringf(UI_BoxFlag_DrawText| UI_BoxFlag_DrawActiveEffects| @@ -11177,7 +11064,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ ui_set_next_font(df_font_from_slot(DF_FontSlot_Icons)); ui_set_next_font_size(params->font_size * 1.f); ui_set_next_hover_cursor(OS_Cursor_HandPoint); - ui_set_next_text_color(color); + ui_set_next_scheme(ui_fork_top_color_scheme(.text = color)); ui_set_next_text_alignment(UI_TextAlign_Center); UI_Box *pin_box = ui_build_box_from_stringf(UI_BoxFlag_DrawText| UI_BoxFlag_DrawActiveEffects| @@ -11305,19 +11192,10 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ UI_Parent(line_extras_boxes[line_idx]) UI_PrefWidth(ui_children_sum(1)) UI_PrefHeight(ui_px(params->line_height_px, 1.f)) { UI_Box *box = ui_build_box_from_stringf(UI_BoxFlag_DrawBorder, "###exception_info"); - UI_Parent(box) + UI_Parent(box) UI_PrefWidth(ui_text_dim(10, 1)) { - UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_FailureBackground)) - UI_Font(df_font_from_slot(DF_FontSlot_Icons)) - UI_PrefWidth(ui_text_dim(10, 1)) - { - ui_label(df_g_icon_kind_text_table[DF_IconKind_WarningBig]); - } - UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_FailureBackground)) - UI_PrefWidth(ui_text_dim(10, 1)) - { - ui_label(explanation); - } + UI_Font(df_font_from_slot(DF_FontSlot_Icons)) ui_label(df_g_icon_kind_text_table[DF_IconKind_WarningBig]); + ui_label(explanation); } } } @@ -11360,14 +11238,14 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ UI_BoxFlag_DrawBorder, pin_box_key); UI_Parent(pin_box) UI_PrefWidth(ui_text_dim(10, 1)) { - Vec4F32 pin_color = df_rgba_from_theme_color(DF_ThemeColor_WeakText); + Vec4F32 pin_color = df_rgba_from_theme_color(DF_ThemeColor_CodeDefault); if(pin->flags & DF_EntityFlag_HasColor) { pin_color = df_rgba_from_entity(pin); } UI_PrefWidth(ui_em(1.5f, 1.f)) UI_Font(df_font_from_slot(DF_FontSlot_Icons)) - UI_TextColor(pin_color) + UI_Scheme(ui_fork_top_color_scheme(.text = pin_color)) UI_TextAlignment(UI_TextAlign_Center) UI_Flags(UI_BoxFlag_DisableTextTrunc) { @@ -11685,7 +11563,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ { TxtRngColorPairNode *n = push_array(scratch.arena, TxtRngColorPairNode, 1); n->rng = txt_rng(*cursor, *mark); - n->color = ui_top_text_select_color(); + n->color = ui_top_scheme()->colors[DF_ThemeColor_Selection]; SLLQueuePush(first_txt_rng_color_pair, last_txt_rng_color_pair, n); } @@ -11721,8 +11599,8 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ if(params->flags & DF_CodeSliceFlag_LineNums) UI_Parent(text_container_box) ProfScope("build line numbers") UI_Focus(UI_FocusKind_Off) { TxtRng select_rng = txt_rng(*cursor, *mark); - Vec4F32 inactive_color = df_rgba_from_theme_color(DF_ThemeColor_WeakText); - Vec4F32 active_color = df_rgba_from_theme_color(DF_ThemeColor_PlainText); + Vec4F32 active_color = df_rgba_from_theme_color(DF_ThemeColor_CodeLineNumbersActive); + Vec4F32 inactive_color = df_rgba_from_theme_color(DF_ThemeColor_CodeLineNumbersInactive); if(params->margin_float_off_px != 0) { ui_set_next_pref_width(ui_px(params->line_num_width_px, 1.f)); @@ -11792,8 +11670,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ } // rjf: build line num box - ui_set_next_text_color(text_color); - ui_set_next_background_color(bg_color); + ui_set_next_scheme(ui_fork_top_color_scheme(.text = text_color, .background = bg_color)); ui_build_box_from_stringf(UI_BoxFlag_DrawText|(UI_BoxFlag_DrawBackground*!!has_line_info), "%I64u##line_num", line_num); } } @@ -11814,7 +11691,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ UI_Font(params->font) UI_FontSize(params->font_size) UI_CornerRadius(0) - UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_CodeDefault)) + DF_UIColorScheme(DF_UIColorSchemeCode_Code) { U64 line_idx = 0; for(S64 line_num = params->line_num_range.min; @@ -11828,8 +11705,8 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ Vec4F32 line_bg_color = line_bg_colors[line_idx]; if(line_bg_color.w != 0) { - ui_set_next_background_color(line_bg_color); ui_set_next_flags(UI_BoxFlag_DrawBackground); + ui_set_next_scheme(ui_fork_top_color_scheme(.background = line_bg_color)); } UI_Box *line_box = ui_build_box_from_key(UI_BoxFlag_DisableTextTrunc|UI_BoxFlag_DrawText|UI_BoxFlag_DisableIDString, line_key); D_Bucket *line_bucket = d_bucket_make(); @@ -11889,7 +11766,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ if(voff != 0) { mapped_special = 1; - new_color_kind = DF_ThemeColor_CodeFunction; + new_color_kind = DF_ThemeColor_CodeProcedure; mix_t = selected_thread_module->alive_t; } } @@ -12070,8 +11947,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ ui_box_text_position(line_box).x+cursor_off_pixels+cursor_thickness, line_box->rect.y1+params->font_size*0.25f, }; - Vec4F32 color = is_focused ? ui_top_text_cursor_color() : df_rgba_from_theme_color(DF_ThemeColor_FailureBackground); - d_rect(cursor_rect, color, 1.f, 0, 1.f); + d_rect(cursor_rect, ui_top_scheme()->colors[UI_ColorCode_Cursor], 1.f, 0, 1.f); } // rjf: extra rendering for lines with line-info that match the hovered @@ -12521,10 +12397,11 @@ df_error_label(String8 string) { UI_Box *box = ui_build_box_from_stringf(UI_BoxFlag_Clickable, "###%S_error_label", string); UI_Signal sig = ui_signal_from_box(box); - UI_Parent(box) UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_FailureBackground)) + UI_Parent(box) { ui_set_next_font(ui_icon_font()); ui_set_next_text_alignment(UI_TextAlign_Center); + ui_set_next_flags(UI_BoxFlag_DrawTextWeak); UI_PrefWidth(ui_em(2.25f, 1.f)) ui_label(df_g_icon_kind_text_table[DF_IconKind_WarningBig]); UI_PrefWidth(ui_text_dim(10, 0)) ui_label(string); } @@ -12763,7 +12640,6 @@ df_line_edit(DF_LineEditFlags flags, S32 depth, FuzzyMatchRangeList *matches, Tx //- rjf: build expander if(flags & DF_LineEditFlag_Expander) UI_PrefWidth(ui_px(expander_size_px, 1.f)) UI_Parent(box) UI_Flags(UI_BoxFlag_DrawSideLeft) - UI_BorderColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText)) UI_Focus(UI_FocusKind_Off) { UI_Signal expander_sig = ui_expanderf(*expanded_out, "expander"); @@ -12776,9 +12652,8 @@ df_line_edit(DF_LineEditFlags flags, S32 depth, FuzzyMatchRangeList *matches, Tx //- rjf: build expander placeholder else if(flags & DF_LineEditFlag_ExpanderPlaceholder) UI_Parent(box) UI_PrefWidth(ui_px(expander_size_px, 1.f)) UI_Focus(UI_FocusKind_Off) { - UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText)) + UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_Flags(UI_BoxFlag_DrawSideLeft) - UI_BorderColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText)) UI_Font(ui_icon_font()) ui_label(df_g_icon_kind_text_table[DF_IconKind_Dot]); } @@ -12786,9 +12661,7 @@ df_line_edit(DF_LineEditFlags flags, S32 depth, FuzzyMatchRangeList *matches, Tx //- rjf: build expander space else if(flags & DF_LineEditFlag_ExpanderSpace) UI_Parent(box) UI_Focus(UI_FocusKind_Off) { - UI_Flags(UI_BoxFlag_DrawSideLeft) - UI_BorderColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText)) - ui_spacer(ui_px(expander_size_px, 1.f)); + UI_Flags(UI_BoxFlag_DrawSideLeft) ui_spacer(ui_px(expander_size_px, 1.f)); } //- rjf: build scrollable container box @@ -12954,7 +12827,7 @@ df_line_edit(DF_LineEditFlags flags, S32 depth, FuzzyMatchRangeList *matches, Tx if(!(flags & DF_LineEditFlag_PreferDisplayString) && pre_edit_value.size != 0) { display_string = pre_edit_value; - UI_Box *box = df_code_label(1.f, 1, ui_top_text_color(), display_string); + UI_Box *box = df_code_label(1.f, 1, ui_top_scheme()->text, display_string); if(matches != 0) { ui_box_equip_fuzzy_match_ranges(box, matches); @@ -12962,7 +12835,7 @@ df_line_edit(DF_LineEditFlags flags, S32 depth, FuzzyMatchRangeList *matches, Tx } else if(flags & DF_LineEditFlag_DisplayStringIsCode) { - UI_Box *box = df_code_label(1.f, 1, ui_top_text_color(), display_string); + UI_Box *box = df_code_label(1.f, 1, ui_top_scheme()->text, display_string); if(matches != 0) { ui_box_equip_fuzzy_match_ranges(box, matches); @@ -12970,7 +12843,7 @@ df_line_edit(DF_LineEditFlags flags, S32 depth, FuzzyMatchRangeList *matches, Tx } else { - ui_set_next_text_color(df_rgba_from_theme_color(DF_ThemeColor_WeakText)); + ui_set_next_flags(UI_BoxFlag_DrawTextWeak); UI_Box *box = ui_label(display_string).box; if(matches != 0) { @@ -12987,7 +12860,7 @@ df_line_edit(DF_LineEditFlags flags, S32 depth, FuzzyMatchRangeList *matches, Tx } else { - ui_set_next_text_color(df_rgba_from_theme_color(DF_ThemeColor_WeakText)); + ui_set_next_flags(UI_BoxFlag_DrawTextWeak); } UI_Box *box = ui_label(display_string).box; if(matches != 0) @@ -13003,7 +12876,7 @@ df_line_edit(DF_LineEditFlags flags, S32 depth, FuzzyMatchRangeList *matches, Tx F32 total_editstr_width = total_text_width - !!(flags & (DF_LineEditFlag_Expander|DF_LineEditFlag_ExpanderSpace|DF_LineEditFlag_ExpanderPlaceholder)) * expander_size_px; ui_set_next_pref_width(ui_px(total_editstr_width+ui_top_font_size()*2, 0.f)); UI_Box *editstr_box = ui_build_box_from_stringf(UI_BoxFlag_DrawText|UI_BoxFlag_DisableTextTrunc, "###editstr"); - D_FancyStringList code_fancy_strings = df_fancy_string_list_from_code_string(scratch.arena, 1.f, 0, ui_top_text_color(), edit_string); + D_FancyStringList code_fancy_strings = df_fancy_string_list_from_code_string(scratch.arena, 1.f, 0, ui_top_scheme()->text, edit_string); if(autocomplete_hint_string.size != 0) { String8 query_word = df_autocomp_query_word_from_input_string_off(edit_string, cursor->column-1); @@ -13025,7 +12898,7 @@ df_line_edit(DF_LineEditFlags flags, S32 depth, FuzzyMatchRangeList *matches, Tx D_FancyString *fstr = &autocomp_fstr_n->v; fstr->font = ui_top_font(); fstr->string = autocomplete_append_string; - fstr->color = ui_top_text_color(); + fstr->color = ui_top_scheme()->text; fstr->color.w *= 0.5f; fstr->size = ui_top_font_size(); autocomp_fstr_n->next = prev_n ? prev_n->next : 0; @@ -13073,8 +12946,6 @@ df_line_edit(DF_LineEditFlags flags, S32 depth, FuzzyMatchRangeList *matches, Tx draw_data->edited_string = push_str8_copy(ui_build_arena(), edit_string); draw_data->cursor = *cursor; draw_data->mark = *mark; - draw_data->cursor_color = is_focus_active ? ui_top_text_cursor_color() : df_rgba_from_theme_color(DF_ThemeColor_FailureBackground); - draw_data->select_color = ui_top_text_select_color(); 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())); cursor_off = f_dim_from_tag_size_string(ui_top_font(), ui_top_font_size(), 0, ui_top_tab_size(), str8_prefix(edit_string, cursor->column-1)).x; @@ -13091,8 +12962,6 @@ df_line_edit(DF_LineEditFlags flags, S32 depth, FuzzyMatchRangeList *matches, Tx draw_data->edited_string = push_str8_copy(ui_build_arena(), edit_string); draw_data->cursor = *cursor; draw_data->mark = *mark; - draw_data->cursor_color = is_focus_active ? ui_top_text_cursor_color() : df_rgba_from_theme_color(DF_ThemeColor_FailureBackground); - 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())); @@ -13938,45 +13807,9 @@ df_gfx_begin_frame(Arena *arena, DF_CmdList *cmds) } } - //- rjf: apply theme colors - B8 theme_color_hit[DF_ThemeColor_COUNT] = {0}; + //- rjf: reset theme to default MemoryCopy(df_gfx_state->cfg_theme_target.colors, df_g_theme_preset_colors__default_dark, sizeof(df_g_theme_preset_colors__default_dark)); MemoryCopy(df_gfx_state->cfg_theme.colors, df_g_theme_preset_colors__default_dark, sizeof(df_g_theme_preset_colors__default_dark)); - DF_CfgVal *colors = df_cfg_val_from_string(table, str8_lit("colors")); - for(DF_CfgNode *colors_set = colors->first; - colors_set != &df_g_nil_cfg_node; - colors_set = colors_set->next) - { - for(DF_CfgNode *color = colors_set->first; - color != &df_g_nil_cfg_node; - color = color->next) - { - String8 color_name = color->string; - DF_ThemeColor color_code = DF_ThemeColor_Null; - for(DF_ThemeColor c = DF_ThemeColor_Null; c < DF_ThemeColor_COUNT; c = (DF_ThemeColor)(c+1)) - { - if(str8_match(df_g_theme_color_cfg_string_table[c], color_name, StringMatchFlag_CaseInsensitive)) - { - color_code = c; - break; - } - } - if(color_code != DF_ThemeColor_Null) - { - theme_color_hit[color_code] = 1; - DF_CfgNode *hex_cfg = color->first; - String8 hex_string = hex_cfg->string; - U64 hex_val = 0; - try_u64_from_str8_c_rules(hex_string, &hex_val); - Vec4F32 color_rgba = rgba_from_u32((U32)hex_val); - df_gfx_state->cfg_theme_target.colors[color_code] = color_rgba; - if(df_frame_index() <= 2) - { - df_gfx_state->cfg_theme.colors[color_code] = color_rgba; - } - } - } - } //- rjf: apply theme presets DF_CfgVal *color_preset = df_cfg_val_from_string(table, str8_lit("color_preset")); @@ -14003,6 +13836,57 @@ df_gfx_begin_frame(Arena *arena, DF_CmdList *cmds) } } + //- rjf: apply individual theme colors + B8 theme_color_hit[DF_ThemeColor_COUNT] = {0}; + DF_CfgVal *colors = df_cfg_val_from_string(table, str8_lit("colors")); + for(DF_CfgNode *colors_set = colors->first; + colors_set != &df_g_nil_cfg_node; + colors_set = colors_set->next) + { + for(DF_CfgNode *color = colors_set->first; + color != &df_g_nil_cfg_node; + color = color->next) + { + String8 saved_color_name = color->string; + String8List candidate_color_names = {0}; + str8_list_push(scratch.arena, &candidate_color_names, saved_color_name); + for(U64 idx = 0; idx < ArrayCount(df_g_theme_color_version_remap_old_name_table); idx += 1) + { + if(str8_match(df_g_theme_color_version_remap_old_name_table[idx], saved_color_name, StringMatchFlag_CaseInsensitive)) + { + str8_list_push(scratch.arena, &candidate_color_names, df_g_theme_color_version_remap_new_name_table[idx]); + } + } + for(String8Node *name_n = candidate_color_names.first; name_n != 0; name_n = name_n->next) + { + String8 name = name_n->string; + DF_ThemeColor color_code = DF_ThemeColor_Null; + for(DF_ThemeColor c = DF_ThemeColor_Null; c < DF_ThemeColor_COUNT; c = (DF_ThemeColor)(c+1)) + { + if(str8_match(df_g_theme_color_cfg_string_table[c], name, StringMatchFlag_CaseInsensitive)) + { + color_code = c; + break; + } + } + if(color_code != DF_ThemeColor_Null) + { + theme_color_hit[color_code] = 1; + DF_CfgNode *hex_cfg = color->first; + String8 hex_string = hex_cfg->string; + U64 hex_val = 0; + try_u64_from_str8_c_rules(hex_string, &hex_val); + Vec4F32 color_rgba = rgba_from_u32((U32)hex_val); + df_gfx_state->cfg_theme_target.colors[color_code] = color_rgba; + if(df_frame_index() <= 2) + { + df_gfx_state->cfg_theme.colors[color_code] = color_rgba; + } + } + } + } + } + //- rjf: no preset -> autofill all missing colors from the preset with the most similar background if(!preset_applied) { @@ -14010,8 +13894,8 @@ df_gfx_begin_frame(Arena *arena, DF_CmdList *cmds) F32 closest_preset_bg_distance = 100000000; for(DF_ThemePreset p = (DF_ThemePreset)0; p < DF_ThemePreset_COUNT; p = (DF_ThemePreset)(p+1)) { - Vec4F32 cfg_bg = df_gfx_state->cfg_theme_target.colors[DF_ThemeColor_PlainBackground]; - Vec4F32 pre_bg = df_g_theme_preset_colors_table[p][DF_ThemeColor_PlainBackground]; + Vec4F32 cfg_bg = df_gfx_state->cfg_theme_target.colors[DF_ThemeColor_DefaultBackground]; + Vec4F32 pre_bg = df_g_theme_preset_colors_table[p][DF_ThemeColor_DefaultBackground]; Vec4F32 diff = sub_4f32(cfg_bg, pre_bg); Vec3F32 diff3 = diff.xyz; F32 distance = length_3f32(diff3); @@ -14179,6 +14063,65 @@ df_gfx_begin_frame(Arena *arena, DF_CmdList *cmds) } } + //- rjf: compute ui color schemes from theme + { + DF_Theme *current = &df_gfx_state->cfg_theme; + for(EachEnumVal(DF_UIColorSchemeCode, code)) + { + df_gfx_state->cfg_ui_color_schemes[code].null = v4f32(1, 0, 1, 1); + df_gfx_state->cfg_ui_color_schemes[code].cursor = current->colors[DF_ThemeColor_CursorActive]; + df_gfx_state->cfg_ui_color_schemes[code].selection = current->colors[DF_ThemeColor_Selection]; + } + df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_Default].background = current->colors[DF_ThemeColor_DefaultBackground]; + df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_Default].text = current->colors[DF_ThemeColor_DefaultText]; + df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_Default].text_weak = current->colors[DF_ThemeColor_DefaultTextWeak]; + df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_Default].border = current->colors[DF_ThemeColor_DefaultBorder]; + df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_DefaultPositive].background = current->colors[DF_ThemeColor_DefaultBackground]; + df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_DefaultPositive].text = current->colors[DF_ThemeColor_DefaultTextPositive]; + df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_DefaultPositive].text_weak = current->colors[DF_ThemeColor_DefaultTextWeak]; + df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_DefaultPositive].border = current->colors[DF_ThemeColor_DefaultBorder]; + df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_DefaultNegative].background = current->colors[DF_ThemeColor_DefaultBackground]; + df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_DefaultNegative].text = current->colors[DF_ThemeColor_DefaultTextNegative]; + df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_DefaultNegative].text_weak = current->colors[DF_ThemeColor_DefaultTextWeak]; + df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_DefaultNegative].border = current->colors[DF_ThemeColor_DefaultBorder]; + df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_Floating].background = current->colors[DF_ThemeColor_FloatingBackground]; + df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_Floating].text = current->colors[DF_ThemeColor_FloatingText]; + df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_Floating].text_weak = current->colors[DF_ThemeColor_FloatingTextWeak]; + df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_Floating].border = current->colors[DF_ThemeColor_FloatingBorder]; + df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_SpecialPositive].background = current->colors[DF_ThemeColor_SpecialPositiveBackground]; + df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_SpecialPositive].text = current->colors[DF_ThemeColor_SpecialPositiveText]; + df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_SpecialPositive].text_weak = current->colors[DF_ThemeColor_SpecialPositiveTextWeak]; + df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_SpecialPositive].border = current->colors[DF_ThemeColor_SpecialPositiveBorder]; + df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_SpecialNegative].background = current->colors[DF_ThemeColor_SpecialNegativeBackground]; + df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_SpecialNegative].text = current->colors[DF_ThemeColor_SpecialNegativeText]; + df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_SpecialNegative].text_weak = current->colors[DF_ThemeColor_SpecialNegativeTextWeak]; + df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_SpecialNegative].border = current->colors[DF_ThemeColor_SpecialNegativeBorder]; + df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_SpecialNeutral].background = current->colors[DF_ThemeColor_SpecialNeutralBackground]; + df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_SpecialNeutral].text = current->colors[DF_ThemeColor_SpecialNeutralText]; + df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_SpecialNeutral].text_weak = current->colors[DF_ThemeColor_SpecialNeutralTextWeak]; + df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_SpecialNeutral].border = current->colors[DF_ThemeColor_SpecialNeutralBorder]; + df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_MenuBar].background = current->colors[DF_ThemeColor_MenuBarBackground]; + df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_MenuBar].text = current->colors[DF_ThemeColor_MenuBarText]; + df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_MenuBar].text_weak = current->colors[DF_ThemeColor_MenuBarTextWeak]; + df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_MenuBar].border = current->colors[DF_ThemeColor_MenuBarBorder]; + df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_TabActive].background = current->colors[DF_ThemeColor_TabActiveBackground]; + df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_TabActive].text = current->colors[DF_ThemeColor_TabActiveText]; + df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_TabActive].text_weak = current->colors[DF_ThemeColor_TabActiveTextWeak]; + df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_TabActive].border = current->colors[DF_ThemeColor_TabActiveBorder]; + df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_TabInactive].background = current->colors[DF_ThemeColor_TabInactiveBackground]; + df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_TabInactive].text = current->colors[DF_ThemeColor_TabInactiveText]; + df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_TabInactive].text_weak = current->colors[DF_ThemeColor_TabInactiveTextWeak]; + df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_TabInactive].border = current->colors[DF_ThemeColor_TabInactiveBorder]; + df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_Code].background = current->colors[DF_ThemeColor_CodeBackground]; + df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_Code].text = current->colors[DF_ThemeColor_CodeDefault]; + df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_Code].text_weak = current->colors[DF_ThemeColor_CodeDefault]; + df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_Code].border = current->colors[DF_ThemeColor_DefaultBorder]; + df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_DropSite].background = current->colors[DF_ThemeColor_DropSiteOverlay]; + df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_DropSite].text = current->colors[DF_ThemeColor_DropSiteOverlay]; + df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_DropSite].text_weak = current->colors[DF_ThemeColor_DropSiteOverlay]; + df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_DropSite].border = current->colors[DF_ThemeColor_DropSiteOverlay]; + } + //- rjf: animate alive-transitions for entities { F32 rate = 1.f - pow_f32(2.f, -20.f*df_dt()); diff --git a/src/df/gfx/df_gfx.h b/src/df/gfx/df_gfx.h index 24f3b5b0..3431dde2 100644 --- a/src/df/gfx/df_gfx.h +++ b/src/df/gfx/df_gfx.h @@ -187,9 +187,6 @@ 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; @@ -377,6 +374,24 @@ typedef enum DF_FontSlot } DF_FontSlot; +typedef enum DF_UIColorSchemeCode +{ + DF_UIColorSchemeCode_Default, + DF_UIColorSchemeCode_DefaultPositive, + DF_UIColorSchemeCode_DefaultNegative, + DF_UIColorSchemeCode_Floating, + DF_UIColorSchemeCode_SpecialPositive, + DF_UIColorSchemeCode_SpecialNegative, + DF_UIColorSchemeCode_SpecialNeutral, + DF_UIColorSchemeCode_MenuBar, + DF_UIColorSchemeCode_TabActive, + DF_UIColorSchemeCode_TabInactive, + DF_UIColorSchemeCode_Code, + DF_UIColorSchemeCode_DropSite, + DF_UIColorSchemeCode_COUNT +} +DF_UIColorSchemeCode; + //////////////////////////////// //~ rjf: UI Helper & Widget Types @@ -746,6 +761,7 @@ struct DF_GfxState String8 cfg_main_font_path; String8 cfg_code_font_path; F_Tag cfg_font_tags[DF_FontSlot_COUNT]; + UI_ColorScheme cfg_ui_color_schemes[DF_UIColorSchemeCode_COUNT]; // rjf: icon texture R_Handle icon_texture; @@ -784,7 +800,6 @@ read_only global DF_View df_g_nil_view = 0, 0, 0, - 0, {0}, {0}, 0, @@ -992,6 +1007,9 @@ 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 -> ui color scheme +internal UI_ColorScheme *df_ui_color_scheme_from_code(DF_UIColorSchemeCode 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); @@ -1005,6 +1023,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_UIColorScheme(code) UI_Scheme(df_ui_color_scheme_from_code(code)) + //////////////////////////////// //~ rjf: UI Widgets: Fancy Buttons diff --git a/src/df/gfx/df_gfx.mdesk b/src/df/gfx/df_gfx.mdesk index 9f3cdfa3..415f59ca 100644 --- a/src/df/gfx/df_gfx.mdesk +++ b/src/df/gfx/df_gfx.mdesk @@ -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 @@ -228,6 +243,25 @@ DF_GfxViewTable: { 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." } } +@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))}```; +} + //////////////////////////////// //~ rjf: Command Parameter Slot -> View @@ -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 // @@ -267,80 +316,42 @@ DF_GfxViewRuleTable: {"geo" - - x x x "Geometry" } } +@gen +{ + ``; + @expand(DF_GfxViewRuleTable a) + `$(a.vr == "x" -> "DF_GFX_VIEW_RULE_VIZ_ROW_PROD_FUNCTION_DEF(" .. a.name_lower .. ");")`; + @expand(DF_GfxViewRuleTable a) + `$(a.ls == "x" -> "DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_DEF(" .. a.name_lower .. ");")`; + @expand(DF_GfxViewRuleTable a) + `$(a.ru == "x" -> "DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_DEF(" .. a.name_lower .. ");")`; + @expand(DF_GfxViewRuleTable a) + `$(a.bu == "x" -> "DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(" .. a.name_lower .. ");")`; + @expand(DF_GfxViewRuleTable a) + `$(a.tu == "x" -> "DF_VIEW_SETUP_FUNCTION_DEF(" .. a.name_lower .. ");")`; + @expand(DF_GfxViewRuleTable a) + `$(a.tu == "x" -> "DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(" .. a.name_lower .. ");")`; + @expand(DF_GfxViewRuleTable a) + `$(a.tu == "x" -> "DF_VIEW_CMD_FUNCTION_DEF(" .. a.name_lower .. ");")`; + @expand(DF_GfxViewRuleTable a) + `$(a.tu == "x" -> "DF_VIEW_UI_FUNCTION_DEF(" .. a.name_lower .. ");")`; +} + +@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: +{ + @expand(DF_GfxViewRuleTable a) + ```{ 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')") }```; +} + //////////////////////////////// //~ 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: { @@ -355,6 +366,199 @@ DF_ThemePresetTable: { FarManager far_manager "Far Manager" } } +@table(name display_name name_lower default_dark default_light vs_dark vs_light solarized_dark solarized_light handmade_hero four_coder far_manager) +DF_ThemeColorTable: +{ + {Null "Null" null 0xff00ffff 0xff00ffff 0xff00ffff 0xff00ffff 0xff00ffff 0xff00ffff 0xff00ffff 0xff00ffff 0xff00ffff } + + //- rjf: global ui colors + {Selection "Selection" selection 0x99ccff4c 0x99ccff4c 0x99ccff4c 0x99ccff4c 0x99ccff4c 0x99ccff4c 0x99ccff4c 0x99ccff4c 0x99ccff4c } + {DropShadow "Drop Shadow" drop_shadow 0x0000007f 0x0000007f 0x0000007f 0x0000007f 0x0000007f 0x0000007f 0x0000007f 0x0000007f 0x0000007f } + {CursorActive "Cursor" cursor_active 0x66e566e5 0x66e566e5 0x66e566e5 0x66e566e5 0x66e566e5 0x66e566e5 0x66e566e5 0x66e566e5 0x66e566e5 } + {CursorInactive "Cursor (Inactive)" cursor_inactive 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff } + {FocusActive "Focus" focus_active 0xb27219ff 0xb27219ff 0xb27219ff 0xb27219ff 0xb27219ff 0xb27219ff 0xb27219ff 0xb27219ff 0xb27219ff } + {FocusInactive "Focus (Inactive)" focus_inactive 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff } + {Highlight0 "Highlight 0" highlight_0 0xb27219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff } + {Highlight1 "Highlight 1" highlight_1 0xb27219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff } + {DisabledOverlay "Disabled Overlay" disabled_overlay 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f } + + //- rjf: default ui colors + {DefaultText "Default Text" default_text 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff } + {DefaultTextPositive "Default Text (Positive)" default_text_positive 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff } + {DefaultTextNegative "Default Text (Negative)" default_text_negative 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff } + {DefaultTextWeak "Default Text (Weak)" default_text_weak 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f } + {DefaultBackground "Default Background" default_background 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f } + {DefaultBorder "Default Border" default_border 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 } + + //- rjf: floating ui colors + {FloatingText "Floating Text" floating_text 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff } + {FloatingTextPositive "Floating Text (Positive)" floating_text_positive 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff } + {FloatingTextNegative "Floating Text (Negative)" floating_text_negative 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff } + {FloatingTextWeak "Floating Text (Weak)" floating_text_weak 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f } + {FloatingBackground "Floating Background" floating_background 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f } + {FloatingBorder "Floating Border" floating_border 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 } + + //- rjf: special button colors + {SpecialPositiveText "Special Positive Text" special_positive_text 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff } + {SpecialPositiveTextWeak "Special Positive Text (Weak)" special_positive_text_weak 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f } + {SpecialPositiveBackground "Special Positive Background" special_positive_background 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff } + {SpecialPositiveBorder "Special Positive Border" special_positive_border 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 } + {SpecialNegativeText "Special Negative Text" special_negative_text 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff } + {SpecialNegativeTextWeak "Special Negative Text (Weak)" special_negative_text_weak 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f } + {SpecialNegativeBackground "Special Negative Background" special_negative_background 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff } + {SpecialNegativeBorder "Special Negative Border" special_negative_border 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 } + {SpecialNeutralText "Special Neutral Text" special_neutral_text 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff } + {SpecialNeutralTextWeak "Special Neutral Text (Weak)" special_neutral_text_weak 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f } + {SpecialNeutralBackground "Special Neutral Background" special_neutral_background 0x327fb2ff 0x327fb2ff 0x327fb2ff 0x327fb2ff 0x327fb2ff 0x327fb2ff 0x327fb2ff 0x327fb2ff 0x327fb2ff } + {SpecialNeutralBorder "Special Neutral Border" special_neutral_border 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 } + + //- rjf: menu bar colors + {MenuBarText "Menu Bar Text" menu_bar_text 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff } + {MenuBarTextWeak "Menu Bar Text (Weak)" menu_bar_text_weak 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f } + {MenuBarTextPositive "Menu Bar Text (Positive)" menu_bar_text_positive 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff } + {MenuBarTextNegative "Menu Bar Text (Negative)" menu_bar_text_negative 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff } + {MenuBarBackground "Menu Bar Background" menu_bar_background 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f } + {MenuBarBorder "Menu Bar Border" menu_bar_border 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 } + + //- rjf: tab colors + {TabActiveText "Tab Text" tab_active_text 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff } + {TabActiveTextWeak "Tab Text (Weak)" tab_active_text_weak 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f } + {TabActiveBackground "Tab Background" tab_active_background 0xa87a4c99 0xa87a4c99 0xa87a4c99 0xa87a4c99 0xa87a4c99 0xa87a4c99 0xa87a4c99 0xa87a4c99 0xa87a4c99 } + {TabActiveBorder "Tab Border" tab_active_border 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 } + {TabInactiveText "Tab Text (Inactive)" tab_inactive_text 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff } + {TabInactiveTextWeak "Tab Text (Inactive, Weak)" tab_inactive_text_weak 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f } + {TabInactiveBackground "Tab Background (Inactive)" tab_inactive_background 0x42474c7f 0x42474c7f 0x42474c7f 0x42474c7f 0x42474c7f 0x42474c7f 0x42474c7f 0x42474c7f 0x42474c7f } + {TabInactiveBorder "Tab Border (Inactive)" tab_inactive_border 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 } + + //- rjf: code ui colors + {CodeBackground "Code Background" code_background 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f } + {CodeBackgroundNegative "Code Background (Negative)" code_background_negative 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f } + {CodeLineNumbersActive "Code Line Numbers" code_line_numbers_active 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff } + {CodeLineNumbersInactive "Code Line Numbers (Inactive)" code_line_numbers_inactive 0xa5a5a5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff } + + //- rjf: code text colors + {CodeDefault "Code (Default)" code_default 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff } + {CodeProcedure "Code (Procedure)" code_procedure 0x7fcc99ff 0x7fcc99ff 0x7fcc99ff 0x7fcc99ff 0x7fcc99ff 0x7fcc99ff 0x7fcc99ff 0x7fcc99ff 0x7fcc99ff } + {CodeType "Code (Type)" code_type 0x66b2e5ff 0x66b2e5ff 0x66b2e5ff 0x66b2e5ff 0x66b2e5ff 0x66b2e5ff 0x66b2e5ff 0x66b2e5ff 0x66b2e5ff } + {CodeLocal "Code (Local)" code_local 0xfe9548ff 0xfe9548ff 0xfe9548ff 0xfe9548ff 0xfe9548ff 0xfe9548ff 0xfe9548ff 0xfe9548ff 0xfe9548ff } + {CodeRegister "Code (Register)" code_register 0xd45d90ff 0xd45d90ff 0xd45d90ff 0xd45d90ff 0xd45d90ff 0xd45d90ff 0xd45d90ff 0xd45d90ff 0xd45d90ff } + {CodeKeyword "Code (Keyword)" code_keyword 0xf7bf5eff 0xf7bf5eff 0xf7bf5eff 0xf7bf5eff 0xf7bf5eff 0xf7bf5eff 0xf7bf5eff 0xf7bf5eff 0xf7bf5eff } + {CodeDelimiterOperator "Code (Delimiters/Operators)" code_delimiter_operator 0x994c32ff 0x994c32ff 0x994c32ff 0x994c32ff 0x994c32ff 0x994c32ff 0x994c32ff 0x994c32ff 0x994c32ff } + {CodeNumeric "Code (Numeric)" code_numeric 0x4ce54cff 0x4ce54cff 0x4ce54cff 0x4ce54cff 0x4ce54cff 0x4ce54cff 0x4ce54cff 0x4ce54cff 0x4ce54cff } + {CodeNumericAltDigitGroup "Code (Numeric, Alt. Digit Group)" code_numeric_alt_digit_group 0x4ca54cff 0x4ca54cff 0x4ca54cff 0x4ca54cff 0x4ca54cff 0x4ca54cff 0x4ca54cff 0x4ca54cff 0x4ca54cff } + {CodeString "Code (String)" code_string 0xe5cc66ff 0xe5cc66ff 0xe5cc66ff 0xe5cc66ff 0xe5cc66ff 0xe5cc66ff 0xe5cc66ff 0xe5cc66ff 0xe5cc66ff } + {CodeMeta "Code (Meta)" code_meta 0xe54c4cff 0xe54c4cff 0xe54c4cff 0xe54c4cff 0xe54c4cff 0xe54c4cff 0xe54c4cff 0xe54c4cff 0xe54c4cff } + {CodeComment "Code (Comment)" code_comment 0x7f7f7fff 0x7f7f7fff 0x7f7f7fff 0x7f7f7fff 0x7f7f7fff 0x7f7f7fff 0x7f7f7fff 0x7f7f7fff 0x7f7f7fff } + + //- 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 0x99503d3f 0x99503d3f 0x99503d3f 0x99503d3f 0x99503d3f 0x99503d3f 0x99503d3f 0x99503d3f 0x99503d3f } + {Thread0 "Thread 0" thread_0 0xffcb7fff 0xffcb7fff 0xffcb7fff 0xffcb7fff 0xffcb7fff 0xffcb7fff 0xffcb7fff 0xffcb7fff 0xffcb7fff } + {Thread1 "Thread 1" thread_1 0xb2ff65ff 0xb2ff65ff 0xb2ff65ff 0xb2ff65ff 0xb2ff65ff 0xb2ff65ff 0xb2ff65ff 0xb2ff65ff 0xb2ff65ff } + {Thread2 "Thread 2" thread_2 0xff99e5ff 0xff99e5ff 0xff99e5ff 0xff99e5ff 0xff99e5ff 0xff99e5ff 0xff99e5ff 0xff99e5ff 0xff99e5ff } + {Thread3 "Thread 3" thread_3 0x6598ffff 0x6598ffff 0x6598ffff 0x6598ffff 0x6598ffff 0x6598ffff 0x6598ffff 0x6598ffff 0x6598ffff } + {Thread4 "Thread 4" thread_4 0x65ffcbff 0x65ffcbff 0x65ffcbff 0x65ffcbff 0x65ffcbff 0x65ffcbff 0x65ffcbff 0x65ffcbff 0x65ffcbff } + {Thread5 "Thread 5" thread_5 0xff9819ff 0xff9819ff 0xff9819ff 0xff9819ff 0xff9819ff 0xff9819ff 0xff9819ff 0xff9819ff 0xff9819ff } + {Thread6 "Thread 6" thread_6 0x9932ffff 0x9932ffff 0x9932ffff 0x9932ffff 0x9932ffff 0x9932ffff 0x9932ffff 0x9932ffff 0x9932ffff } + {Thread7 "Thread 7" thread_7 0x65ff4cff 0x65ff4cff 0x65ff4cff 0x65ff4cff 0x65ff4cff 0x65ff4cff 0x65ff4cff 0x65ff4cff 0x65ff4cff } + {ThreadUnwound "Thread (Unwound)" thread_unwound 0xb2ccd8ff 0xb2ccd8ff 0xb2ccd8ff 0xb2ccd8ff 0xb2ccd8ff 0xb2ccd8ff 0xb2ccd8ff 0xb2ccd8ff 0xb2ccd8ff } + {ThreadError "Thread (Error)" thread_error 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff } + {Breakpoint "Breakpoint" breakpoint 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff } + + //- rjf: behavioral colors + {DropSiteOverlay "Drop Site Overlay" drop_site_overlay 0xffffff0c 0xffffff0c 0xffffff0c 0xffffff0c 0xffffff0c 0xffffff0c 0xffffff0c 0xffffff0c 0xffffff0c } + {InactivePanelOverlay "Inactive Panel Overlay" inactive_panel_overlay 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f } +} + +@table(old_name new_name) +DF_ThemeColorVersionRemapTable: +{ + {plain_text default_text} + {plain_background default_background} + {plain_border default_border} + {plain_overlay drop_site_overlay} + {code_function code_procedure} + {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_text menu_bar_text} + {alt_background menu_bar_background} + {alt_border menu_bar_border} + {alt_overlay drop_site_overlay} + {tab_inactive tab_inactive_background} + {tab_active tab_active_background} + {weak_text default_text_weak} + {text_selection selection} + {cursor cursor_active} + {highlight_0 focus_active} + {success_text special_positive_text} + {success_background special_positive_background} + {success_border special_positive_border} + {failure_text special_negative_text} + {failure_background special_negative_background} + {failure_border special_negative_border} + {action_text special_neutral_text} + {action_background special_neutral_background} + {action_border special_neutral_border} +} + +@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)`, +} + + +// TODO(rjf): OLD vvvvvvvvv @table(name default_dark default_light vs_dark vs_light solarized_dark solarized_light handmade_hero four_coder far_manager) DF_ThemePresetColorTable: { @@ -417,178 +621,6 @@ DF_ThemePresetColorTable: //////////////////////////////// //~ 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 -{ - ``; - @expand(DF_GfxViewRuleTable a) - `$(a.vr == "x" -> "DF_GFX_VIEW_RULE_VIZ_ROW_PROD_FUNCTION_DEF(" .. a.name_lower .. ");")`; - @expand(DF_GfxViewRuleTable a) - `$(a.ls == "x" -> "DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_DEF(" .. a.name_lower .. ");")`; - @expand(DF_GfxViewRuleTable a) - `$(a.ru == "x" -> "DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_DEF(" .. a.name_lower .. ");")`; - @expand(DF_GfxViewRuleTable a) - `$(a.bu == "x" -> "DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(" .. a.name_lower .. ");")`; - @expand(DF_GfxViewRuleTable a) - `$(a.tu == "x" -> "DF_VIEW_SETUP_FUNCTION_DEF(" .. a.name_lower .. ");")`; - @expand(DF_GfxViewRuleTable a) - `$(a.tu == "x" -> "DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(" .. a.name_lower .. ");")`; - @expand(DF_GfxViewRuleTable a) - `$(a.tu == "x" -> "DF_VIEW_CMD_FUNCTION_DEF(" .. a.name_lower .. ");")`; - @expand(DF_GfxViewRuleTable a) - `$(a.tu == "x" -> "DF_VIEW_UI_FUNCTION_DEF(" .. a.name_lower .. ");")`; -} - -//- rjf: gfx view rule tables - -@data(DF_GfxViewRuleSpecInfo) @c_file df_g_gfx_view_rule_spec_info_table: -{ - @expand(DF_GfxViewRuleTable a) - ```{ 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: -{ - @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 .. ') }')```; -} - -//- rjf: default view spec info table - -@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))}```; -} - //- rjf: theme color tables @data(String8) df_g_theme_color_display_string_table: diff --git a/src/df/gfx/df_view_rules.c b/src/df/gfx/df_view_rules.c index 13472ff5..03a584d8 100644 --- a/src/df/gfx/df_view_rules.c +++ b/src/df/gfx/df_view_rules.c @@ -340,13 +340,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_scheme()->text, ui_top_font_size(), 0, 0}; + D_FancyString comma = {ui_top_font(), str8_lit(", "), ui_top_scheme()->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_scheme()->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); @@ -367,7 +367,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_Scheme(ui_fork_top_color_scheme(.background = rgba)) UI_CornerRadius(ui_top_font_size()*0.5f) ui_build_box_from_key(UI_BoxFlag_DrawBackground|UI_BoxFlag_DrawBorder, ui_key_zero()); } } @@ -425,7 +425,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"); @@ -872,7 +872,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->scheme->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) { @@ -893,8 +893,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, @@ -921,7 +920,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); } @@ -1047,7 +1046,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_DefaultTextWeak); for(EachEnumVal(Axis2, axis)) { for(F32 v = rect_cvs.p0.v[axis] - mod_f32(rect_cvs.p0.v[axis], grid_cell_size_cvs); @@ -1279,7 +1278,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; @@ -1327,7 +1325,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); } diff --git a/src/df/gfx/df_views.c b/src/df/gfx/df_views.c index 94e318e3..0d41972b 100644 --- a/src/df/gfx/df_views.c +++ b/src/df/gfx/df_views.c @@ -1545,8 +1545,10 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS UI_Focus(UI_FocusKind_Null) UI_TableF(ArrayCount(col_pcts), col_pcts, "table_header") { + //////////////////////////// //- rjf: build table header - if(visible_row_rng.min == 0) UI_TableVector UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText)) + // + if(visible_row_rng.min == 0) UI_TableVector UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) { UI_TableCell ui_label(str8_lit("Expression")); UI_TableCell ui_label(str8_lit("Value")); @@ -1556,57 +1558,63 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS F32 max_width = ui_top_font_size()*35; ui_label_multiline(max_width, str8_lit("View rules are used to tweak the way evaluated expressions are visualized. Multiple rules can be specified on each row. They are specified in a key:(value) form. Some examples follow:")); ui_spacer(ui_em(1.5f, 1)); - UI_Font(df_font_from_slot(DF_FontSlot_Code)) UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_PlainText)) ui_labelf("array:(N)"); - ui_label_multiline(max_width, str8_lit("Specifies that a pointer points to N elements, rather than only 1.")); + UI_Font(df_font_from_slot(DF_FontSlot_Code)) ui_labelf("array:(N)"); + UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_label_multiline(max_width, str8_lit("Specifies that a pointer points to N elements, rather than only 1.")); ui_spacer(ui_em(1.5f, 1)); - UI_Font(df_font_from_slot(DF_FontSlot_Code)) UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_PlainText)) ui_labelf("omit:(member_1 ... member_n)"); - ui_label_multiline(max_width, str8_lit("Omits a list of member names from appearing in struct, union, or class evaluations.")); + UI_Font(df_font_from_slot(DF_FontSlot_Code)) ui_labelf("omit:(member_1 ... member_n)"); + UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_label_multiline(max_width, str8_lit("Omits a list of member names from appearing in struct, union, or class evaluations.")); ui_spacer(ui_em(1.5f, 1)); - UI_Font(df_font_from_slot(DF_FontSlot_Code)) UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_PlainText)) ui_labelf("only:(member_1 ... member_n)"); - ui_label_multiline(max_width, str8_lit("Specifies that only the specified members should appear in struct, union, or class evaluations.")); + UI_Font(df_font_from_slot(DF_FontSlot_Code)) ui_labelf("only:(member_1 ... member_n)"); + UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_label_multiline(max_width, str8_lit("Specifies that only the specified members should appear in struct, union, or class evaluations.")); ui_spacer(ui_em(1.5f, 1)); - UI_Font(df_font_from_slot(DF_FontSlot_Code)) UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_PlainText)) ui_labelf("list:(next_link_member_name)"); - ui_label_multiline(max_width, str8_lit("Specifies that some struct, union, or class forms the top of a linked list, with next_link_member_name being the member which points at the next element in the list.")); + UI_Font(df_font_from_slot(DF_FontSlot_Code)) ui_labelf("list:(next_link_member_name)"); + UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_label_multiline(max_width, str8_lit("Specifies that some struct, union, or class forms the top of a linked list, with next_link_member_name being the member which points at the next element in the list.")); ui_spacer(ui_em(1.5f, 1)); - UI_Font(df_font_from_slot(DF_FontSlot_Code)) UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_PlainText)) ui_labelf("dec"); - ui_label_multiline(max_width, str8_lit("Specifies that all integral evaluations should appear in base-10 form.")); + UI_Font(df_font_from_slot(DF_FontSlot_Code)) ui_labelf("dec"); + UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_label_multiline(max_width, str8_lit("Specifies that all integral evaluations should appear in base-10 form.")); ui_spacer(ui_em(1.5f, 1)); - UI_Font(df_font_from_slot(DF_FontSlot_Code)) UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_PlainText)) ui_labelf("hex"); - ui_label_multiline(max_width, str8_lit("Specifies that all integral evaluations should appear in base-16 form.")); + UI_Font(df_font_from_slot(DF_FontSlot_Code)) ui_labelf("hex"); + UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_label_multiline(max_width, str8_lit("Specifies that all integral evaluations should appear in base-16 form.")); ui_spacer(ui_em(1.5f, 1)); - UI_Font(df_font_from_slot(DF_FontSlot_Code)) UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_PlainText)) ui_labelf("oct"); - ui_label_multiline(max_width, str8_lit("Specifies that all integral evaluations should appear in base-8 form.")); + UI_Font(df_font_from_slot(DF_FontSlot_Code)) ui_labelf("oct"); + UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_label_multiline(max_width, str8_lit("Specifies that all integral evaluations should appear in base-8 form.")); ui_spacer(ui_em(1.5f, 1)); - UI_Font(df_font_from_slot(DF_FontSlot_Code)) UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_PlainText)) ui_labelf("bin"); - ui_label_multiline(max_width, str8_lit("Specifies that all integral evaluations should appear in base-2 form.")); + UI_Font(df_font_from_slot(DF_FontSlot_Code)) ui_labelf("bin"); + UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_label_multiline(max_width, str8_lit("Specifies that all integral evaluations should appear in base-2 form.")); ui_spacer(ui_em(1.5f, 1)); - UI_Font(df_font_from_slot(DF_FontSlot_Code)) UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_PlainText)) ui_labelf("no_addr"); - ui_label_multiline(max_width, str8_lit("Displays only what pointers point to, if possible, without the pointer's address value.")); + UI_Font(df_font_from_slot(DF_FontSlot_Code)) ui_labelf("no_addr"); + UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_label_multiline(max_width, str8_lit("Displays only what pointers point to, if possible, without the pointer's address value.")); ui_spacer(ui_em(1.5f, 1)); } } + //////////////////////////// //- rjf: viz blocks -> rows + // DF_EvalVizWindowedRowList rows = {0}; { rows = df_eval_viz_windowed_row_list_from_viz_block_list(scratch.arena, di_scope, &ctrl_ctx, &parse_ctx, ¯o_map, eval_view, default_radix, code_font, ui_top_font_size(), r1s64(visible_row_rng.min-1, visible_row_rng.max), &blocks); } + //////////////////////////// //- rjf: build table + // ProfScope("build table") { - //- rjf: build rows U64 semantic_idx = rows.count_before_semantic; for(DF_EvalVizRow *row = rows.first; row != 0; row = row->next, semantic_idx += 1) { + //////////////////////// //- rjf: unpack row info + // U64 row_hash = df_hash_from_expand_key(row->key); U64 expr_hash = df_hash_from_string(row->display_expr); - df_expand_tree_table_animate(&eval_view->expand_tree_table, df_dt()); B32 row_selected = (selection_tbl.min.y <= (semantic_idx+1) && (semantic_idx+1) <= selection_tbl.max.y); B32 row_expanded = df_expand_key_is_set(&eval_view->expand_tree_table, row->key); + //////////////////////// //- rjf: determine if row's data is fresh and/or bad + // B32 row_is_fresh = 0; B32 row_is_bad = 0; switch(row->eval.mode) @@ -1632,423 +1640,448 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS }break; } - //- rjf: build canvas row - if(row->flags & DF_EvalVizRowFlag_Canvas) UI_FocusHot(row_selected ? UI_FocusKind_On : UI_FocusKind_Off) ProfScope("canvas row") - { - DF_WatchViewPoint pt = {DF_WatchViewColumnKind_Expr, row->parent_key, row->key}; - - //- rjf: build - ui_set_next_flags(disabled_flags); - ui_set_next_pref_width(ui_pct(1, 0)); - ui_set_next_pref_height(ui_px(scroll_list_params.row_height_px*row->size_in_rows, 1.f)); - UI_Box *vector = ui_build_box_from_stringf(UI_BoxFlag_DrawSideBottom|UI_BoxFlag_RequireFocusBackground|UI_BoxFlag_Clickable, "row_%I64x", row_hash); - UI_Parent(vector) - { - ui_set_next_fixed_y(-1.f * (row->skipped_size_in_rows) * scroll_list_params.row_height_px); - ui_set_next_fixed_height((row->skipped_size_in_rows + row->size_in_rows + row->chopped_size_in_rows) * scroll_list_params.row_height_px); - ui_set_next_child_layout_axis(Axis2_X); - UI_Box *canvas_box = ui_build_box_from_stringf(UI_BoxFlag_FloatingY, "###canvas_%I64x", row_hash); - if(row->expand_ui_rule_spec != &df_g_nil_gfx_view_rule_spec && row->expand_ui_rule_spec->info.block_ui) - { - UI_Parent(canvas_box) UI_WidthFill UI_HeightFill - { - Vec2F32 canvas_dim = v2f32(scroll_list_params.dim_px.x - ui_top_font_size()*1.5f, - (row->skipped_size_in_rows+row->size_in_rows+row->chopped_size_in_rows)*scroll_list_params.row_height_px); - row->expand_ui_rule_spec->info.block_ui(ws, row->key, row->eval, row->edit_expr, di_scope, &ctrl_ctx, &parse_ctx, ¯o_map, row->expand_ui_rule_node, canvas_dim); - } - } - } - - //- rjf: take interaction - UI_Signal sig = ui_signal_from_box(vector); - - //- rjf: press -> focus - if(ui_pressed(sig)) - { - ewv->next_cursor = ewv->next_mark = pt; - pressed = 1; - } - - //- rjf: double clicked -> open dedicated tab - if(ui_double_clicked(sig)) - { - DF_CfgNode *cfg = df_cfg_tree_copy(scratch.arena, row->expand_ui_rule_node); - DF_CfgNode *cfg_root = push_array(scratch.arena, DF_CfgNode, 1); - cfg_root->first = cfg_root->last = cfg; - cfg_root->next = cfg_root->parent = &df_g_nil_cfg_node; - if(cfg != &df_g_nil_cfg_node) - { - cfg->parent = cfg_root; - } - DF_CmdParams p = df_cmd_params_from_view(ws, panel, view); - p.string = row->edit_expr; - p.view_spec = df_tab_view_spec_from_gfx_view_rule_spec(row->expand_ui_rule_spec); - p.cfg_node = cfg_root; - df_cmd_params_mark_slot(&p, DF_CmdParamSlot_String); - df_cmd_params_mark_slot(&p, DF_CmdParamSlot_ViewSpec); - df_cmd_params_mark_slot(&p, DF_CmdParamSlot_CfgNode); - df_push_cmd__root(&p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_OpenTab)); - } - } - - //- rjf: build normal row - if(!(row->flags & DF_EvalVizRowFlag_Canvas)) ProfScope("row") + //////////////////////// + //- rjf: determine row's color scheme + // + UI_ColorScheme *scheme = ui_top_scheme(); { if(row_is_fresh) { - ui_set_next_flags(disabled_flags|UI_BoxFlag_DrawOverlay); - ui_set_next_overlay_color(mul_4f32(df_rgba_from_theme_color(DF_ThemeColor_Highlight0), v4f32(1, 1, 1, 0.2f))); + scheme = ui_fork_top_color_scheme(.background = mul_4f32(df_rgba_from_theme_color(DF_ThemeColor_Highlight0), v4f32(1, 1, 1, 0.2f))); } - else + } + + //////////////////////// + //- rjf: build row box + // + ui_set_next_flags(disabled_flags); + ui_set_next_pref_width(ui_pct(1, 0)); + ui_set_next_pref_height(ui_px(scroll_list_params.row_height_px*row->size_in_rows, 1.f)); + ui_set_next_scheme(scheme); + UI_Box *row_box = ui_build_box_from_stringf(UI_BoxFlag_DrawSideBottom|UI_BoxFlag_RequireFocusBackground|UI_BoxFlag_Clickable, "row_%I64x", row_hash); + + //////////////////////// + //- rjf: canvas row -> fill with canvas ui build + // + if(row->flags & DF_EvalVizRowFlag_Canvas) UI_Parent(row_box) UI_FocusHot(row_selected ? UI_FocusKind_On : UI_FocusKind_Off) + { + //- rjf: build canvas row contents + ui_set_next_fixed_y(-1.f * (row->skipped_size_in_rows) * scroll_list_params.row_height_px); + ui_set_next_fixed_height((row->skipped_size_in_rows + row->size_in_rows + row->chopped_size_in_rows) * scroll_list_params.row_height_px); + ui_set_next_child_layout_axis(Axis2_X); + UI_Box *canvas_box = ui_build_box_from_stringf(UI_BoxFlag_FloatingY, "###canvas_%I64x", row_hash); + if(row->expand_ui_rule_spec != &df_g_nil_gfx_view_rule_spec && row->expand_ui_rule_spec->info.block_ui) { - ui_set_next_flags(disabled_flags); + UI_Parent(canvas_box) UI_WidthFill UI_HeightFill + { + Vec2F32 canvas_dim = v2f32(scroll_list_params.dim_px.x - ui_top_font_size()*1.5f, + (row->skipped_size_in_rows+row->size_in_rows+row->chopped_size_in_rows)*scroll_list_params.row_height_px); + row->expand_ui_rule_spec->info.block_ui(ws, row->key, row->eval, row->edit_expr, di_scope, &ctrl_ctx, &parse_ctx, ¯o_map, row->expand_ui_rule_node, canvas_dim); + } } - UI_NamedTableVectorF("row_%I64x_%I64x", row_hash, ewv->root_count) + + //- rjf: do canvas row interactions { - //- rjf: draw start of cache lines in expansions - if((row->eval.mode == EVAL_EvalMode_Addr || row->eval.mode == EVAL_EvalMode_NULL) && - row->eval.errors.count == 0 && - row->eval.offset%64 == 0 && row->depth > 0 && - !row_expanded) + DF_WatchViewPoint pt = {DF_WatchViewColumnKind_Expr, row->parent_key, row->key}; + UI_Signal sig = ui_signal_from_box(row_box); + + // rjf: press -> focus + if(ui_pressed(sig)) + { + ewv->next_cursor = ewv->next_mark = pt; + pressed = 1; + } + + // rjf: double clicked -> open dedicated tab + if(ui_double_clicked(sig)) + { + DF_CfgNode *cfg = df_cfg_tree_copy(scratch.arena, row->expand_ui_rule_node); + DF_CfgNode *cfg_root = push_array(scratch.arena, DF_CfgNode, 1); + cfg_root->first = cfg_root->last = cfg; + cfg_root->next = cfg_root->parent = &df_g_nil_cfg_node; + if(cfg != &df_g_nil_cfg_node) + { + cfg->parent = cfg_root; + } + DF_CmdParams p = df_cmd_params_from_view(ws, panel, view); + p.string = row->edit_expr; + p.view_spec = df_tab_view_spec_from_gfx_view_rule_spec(row->expand_ui_rule_spec); + p.cfg_node = cfg_root; + df_cmd_params_mark_slot(&p, DF_CmdParamSlot_String); + df_cmd_params_mark_slot(&p, DF_CmdParamSlot_ViewSpec); + df_cmd_params_mark_slot(&p, DF_CmdParamSlot_CfgNode); + df_push_cmd__root(&p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_OpenTab)); + } + } + } + + //////////////////////// + //- rjf: build non-canvas row contents + // + if(!(row->flags & DF_EvalVizRowFlag_Canvas)) + { + //////////////////// + //- rjf: draw start of cache lines in expansions + // + if((row->eval.mode == EVAL_EvalMode_Addr || row->eval.mode == EVAL_EvalMode_NULL) && + row->eval.errors.count == 0 && + row->eval.offset%64 == 0 && row->depth > 0 && + !row_expanded) + { + ui_set_next_fixed_x(0); + ui_set_next_fixed_y(0); + ui_set_next_fixed_height(ui_top_font_size()*0.1f); + ui_set_next_scheme(ui_fork_top_color_scheme(.background = df_rgba_from_theme_color(DF_ThemeColor_Highlight0))); + ui_build_box_from_key(UI_BoxFlag_Floating|UI_BoxFlag_DrawBackground, ui_key_zero()); + } + + //////////////////// + //- rjf: draw mid-row cache line boundaries in expansions + // + if((row->eval.mode == EVAL_EvalMode_Addr || row->eval.mode == EVAL_EvalMode_NULL) && + row->eval.errors.count == 0 && + row->eval.offset%64 != 0 && + row->depth > 0 && + !row_expanded) + { + U64 next_off = (row->eval.offset + tg_byte_size_from_graph_rdi_key(parse_ctx.type_graph, parse_ctx.rdi, row->eval.type_key)); + if(next_off%64 != 0 && row->eval.offset/64 < next_off/64) { ui_set_next_fixed_x(0); - ui_set_next_fixed_y(0); - ui_set_next_fixed_height(ui_top_font_size()*0.1f); - ui_set_next_background_color(df_rgba_from_theme_color(DF_ThemeColor_Highlight0)); + ui_set_next_fixed_y(scroll_list_params.row_height_px - ui_top_font_size()*0.5f); + ui_set_next_fixed_height(ui_top_font_size()*1.f); + Vec4F32 boundary_color = df_rgba_from_theme_color(DF_ThemeColor_Highlight0); + boundary_color.w *= 0.25f; + ui_set_next_scheme(ui_fork_top_color_scheme(.background = boundary_color)); ui_build_box_from_key(UI_BoxFlag_Floating|UI_BoxFlag_DrawBackground, ui_key_zero()); } + } + + //////////////////// + //- rjf: expression + // + ProfScope("expr") + { + DF_WatchViewPoint pt = {DF_WatchViewColumnKind_Expr, row->parent_key, row->key}; + DF_WatchViewTextEditState *edit_state = df_watch_view_text_edit_state_from_pt(ewv, pt); + B32 cell_selected = (row_selected && selection_tbl.min.x <= pt.column_kind && pt.column_kind <= selection_tbl.max.x); + B32 can_edit_expr = !(row->depth > 0 || modifiable == 0); - //- rjf: draw mid-row cache line boundaries in expansions - if((row->eval.mode == EVAL_EvalMode_Addr || row->eval.mode == EVAL_EvalMode_NULL) && - row->eval.errors.count == 0 && - row->eval.offset%64 != 0 && - row->depth > 0 && - !row_expanded) + // rjf: unpack scheme + UI_ColorScheme *scheme = ui_top_scheme(); { - U64 next_off = (row->eval.offset + tg_byte_size_from_graph_rdi_key(parse_ctx.type_graph, parse_ctx.rdi, row->eval.type_key)); - if(next_off%64 != 0 && row->eval.offset/64 < next_off/64) - { - ui_set_next_fixed_x(0); - ui_set_next_fixed_y(scroll_list_params.row_height_px - ui_top_font_size()*0.5f); - ui_set_next_fixed_height(ui_top_font_size()*1.f); - Vec4F32 boundary_color = df_rgba_from_theme_color(DF_ThemeColor_Highlight0); - boundary_color.w *= 0.25f; - ui_set_next_background_color(boundary_color); - ui_build_box_from_key(UI_BoxFlag_Floating|UI_BoxFlag_DrawBackground, ui_key_zero()); - } - } - - //- rjf: expression - ProfScope("expr") - { - DF_WatchViewPoint pt = {DF_WatchViewColumnKind_Expr, row->parent_key, row->key}; - DF_WatchViewTextEditState *edit_state = df_watch_view_text_edit_state_from_pt(ewv, pt); - B32 cell_selected = (row_selected && selection_tbl.min.x <= pt.column_kind && pt.column_kind <= selection_tbl.max.x); - B32 can_edit_expr = !(row->depth > 0 || modifiable == 0); - - // rjf: build - UI_Signal sig = {0}; - B32 next_expanded = row_expanded; if(row->flags & DF_EvalVizRowFlag_ExprIsSpecial) { - ui_set_next_flags(disabled_flags|UI_BoxFlag_DrawOverlay); - ui_set_next_overlay_color(mul_4f32(df_rgba_from_theme_color(DF_ThemeColor_FailureBackground), v4f32(1, 1, 1, 0.2f))); - } - UI_TableCell - UI_FocusHot(cell_selected ? UI_FocusKind_On : UI_FocusKind_Off) - UI_FocusActive((cell_selected && ewv->text_editing) ? UI_FocusKind_On : UI_FocusKind_Off) - { - B32 expr_editing_active = ui_is_focus_active(); - B32 is_inherited = (row->inherited_type_key_chain.count != 0); - UI_Font(code_font) UI_TextColor((row->flags & DF_EvalVizRowFlag_ExprIsSpecial) ? - df_rgba_from_theme_color(DF_ThemeColor_Highlight0) : - row->depth > 0 ? df_rgba_from_theme_color(DF_ThemeColor_WeakText) : ui_top_text_color()) - { - if(is_inherited) - { - Vec4F32 inherited_bg_color = df_rgba_from_theme_color(DF_ThemeColor_Highlight1); - inherited_bg_color.w *= 0.2f; - ui_set_next_background_color(inherited_bg_color); - } - FuzzyMatchRangeList matches = {0}; - if(filter.size != 0) - { - matches = fuzzy_match_find(scratch.arena, filter, row->display_expr); - } - sig = df_line_editf((DF_LineEditFlag_CodeContents*(!(row->flags & DF_EvalVizRowFlag_ExprIsSpecial))| - DF_LineEditFlag_NoBackground*(!is_inherited)| - DF_LineEditFlag_DisableEdit*(!can_edit_expr)| - DF_LineEditFlag_Expander*!!(row->flags & DF_EvalVizRowFlag_CanExpand)| - DF_LineEditFlag_ExpanderPlaceholder*(row->depth==0)| - DF_LineEditFlag_ExpanderSpace*(row->depth!=0)), - row->depth, - filter.size ? &matches : 0, - &edit_state->cursor, &edit_state->mark, edit_state->input_buffer, sizeof(edit_state->input_buffer), &edit_state->input_size, &next_expanded, - row->display_expr, - "###row_%I64x", row_hash); - } - if(is_inherited && ui_hovering(sig)) UI_Tooltip - { - String8List inheritance_chain_type_names = {0}; - for(TG_KeyNode *n = row->inherited_type_key_chain.first; n != 0; n = n->next) - { - String8 inherited_type_name = tg_string_from_key(scratch.arena, parse_ctx.type_graph, parse_ctx.rdi, n->v); - inherited_type_name = str8_skip_chop_whitespace(inherited_type_name); - str8_list_push(scratch.arena, &inheritance_chain_type_names, inherited_type_name); - } - StringJoin join = {0}; - join.sep = str8_lit("::"); - String8 inheritance_type = str8_list_join(scratch.arena, &inheritance_chain_type_names, &join); - ui_set_next_pref_width(ui_children_sum(1)); - UI_Row - { - ui_labelf("Inherited from "); - UI_Font(df_font_from_slot(DF_FontSlot_Code)) df_code_label(1.f, 1.f, df_rgba_from_theme_color(DF_ThemeColor_CodeType), inheritance_type); - } - } - if(DEV_eval_watch_key_tooltips && ui_hovering(sig)) UI_Tooltip UI_Font(df_font_from_slot(DF_FontSlot_Code)) - { - ui_labelf("Parent Key: %I64x, %I64x", row->parent_key.parent_hash, row->parent_key.child_num); - ui_labelf("Hover Key: %I64x, %I64x", row->key.parent_hash, row->key.child_num); - ui_labelf("Cursor Key: %I64x, %I64x", ewv->cursor.key.parent_hash, ewv->cursor.key.child_num); - } - if(DEV_eval_compiler_tooltips && row->depth == 0 && ui_hovering(sig)) UI_Tooltip - { - Temp scratch = scratch_begin(0, 0); - String8 string = row->display_expr; - - // rjf: lex & parse - EVAL_TokenArray tokens = eval_token_array_from_text(scratch.arena, string); - EVAL_ParseResult parse = eval_parse_expr_from_text_tokens(scratch.arena, &parse_ctx, string, &tokens); - EVAL_ErrorList errors = parse.errors; - ui_labelf("Tokens:"); - UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText)) - for(U64 idx = 0; idx < tokens.count; idx += 1) - { - EVAL_Token *token = tokens.v+idx; - String8 token_string = str8_substr(string, token->range); - String8 token_kind_name = str8_lit("Token"); - switch(token->kind) - { - default:break; - case EVAL_TokenKind_Identifier: {token_kind_name = str8_lit("Identifier");}break; - case EVAL_TokenKind_Numeric: {token_kind_name = str8_lit("Numeric");}break; - case EVAL_TokenKind_StringLiteral:{token_kind_name = str8_lit("StringLiteral");}break; - case EVAL_TokenKind_CharLiteral: {token_kind_name = str8_lit("CharLiteral");}break; - case EVAL_TokenKind_Symbol: {token_kind_name = str8_lit("Symbol");}break; - } - ui_labelf("%S -> \"%S\"", token_kind_name, token_string); - } - - // rjf: produce IR tree & type - EVAL_IRTreeAndType ir_tree_and_type = {&eval_irtree_nil}; - if(parse.expr != &eval_expr_nil && errors.count == 0) - { - ui_labelf("Type:"); - ir_tree_and_type = eval_irtree_and_type_from_expr(scratch.arena, parse_ctx.type_graph, parse_ctx.rdi, &eval_string2expr_map_nil, parse.expr, &errors); - TG_Key type_key = ir_tree_and_type.type_key; - String8 type_string = tg_string_from_key(scratch.arena, parse_ctx.type_graph, parse_ctx.rdi, type_key); - UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText)) - ui_label(type_string); - } - - scratch_end(scratch); - } - - // rjf: autocomplete lister - if(expr_editing_active && - selection_tbl.min.x == selection_tbl.max.x && selection_tbl.min.y == selection_tbl.max.y && - txt_pt_match(edit_state->cursor, edit_state->mark)) - { - String8 input = str8(edit_state->input_buffer, edit_state->input_size); - DF_AutoCompListerParams params = {DF_AutoCompListerFlag_Locals}; - df_set_autocomp_lister_query(ws, sig.box->key, ctrl_ctx, ¶ms, input, edit_state->cursor.column-1); - } - } - - // rjf: press -> commit if editing & select - if(ui_pressed(sig)) - { - ewv->next_cursor = ewv->next_mark = pt; - pressed = 1; - } - - // rjf: double-click -> start editing - if(ui_double_clicked(sig) && can_edit_expr) - { - ui_kill_action(); - DF_CmdParams p = df_cmd_params_from_view(ws, panel, view); - df_push_cmd__root(&p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_Edit)); - } - - // rjf: commit expansion state - if(next_expanded != row_expanded) - { - df_expand_set_expansion(eval_view->arena, &eval_view->expand_tree_table, row->parent_key, row->key, next_expanded); + scheme = ui_fork_top_color_scheme(.text = df_rgba_from_theme_color(DF_ThemeColor_SpecialNegativeText), + .background = df_rgba_from_theme_color(DF_ThemeColor_SpecialNegativeBackground)); } } - //- rjf: value - ProfScope("value") + // rjf: build + UI_Signal sig = {0}; + B32 next_expanded = row_expanded; + UI_Scheme(scheme) UI_TableCell + UI_FocusHot(cell_selected ? UI_FocusKind_On : UI_FocusKind_Off) + UI_FocusActive((cell_selected && ewv->text_editing) ? UI_FocusKind_On : UI_FocusKind_Off) { - DF_WatchViewPoint pt = {DF_WatchViewColumnKind_Value, row->parent_key, row->key}; - DF_WatchViewTextEditState *edit_state = df_watch_view_text_edit_state_from_pt(ewv, pt); - B32 cell_selected = (row_selected && selection_tbl.min.x <= pt.column_kind && pt.column_kind <= selection_tbl.max.x); - B32 value_is_error = (row->eval.errors.count != 0); - B32 value_is_hook = (!value_is_error && row->value_ui_rule_spec != &df_g_nil_gfx_view_rule_spec && row->value_ui_rule_spec != 0); - B32 value_is_complex = (!value_is_error && !value_is_hook && !(row->flags & DF_EvalVizRowFlag_CanEditValue)); - B32 value_is_simple = (!value_is_error && !value_is_hook && (row->flags & DF_EvalVizRowFlag_CanEditValue)); - - // rjf: build - UI_Signal sig = {0}; - if(row_is_bad) + B32 expr_editing_active = ui_is_focus_active(); + B32 is_inherited = (row->inherited_type_key_chain.count != 0); + UI_Font(code_font) UI_Scheme(scheme) UI_FlagsAdd(row->depth > 0 ? UI_BoxFlag_DrawTextWeak : 0) { - ui_set_next_flags(disabled_flags|UI_BoxFlag_DrawOverlay); - ui_set_next_overlay_color(mul_4f32(df_rgba_from_theme_color(DF_ThemeColor_FailureBackground), v4f32(1, 1, 1, 0.2f))); - } - UI_TableCell UI_Font(code_font) - UI_FocusHot(cell_selected ? UI_FocusKind_On : UI_FocusKind_Off) - UI_FocusActive((cell_selected && ewv->text_editing) ? UI_FocusKind_On : UI_FocusKind_Off) - { - // rjf: errors? -> show errors - if(value_is_error) UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_FailureBackground)) UI_Font(df_font_from_slot(DF_FontSlot_Main)) + if(is_inherited) { - String8List strings = {0}; - for(EVAL_Error *error = row->eval.errors.first; error != 0; error = error->next) + Vec4F32 inherited_bg_color = df_rgba_from_theme_color(DF_ThemeColor_Highlight1); + inherited_bg_color.w *= 0.2f; + ui_set_next_scheme(ui_fork_top_color_scheme(.background = inherited_bg_color)); + } + FuzzyMatchRangeList matches = {0}; + if(filter.size != 0) + { + matches = fuzzy_match_find(scratch.arena, filter, row->display_expr); + } + sig = df_line_editf((DF_LineEditFlag_CodeContents*(!(row->flags & DF_EvalVizRowFlag_ExprIsSpecial))| + DF_LineEditFlag_NoBackground*(!is_inherited)| + DF_LineEditFlag_DisableEdit*(!can_edit_expr)| + DF_LineEditFlag_Expander*!!(row->flags & DF_EvalVizRowFlag_CanExpand)| + DF_LineEditFlag_ExpanderPlaceholder*(row->depth==0)| + DF_LineEditFlag_ExpanderSpace*(row->depth!=0)), + row->depth, + filter.size ? &matches : 0, + &edit_state->cursor, &edit_state->mark, edit_state->input_buffer, sizeof(edit_state->input_buffer), &edit_state->input_size, &next_expanded, + row->display_expr, + "###row_%I64x", row_hash); + } + if(is_inherited && ui_hovering(sig)) UI_Tooltip + { + String8List inheritance_chain_type_names = {0}; + for(TG_KeyNode *n = row->inherited_type_key_chain.first; n != 0; n = n->next) + { + String8 inherited_type_name = tg_string_from_key(scratch.arena, parse_ctx.type_graph, parse_ctx.rdi, n->v); + inherited_type_name = str8_skip_chop_whitespace(inherited_type_name); + str8_list_push(scratch.arena, &inheritance_chain_type_names, inherited_type_name); + } + StringJoin join = {0}; + join.sep = str8_lit("::"); + String8 inheritance_type = str8_list_join(scratch.arena, &inheritance_chain_type_names, &join); + ui_set_next_pref_width(ui_children_sum(1)); + UI_Row + { + ui_labelf("Inherited from "); + UI_Font(df_font_from_slot(DF_FontSlot_Code)) df_code_label(1.f, 1.f, df_rgba_from_theme_color(DF_ThemeColor_CodeType), inheritance_type); + } + } + if(DEV_eval_watch_key_tooltips && ui_hovering(sig)) UI_Tooltip UI_Font(df_font_from_slot(DF_FontSlot_Code)) + { + ui_labelf("Parent Key: %I64x, %I64x", row->parent_key.parent_hash, row->parent_key.child_num); + ui_labelf("Hover Key: %I64x, %I64x", row->key.parent_hash, row->key.child_num); + ui_labelf("Cursor Key: %I64x, %I64x", ewv->cursor.key.parent_hash, ewv->cursor.key.child_num); + } + if(DEV_eval_compiler_tooltips && row->depth == 0 && ui_hovering(sig)) UI_Tooltip + { + Temp scratch = scratch_begin(0, 0); + String8 string = row->display_expr; + + // rjf: lex & parse + EVAL_TokenArray tokens = eval_token_array_from_text(scratch.arena, string); + EVAL_ParseResult parse = eval_parse_expr_from_text_tokens(scratch.arena, &parse_ctx, string, &tokens); + EVAL_ErrorList errors = parse.errors; + ui_labelf("Tokens:"); + UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) for(U64 idx = 0; idx < tokens.count; idx += 1) + { + EVAL_Token *token = tokens.v+idx; + String8 token_string = str8_substr(string, token->range); + String8 token_kind_name = str8_lit("Token"); + switch(token->kind) { - str8_list_push(scratch.arena, &strings, error->text); + default:break; + case EVAL_TokenKind_Identifier: {token_kind_name = str8_lit("Identifier");}break; + case EVAL_TokenKind_Numeric: {token_kind_name = str8_lit("Numeric");}break; + case EVAL_TokenKind_StringLiteral:{token_kind_name = str8_lit("StringLiteral");}break; + case EVAL_TokenKind_CharLiteral: {token_kind_name = str8_lit("CharLiteral");}break; + case EVAL_TokenKind_Symbol: {token_kind_name = str8_lit("Symbol");}break; } - StringJoin join = {str8_lit(""), str8_lit(" "), str8_lit("")}; - String8 error_string = str8_list_join(scratch.arena, &strings, &join); - sig = df_error_label(error_string); + ui_labelf("%S -> \"%S\"", token_kind_name, token_string); } - // rjf: hook -> call hook - if(value_is_hook) UI_Font(df_font_from_slot(DF_FontSlot_Main)) + // rjf: produce IR tree & type + EVAL_IRTreeAndType ir_tree_and_type = {&eval_irtree_nil}; + if(parse.expr != &eval_expr_nil && errors.count == 0) { - UI_Box *box = ui_build_box_from_stringf(UI_BoxFlag_Clip|UI_BoxFlag_Clickable, "###val_%I64x", row_hash); - UI_Parent(box) - { - row->value_ui_rule_spec->info.row_ui(row->key, row->eval, di_scope, &ctrl_ctx, &parse_ctx, ¯o_map, row->value_ui_rule_node); - } - sig = ui_signal_from_box(box); + ui_labelf("Type:"); + ir_tree_and_type = eval_irtree_and_type_from_expr(scratch.arena, parse_ctx.type_graph, parse_ctx.rdi, &eval_string2expr_map_nil, parse.expr, &errors); + TG_Key type_key = ir_tree_and_type.type_key; + String8 type_string = tg_string_from_key(scratch.arena, parse_ctx.type_graph, parse_ctx.rdi, type_key); + UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) + ui_label(type_string); } - // rjf: complex values - if(value_is_complex) - { - UI_Box *box = ui_build_box_from_stringf(UI_BoxFlag_Clip|UI_BoxFlag_Clickable, "###val_%I64x", row_hash); - UI_Parent(box) - { - df_code_label(1.f, 1, df_rgba_from_theme_color(DF_ThemeColor_CodeDefault), row->display_value); - } - sig = ui_signal_from_box(box); - } - - // rjf: simple values (editable) - if(value_is_simple) - { - sig = df_line_editf(DF_LineEditFlag_CodeContents|DF_LineEditFlag_NoBackground, 0, 0, &edit_state->cursor, &edit_state->mark, edit_state->input_buffer, sizeof(edit_state->input_buffer), &edit_state->input_size, 0, row->display_value, "%S###val_%I64x", row->display_value, row_hash); - } - } - - // rjf: bad & hovering -> display - if(row_is_bad && ui_hovering(sig)) UI_Tooltip - { - UI_PrefWidth(ui_children_sum(1)) df_error_label(str8_lit("Could not read process memory successfully.")); - } - - // rjf: press -> focus & commit if editing & not selected - if(ui_pressed(sig)) - { - ewv->next_cursor = ewv->next_mark = pt; - pressed = 1; - } - - // rjf: double-click -> start editing - if(ui_double_clicked(sig) && value_is_simple) - { - ui_kill_action(); - DF_CmdParams p = df_cmd_params_from_view(ws, panel, view); - df_push_cmd__root(&p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_Edit)); - } - } - - //- rjf: type - ProfScope("type") - { - DF_WatchViewPoint pt = {DF_WatchViewColumnKind_Type, row->parent_key, row->key}; - DF_WatchViewTextEditState *edit_state = df_watch_view_text_edit_state_from_pt(ewv, pt); - B32 cell_selected = (row_selected && selection_tbl.min.x <= pt.column_kind && pt.column_kind <= selection_tbl.max.x); - UI_TableCell UI_Font(code_font) - UI_FocusHot(cell_selected ? UI_FocusKind_On : UI_FocusKind_Off) - UI_FocusActive((cell_selected && ewv->text_editing) ? UI_FocusKind_On : UI_FocusKind_Off) - { - TG_Key key = row->eval.type_key; - String8 string = tg_string_from_key(scratch.arena, parse_ctx.type_graph, parse_ctx.rdi, key); - string = str8_skip_chop_whitespace(string); - UI_Box *box = ui_build_box_from_stringf(UI_BoxFlag_Clip|UI_BoxFlag_Clickable, "###type_%I64x", row_hash); - if(!tg_key_match(key, tg_key_zero())) UI_Parent(box) - { - df_code_label(1.f, 1, df_rgba_from_theme_color(DF_ThemeColor_CodeType), string); - } - UI_Signal sig = ui_signal_from_box(box); - if(ui_pressed(sig)) - { - ewv->next_cursor = ewv->next_mark = pt; - pressed = 1; - } - } - } - - //- rjf: view rule - ProfScope("view rule") - { - DF_WatchViewPoint pt = {DF_WatchViewColumnKind_ViewRule, row->parent_key, row->key}; - DF_WatchViewTextEditState *edit_state = df_watch_view_text_edit_state_from_pt(ewv, pt); - B32 cell_selected = (row_selected && selection_tbl.min.x <= pt.column_kind && pt.column_kind <= selection_tbl.max.x); - String8 view_rule = df_eval_view_rule_from_key(eval_view, row->key); - - // rjf: build - UI_Signal sig = {0}; - B32 rule_editing_active = 0; - UI_TableCell UI_Font(code_font) - UI_FocusHot(cell_selected ? UI_FocusKind_On : UI_FocusKind_Off) - UI_FocusActive((cell_selected && ewv->text_editing) ? UI_FocusKind_On : UI_FocusKind_Off) - { - rule_editing_active = ui_is_focus_active(); - sig = df_line_editf(DF_LineEditFlag_CodeContents|DF_LineEditFlag_NoBackground, 0, 0, &edit_state->cursor, &edit_state->mark, edit_state->input_buffer, sizeof(edit_state->input_buffer), &edit_state->input_size, 0, view_rule, "###view_rule_%I64x", row_hash); - } - - // rjf: press -> commit if not selected, select this cell - if(ui_pressed(sig)) - { - ewv->next_cursor = ewv->next_mark = pt; - pressed = 1; + scratch_end(scratch); } // rjf: autocomplete lister - if(rule_editing_active && + if(expr_editing_active && selection_tbl.min.x == selection_tbl.max.x && selection_tbl.min.y == selection_tbl.max.y && txt_pt_match(edit_state->cursor, edit_state->mark)) { String8 input = str8(edit_state->input_buffer, edit_state->input_size); - DF_AutoCompListerParams params = df_view_rule_autocomp_lister_params_from_input_cursor(scratch.arena, input, edit_state->cursor.column-1); - if(params.flags == 0) - { - params.flags = DF_AutoCompListerFlag_ViewRules; - } + DF_AutoCompListerParams params = {DF_AutoCompListerFlag_Locals}; df_set_autocomp_lister_query(ws, sig.box->key, ctrl_ctx, ¶ms, input, edit_state->cursor.column-1); } - - // rjf: double-click -> begin editing - if(ui_double_clicked(sig) && !ewv->text_editing) + } + + // rjf: press -> commit if editing & select + if(ui_pressed(sig)) + { + ewv->next_cursor = ewv->next_mark = pt; + pressed = 1; + } + + // rjf: double-click -> start editing + if(ui_double_clicked(sig) && can_edit_expr) + { + ui_kill_action(); + DF_CmdParams p = df_cmd_params_from_view(ws, panel, view); + df_push_cmd__root(&p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_Edit)); + } + + // rjf: commit expansion state + if(next_expanded != row_expanded) + { + df_expand_set_expansion(eval_view->arena, &eval_view->expand_tree_table, row->parent_key, row->key, next_expanded); + } + } + + //////////////////// + //- rjf: value + // + ProfScope("value") + { + DF_WatchViewPoint pt = {DF_WatchViewColumnKind_Value, row->parent_key, row->key}; + DF_WatchViewTextEditState *edit_state = df_watch_view_text_edit_state_from_pt(ewv, pt); + B32 cell_selected = (row_selected && selection_tbl.min.x <= pt.column_kind && pt.column_kind <= selection_tbl.max.x); + B32 value_is_error = (row->eval.errors.count != 0); + B32 value_is_hook = (!value_is_error && row->value_ui_rule_spec != &df_g_nil_gfx_view_rule_spec && row->value_ui_rule_spec != 0); + B32 value_is_complex = (!value_is_error && !value_is_hook && !(row->flags & DF_EvalVizRowFlag_CanEditValue)); + B32 value_is_simple = (!value_is_error && !value_is_hook && (row->flags & DF_EvalVizRowFlag_CanEditValue)); + + // rjf: unpack scheme + UI_ColorScheme *scheme = ui_top_scheme(); + { + if(row_is_bad) { - ui_kill_action(); - DF_CmdParams p = df_cmd_params_from_view(ws, panel, view); - df_push_cmd__root(&p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_Edit)); + scheme = ui_fork_top_color_scheme(.text = df_rgba_from_theme_color(DF_ThemeColor_SpecialNegativeText), + .background = df_rgba_from_theme_color(DF_ThemeColor_SpecialNegativeBackground)); } } + + // rjf: build + UI_Signal sig = {0}; + UI_Scheme(scheme) UI_TableCell UI_Font(code_font) + UI_FocusHot(cell_selected ? UI_FocusKind_On : UI_FocusKind_Off) + UI_FocusActive((cell_selected && ewv->text_editing) ? UI_FocusKind_On : UI_FocusKind_Off) + { + // rjf: errors? -> show errors + if(value_is_error) UI_Font(df_font_from_slot(DF_FontSlot_Main)) + { + String8List strings = {0}; + for(EVAL_Error *error = row->eval.errors.first; error != 0; error = error->next) + { + str8_list_push(scratch.arena, &strings, error->text); + } + StringJoin join = {str8_lit(""), str8_lit(" "), str8_lit("")}; + String8 error_string = str8_list_join(scratch.arena, &strings, &join); + sig = df_error_label(error_string); + } + + // rjf: hook -> call hook + if(value_is_hook) UI_Font(df_font_from_slot(DF_FontSlot_Main)) + { + UI_Box *box = ui_build_box_from_stringf(UI_BoxFlag_Clip|UI_BoxFlag_Clickable, "###val_%I64x", row_hash); + UI_Parent(box) + { + row->value_ui_rule_spec->info.row_ui(row->key, row->eval, di_scope, &ctrl_ctx, &parse_ctx, ¯o_map, row->value_ui_rule_node); + } + sig = ui_signal_from_box(box); + } + + // rjf: complex values + if(value_is_complex) + { + UI_Box *box = ui_build_box_from_stringf(UI_BoxFlag_Clip|UI_BoxFlag_Clickable, "###val_%I64x", row_hash); + UI_Parent(box) + { + df_code_label(1.f, 1, df_rgba_from_theme_color(DF_ThemeColor_CodeDefault), row->display_value); + } + sig = ui_signal_from_box(box); + } + + // rjf: simple values (editable) + if(value_is_simple) + { + sig = df_line_editf(DF_LineEditFlag_CodeContents|DF_LineEditFlag_NoBackground, 0, 0, &edit_state->cursor, &edit_state->mark, edit_state->input_buffer, sizeof(edit_state->input_buffer), &edit_state->input_size, 0, row->display_value, "%S###val_%I64x", row->display_value, row_hash); + } + } + + // rjf: bad & hovering -> display + if(row_is_bad && ui_hovering(sig)) UI_Tooltip + { + UI_PrefWidth(ui_children_sum(1)) df_error_label(str8_lit("Could not read process memory successfully.")); + } + + // rjf: press -> focus & commit if editing & not selected + if(ui_pressed(sig)) + { + ewv->next_cursor = ewv->next_mark = pt; + pressed = 1; + } + + // rjf: double-click -> start editing + if(ui_double_clicked(sig) && value_is_simple) + { + ui_kill_action(); + DF_CmdParams p = df_cmd_params_from_view(ws, panel, view); + df_push_cmd__root(&p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_Edit)); + } + } + + //////////////////// + //- rjf: type + // + ProfScope("type") + { + DF_WatchViewPoint pt = {DF_WatchViewColumnKind_Type, row->parent_key, row->key}; + DF_WatchViewTextEditState *edit_state = df_watch_view_text_edit_state_from_pt(ewv, pt); + B32 cell_selected = (row_selected && selection_tbl.min.x <= pt.column_kind && pt.column_kind <= selection_tbl.max.x); + UI_TableCell UI_Font(code_font) + UI_FocusHot(cell_selected ? UI_FocusKind_On : UI_FocusKind_Off) + UI_FocusActive((cell_selected && ewv->text_editing) ? UI_FocusKind_On : UI_FocusKind_Off) + { + TG_Key key = row->eval.type_key; + String8 string = tg_string_from_key(scratch.arena, parse_ctx.type_graph, parse_ctx.rdi, key); + string = str8_skip_chop_whitespace(string); + UI_Box *box = ui_build_box_from_stringf(UI_BoxFlag_Clip|UI_BoxFlag_Clickable, "###type_%I64x", row_hash); + if(!tg_key_match(key, tg_key_zero())) UI_Parent(box) + { + df_code_label(1.f, 1, df_rgba_from_theme_color(DF_ThemeColor_CodeType), string); + } + UI_Signal sig = ui_signal_from_box(box); + if(ui_pressed(sig)) + { + ewv->next_cursor = ewv->next_mark = pt; + pressed = 1; + } + } + } + + //////////////////// + //- rjf: view rule + // + ProfScope("view rule") + { + DF_WatchViewPoint pt = {DF_WatchViewColumnKind_ViewRule, row->parent_key, row->key}; + DF_WatchViewTextEditState *edit_state = df_watch_view_text_edit_state_from_pt(ewv, pt); + B32 cell_selected = (row_selected && selection_tbl.min.x <= pt.column_kind && pt.column_kind <= selection_tbl.max.x); + String8 view_rule = df_eval_view_rule_from_key(eval_view, row->key); + + // rjf: build + UI_Signal sig = {0}; + B32 rule_editing_active = 0; + UI_TableCell UI_Font(code_font) + UI_FocusHot(cell_selected ? UI_FocusKind_On : UI_FocusKind_Off) + UI_FocusActive((cell_selected && ewv->text_editing) ? UI_FocusKind_On : UI_FocusKind_Off) + { + rule_editing_active = ui_is_focus_active(); + sig = df_line_editf(DF_LineEditFlag_CodeContents|DF_LineEditFlag_NoBackground, 0, 0, &edit_state->cursor, &edit_state->mark, edit_state->input_buffer, sizeof(edit_state->input_buffer), &edit_state->input_size, 0, view_rule, "###view_rule_%I64x", row_hash); + } + + // rjf: press -> commit if not selected, select this cell + if(ui_pressed(sig)) + { + ewv->next_cursor = ewv->next_mark = pt; + pressed = 1; + } + + // rjf: autocomplete lister + if(rule_editing_active && + selection_tbl.min.x == selection_tbl.max.x && selection_tbl.min.y == selection_tbl.max.y && + txt_pt_match(edit_state->cursor, edit_state->mark)) + { + String8 input = str8(edit_state->input_buffer, edit_state->input_size); + DF_AutoCompListerParams params = df_view_rule_autocomp_lister_params_from_input_cursor(scratch.arena, input, edit_state->cursor.column-1); + if(params.flags == 0) + { + params.flags = DF_AutoCompListerFlag_ViewRules; + } + df_set_autocomp_lister_query(ws, sig.box->key, ctrl_ctx, ¶ms, input, edit_state->cursor.column-1); + } + + // rjf: double-click -> begin editing + if(ui_double_clicked(sig) && !ewv->text_editing) + { + ui_kill_action(); + DF_CmdParams p = df_cmd_params_from_view(ws, panel, view); + df_push_cmd__root(&p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_Edit)); + } } } } @@ -2087,7 +2120,7 @@ DF_VIEW_CMD_FUNCTION_DEF(Empty) {} DF_VIEW_UI_FUNCTION_DEF(Empty) { ui_set_next_flags(UI_BoxFlag_DefaultFocusNav); - UI_Focus(UI_FocusKind_On) UI_WidthFill UI_HeightFill UI_NamedColumn(str8_lit("empty_view")) UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText)) + UI_Focus(UI_FocusKind_On) UI_WidthFill UI_HeightFill UI_NamedColumn(str8_lit("empty_view")) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_Padding(ui_pct(1, 0)) UI_Focus(UI_FocusKind_Null) { UI_PrefHeight(ui_em(3.f, 1.f)) @@ -2096,9 +2129,7 @@ DF_VIEW_UI_FUNCTION_DEF(Empty) UI_TextAlignment(UI_TextAlign_Center) UI_PrefWidth(ui_em(15.f, 1.f)) UI_CornerRadius(ui_top_font_size()/2.f) - UI_BackgroundColor(df_rgba_from_theme_color(DF_ThemeColor_FailureBackground)) - UI_BorderColor(df_rgba_from_theme_color(DF_ThemeColor_FailureBorder)) - UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_FailureText)) + DF_UIColorScheme(DF_UIColorSchemeCode_SpecialNegative) { if(ui_clicked(df_icon_buttonf(DF_IconKind_X, 0, "Close Panel"))) { @@ -2120,7 +2151,8 @@ DF_VIEW_UI_FUNCTION_DEF(GettingStarted) ProfBeginFunction(); Temp scratch = scratch_begin(0, 0); ui_set_next_flags(UI_BoxFlag_DefaultFocusNav); - UI_Focus(UI_FocusKind_On) UI_WidthFill UI_HeightFill UI_NamedColumn(str8_lit("empty_view")) UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText)) + UI_Focus(UI_FocusKind_On) UI_WidthFill UI_HeightFill UI_NamedColumn(str8_lit("empty_view")) + UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_Padding(ui_pct(1, 0)) UI_Focus(UI_FocusKind_Null) { DF_EntityList targets = df_push_active_target_list(scratch.arena); @@ -2171,9 +2203,7 @@ DF_VIEW_UI_FUNCTION_DEF(GettingStarted) UI_TextAlignment(UI_TextAlign_Center) UI_PrefWidth(ui_em(22.f, 1.f)) UI_CornerRadius(ui_top_font_size()/2.f) - UI_BackgroundColor(df_rgba_from_theme_color(DF_ThemeColor_ActionBackground)) - UI_BorderColor(df_rgba_from_theme_color(DF_ThemeColor_ActionBorder)) - UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_ActionText)) + DF_UIColorScheme(DF_UIColorSchemeCode_SpecialNeutral) if(ui_clicked(df_icon_buttonf(DF_IconKind_Add, 0, "Add Target"))) { DF_CmdParams params = df_cmd_params_from_view(ws, panel, view); @@ -2195,9 +2225,7 @@ DF_VIEW_UI_FUNCTION_DEF(GettingStarted) UI_TextAlignment(UI_TextAlign_Center) UI_PrefWidth(ui_em(22.f, 1.f)) UI_CornerRadius(ui_top_font_size()/2.f) - UI_BackgroundColor(df_rgba_from_theme_color(DF_ThemeColor_ActionBackground)) - UI_BorderColor(df_rgba_from_theme_color(DF_ThemeColor_ActionBorder)) - UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_ActionText)) + DF_UIColorScheme(DF_UIColorSchemeCode_SpecialNeutral) { if(ui_clicked(df_icon_buttonf(DF_IconKind_Play, 0, "Launch %S", target_name))) { @@ -2244,10 +2272,7 @@ DF_VIEW_UI_FUNCTION_DEF(GettingStarted) { ui_labelf("use"); DF_CmdSpec *spec = df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_RunCommand); - UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_PlainText)) - UI_Flags(UI_BoxFlag_DrawBorder) - UI_TextAlignment(UI_TextAlign_Center) - df_cmd_binding_button(spec); + UI_Flags(UI_BoxFlag_DrawBorder) UI_TextAlignment(UI_TextAlign_Center) df_cmd_binding_button(spec); ui_labelf("to open command menu"); } } @@ -2347,7 +2372,7 @@ DF_VIEW_UI_FUNCTION_DEF(Commands) UI_TextAlignment(UI_TextAlign_Center) UI_Font(df_font_from_slot(DF_FontSlot_Icons)) UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Icons)) - UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText)) + UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_PrefWidth(ui_em(2.25f, 1.f)) { ui_label(df_g_icon_kind_text_table[icon]); @@ -2364,7 +2389,7 @@ DF_VIEW_UI_FUNCTION_DEF(Commands) UI_TextAlignment(UI_TextAlign_Left) UI_Font(df_font_from_slot(DF_FontSlot_Code)) UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Code)) - UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText)) + UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_label(item->cmd_spec->info.string); } } @@ -2390,7 +2415,7 @@ DF_VIEW_UI_FUNCTION_DEF(Commands) UI_Column UI_Font(df_font_from_slot(DF_FontSlot_Icons)) UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Icons)) - UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText)) + UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_HeightFill UI_TextAlignment(UI_TextAlign_Center) { @@ -2413,7 +2438,7 @@ DF_VIEW_UI_FUNCTION_DEF(Commands) String8 cmd_desc = item->cmd_spec->info.description; UI_Box *name_box = ui_build_box_from_stringf(UI_BoxFlag_DrawText, "%S##name_%p", cmd_display_name, item->cmd_spec); UI_Box *desc_box = &ui_g_nil_box; - UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText)) UI_PrefHeight(ui_em(1.8f, 1.f)) + UI_PrefHeight(ui_em(1.8f, 1.f)) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) { desc_box = ui_build_box_from_stringf(UI_BoxFlag_DrawText, "%S##desc_%p", cmd_desc, item->cmd_spec); } @@ -2422,7 +2447,7 @@ DF_VIEW_UI_FUNCTION_DEF(Commands) } //- rjf: binding - UI_PrefWidth(ui_pct(0.15f, 1.f)) UI_HeightFill UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText)) + UI_PrefWidth(ui_pct(0.15f, 1.f)) UI_HeightFill UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) { df_cmd_binding_button(item->cmd_spec); } @@ -2707,7 +2732,7 @@ DF_VIEW_UI_FUNCTION_DEF(FileSystem) } UI_PrefHeight(ui_px(row_height_px, 1)) UI_Focus(UI_FocusKind_Off) UI_TableF(ArrayCount(fs->col_pcts), col_pcts, "###fs_tbl") { - UI_TableVector UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText)) + UI_TableVector { struct { @@ -2722,12 +2747,8 @@ DF_VIEW_UI_FUNCTION_DEF(FileSystem) }; for(U64 idx = 0; idx < ArrayCount(kinds); idx += 1) { - B32 sorting = fs->sort_kind == kinds[idx].kind; - if(sorting) - { - ui_push_text_color(df_rgba_from_theme_color(DF_ThemeColor_PlainText)); - } - UI_TableCell + B32 sorting = (fs->sort_kind == kinds[idx].kind); + UI_TableCell UI_FlagsAdd(sorting ? 0 : UI_BoxFlag_DrawTextWeak) { UI_Signal sig = ui_sort_header(sorting, fs->cached_files_sort_side == Side_Min, @@ -2749,10 +2770,6 @@ DF_VIEW_UI_FUNCTION_DEF(FileSystem) } } } - if(sorting) - { - ui_pop_text_color(); - } } } } @@ -2869,7 +2886,7 @@ DF_VIEW_UI_FUNCTION_DEF(FileSystem) // rjf: last-modified time UI_PrefWidth(ui_pct(fs->col_pcts[1], 1)) UI_Row UI_PrefWidth(ui_pct(1, 0)) - UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText)) + UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) { DateTime time = date_time_from_dense_time(file->props.modified); DateTime time_local = os_local_time_from_universal_time(&time); @@ -2883,7 +2900,7 @@ DF_VIEW_UI_FUNCTION_DEF(FileSystem) { if(file->props.size != 0) { - UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText)) ui_label(str8_from_memory_size(scratch.arena, file->props.size)); + UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_label(str8_from_memory_size(scratch.arena, file->props.size)); } } } @@ -3038,7 +3055,7 @@ DF_VIEW_UI_FUNCTION_DEF(SystemProcesses) } // rjf: attached indicator - if(is_attached) UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_Highlight1)) UI_PrefWidth(ui_text_dim(10, 1)) + if(is_attached) UI_PrefWidth(ui_text_dim(10, 1)) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) { UI_Box *attached_label = ui_build_box_from_stringf(UI_BoxFlag_DrawText, "[attached]##attached_label_%i", (int)info->info.pid); ui_box_equip_fuzzy_match_ranges(attached_label, &info->attached_match_ranges); @@ -3204,7 +3221,7 @@ DF_VIEW_UI_FUNCTION_DEF(EntityLister) UI_TextAlignment(UI_TextAlign_Center) UI_Font(df_font_from_slot(DF_FontSlot_Icons)) UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Icons)) - UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText)) + UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_PrefWidth(ui_text_dim(10, 1)) ui_label(df_g_icon_kind_text_table[icon_kind]); } @@ -3212,7 +3229,7 @@ DF_VIEW_UI_FUNCTION_DEF(EntityLister) Vec4F32 color = df_rgba_from_entity(ent); if(color.w != 0) { - ui_set_next_text_color(color); + ui_set_next_scheme(ui_fork_top_color_scheme(.text = color)); } UI_Box *name_label = ui_build_box_from_stringf(UI_BoxFlag_DrawText, "%S##label_%p", display_string, ent); ui_box_equip_fuzzy_match_ranges(name_label, &item.name_match_ranges); @@ -3398,12 +3415,12 @@ DF_VIEW_UI_FUNCTION_DEF(SymbolLister) "###procedure_%I64x", item->idx); UI_Parent(box) UI_PrefWidth(ui_text_dim(10, 1)) { - UI_Box *box = df_code_label(1.f, 0, df_rgba_from_theme_color(DF_ThemeColor_CodeFunction), name); + UI_Box *box = df_code_label(1.f, 0, df_rgba_from_theme_color(DF_ThemeColor_CodeProcedure), name); ui_box_equip_fuzzy_match_ranges(box, &item->match_ranges); if(!tg_key_match(tg_key_zero(), type_key) && graph != 0) { String8 type_string = tg_string_from_key(scratch.arena, graph, rdi, type_key); - df_code_label(0.5f, 0, df_rgba_from_theme_color(DF_ThemeColor_WeakText), type_string); + df_code_label(0.5f, 0, df_rgba_from_theme_color(DF_ThemeColor_DefaultTextWeak), type_string); } } @@ -3422,17 +3439,17 @@ DF_VIEW_UI_FUNCTION_DEF(SymbolLister) DF_TextLineDasm2SrcInfo dasm2src_info = df_text_line_dasm2src_info_from_dbgi_key_voff(&dbgi_key, binary_voff, 0); String8 file_path = df_full_path_from_entity(scratch.arena, dasm2src_info.file); S64 line_num = dasm2src_info.pt.line; - df_code_label(1.f, 0, df_rgba_from_theme_color(DF_ThemeColor_CodeFunction), name); - UI_Font(df_font_from_slot(DF_FontSlot_Main)) UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText)) + df_code_label(1.f, 0, df_rgba_from_theme_color(DF_ThemeColor_CodeProcedure), name); + UI_Font(df_font_from_slot(DF_FontSlot_Main)) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_labelf("Procedure #%I64u", item->idx); if(!df_entity_is_nil(dasm2src_info.file)) { - UI_Font(df_font_from_slot(DF_FontSlot_Main)) UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText)) + UI_Font(df_font_from_slot(DF_FontSlot_Main)) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_labelf("%S:%I64d", file_path, line_num); } else { - UI_Font(df_font_from_slot(DF_FontSlot_Main)) UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText)) + UI_Font(df_font_from_slot(DF_FontSlot_Main)) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_label(str8_lit("(No source code location found)")); } } @@ -3618,7 +3635,7 @@ DF_VIEW_UI_FUNCTION_DEF(Target) B32 has_browse = kv_info[idx].fill_with_file || kv_info[idx].fill_with_folder; //- rjf: key (label) - UI_TableCell UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText)) + UI_TableCell UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) { if(kv_info[idx].storage_child_kind == DF_EntityKind_EntryPointName) { @@ -3626,7 +3643,7 @@ DF_VIEW_UI_FUNCTION_DEF(Target) { ui_label_multiline(ui_top_font_size()*30.f, str8_lit("By default, the debugger attempts to find a target's entry point with a set of default names, such as:")); ui_spacer(ui_em(1.5f, 1.f)); - UI_Font(df_font_from_slot(DF_FontSlot_Code)) UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_CodeFunction)) + UI_Font(df_font_from_slot(DF_FontSlot_Code)) UI_Scheme(ui_fork_top_color_scheme(.text = df_rgba_from_theme_color(DF_ThemeColor_CodeProcedure))) { ui_label(str8_lit("WinMain")); ui_label(str8_lit("wWinMain")); @@ -4084,7 +4101,7 @@ DF_VIEW_UI_FUNCTION_DEF(FilePathMap) next_cursor = fpms->cursor; //- rjf: header - if(visible_row_range.min == 0) UI_TableVector UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText)) + if(visible_row_range.min == 0) UI_TableVector UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) { UI_TableCell if(df_help_label(str8_lit("Source Path"))) UI_Tooltip { @@ -4407,7 +4424,7 @@ DF_VIEW_UI_FUNCTION_DEF(AutoViewRules) next_cursor = avrs->cursor; //- rjf: header - if(visible_row_range.min == 0) UI_TableVector UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText)) + if(visible_row_range.min == 0) UI_TableVector UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) { UI_TableCell ui_label(str8_lit("Type")); UI_TableCell ui_label(str8_lit("View Rule")); @@ -4724,18 +4741,21 @@ DF_VIEW_UI_FUNCTION_DEF(Scheduler) { B32 frozen_by_solo_mode = (entity->kind == DF_EntityKind_Thread && entity != df_entity_from_handle(ctrl_ctx.thread) && df_state->ctrl_solo_stepping_mode); B32 frozen = df_entity_is_frozen(entity); - Vec4F32 frozen_color = df_rgba_from_theme_color(DF_ThemeColor_FailureBackground); - Vec4F32 frozen_in_solo_mode_color = df_rgba_from_theme_color(DF_ThemeColor_Highlight0); - Vec4F32 thawed_color = df_rgba_from_theme_color(DF_ThemeColor_SuccessBackground); - UI_Signal sig = {0}; - UI_BackgroundColor(frozen ? frozen_color : thawed_color) + UI_ColorScheme *scheme = ui_top_scheme(); + if(frozen_by_solo_mode) { - if(frozen_by_solo_mode) - { - ui_set_next_background_color(frozen_in_solo_mode_color); - } - sig = df_icon_buttonf(frozen ? DF_IconKind_Locked : DF_IconKind_Unlocked, 0, "###lock_%p", entity); + scheme = ui_fork_top_color_scheme(.background = df_rgba_from_theme_color(DF_ThemeColor_Highlight0)); } + else if(frozen) + { + scheme = df_ui_color_scheme_from_code(DF_UIColorSchemeCode_SpecialNegative); + } + else + { + scheme = df_ui_color_scheme_from_code(DF_UIColorSchemeCode_SpecialPositive); + } + UI_Signal sig = {0}; + UI_Scheme(scheme) sig = df_icon_buttonf(frozen ? DF_IconKind_Locked : DF_IconKind_Unlocked, 0, "###lock_%p", entity); if(frozen_by_solo_mode && ui_hovering(sig)) UI_Tooltip { ui_label(str8_lit("This thread is frozen during stepping operations because it isn't selected, and Solo Stepping Mode is enabled.")); @@ -4789,9 +4809,7 @@ DF_VIEW_UI_FUNCTION_DEF(Scheduler) } UI_TableCellSized(ui_em(2.25f, 1.f)) UI_FocusHot((row_is_selected && cursor.x == 4) ? UI_FocusKind_On : UI_FocusKind_Off) { - UI_BackgroundColor(df_rgba_from_theme_color(DF_ThemeColor_FailureBackground)) - UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_FailureText)) - UI_BorderColor(df_rgba_from_theme_color(DF_ThemeColor_FailureBorder)) + DF_UIColorScheme(DF_UIColorSchemeCode_SpecialNegative) if(ui_clicked(df_icon_buttonf(DF_IconKind_X, 0, "###kill"))) { DF_CmdParams params = df_cmd_params_from_view(ws, panel, view); @@ -4846,7 +4864,7 @@ DF_VIEW_UI_FUNCTION_DEF(CallStack) DF_Entity *thread = df_entity_from_handle(ctrl_ctx.thread); Architecture arch = df_architecture_from_entity(thread); DF_Entity *process = thread->parent; - Vec4F32 thread_color = df_rgba_from_theme_color(DF_ThemeColor_PlainText); + Vec4F32 thread_color = ui_top_scheme()->text; if(thread->flags & DF_EntityFlag_HasColor) { thread_color = df_rgba_from_entity(thread); @@ -4908,7 +4926,7 @@ DF_VIEW_UI_FUNCTION_DEF(CallStack) UI_TableF(ArrayCount(col_pcts), col_pcts, "###tbl") { //- rjf: header - if(visible_row_range.min == 0) UI_TableVector UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText)) + if(visible_row_range.min == 0) UI_TableVector UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) { UI_TableCell {} UI_TableCell ui_label(str8_lit("Module")); @@ -4956,7 +4974,6 @@ DF_VIEW_UI_FUNCTION_DEF(CallStack) UI_TableCell UI_Font(df_font_from_slot(DF_FontSlot_Icons)) UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Icons)) - UI_TextColor(thread_color) UI_WidthFill UI_TextAlignment(UI_TextAlign_Center) UI_FocusHot((row_selected && cs->cursor.x == 0) ? UI_FocusKind_On : UI_FocusKind_Off) @@ -4966,6 +4983,7 @@ DF_VIEW_UI_FUNCTION_DEF(CallStack) ctrl_ctx.inline_unwind_count == frame->inline_unwind_idx) { selected_string = df_g_icon_kind_text_table[DF_IconKind_RightArrow]; + ui_set_next_scheme(ui_fork_top_color_scheme(.text = thread_color)); } UI_Box *box = ui_build_box_from_stringf(UI_BoxFlag_Clickable|UI_BoxFlag_DrawText, "%S###selection_%i", selected_string, (int)frame_idx); @@ -4990,7 +5008,7 @@ DF_VIEW_UI_FUNCTION_DEF(CallStack) // rjf: build cell for module UI_TableCell UI_FocusHot((row_selected && cs->cursor.x == 1) ? UI_FocusKind_On : UI_FocusKind_Off) { - if(df_entity_is_nil(module)) UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText)) + if(df_entity_is_nil(module)) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) { UI_Box *box = ui_build_box_from_stringf(UI_BoxFlag_DrawText|UI_BoxFlag_Clickable, "(No Module)###moduleless_frame_%I64x", frame_idx); UI_Signal sig = ui_signal_from_box(box); @@ -5017,24 +5035,22 @@ DF_VIEW_UI_FUNCTION_DEF(CallStack) { if(frame->inline_site != 0) { - UI_PrefWidth(ui_text_dim(10, 1)) + UI_PrefWidth(ui_text_dim(10, 1)) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) { - ui_set_next_text_color(df_rgba_from_theme_color(DF_ThemeColor_WeakText)); ui_label(str8_lit("[inlined]")); } } if(symbol_name.size == 0) { - ui_set_next_text_color(df_rgba_from_theme_color(DF_ThemeColor_WeakText)); - ui_label(str8_lit("[unknown symbol]")); + UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_label(str8_lit("[unknown symbol]")); } else UI_WidthFill { - D_FancyStringList symbol_name_fstrs = df_fancy_string_list_from_code_string(scratch.arena, 1.f, 0, df_rgba_from_theme_color(DF_ThemeColor_CodeFunction), symbol_name); + D_FancyStringList symbol_name_fstrs = df_fancy_string_list_from_code_string(scratch.arena, 1.f, 0, df_rgba_from_theme_color(DF_ThemeColor_CodeProcedure), symbol_name); D_FancyStringList symbol_type_fstrs = df_fancy_string_list_from_code_string(scratch.arena, 0.5f, 0, df_rgba_from_theme_color(DF_ThemeColor_CodeDefault), symbol_type_string); D_FancyStringList fstrs = {0}; d_fancy_string_list_concat_in_place(&fstrs, &symbol_name_fstrs); - D_FancyString sep = {ui_top_font(), str8_lit(": "), df_rgba_from_theme_color(DF_ThemeColor_WeakText), ui_top_font_size()}; + D_FancyString sep = {ui_top_font(), str8_lit(": "), ui_top_scheme()->colors[UI_ColorCode_TextWeak], ui_top_font_size()}; d_fancy_string_list_push(scratch.arena, &fstrs, &sep); d_fancy_string_list_concat_in_place(&fstrs, &symbol_type_fstrs); UI_Box *label = ui_build_box_from_key(UI_BoxFlag_DrawText, ui_key_zero()); @@ -5300,7 +5316,7 @@ DF_VIEW_UI_FUNCTION_DEF(Modules) case DF_EntityKind_Module: UI_NamedTableVectorF("module_%p", entity) { - UI_TableCell UI_TextAlignment(UI_TextAlign_Center) UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText)) + UI_TableCell UI_TextAlignment(UI_TextAlign_Center) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) { ui_labelf("%I64u", idx_in_process); } @@ -5346,7 +5362,7 @@ DF_VIEW_UI_FUNCTION_DEF(Modules) UI_FocusActive((txt_is_selected && mv->txt_editing) ? UI_FocusKind_On : UI_FocusKind_Off) UI_WidthFill { - UI_TextColor(!dbgi_is_valid ? df_rgba_from_theme_color(DF_ThemeColor_FailureBackground) : ui_top_text_color()) + DF_UIColorScheme(dbgi_is_valid ? DF_UIColorSchemeCode_DefaultPositive : DF_UIColorSchemeCode_Default) sig = df_line_editf(DF_LineEditFlag_NoBackground, 0, 0, &mv->txt_cursor, &mv->txt_mark, mv->txt_buffer, sizeof(mv->txt_buffer), &mv->txt_size, 0, dbgi_path, "###dbg_path_%p", entity); edit_commit = (edit_commit || ui_committed(sig)); } @@ -6013,7 +6029,7 @@ DF_VIEW_UI_FUNCTION_DEF(Code) UI_PrefWidth(ui_children_sum(1)) UI_PrefHeight(ui_em(3, 1)) UI_Row UI_Padding(ui_pct(1, 0)) UI_PrefWidth(ui_text_dim(10, 1)) - UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_FailureBackground)) + DF_UIColorScheme(DF_UIColorSchemeCode_DefaultNegative) { UI_Font(ui_icon_font()) ui_label(df_g_icon_kind_text_table[DF_IconKind_WarningBig]); ui_labelf("Could not find \"%S\".", full_path); @@ -6021,12 +6037,10 @@ DF_VIEW_UI_FUNCTION_DEF(Code) UI_PrefHeight(ui_em(3, 1)) UI_Row UI_Padding(ui_pct(1, 0)) UI_PrefWidth(ui_text_dim(10, 1)) - UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_ActionText)) - UI_BackgroundColor(df_rgba_from_theme_color(DF_ThemeColor_ActionBackground)) - UI_BorderColor(df_rgba_from_theme_color(DF_ThemeColor_ActionBorder)) UI_CornerRadius(ui_top_font_size()/3) UI_PrefWidth(ui_text_dim(10, 1)) UI_Focus(UI_FocusKind_On) + DF_UIColorScheme(DF_UIColorSchemeCode_SpecialNeutral) if(ui_clicked(ui_buttonf("Find alternative..."))) { DF_CmdParams params = df_cmd_params_from_view(ws, panel, view); @@ -6556,12 +6570,11 @@ DF_VIEW_UI_FUNCTION_DEF(Code) ui_set_next_fixed_y(code_area_dim.y + scroll_bar_dim); ui_set_next_pref_width(ui_px(bottom_bar_dim.x, 1)); ui_set_next_pref_height(ui_px(bottom_bar_dim.y, 1)); - ui_set_next_background_color(df_rgba_from_theme_color(file_is_out_of_date ? DF_ThemeColor_FailureBackground : DF_ThemeColor_AltBackground)); ui_set_next_flags(UI_BoxFlag_DrawBackground); UI_Row UI_TextAlignment(UI_TextAlign_Center) UI_PrefWidth(ui_text_dim(10, 1)) - UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText)) + UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) { String8 full_path = df_full_path_from_entity(scratch.arena, entity); TXTI_Handle handle = txti_handle_from_path(full_path); @@ -6569,7 +6582,7 @@ DF_VIEW_UI_FUNCTION_DEF(Code) if(file_is_out_of_date) { UI_Box *box = &ui_g_nil_box; - UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_FailureText)) + DF_UIColorScheme(DF_UIColorSchemeCode_SpecialNegative) UI_Font(df_font_from_slot(DF_FontSlot_Icons)) { box = ui_build_box_from_stringf(UI_BoxFlag_DrawText|UI_BoxFlag_Clickable, "%S###file_ood_warning", df_g_icon_kind_text_table[DF_IconKind_WarningBig]); @@ -6580,7 +6593,7 @@ DF_VIEW_UI_FUNCTION_DEF(Code) UI_PrefWidth(ui_children_sum(1)) UI_Row UI_PrefWidth(ui_text_dim(1, 1)) { ui_labelf("This file has changed since ", out_of_date_dbgi_name); - UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_Highlight0)) ui_label(out_of_date_dbgi_name); + UI_Scheme(ui_fork_top_color_scheme(.text = df_rgba_from_theme_color(DF_ThemeColor_Highlight0))) ui_label(out_of_date_dbgi_name); ui_labelf(" was produced."); } } @@ -7433,12 +7446,11 @@ DF_VIEW_UI_FUNCTION_DEF(Disassembly) ui_set_next_fixed_y(code_area_dim.y + scroll_bar_dim); ui_set_next_pref_width(ui_px(bottom_bar_dim.x, 1)); ui_set_next_pref_height(ui_px(bottom_bar_dim.y, 1)); - ui_set_next_background_color(df_rgba_from_theme_color(DF_ThemeColor_AltBackground)); ui_set_next_flags(UI_BoxFlag_DrawBackground); UI_Row UI_TextAlignment(UI_TextAlign_Center) UI_PrefWidth(ui_text_dim(10, 1)) - UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText)) + UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_Font(code_font) { DF_Entity *module = df_module_from_process_vaddr(process, dasm_vaddr_range.min); @@ -8235,12 +8247,11 @@ DF_VIEW_UI_FUNCTION_DEF(Output) ui_set_next_fixed_y(code_area_dim.y + scroll_bar_dim); ui_set_next_pref_width(ui_px(bottom_bar_dim.x, 1)); ui_set_next_pref_height(ui_px(bottom_bar_dim.y, 1)); - ui_set_next_background_color(df_rgba_from_theme_color(DF_ThemeColor_AltBackground)); ui_set_next_flags(UI_BoxFlag_DrawBackground); UI_Row UI_TextAlignment(UI_TextAlign_Center) UI_PrefWidth(ui_text_dim(10, 1)) - UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText)) + UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_Font(code_font) { ui_labelf("Line: %I64d, Column: %I64d", tv->cursor.line, tv->cursor.column); @@ -8505,8 +8516,8 @@ DF_VIEW_UI_FUNCTION_DEF(Memory) // D_FancyStringList byte_fancy_strings[256] = {0}; { - Vec4F32 full_color = df_rgba_from_theme_color(DF_ThemeColor_Highlight1); - Vec4F32 zero_color = df_rgba_from_theme_color(DF_ThemeColor_WeakText); + Vec4F32 full_color = df_rgba_from_theme_color(DF_ThemeColor_DefaultTextPositive); + Vec4F32 zero_color = df_rgba_from_theme_color(DF_ThemeColor_DefaultTextWeak); for(U64 idx = 0; idx < ArrayCount(byte_fancy_strings); idx += 1) { U8 byte = (U8)idx; @@ -8628,7 +8639,7 @@ DF_VIEW_UI_FUNCTION_DEF(Memory) Annotation *annotation = push_array(scratch.arena, Annotation, 1); annotation->name_string = symbol_name.size != 0 ? symbol_name : str8_lit("[external code]"); annotation->kind_string = str8_lit("Call Stack Frame"); - annotation->color = symbol_name.size != 0 ? df_rgba_from_theme_color(DF_ThemeColor_CodeFunction) : df_rgba_from_theme_color(DF_ThemeColor_WeakText); + annotation->color = symbol_name.size != 0 ? df_rgba_from_theme_color(DF_ThemeColor_CodeProcedure) : df_rgba_from_theme_color(DF_ThemeColor_DefaultTextWeak); annotation->vaddr_range = frame_vaddr_range; for(U64 vaddr = frame_vaddr_range_in_viz.min; vaddr < frame_vaddr_range_in_viz.max; vaddr += 1) { @@ -8651,7 +8662,7 @@ DF_VIEW_UI_FUNCTION_DEF(Memory) Annotation *annotation = push_array(scratch.arena, Annotation, 1); annotation->name_string = df_display_string_from_entity(scratch.arena, thread); annotation->kind_string = str8_lit("Stack"); - annotation->color = thread->flags & DF_EntityFlag_HasColor ? df_rgba_from_entity(thread) : df_rgba_from_theme_color(DF_ThemeColor_PlainText); + annotation->color = thread->flags & DF_EntityFlag_HasColor ? df_rgba_from_entity(thread) : df_rgba_from_theme_color(DF_ThemeColor_DefaultText); annotation->vaddr_range = stack_vaddr_range; for(U64 vaddr = stack_vaddr_range_in_viz.min; vaddr < stack_vaddr_range_in_viz.max; vaddr += 1) { @@ -8732,7 +8743,7 @@ DF_VIEW_UI_FUNCTION_DEF(Memory) UI_Parent(header_box) UI_Font(font) UI_FontSize(font_size) - UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText)) + UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) { UI_PrefWidth(ui_px(big_glyph_advance*18.f, 1.f)) ui_labelf("Address"); UI_PrefWidth(ui_px(cell_width_px, 1.f)) @@ -8741,9 +8752,9 @@ DF_VIEW_UI_FUNCTION_DEF(Memory) Rng1U64 col_selection_rng = r1u64(mv->cursor%mv->num_columns, mv->mark%mv->num_columns); for(U64 row_off = 0; row_off < mv->num_columns*mv->bytes_per_cell; row_off += mv->bytes_per_cell) { - if(col_selection_rng.min <= row_off && row_off <= col_selection_rng.max) + if(!(col_selection_rng.min <= row_off && row_off <= col_selection_rng.max)) { - ui_set_next_text_color(df_rgba_from_theme_color(DF_ThemeColor_PlainText)); + ui_set_next_flags(UI_BoxFlag_DrawTextWeak); } ui_labelf("%I64X", row_off); } @@ -8906,23 +8917,21 @@ DF_VIEW_UI_FUNCTION_DEF(Memory) row_is_boundary = 1; row_boundary_color = df_rgba_from_theme_color(DF_ThemeColor_Highlight0); } - ui_set_next_border_color(row_boundary_color); UI_Box *row = ui_build_box_from_stringf(UI_BoxFlag_DrawSideTop*!!row_is_boundary, "row_%I64x", row_range_bytes.min); UI_Parent(row) { UI_PrefWidth(ui_px(big_glyph_advance*18.f, 1.f)) { - ui_set_next_text_color((selection.max >= row_range_bytes.min && selection.min < row_range_bytes.max) - ? df_rgba_from_theme_color(DF_ThemeColor_PlainText) - : df_rgba_from_theme_color(DF_ThemeColor_WeakText)); + if(!(selection.max >= row_range_bytes.min && selection.min < row_range_bytes.max)) + { + ui_set_next_flags(UI_BoxFlag_DrawTextWeak); + } ui_labelf("%016I64X", row_range_bytes.min); } UI_PrefWidth(ui_px(cell_width_px, 1.f)) UI_TextAlignment(UI_TextAlign_Center) UI_CornerRadius(0) { - Vec4F32 full_color = df_rgba_from_theme_color(DF_ThemeColor_Highlight1); - Vec4F32 zero_color = df_rgba_from_theme_color(DF_ThemeColor_WeakText); for(U64 col_idx = 0; col_idx < mv->num_columns; col_idx += 1) { U64 visible_byte_idx = (row_idx-viz_range_rows.min)*mv->num_columns + col_idx; @@ -8954,15 +8963,7 @@ DF_VIEW_UI_FUNCTION_DEF(Memory) if(selection.min <= global_byte_idx && global_byte_idx <= selection.max) { cell_flags |= UI_BoxFlag_DrawBackground; - cell_bg_rgba = df_rgba_from_theme_color(DF_ThemeColor_TextSelection); - } - if(cell_flags & (UI_BoxFlag_DrawBorder|UI_BoxFlag_DrawSideTop|UI_BoxFlag_DrawSideLeft|UI_BoxFlag_DrawSideRight|UI_BoxFlag_DrawSideBottom)) - { - ui_set_next_border_color(cell_border_rgba); - } - if(cell_flags & UI_BoxFlag_DrawBackground) - { - ui_set_next_background_color(cell_bg_rgba); + cell_bg_rgba = df_rgba_from_theme_color(DF_ThemeColor_Selection); } UI_Box *cell_box = ui_build_box_from_key(UI_BoxFlag_DrawText|cell_flags, ui_key_zero()); ui_box_equip_display_fancy_strings(cell_box, 0, &byte_fancy_strings[byte_value]); @@ -8972,7 +8973,7 @@ DF_VIEW_UI_FUNCTION_DEF(Memory) { if(global_byte_idx == a->vaddr_range.min) UI_Parent(row_overlay_box) { - ui_set_next_background_color(annotation->color); + ui_set_next_scheme(ui_fork_top_color_scheme(.background = annotation->color)); ui_set_next_fixed_x(big_glyph_advance*18.f + col_idx*cell_width_px + -cell_width_px/8.f + off); ui_set_next_fixed_y((row_idx-viz_range_rows.min)*row_height_px + -cell_width_px/8.f); ui_set_next_fixed_width(cell_width_px/4.f); @@ -8992,14 +8993,14 @@ DF_VIEW_UI_FUNCTION_DEF(Memory) { UI_PrefWidth(ui_children_sum(1)) UI_Row UI_PrefWidth(ui_text_dim(10, 1)) { - UI_TextColor(a->color) UI_Font(font) ui_label(a->name_string); - UI_Font(df_font_from_slot(DF_FontSlot_Main)) UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText)) ui_label(a->kind_string); + UI_Font(font) ui_label(a->name_string); + UI_Font(df_font_from_slot(DF_FontSlot_Main)) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_label(a->kind_string); } if(a->type_string.size != 0) { df_code_label(1.f, 1, df_rgba_from_theme_color(DF_ThemeColor_CodeType), a->type_string); } - UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText)) ui_label(str8_from_memory_size(scratch.arena, dim_1u64(a->vaddr_range))); + UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_label(str8_from_memory_size(scratch.arena, dim_1u64(a->vaddr_range))); if(a->next != 0) { ui_spacer(ui_em(1.5f, 1.f)); @@ -9034,7 +9035,7 @@ DF_VIEW_UI_FUNCTION_DEF(Memory) ascii_box->rect.y0, text_pos.x + f_dim_from_tag_size_string(font, font_size, 0, 0, str8_prefix(ascii_text, selection_in_row.max+1-row_range_bytes.min)).x + font_size/4.f, ascii_box->rect.y1), - df_rgba_from_theme_color(DF_ThemeColor_TextSelection), + df_rgba_from_theme_color(DF_ThemeColor_Selection), 0, 0, 1.f); } ui_box_equip_draw_bucket(ascii_box, bucket); @@ -9073,7 +9074,7 @@ DF_VIEW_UI_FUNCTION_DEF(Memory) footer_box = ui_build_box_from_stringf(UI_BoxFlag_DrawBackground|UI_BoxFlag_DrawDropShadow, "footer"); UI_Parent(footer_box) UI_Font(font) UI_FontSize(font_size) { - UI_PrefWidth(ui_em(7.5f, 1.f)) UI_HeightFill UI_Column UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText)) + UI_PrefWidth(ui_em(7.5f, 1.f)) UI_HeightFill UI_Column UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_PrefHeight(ui_px(row_height_px, 0.f)) { ui_labelf("Address:"); @@ -9082,7 +9083,7 @@ DF_VIEW_UI_FUNCTION_DEF(Memory) ui_labelf("U32:"); ui_labelf("U64:"); } - UI_PrefWidth(ui_em(45.f, 1.f)) UI_HeightFill UI_Column UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_CodeNumeric)) + UI_PrefWidth(ui_em(45.f, 1.f)) UI_HeightFill UI_Column UI_PrefHeight(ui_px(row_height_px, 0.f)) { B32 cursor_in_range = (viz_range_bytes.min <= mv->cursor && mv->cursor+8 <= viz_range_bytes.max); @@ -9198,7 +9199,7 @@ DF_VIEW_UI_FUNCTION_DEF(Breakpoints) UI_Focus(UI_FocusKind_Null) UI_TableF(ArrayCount(col_pcts), col_pcts, "breakpoints_table") { - if(visible_row_range.min == 0) UI_TableVector UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText)) + if(visible_row_range.min == 0) UI_TableVector UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) { UI_TableCell{} UI_TableCell{ui_labelf("Name");} @@ -9373,7 +9374,7 @@ DF_VIEW_UI_FUNCTION_DEF(WatchPins) UI_Focus(UI_FocusKind_Null) UI_TableF(ArrayCount(col_pcts), col_pcts, "pins_table") { - if(visible_row_range.min == 0) UI_TableVector UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText)) + if(visible_row_range.min == 0) UI_TableVector UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) { UI_TableCell{ui_labelf("Name");} UI_TableCell{ui_labelf("Location");} @@ -9674,12 +9675,12 @@ DF_VIEW_UI_FUNCTION_DEF(Theme) preset = (DF_ThemePreset)(preset+1)) { Vec4F32 *colors = df_g_theme_preset_colors_table[preset]; - Vec4F32 bg_color = colors[DF_ThemeColor_PlainBackground]; - Vec4F32 tx_color = colors[DF_ThemeColor_PlainText]; - Vec4F32 bd_color = colors[DF_ThemeColor_PlainBorder]; - ui_set_next_background_color(bg_color); - ui_set_next_text_color(tx_color); - ui_set_next_border_color(bd_color); + Vec4F32 bg_color = colors[DF_ThemeColor_DefaultBackground]; + Vec4F32 tx_color = colors[DF_ThemeColor_DefaultText]; + Vec4F32 bd_color = colors[DF_ThemeColor_DefaultBorder]; + ui_set_next_scheme(ui_fork_top_color_scheme(.text = tx_color, + .border = bd_color, + .background = bg_color)); if(ui_clicked(ui_buttonf("%S", df_g_theme_preset_display_string_table[preset]))) { MemoryCopy(df_gfx_state->cfg_theme_target.colors, colors, sizeof(df_gfx_state->cfg_theme_target.colors)); @@ -9710,7 +9711,7 @@ DF_VIEW_UI_FUNCTION_DEF(Theme) UI_Row { ui_spacer(ui_em(1.5f, 1.f)); - UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText)) ui_label(df_g_theme_color_display_string_table[color]); + UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_label(df_g_theme_color_display_string_table[color]); } ui_spacer(ui_em(1.5f, 1.f)); @@ -9760,7 +9761,7 @@ DF_VIEW_UI_FUNCTION_DEF(Theme) String8 a_string = push_str8f(scratch.arena, "%.2f", rgba.w); UI_Row UI_Font(df_font_from_slot(DF_FontSlot_Code)) { - UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText)) UI_PrefWidth(ui_em(4.5f, 1.f)) ui_labelf("Hex"); + UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_PrefWidth(ui_em(4.5f, 1.f)) ui_labelf("Hex"); UI_Signal sig = df_line_editf(DF_LineEditFlag_Border, 0, 0, &sv->txt_cursor, &sv->txt_mark, sv->txt_buffer, sizeof(sv->txt_buffer), &sv->txt_size, 0, hex_string, "###hex_edit"); if(ui_committed(sig)) { @@ -9773,7 +9774,7 @@ DF_VIEW_UI_FUNCTION_DEF(Theme) ui_spacer(ui_em(0.75f, 1.f)); UI_Row { - UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText)) UI_PrefWidth(ui_em(4.5f, 1.f)) ui_labelf("R"); + UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_PrefWidth(ui_em(4.5f, 1.f)) ui_labelf("R"); UI_Signal sig = df_line_editf(DF_LineEditFlag_Border, 0, 0, &sv->txt_cursor, &sv->txt_mark, sv->txt_buffer, sizeof(sv->txt_buffer), &sv->txt_size, 0, r_string, "###r_edit"); if(ui_committed(sig)) { @@ -9785,7 +9786,7 @@ DF_VIEW_UI_FUNCTION_DEF(Theme) } UI_Row { - UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText)) UI_PrefWidth(ui_em(4.5f, 1.f)) ui_labelf("G"); + UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_PrefWidth(ui_em(4.5f, 1.f)) ui_labelf("G"); UI_Signal sig = df_line_editf(DF_LineEditFlag_Border, 0, 0, &sv->txt_cursor, &sv->txt_mark, sv->txt_buffer, sizeof(sv->txt_buffer), &sv->txt_size, 0, g_string, "###g_edit"); if(ui_committed(sig)) { @@ -9797,7 +9798,7 @@ DF_VIEW_UI_FUNCTION_DEF(Theme) } UI_Row { - UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText)) UI_PrefWidth(ui_em(4.5f, 1.f)) ui_labelf("B"); + UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_PrefWidth(ui_em(4.5f, 1.f)) ui_labelf("B"); UI_Signal sig = df_line_editf(DF_LineEditFlag_Border, 0, 0, &sv->txt_cursor, &sv->txt_mark, sv->txt_buffer, sizeof(sv->txt_buffer), &sv->txt_size, 0, b_string, "###b_edit"); if(ui_committed(sig)) { @@ -9810,7 +9811,7 @@ DF_VIEW_UI_FUNCTION_DEF(Theme) ui_spacer(ui_em(0.75f, 1.f)); UI_Row { - UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText)) UI_PrefWidth(ui_em(4.5f, 1.f)) ui_labelf("H"); + UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_PrefWidth(ui_em(4.5f, 1.f)) ui_labelf("H"); UI_Signal sig = df_line_editf(DF_LineEditFlag_Border, 0, 0, &sv->txt_cursor, &sv->txt_mark, sv->txt_buffer, sizeof(sv->txt_buffer), &sv->txt_size, 0, h_string, "###h_edit"); if(ui_committed(sig)) { @@ -9821,7 +9822,7 @@ DF_VIEW_UI_FUNCTION_DEF(Theme) } UI_Row { - UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText)) UI_PrefWidth(ui_em(4.5f, 1.f)) ui_labelf("S"); + UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_PrefWidth(ui_em(4.5f, 1.f)) ui_labelf("S"); UI_Signal sig = df_line_editf(DF_LineEditFlag_Border, 0, 0, &sv->txt_cursor, &sv->txt_mark, sv->txt_buffer, sizeof(sv->txt_buffer), &sv->txt_size, 0, s_string, "###s_edit"); if(ui_committed(sig)) { @@ -9832,7 +9833,7 @@ DF_VIEW_UI_FUNCTION_DEF(Theme) } UI_Row { - UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText)) UI_PrefWidth(ui_em(4.5f, 1.f)) ui_labelf("V"); + UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_PrefWidth(ui_em(4.5f, 1.f)) ui_labelf("V"); UI_Signal sig = df_line_editf(DF_LineEditFlag_Border, 0, 0, &sv->txt_cursor, &sv->txt_mark, sv->txt_buffer, sizeof(sv->txt_buffer), &sv->txt_size, 0, v_string, "###v_edit"); if(ui_committed(sig)) { @@ -9844,7 +9845,7 @@ DF_VIEW_UI_FUNCTION_DEF(Theme) ui_spacer(ui_em(0.75f, 1.f)); UI_Row { - UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText)) UI_PrefWidth(ui_em(4.5f, 1.f)) ui_labelf("A"); + UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_PrefWidth(ui_em(4.5f, 1.f)) ui_labelf("A"); UI_Signal sig = df_line_editf(DF_LineEditFlag_Border, 0, 0, &sv->txt_cursor, &sv->txt_mark, sv->txt_buffer, sizeof(sv->txt_buffer), &sv->txt_size, 0, a_string, "###a_edit"); if(ui_committed(sig)) { @@ -9923,7 +9924,6 @@ DF_VIEW_UI_FUNCTION_DEF(Theme) Vec3F32 hsv = hsv_from_rgb(rgb); Vec4F32 hsva = v4f32(hsv.x, hsv.y, hsv.z, rgba.w); ui_set_next_pref_width(ui_pct(1, 0)); - ui_set_next_background_color(v4f32(0, 0, 0, 0)); ui_set_next_hover_cursor(OS_Cursor_HandPoint); UI_Box *color_row = ui_build_box_from_stringf(UI_BoxFlag_DrawBorder| UI_BoxFlag_DrawBackground| @@ -9933,15 +9933,15 @@ DF_VIEW_UI_FUNCTION_DEF(Theme) "###color_%I64x", (U64)color); UI_Parent(color_row) { - Vec4F32 bg_color = ui_top_background_color(); - Vec4F32 default_text_color = ui_top_text_color(); + Vec4F32 bg_color = ui_top_scheme()->background; + Vec4F32 default_text_color = ui_top_scheme()->text; F32 default_fallback_factor = clamp_1f32(r1f32(0.3f, 1), dot_4f32(normalize_4f32(rgba), normalize_4f32(bg_color))) - 0.3f; Vec4F32 text_rgba = mix_4f32(rgba, default_text_color, default_fallback_factor); - UI_WidthFill UI_TextColor(text_rgba) ui_label(df_g_theme_color_display_string_table[color]); + UI_WidthFill UI_Scheme(ui_fork_top_color_scheme(.text = text_rgba)) ui_label(df_g_theme_color_display_string_table[color]); ui_set_next_pref_width(ui_top_pref_height()); UI_HeightFill UI_Column UI_Padding(ui_em(0.3f, 1)) { - ui_set_next_background_color(rgba); + ui_set_next_scheme(ui_fork_top_color_scheme(.background = rgba)); ui_set_next_corner_radius_00(ui_top_font_size()/4.f); ui_set_next_corner_radius_01(ui_top_font_size()/4.f); ui_set_next_corner_radius_10(ui_top_font_size()/4.f); diff --git a/src/df/gfx/generated/df_gfx.meta.c b/src/df/gfx/generated/df_gfx.meta.c index 7b0ef1c8..7b413893 100644 --- a/src/df/gfx/generated/df_gfx.meta.c +++ b/src/df/gfx/generated/df_gfx.meta.c @@ -4,600 +4,6 @@ //- GENERATED CODE C_LINKAGE_BEGIN -String8 df_g_theme_preset_display_string_table[9] = -{ -str8_lit_comp("Default (Dark)"), -str8_lit_comp("Default (Light)"), -str8_lit_comp("VS (Dark)"), -str8_lit_comp("VS (Light)"), -str8_lit_comp("Solarized (Dark)"), -str8_lit_comp("Solarized (Light)"), -str8_lit_comp("Handmade Hero"), -str8_lit_comp("4coder"), -str8_lit_comp("Far Manager"), -}; - -String8 df_g_theme_preset_code_string_table[9] = -{ -str8_lit_comp("default_dark"), -str8_lit_comp("default_light"), -str8_lit_comp("vs_dark"), -str8_lit_comp("vs_light"), -str8_lit_comp("solarized_dark"), -str8_lit_comp("solarized_light"), -str8_lit_comp("handmade_hero"), -str8_lit_comp("four_coder"), -str8_lit_comp("far_manager"), -}; - -Vec4F32 df_g_theme_preset_colors__default_dark[54] = -{ -rgba_from_u32_lit_comp(0xff00ffff), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0x3333337f), -rgba_from_u32_lit_comp(0xffffff19), -rgba_from_u32_lit_comp(0xffffff33), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0x7fcc99ff), -rgba_from_u32_lit_comp(0x66b2e5ff), -rgba_from_u32_lit_comp(0xfe9548ff), -rgba_from_u32_lit_comp(0xd45d90ff), -rgba_from_u32_lit_comp(0xf7bf5eff), -rgba_from_u32_lit_comp(0x994c32ff), -rgba_from_u32_lit_comp(0x4ce54cff), -rgba_from_u32_lit_comp(0xe5cc66ff), -rgba_from_u32_lit_comp(0xe54c4cff), -rgba_from_u32_lit_comp(0x7f7f7fff), -rgba_from_u32_lit_comp(0x99503d3f), -rgba_from_u32_lit_comp(0xfe82493f), -rgba_from_u32_lit_comp(0xffba173f), -rgba_from_u32_lit_comp(0xcefd693f), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0x42474c7f), -rgba_from_u32_lit_comp(0xffffff19), -rgba_from_u32_lit_comp(0xffffff33), -rgba_from_u32_lit_comp(0x42474c7f), -rgba_from_u32_lit_comp(0xa87a4c99), -rgba_from_u32_lit_comp(0x4293cc99), -rgba_from_u32_lit_comp(0x8e2d4ccc), -rgba_from_u32_lit_comp(0xffffff7f), -rgba_from_u32_lit_comp(0x99ccff4c), -rgba_from_u32_lit_comp(0x66e566e5), -rgba_from_u32_lit_comp(0xb27219ff), -rgba_from_u32_lit_comp(0x327f19ff), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0x32b219ff), -rgba_from_u32_lit_comp(0xffffff33), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xffffff33), -rgba_from_u32_lit_comp(0xffffffff), -rgba_from_u32_lit_comp(0x327fb2ff), -rgba_from_u32_lit_comp(0xffffff33), -rgba_from_u32_lit_comp(0xffffff0c), -rgba_from_u32_lit_comp(0xffcb7fff), -rgba_from_u32_lit_comp(0xb2ff65ff), -rgba_from_u32_lit_comp(0xff99e5ff), -rgba_from_u32_lit_comp(0x6598ffff), -rgba_from_u32_lit_comp(0x65ffcbff), -rgba_from_u32_lit_comp(0xff9819ff), -rgba_from_u32_lit_comp(0x9932ffff), -rgba_from_u32_lit_comp(0x65ff4cff), -rgba_from_u32_lit_comp(0xb2ccd8ff), -rgba_from_u32_lit_comp(0x0000003f), -rgba_from_u32_lit_comp(0x0000007f), -}; - -Vec4F32 df_g_theme_preset_colors__default_light[54] = -{ -rgba_from_u32_lit_comp(0xff00ffff), -rgba_from_u32_lit_comp(0x383838ff), -rgba_from_u32_lit_comp(0xedededfe), -rgba_from_u32_lit_comp(0x0000001d), -rgba_from_u32_lit_comp(0x00000033), -rgba_from_u32_lit_comp(0x282828ff), -rgba_from_u32_lit_comp(0x2a7a45ff), -rgba_from_u32_lit_comp(0x2c688fff), -rgba_from_u32_lit_comp(0xfe9548ff), -rgba_from_u32_lit_comp(0xd45d90ff), -rgba_from_u32_lit_comp(0xa47729ff), -rgba_from_u32_lit_comp(0x6c2d18ff), -rgba_from_u32_lit_comp(0x2c7d2cff), -rgba_from_u32_lit_comp(0xcc5a0fff), -rgba_from_u32_lit_comp(0x8a0c0cff), -rgba_from_u32_lit_comp(0x7f7f7fff), -rgba_from_u32_lit_comp(0x99503d3f), -rgba_from_u32_lit_comp(0xfe82493f), -rgba_from_u32_lit_comp(0xffba173f), -rgba_from_u32_lit_comp(0xcefd693f), -rgba_from_u32_lit_comp(0x535353ff), -rgba_from_u32_lit_comp(0xfefefebc), -rgba_from_u32_lit_comp(0xffffff19), -rgba_from_u32_lit_comp(0xffffff33), -rgba_from_u32_lit_comp(0x42474c7f), -rgba_from_u32_lit_comp(0xc7a27dff), -rgba_from_u32_lit_comp(0x4293cc99), -rgba_from_u32_lit_comp(0xd76489cc), -rgba_from_u32_lit_comp(0x0000007f), -rgba_from_u32_lit_comp(0x7d98b34c), -rgba_from_u32_lit_comp(0x101010ff), -rgba_from_u32_lit_comp(0xb272189b), -rgba_from_u32_lit_comp(0x327f19ff), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0x75db61ff), -rgba_from_u32_lit_comp(0xffffff33), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0xf27961ff), -rgba_from_u32_lit_comp(0xffffff33), -rgba_from_u32_lit_comp(0xffffffff), -rgba_from_u32_lit_comp(0x327fb2ff), -rgba_from_u32_lit_comp(0xffffff33), -rgba_from_u32_lit_comp(0xffffff0c), -rgba_from_u32_lit_comp(0xad7c34ff), -rgba_from_u32_lit_comp(0x639b2aff), -rgba_from_u32_lit_comp(0xa94c91ff), -rgba_from_u32_lit_comp(0x305398ff), -rgba_from_u32_lit_comp(0x339574ff), -rgba_from_u32_lit_comp(0xbf7416ff), -rgba_from_u32_lit_comp(0x57238bff), -rgba_from_u32_lit_comp(0x2a7e1cff), -rgba_from_u32_lit_comp(0x236481ff), -rgba_from_u32_lit_comp(0x0000000d), -rgba_from_u32_lit_comp(0x0000003b), -}; - -Vec4F32 df_g_theme_preset_colors__vs_dark[54] = -{ -rgba_from_u32_lit_comp(0xff00ffff), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0x1e1e1eff), -rgba_from_u32_lit_comp(0xffffff19), -rgba_from_u32_lit_comp(0xffffff33), -rgba_from_u32_lit_comp(0xd4d4d4ff), -rgba_from_u32_lit_comp(0xdcdcaaff), -rgba_from_u32_lit_comp(0x4ec9b0ff), -rgba_from_u32_lit_comp(0xfe9548ff), -rgba_from_u32_lit_comp(0xd45d90ff), -rgba_from_u32_lit_comp(0x569cd6ff), -rgba_from_u32_lit_comp(0xb4b4b4ff), -rgba_from_u32_lit_comp(0xb5cea8ff), -rgba_from_u32_lit_comp(0xd69d85ff), -rgba_from_u32_lit_comp(0x9b9b9bff), -rgba_from_u32_lit_comp(0x6a9955ff), -rgba_from_u32_lit_comp(0x99503d3f), -rgba_from_u32_lit_comp(0xfe82493f), -rgba_from_u32_lit_comp(0xffba173f), -rgba_from_u32_lit_comp(0xcefd693f), -rgba_from_u32_lit_comp(0xf1f1f1ff), -rgba_from_u32_lit_comp(0x1b1b1cff), -rgba_from_u32_lit_comp(0x333337ff), -rgba_from_u32_lit_comp(0xffffff33), -rgba_from_u32_lit_comp(0x42474c7f), -rgba_from_u32_lit_comp(0x007accff), -rgba_from_u32_lit_comp(0x4293cc99), -rgba_from_u32_lit_comp(0x8e2d4ccc), -rgba_from_u32_lit_comp(0xffffff7f), -rgba_from_u32_lit_comp(0x99ccff4c), -rgba_from_u32_lit_comp(0x66e566e5), -rgba_from_u32_lit_comp(0xb27219ff), -rgba_from_u32_lit_comp(0x327f19ff), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0x32b219ff), -rgba_from_u32_lit_comp(0xffffff33), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xffffff33), -rgba_from_u32_lit_comp(0xffffffff), -rgba_from_u32_lit_comp(0x327fb2ff), -rgba_from_u32_lit_comp(0xffffff33), -rgba_from_u32_lit_comp(0xffffff0c), -rgba_from_u32_lit_comp(0xffcb7fff), -rgba_from_u32_lit_comp(0xb2ff65ff), -rgba_from_u32_lit_comp(0xff99e5ff), -rgba_from_u32_lit_comp(0x6598ffff), -rgba_from_u32_lit_comp(0x65ffcbff), -rgba_from_u32_lit_comp(0xff9819ff), -rgba_from_u32_lit_comp(0x9932ffff), -rgba_from_u32_lit_comp(0x65ff4cff), -rgba_from_u32_lit_comp(0xb2ccd8ff), -rgba_from_u32_lit_comp(0x0000003f), -rgba_from_u32_lit_comp(0x0000007f), -}; - -Vec4F32 df_g_theme_preset_colors__vs_light[54] = -{ -rgba_from_u32_lit_comp(0xff00ffff), -rgba_from_u32_lit_comp(0x1e1e1eff), -rgba_from_u32_lit_comp(0xffffffff), -rgba_from_u32_lit_comp(0xcccedb1d), -rgba_from_u32_lit_comp(0xffffff33), -rgba_from_u32_lit_comp(0x000000ff), -rgba_from_u32_lit_comp(0x74531fff), -rgba_from_u32_lit_comp(0x2b91afff), -rgba_from_u32_lit_comp(0xfe9548ff), -rgba_from_u32_lit_comp(0xd45d90ff), -rgba_from_u32_lit_comp(0x0000ffff), -rgba_from_u32_lit_comp(0x000000ff), -rgba_from_u32_lit_comp(0x000000ff), -rgba_from_u32_lit_comp(0xc11515ff), -rgba_from_u32_lit_comp(0x808080ff), -rgba_from_u32_lit_comp(0x008000ff), -rgba_from_u32_lit_comp(0x99503d3f), -rgba_from_u32_lit_comp(0xfe82493f), -rgba_from_u32_lit_comp(0xffba173f), -rgba_from_u32_lit_comp(0xcefd693f), -rgba_from_u32_lit_comp(0x535353ff), -rgba_from_u32_lit_comp(0xfefefebc), -rgba_from_u32_lit_comp(0xffffff19), -rgba_from_u32_lit_comp(0xffffff33), -rgba_from_u32_lit_comp(0x42474c7f), -rgba_from_u32_lit_comp(0x007accff), -rgba_from_u32_lit_comp(0x4293cc99), -rgba_from_u32_lit_comp(0x8e2d4ccc), -rgba_from_u32_lit_comp(0x0000007f), -rgba_from_u32_lit_comp(0x7d98b34c), -rgba_from_u32_lit_comp(0x101010ff), -rgba_from_u32_lit_comp(0xb27219ff), -rgba_from_u32_lit_comp(0x327f19ff), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0x32b219ff), -rgba_from_u32_lit_comp(0xffffff33), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xffffff33), -rgba_from_u32_lit_comp(0xffffffff), -rgba_from_u32_lit_comp(0x327fb2ff), -rgba_from_u32_lit_comp(0xffffff33), -rgba_from_u32_lit_comp(0xffffff0c), -rgba_from_u32_lit_comp(0xad7c34ff), -rgba_from_u32_lit_comp(0x639b2aff), -rgba_from_u32_lit_comp(0xa94c91ff), -rgba_from_u32_lit_comp(0x305398ff), -rgba_from_u32_lit_comp(0x339574ff), -rgba_from_u32_lit_comp(0xbf7416ff), -rgba_from_u32_lit_comp(0x57238bff), -rgba_from_u32_lit_comp(0x2a7e1cff), -rgba_from_u32_lit_comp(0x236481ff), -rgba_from_u32_lit_comp(0x0000000d), -rgba_from_u32_lit_comp(0x0000003b), -}; - -Vec4F32 df_g_theme_preset_colors__solarized_dark[54] = -{ -rgba_from_u32_lit_comp(0xff00ffff), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0x002b36ff), -rgba_from_u32_lit_comp(0xffffff19), -rgba_from_u32_lit_comp(0xffffff33), -rgba_from_u32_lit_comp(0x839496ff), -rgba_from_u32_lit_comp(0x1c7dd1ff), -rgba_from_u32_lit_comp(0x1c7dd1ff), -rgba_from_u32_lit_comp(0xfe9548ff), -rgba_from_u32_lit_comp(0xd45d90ff), -rgba_from_u32_lit_comp(0x63980fff), -rgba_from_u32_lit_comp(0x839496ff), -rgba_from_u32_lit_comp(0xcb4b20ff), -rgba_from_u32_lit_comp(0x2aa198ff), -rgba_from_u32_lit_comp(0xe54c4cff), -rgba_from_u32_lit_comp(0x7f7f7fff), -rgba_from_u32_lit_comp(0x99503d3f), -rgba_from_u32_lit_comp(0xfe82493f), -rgba_from_u32_lit_comp(0xffba173f), -rgba_from_u32_lit_comp(0xcefd693f), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0x002b36ff), -rgba_from_u32_lit_comp(0xffffff19), -rgba_from_u32_lit_comp(0xffffff33), -rgba_from_u32_lit_comp(0x42474c7f), -rgba_from_u32_lit_comp(0x28515eff), -rgba_from_u32_lit_comp(0x4293cc99), -rgba_from_u32_lit_comp(0x8e2d4ccc), -rgba_from_u32_lit_comp(0xffffff7f), -rgba_from_u32_lit_comp(0x99ccff4c), -rgba_from_u32_lit_comp(0x66e566e5), -rgba_from_u32_lit_comp(0xb27219ff), -rgba_from_u32_lit_comp(0x327f19ff), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0x32b219ff), -rgba_from_u32_lit_comp(0xffffff33), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xffffff33), -rgba_from_u32_lit_comp(0xffffffff), -rgba_from_u32_lit_comp(0x327fb2ff), -rgba_from_u32_lit_comp(0xffffff33), -rgba_from_u32_lit_comp(0xffffff0c), -rgba_from_u32_lit_comp(0xffcb7fff), -rgba_from_u32_lit_comp(0xb2ff65ff), -rgba_from_u32_lit_comp(0xff99e5ff), -rgba_from_u32_lit_comp(0x6598ffff), -rgba_from_u32_lit_comp(0x65ffcbff), -rgba_from_u32_lit_comp(0xff9819ff), -rgba_from_u32_lit_comp(0x9932ffff), -rgba_from_u32_lit_comp(0x65ff4cff), -rgba_from_u32_lit_comp(0xb2ccd8ff), -rgba_from_u32_lit_comp(0x0000003f), -rgba_from_u32_lit_comp(0x0000007f), -}; - -Vec4F32 df_g_theme_preset_colors__solarized_light[54] = -{ -rgba_from_u32_lit_comp(0xff00ffff), -rgba_from_u32_lit_comp(0x1e1e1eff), -rgba_from_u32_lit_comp(0xfcf6e2ff), -rgba_from_u32_lit_comp(0xcccedb1d), -rgba_from_u32_lit_comp(0xffffff33), -rgba_from_u32_lit_comp(0x74878cff), -rgba_from_u32_lit_comp(0xc39d36ff), -rgba_from_u32_lit_comp(0x66b2e5ff), -rgba_from_u32_lit_comp(0xfe9548ff), -rgba_from_u32_lit_comp(0xd45d90ff), -rgba_from_u32_lit_comp(0xc39d36ff), -rgba_from_u32_lit_comp(0x2e5256ff), -rgba_from_u32_lit_comp(0x657b83ff), -rgba_from_u32_lit_comp(0x5ab4a9ff), -rgba_from_u32_lit_comp(0xe54c4cff), -rgba_from_u32_lit_comp(0xadafb2ff), -rgba_from_u32_lit_comp(0x99503d3f), -rgba_from_u32_lit_comp(0xfe82493f), -rgba_from_u32_lit_comp(0xffba173f), -rgba_from_u32_lit_comp(0xcefd693f), -rgba_from_u32_lit_comp(0x535353ff), -rgba_from_u32_lit_comp(0xfcf6e2ff), -rgba_from_u32_lit_comp(0xffffff19), -rgba_from_u32_lit_comp(0xffffff33), -rgba_from_u32_lit_comp(0x42474c7f), -rgba_from_u32_lit_comp(0xa87a4c99), -rgba_from_u32_lit_comp(0x4293cc99), -rgba_from_u32_lit_comp(0x8e2d4ccc), -rgba_from_u32_lit_comp(0x0000007f), -rgba_from_u32_lit_comp(0x7d98b34c), -rgba_from_u32_lit_comp(0x101010ff), -rgba_from_u32_lit_comp(0xb27219ff), -rgba_from_u32_lit_comp(0x327f19ff), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0x32b219ff), -rgba_from_u32_lit_comp(0xffffff33), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xffffff33), -rgba_from_u32_lit_comp(0xffffffff), -rgba_from_u32_lit_comp(0x327fb2ff), -rgba_from_u32_lit_comp(0xffffff33), -rgba_from_u32_lit_comp(0xffffff0c), -rgba_from_u32_lit_comp(0xad7c34ff), -rgba_from_u32_lit_comp(0x639b2aff), -rgba_from_u32_lit_comp(0xa94c91ff), -rgba_from_u32_lit_comp(0x305398ff), -rgba_from_u32_lit_comp(0x339574ff), -rgba_from_u32_lit_comp(0xbf7416ff), -rgba_from_u32_lit_comp(0x57238bff), -rgba_from_u32_lit_comp(0x2a7e1cff), -rgba_from_u32_lit_comp(0x236481ff), -rgba_from_u32_lit_comp(0x0000000d), -rgba_from_u32_lit_comp(0x0000003b), -}; - -Vec4F32 df_g_theme_preset_colors__handmade_hero[54] = -{ -rgba_from_u32_lit_comp(0xff00ffff), -rgba_from_u32_lit_comp(0xa08563ff), -rgba_from_u32_lit_comp(0x0c0c0cff), -rgba_from_u32_lit_comp(0xffffff19), -rgba_from_u32_lit_comp(0xffffff33), -rgba_from_u32_lit_comp(0xa08563ff), -rgba_from_u32_lit_comp(0xcc5735ff), -rgba_from_u32_lit_comp(0xd8a51dff), -rgba_from_u32_lit_comp(0xfe9548ff), -rgba_from_u32_lit_comp(0xd45d90ff), -rgba_from_u32_lit_comp(0xac7b0bff), -rgba_from_u32_lit_comp(0x994c32ff), -rgba_from_u32_lit_comp(0x6b8e23ff), -rgba_from_u32_lit_comp(0x6b8e23ff), -rgba_from_u32_lit_comp(0xdab98fff), -rgba_from_u32_lit_comp(0x686868ff), -rgba_from_u32_lit_comp(0x99503d3f), -rgba_from_u32_lit_comp(0xfe82493f), -rgba_from_u32_lit_comp(0xffba173f), -rgba_from_u32_lit_comp(0xcefd693f), -rgba_from_u32_lit_comp(0xa08563ff), -rgba_from_u32_lit_comp(0x0c0c0cff), -rgba_from_u32_lit_comp(0xffffff19), -rgba_from_u32_lit_comp(0xffffff33), -rgba_from_u32_lit_comp(0x42474c7f), -rgba_from_u32_lit_comp(0xa87a4c99), -rgba_from_u32_lit_comp(0x4293cc99), -rgba_from_u32_lit_comp(0x8e2d4ccc), -rgba_from_u32_lit_comp(0xa08563af), -rgba_from_u32_lit_comp(0x99ccff4c), -rgba_from_u32_lit_comp(0x66e566e5), -rgba_from_u32_lit_comp(0xb27219ff), -rgba_from_u32_lit_comp(0x327f19ff), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0x32b219ff), -rgba_from_u32_lit_comp(0xffffff33), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xffffff33), -rgba_from_u32_lit_comp(0xffffffff), -rgba_from_u32_lit_comp(0x327fb2ff), -rgba_from_u32_lit_comp(0xffffff33), -rgba_from_u32_lit_comp(0xffffff0c), -rgba_from_u32_lit_comp(0xffcb7fff), -rgba_from_u32_lit_comp(0xb2ff65ff), -rgba_from_u32_lit_comp(0xff99e5ff), -rgba_from_u32_lit_comp(0x6598ffff), -rgba_from_u32_lit_comp(0x65ffcbff), -rgba_from_u32_lit_comp(0xff9819ff), -rgba_from_u32_lit_comp(0x9932ffff), -rgba_from_u32_lit_comp(0x65ff4cff), -rgba_from_u32_lit_comp(0xb2ccd8ff), -rgba_from_u32_lit_comp(0x0000003f), -rgba_from_u32_lit_comp(0x0000007f), -}; - -Vec4F32 df_g_theme_preset_colors__four_coder[54] = -{ -rgba_from_u32_lit_comp(0xff00ffff), -rgba_from_u32_lit_comp(0x90b080ff), -rgba_from_u32_lit_comp(0x0c0c0cff), -rgba_from_u32_lit_comp(0x181818a0), -rgba_from_u32_lit_comp(0xffffff33), -rgba_from_u32_lit_comp(0x90b080ff), -rgba_from_u32_lit_comp(0x7fcc99ff), -rgba_from_u32_lit_comp(0x66b2e5ff), -rgba_from_u32_lit_comp(0xfe9548ff), -rgba_from_u32_lit_comp(0xd45d90ff), -rgba_from_u32_lit_comp(0xd08f20ff), -rgba_from_u32_lit_comp(0x994c32ff), -rgba_from_u32_lit_comp(0x50ff30ff), -rgba_from_u32_lit_comp(0x50ff30ff), -rgba_from_u32_lit_comp(0x50ff30ff), -rgba_from_u32_lit_comp(0x2090f0ff), -rgba_from_u32_lit_comp(0x99503d3f), -rgba_from_u32_lit_comp(0xfe82493f), -rgba_from_u32_lit_comp(0xffba173f), -rgba_from_u32_lit_comp(0xcefd693f), -rgba_from_u32_lit_comp(0x90b080ff), -rgba_from_u32_lit_comp(0x0c0c0cff), -rgba_from_u32_lit_comp(0xffffff19), -rgba_from_u32_lit_comp(0xffffff33), -rgba_from_u32_lit_comp(0x42474c7f), -rgba_from_u32_lit_comp(0xa87a4c99), -rgba_from_u32_lit_comp(0x4293cc99), -rgba_from_u32_lit_comp(0x8e2d4ccc), -rgba_from_u32_lit_comp(0x90b080af), -rgba_from_u32_lit_comp(0x99ccff4c), -rgba_from_u32_lit_comp(0x66e566e5), -rgba_from_u32_lit_comp(0xb27219ff), -rgba_from_u32_lit_comp(0x327f19ff), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0x32b219ff), -rgba_from_u32_lit_comp(0xffffff33), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xffffff33), -rgba_from_u32_lit_comp(0xffffffff), -rgba_from_u32_lit_comp(0x327fb2ff), -rgba_from_u32_lit_comp(0xffffff33), -rgba_from_u32_lit_comp(0xffffff0c), -rgba_from_u32_lit_comp(0xffcb7fff), -rgba_from_u32_lit_comp(0xb2ff65ff), -rgba_from_u32_lit_comp(0xff99e5ff), -rgba_from_u32_lit_comp(0x6598ffff), -rgba_from_u32_lit_comp(0x65ffcbff), -rgba_from_u32_lit_comp(0xff9819ff), -rgba_from_u32_lit_comp(0x9932ffff), -rgba_from_u32_lit_comp(0x65ff4cff), -rgba_from_u32_lit_comp(0xb2ccd8ff), -rgba_from_u32_lit_comp(0x0000003f), -rgba_from_u32_lit_comp(0x0000007f), -}; - -Vec4F32 df_g_theme_preset_colors__far_manager[54] = -{ -rgba_from_u32_lit_comp(0xff00ffff), -rgba_from_u32_lit_comp(0x00ffffff), -rgba_from_u32_lit_comp(0x000082ff), -rgba_from_u32_lit_comp(0xffffff19), -rgba_from_u32_lit_comp(0xffffff33), -rgba_from_u32_lit_comp(0x00ffffff), -rgba_from_u32_lit_comp(0x49b2ffff), -rgba_from_u32_lit_comp(0x49b2ffff), -rgba_from_u32_lit_comp(0xfe9548ff), -rgba_from_u32_lit_comp(0xd45d90ff), -rgba_from_u32_lit_comp(0xff0000ff), -rgba_from_u32_lit_comp(0xffffffff), -rgba_from_u32_lit_comp(0x2cff50ff), -rgba_from_u32_lit_comp(0xe5cc66ff), -rgba_from_u32_lit_comp(0xffff00ff), -rgba_from_u32_lit_comp(0x7f7f7fff), -rgba_from_u32_lit_comp(0x99503d3f), -rgba_from_u32_lit_comp(0xfe82493f), -rgba_from_u32_lit_comp(0xffba173f), -rgba_from_u32_lit_comp(0xcefd693f), -rgba_from_u32_lit_comp(0x000000ff), -rgba_from_u32_lit_comp(0x008184ff), -rgba_from_u32_lit_comp(0xffffff19), -rgba_from_u32_lit_comp(0xffffff33), -rgba_from_u32_lit_comp(0x42474c7f), -rgba_from_u32_lit_comp(0xa87a4c99), -rgba_from_u32_lit_comp(0x4293cc99), -rgba_from_u32_lit_comp(0x8e2d4ccc), -rgba_from_u32_lit_comp(0xffffff7f), -rgba_from_u32_lit_comp(0x99ccff4c), -rgba_from_u32_lit_comp(0x66e566e5), -rgba_from_u32_lit_comp(0xb27219ff), -rgba_from_u32_lit_comp(0x327f19ff), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0x32b219ff), -rgba_from_u32_lit_comp(0xffffff33), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xffffff33), -rgba_from_u32_lit_comp(0xffffffff), -rgba_from_u32_lit_comp(0x327fb2ff), -rgba_from_u32_lit_comp(0xffffff33), -rgba_from_u32_lit_comp(0xffffff0c), -rgba_from_u32_lit_comp(0xffcb7fff), -rgba_from_u32_lit_comp(0xb2ff65ff), -rgba_from_u32_lit_comp(0xff99e5ff), -rgba_from_u32_lit_comp(0x6598ffff), -rgba_from_u32_lit_comp(0x65ffcbff), -rgba_from_u32_lit_comp(0xff9819ff), -rgba_from_u32_lit_comp(0x9932ffff), -rgba_from_u32_lit_comp(0x65ff4cff), -rgba_from_u32_lit_comp(0xb2ccd8ff), -rgba_from_u32_lit_comp(0x0000003f), -rgba_from_u32_lit_comp(0x0000007f), -}; - -Vec4F32* df_g_theme_preset_colors_table[9] = -{ -df_g_theme_preset_colors__default_dark, -df_g_theme_preset_colors__default_light, -df_g_theme_preset_colors__vs_dark, -df_g_theme_preset_colors__vs_light, -df_g_theme_preset_colors__solarized_dark, -df_g_theme_preset_colors__solarized_light, -df_g_theme_preset_colors__handmade_hero, -df_g_theme_preset_colors__four_coder, -df_g_theme_preset_colors__far_manager, -}; - -DF_CmdParamSlot df_g_cmd_param_slot_2_view_spec_src_map[7] = -{ -DF_CmdParamSlot_Entity, -DF_CmdParamSlot_EntityList, -DF_CmdParamSlot_FilePath, -DF_CmdParamSlot_CmdSpec, -DF_CmdParamSlot_ID, -DF_CmdParamSlot_String, -DF_CmdParamSlot_String, -}; - -String8 df_g_cmd_param_slot_2_view_spec_dst_map[7] = -{ -str8_lit_comp("entity_lister"), -str8_lit_comp("entity_lister"), -str8_lit_comp("file_system"), -str8_lit_comp("commands"), -str8_lit_comp("system_processes"), -str8_lit_comp("symbol_lister"), -str8_lit_comp("symbol_lister"), -}; - -String8 df_g_cmd_param_slot_2_view_spec_cmd_map[7] = -{ -str8_lit_comp(""), -str8_lit_comp(""), -str8_lit_comp(""), -str8_lit_comp(""), -str8_lit_comp(""), -str8_lit_comp("goto_name"), -str8_lit_comp("function_breakpoint"), -}; - DF_StringBindingPair df_g_default_binding_table[105] = { {str8_lit_comp("kill_all"), {OS_Key_F5, 0 |OS_EventFlag_Shift }}, @@ -725,32 +131,6 @@ str8_lit_comp("open_project"), str8_lit_comp("open_project"), }; -DF_GfxViewRuleSpecInfo df_g_gfx_view_rule_spec_info_table[14] = -{ -{ str8_lit_comp("array"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*0)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*0), 0, 0, 0, 0, str8_lit_comp("") }, -{ str8_lit_comp("list"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*1)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*0)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*0), DF_GFX_VIEW_RULE_VIZ_ROW_PROD_FUNCTION_NAME(list) , 0, 0, 0, str8_lit_comp("") }, -{ str8_lit_comp("dec"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*1)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*0), 0, DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_NAME(dec) , 0, 0, str8_lit_comp("") }, -{ str8_lit_comp("bin"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*1)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*0), 0, DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_NAME(bin) , 0, 0, str8_lit_comp("") }, -{ str8_lit_comp("oct"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*1)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*0), 0, DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_NAME(oct) , 0, 0, str8_lit_comp("") }, -{ str8_lit_comp("hex"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*1)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*0), 0, DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_NAME(hex) , 0, 0, str8_lit_comp("") }, -{ str8_lit_comp("only"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*1)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*1)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*0), DF_GFX_VIEW_RULE_VIZ_ROW_PROD_FUNCTION_NAME(only) , DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_NAME(only) , 0, 0, str8_lit_comp("") }, -{ str8_lit_comp("omit"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*1)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*1)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*0), DF_GFX_VIEW_RULE_VIZ_ROW_PROD_FUNCTION_NAME(omit) , DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_NAME(omit) , 0, 0, str8_lit_comp("") }, -{ str8_lit_comp("no_addr"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*1)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*0), 0, DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_NAME(no_addr) , 0, 0, str8_lit_comp("") }, -{ str8_lit_comp("rgba"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*0)|(DF_GfxViewRuleSpecInfoFlag_RowUI*1)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*1), 0, 0, DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_NAME(rgba) , DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_NAME(rgba) , str8_lit_comp("") }, -{ str8_lit_comp("text"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*0)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*1), 0, 0, 0, DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_NAME(text) , str8_lit_comp("text_view_rule") }, -{ str8_lit_comp("disasm"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*0)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*1), 0, 0, 0, DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_NAME(disasm) , str8_lit_comp("disasm_view_rule") }, -{ str8_lit_comp("bitmap"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*0)|(DF_GfxViewRuleSpecInfoFlag_RowUI*1)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*1), 0, 0, DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_NAME(bitmap) , DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_NAME(bitmap) , str8_lit_comp("bitmap_view_rule") }, -{ str8_lit_comp("geo"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*0)|(DF_GfxViewRuleSpecInfoFlag_RowUI*1)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*1), 0, 0, DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_NAME(geo) , DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_NAME(geo) , str8_lit_comp("geo_view_rule") }, -}; - -DF_ViewSpecInfo df_g_gfx_view_rule_tab_view_spec_info_table[4] = -{ -{ DF_ViewSpecFlag_CanSerialize|DF_ViewSpecFlag_CanSerializeQuery, str8_lit_comp("text_view_rule"), str8_lit_comp("Text"), DF_NameKind_Null, DF_IconKind_Binoculars, DF_VIEW_SETUP_FUNCTION_NAME(text), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(text), DF_VIEW_CMD_FUNCTION_NAME(text), DF_VIEW_UI_FUNCTION_NAME(text) }, -{ DF_ViewSpecFlag_CanSerialize|DF_ViewSpecFlag_CanSerializeQuery, str8_lit_comp("disasm_view_rule"), str8_lit_comp("Disassembly"), DF_NameKind_Null, DF_IconKind_Binoculars, DF_VIEW_SETUP_FUNCTION_NAME(disasm), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(disasm), DF_VIEW_CMD_FUNCTION_NAME(disasm), DF_VIEW_UI_FUNCTION_NAME(disasm) }, -{ DF_ViewSpecFlag_CanSerialize|DF_ViewSpecFlag_CanSerializeQuery, str8_lit_comp("bitmap_view_rule"), str8_lit_comp("Bitmap"), DF_NameKind_Null, DF_IconKind_Binoculars, DF_VIEW_SETUP_FUNCTION_NAME(bitmap), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(bitmap), DF_VIEW_CMD_FUNCTION_NAME(bitmap), DF_VIEW_UI_FUNCTION_NAME(bitmap) }, -{ DF_ViewSpecFlag_CanSerialize|DF_ViewSpecFlag_CanSerializeQuery, str8_lit_comp("geo_view_rule"), str8_lit_comp("Geometry"), DF_NameKind_Null, DF_IconKind_Binoculars, DF_VIEW_SETUP_FUNCTION_NAME(geo), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(geo), DF_VIEW_CMD_FUNCTION_NAME(geo), DF_VIEW_UI_FUNCTION_NAME(geo) }, -}; - DF_ViewSpecInfo df_g_gfx_view_kind_spec_info_table[31] = { {(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_ProjectSpecific|0*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|0*DF_ViewSpecFlag_CanFilter|0*DF_ViewSpecFlag_FilterIsCode|0*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("null"), str8_lit_comp(""), DF_NameKind_Null, DF_IconKind_Null, DF_VIEW_SETUP_FUNCTION_NAME(Null), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(Null), DF_VIEW_CMD_FUNCTION_NAME(Null), DF_VIEW_UI_FUNCTION_NAME(Null)}, @@ -786,82 +166,100 @@ DF_ViewSpecInfo df_g_gfx_view_kind_spec_info_table[31] = {(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_ProjectSpecific|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|0*DF_ViewSpecFlag_CanFilter|0*DF_ViewSpecFlag_FilterIsCode|0*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("theme"), str8_lit_comp("Theme"), DF_NameKind_Null, DF_IconKind_Palette, DF_VIEW_SETUP_FUNCTION_NAME(Theme), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(Theme), DF_VIEW_CMD_FUNCTION_NAME(Theme), DF_VIEW_UI_FUNCTION_NAME(Theme)}, }; -String8 df_g_theme_color_display_string_table[54] = +DF_CmdParamSlot df_g_cmd_param_slot_2_view_spec_src_map[7] = { -str8_lit_comp("Null"), -str8_lit_comp("Plain Text"), -str8_lit_comp("Plain Background"), -str8_lit_comp("Plain Border"), -str8_lit_comp("Plain Overlay"), -str8_lit_comp("Code (Default)"), -str8_lit_comp("Code (Function)"), -str8_lit_comp("Code (Type)"), -str8_lit_comp("Code (Local)"), -str8_lit_comp("Code (Register)"), -str8_lit_comp("Code (Keyword)"), -str8_lit_comp("Code (Symbol)"), -str8_lit_comp("Code (Numeric)"), -str8_lit_comp("Code (String)"), -str8_lit_comp("Code (Meta)"), -str8_lit_comp("Code (Comment)"), -str8_lit_comp("Line Info (0)"), -str8_lit_comp("Line Info (1)"), -str8_lit_comp("Line Info (2)"), -str8_lit_comp("Line Info (3)"), -str8_lit_comp("Alt Text"), -str8_lit_comp("Alt Background"), -str8_lit_comp("Alt Border"), -str8_lit_comp("Alt Overlay"), -str8_lit_comp("Inactive Tab"), -str8_lit_comp("Active Tab"), -str8_lit_comp("Entity Background"), -str8_lit_comp("Query Bar"), -str8_lit_comp("Weak Text"), -str8_lit_comp("Text Selection"), -str8_lit_comp("Cursor"), -str8_lit_comp("Highlight (0)"), -str8_lit_comp("Highlight (1)"), -str8_lit_comp("Success Text"), -str8_lit_comp("Success Background"), -str8_lit_comp("Success Border"), -str8_lit_comp("Failure Text"), -str8_lit_comp("Failure Background"), -str8_lit_comp("Failure Border"), -str8_lit_comp("Action Text"), -str8_lit_comp("Action Background"), -str8_lit_comp("Action Border"), -str8_lit_comp("Drop Site Overlay"), -str8_lit_comp("Thread (0)"), -str8_lit_comp("Thread (1)"), -str8_lit_comp("Thread (2)"), -str8_lit_comp("Thread (3)"), -str8_lit_comp("Thread (4)"), -str8_lit_comp("Thread (5)"), -str8_lit_comp("Thread (6)"), -str8_lit_comp("Thread (7)"), -str8_lit_comp("Thread (Unwound)"), -str8_lit_comp("Inactive Panel Overlay"), -str8_lit_comp("Drop Shadow"), +DF_CmdParamSlot_Entity, +DF_CmdParamSlot_EntityList, +DF_CmdParamSlot_FilePath, +DF_CmdParamSlot_CmdSpec, +DF_CmdParamSlot_ID, +DF_CmdParamSlot_String, +DF_CmdParamSlot_String, }; -String8 df_g_theme_color_cfg_string_table[54] = +String8 df_g_cmd_param_slot_2_view_spec_dst_map[7] = +{ +str8_lit_comp("entity_lister"), +str8_lit_comp("entity_lister"), +str8_lit_comp("file_system"), +str8_lit_comp("commands"), +str8_lit_comp("system_processes"), +str8_lit_comp("symbol_lister"), +str8_lit_comp("symbol_lister"), +}; + +String8 df_g_cmd_param_slot_2_view_spec_cmd_map[7] = +{ +str8_lit_comp(""), +str8_lit_comp(""), +str8_lit_comp(""), +str8_lit_comp(""), +str8_lit_comp(""), +str8_lit_comp("goto_name"), +str8_lit_comp("function_breakpoint"), +}; + +DF_ViewSpecInfo df_g_gfx_view_rule_tab_view_spec_info_table[4] = +{ +{ DF_ViewSpecFlag_CanSerialize|DF_ViewSpecFlag_CanSerializeQuery, str8_lit_comp("text_view_rule"), str8_lit_comp("Text"), DF_NameKind_Null, DF_IconKind_Binoculars, DF_VIEW_SETUP_FUNCTION_NAME(text), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(text), DF_VIEW_CMD_FUNCTION_NAME(text), DF_VIEW_UI_FUNCTION_NAME(text) }, +{ DF_ViewSpecFlag_CanSerialize|DF_ViewSpecFlag_CanSerializeQuery, str8_lit_comp("disasm_view_rule"), str8_lit_comp("Disassembly"), DF_NameKind_Null, DF_IconKind_Binoculars, DF_VIEW_SETUP_FUNCTION_NAME(disasm), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(disasm), DF_VIEW_CMD_FUNCTION_NAME(disasm), DF_VIEW_UI_FUNCTION_NAME(disasm) }, +{ DF_ViewSpecFlag_CanSerialize|DF_ViewSpecFlag_CanSerializeQuery, str8_lit_comp("bitmap_view_rule"), str8_lit_comp("Bitmap"), DF_NameKind_Null, DF_IconKind_Binoculars, DF_VIEW_SETUP_FUNCTION_NAME(bitmap), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(bitmap), DF_VIEW_CMD_FUNCTION_NAME(bitmap), DF_VIEW_UI_FUNCTION_NAME(bitmap) }, +{ DF_ViewSpecFlag_CanSerialize|DF_ViewSpecFlag_CanSerializeQuery, str8_lit_comp("geo_view_rule"), str8_lit_comp("Geometry"), DF_NameKind_Null, DF_IconKind_Binoculars, DF_VIEW_SETUP_FUNCTION_NAME(geo), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(geo), DF_VIEW_CMD_FUNCTION_NAME(geo), DF_VIEW_UI_FUNCTION_NAME(geo) }, +}; + +DF_GfxViewRuleSpecInfo df_g_gfx_view_rule_spec_info_table[14] = +{ +{ str8_lit_comp("array"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*0)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*0), 0, 0, 0, 0, str8_lit_comp("") }, +{ str8_lit_comp("list"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*1)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*0)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*0), DF_GFX_VIEW_RULE_VIZ_ROW_PROD_FUNCTION_NAME(list) , 0, 0, 0, str8_lit_comp("") }, +{ str8_lit_comp("dec"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*1)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*0), 0, DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_NAME(dec) , 0, 0, str8_lit_comp("") }, +{ str8_lit_comp("bin"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*1)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*0), 0, DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_NAME(bin) , 0, 0, str8_lit_comp("") }, +{ str8_lit_comp("oct"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*1)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*0), 0, DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_NAME(oct) , 0, 0, str8_lit_comp("") }, +{ str8_lit_comp("hex"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*1)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*0), 0, DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_NAME(hex) , 0, 0, str8_lit_comp("") }, +{ str8_lit_comp("only"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*1)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*1)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*0), DF_GFX_VIEW_RULE_VIZ_ROW_PROD_FUNCTION_NAME(only) , DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_NAME(only) , 0, 0, str8_lit_comp("") }, +{ str8_lit_comp("omit"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*1)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*1)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*0), DF_GFX_VIEW_RULE_VIZ_ROW_PROD_FUNCTION_NAME(omit) , DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_NAME(omit) , 0, 0, str8_lit_comp("") }, +{ str8_lit_comp("no_addr"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*1)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*0), 0, DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_NAME(no_addr) , 0, 0, str8_lit_comp("") }, +{ str8_lit_comp("rgba"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*0)|(DF_GfxViewRuleSpecInfoFlag_RowUI*1)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*1), 0, 0, DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_NAME(rgba) , DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_NAME(rgba) , str8_lit_comp("") }, +{ str8_lit_comp("text"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*0)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*1), 0, 0, 0, DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_NAME(text) , str8_lit_comp("text_view_rule") }, +{ str8_lit_comp("disasm"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*0)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*1), 0, 0, 0, DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_NAME(disasm) , str8_lit_comp("disasm_view_rule") }, +{ str8_lit_comp("bitmap"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*0)|(DF_GfxViewRuleSpecInfoFlag_RowUI*1)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*1), 0, 0, DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_NAME(bitmap) , DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_NAME(bitmap) , str8_lit_comp("bitmap_view_rule") }, +{ str8_lit_comp("geo"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*0)|(DF_GfxViewRuleSpecInfoFlag_RowUI*1)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*1), 0, 0, DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_NAME(geo) , DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_NAME(geo) , str8_lit_comp("geo_view_rule") }, +}; + +String8 df_g_theme_preset_display_string_table[9] = +{ +str8_lit_comp("Default (Dark)"), +str8_lit_comp("Default (Light)"), +str8_lit_comp("VS (Dark)"), +str8_lit_comp("VS (Light)"), +str8_lit_comp("Solarized (Dark)"), +str8_lit_comp("Solarized (Light)"), +str8_lit_comp("Handmade Hero"), +str8_lit_comp("4coder"), +str8_lit_comp("Far Manager"), +}; + +String8 df_g_theme_preset_code_string_table[9] = +{ +str8_lit_comp("default_dark"), +str8_lit_comp("default_light"), +str8_lit_comp("vs_dark"), +str8_lit_comp("vs_light"), +str8_lit_comp("solarized_dark"), +str8_lit_comp("solarized_light"), +str8_lit_comp("handmade_hero"), +str8_lit_comp("four_coder"), +str8_lit_comp("far_manager"), +}; + +String8 df_g_theme_color_version_remap_old_name_table[30] = { -str8_lit_comp("null"), str8_lit_comp("plain_text"), str8_lit_comp("plain_background"), str8_lit_comp("plain_border"), str8_lit_comp("plain_overlay"), -str8_lit_comp("code_default"), str8_lit_comp("code_function"), -str8_lit_comp("code_type"), -str8_lit_comp("code_local"), -str8_lit_comp("code_register"), -str8_lit_comp("code_keyword"), str8_lit_comp("code_symbol"), str8_lit_comp("code_numeric"), -str8_lit_comp("code_string"), -str8_lit_comp("code_meta"), -str8_lit_comp("code_comment"), str8_lit_comp("line_info_0"), str8_lit_comp("line_info_1"), str8_lit_comp("line_info_2"), @@ -872,13 +270,10 @@ str8_lit_comp("alt_border"), str8_lit_comp("alt_overlay"), str8_lit_comp("tab_inactive"), str8_lit_comp("tab_active"), -str8_lit_comp("entity_background"), -str8_lit_comp("query_bar"), str8_lit_comp("weak_text"), str8_lit_comp("text_selection"), str8_lit_comp("cursor"), str8_lit_comp("highlight_0"), -str8_lit_comp("highlight_1"), str8_lit_comp("success_text"), str8_lit_comp("success_background"), str8_lit_comp("success_border"), @@ -888,7 +283,1019 @@ str8_lit_comp("failure_border"), str8_lit_comp("action_text"), str8_lit_comp("action_background"), str8_lit_comp("action_border"), +}; + +String8 df_g_theme_color_version_remap_new_name_table[30] = +{ +str8_lit_comp("default_text"), +str8_lit_comp("default_background"), +str8_lit_comp("default_border"), str8_lit_comp("drop_site_overlay"), +str8_lit_comp("code_procedure"), +str8_lit_comp("code_delimiter_operator"), +str8_lit_comp("code_numeric_alt_digit_group"), +str8_lit_comp("line_info_background_0"), +str8_lit_comp("line_info_background_1"), +str8_lit_comp("line_info_background_2"), +str8_lit_comp("line_info_background_3"), +str8_lit_comp("menu_bar_text"), +str8_lit_comp("menu_bar_background"), +str8_lit_comp("menu_bar_border"), +str8_lit_comp("drop_site_overlay"), +str8_lit_comp("tab_inactive_background"), +str8_lit_comp("tab_active_background"), +str8_lit_comp("default_text_weak"), +str8_lit_comp("selection"), +str8_lit_comp("cursor_active"), +str8_lit_comp("focus_active"), +str8_lit_comp("special_positive_text"), +str8_lit_comp("special_positive_background"), +str8_lit_comp("special_positive_border"), +str8_lit_comp("special_negative_text"), +str8_lit_comp("special_negative_background"), +str8_lit_comp("special_negative_border"), +str8_lit_comp("special_neutral_text"), +str8_lit_comp("special_neutral_background"), +str8_lit_comp("special_neutral_border"), +}; + +Vec4F32 df_g_theme_preset_colors__default_dark[85] = +{ +rgba_from_u32_lit_comp(0xff00ffff), +rgba_from_u32_lit_comp(0x99ccff4c), +rgba_from_u32_lit_comp(0x0000007f), +rgba_from_u32_lit_comp(0x66e566e5), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xb27219ff), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xb27219ff), +rgba_from_u32_lit_comp(0xb27219ff), +rgba_from_u32_lit_comp(0x0000003f), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0x32b219ff), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0x3333337f), +rgba_from_u32_lit_comp(0xffffff19), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0x32b219ff), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0x3333337f), +rgba_from_u32_lit_comp(0xffffff19), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0x32b219ff), +rgba_from_u32_lit_comp(0xffffff33), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xffffff33), +rgba_from_u32_lit_comp(0xffffffff), +rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0x327fb2ff), +rgba_from_u32_lit_comp(0xffffff33), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0x32b219ff), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0x3333337f), +rgba_from_u32_lit_comp(0xffffff19), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0xa87a4c99), +rgba_from_u32_lit_comp(0xffffff19), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0x42474c7f), +rgba_from_u32_lit_comp(0xffffff19), +rgba_from_u32_lit_comp(0x3333337f), +rgba_from_u32_lit_comp(0x3333337f), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0xa5a5a5ff), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0x7fcc99ff), +rgba_from_u32_lit_comp(0x66b2e5ff), +rgba_from_u32_lit_comp(0xfe9548ff), +rgba_from_u32_lit_comp(0xd45d90ff), +rgba_from_u32_lit_comp(0xf7bf5eff), +rgba_from_u32_lit_comp(0x994c32ff), +rgba_from_u32_lit_comp(0x4ce54cff), +rgba_from_u32_lit_comp(0x4ca54cff), +rgba_from_u32_lit_comp(0xe5cc66ff), +rgba_from_u32_lit_comp(0xe54c4cff), +rgba_from_u32_lit_comp(0x7f7f7fff), +rgba_from_u32_lit_comp(0x99503d3f), +rgba_from_u32_lit_comp(0xfe82493f), +rgba_from_u32_lit_comp(0xffba173f), +rgba_from_u32_lit_comp(0xcefd693f), +rgba_from_u32_lit_comp(0x99503d3f), +rgba_from_u32_lit_comp(0xfe82493f), +rgba_from_u32_lit_comp(0xffba173f), +rgba_from_u32_lit_comp(0x99503d3f), +rgba_from_u32_lit_comp(0xffcb7fff), +rgba_from_u32_lit_comp(0xb2ff65ff), +rgba_from_u32_lit_comp(0xff99e5ff), +rgba_from_u32_lit_comp(0x6598ffff), +rgba_from_u32_lit_comp(0x65ffcbff), +rgba_from_u32_lit_comp(0xff9819ff), +rgba_from_u32_lit_comp(0x9932ffff), +rgba_from_u32_lit_comp(0x65ff4cff), +rgba_from_u32_lit_comp(0xb2ccd8ff), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xffffff0c), +rgba_from_u32_lit_comp(0x0000003f), +}; + +Vec4F32 df_g_theme_preset_colors__default_light[85] = +{ +rgba_from_u32_lit_comp(0xff00ffff), +rgba_from_u32_lit_comp(0x99ccff4c), +rgba_from_u32_lit_comp(0x0000007f), +rgba_from_u32_lit_comp(0x66e566e5), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xb27219ff), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0x0000003f), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0x32b219ff), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0x3333337f), +rgba_from_u32_lit_comp(0xffffff19), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0x32b219ff), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0x3333337f), +rgba_from_u32_lit_comp(0xffffff19), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0x32b219ff), +rgba_from_u32_lit_comp(0xffffff33), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xffffff33), +rgba_from_u32_lit_comp(0xffffffff), +rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0x327fb2ff), +rgba_from_u32_lit_comp(0xffffff33), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0x32b219ff), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0x3333337f), +rgba_from_u32_lit_comp(0xffffff19), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0xa87a4c99), +rgba_from_u32_lit_comp(0xffffff19), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0x42474c7f), +rgba_from_u32_lit_comp(0xffffff19), +rgba_from_u32_lit_comp(0x3333337f), +rgba_from_u32_lit_comp(0x3333337f), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0x7fcc99ff), +rgba_from_u32_lit_comp(0x66b2e5ff), +rgba_from_u32_lit_comp(0xfe9548ff), +rgba_from_u32_lit_comp(0xd45d90ff), +rgba_from_u32_lit_comp(0xf7bf5eff), +rgba_from_u32_lit_comp(0x994c32ff), +rgba_from_u32_lit_comp(0x4ce54cff), +rgba_from_u32_lit_comp(0x4ca54cff), +rgba_from_u32_lit_comp(0xe5cc66ff), +rgba_from_u32_lit_comp(0xe54c4cff), +rgba_from_u32_lit_comp(0x7f7f7fff), +rgba_from_u32_lit_comp(0x99503d3f), +rgba_from_u32_lit_comp(0xfe82493f), +rgba_from_u32_lit_comp(0xffba173f), +rgba_from_u32_lit_comp(0xcefd693f), +rgba_from_u32_lit_comp(0x99503d3f), +rgba_from_u32_lit_comp(0xfe82493f), +rgba_from_u32_lit_comp(0xffba173f), +rgba_from_u32_lit_comp(0x99503d3f), +rgba_from_u32_lit_comp(0xffcb7fff), +rgba_from_u32_lit_comp(0xb2ff65ff), +rgba_from_u32_lit_comp(0xff99e5ff), +rgba_from_u32_lit_comp(0x6598ffff), +rgba_from_u32_lit_comp(0x65ffcbff), +rgba_from_u32_lit_comp(0xff9819ff), +rgba_from_u32_lit_comp(0x9932ffff), +rgba_from_u32_lit_comp(0x65ff4cff), +rgba_from_u32_lit_comp(0xb2ccd8ff), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xffffff0c), +rgba_from_u32_lit_comp(0x0000003f), +}; + +Vec4F32 df_g_theme_preset_colors__vs_dark[85] = +{ +rgba_from_u32_lit_comp(0xff00ffff), +rgba_from_u32_lit_comp(0x99ccff4c), +rgba_from_u32_lit_comp(0x0000007f), +rgba_from_u32_lit_comp(0x66e566e5), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xb27219ff), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0x0000003f), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0x32b219ff), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0x3333337f), +rgba_from_u32_lit_comp(0xffffff19), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0x32b219ff), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0x3333337f), +rgba_from_u32_lit_comp(0xffffff19), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0x32b219ff), +rgba_from_u32_lit_comp(0xffffff33), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xffffff33), +rgba_from_u32_lit_comp(0xffffffff), +rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0x327fb2ff), +rgba_from_u32_lit_comp(0xffffff33), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0x32b219ff), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0x3333337f), +rgba_from_u32_lit_comp(0xffffff19), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0xa87a4c99), +rgba_from_u32_lit_comp(0xffffff19), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0x42474c7f), +rgba_from_u32_lit_comp(0xffffff19), +rgba_from_u32_lit_comp(0x3333337f), +rgba_from_u32_lit_comp(0x3333337f), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0x7fcc99ff), +rgba_from_u32_lit_comp(0x66b2e5ff), +rgba_from_u32_lit_comp(0xfe9548ff), +rgba_from_u32_lit_comp(0xd45d90ff), +rgba_from_u32_lit_comp(0xf7bf5eff), +rgba_from_u32_lit_comp(0x994c32ff), +rgba_from_u32_lit_comp(0x4ce54cff), +rgba_from_u32_lit_comp(0x4ca54cff), +rgba_from_u32_lit_comp(0xe5cc66ff), +rgba_from_u32_lit_comp(0xe54c4cff), +rgba_from_u32_lit_comp(0x7f7f7fff), +rgba_from_u32_lit_comp(0x99503d3f), +rgba_from_u32_lit_comp(0xfe82493f), +rgba_from_u32_lit_comp(0xffba173f), +rgba_from_u32_lit_comp(0xcefd693f), +rgba_from_u32_lit_comp(0x99503d3f), +rgba_from_u32_lit_comp(0xfe82493f), +rgba_from_u32_lit_comp(0xffba173f), +rgba_from_u32_lit_comp(0x99503d3f), +rgba_from_u32_lit_comp(0xffcb7fff), +rgba_from_u32_lit_comp(0xb2ff65ff), +rgba_from_u32_lit_comp(0xff99e5ff), +rgba_from_u32_lit_comp(0x6598ffff), +rgba_from_u32_lit_comp(0x65ffcbff), +rgba_from_u32_lit_comp(0xff9819ff), +rgba_from_u32_lit_comp(0x9932ffff), +rgba_from_u32_lit_comp(0x65ff4cff), +rgba_from_u32_lit_comp(0xb2ccd8ff), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xffffff0c), +rgba_from_u32_lit_comp(0x0000003f), +}; + +Vec4F32 df_g_theme_preset_colors__vs_light[85] = +{ +rgba_from_u32_lit_comp(0xff00ffff), +rgba_from_u32_lit_comp(0x99ccff4c), +rgba_from_u32_lit_comp(0x0000007f), +rgba_from_u32_lit_comp(0x66e566e5), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xb27219ff), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0x0000003f), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0x32b219ff), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0x3333337f), +rgba_from_u32_lit_comp(0xffffff19), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0x32b219ff), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0x3333337f), +rgba_from_u32_lit_comp(0xffffff19), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0x32b219ff), +rgba_from_u32_lit_comp(0xffffff33), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xffffff33), +rgba_from_u32_lit_comp(0xffffffff), +rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0x327fb2ff), +rgba_from_u32_lit_comp(0xffffff33), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0x32b219ff), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0x3333337f), +rgba_from_u32_lit_comp(0xffffff19), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0xa87a4c99), +rgba_from_u32_lit_comp(0xffffff19), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0x42474c7f), +rgba_from_u32_lit_comp(0xffffff19), +rgba_from_u32_lit_comp(0x3333337f), +rgba_from_u32_lit_comp(0x3333337f), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0x7fcc99ff), +rgba_from_u32_lit_comp(0x66b2e5ff), +rgba_from_u32_lit_comp(0xfe9548ff), +rgba_from_u32_lit_comp(0xd45d90ff), +rgba_from_u32_lit_comp(0xf7bf5eff), +rgba_from_u32_lit_comp(0x994c32ff), +rgba_from_u32_lit_comp(0x4ce54cff), +rgba_from_u32_lit_comp(0x4ca54cff), +rgba_from_u32_lit_comp(0xe5cc66ff), +rgba_from_u32_lit_comp(0xe54c4cff), +rgba_from_u32_lit_comp(0x7f7f7fff), +rgba_from_u32_lit_comp(0x99503d3f), +rgba_from_u32_lit_comp(0xfe82493f), +rgba_from_u32_lit_comp(0xffba173f), +rgba_from_u32_lit_comp(0xcefd693f), +rgba_from_u32_lit_comp(0x99503d3f), +rgba_from_u32_lit_comp(0xfe82493f), +rgba_from_u32_lit_comp(0xffba173f), +rgba_from_u32_lit_comp(0x99503d3f), +rgba_from_u32_lit_comp(0xffcb7fff), +rgba_from_u32_lit_comp(0xb2ff65ff), +rgba_from_u32_lit_comp(0xff99e5ff), +rgba_from_u32_lit_comp(0x6598ffff), +rgba_from_u32_lit_comp(0x65ffcbff), +rgba_from_u32_lit_comp(0xff9819ff), +rgba_from_u32_lit_comp(0x9932ffff), +rgba_from_u32_lit_comp(0x65ff4cff), +rgba_from_u32_lit_comp(0xb2ccd8ff), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xffffff0c), +rgba_from_u32_lit_comp(0x0000003f), +}; + +Vec4F32 df_g_theme_preset_colors__solarized_dark[85] = +{ +rgba_from_u32_lit_comp(0xff00ffff), +rgba_from_u32_lit_comp(0x99ccff4c), +rgba_from_u32_lit_comp(0x0000007f), +rgba_from_u32_lit_comp(0x66e566e5), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xb27219ff), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0x0000003f), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0x32b219ff), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0x3333337f), +rgba_from_u32_lit_comp(0xffffff19), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0x32b219ff), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0x3333337f), +rgba_from_u32_lit_comp(0xffffff19), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0x32b219ff), +rgba_from_u32_lit_comp(0xffffff33), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xffffff33), +rgba_from_u32_lit_comp(0xffffffff), +rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0x327fb2ff), +rgba_from_u32_lit_comp(0xffffff33), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0x32b219ff), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0x3333337f), +rgba_from_u32_lit_comp(0xffffff19), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0xa87a4c99), +rgba_from_u32_lit_comp(0xffffff19), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0x42474c7f), +rgba_from_u32_lit_comp(0xffffff19), +rgba_from_u32_lit_comp(0x3333337f), +rgba_from_u32_lit_comp(0x3333337f), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0x7fcc99ff), +rgba_from_u32_lit_comp(0x66b2e5ff), +rgba_from_u32_lit_comp(0xfe9548ff), +rgba_from_u32_lit_comp(0xd45d90ff), +rgba_from_u32_lit_comp(0xf7bf5eff), +rgba_from_u32_lit_comp(0x994c32ff), +rgba_from_u32_lit_comp(0x4ce54cff), +rgba_from_u32_lit_comp(0x4ca54cff), +rgba_from_u32_lit_comp(0xe5cc66ff), +rgba_from_u32_lit_comp(0xe54c4cff), +rgba_from_u32_lit_comp(0x7f7f7fff), +rgba_from_u32_lit_comp(0x99503d3f), +rgba_from_u32_lit_comp(0xfe82493f), +rgba_from_u32_lit_comp(0xffba173f), +rgba_from_u32_lit_comp(0xcefd693f), +rgba_from_u32_lit_comp(0x99503d3f), +rgba_from_u32_lit_comp(0xfe82493f), +rgba_from_u32_lit_comp(0xffba173f), +rgba_from_u32_lit_comp(0x99503d3f), +rgba_from_u32_lit_comp(0xffcb7fff), +rgba_from_u32_lit_comp(0xb2ff65ff), +rgba_from_u32_lit_comp(0xff99e5ff), +rgba_from_u32_lit_comp(0x6598ffff), +rgba_from_u32_lit_comp(0x65ffcbff), +rgba_from_u32_lit_comp(0xff9819ff), +rgba_from_u32_lit_comp(0x9932ffff), +rgba_from_u32_lit_comp(0x65ff4cff), +rgba_from_u32_lit_comp(0xb2ccd8ff), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xffffff0c), +rgba_from_u32_lit_comp(0x0000003f), +}; + +Vec4F32 df_g_theme_preset_colors__solarized_light[85] = +{ +rgba_from_u32_lit_comp(0xff00ffff), +rgba_from_u32_lit_comp(0x99ccff4c), +rgba_from_u32_lit_comp(0x0000007f), +rgba_from_u32_lit_comp(0x66e566e5), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xb27219ff), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0x0000003f), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0x32b219ff), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0x3333337f), +rgba_from_u32_lit_comp(0xffffff19), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0x32b219ff), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0x3333337f), +rgba_from_u32_lit_comp(0xffffff19), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0x32b219ff), +rgba_from_u32_lit_comp(0xffffff33), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xffffff33), +rgba_from_u32_lit_comp(0xffffffff), +rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0x327fb2ff), +rgba_from_u32_lit_comp(0xffffff33), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0x32b219ff), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0x3333337f), +rgba_from_u32_lit_comp(0xffffff19), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0xa87a4c99), +rgba_from_u32_lit_comp(0xffffff19), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0x42474c7f), +rgba_from_u32_lit_comp(0xffffff19), +rgba_from_u32_lit_comp(0x3333337f), +rgba_from_u32_lit_comp(0x3333337f), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0x7fcc99ff), +rgba_from_u32_lit_comp(0x66b2e5ff), +rgba_from_u32_lit_comp(0xfe9548ff), +rgba_from_u32_lit_comp(0xd45d90ff), +rgba_from_u32_lit_comp(0xf7bf5eff), +rgba_from_u32_lit_comp(0x994c32ff), +rgba_from_u32_lit_comp(0x4ce54cff), +rgba_from_u32_lit_comp(0x4ca54cff), +rgba_from_u32_lit_comp(0xe5cc66ff), +rgba_from_u32_lit_comp(0xe54c4cff), +rgba_from_u32_lit_comp(0x7f7f7fff), +rgba_from_u32_lit_comp(0x99503d3f), +rgba_from_u32_lit_comp(0xfe82493f), +rgba_from_u32_lit_comp(0xffba173f), +rgba_from_u32_lit_comp(0xcefd693f), +rgba_from_u32_lit_comp(0x99503d3f), +rgba_from_u32_lit_comp(0xfe82493f), +rgba_from_u32_lit_comp(0xffba173f), +rgba_from_u32_lit_comp(0x99503d3f), +rgba_from_u32_lit_comp(0xffcb7fff), +rgba_from_u32_lit_comp(0xb2ff65ff), +rgba_from_u32_lit_comp(0xff99e5ff), +rgba_from_u32_lit_comp(0x6598ffff), +rgba_from_u32_lit_comp(0x65ffcbff), +rgba_from_u32_lit_comp(0xff9819ff), +rgba_from_u32_lit_comp(0x9932ffff), +rgba_from_u32_lit_comp(0x65ff4cff), +rgba_from_u32_lit_comp(0xb2ccd8ff), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xffffff0c), +rgba_from_u32_lit_comp(0x0000003f), +}; + +Vec4F32 df_g_theme_preset_colors__handmade_hero[85] = +{ +rgba_from_u32_lit_comp(0xff00ffff), +rgba_from_u32_lit_comp(0x99ccff4c), +rgba_from_u32_lit_comp(0x0000007f), +rgba_from_u32_lit_comp(0x66e566e5), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xb27219ff), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0x0000003f), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0x32b219ff), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0x3333337f), +rgba_from_u32_lit_comp(0xffffff19), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0x32b219ff), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0x3333337f), +rgba_from_u32_lit_comp(0xffffff19), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0x32b219ff), +rgba_from_u32_lit_comp(0xffffff33), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xffffff33), +rgba_from_u32_lit_comp(0xffffffff), +rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0x327fb2ff), +rgba_from_u32_lit_comp(0xffffff33), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0x32b219ff), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0x3333337f), +rgba_from_u32_lit_comp(0xffffff19), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0xa87a4c99), +rgba_from_u32_lit_comp(0xffffff19), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0x42474c7f), +rgba_from_u32_lit_comp(0xffffff19), +rgba_from_u32_lit_comp(0x3333337f), +rgba_from_u32_lit_comp(0x3333337f), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0x7fcc99ff), +rgba_from_u32_lit_comp(0x66b2e5ff), +rgba_from_u32_lit_comp(0xfe9548ff), +rgba_from_u32_lit_comp(0xd45d90ff), +rgba_from_u32_lit_comp(0xf7bf5eff), +rgba_from_u32_lit_comp(0x994c32ff), +rgba_from_u32_lit_comp(0x4ce54cff), +rgba_from_u32_lit_comp(0x4ca54cff), +rgba_from_u32_lit_comp(0xe5cc66ff), +rgba_from_u32_lit_comp(0xe54c4cff), +rgba_from_u32_lit_comp(0x7f7f7fff), +rgba_from_u32_lit_comp(0x99503d3f), +rgba_from_u32_lit_comp(0xfe82493f), +rgba_from_u32_lit_comp(0xffba173f), +rgba_from_u32_lit_comp(0xcefd693f), +rgba_from_u32_lit_comp(0x99503d3f), +rgba_from_u32_lit_comp(0xfe82493f), +rgba_from_u32_lit_comp(0xffba173f), +rgba_from_u32_lit_comp(0x99503d3f), +rgba_from_u32_lit_comp(0xffcb7fff), +rgba_from_u32_lit_comp(0xb2ff65ff), +rgba_from_u32_lit_comp(0xff99e5ff), +rgba_from_u32_lit_comp(0x6598ffff), +rgba_from_u32_lit_comp(0x65ffcbff), +rgba_from_u32_lit_comp(0xff9819ff), +rgba_from_u32_lit_comp(0x9932ffff), +rgba_from_u32_lit_comp(0x65ff4cff), +rgba_from_u32_lit_comp(0xb2ccd8ff), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xffffff0c), +rgba_from_u32_lit_comp(0x0000003f), +}; + +Vec4F32 df_g_theme_preset_colors__four_coder[85] = +{ +rgba_from_u32_lit_comp(0xff00ffff), +rgba_from_u32_lit_comp(0x99ccff4c), +rgba_from_u32_lit_comp(0x0000007f), +rgba_from_u32_lit_comp(0x66e566e5), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xb27219ff), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0x0000003f), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0x32b219ff), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0x3333337f), +rgba_from_u32_lit_comp(0xffffff19), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0x32b219ff), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0x3333337f), +rgba_from_u32_lit_comp(0xffffff19), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0x32b219ff), +rgba_from_u32_lit_comp(0xffffff33), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xffffff33), +rgba_from_u32_lit_comp(0xffffffff), +rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0x327fb2ff), +rgba_from_u32_lit_comp(0xffffff33), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0x32b219ff), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0x3333337f), +rgba_from_u32_lit_comp(0xffffff19), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0xa87a4c99), +rgba_from_u32_lit_comp(0xffffff19), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0x42474c7f), +rgba_from_u32_lit_comp(0xffffff19), +rgba_from_u32_lit_comp(0x3333337f), +rgba_from_u32_lit_comp(0x3333337f), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0x7fcc99ff), +rgba_from_u32_lit_comp(0x66b2e5ff), +rgba_from_u32_lit_comp(0xfe9548ff), +rgba_from_u32_lit_comp(0xd45d90ff), +rgba_from_u32_lit_comp(0xf7bf5eff), +rgba_from_u32_lit_comp(0x994c32ff), +rgba_from_u32_lit_comp(0x4ce54cff), +rgba_from_u32_lit_comp(0x4ca54cff), +rgba_from_u32_lit_comp(0xe5cc66ff), +rgba_from_u32_lit_comp(0xe54c4cff), +rgba_from_u32_lit_comp(0x7f7f7fff), +rgba_from_u32_lit_comp(0x99503d3f), +rgba_from_u32_lit_comp(0xfe82493f), +rgba_from_u32_lit_comp(0xffba173f), +rgba_from_u32_lit_comp(0xcefd693f), +rgba_from_u32_lit_comp(0x99503d3f), +rgba_from_u32_lit_comp(0xfe82493f), +rgba_from_u32_lit_comp(0xffba173f), +rgba_from_u32_lit_comp(0x99503d3f), +rgba_from_u32_lit_comp(0xffcb7fff), +rgba_from_u32_lit_comp(0xb2ff65ff), +rgba_from_u32_lit_comp(0xff99e5ff), +rgba_from_u32_lit_comp(0x6598ffff), +rgba_from_u32_lit_comp(0x65ffcbff), +rgba_from_u32_lit_comp(0xff9819ff), +rgba_from_u32_lit_comp(0x9932ffff), +rgba_from_u32_lit_comp(0x65ff4cff), +rgba_from_u32_lit_comp(0xb2ccd8ff), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xffffff0c), +rgba_from_u32_lit_comp(0x0000003f), +}; + +Vec4F32 df_g_theme_preset_colors__far_manager[85] = +{ +rgba_from_u32_lit_comp(0xff00ffff), +rgba_from_u32_lit_comp(0x99ccff4c), +rgba_from_u32_lit_comp(0x0000007f), +rgba_from_u32_lit_comp(0x66e566e5), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xb27219ff), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0x0000003f), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0x32b219ff), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0x3333337f), +rgba_from_u32_lit_comp(0xffffff19), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0x32b219ff), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0x3333337f), +rgba_from_u32_lit_comp(0xffffff19), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0x32b219ff), +rgba_from_u32_lit_comp(0xffffff33), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xffffff33), +rgba_from_u32_lit_comp(0xffffffff), +rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0x327fb2ff), +rgba_from_u32_lit_comp(0xffffff33), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0x32b219ff), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0x3333337f), +rgba_from_u32_lit_comp(0xffffff19), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0xa87a4c99), +rgba_from_u32_lit_comp(0xffffff19), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0x42474c7f), +rgba_from_u32_lit_comp(0xffffff19), +rgba_from_u32_lit_comp(0x3333337f), +rgba_from_u32_lit_comp(0x3333337f), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0x7fcc99ff), +rgba_from_u32_lit_comp(0x66b2e5ff), +rgba_from_u32_lit_comp(0xfe9548ff), +rgba_from_u32_lit_comp(0xd45d90ff), +rgba_from_u32_lit_comp(0xf7bf5eff), +rgba_from_u32_lit_comp(0x994c32ff), +rgba_from_u32_lit_comp(0x4ce54cff), +rgba_from_u32_lit_comp(0x4ca54cff), +rgba_from_u32_lit_comp(0xe5cc66ff), +rgba_from_u32_lit_comp(0xe54c4cff), +rgba_from_u32_lit_comp(0x7f7f7fff), +rgba_from_u32_lit_comp(0x99503d3f), +rgba_from_u32_lit_comp(0xfe82493f), +rgba_from_u32_lit_comp(0xffba173f), +rgba_from_u32_lit_comp(0xcefd693f), +rgba_from_u32_lit_comp(0x99503d3f), +rgba_from_u32_lit_comp(0xfe82493f), +rgba_from_u32_lit_comp(0xffba173f), +rgba_from_u32_lit_comp(0x99503d3f), +rgba_from_u32_lit_comp(0xffcb7fff), +rgba_from_u32_lit_comp(0xb2ff65ff), +rgba_from_u32_lit_comp(0xff99e5ff), +rgba_from_u32_lit_comp(0x6598ffff), +rgba_from_u32_lit_comp(0x65ffcbff), +rgba_from_u32_lit_comp(0xff9819ff), +rgba_from_u32_lit_comp(0x9932ffff), +rgba_from_u32_lit_comp(0x65ff4cff), +rgba_from_u32_lit_comp(0xb2ccd8ff), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xffffff0c), +rgba_from_u32_lit_comp(0x0000003f), +}; + +Vec4F32* df_g_theme_preset_colors_table[9] = +{ +df_g_theme_preset_colors__default_dark, +df_g_theme_preset_colors__default_light, +df_g_theme_preset_colors__vs_dark, +df_g_theme_preset_colors__vs_light, +df_g_theme_preset_colors__solarized_dark, +df_g_theme_preset_colors__solarized_light, +df_g_theme_preset_colors__handmade_hero, +df_g_theme_preset_colors__four_coder, +df_g_theme_preset_colors__far_manager, +}; + +String8 df_g_theme_color_display_string_table[85] = +{ +str8_lit_comp("Null"), +str8_lit_comp("Selection"), +str8_lit_comp("Drop Shadow"), +str8_lit_comp("Cursor"), +str8_lit_comp("Cursor (Inactive)"), +str8_lit_comp("Focus"), +str8_lit_comp("Focus (Inactive)"), +str8_lit_comp("Highlight 0"), +str8_lit_comp("Highlight 1"), +str8_lit_comp("Disabled Overlay"), +str8_lit_comp("Default Text"), +str8_lit_comp("Default Text (Positive)"), +str8_lit_comp("Default Text (Negative)"), +str8_lit_comp("Default Text (Weak)"), +str8_lit_comp("Default Background"), +str8_lit_comp("Default Border"), +str8_lit_comp("Floating Text"), +str8_lit_comp("Floating Text (Positive)"), +str8_lit_comp("Floating Text (Negative)"), +str8_lit_comp("Floating Text (Weak)"), +str8_lit_comp("Floating Background"), +str8_lit_comp("Floating Border"), +str8_lit_comp("Special Positive Text"), +str8_lit_comp("Special Positive Text (Weak)"), +str8_lit_comp("Special Positive Background"), +str8_lit_comp("Special Positive Border"), +str8_lit_comp("Special Negative Text"), +str8_lit_comp("Special Negative Text (Weak)"), +str8_lit_comp("Special Negative Background"), +str8_lit_comp("Special Negative Border"), +str8_lit_comp("Special Neutral Text"), +str8_lit_comp("Special Neutral Text (Weak)"), +str8_lit_comp("Special Neutral Background"), +str8_lit_comp("Special Neutral Border"), +str8_lit_comp("Menu Bar Text"), +str8_lit_comp("Menu Bar Text (Weak)"), +str8_lit_comp("Menu Bar Text (Positive)"), +str8_lit_comp("Menu Bar Text (Negative)"), +str8_lit_comp("Menu Bar Background"), +str8_lit_comp("Menu Bar Border"), +str8_lit_comp("Tab Text"), +str8_lit_comp("Tab Text (Weak)"), +str8_lit_comp("Tab Background"), +str8_lit_comp("Tab Border"), +str8_lit_comp("Tab Text (Inactive)"), +str8_lit_comp("Tab Text (Inactive, Weak)"), +str8_lit_comp("Tab Background (Inactive)"), +str8_lit_comp("Tab Border (Inactive)"), +str8_lit_comp("Code Background"), +str8_lit_comp("Code Background (Negative)"), +str8_lit_comp("Code Line Numbers"), +str8_lit_comp("Code Line Numbers (Inactive)"), +str8_lit_comp("Code (Default)"), +str8_lit_comp("Code (Procedure)"), +str8_lit_comp("Code (Type)"), +str8_lit_comp("Code (Local)"), +str8_lit_comp("Code (Register)"), +str8_lit_comp("Code (Keyword)"), +str8_lit_comp("Code (Delimiters/Operators)"), +str8_lit_comp("Code (Numeric)"), +str8_lit_comp("Code (Numeric, Alt. Digit Group)"), +str8_lit_comp("Code (String)"), +str8_lit_comp("Code (Meta)"), +str8_lit_comp("Code (Comment)"), +str8_lit_comp("Line Info Background 0"), +str8_lit_comp("Line Info Background 1"), +str8_lit_comp("Line Info Background 2"), +str8_lit_comp("Line Info Background 3"), +str8_lit_comp("Line Info Background 4"), +str8_lit_comp("Line Info Background 5"), +str8_lit_comp("Line Info Background 6"), +str8_lit_comp("Line Info Background 7"), +str8_lit_comp("Thread 0"), +str8_lit_comp("Thread 1"), +str8_lit_comp("Thread 2"), +str8_lit_comp("Thread 3"), +str8_lit_comp("Thread 4"), +str8_lit_comp("Thread 5"), +str8_lit_comp("Thread 6"), +str8_lit_comp("Thread 7"), +str8_lit_comp("Thread (Unwound)"), +str8_lit_comp("Thread (Error)"), +str8_lit_comp("Breakpoint"), +str8_lit_comp("Drop Site Overlay"), +str8_lit_comp("Inactive Panel Overlay"), +}; + +String8 df_g_theme_color_cfg_string_table[85] = +{ +str8_lit_comp("null"), +str8_lit_comp("selection"), +str8_lit_comp("drop_shadow"), +str8_lit_comp("cursor_active"), +str8_lit_comp("cursor_inactive"), +str8_lit_comp("focus_active"), +str8_lit_comp("focus_inactive"), +str8_lit_comp("highlight_0"), +str8_lit_comp("highlight_1"), +str8_lit_comp("disabled_overlay"), +str8_lit_comp("default_text"), +str8_lit_comp("default_text_positive"), +str8_lit_comp("default_text_negative"), +str8_lit_comp("default_text_weak"), +str8_lit_comp("default_background"), +str8_lit_comp("default_border"), +str8_lit_comp("floating_text"), +str8_lit_comp("floating_text_positive"), +str8_lit_comp("floating_text_negative"), +str8_lit_comp("floating_text_weak"), +str8_lit_comp("floating_background"), +str8_lit_comp("floating_border"), +str8_lit_comp("special_positive_text"), +str8_lit_comp("special_positive_text_weak"), +str8_lit_comp("special_positive_background"), +str8_lit_comp("special_positive_border"), +str8_lit_comp("special_negative_text"), +str8_lit_comp("special_negative_text_weak"), +str8_lit_comp("special_negative_background"), +str8_lit_comp("special_negative_border"), +str8_lit_comp("special_neutral_text"), +str8_lit_comp("special_neutral_text_weak"), +str8_lit_comp("special_neutral_background"), +str8_lit_comp("special_neutral_border"), +str8_lit_comp("menu_bar_text"), +str8_lit_comp("menu_bar_text_weak"), +str8_lit_comp("menu_bar_text_positive"), +str8_lit_comp("menu_bar_text_negative"), +str8_lit_comp("menu_bar_background"), +str8_lit_comp("menu_bar_border"), +str8_lit_comp("tab_active_text"), +str8_lit_comp("tab_active_text_weak"), +str8_lit_comp("tab_active_background"), +str8_lit_comp("tab_active_border"), +str8_lit_comp("tab_inactive_text"), +str8_lit_comp("tab_inactive_text_weak"), +str8_lit_comp("tab_inactive_background"), +str8_lit_comp("tab_inactive_border"), +str8_lit_comp("code_background"), +str8_lit_comp("code_background_negative"), +str8_lit_comp("code_line_numbers_active"), +str8_lit_comp("code_line_numbers_inactive"), +str8_lit_comp("code_default"), +str8_lit_comp("code_procedure"), +str8_lit_comp("code_type"), +str8_lit_comp("code_local"), +str8_lit_comp("code_register"), +str8_lit_comp("code_keyword"), +str8_lit_comp("code_delimiter_operator"), +str8_lit_comp("code_numeric"), +str8_lit_comp("code_numeric_alt_digit_group"), +str8_lit_comp("code_string"), +str8_lit_comp("code_meta"), +str8_lit_comp("code_comment"), +str8_lit_comp("line_info_background_0"), +str8_lit_comp("line_info_background_1"), +str8_lit_comp("line_info_background_2"), +str8_lit_comp("line_info_background_3"), +str8_lit_comp("line_info_background_4"), +str8_lit_comp("line_info_background_5"), +str8_lit_comp("line_info_background_6"), +str8_lit_comp("line_info_background_7"), str8_lit_comp("thread_0"), str8_lit_comp("thread_1"), str8_lit_comp("thread_2"), @@ -898,8 +1305,10 @@ str8_lit_comp("thread_5"), str8_lit_comp("thread_6"), str8_lit_comp("thread_7"), str8_lit_comp("thread_unwound"), +str8_lit_comp("thread_error"), +str8_lit_comp("breakpoint"), +str8_lit_comp("drop_site_overlay"), str8_lit_comp("inactive_panel_overlay"), -str8_lit_comp("drop_shadow"), }; C_LINKAGE_END diff --git a/src/df/gfx/generated/df_gfx.meta.h b/src/df/gfx/generated/df_gfx.meta.h index d65a1898..3a2795f4 100644 --- a/src/df/gfx/generated/df_gfx.meta.h +++ b/src/df/gfx/generated/df_gfx.meta.h @@ -45,48 +45,77 @@ DF_GfxViewKind_COUNT, typedef enum DF_ThemeColor { DF_ThemeColor_Null, -DF_ThemeColor_PlainText, -DF_ThemeColor_PlainBackground, -DF_ThemeColor_PlainBorder, -DF_ThemeColor_PlainOverlay, +DF_ThemeColor_Selection, +DF_ThemeColor_DropShadow, +DF_ThemeColor_CursorActive, +DF_ThemeColor_CursorInactive, +DF_ThemeColor_FocusActive, +DF_ThemeColor_FocusInactive, +DF_ThemeColor_Highlight0, +DF_ThemeColor_Highlight1, +DF_ThemeColor_DisabledOverlay, +DF_ThemeColor_DefaultText, +DF_ThemeColor_DefaultTextPositive, +DF_ThemeColor_DefaultTextNegative, +DF_ThemeColor_DefaultTextWeak, +DF_ThemeColor_DefaultBackground, +DF_ThemeColor_DefaultBorder, +DF_ThemeColor_FloatingText, +DF_ThemeColor_FloatingTextPositive, +DF_ThemeColor_FloatingTextNegative, +DF_ThemeColor_FloatingTextWeak, +DF_ThemeColor_FloatingBackground, +DF_ThemeColor_FloatingBorder, +DF_ThemeColor_SpecialPositiveText, +DF_ThemeColor_SpecialPositiveTextWeak, +DF_ThemeColor_SpecialPositiveBackground, +DF_ThemeColor_SpecialPositiveBorder, +DF_ThemeColor_SpecialNegativeText, +DF_ThemeColor_SpecialNegativeTextWeak, +DF_ThemeColor_SpecialNegativeBackground, +DF_ThemeColor_SpecialNegativeBorder, +DF_ThemeColor_SpecialNeutralText, +DF_ThemeColor_SpecialNeutralTextWeak, +DF_ThemeColor_SpecialNeutralBackground, +DF_ThemeColor_SpecialNeutralBorder, +DF_ThemeColor_MenuBarText, +DF_ThemeColor_MenuBarTextWeak, +DF_ThemeColor_MenuBarTextPositive, +DF_ThemeColor_MenuBarTextNegative, +DF_ThemeColor_MenuBarBackground, +DF_ThemeColor_MenuBarBorder, +DF_ThemeColor_TabActiveText, +DF_ThemeColor_TabActiveTextWeak, +DF_ThemeColor_TabActiveBackground, +DF_ThemeColor_TabActiveBorder, +DF_ThemeColor_TabInactiveText, +DF_ThemeColor_TabInactiveTextWeak, +DF_ThemeColor_TabInactiveBackground, +DF_ThemeColor_TabInactiveBorder, +DF_ThemeColor_CodeBackground, +DF_ThemeColor_CodeBackgroundNegative, +DF_ThemeColor_CodeLineNumbersActive, +DF_ThemeColor_CodeLineNumbersInactive, DF_ThemeColor_CodeDefault, -DF_ThemeColor_CodeFunction, +DF_ThemeColor_CodeProcedure, 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_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 +125,10 @@ DF_ThemeColor_Thread5, DF_ThemeColor_Thread6, DF_ThemeColor_Thread7, DF_ThemeColor_ThreadUnwound, +DF_ThemeColor_ThreadError, +DF_ThemeColor_Breakpoint, +DF_ThemeColor_DropSiteOverlay, DF_ThemeColor_InactivePanelOverlay, -DF_ThemeColor_DropShadow, DF_ThemeColor_COUNT, } DF_ThemeColor; @@ -275,27 +306,29 @@ DF_VIEW_UI_FUNCTION_DEF(disasm); DF_VIEW_UI_FUNCTION_DEF(bitmap); 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[30]; +extern String8 df_g_theme_color_version_remap_new_name_table[30]; +extern Vec4F32 df_g_theme_preset_colors__default_dark[85]; +extern Vec4F32 df_g_theme_preset_colors__default_light[85]; +extern Vec4F32 df_g_theme_preset_colors__vs_dark[85]; +extern Vec4F32 df_g_theme_preset_colors__vs_light[85]; +extern Vec4F32 df_g_theme_preset_colors__solarized_dark[85]; +extern Vec4F32 df_g_theme_preset_colors__solarized_light[85]; +extern Vec4F32 df_g_theme_preset_colors__handmade_hero[85]; +extern Vec4F32 df_g_theme_preset_colors__four_coder[85]; +extern Vec4F32 df_g_theme_preset_colors__far_manager[85]; +extern Vec4F32* df_g_theme_preset_colors_table[9]; +extern String8 df_g_theme_color_display_string_table[85]; +extern String8 df_g_theme_color_cfg_string_table[85]; 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, diff --git a/src/ui/generated/ui.meta.c b/src/ui/generated/ui.meta.c index 690f55f7..b292cc26 100644 --- a/src/ui/generated/ui.meta.c +++ b/src/ui/generated/ui.meta.c @@ -17,12 +17,7 @@ #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_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_Scheme(v) DeferLoop(ui_push_scheme(v), ui_pop_scheme()) #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()) @@ -49,12 +44,7 @@ internal UI_FocusKind ui_top_focus_hot(void) { UI_StackTopImpl(ui_state, FocusHo 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 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_ColorScheme* ui_top_scheme(void) { UI_StackTopImpl(ui_state, Scheme, scheme) } 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) } @@ -80,12 +70,7 @@ internal UI_FocusKind ui_bottom_focus_hot(void) { UI_StackBottomImpl(ui_state, F 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 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_ColorScheme* ui_bottom_scheme(void) { UI_StackBottomImpl(ui_state, Scheme, scheme) } 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) } @@ -111,12 +96,7 @@ internal UI_FocusKind ui_push_focus_hot(UI_FocusKind v) { UI_StackPushImpl(ui_st 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 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_ColorScheme* ui_push_scheme(UI_ColorScheme* v) { UI_StackPushImpl(ui_state, Scheme, scheme, UI_ColorScheme*, 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) } @@ -142,12 +122,7 @@ internal UI_FocusKind ui_pop_focus_hot(void) { UI_StackPopImpl(ui_state, FocusHo 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 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_ColorScheme* ui_pop_scheme(void) { UI_StackPopImpl(ui_state, Scheme, scheme) } 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) } @@ -173,12 +148,7 @@ internal UI_FocusKind ui_set_next_focus_hot(UI_FocusKind v) { UI_StackSetNextImp 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 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_ColorScheme* ui_set_next_scheme(UI_ColorScheme* v) { UI_StackSetNextImpl(ui_state, Scheme, scheme, UI_ColorScheme*, 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) } diff --git a/src/ui/generated/ui.meta.h b/src/ui/generated/ui.meta.h index f49e8463..bdc47306 100644 --- a/src/ui/generated/ui.meta.h +++ b/src/ui/generated/ui.meta.h @@ -19,12 +19,7 @@ typedef struct UI_FocusHotNode UI_FocusHotNode; struct UI_FocusHotNode{UI_FocusH 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_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_SchemeNode UI_SchemeNode; struct UI_SchemeNode{UI_SchemeNode *next; UI_ColorScheme* 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;}; @@ -53,12 +48,7 @@ UI_FocusHotNode focus_hot_nil_stack_top;\ UI_FocusActiveNode focus_active_nil_stack_top;\ UI_FastpathCodepointNode fastpath_codepoint_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_SchemeNode scheme_nil_stack_top;\ UI_SquishNode squish_nil_stack_top;\ UI_HoverCursorNode hover_cursor_nil_stack_top;\ UI_FontNode font_nil_stack_top;\ @@ -86,12 +76,7 @@ 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->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->scheme_nil_stack_top.v = &ui_g_nil_color_scheme;\ 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();\ @@ -121,12 +106,7 @@ struct { UI_FocusHotNode *top; UI_FocusKind bottom_val; UI_FocusHotNode *free; B 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_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_SchemeNode *top; UI_ColorScheme* bottom_val; UI_SchemeNode *free; B32 auto_pop; } scheme_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;\ @@ -154,12 +134,7 @@ state->focus_hot_stack.top = &state->focus_hot_nil_stack_top; state->focus_hot_s 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->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->scheme_stack.top = &state->scheme_nil_stack_top; state->scheme_stack.bottom_val = &ui_g_nil_color_scheme; state->scheme_stack.free = 0; state->scheme_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;\ @@ -187,12 +162,7 @@ if(state->focus_hot_stack.auto_pop) { ui_pop_focus_hot(); state->focus_hot_stack 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->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->scheme_stack.auto_pop) { ui_pop_scheme(); state->scheme_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; }\ @@ -219,12 +189,7 @@ internal UI_FocusKind ui_top_focus_hot(void); internal UI_FocusKind ui_top_focus_active(void); internal U32 ui_top_fastpath_codepoint(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_ColorScheme* ui_top_scheme(void); internal F32 ui_top_squish(void); internal OS_Cursor ui_top_hover_cursor(void); internal F_Tag ui_top_font(void); @@ -250,12 +215,7 @@ internal UI_FocusKind ui_bottom_focus_hot(void); internal UI_FocusKind ui_bottom_focus_active(void); internal U32 ui_bottom_fastpath_codepoint(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_ColorScheme* ui_bottom_scheme(void); internal F32 ui_bottom_squish(void); internal OS_Cursor ui_bottom_hover_cursor(void); internal F_Tag ui_bottom_font(void); @@ -281,12 +241,7 @@ 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 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_ColorScheme* ui_push_scheme(UI_ColorScheme* 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); @@ -312,12 +267,7 @@ internal UI_FocusKind ui_pop_focus_hot(void); internal UI_FocusKind ui_pop_focus_active(void); internal U32 ui_pop_fastpath_codepoint(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_ColorScheme* ui_pop_scheme(void); internal F32 ui_pop_squish(void); internal OS_Cursor ui_pop_hover_cursor(void); internal F_Tag ui_pop_font(void); @@ -343,12 +293,7 @@ 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 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_ColorScheme* ui_set_next_scheme(UI_ColorScheme* 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); diff --git a/src/ui/ui.mdesk b/src/ui/ui.mdesk index 1eb36228..3e90019e 100644 --- a/src/ui/ui.mdesk +++ b/src/ui/ui.mdesk @@ -7,59 +7,54 @@ 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 } //- 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 } + { Scheme scheme `UI_ColorScheme*` `&ui_g_nil_color_scheme` } //- 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 } + { 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 diff --git a/src/ui/ui_basic_widgets.c b/src/ui/ui_basic_widgets.c index aea53327..18d051eb 100644 --- a/src/ui/ui_basic_widgets.c +++ b/src/ui/ui_basic_widgets.c @@ -120,8 +120,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 +130,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->scheme->colors[UI_ColorCode_Cursor]; cursor_color.w *= box->parent->parent->focus_active_t; - Vec4F32 select_color = draw_data->select_color; + Vec4F32 select_color = box->scheme->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 +259,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 +399,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 +478,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_Scheme(ui_fork_top_color_scheme(.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 +517,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_Scheme(ui_fork_top_color_scheme(.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("")); } diff --git a/src/ui/ui_basic_widgets.h b/src/ui/ui_basic_widgets.h index dc8c2394..98a571a0 100644 --- a/src/ui/ui_basic_widgets.h +++ b/src/ui/ui_basic_widgets.h @@ -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); diff --git a/src/ui/ui_core.c b/src/ui/ui_core.c index adc59066..153eb7a3 100644 --- a/src/ui/ui_core.c +++ b/src/ui/ui_core.c @@ -1890,8 +1890,7 @@ ui_begin_ctx_menu(UI_Key key) 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->scheme = ui_top_scheme(); ui_state->ctx_menu_root->blur_size = ui_top_blur_size(); } ui_push_pref_width(ui_bottom_pref_width()); @@ -2037,6 +2036,41 @@ ui_set_auto_focus_hot_key(UI_Key key) } } +//- rjf: color scheme forming + +internal UI_ColorScheme * +ui_push_color_scheme_(UI_ColorScheme *params) +{ + UI_ColorScheme *scheme = push_array(ui_build_arena(), UI_ColorScheme, 1); + MemoryCopyStruct(scheme, params); + return scheme; +} + +internal UI_ColorScheme * +ui_fork_color_scheme_(UI_ColorScheme *scheme, UI_ColorScheme *overrides) +{ + UI_ColorScheme *fork = push_array(ui_build_arena(), UI_ColorScheme, 1); + MemoryCopyStruct(fork, scheme); + 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) + { + fork->colors[code] = overrides->colors[code]; + } + } + return fork; +} + +internal UI_ColorScheme * +ui_fork_top_color_scheme_(UI_ColorScheme *params) +{ + UI_ColorScheme *scheme = ui_fork_color_scheme_(ui_top_scheme(), params); + return scheme; +} + //- rjf: box node construction internal UI_Box * @@ -2181,10 +2215,7 @@ 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->scheme = ui_state->scheme_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; @@ -2274,7 +2305,7 @@ ui_box_equip_display_string(UI_Box *box, String8 string) 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->scheme->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); } @@ -2287,15 +2318,15 @@ 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->scheme->colors[UI_ColorCode_Text], 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->scheme->colors[UI_ColorCode_Text], 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->scheme->colors[UI_ColorCode_Text], 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); } 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->scheme->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); } @@ -2406,63 +2437,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) { diff --git a/src/ui/ui_core.h b/src/ui/ui_core.h index 8f69313d..db02e8c9 100644 --- a/src/ui/ui_core.h +++ b/src/ui/ui_core.h @@ -195,6 +195,43 @@ struct UI_Size F32 strictness; }; +//////////////////////////////// +//~ rjf: Color Schemes + +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_ColorScheme UI_ColorScheme; +struct UI_ColorScheme +{ + union + { + Vec4F32 colors[UI_ColorCode_COUNT]; + struct + { + Vec4F32 null; + Vec4F32 background; + Vec4F32 text; + Vec4F32 text_weak; + Vec4F32 border; + Vec4F32 overlay; + Vec4F32 cursor; + Vec4F32 selection; + }; + }; +}; + //////////////////////////////// //~ rjf: Scroll Positions @@ -275,20 +312,21 @@ typedef U64 UI_BoxFlags; # 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_DrawTextWeak (UI_BoxFlags)(1ull<<36) +# define UI_BoxFlag_DrawHotEffects (UI_BoxFlags)(1ull<<37) +# define UI_BoxFlag_DrawActiveEffects (UI_BoxFlags)(1ull<<38) +# define UI_BoxFlag_DrawOverlay (UI_BoxFlags)(1ull<<39) +# define UI_BoxFlag_DrawBucket (UI_BoxFlags)(1ull<<40) +# define UI_BoxFlag_Clip (UI_BoxFlags)(1ull<<41) +# define UI_BoxFlag_AnimatePosX (UI_BoxFlags)(1ull<<42) +# define UI_BoxFlag_AnimatePosY (UI_BoxFlags)(1ull<<43) +# define UI_BoxFlag_DisableTextTrunc (UI_BoxFlags)(1ull<<44) +# define UI_BoxFlag_DisableIDString (UI_BoxFlags)(1ull<<45) +# define UI_BoxFlag_DisableFocusViz (UI_BoxFlags)(1ull<<46) +# define UI_BoxFlag_RequireFocusBackground (UI_BoxFlags)(1ull<<47) +# define UI_BoxFlag_HasDisplayString (UI_BoxFlags)(1ull<<48) +# define UI_BoxFlag_HasFuzzyMatchRanges (UI_BoxFlags)(1ull<<49) +# define UI_BoxFlag_RoundChildrenByParent (UI_BoxFlags)(1ull<<50) //- rjf: bundles # define UI_BoxFlag_Clickable (UI_BoxFlag_MouseClickable|UI_BoxFlag_KeyboardClickable) @@ -330,10 +368,7 @@ struct UI_Box 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_ColorScheme *scheme; F_Tag font; F32 font_size; F32 tab_size; @@ -604,6 +639,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_ColorScheme ui_g_nil_color_scheme = {0}; + //////////////////////////////// //~ rjf: Scroll Point Type Functions @@ -720,6 +760,14 @@ 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: color scheme forming +internal UI_ColorScheme * ui_push_color_scheme_(UI_ColorScheme *params); +internal UI_ColorScheme * ui_fork_color_scheme_(UI_ColorScheme *scheme, UI_ColorScheme *overrides); +internal UI_ColorScheme * ui_fork_top_color_scheme_(UI_ColorScheme *params); +#define ui_push_color_scheme(...) ui_push_color_scheme_(&(UI_ColorScheme){__VA_ARGS__}) +#define ui_fork_color_scheme(scheme, ...) ui_fork_color_scheme_((scheme), &(UI_ColorScheme){__VA_ARGS__}) +#define ui_fork_top_color_scheme(...) ui_fork_top_color_scheme_(&(UI_ColorScheme){__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); @@ -742,10 +790,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); //////////////////////////////// @@ -765,16 +809,12 @@ internal UI_FocusKind ui_top_focus_hot(void); internal UI_FocusKind ui_top_focus_active(void); internal U32 ui_top_fastpath_codepoint(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_ColorScheme* ui_top_scheme(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 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); @@ -795,16 +835,12 @@ internal UI_FocusKind ui_bottom_focus_hot(void); internal UI_FocusKind ui_bottom_focus_active(void); internal U32 ui_bottom_fastpath_codepoint(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_ColorScheme* ui_bottom_scheme(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 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); @@ -825,16 +861,12 @@ 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 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_ColorScheme* ui_push_scheme(UI_ColorScheme* 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 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); @@ -855,16 +887,12 @@ internal UI_FocusKind ui_pop_focus_hot(void); internal UI_FocusKind ui_pop_focus_active(void); internal U32 ui_pop_fastpath_codepoint(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_ColorScheme* ui_pop_scheme(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 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); @@ -885,16 +913,12 @@ 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 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_ColorScheme* ui_set_next_scheme(UI_ColorScheme* 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 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); @@ -929,12 +953,7 @@ internal void ui_pop_corner_radius(void); #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_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_Scheme(v) DeferLoop(ui_push_scheme(v), ui_pop_scheme()) #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()) @@ -955,6 +974,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()) From fc778444521294c345be570d34586f4ade378df6 Mon Sep 17 00:00:00 2001 From: Ryan Fleury Date: Fri, 21 Jun 2024 09:49:51 -0700 Subject: [PATCH 05/47] color scheme -> palette; fix eval/watch views after cleanup; make more progress on new palette system --- src/df/core/df_core.c | 9 +- src/df/gfx/df_gfx.c | 336 +++++++++++++++++++------------------ src/df/gfx/df_gfx.h | 40 ++--- src/df/gfx/df_view_rules.c | 10 +- src/df/gfx/df_views.c | 92 +++++----- src/ui/generated/ui.meta.c | 18 +- src/ui/generated/ui.meta.h | 33 ++-- src/ui/ui.mdesk | 3 +- src/ui/ui_basic_widgets.c | 9 +- src/ui/ui_core.c | 49 +++--- src/ui/ui_core.h | 105 ++++++------ 11 files changed, 364 insertions(+), 340 deletions(-) diff --git a/src/df/core/df_core.c b/src/df/core/df_core.c index 13127f51..a8784f16 100644 --- a/src/df/core/df_core.c +++ b/src/df/core/df_core.c @@ -5708,10 +5708,11 @@ df_eval_viz_row_list_push_new(Arena *arena, EVAL_ParseCtx *parse_ctx, DF_EvalViz rows->count += 1; // rjf: fill basics - row->depth = block->depth; - row->parent_key = block->parent_key; - row->key = key; - row->eval = eval; + row->depth = block->depth; + row->parent_key = block->parent_key; + row->key = key; + row->eval = eval; + row->size_in_rows = 1; // rjf: determine exandability, editability if(tg_kind_from_key(eval.type_key) != TG_Kind_Null) diff --git a/src/df/gfx/df_gfx.c b/src/df/gfx/df_gfx.c index 329aee90..6a011d04 100644 --- a/src/df/gfx/df_gfx.c +++ b/src/df/gfx/df_gfx.c @@ -3457,7 +3457,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) ui_push_font_size(main_font_size); ui_push_pref_width(ui_em(20.f, 1)); ui_push_pref_height(ui_em(2.5f, 1.f)); - ui_push_scheme(df_ui_color_scheme_from_code(DF_UIColorSchemeCode_Default)); + ui_push_palette(df_palette_from_code(DF_PaletteCode_Default)); ui_push_blur_size(10.f); } @@ -3503,7 +3503,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) UI_Size main_width = ui_top_pref_width(); UI_Size main_height = ui_top_pref_height(); UI_TextAlign main_text_align = ui_top_text_alignment(); - DF_UIColorScheme(DF_UIColorSchemeCode_TabActive) + DF_Palette(DF_PaletteCode_TabActive) UI_Tooltip UI_PrefWidth(main_width) UI_PrefHeight(main_height) @@ -3564,7 +3564,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) //- rjf: entity drop completion ctx menu // { - DF_UIColorScheme(DF_UIColorSchemeCode_Floating) + DF_Palette(DF_PaletteCode_Floating) UI_CtxMenu(ws->drop_completion_ctx_menu_key) UI_PrefWidth(ui_em(30.f, 1.f)) { @@ -3715,7 +3715,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) //////////////////////////// //- rjf: universal ctx menus // - DF_UIColorScheme(DF_UIColorSchemeCode_Floating) + DF_Palette(DF_PaletteCode_Floating) { Temp scratch = scratch_begin(&arena, 1); @@ -3752,12 +3752,12 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) UI_Flags(UI_BoxFlag_DrawTextWeak) ui_label(df_g_entity_kind_display_string_table[entity->kind]); { - UI_ColorScheme *scheme = ui_top_scheme(); + UI_Palette *palette = ui_top_palette(); if(entity->flags & DF_EntityFlag_HasColor) { - scheme = ui_fork_top_color_scheme(.text = df_rgba_from_entity(entity)); + palette = ui_build_palette(ui_top_palette(), .text = df_rgba_from_entity(entity)); } - UI_Scheme(scheme) + UI_Palette(palette) UI_PrefWidth(ui_text_dim(10, 1)) UI_Font((kind_flags & DF_EntityKindFlag_NameIsCode) ? df_font_from_slot(DF_FontSlot_Code) : ui_top_font()) ui_label(display_name); @@ -3933,7 +3933,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) if(op_flags & DF_EntityOpFlag_Freeze) { B32 is_frozen = df_entity_is_frozen(entity); - ui_set_next_scheme(df_ui_color_scheme_from_code(is_frozen ? DF_UIColorSchemeCode_SpecialNegative : DF_UIColorSchemeCode_SpecialPositive)); + ui_set_next_palette(df_palette_from_code(is_frozen ? DF_PaletteCode_SpecialNegative : DF_PaletteCode_SpecialPositive)); if(is_frozen && ui_clicked(df_icon_buttonf(DF_IconKind_Locked, 0, "Thaw###freeze_thaw"))) { DF_CmdParams params = df_cmd_params_from_window(ws); @@ -4203,7 +4203,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) for(U64 preset_idx = 0; preset_idx < ArrayCount(presets); preset_idx += 1) { ui_set_next_hover_cursor(OS_Cursor_HandPoint); - ui_set_next_scheme(ui_fork_top_color_scheme(.background = presets[preset_idx])); + ui_set_next_palette(ui_build_palette(ui_top_palette(), .background = presets[preset_idx])); UI_Box *box = ui_build_box_from_stringf(UI_BoxFlag_DrawBackground| UI_BoxFlag_DrawBorder| UI_BoxFlag_Clickable| @@ -4369,15 +4369,17 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) { Vec2F32 window_dim = dim_2f32(window_rect); UI_Box *bg_box = &ui_g_nil_box; + UI_Palette *palette = ui_build_palette(df_palette_from_code(DF_PaletteCode_Floating)); + palette->background.w *= df_gfx_state->confirm_t; UI_Rect(window_rect) UI_ChildLayoutAxis(Axis2_X) UI_Focus(UI_FocusKind_On) UI_BlurSize(10*df_gfx_state->confirm_t) - DF_UIColorScheme(DF_UIColorSchemeCode_Floating) + UI_Palette(palette) { bg_box = ui_build_box_from_stringf(UI_BoxFlag_FixedSize|UI_BoxFlag_Floating|UI_BoxFlag_Clickable|UI_BoxFlag_Scroll|UI_BoxFlag_DefaultFocusNav|UI_BoxFlag_DrawBackgroundBlur|UI_BoxFlag_DrawBackground, "###confirm_popup_%p", ws); } - if(df_gfx_state->confirm_active) UI_Parent(bg_box) + if(df_gfx_state->confirm_active) UI_Parent(bg_box) UI_Transparency(1-df_gfx_state->confirm_t) { ui_ctx_menu_close(); UI_WidthFill UI_PrefHeight(ui_children_sum(1.f)) UI_Column UI_Padding(ui_pct(1, 0)) @@ -4389,7 +4391,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) { UI_CornerRadius00(ui_top_font_size()*0.25f) UI_CornerRadius01(ui_top_font_size()*0.25f) - DF_UIColorScheme(DF_UIColorSchemeCode_SpecialNeutral) + DF_Palette(DF_PaletteCode_SpecialNeutral) if(ui_clicked(ui_buttonf("OK")) || (ui_key_match(bg_box->default_nav_focus_hot_key, ui_key_zero()) && ui_slot_press(UI_EventActionSlot_Accept))) { DF_CmdParams p = df_cmd_params_zero(); @@ -4707,7 +4709,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) os_window_push_custom_edges(ws->os, window_edge_px); os_window_push_custom_title_bar(ws->os, dim_2f32(top_bar_rect).y); ui_set_next_flags(UI_BoxFlag_DefaultFocusNav); - DF_UIColorScheme(DF_UIColorSchemeCode_MenuBar) + DF_Palette(DF_PaletteCode_MenuBar) UI_Focus((ws->menu_bar_focused && window_is_focused && !ui_any_ctx_menu_is_open() && !hover_eval_is_open) ? UI_FocusKind_On : UI_FocusKind_Null) UI_Pane(top_bar_rect, str8_lit("###top_bar")) UI_WidthFill UI_Row @@ -4892,14 +4894,14 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) for(DF_EntityNode *n = targets_list.first; n != 0; n = n->next) { DF_Entity *target = n->entity; - UI_ColorScheme *scheme = ui_top_scheme(); + UI_Palette *palette = ui_top_palette(); if(target->flags & DF_EntityFlag_HasColor) { - scheme = ui_fork_top_color_scheme(.text = df_rgba_from_entity(target)); + palette = ui_build_palette(ui_top_palette(), .text = df_rgba_from_entity(target)); } String8 target_name = df_display_string_from_entity(scratch.arena, target); UI_Signal sig = {0}; - UI_Scheme(scheme) sig = df_icon_buttonf(DF_IconKind_Target, 0, "%S##%p", target_name, target); + UI_Palette(palette) sig = df_icon_buttonf(DF_IconKind_Target, 0, "%S##%p", target_name, target); if(ui_clicked(sig)) { DF_CmdParams params = df_cmd_params_from_window(ws); @@ -5093,7 +5095,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) // rjf: conversion task visualization UI_PrefWidth(ui_text_dim(10, 1)) UI_HeightFill - DF_UIColorScheme(DF_UIColorSchemeCode_SpecialNeutral) + DF_Palette(DF_PaletteCode_SpecialNeutral) { Temp scratch = scratch_begin(&arena, 1); DF_EntityList tasks = df_query_cached_entity_list_with_kind(DF_EntityKind_ConversionTask); @@ -5140,7 +5142,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) if(can_play || !have_targets || processes.count == 0) UI_TextAlignment(UI_TextAlign_Center) UI_Flags((can_play ? 0 : UI_BoxFlag_Disabled)) - DF_UIColorScheme(DF_UIColorSchemeCode_SpecialPositive) + DF_Palette(DF_PaletteCode_SpecialPositive) { UI_Signal sig = ui_button(df_g_icon_kind_text_table[DF_IconKind_Play]); os_window_push_custom_title_bar_client_area(ws->os, sig.box->rect); @@ -5181,7 +5183,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) //- rjf: restart button if(!can_play && processes.count != 0) UI_TextAlignment(UI_TextAlign_Center) - DF_UIColorScheme(DF_UIColorSchemeCode_SpecialPositive) + DF_Palette(DF_PaletteCode_SpecialPositive) { UI_Signal sig = ui_button(df_g_icon_kind_text_table[DF_IconKind_Redo]); os_window_push_custom_title_bar_client_area(ws->os, sig.box->rect); @@ -5216,7 +5218,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) //- rjf: pause button UI_TextAlignment(UI_TextAlign_Center) UI_Flags(can_pause ? 0 : UI_BoxFlag_Disabled) - DF_UIColorScheme(DF_UIColorSchemeCode_SpecialNeutral) + DF_Palette(DF_PaletteCode_SpecialNeutral) { UI_Signal sig = ui_button(df_g_icon_kind_text_table[DF_IconKind_Pause]); os_window_push_custom_title_bar_client_area(ws->os, sig.box->rect); @@ -5243,7 +5245,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) //- rjf: stop button UI_TextAlignment(UI_TextAlign_Center) UI_Flags(can_stop ? 0 : UI_BoxFlag_Disabled) - DF_UIColorScheme(DF_UIColorSchemeCode_SpecialNegative) + DF_Palette(DF_PaletteCode_SpecialNegative) { UI_Signal sig = {0}; { @@ -5381,7 +5383,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) ui_spacer(ui_pct(1, 0)); // rjf: loaded user viz - if(do_user_prof) DF_UIColorScheme(DF_UIColorSchemeCode_SpecialNeutral) + if(do_user_prof) DF_Palette(DF_PaletteCode_SpecialNeutral) { ui_set_next_pref_width(ui_children_sum(1)); ui_set_next_child_layout_axis(Axis2_X); @@ -5416,7 +5418,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) } // rjf: loaded project viz - if(do_user_prof) DF_UIColorScheme(DF_UIColorSchemeCode_SpecialNeutral) + if(do_user_prof) DF_Palette(DF_PaletteCode_SpecialNeutral) { ui_set_next_pref_width(ui_children_sum(1)); ui_set_next_child_layout_axis(Axis2_X); @@ -5463,7 +5465,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) max_sig = df_icon_buttonf(DF_IconKind_Window, 0, "##maximize"); } UI_PrefWidth(ui_px(button_dim*2, 1.f)) - DF_UIColorScheme(DF_UIColorSchemeCode_SpecialNegative) + DF_Palette(DF_PaletteCode_SpecialNegative) { cls_sig = df_icon_buttonf(DF_IconKind_X, 0, "##close"); } @@ -5495,10 +5497,10 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) { B32 is_running = df_ctrl_targets_running() && df_ctrl_last_run_frame_idx() < df_frame_index(); CTRL_Event stop_event = df_ctrl_last_stop_event(); - UI_ColorScheme *positive_scheme = df_ui_color_scheme_from_code(DF_UIColorSchemeCode_SpecialPositive); - UI_ColorScheme *running_scheme = df_ui_color_scheme_from_code(DF_UIColorSchemeCode_SpecialNeutral); - UI_ColorScheme *negative_scheme = df_ui_color_scheme_from_code(DF_UIColorSchemeCode_SpecialNegative); - UI_ColorScheme *scheme = running_scheme; + UI_Palette *positive_scheme = df_palette_from_code(DF_PaletteCode_SpecialPositive); + UI_Palette *running_scheme = df_palette_from_code(DF_PaletteCode_SpecialNeutral); + UI_Palette *negative_scheme = df_palette_from_code(DF_PaletteCode_SpecialNegative); + UI_Palette *palette = running_scheme; if(!is_running) { switch(stop_event.cause) @@ -5506,21 +5508,21 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) default: case CTRL_EventCause_Finished: { - scheme = positive_scheme; + palette = positive_scheme; }break; case CTRL_EventCause_UserBreakpoint: case CTRL_EventCause_InterruptedByException: case CTRL_EventCause_InterruptedByTrap: case CTRL_EventCause_InterruptedByHalt: { - scheme = negative_scheme; + palette = negative_scheme; }break; } } if(ws->error_t > 0.01f) { - UI_ColorScheme *blended_scheme = push_array(ui_build_arena(), UI_ColorScheme, 1); - MemoryCopyStruct(blended_scheme, scheme); + UI_Palette *blended_scheme = push_array(ui_build_arena(), UI_Palette, 1); + MemoryCopyStruct(blended_scheme, palette); for(EachEnumVal(UI_ColorCode, code)) { for(U64 idx = 0; idx < 4; idx += 1) @@ -5528,10 +5530,10 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) blended_scheme->colors[code].v[idx] += (negative_scheme->colors[code].v[idx] - blended_scheme->colors[code].v[idx]) * ws->error_t; } } - scheme = blended_scheme; + palette = blended_scheme; } UI_Flags(UI_BoxFlag_DrawBackground) UI_CornerRadius(0) - UI_Scheme(scheme) + UI_Palette(palette) UI_Pane(bottom_bar_rect, str8_lit("###bottom_bar")) UI_WidthFill UI_Row UI_Flags(0) { @@ -5584,7 +5586,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) UI_Flags(UI_BoxFlag_DrawBackground) UI_TextAlignment(UI_TextAlign_Center) UI_CornerRadius(4) - DF_UIColorScheme(DF_UIColorSchemeCode_SpecialNeutral) + DF_Palette(DF_PaletteCode_SpecialNeutral) ui_labelf("Currently rebinding \"%S\" hotkey", df_gfx_state->bind_change_cmd_spec->info.display_name); } @@ -5752,6 +5754,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) //- rjf: build query text input B32 query_completed = 0; + B32 query_cancelled = 0; UI_Parent(query_container_box) UI_WidthFill UI_PrefHeight(ui_px(query_line_edit_height, 1.f)) UI_Focus(UI_FocusKind_On) @@ -5789,13 +5792,20 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) ws->query_view_selected = 1; } } - UI_PrefWidth(ui_em(5.f, 1.f)) UI_Focus(UI_FocusKind_Off) + UI_PrefWidth(ui_em(5.f, 1.f)) UI_Focus(UI_FocusKind_Off) DF_Palette(DF_PaletteCode_SpecialPositive) { if(ui_clicked(df_icon_buttonf(DF_IconKind_RightArrow, 0, "##complete_query"))) { query_completed = 1; } } + UI_PrefWidth(ui_em(3.f, 1.f)) UI_Focus(UI_FocusKind_Off) DF_Palette(DF_PaletteCode_Default) + { + if(ui_clicked(df_icon_buttonf(DF_IconKind_X, 0, "##cancel_query"))) + { + query_cancelled = 1; + } + } } } @@ -5808,8 +5818,8 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) } //- rjf: query submission - if((ui_is_focus_active() || (window_is_focused && !ui_any_ctx_menu_is_open() && !ws->menu_bar_focused && !ws->query_view_selected)) && - ui_slot_press(UI_EventActionSlot_Cancel)) + if(((ui_is_focus_active() || (window_is_focused && !ui_any_ctx_menu_is_open() && !ws->menu_bar_focused && !ws->query_view_selected)) && + ui_slot_press(UI_EventActionSlot_Cancel)) || query_cancelled) { DF_CmdParams params = df_cmd_params_from_window(ws); df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_CancelQuery)); @@ -5842,7 +5852,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) } //- rjf: build darkening overlay for rest of screen - UI_Scheme(ui_fork_top_color_scheme(.background = mix_4f32(df_rgba_from_theme_color(DF_ThemeColor_InactivePanelOverlay), v4f32(0, 0, 0, 0), 1-ws->query_view_selected_t))) + UI_Palette(ui_build_palette(ui_top_palette(), .background = mix_4f32(df_rgba_from_theme_color(DF_ThemeColor_InactivePanelOverlay), v4f32(0, 0, 0, 0), 1-ws->query_view_selected_t))) UI_Rect(window_rect) { ui_build_box_from_key(UI_BoxFlag_DrawBackground, ui_key_zero()); @@ -5900,7 +5910,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) if(build_hover_eval && ws->hover_eval_string.size != 0 && hover_eval_is_open) UI_Font(df_font_from_slot(DF_FontSlot_Code)) UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Main)) - DF_UIColorScheme(DF_UIColorSchemeCode_Floating) + DF_Palette(DF_PaletteCode_Floating) { Temp scratch = scratch_begin(&arena, 1); DI_Scope *scope = di_scope_open(); @@ -6060,7 +6070,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) { Vec4F32 rgba = df_rgba_from_theme_color(DF_ThemeColor_Highlight0); rgba.w *= 0.2f; - ui_set_next_scheme(ui_fork_top_color_scheme(.background = rgba)); + ui_set_next_palette(ui_build_palette(ui_top_palette(), .background = rgba)); } UI_Signal sig = df_line_editf(DF_LineEditFlag_CodeContents| DF_LineEditFlag_DisplayStringIsCode| @@ -6087,7 +6097,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) { Vec4F32 rgba = df_rgba_from_theme_color(DF_ThemeColor_Highlight0); rgba.w *= 0.2f; - ui_set_next_scheme(ui_fork_top_color_scheme(.background = rgba)); + ui_set_next_palette(ui_build_palette(ui_top_palette(), .background = rgba)); ui_set_next_flags(UI_BoxFlag_DrawBackground); } df_code_label(1.f, 1, df_rgba_from_theme_color(DF_ThemeColor_CodeDefault), row->display_value); @@ -6243,7 +6253,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) ui_set_next_child_layout_axis(axis2_flip(axis)); if(ui_key_match(key, ui_drop_hot_key())) { - ui_set_next_scheme(ui_fork_top_color_scheme(.border = df_rgba_from_theme_color(DF_ThemeColor_Highlight0))); + ui_set_next_palette(ui_build_palette(ui_top_palette(), .border = df_rgba_from_theme_color(DF_ThemeColor_Highlight0))); } site_box_viz = ui_build_box_from_key(UI_BoxFlag_DrawBackground| UI_BoxFlag_DrawBorder| @@ -6270,7 +6280,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) future_split_rect.p1.v[axis] += drop_site_major_dim_px; future_split_rect.p0.v[axis2_flip(axis)] = panel_rect.p0.v[axis2_flip(axis)]; future_split_rect.p1.v[axis2_flip(axis)] = panel_rect.p1.v[axis2_flip(axis)]; - UI_Rect(future_split_rect) DF_UIColorScheme(DF_UIColorSchemeCode_DropSite) + UI_Rect(future_split_rect) DF_Palette(DF_PaletteCode_DropSite) { ui_build_box_from_key(UI_BoxFlag_DrawBackground, ui_key_zero()); } @@ -6328,7 +6338,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) ui_set_next_child_layout_axis(axis2_flip(split_axis)); if(ui_key_match(key, ui_drop_hot_key())) { - ui_set_next_scheme(ui_fork_top_color_scheme(.border = df_rgba_from_theme_color(DF_ThemeColor_Highlight0))); + ui_set_next_palette(ui_build_palette(ui_top_palette(), .border = df_rgba_from_theme_color(DF_ThemeColor_Highlight0))); } site_box_viz = ui_build_box_from_key(UI_BoxFlag_DrawBackground| UI_BoxFlag_DrawBorder| @@ -6355,7 +6365,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) future_split_rect.p1.v[split_axis] += drop_site_major_dim_px; future_split_rect.p0.v[axis2_flip(split_axis)] = child_rect.p0.v[axis2_flip(split_axis)]; future_split_rect.p1.v[axis2_flip(split_axis)] = child_rect.p1.v[axis2_flip(split_axis)]; - UI_Rect(future_split_rect) DF_UIColorScheme(DF_UIColorSchemeCode_DropSite) + UI_Rect(future_split_rect) DF_Palette(DF_PaletteCode_DropSite) { ui_build_box_from_key(UI_BoxFlag_DrawBackground, ui_key_zero()); } @@ -6631,7 +6641,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) ui_set_next_child_layout_axis(axis2_flip(split_axis)); if(ui_key_match(key, ui_drop_hot_key())) { - ui_set_next_scheme(ui_fork_top_color_scheme(.border = df_rgba_from_theme_color(DF_ThemeColor_Highlight0))); + ui_set_next_palette(ui_build_palette(ui_top_palette(), .border = df_rgba_from_theme_color(DF_ThemeColor_Highlight0))); } site_box_viz = ui_build_box_from_key(UI_BoxFlag_DrawBackground| UI_BoxFlag_DrawBorder| @@ -6646,10 +6656,10 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) UI_Box *row_or_column = ui_build_box_from_key(0, ui_key_zero()); UI_Parent(row_or_column) UI_Padding(ui_px(padding, 1.f)) { if(split_side == Side_Min) { ui_set_next_flags(UI_BoxFlag_DrawBackground); } - DF_UIColorScheme(DF_UIColorSchemeCode_DropSite) ui_build_box_from_key(UI_BoxFlag_DrawBorder, ui_key_zero()); + DF_Palette(DF_PaletteCode_DropSite) ui_build_box_from_key(UI_BoxFlag_DrawBorder, ui_key_zero()); ui_spacer(ui_px(padding, 1.f)); if(split_side == Side_Max) { ui_set_next_flags(UI_BoxFlag_DrawBackground); } - DF_UIColorScheme(DF_UIColorSchemeCode_DropSite) ui_build_box_from_key(UI_BoxFlag_DrawBorder, ui_key_zero()); + DF_Palette(DF_PaletteCode_DropSite) ui_build_box_from_key(UI_BoxFlag_DrawBorder, ui_key_zero()); } } } @@ -6659,7 +6669,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) { ui_set_next_child_layout_axis(split_axis); UI_Box *row_or_column = ui_build_box_from_key(0, ui_key_zero()); - UI_Parent(row_or_column) UI_Padding(ui_px(padding, 1.f)) DF_UIColorScheme(DF_UIColorSchemeCode_DropSite) + UI_Parent(row_or_column) UI_Padding(ui_px(padding, 1.f)) DF_Palette(DF_PaletteCode_DropSite) { ui_build_box_from_key(UI_BoxFlag_DrawBorder|UI_BoxFlag_DrawBackground, ui_key_zero()); } @@ -6702,7 +6712,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) Vec2F32 panel_center = center_2f32(panel_rect); future_split_rect.v[side_flip(split_side)].v[split_axis] = panel_center.v[split_axis]; } - UI_Rect(future_split_rect) DF_UIColorScheme(DF_UIColorSchemeCode_DropSite) + UI_Rect(future_split_rect) DF_Palette(DF_PaletteCode_DropSite) { ui_build_box_from_key(UI_BoxFlag_DrawBackground, ui_key_zero()); } @@ -6849,7 +6859,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) { F64 pct_done_f64 = ((F64)view->loading_progress_v/(F64)view->loading_progress_v_target); F32 pct_done = (F32)pct_done_f64; - ui_set_next_scheme(ui_fork_top_color_scheme(.background = v4f32(1, 1, 1, 0.2f*view->loading_t))); + ui_set_next_palette(ui_build_palette(ui_top_palette(), .background = v4f32(1, 1, 1, 0.2f*view->loading_t))); ui_set_next_fixed_x(indicator_region_rect.x0); ui_set_next_fixed_y(indicator_region_rect.y0); ui_set_next_fixed_width(dim_2f32(indicator_region_rect).x*pct_done); @@ -6858,7 +6868,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) } // rjf: fill - ui_set_next_scheme(ui_fork_top_color_scheme(.background = hl_color)); + ui_set_next_palette(ui_build_palette(ui_top_palette(), .background = hl_color)); ui_set_next_fixed_x(indicator_rect.x0); ui_set_next_fixed_y(indicator_rect.y0); ui_set_next_fixed_width(dim_2f32(indicator_rect).x); @@ -6866,7 +6876,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) ui_build_box_from_key(UI_BoxFlag_DrawBackground|UI_BoxFlag_FloatingX|UI_BoxFlag_FloatingY, ui_key_zero()); // rjf: animated bar - ui_set_next_scheme(ui_fork_top_color_scheme(.border = bd_color, .background = bg_color)); + ui_set_next_palette(ui_build_palette(ui_top_palette(), .border = bd_color, .background = bg_color)); ui_set_next_fixed_x(indicator_region_rect.x0); ui_set_next_fixed_y(indicator_region_rect.y0); ui_set_next_fixed_width(dim_2f32(indicator_region_rect).x); @@ -6878,7 +6888,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) // rjf: build background UI_WidthFill UI_HeightFill { - ui_set_next_scheme(ui_fork_top_color_scheme(.background = bg_color)); + ui_set_next_palette(ui_build_palette(ui_top_palette(), .background = bg_color)); ui_set_next_blur_size(10.f*view->loading_t); ui_build_box_from_key(UI_BoxFlag_DrawBackground|UI_BoxFlag_DrawBackgroundBlur|UI_BoxFlag_FloatingX|UI_BoxFlag_FloatingY, ui_key_zero()); } @@ -7030,7 +7040,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) ui_spacer(ui_em(0.2f, 1.f)); UI_CornerRadius00(corner_radius) UI_CornerRadius10(corner_radius) - DF_UIColorScheme(DF_UIColorSchemeCode_DropSite) + DF_Palette(DF_PaletteCode_DropSite) { ui_build_box_from_key(UI_BoxFlag_DrawBackground|UI_BoxFlag_DrawBorder, ui_key_zero()); } @@ -7055,7 +7065,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) UI_Box *tab_column_box = ui_build_box_from_stringf(!is_changing_panel_boundaries*UI_BoxFlag_AnimatePosX, "tab_column_%p", view); // rjf: build tab container box - UI_Parent(tab_column_box) UI_PrefHeight(ui_px(tab_bar_vheight, 1)) DF_UIColorScheme(view_is_selected ? DF_UIColorSchemeCode_TabActive : DF_UIColorSchemeCode_TabInactive) + UI_Parent(tab_column_box) UI_PrefHeight(ui_px(tab_bar_vheight, 1)) DF_Palette(view_is_selected ? DF_PaletteCode_TabActive : DF_PaletteCode_TabInactive) { if((!view_is_selected && panel->tab_side == Side_Min) || (view_is_selected && panel->tab_side == Side_Max)) @@ -7100,7 +7110,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) { df_font_from_slot(DF_FontSlot_Main), label, - ui_top_scheme()->colors[UI_ColorCode_Text], + ui_top_palette()->colors[UI_ColorCode_Text], ui_top_font_size(), }; d_fancy_string_list_push(scratch.arena, &fstrs, &view_title); @@ -7120,7 +7130,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) { df_font_from_slot(DF_FontSlot_Code), str8(view->query_buffer, view->query_string_size), - ui_top_scheme()->colors[UI_ColorCode_TextWeak], + ui_top_palette()->colors[UI_ColorCode_TextWeak], ui_top_font_size(), }; d_fancy_string_list_push(scratch.arena, &fstrs, &query); @@ -7141,6 +7151,9 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) UI_CornerRadius00(0) UI_CornerRadius01(0) { + UI_Palette *palette = ui_build_palette(ui_top_palette()); + palette->background = v4f32(0, 0, 0, 0); + ui_set_next_palette(palette); UI_Signal sig = ui_buttonf("%S###close_view_%p", df_g_icon_kind_text_table[DF_IconKind_X], view); if(ui_clicked(sig) || ui_middle_clicked(sig)) { @@ -7279,8 +7292,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) DF_Panel *drag_panel = df_panel_from_handle(df_g_drag_drop_payload.panel); if(!df_view_is_nil(view) && active_drop_site != 0) { - UI_Scheme(ui_push_color_scheme(.background = df_rgba_from_theme_color(DF_ThemeColor_DropSiteOverlay))) - UI_Rect(tab_bar_rect) + DF_Palette(DF_PaletteCode_DropSite) UI_Rect(tab_bar_rect) ui_build_box_from_key(UI_BoxFlag_DrawBackground, ui_key_zero()); } @@ -7339,7 +7351,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) { // rjf: vis { - UI_Scheme(ui_push_color_scheme(.background = df_rgba_from_theme_color(DF_ThemeColor_DropSiteOverlay))) UI_Rect(content_rect) + DF_Palette(DF_PaletteCode_DropSite) UI_Rect(content_rect) ui_build_box_from_key(UI_BoxFlag_DrawBackground, ui_key_zero()); } @@ -7638,7 +7650,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) { // rjf: main rectangle { - R_Rect2DInst *inst = d_rect(pad_2f32(box->rect, 1.5f), box->scheme->colors[UI_ColorCode_Background], 0, 0, 1.f); + R_Rect2DInst *inst = d_rect(pad_2f32(box->rect, 1.5f), box->palette->colors[UI_ColorCode_Background], 0, 0, 1.f); MemoryCopyArray(inst->corner_radii, box->corner_radii); } @@ -7834,7 +7846,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) // rjf: draw border if(b->flags & UI_BoxFlag_DrawBorder) { - R_Rect2DInst *inst = d_rect(pad_2f32(b->rect, 1), b->scheme->colors[UI_ColorCode_Border], 0, 1.f, 1.f); + R_Rect2DInst *inst = d_rect(pad_2f32(b->rect, 1), b->palette->colors[UI_ColorCode_Border], 0, 1.f, 1.f); MemoryCopyArray(inst->corner_radii, b->corner_radii); // rjf: hover effect @@ -7859,19 +7871,19 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) F32 softness = 0.5f; if(b->flags & UI_BoxFlag_DrawSideTop) { - d_rect(r2f32p(r.x0, r.y0-half_thickness, r.x1, r.y0+half_thickness), b->scheme->colors[UI_ColorCode_Border], 0, 0, softness); + d_rect(r2f32p(r.x0, r.y0-half_thickness, r.x1, r.y0+half_thickness), b->palette->colors[UI_ColorCode_Border], 0, 0, softness); } if(b->flags & UI_BoxFlag_DrawSideBottom) { - d_rect(r2f32p(r.x0, r.y1-half_thickness, r.x1, r.y1+half_thickness), b->scheme->colors[UI_ColorCode_Border], 0, 0, softness); + d_rect(r2f32p(r.x0, r.y1-half_thickness, r.x1, r.y1+half_thickness), b->palette->colors[UI_ColorCode_Border], 0, 0, softness); } if(b->flags & UI_BoxFlag_DrawSideLeft) { - d_rect(r2f32p(r.x0-half_thickness, r.y0, r.x0+half_thickness, r.y1), b->scheme->colors[UI_ColorCode_Border], 0, 0, softness); + d_rect(r2f32p(r.x0-half_thickness, r.y0, r.x0+half_thickness, r.y1), b->palette->colors[UI_ColorCode_Border], 0, 0, softness); } if(b->flags & UI_BoxFlag_DrawSideRight) { - d_rect(r2f32p(r.x1-half_thickness, r.y0, r.x1+half_thickness, r.y1), b->scheme->colors[UI_ColorCode_Border], 0, 0, softness); + d_rect(r2f32p(r.x1-half_thickness, r.y0, r.x1+half_thickness, r.y1), b->palette->colors[UI_ColorCode_Border], 0, 0, softness); } } @@ -9262,12 +9274,12 @@ df_theme_color_from_txt_token_kind(TXT_TokenKind kind) return color; } -//- rjf: code -> ui color scheme +//- rjf: code -> palette -internal UI_ColorScheme * -df_ui_color_scheme_from_code(DF_UIColorSchemeCode code) +internal UI_Palette * +df_palette_from_code(DF_PaletteCode code) { - UI_ColorScheme *result = &df_gfx_state->cfg_ui_color_schemes[code]; + UI_Palette *result = &df_gfx_state->cfg_palettes[code]; return result; } @@ -9775,28 +9787,28 @@ df_cmd_binding_button(DF_CmdSpec *spec) } } - //- rjf: form color scheme - UI_ColorScheme *scheme = ui_top_scheme(); + //- rjf: form color palette + UI_Palette *palette = ui_top_palette(); if(has_conflicts || (df_gfx_state->bind_change_active && df_gfx_state->bind_change_cmd_spec == spec)) { - scheme = push_array(ui_build_arena(), UI_ColorScheme, 1); - MemoryCopyStruct(scheme, ui_top_scheme()); + palette = push_array(ui_build_arena(), UI_Palette, 1); + MemoryCopyStruct(palette, ui_top_palette()); if(has_conflicts) { - scheme->colors[UI_ColorCode_Text] = df_rgba_from_theme_color(DF_ThemeColor_DefaultTextNegative); + palette->colors[UI_ColorCode_Text] = df_rgba_from_theme_color(DF_ThemeColor_DefaultTextNegative); } if(df_gfx_state->bind_change_active && df_gfx_state->bind_change_cmd_spec == spec) { - scheme->colors[UI_ColorCode_Border] = df_rgba_from_theme_color(DF_ThemeColor_Highlight1); - scheme->colors[UI_ColorCode_Background] = df_rgba_from_theme_color(DF_ThemeColor_Highlight1); - scheme->colors[UI_ColorCode_Background].w *= 0.25f; + palette->colors[UI_ColorCode_Border] = df_rgba_from_theme_color(DF_ThemeColor_Highlight1); + palette->colors[UI_ColorCode_Background] = df_rgba_from_theme_color(DF_ThemeColor_Highlight1); + palette->colors[UI_ColorCode_Background].w *= 0.25f; } } //- rjf: build box ui_set_next_hover_cursor(OS_Cursor_HandPoint); ui_set_next_text_alignment(UI_TextAlign_Center); - ui_set_next_scheme(scheme); + ui_set_next_palette(palette); UI_Box *box = ui_build_box_from_stringf(UI_BoxFlag_DrawText| UI_BoxFlag_Clickable| UI_BoxFlag_DrawActiveEffects, @@ -9995,7 +10007,7 @@ df_entity_tooltips(DF_Entity *entity) { if(entity->flags & DF_EntityFlag_HasColor) { - ui_set_next_scheme(ui_fork_top_color_scheme(.text = df_rgba_from_entity(entity))); + ui_set_next_palette(ui_build_palette(ui_top_palette(), .text = df_rgba_from_entity(entity))); } UI_PrefWidth(ui_text_dim(10, 1)) ui_label(display_string); } @@ -10009,7 +10021,7 @@ df_entity_tooltips(DF_Entity *entity) String8 explanation = df_stop_explanation_string_icon_from_ctrl_event(scratch.arena, &stop_event, &icon_kind); if(explanation.size != 0) { - UI_PrefWidth(ui_children_sum(1)) UI_Row DF_UIColorScheme(DF_UIColorSchemeCode_DefaultNegative) + UI_PrefWidth(ui_children_sum(1)) UI_Row DF_Palette(DF_PaletteCode_DefaultNegative) { UI_PrefWidth(ui_em(1.5f, 1.f)) UI_Font(df_font_from_slot(DF_FontSlot_Icons)) ui_label(df_g_icon_kind_text_table[icon_kind]); UI_PrefWidth(ui_text_dim(10, 1)) ui_label(explanation); @@ -10080,7 +10092,7 @@ df_entity_tooltips(DF_Entity *entity) { if(entity->flags & DF_EntityFlag_HasColor) { - ui_set_next_scheme(ui_fork_top_color_scheme(.text = df_rgba_from_entity(entity))); + ui_set_next_palette(ui_build_palette(ui_top_palette(), .text = df_rgba_from_entity(entity))); } String8 display_string = df_display_string_from_entity(scratch.arena, entity); UI_PrefWidth(ui_text_dim(10, 1)) ui_label(display_string); @@ -10108,7 +10120,7 @@ df_entity_tooltips(DF_Entity *entity) { if(entity->flags & DF_EntityFlag_HasColor) { - ui_set_next_scheme(ui_fork_top_color_scheme(.text = df_rgba_from_entity(entity))); + ui_set_next_palette(ui_build_palette(ui_top_palette(), .text = df_rgba_from_entity(entity))); } String8 display_string = df_display_string_from_entity(scratch.arena, entity); UI_PrefWidth(ui_text_dim(10, 1)) df_code_label(1.f, 1, df_rgba_from_theme_color(DF_ThemeColor_CodeDefault), display_string); @@ -10122,7 +10134,7 @@ df_entity_desc_button(DF_Window *ws, DF_Entity *entity, FuzzyMatchRangeList *nam { ProfBeginFunction(); Temp scratch = scratch_begin(0, 0); - UI_ColorScheme *scheme = ui_top_scheme(); + UI_Palette *palette = ui_top_palette(); if(entity->kind == DF_EntityKind_Thread) { DF_CtrlCtx ctrl_ctx = df_ctrl_ctx_from_window(ws); @@ -10131,7 +10143,7 @@ df_entity_desc_button(DF_Window *ws, DF_Entity *entity, FuzzyMatchRangeList *nam DF_Entity *selected_thread = df_entity_from_handle(ctrl_ctx.thread); if(selected_thread == entity) { - scheme = df_ui_color_scheme_from_code(DF_UIColorSchemeCode_SpecialNeutral); + palette = df_palette_from_code(DF_PaletteCode_SpecialNeutral); } if(stopped_thread == entity && (stop_event.cause == CTRL_EventCause_UserBreakpoint || @@ -10139,19 +10151,19 @@ df_entity_desc_button(DF_Window *ws, DF_Entity *entity, FuzzyMatchRangeList *nam stop_event.cause == CTRL_EventCause_InterruptedByTrap || stop_event.cause == CTRL_EventCause_InterruptedByHalt)) { - scheme = df_ui_color_scheme_from_code(DF_UIColorSchemeCode_SpecialNegative); + palette = df_palette_from_code(DF_PaletteCode_SpecialNegative); } } if(entity->cfg_src == DF_CfgSrc_CommandLine) { - scheme = df_ui_color_scheme_from_code(DF_UIColorSchemeCode_SpecialNeutral); + palette = df_palette_from_code(DF_PaletteCode_SpecialNeutral); } else if(entity->kind == DF_EntityKind_Target && entity->b32 != 0) { - scheme = df_ui_color_scheme_from_code(DF_UIColorSchemeCode_DefaultPositive); + palette = df_palette_from_code(DF_PaletteCode_DefaultPositive); } ui_set_next_hover_cursor(OS_Cursor_HandPoint); - ui_set_next_scheme(scheme); + ui_set_next_palette(palette); UI_Box *box = ui_build_box_from_stringf(UI_BoxFlag_Clickable| UI_BoxFlag_DrawBorder| UI_BoxFlag_DrawBackground| @@ -10165,8 +10177,8 @@ df_entity_desc_button(DF_Window *ws, DF_Entity *entity, FuzzyMatchRangeList *nam DF_EntityKindFlags kind_flags = df_g_entity_kind_flags_table[entity->kind]; DF_EntityOpFlags op_flags = df_g_entity_kind_op_flags_table[entity->kind]; DF_IconKind icon = df_g_entity_kind_icon_kind_table[entity->kind]; - Vec4F32 entity_color = scheme->colors[UI_ColorCode_Text]; - Vec4F32 entity_color_weak = scheme->colors[UI_ColorCode_TextWeak]; + Vec4F32 entity_color = palette->colors[UI_ColorCode_Text]; + Vec4F32 entity_color_weak = palette->colors[UI_ColorCode_TextWeak]; if(entity->flags & DF_EntityFlag_HasColor) { entity_color = df_rgba_from_entity(entity); @@ -10198,8 +10210,9 @@ df_entity_desc_button(DF_Window *ws, DF_Entity *entity, FuzzyMatchRangeList *nam } } String8 label = df_display_string_from_entity(scratch.arena, entity); - UI_Scheme(ui_fork_top_color_scheme(.text = entity_color)) + UI_Palette(ui_build_palette(ui_top_palette(), .text = entity_color)) UI_Font(kind_flags&DF_EntityKindFlag_NameIsCode ? df_font_from_slot(DF_FontSlot_Code) : ui_top_font()) + UI_Flags(entity->kind == DF_EntityKind_Thread ? UI_BoxFlag_DisableTruncatedHover : 0) { UI_Signal label_sig = ui_label(label); if(name_matches != 0) @@ -10219,7 +10232,8 @@ df_entity_desc_button(DF_Window *ws, DF_Entity *entity, FuzzyMatchRangeList *nam if(entity->kind == DF_EntityKind_Thread) UI_FontSize(ui_top_font_size()*0.75f) UI_Font(df_font_from_slot(DF_FontSlot_Code)) - UI_Scheme(ui_fork_top_color_scheme(.text = df_rgba_from_theme_color(DF_ThemeColor_CodeProcedure))) + UI_Palette(ui_build_palette(ui_top_palette(), .text = df_rgba_from_theme_color(DF_ThemeColor_CodeProcedure))) + UI_Flags(UI_BoxFlag_DisableTruncatedHover) { CTRL_Unwind unwind = df_query_cached_unwind_from_thread(entity); DF_Entity *process = df_entity_ancestor_from_kind(entity, DF_EntityKind_Process); @@ -10710,7 +10724,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ ui_set_next_font_size(params->font_size); ui_set_next_pref_width(ui_pct(1, 0)); ui_set_next_pref_height(ui_pct(1, 0)); - ui_set_next_scheme(ui_fork_top_color_scheme(.text = color)); + ui_set_next_palette(ui_build_palette(ui_top_palette(), .text = color)); ui_set_next_text_alignment(UI_TextAlign_Center); UI_Key thread_box_key = ui_key_from_stringf(top_container_box->key, "###ip_%p", thread); UI_Box *thread_box = ui_build_box_from_key(UI_BoxFlag_DisableTextTrunc| @@ -10874,7 +10888,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ ui_set_next_font_size(params->font_size); ui_set_next_pref_width(ui_pct(1, 0)); ui_set_next_pref_height(ui_pct(1, 0)); - ui_set_next_scheme(ui_fork_top_color_scheme(.text = color)); + ui_set_next_palette(ui_build_palette(ui_top_palette(), .text = color)); ui_set_next_text_alignment(UI_TextAlign_Center); UI_Key thread_box_key = ui_key_from_stringf(top_container_box->key, "###ip_%p", thread); UI_Box *thread_box = ui_build_box_from_key(UI_BoxFlag_DisableTextTrunc| @@ -10997,7 +11011,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ ui_set_next_font(df_font_from_slot(DF_FontSlot_Icons)); ui_set_next_font_size(params->font_size * 1.f); ui_set_next_hover_cursor(OS_Cursor_HandPoint); - ui_set_next_scheme(ui_fork_top_color_scheme(.text = bp_color)); + ui_set_next_palette(ui_build_palette(ui_top_palette(), .text = bp_color)); ui_set_next_text_alignment(UI_TextAlign_Center); UI_Box *bp_box = ui_build_box_from_stringf(UI_BoxFlag_DrawText| UI_BoxFlag_DrawActiveEffects| @@ -11064,7 +11078,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ ui_set_next_font(df_font_from_slot(DF_FontSlot_Icons)); ui_set_next_font_size(params->font_size * 1.f); ui_set_next_hover_cursor(OS_Cursor_HandPoint); - ui_set_next_scheme(ui_fork_top_color_scheme(.text = color)); + ui_set_next_palette(ui_build_palette(ui_top_palette(), .text = color)); ui_set_next_text_alignment(UI_TextAlign_Center); UI_Box *pin_box = ui_build_box_from_stringf(UI_BoxFlag_DrawText| UI_BoxFlag_DrawActiveEffects| @@ -11245,7 +11259,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ } UI_PrefWidth(ui_em(1.5f, 1.f)) UI_Font(df_font_from_slot(DF_FontSlot_Icons)) - UI_Scheme(ui_fork_top_color_scheme(.text = pin_color)) + UI_Palette(ui_build_palette(ui_top_palette(), .text = pin_color)) UI_TextAlignment(UI_TextAlign_Center) UI_Flags(UI_BoxFlag_DisableTextTrunc) { @@ -11563,7 +11577,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ { TxtRngColorPairNode *n = push_array(scratch.arena, TxtRngColorPairNode, 1); n->rng = txt_rng(*cursor, *mark); - n->color = ui_top_scheme()->colors[DF_ThemeColor_Selection]; + n->color = ui_top_palette()->colors[DF_ThemeColor_Selection]; SLLQueuePush(first_txt_rng_color_pair, last_txt_rng_color_pair, n); } @@ -11670,7 +11684,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ } // rjf: build line num box - ui_set_next_scheme(ui_fork_top_color_scheme(.text = text_color, .background = bg_color)); + ui_set_next_palette(ui_build_palette(ui_top_palette(), .text = text_color, .background = bg_color)); ui_build_box_from_stringf(UI_BoxFlag_DrawText|(UI_BoxFlag_DrawBackground*!!has_line_info), "%I64u##line_num", line_num); } } @@ -11691,7 +11705,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ UI_Font(params->font) UI_FontSize(params->font_size) UI_CornerRadius(0) - DF_UIColorScheme(DF_UIColorSchemeCode_Code) + DF_Palette(DF_PaletteCode_Code) { U64 line_idx = 0; for(S64 line_num = params->line_num_range.min; @@ -11706,7 +11720,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ if(line_bg_color.w != 0) { ui_set_next_flags(UI_BoxFlag_DrawBackground); - ui_set_next_scheme(ui_fork_top_color_scheme(.background = line_bg_color)); + ui_set_next_palette(ui_build_palette(ui_top_palette(), .background = line_bg_color)); } UI_Box *line_box = ui_build_box_from_key(UI_BoxFlag_DisableTextTrunc|UI_BoxFlag_DrawText|UI_BoxFlag_DisableIDString, line_key); D_Bucket *line_bucket = d_bucket_make(); @@ -11947,7 +11961,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ ui_box_text_position(line_box).x+cursor_off_pixels+cursor_thickness, line_box->rect.y1+params->font_size*0.25f, }; - d_rect(cursor_rect, ui_top_scheme()->colors[UI_ColorCode_Cursor], 1.f, 0, 1.f); + d_rect(cursor_rect, ui_top_palette()->colors[UI_ColorCode_Cursor], 1.f, 0, 1.f); } // rjf: extra rendering for lines with line-info that match the hovered @@ -12827,7 +12841,7 @@ df_line_edit(DF_LineEditFlags flags, S32 depth, FuzzyMatchRangeList *matches, Tx if(!(flags & DF_LineEditFlag_PreferDisplayString) && pre_edit_value.size != 0) { display_string = pre_edit_value; - UI_Box *box = df_code_label(1.f, 1, ui_top_scheme()->text, display_string); + UI_Box *box = df_code_label(1.f, 1, ui_top_palette()->text, display_string); if(matches != 0) { ui_box_equip_fuzzy_match_ranges(box, matches); @@ -12835,7 +12849,7 @@ df_line_edit(DF_LineEditFlags flags, S32 depth, FuzzyMatchRangeList *matches, Tx } else if(flags & DF_LineEditFlag_DisplayStringIsCode) { - UI_Box *box = df_code_label(1.f, 1, ui_top_scheme()->text, display_string); + UI_Box *box = df_code_label(1.f, 1, ui_top_palette()->text, display_string); if(matches != 0) { ui_box_equip_fuzzy_match_ranges(box, matches); @@ -12876,7 +12890,7 @@ df_line_edit(DF_LineEditFlags flags, S32 depth, FuzzyMatchRangeList *matches, Tx F32 total_editstr_width = total_text_width - !!(flags & (DF_LineEditFlag_Expander|DF_LineEditFlag_ExpanderSpace|DF_LineEditFlag_ExpanderPlaceholder)) * expander_size_px; ui_set_next_pref_width(ui_px(total_editstr_width+ui_top_font_size()*2, 0.f)); UI_Box *editstr_box = ui_build_box_from_stringf(UI_BoxFlag_DrawText|UI_BoxFlag_DisableTextTrunc, "###editstr"); - D_FancyStringList code_fancy_strings = df_fancy_string_list_from_code_string(scratch.arena, 1.f, 0, ui_top_scheme()->text, edit_string); + D_FancyStringList code_fancy_strings = df_fancy_string_list_from_code_string(scratch.arena, 1.f, 0, ui_top_palette()->text, edit_string); if(autocomplete_hint_string.size != 0) { String8 query_word = df_autocomp_query_word_from_input_string_off(edit_string, cursor->column-1); @@ -12898,7 +12912,7 @@ df_line_edit(DF_LineEditFlags flags, S32 depth, FuzzyMatchRangeList *matches, Tx D_FancyString *fstr = &autocomp_fstr_n->v; fstr->font = ui_top_font(); fstr->string = autocomplete_append_string; - fstr->color = ui_top_scheme()->text; + fstr->color = ui_top_palette()->text; fstr->color.w *= 0.5f; fstr->size = ui_top_font_size(); autocomp_fstr_n->next = prev_n ? prev_n->next : 0; @@ -14066,60 +14080,60 @@ df_gfx_begin_frame(Arena *arena, DF_CmdList *cmds) //- rjf: compute ui color schemes from theme { DF_Theme *current = &df_gfx_state->cfg_theme; - for(EachEnumVal(DF_UIColorSchemeCode, code)) + for(EachEnumVal(DF_PaletteCode, code)) { - df_gfx_state->cfg_ui_color_schemes[code].null = v4f32(1, 0, 1, 1); - df_gfx_state->cfg_ui_color_schemes[code].cursor = current->colors[DF_ThemeColor_CursorActive]; - df_gfx_state->cfg_ui_color_schemes[code].selection = current->colors[DF_ThemeColor_Selection]; + df_gfx_state->cfg_palettes[code].null = v4f32(1, 0, 1, 1); + df_gfx_state->cfg_palettes[code].cursor = current->colors[DF_ThemeColor_CursorActive]; + df_gfx_state->cfg_palettes[code].selection = current->colors[DF_ThemeColor_Selection]; } - df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_Default].background = current->colors[DF_ThemeColor_DefaultBackground]; - df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_Default].text = current->colors[DF_ThemeColor_DefaultText]; - df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_Default].text_weak = current->colors[DF_ThemeColor_DefaultTextWeak]; - df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_Default].border = current->colors[DF_ThemeColor_DefaultBorder]; - df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_DefaultPositive].background = current->colors[DF_ThemeColor_DefaultBackground]; - df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_DefaultPositive].text = current->colors[DF_ThemeColor_DefaultTextPositive]; - df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_DefaultPositive].text_weak = current->colors[DF_ThemeColor_DefaultTextWeak]; - df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_DefaultPositive].border = current->colors[DF_ThemeColor_DefaultBorder]; - df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_DefaultNegative].background = current->colors[DF_ThemeColor_DefaultBackground]; - df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_DefaultNegative].text = current->colors[DF_ThemeColor_DefaultTextNegative]; - df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_DefaultNegative].text_weak = current->colors[DF_ThemeColor_DefaultTextWeak]; - df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_DefaultNegative].border = current->colors[DF_ThemeColor_DefaultBorder]; - df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_Floating].background = current->colors[DF_ThemeColor_FloatingBackground]; - df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_Floating].text = current->colors[DF_ThemeColor_FloatingText]; - df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_Floating].text_weak = current->colors[DF_ThemeColor_FloatingTextWeak]; - df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_Floating].border = current->colors[DF_ThemeColor_FloatingBorder]; - df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_SpecialPositive].background = current->colors[DF_ThemeColor_SpecialPositiveBackground]; - df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_SpecialPositive].text = current->colors[DF_ThemeColor_SpecialPositiveText]; - df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_SpecialPositive].text_weak = current->colors[DF_ThemeColor_SpecialPositiveTextWeak]; - df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_SpecialPositive].border = current->colors[DF_ThemeColor_SpecialPositiveBorder]; - df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_SpecialNegative].background = current->colors[DF_ThemeColor_SpecialNegativeBackground]; - df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_SpecialNegative].text = current->colors[DF_ThemeColor_SpecialNegativeText]; - df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_SpecialNegative].text_weak = current->colors[DF_ThemeColor_SpecialNegativeTextWeak]; - df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_SpecialNegative].border = current->colors[DF_ThemeColor_SpecialNegativeBorder]; - df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_SpecialNeutral].background = current->colors[DF_ThemeColor_SpecialNeutralBackground]; - df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_SpecialNeutral].text = current->colors[DF_ThemeColor_SpecialNeutralText]; - df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_SpecialNeutral].text_weak = current->colors[DF_ThemeColor_SpecialNeutralTextWeak]; - df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_SpecialNeutral].border = current->colors[DF_ThemeColor_SpecialNeutralBorder]; - df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_MenuBar].background = current->colors[DF_ThemeColor_MenuBarBackground]; - df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_MenuBar].text = current->colors[DF_ThemeColor_MenuBarText]; - df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_MenuBar].text_weak = current->colors[DF_ThemeColor_MenuBarTextWeak]; - df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_MenuBar].border = current->colors[DF_ThemeColor_MenuBarBorder]; - df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_TabActive].background = current->colors[DF_ThemeColor_TabActiveBackground]; - df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_TabActive].text = current->colors[DF_ThemeColor_TabActiveText]; - df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_TabActive].text_weak = current->colors[DF_ThemeColor_TabActiveTextWeak]; - df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_TabActive].border = current->colors[DF_ThemeColor_TabActiveBorder]; - df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_TabInactive].background = current->colors[DF_ThemeColor_TabInactiveBackground]; - df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_TabInactive].text = current->colors[DF_ThemeColor_TabInactiveText]; - df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_TabInactive].text_weak = current->colors[DF_ThemeColor_TabInactiveTextWeak]; - df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_TabInactive].border = current->colors[DF_ThemeColor_TabInactiveBorder]; - df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_Code].background = current->colors[DF_ThemeColor_CodeBackground]; - df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_Code].text = current->colors[DF_ThemeColor_CodeDefault]; - df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_Code].text_weak = current->colors[DF_ThemeColor_CodeDefault]; - df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_Code].border = current->colors[DF_ThemeColor_DefaultBorder]; - df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_DropSite].background = current->colors[DF_ThemeColor_DropSiteOverlay]; - df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_DropSite].text = current->colors[DF_ThemeColor_DropSiteOverlay]; - df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_DropSite].text_weak = current->colors[DF_ThemeColor_DropSiteOverlay]; - df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_DropSite].border = current->colors[DF_ThemeColor_DropSiteOverlay]; + df_gfx_state->cfg_palettes[DF_PaletteCode_Default].background = current->colors[DF_ThemeColor_DefaultBackground]; + df_gfx_state->cfg_palettes[DF_PaletteCode_Default].text = current->colors[DF_ThemeColor_DefaultText]; + df_gfx_state->cfg_palettes[DF_PaletteCode_Default].text_weak = current->colors[DF_ThemeColor_DefaultTextWeak]; + df_gfx_state->cfg_palettes[DF_PaletteCode_Default].border = current->colors[DF_ThemeColor_DefaultBorder]; + df_gfx_state->cfg_palettes[DF_PaletteCode_DefaultPositive].background = current->colors[DF_ThemeColor_DefaultBackground]; + df_gfx_state->cfg_palettes[DF_PaletteCode_DefaultPositive].text = current->colors[DF_ThemeColor_DefaultTextPositive]; + df_gfx_state->cfg_palettes[DF_PaletteCode_DefaultPositive].text_weak = current->colors[DF_ThemeColor_DefaultTextWeak]; + df_gfx_state->cfg_palettes[DF_PaletteCode_DefaultPositive].border = current->colors[DF_ThemeColor_DefaultBorder]; + df_gfx_state->cfg_palettes[DF_PaletteCode_DefaultNegative].background = current->colors[DF_ThemeColor_DefaultBackground]; + df_gfx_state->cfg_palettes[DF_PaletteCode_DefaultNegative].text = current->colors[DF_ThemeColor_DefaultTextNegative]; + df_gfx_state->cfg_palettes[DF_PaletteCode_DefaultNegative].text_weak = current->colors[DF_ThemeColor_DefaultTextWeak]; + df_gfx_state->cfg_palettes[DF_PaletteCode_DefaultNegative].border = current->colors[DF_ThemeColor_DefaultBorder]; + df_gfx_state->cfg_palettes[DF_PaletteCode_Floating].background = current->colors[DF_ThemeColor_FloatingBackground]; + df_gfx_state->cfg_palettes[DF_PaletteCode_Floating].text = current->colors[DF_ThemeColor_FloatingText]; + df_gfx_state->cfg_palettes[DF_PaletteCode_Floating].text_weak = current->colors[DF_ThemeColor_FloatingTextWeak]; + df_gfx_state->cfg_palettes[DF_PaletteCode_Floating].border = current->colors[DF_ThemeColor_FloatingBorder]; + df_gfx_state->cfg_palettes[DF_PaletteCode_SpecialPositive].background = current->colors[DF_ThemeColor_SpecialPositiveBackground]; + df_gfx_state->cfg_palettes[DF_PaletteCode_SpecialPositive].text = current->colors[DF_ThemeColor_SpecialPositiveText]; + df_gfx_state->cfg_palettes[DF_PaletteCode_SpecialPositive].text_weak = current->colors[DF_ThemeColor_SpecialPositiveTextWeak]; + df_gfx_state->cfg_palettes[DF_PaletteCode_SpecialPositive].border = current->colors[DF_ThemeColor_SpecialPositiveBorder]; + df_gfx_state->cfg_palettes[DF_PaletteCode_SpecialNegative].background = current->colors[DF_ThemeColor_SpecialNegativeBackground]; + df_gfx_state->cfg_palettes[DF_PaletteCode_SpecialNegative].text = current->colors[DF_ThemeColor_SpecialNegativeText]; + df_gfx_state->cfg_palettes[DF_PaletteCode_SpecialNegative].text_weak = current->colors[DF_ThemeColor_SpecialNegativeTextWeak]; + df_gfx_state->cfg_palettes[DF_PaletteCode_SpecialNegative].border = current->colors[DF_ThemeColor_SpecialNegativeBorder]; + df_gfx_state->cfg_palettes[DF_PaletteCode_SpecialNeutral].background = current->colors[DF_ThemeColor_SpecialNeutralBackground]; + df_gfx_state->cfg_palettes[DF_PaletteCode_SpecialNeutral].text = current->colors[DF_ThemeColor_SpecialNeutralText]; + df_gfx_state->cfg_palettes[DF_PaletteCode_SpecialNeutral].text_weak = current->colors[DF_ThemeColor_SpecialNeutralTextWeak]; + df_gfx_state->cfg_palettes[DF_PaletteCode_SpecialNeutral].border = current->colors[DF_ThemeColor_SpecialNeutralBorder]; + df_gfx_state->cfg_palettes[DF_PaletteCode_MenuBar].background = current->colors[DF_ThemeColor_MenuBarBackground]; + df_gfx_state->cfg_palettes[DF_PaletteCode_MenuBar].text = current->colors[DF_ThemeColor_MenuBarText]; + df_gfx_state->cfg_palettes[DF_PaletteCode_MenuBar].text_weak = current->colors[DF_ThemeColor_MenuBarTextWeak]; + df_gfx_state->cfg_palettes[DF_PaletteCode_MenuBar].border = current->colors[DF_ThemeColor_MenuBarBorder]; + df_gfx_state->cfg_palettes[DF_PaletteCode_TabActive].background = current->colors[DF_ThemeColor_TabActiveBackground]; + df_gfx_state->cfg_palettes[DF_PaletteCode_TabActive].text = current->colors[DF_ThemeColor_TabActiveText]; + df_gfx_state->cfg_palettes[DF_PaletteCode_TabActive].text_weak = current->colors[DF_ThemeColor_TabActiveTextWeak]; + df_gfx_state->cfg_palettes[DF_PaletteCode_TabActive].border = current->colors[DF_ThemeColor_TabActiveBorder]; + df_gfx_state->cfg_palettes[DF_PaletteCode_TabInactive].background = current->colors[DF_ThemeColor_TabInactiveBackground]; + df_gfx_state->cfg_palettes[DF_PaletteCode_TabInactive].text = current->colors[DF_ThemeColor_TabInactiveText]; + df_gfx_state->cfg_palettes[DF_PaletteCode_TabInactive].text_weak = current->colors[DF_ThemeColor_TabInactiveTextWeak]; + df_gfx_state->cfg_palettes[DF_PaletteCode_TabInactive].border = current->colors[DF_ThemeColor_TabInactiveBorder]; + df_gfx_state->cfg_palettes[DF_PaletteCode_Code].background = current->colors[DF_ThemeColor_CodeBackground]; + df_gfx_state->cfg_palettes[DF_PaletteCode_Code].text = current->colors[DF_ThemeColor_CodeDefault]; + df_gfx_state->cfg_palettes[DF_PaletteCode_Code].text_weak = current->colors[DF_ThemeColor_CodeDefault]; + df_gfx_state->cfg_palettes[DF_PaletteCode_Code].border = current->colors[DF_ThemeColor_DefaultBorder]; + df_gfx_state->cfg_palettes[DF_PaletteCode_DropSite].background = current->colors[DF_ThemeColor_DropSiteOverlay]; + df_gfx_state->cfg_palettes[DF_PaletteCode_DropSite].text = current->colors[DF_ThemeColor_DropSiteOverlay]; + df_gfx_state->cfg_palettes[DF_PaletteCode_DropSite].text_weak = current->colors[DF_ThemeColor_DropSiteOverlay]; + df_gfx_state->cfg_palettes[DF_PaletteCode_DropSite].border = current->colors[DF_ThemeColor_DropSiteOverlay]; } //- rjf: animate alive-transitions for entities diff --git a/src/df/gfx/df_gfx.h b/src/df/gfx/df_gfx.h index 3431dde2..ea38bd97 100644 --- a/src/df/gfx/df_gfx.h +++ b/src/df/gfx/df_gfx.h @@ -374,23 +374,23 @@ typedef enum DF_FontSlot } DF_FontSlot; -typedef enum DF_UIColorSchemeCode +typedef enum DF_PaletteCode { - DF_UIColorSchemeCode_Default, - DF_UIColorSchemeCode_DefaultPositive, - DF_UIColorSchemeCode_DefaultNegative, - DF_UIColorSchemeCode_Floating, - DF_UIColorSchemeCode_SpecialPositive, - DF_UIColorSchemeCode_SpecialNegative, - DF_UIColorSchemeCode_SpecialNeutral, - DF_UIColorSchemeCode_MenuBar, - DF_UIColorSchemeCode_TabActive, - DF_UIColorSchemeCode_TabInactive, - DF_UIColorSchemeCode_Code, - DF_UIColorSchemeCode_DropSite, - DF_UIColorSchemeCode_COUNT + DF_PaletteCode_Default, + DF_PaletteCode_DefaultPositive, + DF_PaletteCode_DefaultNegative, + DF_PaletteCode_Floating, + DF_PaletteCode_SpecialPositive, + DF_PaletteCode_SpecialNegative, + DF_PaletteCode_SpecialNeutral, + DF_PaletteCode_MenuBar, + DF_PaletteCode_TabActive, + DF_PaletteCode_TabInactive, + DF_PaletteCode_Code, + DF_PaletteCode_DropSite, + DF_PaletteCode_COUNT } -DF_UIColorSchemeCode; +DF_PaletteCode; //////////////////////////////// //~ rjf: UI Helper & Widget Types @@ -760,8 +760,8 @@ 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]; - UI_ColorScheme cfg_ui_color_schemes[DF_UIColorSchemeCode_COUNT]; + F_Tag cfg_font_tags[DF_FontSlot_COUNT]; // derivative from font paths + UI_Palette cfg_palettes[DF_PaletteCode_COUNT]; // derivative from theme // rjf: icon texture R_Handle icon_texture; @@ -1007,8 +1007,8 @@ 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 -> ui color scheme -internal UI_ColorScheme *df_ui_color_scheme_from_code(DF_UIColorSchemeCode code); +//- 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); @@ -1026,7 +1026,7 @@ internal String8 df_stop_explanation_string_icon_from_ctrl_event(Arena *arena, C //////////////////////////////// //~ rjf: UI Building Helpers -#define DF_UIColorScheme(code) UI_Scheme(df_ui_color_scheme_from_code(code)) +#define DF_Palette(code) UI_Palette(df_palette_from_code(code)) //////////////////////////////// //~ rjf: UI Widgets: Fancy Buttons diff --git a/src/df/gfx/df_view_rules.c b/src/df/gfx/df_view_rules.c index 03a584d8..d93c4d63 100644 --- a/src/df/gfx/df_view_rules.c +++ b/src/df/gfx/df_view_rules.c @@ -340,13 +340,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_scheme()->text, ui_top_font_size(), 0, 0}; - D_FancyString comma = {ui_top_font(), str8_lit(", "), ui_top_scheme()->text, 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_scheme()->text, 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); @@ -367,7 +367,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_Scheme(ui_fork_top_color_scheme(.background = 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()); } } @@ -872,7 +872,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->scheme->background; + 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) { diff --git a/src/df/gfx/df_views.c b/src/df/gfx/df_views.c index 0d41972b..f9896249 100644 --- a/src/df/gfx/df_views.c +++ b/src/df/gfx/df_views.c @@ -1641,23 +1641,23 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS } //////////////////////// - //- rjf: determine row's color scheme + //- rjf: determine row's color palette // - UI_ColorScheme *scheme = ui_top_scheme(); + UI_Palette *palette = ui_top_palette(); { if(row_is_fresh) { - scheme = ui_fork_top_color_scheme(.background = mul_4f32(df_rgba_from_theme_color(DF_ThemeColor_Highlight0), v4f32(1, 1, 1, 0.2f))); + palette = ui_build_palette(ui_top_palette(), .background = mul_4f32(df_rgba_from_theme_color(DF_ThemeColor_Highlight0), v4f32(1, 1, 1, 0.2f))); } } //////////////////////// //- rjf: build row box // + ui_set_next_palette(palette); ui_set_next_flags(disabled_flags); ui_set_next_pref_width(ui_pct(1, 0)); ui_set_next_pref_height(ui_px(scroll_list_params.row_height_px*row->size_in_rows, 1.f)); - ui_set_next_scheme(scheme); UI_Box *row_box = ui_build_box_from_stringf(UI_BoxFlag_DrawSideBottom|UI_BoxFlag_RequireFocusBackground|UI_BoxFlag_Clickable, "row_%I64x", row_hash); //////////////////////// @@ -1718,7 +1718,7 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS //////////////////////// //- rjf: build non-canvas row contents // - if(!(row->flags & DF_EvalVizRowFlag_Canvas)) + if(!(row->flags & DF_EvalVizRowFlag_Canvas)) UI_Parent(row_box) UI_HeightFill { //////////////////// //- rjf: draw start of cache lines in expansions @@ -1731,7 +1731,7 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS ui_set_next_fixed_x(0); ui_set_next_fixed_y(0); ui_set_next_fixed_height(ui_top_font_size()*0.1f); - ui_set_next_scheme(ui_fork_top_color_scheme(.background = df_rgba_from_theme_color(DF_ThemeColor_Highlight0))); + ui_set_next_palette(ui_build_palette(ui_top_palette(), .background = df_rgba_from_theme_color(DF_ThemeColor_Highlight0))); ui_build_box_from_key(UI_BoxFlag_Floating|UI_BoxFlag_DrawBackground, ui_key_zero()); } @@ -1752,7 +1752,7 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS ui_set_next_fixed_height(ui_top_font_size()*1.f); Vec4F32 boundary_color = df_rgba_from_theme_color(DF_ThemeColor_Highlight0); boundary_color.w *= 0.25f; - ui_set_next_scheme(ui_fork_top_color_scheme(.background = boundary_color)); + ui_set_next_palette(ui_build_palette(ui_top_palette(), .background = boundary_color)); ui_build_box_from_key(UI_BoxFlag_Floating|UI_BoxFlag_DrawBackground, ui_key_zero()); } } @@ -1767,32 +1767,32 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS B32 cell_selected = (row_selected && selection_tbl.min.x <= pt.column_kind && pt.column_kind <= selection_tbl.max.x); B32 can_edit_expr = !(row->depth > 0 || modifiable == 0); - // rjf: unpack scheme - UI_ColorScheme *scheme = ui_top_scheme(); + // rjf: unpack palette + UI_Palette *palette = ui_top_palette(); { if(row->flags & DF_EvalVizRowFlag_ExprIsSpecial) { - scheme = ui_fork_top_color_scheme(.text = df_rgba_from_theme_color(DF_ThemeColor_SpecialNegativeText), - .background = df_rgba_from_theme_color(DF_ThemeColor_SpecialNegativeBackground)); + palette = ui_build_palette(ui_top_palette(), .text = df_rgba_from_theme_color(DF_ThemeColor_SpecialNegativeText), + .background = df_rgba_from_theme_color(DF_ThemeColor_SpecialNegativeBackground)); } } // rjf: build UI_Signal sig = {0}; B32 next_expanded = row_expanded; - UI_Scheme(scheme) UI_TableCell + UI_Palette(palette) UI_TableCell UI_FocusHot(cell_selected ? UI_FocusKind_On : UI_FocusKind_Off) UI_FocusActive((cell_selected && ewv->text_editing) ? UI_FocusKind_On : UI_FocusKind_Off) { B32 expr_editing_active = ui_is_focus_active(); B32 is_inherited = (row->inherited_type_key_chain.count != 0); - UI_Font(code_font) UI_Scheme(scheme) UI_FlagsAdd(row->depth > 0 ? UI_BoxFlag_DrawTextWeak : 0) + UI_Font(code_font) UI_Palette(palette) UI_FlagsAdd(row->depth > 0 ? UI_BoxFlag_DrawTextWeak : 0) { if(is_inherited) { Vec4F32 inherited_bg_color = df_rgba_from_theme_color(DF_ThemeColor_Highlight1); inherited_bg_color.w *= 0.2f; - ui_set_next_scheme(ui_fork_top_color_scheme(.background = inherited_bg_color)); + ui_set_next_palette(ui_build_palette(ui_top_palette(), .background = inherited_bg_color)); } FuzzyMatchRangeList matches = {0}; if(filter.size != 0) @@ -1924,19 +1924,19 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS B32 value_is_complex = (!value_is_error && !value_is_hook && !(row->flags & DF_EvalVizRowFlag_CanEditValue)); B32 value_is_simple = (!value_is_error && !value_is_hook && (row->flags & DF_EvalVizRowFlag_CanEditValue)); - // rjf: unpack scheme - UI_ColorScheme *scheme = ui_top_scheme(); + // rjf: unpack palette + UI_Palette *palette = ui_top_palette(); { if(row_is_bad) { - scheme = ui_fork_top_color_scheme(.text = df_rgba_from_theme_color(DF_ThemeColor_SpecialNegativeText), - .background = df_rgba_from_theme_color(DF_ThemeColor_SpecialNegativeBackground)); + palette = ui_build_palette(ui_top_palette(), .text = df_rgba_from_theme_color(DF_ThemeColor_SpecialNegativeText), + .background = df_rgba_from_theme_color(DF_ThemeColor_SpecialNegativeBackground)); } } // rjf: build UI_Signal sig = {0}; - UI_Scheme(scheme) UI_TableCell UI_Font(code_font) + UI_Palette(palette) UI_TableCell UI_Font(code_font) UI_FocusHot(cell_selected ? UI_FocusKind_On : UI_FocusKind_Off) UI_FocusActive((cell_selected && ewv->text_editing) ? UI_FocusKind_On : UI_FocusKind_Off) { @@ -2129,7 +2129,7 @@ DF_VIEW_UI_FUNCTION_DEF(Empty) UI_TextAlignment(UI_TextAlign_Center) UI_PrefWidth(ui_em(15.f, 1.f)) UI_CornerRadius(ui_top_font_size()/2.f) - DF_UIColorScheme(DF_UIColorSchemeCode_SpecialNegative) + DF_Palette(DF_PaletteCode_SpecialNegative) { if(ui_clicked(df_icon_buttonf(DF_IconKind_X, 0, "Close Panel"))) { @@ -2203,7 +2203,7 @@ DF_VIEW_UI_FUNCTION_DEF(GettingStarted) UI_TextAlignment(UI_TextAlign_Center) UI_PrefWidth(ui_em(22.f, 1.f)) UI_CornerRadius(ui_top_font_size()/2.f) - DF_UIColorScheme(DF_UIColorSchemeCode_SpecialNeutral) + DF_Palette(DF_PaletteCode_SpecialNeutral) if(ui_clicked(df_icon_buttonf(DF_IconKind_Add, 0, "Add Target"))) { DF_CmdParams params = df_cmd_params_from_view(ws, panel, view); @@ -2225,7 +2225,7 @@ DF_VIEW_UI_FUNCTION_DEF(GettingStarted) UI_TextAlignment(UI_TextAlign_Center) UI_PrefWidth(ui_em(22.f, 1.f)) UI_CornerRadius(ui_top_font_size()/2.f) - DF_UIColorScheme(DF_UIColorSchemeCode_SpecialNeutral) + DF_Palette(DF_PaletteCode_SpecialNeutral) { if(ui_clicked(df_icon_buttonf(DF_IconKind_Play, 0, "Launch %S", target_name))) { @@ -3229,7 +3229,7 @@ DF_VIEW_UI_FUNCTION_DEF(EntityLister) Vec4F32 color = df_rgba_from_entity(ent); if(color.w != 0) { - ui_set_next_scheme(ui_fork_top_color_scheme(.text = color)); + ui_set_next_palette(ui_build_palette(ui_top_palette(), .text = color)); } UI_Box *name_label = ui_build_box_from_stringf(UI_BoxFlag_DrawText, "%S##label_%p", display_string, ent); ui_box_equip_fuzzy_match_ranges(name_label, &item.name_match_ranges); @@ -3643,7 +3643,7 @@ DF_VIEW_UI_FUNCTION_DEF(Target) { ui_label_multiline(ui_top_font_size()*30.f, str8_lit("By default, the debugger attempts to find a target's entry point with a set of default names, such as:")); ui_spacer(ui_em(1.5f, 1.f)); - UI_Font(df_font_from_slot(DF_FontSlot_Code)) UI_Scheme(ui_fork_top_color_scheme(.text = df_rgba_from_theme_color(DF_ThemeColor_CodeProcedure))) + UI_Font(df_font_from_slot(DF_FontSlot_Code)) UI_Palette(ui_build_palette(ui_top_palette(), .text = df_rgba_from_theme_color(DF_ThemeColor_CodeProcedure))) { ui_label(str8_lit("WinMain")); ui_label(str8_lit("wWinMain")); @@ -4741,21 +4741,21 @@ DF_VIEW_UI_FUNCTION_DEF(Scheduler) { B32 frozen_by_solo_mode = (entity->kind == DF_EntityKind_Thread && entity != df_entity_from_handle(ctrl_ctx.thread) && df_state->ctrl_solo_stepping_mode); B32 frozen = df_entity_is_frozen(entity); - UI_ColorScheme *scheme = ui_top_scheme(); + UI_Palette *palette = ui_top_palette(); if(frozen_by_solo_mode) { - scheme = ui_fork_top_color_scheme(.background = df_rgba_from_theme_color(DF_ThemeColor_Highlight0)); + palette = ui_build_palette(ui_top_palette(), .background = df_rgba_from_theme_color(DF_ThemeColor_Highlight0)); } else if(frozen) { - scheme = df_ui_color_scheme_from_code(DF_UIColorSchemeCode_SpecialNegative); + palette = df_palette_from_code(DF_PaletteCode_SpecialNegative); } else { - scheme = df_ui_color_scheme_from_code(DF_UIColorSchemeCode_SpecialPositive); + palette = df_palette_from_code(DF_PaletteCode_SpecialPositive); } UI_Signal sig = {0}; - UI_Scheme(scheme) sig = df_icon_buttonf(frozen ? DF_IconKind_Locked : DF_IconKind_Unlocked, 0, "###lock_%p", entity); + UI_Palette(palette) sig = df_icon_buttonf(frozen ? DF_IconKind_Locked : DF_IconKind_Unlocked, 0, "###lock_%p", entity); if(frozen_by_solo_mode && ui_hovering(sig)) UI_Tooltip { ui_label(str8_lit("This thread is frozen during stepping operations because it isn't selected, and Solo Stepping Mode is enabled.")); @@ -4809,7 +4809,7 @@ DF_VIEW_UI_FUNCTION_DEF(Scheduler) } UI_TableCellSized(ui_em(2.25f, 1.f)) UI_FocusHot((row_is_selected && cursor.x == 4) ? UI_FocusKind_On : UI_FocusKind_Off) { - DF_UIColorScheme(DF_UIColorSchemeCode_SpecialNegative) + DF_Palette(DF_PaletteCode_SpecialNegative) if(ui_clicked(df_icon_buttonf(DF_IconKind_X, 0, "###kill"))) { DF_CmdParams params = df_cmd_params_from_view(ws, panel, view); @@ -4864,7 +4864,7 @@ DF_VIEW_UI_FUNCTION_DEF(CallStack) DF_Entity *thread = df_entity_from_handle(ctrl_ctx.thread); Architecture arch = df_architecture_from_entity(thread); DF_Entity *process = thread->parent; - Vec4F32 thread_color = ui_top_scheme()->text; + Vec4F32 thread_color = ui_top_palette()->text; if(thread->flags & DF_EntityFlag_HasColor) { thread_color = df_rgba_from_entity(thread); @@ -4983,7 +4983,7 @@ DF_VIEW_UI_FUNCTION_DEF(CallStack) ctrl_ctx.inline_unwind_count == frame->inline_unwind_idx) { selected_string = df_g_icon_kind_text_table[DF_IconKind_RightArrow]; - ui_set_next_scheme(ui_fork_top_color_scheme(.text = thread_color)); + ui_set_next_palette(ui_build_palette(ui_top_palette(), .text = thread_color)); } UI_Box *box = ui_build_box_from_stringf(UI_BoxFlag_Clickable|UI_BoxFlag_DrawText, "%S###selection_%i", selected_string, (int)frame_idx); @@ -5050,7 +5050,7 @@ DF_VIEW_UI_FUNCTION_DEF(CallStack) D_FancyStringList symbol_type_fstrs = df_fancy_string_list_from_code_string(scratch.arena, 0.5f, 0, df_rgba_from_theme_color(DF_ThemeColor_CodeDefault), symbol_type_string); D_FancyStringList fstrs = {0}; d_fancy_string_list_concat_in_place(&fstrs, &symbol_name_fstrs); - D_FancyString sep = {ui_top_font(), str8_lit(": "), ui_top_scheme()->colors[UI_ColorCode_TextWeak], ui_top_font_size()}; + D_FancyString sep = {ui_top_font(), str8_lit(": "), ui_top_palette()->colors[UI_ColorCode_TextWeak], ui_top_font_size()}; d_fancy_string_list_push(scratch.arena, &fstrs, &sep); d_fancy_string_list_concat_in_place(&fstrs, &symbol_type_fstrs); UI_Box *label = ui_build_box_from_key(UI_BoxFlag_DrawText, ui_key_zero()); @@ -5362,7 +5362,7 @@ DF_VIEW_UI_FUNCTION_DEF(Modules) UI_FocusActive((txt_is_selected && mv->txt_editing) ? UI_FocusKind_On : UI_FocusKind_Off) UI_WidthFill { - DF_UIColorScheme(dbgi_is_valid ? DF_UIColorSchemeCode_DefaultPositive : DF_UIColorSchemeCode_Default) + DF_Palette(dbgi_is_valid ? DF_PaletteCode_DefaultPositive : DF_PaletteCode_Default) sig = df_line_editf(DF_LineEditFlag_NoBackground, 0, 0, &mv->txt_cursor, &mv->txt_mark, mv->txt_buffer, sizeof(mv->txt_buffer), &mv->txt_size, 0, dbgi_path, "###dbg_path_%p", entity); edit_commit = (edit_commit || ui_committed(sig)); } @@ -6029,7 +6029,7 @@ DF_VIEW_UI_FUNCTION_DEF(Code) UI_PrefWidth(ui_children_sum(1)) UI_PrefHeight(ui_em(3, 1)) UI_Row UI_Padding(ui_pct(1, 0)) UI_PrefWidth(ui_text_dim(10, 1)) - DF_UIColorScheme(DF_UIColorSchemeCode_DefaultNegative) + DF_Palette(DF_PaletteCode_DefaultNegative) { UI_Font(ui_icon_font()) ui_label(df_g_icon_kind_text_table[DF_IconKind_WarningBig]); ui_labelf("Could not find \"%S\".", full_path); @@ -6040,7 +6040,7 @@ DF_VIEW_UI_FUNCTION_DEF(Code) UI_CornerRadius(ui_top_font_size()/3) UI_PrefWidth(ui_text_dim(10, 1)) UI_Focus(UI_FocusKind_On) - DF_UIColorScheme(DF_UIColorSchemeCode_SpecialNeutral) + DF_Palette(DF_PaletteCode_SpecialNeutral) if(ui_clicked(ui_buttonf("Find alternative..."))) { DF_CmdParams params = df_cmd_params_from_view(ws, panel, view); @@ -6582,7 +6582,7 @@ DF_VIEW_UI_FUNCTION_DEF(Code) if(file_is_out_of_date) { UI_Box *box = &ui_g_nil_box; - DF_UIColorScheme(DF_UIColorSchemeCode_SpecialNegative) + DF_Palette(DF_PaletteCode_SpecialNegative) UI_Font(df_font_from_slot(DF_FontSlot_Icons)) { box = ui_build_box_from_stringf(UI_BoxFlag_DrawText|UI_BoxFlag_Clickable, "%S###file_ood_warning", df_g_icon_kind_text_table[DF_IconKind_WarningBig]); @@ -6593,7 +6593,7 @@ DF_VIEW_UI_FUNCTION_DEF(Code) UI_PrefWidth(ui_children_sum(1)) UI_Row UI_PrefWidth(ui_text_dim(1, 1)) { ui_labelf("This file has changed since ", out_of_date_dbgi_name); - UI_Scheme(ui_fork_top_color_scheme(.text = df_rgba_from_theme_color(DF_ThemeColor_Highlight0))) ui_label(out_of_date_dbgi_name); + UI_Palette(ui_build_palette(ui_top_palette(), .text = df_rgba_from_theme_color(DF_ThemeColor_Highlight0))) ui_label(out_of_date_dbgi_name); ui_labelf(" was produced."); } } @@ -8973,7 +8973,7 @@ DF_VIEW_UI_FUNCTION_DEF(Memory) { if(global_byte_idx == a->vaddr_range.min) UI_Parent(row_overlay_box) { - ui_set_next_scheme(ui_fork_top_color_scheme(.background = annotation->color)); + ui_set_next_palette(ui_build_palette(ui_top_palette(), .background = annotation->color)); ui_set_next_fixed_x(big_glyph_advance*18.f + col_idx*cell_width_px + -cell_width_px/8.f + off); ui_set_next_fixed_y((row_idx-viz_range_rows.min)*row_height_px + -cell_width_px/8.f); ui_set_next_fixed_width(cell_width_px/4.f); @@ -9678,9 +9678,9 @@ DF_VIEW_UI_FUNCTION_DEF(Theme) Vec4F32 bg_color = colors[DF_ThemeColor_DefaultBackground]; Vec4F32 tx_color = colors[DF_ThemeColor_DefaultText]; Vec4F32 bd_color = colors[DF_ThemeColor_DefaultBorder]; - ui_set_next_scheme(ui_fork_top_color_scheme(.text = tx_color, - .border = bd_color, - .background = bg_color)); + ui_set_next_palette(ui_build_palette(ui_top_palette(), .text = tx_color, + .border = bd_color, + .background = bg_color)); if(ui_clicked(ui_buttonf("%S", df_g_theme_preset_display_string_table[preset]))) { MemoryCopy(df_gfx_state->cfg_theme_target.colors, colors, sizeof(df_gfx_state->cfg_theme_target.colors)); @@ -9933,15 +9933,15 @@ DF_VIEW_UI_FUNCTION_DEF(Theme) "###color_%I64x", (U64)color); UI_Parent(color_row) { - Vec4F32 bg_color = ui_top_scheme()->background; - Vec4F32 default_text_color = ui_top_scheme()->text; + Vec4F32 bg_color = ui_top_palette()->background; + Vec4F32 default_text_color = ui_top_palette()->text; F32 default_fallback_factor = clamp_1f32(r1f32(0.3f, 1), dot_4f32(normalize_4f32(rgba), normalize_4f32(bg_color))) - 0.3f; Vec4F32 text_rgba = mix_4f32(rgba, default_text_color, default_fallback_factor); - UI_WidthFill UI_Scheme(ui_fork_top_color_scheme(.text = text_rgba)) ui_label(df_g_theme_color_display_string_table[color]); + UI_WidthFill UI_Palette(ui_build_palette(ui_top_palette(), .text = text_rgba)) ui_label(df_g_theme_color_display_string_table[color]); ui_set_next_pref_width(ui_top_pref_height()); UI_HeightFill UI_Column UI_Padding(ui_em(0.3f, 1)) { - ui_set_next_scheme(ui_fork_top_color_scheme(.background = rgba)); + ui_set_next_palette(ui_build_palette(ui_top_palette(), .background = rgba)); ui_set_next_corner_radius_00(ui_top_font_size()/4.f); ui_set_next_corner_radius_01(ui_top_font_size()/4.f); ui_set_next_corner_radius_10(ui_top_font_size()/4.f); diff --git a/src/ui/generated/ui.meta.c b/src/ui/generated/ui.meta.c index b292cc26..6b8d711b 100644 --- a/src/ui/generated/ui.meta.c +++ b/src/ui/generated/ui.meta.c @@ -17,11 +17,12 @@ #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_Transparency(v) DeferLoop(ui_push_transparency(v), ui_pop_transparency()) -#define UI_Scheme(v) DeferLoop(ui_push_scheme(v), ui_pop_scheme()) +#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()) @@ -44,11 +45,12 @@ internal UI_FocusKind ui_top_focus_hot(void) { UI_StackTopImpl(ui_state, FocusHo 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 F32 ui_top_transparency(void) { UI_StackTopImpl(ui_state, Transparency, transparency) } -internal UI_ColorScheme* ui_top_scheme(void) { UI_StackTopImpl(ui_state, Scheme, scheme) } +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) } @@ -70,11 +72,12 @@ internal UI_FocusKind ui_bottom_focus_hot(void) { UI_StackBottomImpl(ui_state, F 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 F32 ui_bottom_transparency(void) { UI_StackBottomImpl(ui_state, Transparency, transparency) } -internal UI_ColorScheme* ui_bottom_scheme(void) { UI_StackBottomImpl(ui_state, Scheme, scheme) } +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) } @@ -96,11 +99,12 @@ internal UI_FocusKind ui_push_focus_hot(UI_FocusKind v) { UI_StackPushImpl(ui_st 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 F32 ui_push_transparency(F32 v) { UI_StackPushImpl(ui_state, Transparency, transparency, F32, v) } -internal UI_ColorScheme* ui_push_scheme(UI_ColorScheme* v) { UI_StackPushImpl(ui_state, Scheme, scheme, UI_ColorScheme*, 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) } @@ -122,11 +126,12 @@ internal UI_FocusKind ui_pop_focus_hot(void) { UI_StackPopImpl(ui_state, FocusHo 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 F32 ui_pop_transparency(void) { UI_StackPopImpl(ui_state, Transparency, transparency) } -internal UI_ColorScheme* ui_pop_scheme(void) { UI_StackPopImpl(ui_state, Scheme, scheme) } +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) } @@ -148,11 +153,12 @@ internal UI_FocusKind ui_set_next_focus_hot(UI_FocusKind v) { UI_StackSetNextImp 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 F32 ui_set_next_transparency(F32 v) { UI_StackSetNextImpl(ui_state, Transparency, transparency, F32, v) } -internal UI_ColorScheme* ui_set_next_scheme(UI_ColorScheme* v) { UI_StackSetNextImpl(ui_state, Scheme, scheme, UI_ColorScheme*, 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) } diff --git a/src/ui/generated/ui.meta.h b/src/ui/generated/ui.meta.h index bdc47306..1b2c1683 100644 --- a/src/ui/generated/ui.meta.h +++ b/src/ui/generated/ui.meta.h @@ -19,11 +19,12 @@ typedef struct UI_FocusHotNode UI_FocusHotNode; struct UI_FocusHotNode{UI_FocusH 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_TransparencyNode UI_TransparencyNode; struct UI_TransparencyNode{UI_TransparencyNode *next; F32 v;}; -typedef struct UI_SchemeNode UI_SchemeNode; struct UI_SchemeNode{UI_SchemeNode *next; UI_ColorScheme* 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;}; @@ -48,11 +49,12 @@ UI_FocusHotNode focus_hot_nil_stack_top;\ UI_FocusActiveNode focus_active_nil_stack_top;\ UI_FastpathCodepointNode fastpath_codepoint_nil_stack_top;\ UI_TransparencyNode transparency_nil_stack_top;\ -UI_SchemeNode scheme_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;\ @@ -76,11 +78,12 @@ 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->transparency_nil_stack_top.v = 0;\ -state->scheme_nil_stack_top.v = &ui_g_nil_color_scheme;\ +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;\ @@ -106,11 +109,12 @@ struct { UI_FocusHotNode *top; UI_FocusKind bottom_val; UI_FocusHotNode *free; B 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_TransparencyNode *top; F32 bottom_val; UI_TransparencyNode *free; B32 auto_pop; } transparency_stack;\ -struct { UI_SchemeNode *top; UI_ColorScheme* bottom_val; UI_SchemeNode *free; B32 auto_pop; } scheme_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;\ @@ -134,11 +138,12 @@ state->focus_hot_stack.top = &state->focus_hot_nil_stack_top; state->focus_hot_s 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->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->scheme_stack.top = &state->scheme_nil_stack_top; state->scheme_stack.bottom_val = &ui_g_nil_color_scheme; state->scheme_stack.free = 0; state->scheme_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;\ @@ -162,11 +167,12 @@ if(state->focus_hot_stack.auto_pop) { ui_pop_focus_hot(); state->focus_hot_stack 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->transparency_stack.auto_pop) { ui_pop_transparency(); state->transparency_stack.auto_pop = 0; }\ -if(state->scheme_stack.auto_pop) { ui_pop_scheme(); state->scheme_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; }\ @@ -189,11 +195,12 @@ internal UI_FocusKind ui_top_focus_hot(void); internal UI_FocusKind ui_top_focus_active(void); internal U32 ui_top_fastpath_codepoint(void); internal F32 ui_top_transparency(void); -internal UI_ColorScheme* ui_top_scheme(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); @@ -215,11 +222,12 @@ internal UI_FocusKind ui_bottom_focus_hot(void); internal UI_FocusKind ui_bottom_focus_active(void); internal U32 ui_bottom_fastpath_codepoint(void); internal F32 ui_bottom_transparency(void); -internal UI_ColorScheme* ui_bottom_scheme(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); @@ -241,11 +249,12 @@ 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 F32 ui_push_transparency(F32 v); -internal UI_ColorScheme* ui_push_scheme(UI_ColorScheme* 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); @@ -267,11 +276,12 @@ internal UI_FocusKind ui_pop_focus_hot(void); internal UI_FocusKind ui_pop_focus_active(void); internal U32 ui_pop_fastpath_codepoint(void); internal F32 ui_pop_transparency(void); -internal UI_ColorScheme* ui_pop_scheme(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); @@ -293,11 +303,12 @@ 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 F32 ui_set_next_transparency(F32 v); -internal UI_ColorScheme* ui_set_next_scheme(UI_ColorScheme* 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); diff --git a/src/ui/ui.mdesk b/src/ui/ui.mdesk index 3e90019e..0f9cdcc0 100644 --- a/src/ui/ui.mdesk +++ b/src/ui/ui.mdesk @@ -30,7 +30,7 @@ UI_StackTable: //- rjf: colors { Transparency transparency F32 0 } - { Scheme scheme `UI_ColorScheme*` `&ui_g_nil_color_scheme` } + { Palette palette `UI_Palette* ` `&ui_g_nil_palette` } //- rjf: squish { Squish squish F32 0 } @@ -41,6 +41,7 @@ UI_StackTable: //- rjf: font { 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 diff --git a/src/ui/ui_basic_widgets.c b/src/ui/ui_basic_widgets.c index 18d051eb..91e8c6c7 100644 --- a/src/ui/ui_basic_widgets.c +++ b/src/ui/ui_basic_widgets.c @@ -130,9 +130,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 = box->scheme->colors[UI_ColorCode_Cursor]; + Vec4F32 cursor_color = box->palette->colors[UI_ColorCode_Cursor]; cursor_color.w *= box->parent->parent->focus_active_t; - Vec4F32 select_color = box->scheme->colors[UI_ColorCode_Selection]; + 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; @@ -478,7 +478,7 @@ 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_Scheme(ui_fork_top_color_scheme(.background = v4f32(rgb.x, rgb.y, rgb.z, 1.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("")); @@ -517,7 +517,7 @@ 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_Scheme(ui_fork_top_color_scheme(.background = rgba)) + 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("")); @@ -1064,7 +1064,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)); diff --git a/src/ui/ui_core.c b/src/ui/ui_core.c index 153eb7a3..d3ee58c8 100644 --- a/src/ui/ui_core.c +++ b/src/ui/ui_core.c @@ -1442,7 +1442,7 @@ ui_end_build(void) 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)) { @@ -1890,7 +1890,7 @@ ui_begin_ctx_menu(UI_Key key) 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->scheme = ui_top_scheme(); + ui_state->ctx_menu_root->palette = ui_top_palette(); ui_state->ctx_menu_root->blur_size = ui_top_blur_size(); } ui_push_pref_width(ui_bottom_pref_width()); @@ -2036,21 +2036,16 @@ ui_set_auto_focus_hot_key(UI_Key key) } } -//- rjf: color scheme forming +//- rjf: palette forming -internal UI_ColorScheme * -ui_push_color_scheme_(UI_ColorScheme *params) +internal UI_Palette * +ui_build_palette_(UI_Palette *base, UI_Palette *overrides) { - UI_ColorScheme *scheme = push_array(ui_build_arena(), UI_ColorScheme, 1); - MemoryCopyStruct(scheme, params); - return scheme; -} - -internal UI_ColorScheme * -ui_fork_color_scheme_(UI_ColorScheme *scheme, UI_ColorScheme *overrides) -{ - UI_ColorScheme *fork = push_array(ui_build_arena(), UI_ColorScheme, 1); - MemoryCopyStruct(fork, scheme); + 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 || @@ -2058,17 +2053,10 @@ ui_fork_color_scheme_(UI_ColorScheme *scheme, UI_ColorScheme *overrides) overrides->colors[code].z != 0 || overrides->colors[code].w != 0) { - fork->colors[code] = overrides->colors[code]; + palette->colors[code] = overrides->colors[code]; } } - return fork; -} - -internal UI_ColorScheme * -ui_fork_top_color_scheme_(UI_ColorScheme *params) -{ - UI_ColorScheme *scheme = ui_fork_color_scheme_(ui_top_scheme(), params); - return scheme; + return palette; } //- rjf: box node construction @@ -2215,7 +2203,7 @@ 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->scheme = ui_state->scheme_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; @@ -2302,10 +2290,11 @@ 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->scheme->colors[UI_ColorCode_Text], 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); } @@ -2318,15 +2307,15 @@ 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->scheme->colors[UI_ColorCode_Text], 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->scheme->colors[UI_ColorCode_Text], 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->scheme->colors[UI_ColorCode_Text], 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, 4.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); } else { - D_FancyStringNode fancy_string_n = {0, {box->font, display_string, box->scheme->colors[UI_ColorCode_Text], 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); } diff --git a/src/ui/ui_core.h b/src/ui/ui_core.h index db02e8c9..61e6ab59 100644 --- a/src/ui/ui_core.h +++ b/src/ui/ui_core.h @@ -212,8 +212,8 @@ typedef enum UI_ColorCode } UI_ColorCode; -typedef struct UI_ColorScheme UI_ColorScheme; -struct UI_ColorScheme +typedef struct UI_Palette UI_Palette; +struct UI_Palette { union { @@ -289,44 +289,45 @@ 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_DrawTextWeak (UI_BoxFlags)(1ull<<36) -# define UI_BoxFlag_DrawHotEffects (UI_BoxFlags)(1ull<<37) -# define UI_BoxFlag_DrawActiveEffects (UI_BoxFlags)(1ull<<38) -# define UI_BoxFlag_DrawOverlay (UI_BoxFlags)(1ull<<39) -# define UI_BoxFlag_DrawBucket (UI_BoxFlags)(1ull<<40) -# define UI_BoxFlag_Clip (UI_BoxFlags)(1ull<<41) -# define UI_BoxFlag_AnimatePosX (UI_BoxFlags)(1ull<<42) -# define UI_BoxFlag_AnimatePosY (UI_BoxFlags)(1ull<<43) -# define UI_BoxFlag_DisableTextTrunc (UI_BoxFlags)(1ull<<44) -# define UI_BoxFlag_DisableIDString (UI_BoxFlags)(1ull<<45) -# define UI_BoxFlag_DisableFocusViz (UI_BoxFlags)(1ull<<46) -# define UI_BoxFlag_RequireFocusBackground (UI_BoxFlags)(1ull<<47) -# define UI_BoxFlag_HasDisplayString (UI_BoxFlags)(1ull<<48) -# define UI_BoxFlag_HasFuzzyMatchRanges (UI_BoxFlags)(1ull<<49) -# define UI_BoxFlag_RoundChildrenByParent (UI_BoxFlags)(1ull<<50) +# 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_DisableFocusViz (UI_BoxFlags)(1ull<<47) +# define UI_BoxFlag_RequireFocusBackground (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) @@ -368,7 +369,7 @@ struct UI_Box D_Bucket *draw_bucket; UI_BoxCustomDrawFunctionType *custom_draw; void *custom_draw_user_data; - UI_ColorScheme *scheme; + UI_Palette *palette; F_Tag font; F32 font_size; F32 tab_size; @@ -642,7 +643,7 @@ internal UI_Size ui_size(UI_SizeKind kind, F32 value, F32 strictness); //////////////////////////////// //~ rjf: Color Scheme Type Functions -read_only global UI_ColorScheme ui_g_nil_color_scheme = {0}; +read_only global UI_Palette ui_g_nil_palette = {0}; //////////////////////////////// //~ rjf: Scroll Point Type Functions @@ -760,13 +761,9 @@ 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: color scheme forming -internal UI_ColorScheme * ui_push_color_scheme_(UI_ColorScheme *params); -internal UI_ColorScheme * ui_fork_color_scheme_(UI_ColorScheme *scheme, UI_ColorScheme *overrides); -internal UI_ColorScheme * ui_fork_top_color_scheme_(UI_ColorScheme *params); -#define ui_push_color_scheme(...) ui_push_color_scheme_(&(UI_ColorScheme){__VA_ARGS__}) -#define ui_fork_color_scheme(scheme, ...) ui_fork_color_scheme_((scheme), &(UI_ColorScheme){__VA_ARGS__}) -#define ui_fork_top_color_scheme(...) ui_fork_top_color_scheme_(&(UI_ColorScheme){__VA_ARGS__}) +//- 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(1, 1, 1, 1), __VA_ARGS__}) //- rjf: box node construction internal UI_Box * ui_build_box_from_key(UI_BoxFlags flags, UI_Key key); @@ -809,11 +806,12 @@ internal UI_FocusKind ui_top_focus_hot(void); internal UI_FocusKind ui_top_focus_active(void); internal U32 ui_top_fastpath_codepoint(void); internal F32 ui_top_transparency(void); -internal UI_ColorScheme* ui_top_scheme(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); @@ -835,11 +833,12 @@ internal UI_FocusKind ui_bottom_focus_hot(void); internal UI_FocusKind ui_bottom_focus_active(void); internal U32 ui_bottom_fastpath_codepoint(void); internal F32 ui_bottom_transparency(void); -internal UI_ColorScheme* ui_bottom_scheme(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); @@ -861,11 +860,12 @@ 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 F32 ui_push_transparency(F32 v); -internal UI_ColorScheme* ui_push_scheme(UI_ColorScheme* 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); @@ -887,11 +887,12 @@ internal UI_FocusKind ui_pop_focus_hot(void); internal UI_FocusKind ui_pop_focus_active(void); internal U32 ui_pop_fastpath_codepoint(void); internal F32 ui_pop_transparency(void); -internal UI_ColorScheme* ui_pop_scheme(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); @@ -913,11 +914,12 @@ 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 F32 ui_set_next_transparency(F32 v); -internal UI_ColorScheme* ui_set_next_scheme(UI_ColorScheme* 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); @@ -953,11 +955,12 @@ internal void ui_pop_corner_radius(void); #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_Transparency(v) DeferLoop(ui_push_transparency(v), ui_pop_transparency()) -#define UI_Scheme(v) DeferLoop(ui_push_scheme(v), ui_pop_scheme()) +#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()) From 5f23820f9d26293580476571d1cc067218eaf14c Mon Sep 17 00:00:00 2001 From: Ryan Fleury Date: Fri, 21 Jun 2024 22:06:40 -0700 Subject: [PATCH 06/47] checkpoint on ui/palettes/visuals pass --- src/df/gfx/df_gfx.c | 325 ++++++++++-------- src/df/gfx/df_gfx.h | 13 +- src/df/gfx/df_gfx.mdesk | 112 +++--- src/df/gfx/df_view_rules.c | 2 +- src/df/gfx/df_views.c | 60 +--- src/df/gfx/generated/df_gfx.meta.c | 130 +++---- src/df/gfx/generated/df_gfx.meta.h | 2 +- src/draw/draw.c | 35 +- src/draw/draw.h | 10 +- src/font_cache/font_cache.c | 13 +- .../dwrite/font_provider_dwrite.c | 2 +- src/raddbg/raddbg_main.c | 2 +- .../rdi_breakpad_from_pdb_main.c | 2 +- src/rdi_dump/rdi_dump_main.c | 2 +- src/rdi_from_dwarf/rdi_from_dwarf.c | 2 +- src/rdi_from_pdb/rdi_from_pdb_main.c | 4 +- src/type_graph/type_graph.c | 2 +- src/ui/ui_basic_widgets.c | 16 +- src/ui/ui_basic_widgets.h | 1 + src/ui/ui_core.c | 62 ++-- src/ui/ui_core.h | 7 +- 21 files changed, 426 insertions(+), 378 deletions(-) diff --git a/src/df/gfx/df_gfx.c b/src/df/gfx/df_gfx.c index 6a011d04..31ef599a 100644 --- a/src/df/gfx/df_gfx.c +++ b/src/df/gfx/df_gfx.c @@ -1026,7 +1026,6 @@ df_window_open(Vec2F32 size, OS_Handle preferred_monitor, DF_CfgSrc cfg_src) window->r = r_window_equip(window->os); window->ui = ui_state_alloc(); window->view_state_hist = df_state_delta_history_alloc(); - window->drop_completion_ctx_menu_key = ui_key_from_string(ui_key_zero(), str8_lit("_drop_complete_ctx_menu_")); window->entity_ctx_menu_key = ui_key_from_string(ui_key_zero(), str8_lit("_entity_ctx_menu_")); window->tab_ctx_menu_key = ui_key_from_string(ui_key_zero(), str8_lit("_tab_ctx_menu_")); window->hover_eval_arena = arena_alloc(); @@ -1064,17 +1063,17 @@ df_window_open(Vec2F32 size, OS_Handle preferred_monitor, DF_CfgSrc cfg_src) f_push_run_from_string(scratch.arena, df_font_from_slot(icon_font_slot), df_font_size_from_slot(window, icon_font_slot), - 0, 0, 0, + 0, 0, F_RunFlag_Smooth, df_g_icon_kind_text_table[icon_kind]); f_push_run_from_string(scratch.arena, df_font_from_slot(icon_font_slot), df_font_size_from_slot(window, DF_FontSlot_Main), - 0, 0, 0, + 0, 0, F_RunFlag_Smooth, df_g_icon_kind_text_table[icon_kind]); f_push_run_from_string(scratch.arena, df_font_from_slot(icon_font_slot), df_font_size_from_slot(window, DF_FontSlot_Code), - 0, 0, 0, + 0, 0, F_RunFlag_Smooth, df_g_icon_kind_text_table[icon_kind]); scratch_end(scratch); } @@ -3456,7 +3455,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) ui_push_font(main_font); ui_push_font_size(main_font_size); ui_push_pref_width(ui_em(20.f, 1)); - ui_push_pref_height(ui_em(2.5f, 1.f)); + ui_push_pref_height(ui_em(2.75f, 1.f)); ui_push_palette(df_palette_from_code(DF_PaletteCode_Default)); ui_push_blur_size(10.f); } @@ -3522,6 +3521,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) DF_IconKind icon_kind = df_icon_kind_from_view(view); UI_Font(df_font_from_slot(DF_FontSlot_Icons)) UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Icons)) + UI_RunFlags(F_RunFlag_Smooth) UI_PrefWidth(ui_em(2.5f, 1.f)) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_label(df_g_icon_kind_text_table[icon_kind]); @@ -3551,6 +3551,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) DF_IconKind icon_kind = df_g_entity_kind_icon_kind_table[entity->kind]; UI_Font(df_font_from_slot(DF_FontSlot_Icons)) UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Icons)) + UI_RunFlags(F_RunFlag_Smooth) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_label(df_g_icon_kind_text_table[icon_kind]); ui_label(display_name); @@ -3560,59 +3561,6 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) scratch_end(scratch); } - //////////////////////////// - //- rjf: entity drop completion ctx menu - // - { - DF_Palette(DF_PaletteCode_Floating) - UI_CtxMenu(ws->drop_completion_ctx_menu_key) - UI_PrefWidth(ui_em(30.f, 1.f)) - { - DF_Entity *entity = df_entity_from_handle(ws->drop_completion_entity); - DF_Panel *panel = df_panel_from_handle(ws->drop_completion_panel); - if(df_entity_is_nil(entity)) - { - ui_ctx_menu_close(); - } - switch(entity->kind) - { - default:{}break; - - case DF_EntityKind_Module: - { - }break; - case DF_EntityKind_Process: - { -#if 0 - if(ui_clicked(df_icon_buttonf(DF_IconKind_FileOutline, 0, "Open Process Log"))) - { - DF_Entity *log = df_log_from_entity(entity); - DF_CmdParams params = df_cmd_params_from_panel(ws, panel); - params.entity = df_handle_from_entity(log); - df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_Entity); - df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_Code)); - ui_ctx_menu_close(); - } -#endif - }break; - case DF_EntityKind_Thread: - { -#if 0 - if(ui_clicked(df_icon_buttonf(DF_IconKind_FileOutline, 0, "Open Thread Log"))) - { - DF_Entity *log = df_log_from_entity(entity); - DF_CmdParams params = df_cmd_params_from_panel(ws, panel); - params.entity = df_handle_from_entity(log); - df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_Entity); - df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_Code)); - ui_ctx_menu_close(); - } -#endif - }break; - } - } - } - //////////////////////////// //- rjf: developer menu // @@ -3730,7 +3678,9 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) } //- rjf: entity menu - UI_CtxMenu(ws->entity_ctx_menu_key) UI_PrefWidth(ui_em(30.f, 1.f)) + UI_CtxMenu(ws->entity_ctx_menu_key) + UI_PrefWidth(ui_em(30.f, 1.f)) + DF_Palette(DF_PaletteCode_ImplicitContents) { DF_Entity *entity = df_entity_from_handle(ws->entity_ctx_menu_entity); DF_IconKind entity_icon = df_g_entity_kind_icon_kind_table[entity->kind]; @@ -3741,9 +3691,11 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) // rjf: title UI_Row { + ui_spacer(ui_em(1.f, 1.f)); UI_Font(df_font_from_slot(DF_FontSlot_Icons)) UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Icons)) - UI_PrefWidth(ui_em(2.f*1.5f, 1.f)) + UI_RunFlags(F_RunFlag_Smooth) + UI_PrefWidth(ui_em(2.f, 1.f)) UI_PrefHeight(ui_pct(1, 0)) UI_TextAlignment(UI_TextAlign_Center) UI_Flags(UI_BoxFlag_DrawTextWeak) @@ -3764,6 +3716,8 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) } } + DF_Palette(DF_PaletteCode_Floating) ui_divider(ui_em(1.f, 1.f)); + // rjf: name editor if(op_flags & DF_EntityOpFlag_Rename) { @@ -4177,6 +4131,8 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) }break; } + DF_Palette(DF_PaletteCode_Floating) ui_divider(ui_em(1.f, 1.f)); + // rjf: color editor { B32 entity_has_color = entity->flags & DF_EntityFlag_HasColor; @@ -4235,7 +4191,8 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) } } - UI_Row UI_Padding(ui_pct(1, 0)) UI_PrefWidth(ui_em(12.f, 1.f)) UI_CornerRadius(8.f) + UI_Row UI_Padding(ui_pct(1, 0)) UI_PrefWidth(ui_em(16.f, 1.f)) UI_CornerRadius(8.f) UI_TextAlignment(UI_TextAlign_Center) + DF_Palette(DF_PaletteCode_Floating) { if(ui_clicked(df_icon_buttonf(DF_IconKind_Trash, 0, "Remove Color###color_toggle"))) { @@ -4264,6 +4221,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) //- rjf: tab menu UI_CtxMenu(ws->tab_ctx_menu_key) UI_PrefWidth(ui_em(25.f, 1.f)) UI_CornerRadius(0) + DF_Palette(DF_PaletteCode_ImplicitContents) { DF_View *view = df_view_from_handle(ws->tab_ctx_menu_view); DF_IconKind view_icon = df_icon_kind_from_view(view); @@ -4274,9 +4232,11 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) // rjf: title UI_Row { + ui_spacer(ui_em(1.f, 1.f)); UI_Font(df_font_from_slot(DF_FontSlot_Icons)) UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Icons)) - UI_PrefWidth(ui_em(3.f, 1.f)) + UI_RunFlags(F_RunFlag_Smooth) + UI_PrefWidth(ui_em(2.f, 1.f)) UI_PrefHeight(ui_pct(1, 0)) UI_TextAlignment(UI_TextAlign_Center) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) @@ -4284,6 +4244,8 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) UI_PrefWidth(ui_text_dim(10, 1)) ui_label(display_name); } + DF_Palette(DF_PaletteCode_Floating) ui_divider(ui_em(1.f, 1.f)); + // rjf: copy name if(ui_clicked(df_icon_buttonf(DF_IconKind_Clipboard, 0, "Copy Name"))) { @@ -4735,7 +4697,10 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) { // rjf: file menu UI_Key file_menu_key = ui_key_from_string(ui_key_zero(), str8_lit("_file_menu_key_")); - UI_CtxMenu(file_menu_key) UI_PrefWidth(ui_em(30.f, 1.f)) + DF_Palette(DF_PaletteCode_Floating) + UI_CtxMenu(file_menu_key) + UI_PrefWidth(ui_em(40.f, 1.f)) + DF_Palette(DF_PaletteCode_ImplicitContents) { DF_CoreCmdKind cmds[] = { @@ -4759,7 +4724,10 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) // rjf: window menu UI_Key window_menu_key = ui_key_from_string(ui_key_zero(), str8_lit("_window_menu_key_")); - UI_CtxMenu(window_menu_key) UI_PrefWidth(ui_em(30.f, 1.f)) + DF_Palette(DF_PaletteCode_Floating) + UI_CtxMenu(window_menu_key) + UI_PrefWidth(ui_em(40.f, 1.f)) + DF_Palette(DF_PaletteCode_ImplicitContents) { DF_CoreCmdKind cmds[] = { @@ -4779,7 +4747,10 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) // rjf: panel menu UI_Key panel_menu_key = ui_key_from_string(ui_key_zero(), str8_lit("_panel_menu_key_")); - UI_CtxMenu(panel_menu_key) UI_PrefWidth(ui_em(30.f, 1.f)) + DF_Palette(DF_PaletteCode_Floating) + UI_CtxMenu(panel_menu_key) + UI_PrefWidth(ui_em(40.f, 1.f)) + DF_Palette(DF_PaletteCode_ImplicitContents) { DF_CoreCmdKind cmds[] = { @@ -4819,7 +4790,10 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) // rjf: view menu UI_Key view_menu_key = ui_key_from_string(ui_key_zero(), str8_lit("_view_menu_key_")); - UI_CtxMenu(view_menu_key) UI_PrefWidth(ui_em(30.f, 1.f)) + DF_Palette(DF_PaletteCode_Floating) + UI_CtxMenu(view_menu_key) + UI_PrefWidth(ui_em(40.f, 1.f)) + DF_Palette(DF_PaletteCode_ImplicitContents) { DF_CoreCmdKind cmds[] = { @@ -4873,7 +4847,10 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) // rjf: targets menu UI_Key targets_menu_key = ui_key_from_string(ui_key_zero(), str8_lit("_targets_menu_key_")); - UI_CtxMenu(targets_menu_key) UI_PrefWidth(ui_em(30.f, 1.f)) + DF_Palette(DF_PaletteCode_Floating) + UI_CtxMenu(targets_menu_key) + UI_PrefWidth(ui_em(40.f, 1.f)) + DF_Palette(DF_PaletteCode_ImplicitContents) { Temp scratch = scratch_begin(&arena, 1); DF_CoreCmdKind cmds[] = @@ -4890,6 +4867,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) }; Assert(ArrayCount(codepoints) == ArrayCount(cmds)); df_cmd_list_menu_buttons(ws, ArrayCount(cmds), cmds, codepoints); + DF_Palette(DF_PaletteCode_Floating) ui_divider(ui_em(1.f, 1.f)); DF_EntityList targets_list = df_query_cached_entity_list_with_kind(DF_EntityKind_Target); for(DF_EntityNode *n = targets_list.first; n != 0; n = n->next) { @@ -4917,7 +4895,10 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) // rjf: ctrl menu UI_Key ctrl_menu_key = ui_key_from_string(ui_key_zero(), str8_lit("_ctrl_menu_key_")); - UI_CtxMenu(ctrl_menu_key) UI_PrefWidth(ui_em(30.f, 1.f)) + DF_Palette(DF_PaletteCode_Floating) + UI_CtxMenu(ctrl_menu_key) + UI_PrefWidth(ui_em(40.f, 1.f)) + DF_Palette(DF_PaletteCode_ImplicitContents) { DF_CoreCmdKind cmds[] = { @@ -4949,7 +4930,10 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) // rjf: help menu UI_Key help_menu_key = ui_key_from_string(ui_key_zero(), str8_lit("_help_menu_key_")); - UI_CtxMenu(help_menu_key) UI_PrefWidth(ui_em(60.f, 1.f)) + DF_Palette(DF_PaletteCode_Floating) + UI_CtxMenu(help_menu_key) + UI_PrefWidth(ui_em(60.f, 1.f)) + DF_Palette(DF_PaletteCode_ImplicitContents) { UI_Row UI_TextAlignment(UI_TextAlign_Center) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_label(str8_lit(BUILD_TITLE_STRING_LITERAL)); @@ -5127,6 +5111,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) UI_PrefWidth(ui_em(2.25f, 1)) UI_Font(df_font_from_slot(DF_FontSlot_Icons)) UI_FontSize(ui_top_font_size()*0.85f) + UI_RunFlags(F_RunFlag_Smooth) { Temp scratch = scratch_begin(&arena, 1); DF_EntityList targets = df_push_active_target_list(scratch.arena); @@ -5142,7 +5127,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) if(can_play || !have_targets || processes.count == 0) UI_TextAlignment(UI_TextAlign_Center) UI_Flags((can_play ? 0 : UI_BoxFlag_Disabled)) - DF_Palette(DF_PaletteCode_SpecialPositive) + DF_Palette(DF_PaletteCode_DefaultPositive) { UI_Signal sig = ui_button(df_g_icon_kind_text_table[DF_IconKind_Play]); os_window_push_custom_title_bar_client_area(ws->os, sig.box->rect); @@ -5183,7 +5168,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) //- rjf: restart button if(!can_play && processes.count != 0) UI_TextAlignment(UI_TextAlign_Center) - DF_Palette(DF_PaletteCode_SpecialPositive) + DF_Palette(DF_PaletteCode_DefaultPositive) { UI_Signal sig = ui_button(df_g_icon_kind_text_table[DF_IconKind_Redo]); os_window_push_custom_title_bar_client_area(ws->os, sig.box->rect); @@ -5218,7 +5203,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) //- rjf: pause button UI_TextAlignment(UI_TextAlign_Center) UI_Flags(can_pause ? 0 : UI_BoxFlag_Disabled) - DF_Palette(DF_PaletteCode_SpecialNeutral) + DF_Palette(DF_PaletteCode_DefaultNeutral) { UI_Signal sig = ui_button(df_g_icon_kind_text_table[DF_IconKind_Pause]); os_window_push_custom_title_bar_client_area(ws->os, sig.box->rect); @@ -5245,7 +5230,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) //- rjf: stop button UI_TextAlignment(UI_TextAlign_Center) UI_Flags(can_stop ? 0 : UI_BoxFlag_Disabled) - DF_Palette(DF_PaletteCode_SpecialNegative) + DF_Palette(DF_PaletteCode_DefaultNegative) { UI_Signal sig = {0}; { @@ -5399,7 +5384,9 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) { String8 user_path = df_cfg_path_from_src(DF_CfgSrc_User); user_path = str8_chop_last_dot(user_path); - UI_Font(ui_icon_font()) ui_label(df_g_icon_kind_text_table[DF_IconKind_Person]); + UI_Font(df_font_from_slot(DF_FontSlot_Icons)) + UI_RunFlags(F_RunFlag_Smooth) + ui_label(df_g_icon_kind_text_table[DF_IconKind_Person]); ui_label(str8_skip_last_slash(user_path)); } UI_Signal user_sig = ui_signal_from_box(user_box); @@ -5434,7 +5421,8 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) { String8 prof_path = df_cfg_path_from_src(DF_CfgSrc_Project); prof_path = str8_chop_last_dot(prof_path); - UI_Font(ui_icon_font()) ui_label(df_g_icon_kind_text_table[DF_IconKind_Briefcase]); + UI_Font(df_font_from_slot(DF_FontSlot_Icons)) UI_RunFlags(F_RunFlag_Smooth) + ui_label(df_g_icon_kind_text_table[DF_IconKind_Briefcase]); ui_label(str8_skip_last_slash(prof_path)); } UI_Signal prof_sig = ui_signal_from_box(prof_box); @@ -5570,6 +5558,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) UI_PrefWidth(ui_em(2.25f, 1.f)) UI_Font(df_font_from_slot(DF_FontSlot_Icons)) UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Icons)) + UI_RunFlags(F_RunFlag_Smooth) ui_label(df_g_icon_kind_text_table[icon]); } UI_PrefWidth(ui_text_dim(10, 1)) ui_label(explanation); @@ -5606,6 +5595,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) { UI_Font(df_font_from_slot(DF_FontSlot_Icons)) UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Icons)) + UI_RunFlags(F_RunFlag_Smooth) ui_label(df_g_icon_kind_text_table[DF_IconKind_WarningBig]); ui_label(error_string); } @@ -5709,6 +5699,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) // if(!df_view_is_nil(ws->query_view_stack_top)) UI_Focus((window_is_focused && !ui_any_ctx_menu_is_open() && !ws->menu_bar_focused && ws->query_view_selected) ? UI_FocusKind_On : UI_FocusKind_Off) + DF_Palette(DF_PaletteCode_Floating) { DF_View *view = ws->query_view_stack_top; DF_CmdSpec *cmd_spec = ws->query_cmd_spec; @@ -5768,7 +5759,8 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) DF_IconKind icon_kind = ws->query_cmd_spec->info.canonical_icon_kind; if(icon_kind != DF_IconKind_Null) { - UI_Font(df_font_from_slot(DF_FontSlot_Icons)) ui_label(df_g_icon_kind_text_table[icon_kind]); + UI_Font(df_font_from_slot(DF_FontSlot_Icons)) UI_RunFlags(F_RunFlag_Smooth) + ui_label(df_g_icon_kind_text_table[icon_kind]); } ui_labelf("%S", ws->query_cmd_spec->info.display_name); ui_spacer(ui_em(0.5f, 1.f)); @@ -5928,7 +5920,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) UI_Focus((hover_eval_is_open && !ui_any_ctx_menu_is_open() && (!query_is_open || !ws->query_view_selected)) ? UI_FocusKind_Null : UI_FocusKind_Off) { //- rjf: eval -> viz artifacts - F32 row_height = ui_top_font_size()*2.25f; + F32 row_height = floor_f32(ui_top_font_size()*2.5f); DF_CfgTable cfg_table = {0}; U64 expr_hash = df_hash_from_string(expr); DF_EvalViewKey eval_view_key = df_eval_view_key_from_stringf("eval_hover_%I64x", expr_hash); @@ -6057,7 +6049,8 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) { UI_PrefWidth(ui_em(1.5f, 1)) UI_Flags(UI_BoxFlag_DrawSideLeft*(row->depth>0) | UI_BoxFlag_DrawTextWeak) - UI_Font(ui_icon_font()) + UI_Font(df_font_from_slot(DF_FontSlot_Icons)) + UI_RunFlags(F_RunFlag_Smooth) ui_label(df_g_icon_kind_text_table[DF_IconKind_Dot]); } UI_WidthFill @@ -6761,6 +6754,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) UI_PrefWidth(ui_em(2.f, 1.f)) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_Font(df_font_from_slot(DF_FontSlot_Icons)) + UI_RunFlags(F_RunFlag_Smooth) ui_label(df_g_icon_kind_text_table[DF_IconKind_Find]); UI_PrefWidth(ui_text_dim(10, 1)) { @@ -6792,6 +6786,18 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) } } + ////////////////////////// + //- rjf: panel not selected? -> darken + // + if(panel != ws->focused_panel) + { + UI_Palette(ui_build_palette(ui_top_palette(), .background = df_rgba_from_theme_color(DF_ThemeColor_InactivePanelOverlay))) + UI_Rect(content_rect) + { + ui_build_box_from_key(UI_BoxFlag_DrawBackground, ui_key_zero()); + } + } + ////////////////////////// //- rjf: build panel container box // @@ -7090,13 +7096,15 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) { UI_WidthFill UI_Row { + ui_spacer(ui_em(0.5f, 1.f)); if(icon_kind != DF_IconKind_Null) { UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_Font(df_font_from_slot(DF_FontSlot_Icons)) UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Icons)) + UI_RunFlags(F_RunFlag_Smooth) UI_TextAlignment(UI_TextAlign_Center) - UI_PrefWidth(ui_em(2.25f, 1.f)) + UI_PrefWidth(ui_em(1.75f, 1.f)) ui_label(df_g_icon_kind_text_table[icon_kind]); } if(view->query_string_size != 0) @@ -7136,7 +7144,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) d_fancy_string_list_push(scratch.arena, &fstrs, &query); } UI_Box *box = ui_build_box_from_key(UI_BoxFlag_DrawText, ui_key_zero()); - ui_box_equip_display_fancy_strings(box, ui_top_tab_size(), &fstrs); + ui_box_equip_display_fancy_strings(box, &fstrs); scratch_end(scratch); } } @@ -7148,6 +7156,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) UI_PrefWidth(ui_em(2.35f, 1.f)) UI_TextAlignment(UI_TextAlign_Center) UI_Font(df_font_from_slot(DF_FontSlot_Icons)) UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Icons)*0.75f) + UI_RunFlags(F_RunFlag_Smooth) UI_CornerRadius00(0) UI_CornerRadius01(0) { @@ -7220,6 +7229,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) UI_CornerRadius(tab_bar_vheight/2.f) UI_Font(df_font_from_slot(DF_FontSlot_Icons)) UI_FontSize(ui_top_font_size()*0.75f) + UI_RunFlags(F_RunFlag_Smooth) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_HoverCursor(OS_Cursor_HandPoint) { @@ -7391,9 +7401,6 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_TextPoint); df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_Entity); df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_SpawnEntityView)); - ui_ctx_menu_open(ws->drop_completion_ctx_menu_key, ui_key_zero(), sub_2f32(ui_mouse(), v2f32(2, 2))); - ws->drop_completion_entity = df_handle_from_entity(entity); - ws->drop_completion_panel = df_handle_from_panel(panel); } } } @@ -7667,14 +7674,19 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) // rjf: brighten { R_Rect2DInst *inst = d_rect(box->rect, v4f32(0, 0, 0, 0), 0, 0, 1.f); - inst->colors[Corner_00] = v4f32(1.f, 0.9f, 0.7f, 0.1f*t); - inst->colors[Corner_01] = v4f32(1.f, 0.9f, 0.7f, 0.1f*t); - inst->colors[Corner_10] = v4f32(1.f, 0.9f, 0.7f, 0.1f*t); - inst->colors[Corner_11] = v4f32(1.f, 0.9f, 0.7f, 0.1f*t); + Vec4F32 color = df_rgba_from_theme_color(DF_ThemeColor_Highlight1); + color.w *= t*0.2f; + inst->colors[Corner_00] = color; + inst->colors[Corner_01] = color; + inst->colors[Corner_10] = color; + inst->colors[Corner_11] = color; + inst->colors[Corner_10].w *= t; + inst->colors[Corner_11].w *= t; MemoryCopyArray(inst->corner_radii, box->corner_radii); } // rjf: slight emboss fadeoff + if(0) { Rng2F32 rect = r2f32p(box->rect.x0, box->rect.y0, @@ -7692,6 +7704,11 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) // rjf: active effect extension if(box->flags & UI_BoxFlag_DrawActiveEffects) { + Vec4F32 shadow_color = df_rgba_from_theme_color(DF_ThemeColor_Highlight1); + shadow_color.x *= 0.3f; + shadow_color.y *= 0.3f; + shadow_color.z *= 0.3f; + shadow_color.w *= 0.5f*box->active_t; Vec2F32 shadow_size = { (box->rect.x1 - box->rect.x0)*0.60f*box->active_t, @@ -7703,7 +7720,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) // rjf: top -> bottom dark effect { R_Rect2DInst *inst = d_rect(r2f32p(box->rect.x0, box->rect.y0, box->rect.x1, box->rect.y0 + shadow_size.y), v4f32(0, 0, 0, 0), 0, 0, 1.f); - inst->colors[Corner_00] = inst->colors[Corner_10] = v4f32(0.f, 0.f, 0.f, 0.8f*box->active_t); + inst->colors[Corner_00] = inst->colors[Corner_10] = shadow_color; inst->colors[Corner_01] = inst->colors[Corner_11] = v4f32(0.f, 0.f, 0.f, 0.0f); MemoryCopyArray(inst->corner_radii, box->corner_radii); } @@ -7720,8 +7737,8 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) { R_Rect2DInst *inst = d_rect(r2f32p(box->rect.x0, box->rect.y0, box->rect.x0 + shadow_size.x, box->rect.y1), v4f32(0, 0, 0, 0), 0, 0, 1.f); inst->colors[Corner_10] = inst->colors[Corner_11] = v4f32(0.f, 0.f, 0.f, 0.f); - inst->colors[Corner_00] = v4f32(0.f, 0.f, 0.f, 0.8f*box->active_t); - inst->colors[Corner_01] = v4f32(0.f, 0.f, 0.f, 0.4f*box->active_t); + inst->colors[Corner_00] = shadow_color; + inst->colors[Corner_01] = shadow_color; MemoryCopyArray(inst->corner_radii, box->corner_radii); } @@ -7729,8 +7746,8 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) { R_Rect2DInst *inst = d_rect(r2f32p(box->rect.x1 - shadow_size.x, box->rect.y0, box->rect.x1, box->rect.y1), v4f32(0, 0, 0, 0), 0, 0, 1.f); inst->colors[Corner_00] = inst->colors[Corner_01] = v4f32(0.f, 0.f, 0.f, 0.f); - inst->colors[Corner_10] = v4f32(0.f, 0.f, 0.f, 0.8f*box->active_t); - inst->colors[Corner_11] = v4f32(0.f, 0.f, 0.f, 0.4f*box->active_t); + inst->colors[Corner_10] = shadow_color; + inst->colors[Corner_11] = shadow_color; MemoryCopyArray(inst->corner_radii, box->corner_radii); } } @@ -7852,7 +7869,9 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) // rjf: hover effect if(b->flags & UI_BoxFlag_DrawHotEffects) { - R_Rect2DInst *inst = d_rect(pad_2f32(b->rect, 1.f), v4f32(1, 1, 1, 0.5f*b->hot_t), 0, 1.f, 1.f); + Vec4F32 color = df_rgba_from_theme_color(DF_ThemeColor_Highlight1); + color.w *= 0.5f*b->hot_t; + R_Rect2DInst *inst = d_rect(pad_2f32(b->rect, 1.f), color, 0, 1.f, 1.f); MemoryCopyArray(inst->corner_radii, b->corner_radii); } } @@ -7902,11 +7921,10 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) } R_Rect2DInst *inst = d_rect(pad_2f32(r2f32p(b->rect.x0, b->rect.y0, - b->rect.x0 + (b->rect.x1 - b->rect.x0) * b->focus_hot_t, + b->rect.x0 + (b->rect.x1 - b->rect.x0) * 1.f, b->rect.y1), - 6.f), - color, 4.f, 0, 4.f); - inst->colors[Corner_00] = inst->colors[Corner_10] = v4f32(color.x, color.y, color.z, color.w/3.f); + 1.f), + color, 4.f, 0, 1.f); MemoryCopyArray(inst->corner_radii, b->corner_radii); } @@ -7915,8 +7933,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) { Vec4F32 color = df_rgba_from_theme_color(DF_ThemeColor_FocusActive); color.w *= b->focus_active_t; - R_Rect2DInst *inst = d_rect(pad_2f32(b->rect, 1.f), color, 0, 2.f, 1.f); - inst->colors[Corner_10] = inst->colors[Corner_01] = inst->colors[Corner_11] = v4f32(color.x, color.y, color.z, color.w/3.f); + R_Rect2DInst *inst = d_rect(pad_2f32(b->rect, 1.f), color, 0, 1.f, 1.f); MemoryCopyArray(inst->corner_radii, b->corner_radii); } @@ -7925,8 +7942,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) { Vec4F32 color = df_rgba_from_theme_color(DF_ThemeColor_FocusInactive); color.w *= b->focus_active_disabled_t; - R_Rect2DInst *inst = d_rect(pad_2f32(b->rect, 1.f), color, 0, 2.f, 1.f); - inst->colors[Corner_10] = inst->colors[Corner_01] = inst->colors[Corner_11] = v4f32(color.x, color.y, color.z, color.w/3.f); + R_Rect2DInst *inst = d_rect(pad_2f32(b->rect, 1.f), color, 0, 1.f, 1.f); MemoryCopyArray(inst->corner_radii, b->corner_radii); } @@ -7999,7 +8015,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) d_fancy_string_list_push(scratch.arena, &strs, &str2); D_FancyString str3 = {df_font_from_slot(DF_FontSlot_Code), str8_lit("very fancy text!"), v4f32(1, 0.8f, 0.4f, 1), 18.f, 4.f, 4.f}; d_fancy_string_list_push(scratch.arena, &strs, &str3); - D_FancyRunList runs = d_fancy_run_list_from_fancy_string_list(scratch.arena, 0, &strs); + D_FancyRunList runs = d_fancy_run_list_from_fancy_string_list(scratch.arena, 0, 0, &strs); F_Run trailer_run = f_push_run_from_string(scratch.arena, df_font_from_slot(DF_FontSlot_Main), 16.f, 0, 0, 0, str8_lit("...")); F32 limit = 500.f + sin_f32(df_time_in_seconds()/10.f)*200.f; d_truncated_fancy_run_list(p, &runs, limit, trailer_run); @@ -9302,12 +9318,12 @@ df_font_size_from_slot(DF_Window *ws, DF_FontSlot slot) default: case DF_FontSlot_Main: { - F32 size_at_96dpi = 9.f; + F32 size_at_96dpi = 10.f; result = dpi * ((size_at_96dpi / 96.f) + ws->main_font_size_delta); }break; case DF_FontSlot_Code: { - F32 size_at_96dpi = 9.f; + F32 size_at_96dpi = 10.f; result = dpi * ((size_at_96dpi / 96.f) + ws->code_font_size_delta); }break; case DF_FontSlot_Icons: @@ -9873,12 +9889,13 @@ df_cmd_spec_button(DF_CmdSpec *spec) UI_BoxFlag_DrawActiveEffects| UI_BoxFlag_Clickable, "###cmd_%p", spec); - UI_Parent(box) UI_HeightFill + UI_Parent(box) UI_HeightFill UI_Padding(ui_em(1.f, 1.f)) { DF_IconKind canonical_icon = spec->info.canonical_icon_kind; if(canonical_icon != DF_IconKind_Null) { UI_Font(df_font_from_slot(DF_FontSlot_Icons)) + UI_RunFlags(F_RunFlag_Smooth) UI_PrefWidth(ui_em(2.f, 1.f)) UI_TextAlignment(UI_TextAlign_Center) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) @@ -9943,8 +9960,13 @@ df_icon_button(DF_IconKind kind, FuzzyMatchRangeList *matches, String8 string) { ui_spacer(ui_pct(1, 0)); } + else + { + ui_spacer(ui_em(1.f, 1.f)); + } UI_TextAlignment(UI_TextAlign_Center) UI_Font(df_font_from_slot(DF_FontSlot_Icons)) + UI_RunFlags(F_RunFlag_Smooth) UI_PrefWidth(ui_em(2.f, 1.f)) UI_PrefHeight(ui_pct(1, 0)) UI_FlagsAdd(UI_BoxFlag_DisableTextTrunc|UI_BoxFlag_DrawTextWeak) @@ -9964,6 +9986,10 @@ df_icon_button(DF_IconKind kind, FuzzyMatchRangeList *matches, String8 string) { ui_spacer(ui_pct(1, 0)); } + else + { + ui_spacer(ui_em(1.f, 1.f)); + } } UI_Signal result = ui_signal_from_box(box); return result; @@ -9986,7 +10012,7 @@ internal void df_entity_tooltips(DF_Entity *entity) { Temp scratch = scratch_begin(0, 0); - switch(entity->kind) + DF_Palette(DF_PaletteCode_Floating) switch(entity->kind) { default:{}break; case DF_EntityKind_File: @@ -10023,7 +10049,10 @@ df_entity_tooltips(DF_Entity *entity) { UI_PrefWidth(ui_children_sum(1)) UI_Row DF_Palette(DF_PaletteCode_DefaultNegative) { - UI_PrefWidth(ui_em(1.5f, 1.f)) UI_Font(df_font_from_slot(DF_FontSlot_Icons)) ui_label(df_g_icon_kind_text_table[icon_kind]); + UI_PrefWidth(ui_em(1.5f, 1.f)) + UI_Font(df_font_from_slot(DF_FontSlot_Icons)) + UI_RunFlags(F_RunFlag_Smooth) + ui_label(df_g_icon_kind_text_table[icon_kind]); UI_PrefWidth(ui_text_dim(10, 1)) ui_label(explanation); } } @@ -10172,7 +10201,7 @@ df_entity_desc_button(DF_Window *ws, DF_Entity *entity, FuzzyMatchRangeList *nam "entity_ref_button_%p", entity); //- rjf: build contents - UI_Parent(box) UI_PrefWidth(ui_text_dim(10, 0)) + UI_Parent(box) UI_PrefWidth(ui_text_dim(10, 0)) UI_Padding(ui_em(1.f, 1.f)) { DF_EntityKindFlags kind_flags = df_g_entity_kind_flags_table[entity->kind]; DF_EntityOpFlags op_flags = df_g_entity_kind_op_flags_table[entity->kind]; @@ -10188,6 +10217,7 @@ df_entity_desc_button(DF_Window *ws, DF_Entity *entity, FuzzyMatchRangeList *nam UI_TextAlignment(UI_TextAlign_Center) UI_Font(df_font_from_slot(DF_FontSlot_Icons)) UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Icons)) + UI_RunFlags(F_RunFlag_Smooth) UI_PrefWidth(ui_em(1.875f, 1.f)) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_label(df_g_icon_kind_text_table[icon]); @@ -10199,6 +10229,7 @@ df_entity_desc_button(DF_Window *ws, DF_Entity *entity, FuzzyMatchRangeList *nam UI_Box *info_box = &ui_g_nil_box; UI_Font(df_font_from_slot(DF_FontSlot_Icons)) UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Icons)) + UI_RunFlags(F_RunFlag_Smooth) { info_box = ui_build_box_from_stringf(UI_BoxFlag_DrawText|UI_BoxFlag_DrawTextWeak|UI_BoxFlag_Clickable, "%S###%p_temp_info", df_g_icon_kind_text_table[DF_IconKind_Info], entity); } @@ -10212,7 +10243,11 @@ df_entity_desc_button(DF_Window *ws, DF_Entity *entity, FuzzyMatchRangeList *nam String8 label = df_display_string_from_entity(scratch.arena, entity); UI_Palette(ui_build_palette(ui_top_palette(), .text = entity_color)) UI_Font(kind_flags&DF_EntityKindFlag_NameIsCode ? df_font_from_slot(DF_FontSlot_Code) : ui_top_font()) - UI_Flags(entity->kind == DF_EntityKind_Thread ? UI_BoxFlag_DisableTruncatedHover : 0) + UI_Flags((entity->kind == DF_EntityKind_Thread || + entity->kind == DF_EntityKind_Breakpoint || + entity->kind == DF_EntityKind_WatchPin) + ? UI_BoxFlag_DisableTruncatedHover + : 0) { UI_Signal label_sig = ui_label(label); if(name_matches != 0) @@ -10344,6 +10379,7 @@ df_entity_src_loc_button(DF_Window *ws, DF_Entity *entity, TxtPt point) UI_TextAlignment(UI_TextAlign_Center) UI_Font(df_font_from_slot(DF_FontSlot_Icons)) UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Icons)) + UI_RunFlags(F_RunFlag_Smooth) ui_label(df_g_icon_kind_text_table[icon]); ui_labelf("%S:%I64d:%I64d", filename, point.line, point.column); } @@ -10437,8 +10473,8 @@ internal UI_BOX_CUSTOM_DRAW(df_thread_box_draw_extensions) { F32 lock_icon_off = ui_top_font_size()*0.2f; Vec4F32 lock_icon_color = df_rgba_from_theme_color(DF_ThemeColor_DefaultTextNegative); - d_text(ui_icon_font(), - box->font_size, 0, 0, + d_text(df_font_from_slot(DF_FontSlot_Icons), + box->font_size, 0, 0, F_RunFlag_Smooth, v2f32((box->rect.x0 + box->rect.x1)/2 + lock_icon_off/2, box->rect.y0 + lock_icon_off/2), lock_icon_color, @@ -10499,7 +10535,7 @@ internal UI_BOX_CUSTOM_DRAW(df_bp_box_draw_extensions) bp_center.x + remap_bar_thickness, bp_center.y + ClampBot(remap_px_delta, 0) + remap_bar_thickness), remap_color, 2.f, 0, 1.f); - d_text(box->font, box->font_size, 0, 0, + d_text(box->font, box->font_size, 0, 0, F_RunFlag_Smooth, v2f32(bp_text_pos.x, bp_center.y + remap_px_delta), remap_color, @@ -10528,6 +10564,9 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ df_rgba_from_theme_color(DF_ThemeColor_LineInfoBackground2), df_rgba_from_theme_color(DF_ThemeColor_LineInfoBackground3), }; + UI_Palette *margin_palette = df_palette_from_code(DF_PaletteCode_Floating); + UI_Palette *margin_contents_palette = ui_build_palette(df_palette_from_code(DF_PaletteCode_Floating)); + margin_contents_palette->background = v4f32(0, 0, 0, 0); ////////////////////////////// //- rjf: build top-level container @@ -10582,7 +10621,10 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ line_num += 1, line_idx += 1) { ctx_menu_keys[line_idx] = ui_key_from_stringf(top_container_box->key, "line_ctx_%I64d", line_num); - UI_CtxMenu(ctx_menu_keys[line_idx]) UI_PrefWidth(ui_em(37.f, 1.f)) + DF_Palette(DF_PaletteCode_Floating) + UI_CtxMenu(ctx_menu_keys[line_idx]) + DF_Palette(DF_PaletteCode_ImplicitContents) + UI_PrefWidth(ui_em(37.f, 1.f)) { DF_TextLineSrc2DasmInfoList *line_src2dasm_list = ¶ms->line_src2dasm[line_idx]; DF_TextLineDasm2SrcInfoList *line_dasm2src_list = ¶ms->line_dasm2src[line_idx]; @@ -10648,7 +10690,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ //- rjf: build priority margin // UI_Box *priority_margin_container_box = &ui_g_nil_box; - if(params->flags & DF_CodeSliceFlag_PriorityMargin) UI_Focus(UI_FocusKind_Off) UI_Parent(top_container_box) ProfScope("build priority margins") + if(params->flags & DF_CodeSliceFlag_PriorityMargin) UI_Focus(UI_FocusKind_Off) UI_Parent(top_container_box) UI_Palette(margin_palette) ProfScope("build priority margins") { if(params->margin_float_off_px != 0) { @@ -10656,13 +10698,12 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ ui_set_next_pref_height(ui_px(params->line_height_px*(dim_1s64(params->line_num_range)+1), 1.f)); ui_build_box_from_key(0, ui_key_zero()); ui_set_next_fixed_x(params->margin_float_off_px); - ui_set_next_flags(UI_BoxFlag_DrawBackground); } ui_set_next_pref_width(ui_px(params->priority_margin_width_px, 1)); ui_set_next_pref_height(ui_px(params->line_height_px*(dim_1s64(params->line_num_range)+1), 1.f)); ui_set_next_child_layout_axis(Axis2_Y); priority_margin_container_box = ui_build_box_from_string(UI_BoxFlag_Clickable*!!(params->flags & DF_CodeSliceFlag_Clickable), str8_lit("priority_margin_container")); - UI_Parent(priority_margin_container_box) UI_PrefHeight(ui_px(params->line_height_px, 1.f)) + UI_Parent(priority_margin_container_box) UI_PrefHeight(ui_px(params->line_height_px, 1.f)) UI_Palette(margin_contents_palette) { U64 line_idx = 0; for(S64 line_num = params->line_num_range.min; @@ -10720,8 +10761,9 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ // rjf: build thread box ui_set_next_hover_cursor(OS_Cursor_UpDownLeftRight); - ui_set_next_font(ui_icon_font()); + ui_set_next_font(df_font_from_slot(DF_FontSlot_Icons)); ui_set_next_font_size(params->font_size); + ui_set_next_run_flags(F_RunFlag_Smooth); ui_set_next_pref_width(ui_pct(1, 0)); ui_set_next_pref_height(ui_pct(1, 0)); ui_set_next_palette(ui_build_palette(ui_top_palette(), .text = color)); @@ -10810,7 +10852,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ //- rjf: build catchall margin // UI_Box *catchall_margin_container_box = &ui_g_nil_box; - if(params->flags & DF_CodeSliceFlag_CatchallMargin) UI_Focus(UI_FocusKind_Off) UI_Parent(top_container_box) ProfScope("build catchall margins") + if(params->flags & DF_CodeSliceFlag_CatchallMargin) UI_Focus(UI_FocusKind_Off) UI_Palette(margin_palette) UI_Parent(top_container_box) ProfScope("build catchall margins") { if(params->margin_float_off_px != 0) { @@ -10818,13 +10860,12 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ ui_set_next_pref_height(ui_px(params->line_height_px*(dim_1s64(params->line_num_range)+1), 1.f)); ui_build_box_from_key(0, ui_key_zero()); ui_set_next_fixed_x(params->margin_float_off_px + params->priority_margin_width_px); - ui_set_next_flags(UI_BoxFlag_DrawBackground); } ui_set_next_pref_width(ui_px(params->catchall_margin_width_px, 1)); ui_set_next_pref_height(ui_px(params->line_height_px*(dim_1s64(params->line_num_range)+1), 1.f)); ui_set_next_child_layout_axis(Axis2_Y); catchall_margin_container_box = ui_build_box_from_string(UI_BoxFlag_DrawSideLeft|UI_BoxFlag_Clickable*!!(params->flags & DF_CodeSliceFlag_Clickable), str8_lit("catchall_margin_container")); - UI_Parent(catchall_margin_container_box) UI_PrefHeight(ui_px(params->line_height_px, 1.f)) + UI_Parent(catchall_margin_container_box) UI_PrefHeight(ui_px(params->line_height_px, 1.f)) UI_Palette(margin_contents_palette) { U64 line_idx = 0; for(S64 line_num = params->line_num_range.min; @@ -10884,8 +10925,9 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ // rjf: build thread box ui_set_next_hover_cursor(OS_Cursor_UpDownLeftRight); - ui_set_next_font(ui_icon_font()); + ui_set_next_font(df_font_from_slot(DF_FontSlot_Icons)); ui_set_next_font_size(params->font_size); + ui_set_next_run_flags(F_RunFlag_Smooth); ui_set_next_pref_width(ui_pct(1, 0)); ui_set_next_pref_height(ui_pct(1, 0)); ui_set_next_palette(ui_build_palette(ui_top_palette(), .text = color)); @@ -11010,6 +11052,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ // rjf: build box for breakpoint ui_set_next_font(df_font_from_slot(DF_FontSlot_Icons)); ui_set_next_font_size(params->font_size * 1.f); + ui_set_next_run_flags(F_RunFlag_Smooth); ui_set_next_hover_cursor(OS_Cursor_HandPoint); ui_set_next_palette(ui_build_palette(ui_top_palette(), .text = bp_color)); ui_set_next_text_alignment(UI_TextAlign_Center); @@ -11077,6 +11120,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ // rjf: build box for watch ui_set_next_font(df_font_from_slot(DF_FontSlot_Icons)); ui_set_next_font_size(params->font_size * 1.f); + ui_set_next_run_flags(F_RunFlag_Smooth); ui_set_next_hover_cursor(OS_Cursor_HandPoint); ui_set_next_palette(ui_build_palette(ui_top_palette(), .text = color)); ui_set_next_text_alignment(UI_TextAlign_Center); @@ -11208,7 +11252,9 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ UI_Box *box = ui_build_box_from_stringf(UI_BoxFlag_DrawBorder, "###exception_info"); UI_Parent(box) UI_PrefWidth(ui_text_dim(10, 1)) { - UI_Font(df_font_from_slot(DF_FontSlot_Icons)) ui_label(df_g_icon_kind_text_table[DF_IconKind_WarningBig]); + UI_Font(df_font_from_slot(DF_FontSlot_Icons)) + UI_RunFlags(F_RunFlag_Smooth) + ui_label(df_g_icon_kind_text_table[DF_IconKind_WarningBig]); ui_label(explanation); } } @@ -11259,6 +11305,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ } UI_PrefWidth(ui_em(1.5f, 1.f)) UI_Font(df_font_from_slot(DF_FontSlot_Icons)) + UI_RunFlags(F_RunFlag_Smooth) UI_Palette(ui_build_palette(ui_top_palette(), .text = pin_color)) UI_TextAlignment(UI_TextAlign_Center) UI_Flags(UI_BoxFlag_DisableTextTrunc) @@ -11577,7 +11624,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ { TxtRngColorPairNode *n = push_array(scratch.arena, TxtRngColorPairNode, 1); n->rng = txt_rng(*cursor, *mark); - n->color = ui_top_palette()->colors[DF_ThemeColor_Selection]; + n->color = ui_top_palette()->colors[UI_ColorCode_Selection]; SLLQueuePush(first_txt_rng_color_pair, last_txt_rng_color_pair, n); } @@ -11621,12 +11668,8 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ ui_set_next_pref_height(ui_px(params->line_height_px*(dim_1s64(params->line_num_range)+1), 1.f)); ui_build_box_from_key(0, ui_key_zero()); ui_set_next_fixed_x(params->margin_float_off_px); - ui_set_next_flags(UI_BoxFlag_DrawDropShadow|UI_BoxFlag_DrawBackground|UI_BoxFlag_DrawSideRight|UI_BoxFlag_DrawSideLeft); - } - else - { - ui_set_next_flags(UI_BoxFlag_DrawSideRight|UI_BoxFlag_DrawSideLeft); } + ui_set_next_flags(UI_BoxFlag_DrawSideRight|UI_BoxFlag_DrawSideLeft); ui_set_next_pref_width(ui_px(params->line_num_width_px, 1.f)); ui_set_next_pref_height(ui_px(params->line_height_px*(dim_1s64(params->line_num_range)+1), 1.f)); UI_Column @@ -11722,6 +11765,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ ui_set_next_flags(UI_BoxFlag_DrawBackground); ui_set_next_palette(ui_build_palette(ui_top_palette(), .background = line_bg_color)); } + ui_set_next_tab_size(params->tab_size); UI_Box *line_box = ui_build_box_from_key(UI_BoxFlag_DisableTextTrunc|UI_BoxFlag_DrawText|UI_BoxFlag_DisableIDString, line_key); D_Bucket *line_bucket = d_bucket_make(); d_push_bucket(line_bucket); @@ -11853,7 +11897,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ } // rjf: equip fancy strings to line box - ui_box_equip_display_fancy_strings(line_box, params->tab_size, &line_fancy_strings); + ui_box_equip_display_fancy_strings(line_box, &line_fancy_strings); // rjf: extra rendering for strings that are currently being searched for if(params->search_query.size != 0) @@ -12413,7 +12457,8 @@ df_error_label(String8 string) UI_Signal sig = ui_signal_from_box(box); UI_Parent(box) { - ui_set_next_font(ui_icon_font()); + ui_set_next_font(df_font_from_slot(DF_FontSlot_Icons)); + ui_set_next_run_flags(F_RunFlag_Smooth); ui_set_next_text_alignment(UI_TextAlign_Center); ui_set_next_flags(UI_BoxFlag_DrawTextWeak); UI_PrefWidth(ui_em(2.25f, 1.f)) ui_label(df_g_icon_kind_text_table[DF_IconKind_WarningBig]); @@ -12434,7 +12479,8 @@ df_help_label(String8 string) if(ui_hovering(sig)) UI_PrefWidth(ui_em(2.25f, 1)) { result = 1; - ui_set_next_font(ui_icon_font()); + ui_set_next_font(df_font_from_slot(DF_FontSlot_Icons)); + ui_set_next_run_flags(F_RunFlag_Smooth); ui_set_next_text_alignment(UI_TextAlign_Center); UI_Box *help_hoverer = ui_build_box_from_stringf(UI_BoxFlag_DrawText|UI_BoxFlag_DrawBorder|UI_BoxFlag_DrawHotEffects, "###help_hoverer_%S", string); ui_box_equip_display_string(help_hoverer, df_g_icon_kind_text_table[DF_IconKind_QuestionMark]); @@ -12604,7 +12650,7 @@ df_code_label(F32 alpha, B32 indirection_size_change, Vec4F32 base_color, String Temp scratch = scratch_begin(0, 0); D_FancyStringList fancy_strings = df_fancy_string_list_from_code_string(scratch.arena, alpha, indirection_size_change, base_color, string); UI_Box *box = ui_build_box_from_key(UI_BoxFlag_DrawText, ui_key_zero()); - ui_box_equip_display_fancy_strings(box, ui_top_tab_size(), &fancy_strings); + ui_box_equip_display_fancy_strings(box, &fancy_strings); scratch_end(scratch); return box; } @@ -12668,7 +12714,8 @@ df_line_edit(DF_LineEditFlags flags, S32 depth, FuzzyMatchRangeList *matches, Tx { UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_Flags(UI_BoxFlag_DrawSideLeft) - UI_Font(ui_icon_font()) + UI_Font(df_font_from_slot(DF_FontSlot_Icons)) + UI_RunFlags(F_RunFlag_Smooth) ui_label(df_g_icon_kind_text_table[DF_IconKind_Dot]); } @@ -12955,7 +13002,7 @@ df_line_edit(DF_LineEditFlags flags, S32 depth, FuzzyMatchRangeList *matches, Tx } } } - ui_box_equip_display_fancy_strings(editstr_box, ui_top_tab_size(), &code_fancy_strings); + ui_box_equip_display_fancy_strings(editstr_box, &code_fancy_strings); UI_LineEditDrawData *draw_data = push_array(ui_build_arena(), UI_LineEditDrawData, 1); draw_data->edited_string = push_str8_copy(ui_build_arena(), edit_string); draw_data->cursor = *cursor; @@ -14098,10 +14145,18 @@ df_gfx_begin_frame(Arena *arena, DF_CmdList *cmds) df_gfx_state->cfg_palettes[DF_PaletteCode_DefaultNegative].text = current->colors[DF_ThemeColor_DefaultTextNegative]; df_gfx_state->cfg_palettes[DF_PaletteCode_DefaultNegative].text_weak = current->colors[DF_ThemeColor_DefaultTextWeak]; df_gfx_state->cfg_palettes[DF_PaletteCode_DefaultNegative].border = current->colors[DF_ThemeColor_DefaultBorder]; + df_gfx_state->cfg_palettes[DF_PaletteCode_DefaultNeutral].background = current->colors[DF_ThemeColor_DefaultBackground]; + df_gfx_state->cfg_palettes[DF_PaletteCode_DefaultNeutral].text = current->colors[DF_ThemeColor_DefaultTextNeutral]; + df_gfx_state->cfg_palettes[DF_PaletteCode_DefaultNeutral].text_weak = current->colors[DF_ThemeColor_DefaultTextWeak]; + df_gfx_state->cfg_palettes[DF_PaletteCode_DefaultNeutral].border = current->colors[DF_ThemeColor_DefaultBorder]; df_gfx_state->cfg_palettes[DF_PaletteCode_Floating].background = current->colors[DF_ThemeColor_FloatingBackground]; df_gfx_state->cfg_palettes[DF_PaletteCode_Floating].text = current->colors[DF_ThemeColor_FloatingText]; df_gfx_state->cfg_palettes[DF_PaletteCode_Floating].text_weak = current->colors[DF_ThemeColor_FloatingTextWeak]; df_gfx_state->cfg_palettes[DF_PaletteCode_Floating].border = current->colors[DF_ThemeColor_FloatingBorder]; + df_gfx_state->cfg_palettes[DF_PaletteCode_ImplicitContents].background = v4f32(0, 0, 0, 0); + df_gfx_state->cfg_palettes[DF_PaletteCode_ImplicitContents].text = current->colors[DF_ThemeColor_FloatingText]; + df_gfx_state->cfg_palettes[DF_PaletteCode_ImplicitContents].text_weak = current->colors[DF_ThemeColor_FloatingTextWeak]; + df_gfx_state->cfg_palettes[DF_PaletteCode_ImplicitContents].border = v4f32(0, 0, 0, 0); df_gfx_state->cfg_palettes[DF_PaletteCode_SpecialPositive].background = current->colors[DF_ThemeColor_SpecialPositiveBackground]; df_gfx_state->cfg_palettes[DF_PaletteCode_SpecialPositive].text = current->colors[DF_ThemeColor_SpecialPositiveText]; df_gfx_state->cfg_palettes[DF_PaletteCode_SpecialPositive].text_weak = current->colors[DF_ThemeColor_SpecialPositiveTextWeak]; @@ -14126,7 +14181,7 @@ df_gfx_begin_frame(Arena *arena, DF_CmdList *cmds) df_gfx_state->cfg_palettes[DF_PaletteCode_TabInactive].text = current->colors[DF_ThemeColor_TabInactiveText]; df_gfx_state->cfg_palettes[DF_PaletteCode_TabInactive].text_weak = current->colors[DF_ThemeColor_TabInactiveTextWeak]; df_gfx_state->cfg_palettes[DF_PaletteCode_TabInactive].border = current->colors[DF_ThemeColor_TabInactiveBorder]; - df_gfx_state->cfg_palettes[DF_PaletteCode_Code].background = current->colors[DF_ThemeColor_CodeBackground]; + df_gfx_state->cfg_palettes[DF_PaletteCode_Code].background = current->colors[DF_ThemeColor_DefaultBackground]; df_gfx_state->cfg_palettes[DF_PaletteCode_Code].text = current->colors[DF_ThemeColor_CodeDefault]; df_gfx_state->cfg_palettes[DF_PaletteCode_Code].text_weak = current->colors[DF_ThemeColor_CodeDefault]; df_gfx_state->cfg_palettes[DF_PaletteCode_Code].border = current->colors[DF_ThemeColor_DefaultBorder]; diff --git a/src/df/gfx/df_gfx.h b/src/df/gfx/df_gfx.h index ea38bd97..8f08ee50 100644 --- a/src/df/gfx/df_gfx.h +++ b/src/df/gfx/df_gfx.h @@ -379,7 +379,9 @@ typedef enum DF_PaletteCode DF_PaletteCode_Default, DF_PaletteCode_DefaultPositive, DF_PaletteCode_DefaultNegative, + DF_PaletteCode_DefaultNeutral, DF_PaletteCode_Floating, + DF_PaletteCode_ImplicitContents, DF_PaletteCode_SpecialPositive, DF_PaletteCode_SpecialNegative, DF_PaletteCode_SpecialNeutral, @@ -551,21 +553,24 @@ 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: 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; diff --git a/src/df/gfx/df_gfx.mdesk b/src/df/gfx/df_gfx.mdesk index 415f59ca..8361de51 100644 --- a/src/df/gfx/df_gfx.mdesk +++ b/src/df/gfx/df_gfx.mdesk @@ -374,81 +374,81 @@ DF_ThemeColorTable: //- rjf: global ui colors {Selection "Selection" selection 0x99ccff4c 0x99ccff4c 0x99ccff4c 0x99ccff4c 0x99ccff4c 0x99ccff4c 0x99ccff4c 0x99ccff4c 0x99ccff4c } {DropShadow "Drop Shadow" drop_shadow 0x0000007f 0x0000007f 0x0000007f 0x0000007f 0x0000007f 0x0000007f 0x0000007f 0x0000007f 0x0000007f } - {CursorActive "Cursor" cursor_active 0x66e566e5 0x66e566e5 0x66e566e5 0x66e566e5 0x66e566e5 0x66e566e5 0x66e566e5 0x66e566e5 0x66e566e5 } - {CursorInactive "Cursor (Inactive)" cursor_inactive 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff } - {FocusActive "Focus" focus_active 0xb27219ff 0xb27219ff 0xb27219ff 0xb27219ff 0xb27219ff 0xb27219ff 0xb27219ff 0xb27219ff 0xb27219ff } - {FocusInactive "Focus (Inactive)" focus_inactive 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff } - {Highlight0 "Highlight 0" highlight_0 0xb27219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff } - {Highlight1 "Highlight 1" highlight_1 0xb27219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff } + {CursorActive "Cursor" cursor_active 0x8bff00ff 0x66e566e5 0x66e566e5 0x66e566e5 0x66e566e5 0x66e566e5 0x66e566e5 0x66e566e5 0x66e566e5 } + {CursorInactive "Cursor (Inactive)" cursor_inactive 0xb23217ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff } + {FocusActive "Focus" focus_active 0xfea200ff 0xb27219ff 0xb27219ff 0xb27219ff 0xb27219ff 0xb27219ff 0xb27219ff 0xb27219ff 0xb27219ff } + {FocusInactive "Focus (Inactive)" focus_inactive 0x904334ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff } + {Highlight0 "Highlight 0" highlight_0 0xfe9603ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff } + {Highlight1 "Highlight 1" highlight_1 0x7bffc7ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff } {DisabledOverlay "Disabled Overlay" disabled_overlay 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f } //- rjf: default ui colors - {DefaultText "Default Text" default_text 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff } - {DefaultTextPositive "Default Text (Positive)" default_text_positive 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff } - {DefaultTextNegative "Default Text (Negative)" default_text_negative 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff } - {DefaultTextWeak "Default Text (Weak)" default_text_weak 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f } - {DefaultBackground "Default Background" default_background 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f } - {DefaultBorder "Default Border" default_border 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 } + {DefaultText "Default Text" default_text 0xbebebeff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff } + {DefaultTextPositive "Default Text (Positive)" default_text_positive 0x4dc221ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff } + {DefaultTextNegative "Default Text (Negative)" default_text_negative 0xc56553ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff } + {DefaultTextNeutral "Default Text (Neutral)" default_text_neutral 0x327fb2ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff } + {DefaultTextWeak "Default Text (Weak)" default_text_weak 0xa4a4a4fe 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f } + {DefaultBackground "Default Background" default_background 0x1b1b1bfe 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f } + {DefaultBorder "Default Border" default_border 0x3f3f3ffe 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 } //- rjf: floating ui colors - {FloatingText "Floating Text" floating_text 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff } - {FloatingTextPositive "Floating Text (Positive)" floating_text_positive 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff } - {FloatingTextNegative "Floating Text (Negative)" floating_text_negative 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff } - {FloatingTextWeak "Floating Text (Weak)" floating_text_weak 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f } - {FloatingBackground "Floating Background" floating_background 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f } - {FloatingBorder "Floating Border" floating_border 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 } + {FloatingText "Floating Text" floating_text 0xbebebeff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff } + {FloatingTextPositive "Floating Text (Positive)" floating_text_positive 0x4dc220ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff } + {FloatingTextNegative "Floating Text (Negative)" floating_text_negative 0xc56452ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff } + {FloatingTextWeak "Floating Text (Weak)" floating_text_weak 0xa4a4a4ff 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f } + {FloatingBackground "Floating Background" floating_background 0x33333333 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f } + {FloatingBorder "Floating Border" floating_border 0x3f3f3ffd 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 } //- rjf: special button colors - {SpecialPositiveText "Special Positive Text" special_positive_text 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff } - {SpecialPositiveTextWeak "Special Positive Text (Weak)" special_positive_text_weak 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f } - {SpecialPositiveBackground "Special Positive Background" special_positive_background 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff } - {SpecialPositiveBorder "Special Positive Border" special_positive_border 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 } - {SpecialNegativeText "Special Negative Text" special_negative_text 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff } - {SpecialNegativeTextWeak "Special Negative Text (Weak)" special_negative_text_weak 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f } - {SpecialNegativeBackground "Special Negative Background" special_negative_background 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff } - {SpecialNegativeBorder "Special Negative Border" special_negative_border 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 } - {SpecialNeutralText "Special Neutral Text" special_neutral_text 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff } - {SpecialNeutralTextWeak "Special Neutral Text (Weak)" special_neutral_text_weak 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f } - {SpecialNeutralBackground "Special Neutral Background" special_neutral_background 0x327fb2ff 0x327fb2ff 0x327fb2ff 0x327fb2ff 0x327fb2ff 0x327fb2ff 0x327fb2ff 0x327fb2ff 0x327fb2ff } - {SpecialNeutralBorder "Special Neutral Border" special_neutral_border 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 } + {SpecialPositiveText "Special Positive Text" special_positive_text 0xfefefeff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff } + {SpecialPositiveTextWeak "Special Positive Text (Weak)" special_positive_text_weak 0xa4a4a4fe 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f } + {SpecialPositiveBackground "Special Positive Background" special_positive_background 0x2d7e3eff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff } + {SpecialPositiveBorder "Special Positive Border" special_positive_border 0x3f3f3ffd 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 } + {SpecialNegativeText "Special Negative Text" special_negative_text 0xfefefeff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff } + {SpecialNegativeTextWeak "Special Negative Text (Weak)" special_negative_text_weak 0xa4a4a4fd 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f } + {SpecialNegativeBackground "Special Negative Background" special_negative_background 0x803425ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff } + {SpecialNegativeBorder "Special Negative Border" special_negative_border 0x3f3f3ffd 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 } + {SpecialNeutralText "Special Neutral Text" special_neutral_text 0xfefefeff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff } + {SpecialNeutralTextWeak "Special Neutral Text (Weak)" special_neutral_text_weak 0xa4a4a4fd 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f } + {SpecialNeutralBackground "Special Neutral Background" special_neutral_background 0x355b6eff 0x327fb2ff 0x327fb2ff 0x327fb2ff 0x327fb2ff 0x327fb2ff 0x327fb2ff 0x327fb2ff 0x327fb2ff } + {SpecialNeutralBorder "Special Neutral Border" special_neutral_border 0x3f3f3ffd 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 } //- rjf: menu bar colors - {MenuBarText "Menu Bar Text" menu_bar_text 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff } + {MenuBarText "Menu Bar Text" menu_bar_text 0xfefefeff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff } {MenuBarTextWeak "Menu Bar Text (Weak)" menu_bar_text_weak 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f } {MenuBarTextPositive "Menu Bar Text (Positive)" menu_bar_text_positive 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff } {MenuBarTextNegative "Menu Bar Text (Negative)" menu_bar_text_negative 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff } - {MenuBarBackground "Menu Bar Background" menu_bar_background 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f } + {MenuBarBackground "Menu Bar Background" menu_bar_background 0x3e4c577f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f } {MenuBarBorder "Menu Bar Border" menu_bar_border 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 } //- rjf: tab colors - {TabActiveText "Tab Text" tab_active_text 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff } + {TabActiveText "Tab Text" tab_active_text 0xffffffff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff } {TabActiveTextWeak "Tab Text (Weak)" tab_active_text_weak 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f } - {TabActiveBackground "Tab Background" tab_active_background 0xa87a4c99 0xa87a4c99 0xa87a4c99 0xa87a4c99 0xa87a4c99 0xa87a4c99 0xa87a4c99 0xa87a4c99 0xa87a4c99 } - {TabActiveBorder "Tab Border" tab_active_border 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 } - {TabInactiveText "Tab Text (Inactive)" tab_inactive_text 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff } - {TabInactiveTextWeak "Tab Text (Inactive, Weak)" tab_inactive_text_weak 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f } - {TabInactiveBackground "Tab Background (Inactive)" tab_inactive_background 0x42474c7f 0x42474c7f 0x42474c7f 0x42474c7f 0x42474c7f 0x42474c7f 0x42474c7f 0x42474c7f 0x42474c7f } + {TabActiveBackground "Tab Background" tab_active_background 0x7b4d27fe 0xa87a4c99 0xa87a4c99 0xa87a4c99 0xa87a4c99 0xa87a4c99 0xa87a4c99 0xa87a4c99 0xa87a4c99 } + {TabActiveBorder "Tab Border" tab_active_border 0xb48300fd 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 } + {TabInactiveText "Tab Text (Inactive)" tab_inactive_text 0xa4a4a4fd 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff } + {TabInactiveTextWeak "Tab Text (Inactive, Weak)" tab_inactive_text_weak 0x808080fd 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f } + {TabInactiveBackground "Tab Background (Inactive)" tab_inactive_background 0x3e4c577f 0x42474c7f 0x42474c7f 0x42474c7f 0x42474c7f 0x42474c7f 0x42474c7f 0x42474c7f 0x42474c7f } {TabInactiveBorder "Tab Border (Inactive)" tab_inactive_border 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 } //- rjf: code ui colors - {CodeBackground "Code Background" code_background 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f } - {CodeBackgroundNegative "Code Background (Negative)" code_background_negative 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f } - {CodeLineNumbersActive "Code Line Numbers" code_line_numbers_active 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff } - {CodeLineNumbersInactive "Code Line Numbers (Inactive)" code_line_numbers_inactive 0xa5a5a5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff } + {CodeBackgroundNegative "Code Background (Negative)" code_background_negative 0x3b1f1ffe 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f } + {CodeLineNumbersActive "Code Line Numbers" code_line_numbers_active 0xbebebeff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff } + {CodeLineNumbersInactive "Code Line Numbers (Inactive)" code_line_numbers_inactive 0x7f7f7fff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff } //- rjf: code text colors - {CodeDefault "Code (Default)" code_default 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff } - {CodeProcedure "Code (Procedure)" code_procedure 0x7fcc99ff 0x7fcc99ff 0x7fcc99ff 0x7fcc99ff 0x7fcc99ff 0x7fcc99ff 0x7fcc99ff 0x7fcc99ff 0x7fcc99ff } - {CodeType "Code (Type)" code_type 0x66b2e5ff 0x66b2e5ff 0x66b2e5ff 0x66b2e5ff 0x66b2e5ff 0x66b2e5ff 0x66b2e5ff 0x66b2e5ff 0x66b2e5ff } - {CodeLocal "Code (Local)" code_local 0xfe9548ff 0xfe9548ff 0xfe9548ff 0xfe9548ff 0xfe9548ff 0xfe9548ff 0xfe9548ff 0xfe9548ff 0xfe9548ff } - {CodeRegister "Code (Register)" code_register 0xd45d90ff 0xd45d90ff 0xd45d90ff 0xd45d90ff 0xd45d90ff 0xd45d90ff 0xd45d90ff 0xd45d90ff 0xd45d90ff } - {CodeKeyword "Code (Keyword)" code_keyword 0xf7bf5eff 0xf7bf5eff 0xf7bf5eff 0xf7bf5eff 0xf7bf5eff 0xf7bf5eff 0xf7bf5eff 0xf7bf5eff 0xf7bf5eff } - {CodeDelimiterOperator "Code (Delimiters/Operators)" code_delimiter_operator 0x994c32ff 0x994c32ff 0x994c32ff 0x994c32ff 0x994c32ff 0x994c32ff 0x994c32ff 0x994c32ff 0x994c32ff } - {CodeNumeric "Code (Numeric)" code_numeric 0x4ce54cff 0x4ce54cff 0x4ce54cff 0x4ce54cff 0x4ce54cff 0x4ce54cff 0x4ce54cff 0x4ce54cff 0x4ce54cff } - {CodeNumericAltDigitGroup "Code (Numeric, Alt. Digit Group)" code_numeric_alt_digit_group 0x4ca54cff 0x4ca54cff 0x4ca54cff 0x4ca54cff 0x4ca54cff 0x4ca54cff 0x4ca54cff 0x4ca54cff 0x4ca54cff } - {CodeString "Code (String)" code_string 0xe5cc66ff 0xe5cc66ff 0xe5cc66ff 0xe5cc66ff 0xe5cc66ff 0xe5cc66ff 0xe5cc66ff 0xe5cc66ff 0xe5cc66ff } - {CodeMeta "Code (Meta)" code_meta 0xe54c4cff 0xe54c4cff 0xe54c4cff 0xe54c4cff 0xe54c4cff 0xe54c4cff 0xe54c4cff 0xe54c4cff 0xe54c4cff } - {CodeComment "Code (Comment)" code_comment 0x7f7f7fff 0x7f7f7fff 0x7f7f7fff 0x7f7f7fff 0x7f7f7fff 0x7f7f7fff 0x7f7f7fff 0x7f7f7fff 0x7f7f7fff } + {CodeDefault "Code (Default)" code_default 0xbebebeff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff } + {CodeProcedure "Code (Procedure)" code_procedure 0x6093c2ff 0x7fcc99ff 0x7fcc99ff 0x7fcc99ff 0x7fcc99ff 0x7fcc99ff 0x7fcc99ff 0x7fcc99ff 0x7fcc99ff } + {CodeType "Code (Type)" code_type 0xecb31aff 0x66b2e5ff 0x66b2e5ff 0x66b2e5ff 0x66b2e5ff 0x66b2e5ff 0x66b2e5ff 0x66b2e5ff 0x66b2e5ff } + {CodeLocal "Code (Local)" code_local 0xadc9e0ff 0xfe9548ff 0xfe9548ff 0xfe9548ff 0xfe9548ff 0xfe9548ff 0xfe9548ff 0xfe9548ff 0xfe9548ff } + {CodeRegister "Code (Register)" code_register 0xb7afd5ff 0xd45d90ff 0xd45d90ff 0xd45d90ff 0xd45d90ff 0xd45d90ff 0xd45d90ff 0xd45d90ff 0xd45d90ff } + {CodeKeyword "Code (Keyword)" code_keyword 0xb18e32ff 0xf7bf5eff 0xf7bf5eff 0xf7bf5eff 0xf7bf5eff 0xf7bf5eff 0xf7bf5eff 0xf7bf5eff 0xf7bf5eff } + {CodeDelimiterOperator "Code (Delimiters/Operators)" code_delimiter_operator 0x7f7f7fff 0x994c32ff 0x994c32ff 0x994c32ff 0x994c32ff 0x994c32ff 0x994c32ff 0x994c32ff 0x994c32ff } + {CodeNumeric "Code (Numeric)" code_numeric 0x89b379ff 0x4ce54cff 0x4ce54cff 0x4ce54cff 0x4ce54cff 0x4ce54cff 0x4ce54cff 0x4ce54cff 0x4ce54cff } + {CodeNumericAltDigitGroup "Code (Numeric, Alt. Digit Group)" code_numeric_alt_digit_group 0x608752ff 0x4ca54cff 0x4ca54cff 0x4ca54cff 0x4ca54cff 0x4ca54cff 0x4ca54cff 0x4ca54cff 0x4ca54cff } + {CodeString "Code (String)" code_string 0x89b379ff 0xe5cc66ff 0xe5cc66ff 0xe5cc66ff 0xe5cc66ff 0xe5cc66ff 0xe5cc66ff 0xe5cc66ff 0xe5cc66ff } + {CodeMeta "Code (Meta)" code_meta 0x906f81ff 0xe54c4cff 0xe54c4cff 0xe54c4cff 0xe54c4cff 0xe54c4cff 0xe54c4cff 0xe54c4cff 0xe54c4cff } + {CodeComment "Code (Comment)" code_comment 0x717171ff 0x7f7f7fff 0x7f7f7fff 0x7f7f7fff 0x7f7f7fff 0x7f7f7fff 0x7f7f7fff 0x7f7f7fff 0x7f7f7fff } //- rjf: debugging colors {LineInfoBackground0 "Line Info Background 0" line_info_background_0 0x99503d3f 0x99503d3f 0x99503d3f 0x99503d3f 0x99503d3f 0x99503d3f 0x99503d3f 0x99503d3f 0x99503d3f } @@ -458,7 +458,7 @@ DF_ThemeColorTable: {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 0x99503d3f 0x99503d3f 0x99503d3f 0x99503d3f 0x99503d3f 0x99503d3f 0x99503d3f 0x99503d3f 0x99503d3f } + {LineInfoBackground7 "Line Info Background 7" line_info_background_7 0xcefd693f 0x99503d3f 0x99503d3f 0x99503d3f 0x99503d3f 0x99503d3f 0x99503d3f 0x99503d3f 0x99503d3f } {Thread0 "Thread 0" thread_0 0xffcb7fff 0xffcb7fff 0xffcb7fff 0xffcb7fff 0xffcb7fff 0xffcb7fff 0xffcb7fff 0xffcb7fff 0xffcb7fff } {Thread1 "Thread 1" thread_1 0xb2ff65ff 0xb2ff65ff 0xb2ff65ff 0xb2ff65ff 0xb2ff65ff 0xb2ff65ff 0xb2ff65ff 0xb2ff65ff 0xb2ff65ff } {Thread2 "Thread 2" thread_2 0xff99e5ff 0xff99e5ff 0xff99e5ff 0xff99e5ff 0xff99e5ff 0xff99e5ff 0xff99e5ff 0xff99e5ff 0xff99e5ff } @@ -469,7 +469,7 @@ DF_ThemeColorTable: {Thread7 "Thread 7" thread_7 0x65ff4cff 0x65ff4cff 0x65ff4cff 0x65ff4cff 0x65ff4cff 0x65ff4cff 0x65ff4cff 0x65ff4cff 0x65ff4cff } {ThreadUnwound "Thread (Unwound)" thread_unwound 0xb2ccd8ff 0xb2ccd8ff 0xb2ccd8ff 0xb2ccd8ff 0xb2ccd8ff 0xb2ccd8ff 0xb2ccd8ff 0xb2ccd8ff 0xb2ccd8ff } {ThreadError "Thread (Error)" thread_error 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff } - {Breakpoint "Breakpoint" breakpoint 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff } + {Breakpoint "Breakpoint" breakpoint 0xa72a12ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff } //- rjf: behavioral colors {DropSiteOverlay "Drop Site Overlay" drop_site_overlay 0xffffff0c 0xffffff0c 0xffffff0c 0xffffff0c 0xffffff0c 0xffffff0c 0xffffff0c 0xffffff0c 0xffffff0c } diff --git a/src/df/gfx/df_view_rules.c b/src/df/gfx/df_view_rules.c index d93c4d63..edea627e 100644 --- a/src/df/gfx/df_view_rules.c +++ b/src/df/gfx/df_view_rules.c @@ -357,7 +357,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 diff --git a/src/df/gfx/df_views.c b/src/df/gfx/df_views.c index f9896249..310df2ba 100644 --- a/src/df/gfx/df_views.c +++ b/src/df/gfx/df_views.c @@ -2359,41 +2359,6 @@ DF_VIEW_UI_FUNCTION_DEF(Commands) { DF_CmdListerItem *item = &cmd_array.v[row_idx]; - //- rjf: build context menu for this command - UI_Key item_ctx_menu_key = ui_key_from_stringf(ui_key_zero(), "###%p_cmd_ctx_%p", view, item->cmd_spec); - UI_CtxMenu(item_ctx_menu_key) UI_PrefWidth(ui_em(33, 1)) - { - // rjf: row with icon & name - UI_Row UI_PrefWidth(ui_text_dim(10, 1)) UI_PrefHeight(ui_pct(1, 0)) - { - // rjf: icon - DF_IconKind icon = item->cmd_spec->info.canonical_icon_kind; - if(icon != DF_IconKind_Null) - UI_TextAlignment(UI_TextAlign_Center) - UI_Font(df_font_from_slot(DF_FontSlot_Icons)) - UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Icons)) - UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) - UI_PrefWidth(ui_em(2.25f, 1.f)) - { - ui_label(df_g_icon_kind_text_table[icon]); - } - - // rjf: display name - ui_label(item->cmd_spec->info.display_name); - } - - // rjf: row with ipc syntax - UI_Row UI_PrefWidth(ui_text_dim(10, 1)) UI_PrefHeight(ui_pct(1, 0)) - { - // rjf: name - UI_TextAlignment(UI_TextAlign_Left) - UI_Font(df_font_from_slot(DF_FontSlot_Code)) - UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Code)) - UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) - ui_label(item->cmd_spec->info.string); - } - } - //- rjf: build row contents ui_set_next_hover_cursor(OS_Cursor_HandPoint); ui_set_next_child_layout_axis(Axis2_X); @@ -2415,6 +2380,7 @@ DF_VIEW_UI_FUNCTION_DEF(Commands) UI_Column UI_Font(df_font_from_slot(DF_FontSlot_Icons)) UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Icons)) + UI_RunFlags(F_RunFlag_Smooth) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_HeightFill UI_TextAlignment(UI_TextAlign_Center) @@ -2462,10 +2428,6 @@ DF_VIEW_UI_FUNCTION_DEF(Commands) df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_CmdSpec); df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_CompleteQuery)); } - if(ui_right_clicked(sig)) - { - ui_ctx_menu_open(item_ctx_menu_key, ui_key_zero(), sub_2f32(ui_mouse(), v2f32(2, 2))); - } } } @@ -2812,6 +2774,7 @@ DF_VIEW_UI_FUNCTION_DEF(FileSystem) // rjf: icons UI_Font(df_font_from_slot(DF_FontSlot_Icons)) UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Icons)) + UI_RunFlags(F_RunFlag_Smooth) UI_PrefWidth(ui_em(3.f, 1.f)) UI_TextAlignment(UI_TextAlign_Center) { @@ -2860,6 +2823,7 @@ DF_VIEW_UI_FUNCTION_DEF(FileSystem) // rjf: icon to signify directory UI_Font(df_font_from_slot(DF_FontSlot_Icons)) UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Icons)) + UI_RunFlags(F_RunFlag_Smooth) UI_PrefWidth(ui_em(3.f, 1.f)) UI_TextAlignment(UI_TextAlign_Center) { @@ -3048,6 +3012,7 @@ DF_VIEW_UI_FUNCTION_DEF(SystemProcesses) // rjf: icon UI_Font(df_font_from_slot(DF_FontSlot_Icons)) UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Icons)) + UI_RunFlags(F_RunFlag_Smooth) UI_PrefWidth(ui_em(3.f, 1.f)) UI_TextAlignment(UI_TextAlign_Center) { @@ -3221,6 +3186,7 @@ DF_VIEW_UI_FUNCTION_DEF(EntityLister) UI_TextAlignment(UI_TextAlign_Center) UI_Font(df_font_from_slot(DF_FontSlot_Icons)) UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Icons)) + UI_RunFlags(F_RunFlag_Smooth) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_PrefWidth(ui_text_dim(10, 1)) ui_label(df_g_icon_kind_text_table[icon_kind]); @@ -4974,6 +4940,7 @@ DF_VIEW_UI_FUNCTION_DEF(CallStack) UI_TableCell UI_Font(df_font_from_slot(DF_FontSlot_Icons)) UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Icons)) + UI_RunFlags(F_RunFlag_Smooth) UI_WidthFill UI_TextAlignment(UI_TextAlign_Center) UI_FocusHot((row_selected && cs->cursor.x == 0) ? UI_FocusKind_On : UI_FocusKind_Off) @@ -5054,7 +5021,7 @@ DF_VIEW_UI_FUNCTION_DEF(CallStack) d_fancy_string_list_push(scratch.arena, &fstrs, &sep); d_fancy_string_list_concat_in_place(&fstrs, &symbol_type_fstrs); UI_Box *label = ui_build_box_from_key(UI_BoxFlag_DrawText, ui_key_zero()); - ui_box_equip_display_fancy_strings(label, 0, &fstrs); + ui_box_equip_display_fancy_strings(label, &fstrs); } } UI_Signal sig = ui_signal_from_box(box); @@ -6031,7 +5998,9 @@ DF_VIEW_UI_FUNCTION_DEF(Code) UI_PrefWidth(ui_text_dim(10, 1)) DF_Palette(DF_PaletteCode_DefaultNegative) { - UI_Font(ui_icon_font()) ui_label(df_g_icon_kind_text_table[DF_IconKind_WarningBig]); + UI_Font(df_font_from_slot(DF_FontSlot_Icons)) + UI_RunFlags(F_RunFlag_Smooth) + ui_label(df_g_icon_kind_text_table[DF_IconKind_WarningBig]); ui_labelf("Could not find \"%S\".", full_path); } UI_PrefHeight(ui_em(3, 1)) @@ -6584,6 +6553,7 @@ DF_VIEW_UI_FUNCTION_DEF(Code) UI_Box *box = &ui_g_nil_box; DF_Palette(DF_PaletteCode_SpecialNegative) UI_Font(df_font_from_slot(DF_FontSlot_Icons)) + UI_RunFlags(F_RunFlag_Smooth) { box = ui_build_box_from_stringf(UI_BoxFlag_DrawText|UI_BoxFlag_Clickable, "%S###file_ood_warning", df_g_icon_kind_text_table[DF_IconKind_WarningBig]); } @@ -8966,7 +8936,7 @@ DF_VIEW_UI_FUNCTION_DEF(Memory) cell_bg_rgba = df_rgba_from_theme_color(DF_ThemeColor_Selection); } UI_Box *cell_box = ui_build_box_from_key(UI_BoxFlag_DrawText|cell_flags, ui_key_zero()); - ui_box_equip_display_fancy_strings(cell_box, 0, &byte_fancy_strings[byte_value]); + ui_box_equip_display_fancy_strings(cell_box, &byte_fancy_strings[byte_value]); { F32 off = 0; for(Annotation *a = annotation; a != 0; a = a->next) @@ -9668,7 +9638,7 @@ DF_VIEW_UI_FUNCTION_DEF(Theme) //- rjf: build preset ctx menu UI_Key preset_ctx_menu_key = ui_key_from_stringf(ui_key_zero(), "%p_preset_ctx_menu", view); - UI_CtxMenu(preset_ctx_menu_key) UI_PrefWidth(ui_em(30.f, 1.f)) + DF_Palette(DF_PaletteCode_Floating) UI_CtxMenu(preset_ctx_menu_key) UI_PrefWidth(ui_em(30.f, 1.f)) { for(DF_ThemePreset preset = (DF_ThemePreset)0; preset < DF_ThemePreset_COUNT; @@ -9704,7 +9674,9 @@ DF_VIEW_UI_FUNCTION_DEF(Theme) color < DF_ThemeColor_COUNT; color = (DF_ThemeColor)(color+1)) { - UI_CtxMenu(color_ctx_menu_keys[color]) UI_Padding(ui_em(1.5f, 1.f)) + DF_Palette(DF_PaletteCode_Floating) + UI_CtxMenu(color_ctx_menu_keys[color]) + UI_Padding(ui_em(1.5f, 1.f)) UI_PrefWidth(ui_em(28.5f, 1)) UI_PrefHeight(ui_children_sum(1.f)) { // rjf: build title diff --git a/src/df/gfx/generated/df_gfx.meta.c b/src/df/gfx/generated/df_gfx.meta.c index 7b413893..248a1e9d 100644 --- a/src/df/gfx/generated/df_gfx.meta.c +++ b/src/df/gfx/generated/df_gfx.meta.c @@ -324,67 +324,67 @@ Vec4F32 df_g_theme_preset_colors__default_dark[85] = rgba_from_u32_lit_comp(0xff00ffff), rgba_from_u32_lit_comp(0x99ccff4c), rgba_from_u32_lit_comp(0x0000007f), -rgba_from_u32_lit_comp(0x66e566e5), -rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xb27219ff), -rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xb27219ff), -rgba_from_u32_lit_comp(0xb27219ff), +rgba_from_u32_lit_comp(0x8bff00ff), +rgba_from_u32_lit_comp(0xb23217ff), +rgba_from_u32_lit_comp(0xfea200ff), +rgba_from_u32_lit_comp(0x904334ff), +rgba_from_u32_lit_comp(0xfe9603ff), +rgba_from_u32_lit_comp(0x7bffc7ff), rgba_from_u32_lit_comp(0x0000003f), -rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0xbebebeff), +rgba_from_u32_lit_comp(0x4dc221ff), +rgba_from_u32_lit_comp(0xc56553ff), +rgba_from_u32_lit_comp(0x327fb2ff), +rgba_from_u32_lit_comp(0xa4a4a4fe), +rgba_from_u32_lit_comp(0x1b1b1bfe), +rgba_from_u32_lit_comp(0x3f3f3ffe), +rgba_from_u32_lit_comp(0xbebebeff), +rgba_from_u32_lit_comp(0x4dc220ff), +rgba_from_u32_lit_comp(0xc56452ff), +rgba_from_u32_lit_comp(0xa4a4a4ff), +rgba_from_u32_lit_comp(0x33333333), +rgba_from_u32_lit_comp(0x3f3f3ffd), +rgba_from_u32_lit_comp(0xfefefeff), +rgba_from_u32_lit_comp(0xa4a4a4fe), +rgba_from_u32_lit_comp(0x2d7e3eff), +rgba_from_u32_lit_comp(0x3f3f3ffd), +rgba_from_u32_lit_comp(0xfefefeff), +rgba_from_u32_lit_comp(0xa4a4a4fd), +rgba_from_u32_lit_comp(0x803425ff), +rgba_from_u32_lit_comp(0x3f3f3ffd), +rgba_from_u32_lit_comp(0xfefefeff), +rgba_from_u32_lit_comp(0xa4a4a4fd), +rgba_from_u32_lit_comp(0x355b6eff), +rgba_from_u32_lit_comp(0x3f3f3ffd), +rgba_from_u32_lit_comp(0xfefefeff), +rgba_from_u32_lit_comp(0xffffff7f), rgba_from_u32_lit_comp(0x32b219ff), rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xffffff7f), -rgba_from_u32_lit_comp(0x3333337f), +rgba_from_u32_lit_comp(0x3e4c577f), rgba_from_u32_lit_comp(0xffffff19), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0x32b219ff), -rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xffffff7f), -rgba_from_u32_lit_comp(0x3333337f), -rgba_from_u32_lit_comp(0xffffff19), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0xffffff7f), -rgba_from_u32_lit_comp(0x32b219ff), -rgba_from_u32_lit_comp(0xffffff33), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0xffffff7f), -rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xffffff33), rgba_from_u32_lit_comp(0xffffffff), rgba_from_u32_lit_comp(0xffffff7f), -rgba_from_u32_lit_comp(0x327fb2ff), -rgba_from_u32_lit_comp(0xffffff33), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0xffffff7f), -rgba_from_u32_lit_comp(0x32b219ff), -rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0x3333337f), +rgba_from_u32_lit_comp(0x7b4d27fe), +rgba_from_u32_lit_comp(0xb48300fd), +rgba_from_u32_lit_comp(0xa4a4a4fd), +rgba_from_u32_lit_comp(0x808080fd), +rgba_from_u32_lit_comp(0x3e4c577f), rgba_from_u32_lit_comp(0xffffff19), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0xffffff7f), -rgba_from_u32_lit_comp(0xa87a4c99), -rgba_from_u32_lit_comp(0xffffff19), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0xffffff7f), -rgba_from_u32_lit_comp(0x42474c7f), -rgba_from_u32_lit_comp(0xffffff19), -rgba_from_u32_lit_comp(0x3333337f), -rgba_from_u32_lit_comp(0x3333337f), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0xa5a5a5ff), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0x7fcc99ff), -rgba_from_u32_lit_comp(0x66b2e5ff), -rgba_from_u32_lit_comp(0xfe9548ff), -rgba_from_u32_lit_comp(0xd45d90ff), -rgba_from_u32_lit_comp(0xf7bf5eff), -rgba_from_u32_lit_comp(0x994c32ff), -rgba_from_u32_lit_comp(0x4ce54cff), -rgba_from_u32_lit_comp(0x4ca54cff), -rgba_from_u32_lit_comp(0xe5cc66ff), -rgba_from_u32_lit_comp(0xe54c4cff), +rgba_from_u32_lit_comp(0x3b1f1ffe), +rgba_from_u32_lit_comp(0xbebebeff), rgba_from_u32_lit_comp(0x7f7f7fff), +rgba_from_u32_lit_comp(0xbebebeff), +rgba_from_u32_lit_comp(0x6093c2ff), +rgba_from_u32_lit_comp(0xecb31aff), +rgba_from_u32_lit_comp(0xadc9e0ff), +rgba_from_u32_lit_comp(0xb7afd5ff), +rgba_from_u32_lit_comp(0xb18e32ff), +rgba_from_u32_lit_comp(0x7f7f7fff), +rgba_from_u32_lit_comp(0x89b379ff), +rgba_from_u32_lit_comp(0x608752ff), +rgba_from_u32_lit_comp(0x89b379ff), +rgba_from_u32_lit_comp(0x906f81ff), +rgba_from_u32_lit_comp(0x717171ff), rgba_from_u32_lit_comp(0x99503d3f), rgba_from_u32_lit_comp(0xfe82493f), rgba_from_u32_lit_comp(0xffba173f), @@ -392,7 +392,7 @@ rgba_from_u32_lit_comp(0xcefd693f), rgba_from_u32_lit_comp(0x99503d3f), rgba_from_u32_lit_comp(0xfe82493f), rgba_from_u32_lit_comp(0xffba173f), -rgba_from_u32_lit_comp(0x99503d3f), +rgba_from_u32_lit_comp(0xcefd693f), rgba_from_u32_lit_comp(0xffcb7fff), rgba_from_u32_lit_comp(0xb2ff65ff), rgba_from_u32_lit_comp(0xff99e5ff), @@ -403,7 +403,7 @@ rgba_from_u32_lit_comp(0x9932ffff), rgba_from_u32_lit_comp(0x65ff4cff), rgba_from_u32_lit_comp(0xb2ccd8ff), rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xa72a12ff), rgba_from_u32_lit_comp(0xffffff0c), rgba_from_u32_lit_comp(0x0000003f), }; @@ -423,6 +423,7 @@ rgba_from_u32_lit_comp(0x0000003f), rgba_from_u32_lit_comp(0xe5e5e5ff), rgba_from_u32_lit_comp(0x32b219ff), rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xb23219ff), rgba_from_u32_lit_comp(0xffffff7f), rgba_from_u32_lit_comp(0x3333337f), rgba_from_u32_lit_comp(0xffffff19), @@ -459,7 +460,6 @@ rgba_from_u32_lit_comp(0xffffff7f), rgba_from_u32_lit_comp(0x42474c7f), rgba_from_u32_lit_comp(0xffffff19), rgba_from_u32_lit_comp(0x3333337f), -rgba_from_u32_lit_comp(0x3333337f), rgba_from_u32_lit_comp(0xe5e5e5ff), rgba_from_u32_lit_comp(0xe5e5e5ff), rgba_from_u32_lit_comp(0xe5e5e5ff), @@ -512,6 +512,7 @@ rgba_from_u32_lit_comp(0x0000003f), rgba_from_u32_lit_comp(0xe5e5e5ff), rgba_from_u32_lit_comp(0x32b219ff), rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xb23219ff), rgba_from_u32_lit_comp(0xffffff7f), rgba_from_u32_lit_comp(0x3333337f), rgba_from_u32_lit_comp(0xffffff19), @@ -548,7 +549,6 @@ rgba_from_u32_lit_comp(0xffffff7f), rgba_from_u32_lit_comp(0x42474c7f), rgba_from_u32_lit_comp(0xffffff19), rgba_from_u32_lit_comp(0x3333337f), -rgba_from_u32_lit_comp(0x3333337f), rgba_from_u32_lit_comp(0xe5e5e5ff), rgba_from_u32_lit_comp(0xe5e5e5ff), rgba_from_u32_lit_comp(0xe5e5e5ff), @@ -601,6 +601,7 @@ rgba_from_u32_lit_comp(0x0000003f), rgba_from_u32_lit_comp(0xe5e5e5ff), rgba_from_u32_lit_comp(0x32b219ff), rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xb23219ff), rgba_from_u32_lit_comp(0xffffff7f), rgba_from_u32_lit_comp(0x3333337f), rgba_from_u32_lit_comp(0xffffff19), @@ -637,7 +638,6 @@ rgba_from_u32_lit_comp(0xffffff7f), rgba_from_u32_lit_comp(0x42474c7f), rgba_from_u32_lit_comp(0xffffff19), rgba_from_u32_lit_comp(0x3333337f), -rgba_from_u32_lit_comp(0x3333337f), rgba_from_u32_lit_comp(0xe5e5e5ff), rgba_from_u32_lit_comp(0xe5e5e5ff), rgba_from_u32_lit_comp(0xe5e5e5ff), @@ -690,6 +690,7 @@ rgba_from_u32_lit_comp(0x0000003f), rgba_from_u32_lit_comp(0xe5e5e5ff), rgba_from_u32_lit_comp(0x32b219ff), rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xb23219ff), rgba_from_u32_lit_comp(0xffffff7f), rgba_from_u32_lit_comp(0x3333337f), rgba_from_u32_lit_comp(0xffffff19), @@ -726,7 +727,6 @@ rgba_from_u32_lit_comp(0xffffff7f), rgba_from_u32_lit_comp(0x42474c7f), rgba_from_u32_lit_comp(0xffffff19), rgba_from_u32_lit_comp(0x3333337f), -rgba_from_u32_lit_comp(0x3333337f), rgba_from_u32_lit_comp(0xe5e5e5ff), rgba_from_u32_lit_comp(0xe5e5e5ff), rgba_from_u32_lit_comp(0xe5e5e5ff), @@ -779,6 +779,7 @@ rgba_from_u32_lit_comp(0x0000003f), rgba_from_u32_lit_comp(0xe5e5e5ff), rgba_from_u32_lit_comp(0x32b219ff), rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xb23219ff), rgba_from_u32_lit_comp(0xffffff7f), rgba_from_u32_lit_comp(0x3333337f), rgba_from_u32_lit_comp(0xffffff19), @@ -815,7 +816,6 @@ rgba_from_u32_lit_comp(0xffffff7f), rgba_from_u32_lit_comp(0x42474c7f), rgba_from_u32_lit_comp(0xffffff19), rgba_from_u32_lit_comp(0x3333337f), -rgba_from_u32_lit_comp(0x3333337f), rgba_from_u32_lit_comp(0xe5e5e5ff), rgba_from_u32_lit_comp(0xe5e5e5ff), rgba_from_u32_lit_comp(0xe5e5e5ff), @@ -868,6 +868,7 @@ rgba_from_u32_lit_comp(0x0000003f), rgba_from_u32_lit_comp(0xe5e5e5ff), rgba_from_u32_lit_comp(0x32b219ff), rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xb23219ff), rgba_from_u32_lit_comp(0xffffff7f), rgba_from_u32_lit_comp(0x3333337f), rgba_from_u32_lit_comp(0xffffff19), @@ -904,7 +905,6 @@ rgba_from_u32_lit_comp(0xffffff7f), rgba_from_u32_lit_comp(0x42474c7f), rgba_from_u32_lit_comp(0xffffff19), rgba_from_u32_lit_comp(0x3333337f), -rgba_from_u32_lit_comp(0x3333337f), rgba_from_u32_lit_comp(0xe5e5e5ff), rgba_from_u32_lit_comp(0xe5e5e5ff), rgba_from_u32_lit_comp(0xe5e5e5ff), @@ -957,6 +957,7 @@ rgba_from_u32_lit_comp(0x0000003f), rgba_from_u32_lit_comp(0xe5e5e5ff), rgba_from_u32_lit_comp(0x32b219ff), rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xb23219ff), rgba_from_u32_lit_comp(0xffffff7f), rgba_from_u32_lit_comp(0x3333337f), rgba_from_u32_lit_comp(0xffffff19), @@ -993,7 +994,6 @@ rgba_from_u32_lit_comp(0xffffff7f), rgba_from_u32_lit_comp(0x42474c7f), rgba_from_u32_lit_comp(0xffffff19), rgba_from_u32_lit_comp(0x3333337f), -rgba_from_u32_lit_comp(0x3333337f), rgba_from_u32_lit_comp(0xe5e5e5ff), rgba_from_u32_lit_comp(0xe5e5e5ff), rgba_from_u32_lit_comp(0xe5e5e5ff), @@ -1046,6 +1046,7 @@ rgba_from_u32_lit_comp(0x0000003f), rgba_from_u32_lit_comp(0xe5e5e5ff), rgba_from_u32_lit_comp(0x32b219ff), rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xb23219ff), rgba_from_u32_lit_comp(0xffffff7f), rgba_from_u32_lit_comp(0x3333337f), rgba_from_u32_lit_comp(0xffffff19), @@ -1082,7 +1083,6 @@ rgba_from_u32_lit_comp(0xffffff7f), rgba_from_u32_lit_comp(0x42474c7f), rgba_from_u32_lit_comp(0xffffff19), rgba_from_u32_lit_comp(0x3333337f), -rgba_from_u32_lit_comp(0x3333337f), rgba_from_u32_lit_comp(0xe5e5e5ff), rgba_from_u32_lit_comp(0xe5e5e5ff), rgba_from_u32_lit_comp(0xe5e5e5ff), @@ -1148,6 +1148,7 @@ str8_lit_comp("Disabled Overlay"), str8_lit_comp("Default Text"), str8_lit_comp("Default Text (Positive)"), str8_lit_comp("Default Text (Negative)"), +str8_lit_comp("Default Text (Neutral)"), str8_lit_comp("Default Text (Weak)"), str8_lit_comp("Default Background"), str8_lit_comp("Default Border"), @@ -1183,7 +1184,6 @@ str8_lit_comp("Tab Text (Inactive)"), str8_lit_comp("Tab Text (Inactive, Weak)"), str8_lit_comp("Tab Background (Inactive)"), str8_lit_comp("Tab Border (Inactive)"), -str8_lit_comp("Code Background"), str8_lit_comp("Code Background (Negative)"), str8_lit_comp("Code Line Numbers"), str8_lit_comp("Code Line Numbers (Inactive)"), @@ -1237,6 +1237,7 @@ str8_lit_comp("disabled_overlay"), str8_lit_comp("default_text"), str8_lit_comp("default_text_positive"), str8_lit_comp("default_text_negative"), +str8_lit_comp("default_text_neutral"), str8_lit_comp("default_text_weak"), str8_lit_comp("default_background"), str8_lit_comp("default_border"), @@ -1272,7 +1273,6 @@ str8_lit_comp("tab_inactive_text"), str8_lit_comp("tab_inactive_text_weak"), str8_lit_comp("tab_inactive_background"), str8_lit_comp("tab_inactive_border"), -str8_lit_comp("code_background"), str8_lit_comp("code_background_negative"), str8_lit_comp("code_line_numbers_active"), str8_lit_comp("code_line_numbers_inactive"), diff --git a/src/df/gfx/generated/df_gfx.meta.h b/src/df/gfx/generated/df_gfx.meta.h index 3a2795f4..8b3989bf 100644 --- a/src/df/gfx/generated/df_gfx.meta.h +++ b/src/df/gfx/generated/df_gfx.meta.h @@ -57,6 +57,7 @@ DF_ThemeColor_DisabledOverlay, DF_ThemeColor_DefaultText, DF_ThemeColor_DefaultTextPositive, DF_ThemeColor_DefaultTextNegative, +DF_ThemeColor_DefaultTextNeutral, DF_ThemeColor_DefaultTextWeak, DF_ThemeColor_DefaultBackground, DF_ThemeColor_DefaultBorder, @@ -92,7 +93,6 @@ DF_ThemeColor_TabInactiveText, DF_ThemeColor_TabInactiveTextWeak, DF_ThemeColor_TabInactiveBackground, DF_ThemeColor_TabInactiveBorder, -DF_ThemeColor_CodeBackground, DF_ThemeColor_CodeBackgroundNegative, DF_ThemeColor_CodeLineNumbersActive, DF_ThemeColor_CodeLineNumbersInactive, diff --git a/src/draw/draw.c b/src/draw/draw.c index 16f47342..33292251 100644 --- a/src/draw/draw.c +++ b/src/draw/draw.c @@ -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; @@ -469,9 +469,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 +505,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 +731,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); } diff --git a/src/draw/draw.h b/src/draw/draw.h index b3de754a..fbc12ca7 100644 --- a/src/draw/draw.h +++ b/src/draw/draw.h @@ -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 diff --git a/src/font_cache/font_cache.c b/src/font_cache/font_cache.c index 0f7ba96d..96d1a467 100644 --- a/src/font_cache/font_cache.c +++ b/src/font_cache/font_cache.c @@ -521,11 +521,12 @@ f_hash2style_from_tag_size(F_Tag tag, F32 size) //- 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), }; style_hash = f_little_hash_from_string(str8((U8 *)buffer, sizeof(buffer))); } @@ -682,7 +683,7 @@ 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 = fp_raster(scratch.arena, font_handle, floor_f32(size), FP_RasterMode_Sharp, piece_substring); // rjf: allocate portion of an atlas to upload the rasterization S16 chosen_atlas_num = 0; @@ -1022,10 +1023,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; diff --git a/src/font_provider/dwrite/font_provider_dwrite.c b/src/font_provider/dwrite/font_provider_dwrite.c index 0ed0b7fb..a108fe49 100644 --- a/src/font_provider/dwrite/font_provider_dwrite.c +++ b/src/font_provider/dwrite/font_provider_dwrite.c @@ -414,7 +414,7 @@ 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.advance = floor_f32(advance); result.height = bounding_box.bottom + 1.f; // rjf: fill atlas diff --git a/src/raddbg/raddbg_main.c b/src/raddbg/raddbg_main.c index 212666b1..024d0aa4 100644 --- a/src/raddbg/raddbg_main.c +++ b/src/raddbg/raddbg_main.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 "The RAD Debugger" #define OS_FEATURE_GRAPHICAL 1 diff --git a/src/rdi_breakpad_from_pdb/rdi_breakpad_from_pdb_main.c b/src/rdi_breakpad_from_pdb/rdi_breakpad_from_pdb_main.c index 9a32b06e..d776c7c5 100644 --- a/src/rdi_breakpad_from_pdb/rdi_breakpad_from_pdb_main.c +++ b/src/rdi_breakpad_from_pdb/rdi_breakpad_from_pdb_main.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 diff --git a/src/rdi_dump/rdi_dump_main.c b/src/rdi_dump/rdi_dump_main.c index bb4ae241..7f83e9e8 100644 --- a/src/rdi_dump/rdi_dump_main.c +++ b/src/rdi_dump/rdi_dump_main.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_dump" #define BUILD_CONSOLE_INTERFACE 1 diff --git a/src/rdi_from_dwarf/rdi_from_dwarf.c b/src/rdi_from_dwarf/rdi_from_dwarf.c index f976b225..473313d2 100644 --- a/src/rdi_from_dwarf/rdi_from_dwarf.c +++ b/src/rdi_from_dwarf/rdi_from_dwarf.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_from_dwarf" #define BUILD_CONSOLE_INTERFACE 1 diff --git a/src/rdi_from_pdb/rdi_from_pdb_main.c b/src/rdi_from_pdb/rdi_from_pdb_main.c index 50fd0a88..ed757af4 100644 --- a/src/rdi_from_pdb/rdi_from_pdb_main.c +++ b/src/rdi_from_pdb/rdi_from_pdb_main.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_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: [optional] Specifies the path of the executable file for which the\n"); diff --git a/src/type_graph/type_graph.c b/src/type_graph/type_graph.c index 21fb143c..a8df878c 100644 --- a/src/type_graph/type_graph.c +++ b/src/type_graph/type_graph.c @@ -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; diff --git a/src/ui/ui_basic_widgets.c b/src/ui/ui_basic_widgets.c index 91e8c6c7..4d9fec5d 100644 --- a/src/ui/ui_basic_widgets.c +++ b/src/ui/ui_basic_widgets.c @@ -9,11 +9,25 @@ 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_string(0, str8_lit("")); + UI_Box *box = ui_build_box_from_key(0, ui_key_zero()); UI_Signal interact = ui_signal_from_box(box); return interact; } +internal void +ui_divider(UI_Size size) +{ + UI_Box *parent = ui_top_parent(); + ui_set_next_pref_size(parent->child_layout_axis, size); + 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) { diff --git a/src/ui/ui_basic_widgets.h b/src/ui/ui_basic_widgets.h index 98a571a0..befcb4cc 100644 --- a/src/ui/ui_basic_widgets.h +++ b/src/ui/ui_basic_widgets.h @@ -69,6 +69,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); diff --git a/src/ui/ui_core.c b/src/ui/ui_core.c index d3ee58c8..c65f1f2b 100644 --- a/src/ui/ui_core.c +++ b/src/ui/ui_core.c @@ -963,26 +963,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(); @@ -1822,11 +1802,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,9 +1822,9 @@ 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_tooltip_end_base(); } @@ -1879,8 +1859,12 @@ 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); + 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; @@ -1892,17 +1876,20 @@ ui_begin_ctx_menu(UI_Key key) 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->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_focus_active(); ui_pop_focus_hot(); ui_pop_pref_width(); @@ -2207,6 +2194,7 @@ ui_build_box_from_key(UI_BoxFlags flags, UI_Key key) 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; @@ -2296,7 +2284,7 @@ ui_box_equip_display_string(UI_Box *box, String8 string) String8 display_string = ui_box_display_string(box); 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) { @@ -2308,16 +2296,16 @@ ui_box_equip_display_string(UI_Box *box, String8 string) if(fpcp_pos < display_string.size) { 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, 4.f, 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->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); } @@ -2325,11 +2313,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 diff --git a/src/ui/ui_core.h b/src/ui/ui_core.h index 61e6ab59..2df508bd 100644 --- a/src/ui/ui_core.h +++ b/src/ui/ui_core.h @@ -373,6 +373,7 @@ struct UI_Box F_Tag font; F32 font_size; F32 tab_size; + F_RunFlags run_flags; F32 corner_radii[Corner_COUNT]; F32 blur_size; F32 transparency; @@ -548,6 +549,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; @@ -564,7 +568,6 @@ struct UI_State UI_EventList *events; Vec2F32 mouse; F32 animation_dt; - B32 external_focus_commit; //- rjf: user interaction state UI_Key hot_box_key; @@ -773,7 +776,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); From 6ac870dac0c66d6be52596348376adda955e4c6a Mon Sep 17 00:00:00 2001 From: Ryan Fleury Date: Sat, 22 Jun 2024 15:58:40 -0700 Subject: [PATCH 07/47] improvements in text layout, focus visualization, smooth text rasterization for icons; checkpoint in ui visuals pass --- src/df/gfx/df_gfx.c | 129 ++++++++++-------- src/df/gfx/df_gfx.h | 3 + src/df/gfx/df_views.c | 5 +- src/font_cache/font_cache.c | 13 +- src/font_cache/font_cache.h | 3 +- .../dwrite/font_provider_dwrite.c | 74 +++++++--- .../dwrite/font_provider_dwrite.h | 15 +- src/font_provider/font_provider.h | 2 +- src/ui/ui_basic_widgets.c | 2 +- src/ui/ui_core.c | 11 +- src/ui/ui_core.h | 21 +-- 11 files changed, 179 insertions(+), 99 deletions(-) diff --git a/src/df/gfx/df_gfx.c b/src/df/gfx/df_gfx.c index 31ef599a..b5ca9379 100644 --- a/src/df/gfx/df_gfx.c +++ b/src/df/gfx/df_gfx.c @@ -4339,14 +4339,21 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) UI_BlurSize(10*df_gfx_state->confirm_t) UI_Palette(palette) { - bg_box = ui_build_box_from_stringf(UI_BoxFlag_FixedSize|UI_BoxFlag_Floating|UI_BoxFlag_Clickable|UI_BoxFlag_Scroll|UI_BoxFlag_DefaultFocusNav|UI_BoxFlag_DrawBackgroundBlur|UI_BoxFlag_DrawBackground, "###confirm_popup_%p", ws); + bg_box = ui_build_box_from_stringf(UI_BoxFlag_FixedSize| + UI_BoxFlag_Floating| + UI_BoxFlag_Clickable| + UI_BoxFlag_Scroll| + UI_BoxFlag_DefaultFocusNav| + UI_BoxFlag_DisableFocusOverlay| + UI_BoxFlag_DrawBackgroundBlur| + UI_BoxFlag_DrawBackground, "###confirm_popup_%p", ws); } if(df_gfx_state->confirm_active) UI_Parent(bg_box) UI_Transparency(1-df_gfx_state->confirm_t) { ui_ctx_menu_close(); UI_WidthFill UI_PrefHeight(ui_children_sum(1.f)) UI_Column UI_Padding(ui_pct(1, 0)) { - UI_FontSize(ui_top_font_size()*2.f) UI_PrefHeight(ui_em(3.f, 1.f)) ui_label(df_gfx_state->confirm_title); + UI_RunFlags(F_RunFlag_Smooth) UI_FontSize(ui_top_font_size()*2.f) UI_PrefHeight(ui_em(3.f, 1.f)) ui_label(df_gfx_state->confirm_title); UI_PrefHeight(ui_em(3.f, 1.f)) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_label(df_gfx_state->confirm_msg); ui_spacer(ui_em(1.5f, 1.f)); UI_Row UI_Padding(ui_pct(1.f, 0.f)) UI_WidthFill UI_PrefHeight(ui_em(5.f, 1.f)) @@ -4597,8 +4604,8 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) F32 row_height_px = floor_f32(ui_top_font_size()*2.5f); ui_set_next_fixed_x(autocomp_root_box->rect.x0); ui_set_next_fixed_y(autocomp_root_box->rect.y1); - ui_set_next_pref_width(ui_em(25.f, 1.f)); - ui_set_next_pref_height(ui_px(row_height_px*ws->autocomp_num_visible_rows_t, 1.f)); + ui_set_next_pref_width(ui_em(30.f, 1.f)); + ui_set_next_pref_height(ui_px(row_height_px*ws->autocomp_num_visible_rows_t + ui_top_font_size()*2.f, 1.f)); ui_set_next_child_layout_axis(Axis2_Y); ui_set_next_corner_radius_01(ui_top_font_size()*0.25f); ui_set_next_corner_radius_11(ui_top_font_size()*0.25f); @@ -4607,15 +4614,30 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) UI_Squish(0.25f-0.25f*ws->autocomp_open_t) UI_Transparency(1.f-ws->autocomp_open_t) { - autocomp_box = ui_build_box_from_stringf(UI_BoxFlag_DefaultFocusNavY|UI_BoxFlag_Clickable|UI_BoxFlag_Clip|UI_BoxFlag_RoundChildrenByParent|UI_BoxFlag_DrawBorder|UI_BoxFlag_DrawBackgroundBlur|UI_BoxFlag_DrawDropShadow|UI_BoxFlag_DrawBackground, "autocomp_box"); + autocomp_box = ui_build_box_from_stringf(UI_BoxFlag_DefaultFocusNavY| + UI_BoxFlag_Clickable| + UI_BoxFlag_Clip| + UI_BoxFlag_RoundChildrenByParent| + UI_BoxFlag_DisableFocusOverlay| + UI_BoxFlag_DrawBorder| + UI_BoxFlag_DrawBackgroundBlur| + UI_BoxFlag_DrawDropShadow| + UI_BoxFlag_DrawBackground, + "autocomp_box"); if(ws->autocomp_query_dirty) { ws->autocomp_query_dirty = 0; autocomp_box->default_nav_focus_hot_key = autocomp_box->default_nav_focus_active_key = autocomp_box->default_nav_focus_next_hot_key = autocomp_box->default_nav_focus_next_active_key = ui_key_zero(); } } - UI_Parent(autocomp_box) UI_WidthFill UI_PrefHeight(ui_px(row_height_px, 1.f)) UI_Font(df_font_from_slot(DF_FontSlot_Code)) UI_HoverCursor(OS_Cursor_HandPoint) + UI_Parent(autocomp_box) + UI_WidthFill + UI_PrefHeight(ui_px(row_height_px, 1.f)) + UI_Font(df_font_from_slot(DF_FontSlot_Code)) + UI_HoverCursor(OS_Cursor_HandPoint) UI_Focus(UI_FocusKind_Null) + DF_Palette(DF_PaletteCode_ImplicitContents) + UI_Padding(ui_em(1.f, 1.f)) { for(U64 idx = 0; idx < item_array.count; idx += 1) { @@ -4684,11 +4706,17 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) UI_WidthFill UI_NamedRow(str8_lit("###menu_bar")) { //- rjf: icon - UI_Padding(ui_em(0.5f, 1.f)) UI_PrefWidth(ui_px(dim_2f32(top_bar_rect).y, 1.f)) + UI_Padding(ui_em(0.5f, 1.f)) { - R_Handle texture = df_gfx_state->icon_texture; - Vec2S32 texture_dim = r_size_from_tex2d(texture); - ui_image(texture, R_Tex2DSampleKind_Linear, r2f32p(0, 0, texture_dim.x, texture_dim.y), v4f32(1, 1, 1, 1), 0, str8_lit("")); + UI_PrefWidth(ui_px(dim_2f32(top_bar_rect).y - ui_top_font_size()*0.8f, 1.f)) + UI_Column + UI_Padding(ui_em(0.4f, 1.f)) + UI_HeightFill + { + R_Handle texture = df_gfx_state->icon_texture; + Vec2S32 texture_dim = r_size_from_tex2d(texture); + ui_image(texture, R_Tex2DSampleKind_Linear, r2f32p(0, 0, texture_dim.x, texture_dim.y), v4f32(1, 1, 1, 1), 0, str8_lit("")); + } } //- rjf: menu items @@ -5127,7 +5155,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) if(can_play || !have_targets || processes.count == 0) UI_TextAlignment(UI_TextAlign_Center) UI_Flags((can_play ? 0 : UI_BoxFlag_Disabled)) - DF_Palette(DF_PaletteCode_DefaultPositive) + DF_Palette(DF_PaletteCode_MenuBarPositive) { UI_Signal sig = ui_button(df_g_icon_kind_text_table[DF_IconKind_Play]); os_window_push_custom_title_bar_client_area(ws->os, sig.box->rect); @@ -5168,7 +5196,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) //- rjf: restart button if(!can_play && processes.count != 0) UI_TextAlignment(UI_TextAlign_Center) - DF_Palette(DF_PaletteCode_DefaultPositive) + DF_Palette(DF_PaletteCode_MenuBarPositive) { UI_Signal sig = ui_button(df_g_icon_kind_text_table[DF_IconKind_Redo]); os_window_push_custom_title_bar_client_area(ws->os, sig.box->rect); @@ -5203,7 +5231,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) //- rjf: pause button UI_TextAlignment(UI_TextAlign_Center) UI_Flags(can_pause ? 0 : UI_BoxFlag_Disabled) - DF_Palette(DF_PaletteCode_DefaultNeutral) + DF_Palette(DF_PaletteCode_MenuBarNeutral) { UI_Signal sig = ui_button(df_g_icon_kind_text_table[DF_IconKind_Pause]); os_window_push_custom_title_bar_client_area(ws->os, sig.box->rect); @@ -5230,7 +5258,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) //- rjf: stop button UI_TextAlignment(UI_TextAlign_Center) UI_Flags(can_stop ? 0 : UI_BoxFlag_Disabled) - DF_Palette(DF_PaletteCode_DefaultNegative) + DF_Palette(DF_PaletteCode_MenuBarNegative) { UI_Signal sig = {0}; { @@ -5736,6 +5764,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) UI_BoxFlag_AllowOverflow| UI_BoxFlag_Clickable| UI_BoxFlag_Clip| + UI_BoxFlag_DisableFocusOverlay| UI_BoxFlag_DrawBorder| UI_BoxFlag_DrawBackground| UI_BoxFlag_DrawBackgroundBlur| @@ -5984,6 +6013,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) UI_BoxFlag_DrawBackground| UI_BoxFlag_DrawBackgroundBlur| UI_BoxFlag_DrawDropShadow| + UI_BoxFlag_DisableFocusOverlay| UI_BoxFlag_Clip| UI_BoxFlag_AllowOverflowY| UI_BoxFlag_ViewScroll| @@ -6808,7 +6838,8 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) panel_box = ui_build_box_from_key(UI_BoxFlag_MouseClickable| UI_BoxFlag_Clip| UI_BoxFlag_DrawBorder| - ((ws->focused_panel != panel)*UI_BoxFlag_DisableFocusViz)| + UI_BoxFlag_DisableFocusOverlay| + ((ws->focused_panel != panel)*UI_BoxFlag_DisableFocusBorder)| ((ws->focused_panel != panel)*UI_BoxFlag_DrawOverlay), panel_key); } @@ -7076,7 +7107,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) if((!view_is_selected && panel->tab_side == Side_Min) || (view_is_selected && panel->tab_side == Side_Max)) { - ui_spacer(ui_px(tab_bar_rv_diff, 1.f)); + ui_spacer(ui_px(1.f, 1.f)); } else { @@ -7157,6 +7188,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) UI_Font(df_font_from_slot(DF_FontSlot_Icons)) UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Icons)*0.75f) UI_RunFlags(F_RunFlag_Smooth) + UI_Flags(UI_BoxFlag_DrawTextWeak) UI_CornerRadius00(0) UI_CornerRadius01(0) { @@ -7228,10 +7260,11 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) ui_spacer(ui_px(tab_bar_rv_diff/2.f, 1.f)); UI_CornerRadius(tab_bar_vheight/2.f) UI_Font(df_font_from_slot(DF_FontSlot_Icons)) - UI_FontSize(ui_top_font_size()*0.75f) + UI_FontSize(ui_top_font_size()) UI_RunFlags(F_RunFlag_Smooth) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_HoverCursor(OS_Cursor_HandPoint) + DF_Palette(DF_PaletteCode_ImplicitContents) { UI_Box *add_new_box = ui_build_box_from_stringf(UI_BoxFlag_DrawBackground| UI_BoxFlag_DrawText| @@ -7906,30 +7939,17 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) } } - // rjf: draw focus hot vis - if(b->flags & UI_BoxFlag_Clickable && !(b->flags & UI_BoxFlag_DisableFocusViz) && b->focus_hot_t > 0.01f) + // rjf: draw focus overlay + if(b->flags & UI_BoxFlag_Clickable && !(b->flags & UI_BoxFlag_DisableFocusOverlay) && b->focus_hot_t > 0.01f) { - Vec4F32 color = df_rgba_from_theme_color(DF_ThemeColor_Highlight0); - F32 size_factor = 1 - Clamp(0, dim_2f32(b->rect).y / 100.f, 1); - if(b->flags & UI_BoxFlag_RequireFocusBackground) - { - color.w *= 0.2f + b->focus_hot_t * 0.3f * size_factor; - } - else - { - color.w *= b->focus_hot_t * 0.5f * size_factor; - } - R_Rect2DInst *inst = d_rect(pad_2f32(r2f32p(b->rect.x0, - b->rect.y0, - b->rect.x0 + (b->rect.x1 - b->rect.x0) * 1.f, - b->rect.y1), - 1.f), - color, 4.f, 0, 1.f); + Vec4F32 color = df_rgba_from_theme_color(DF_ThemeColor_FocusActive); + color.w *= 0.2f*b->focus_hot_t; + R_Rect2DInst *inst = d_rect(b->rect, color, 0, 0, 1.f); MemoryCopyArray(inst->corner_radii, b->corner_radii); } - // rjf: draw focus active vis - if(b->flags & UI_BoxFlag_Clickable && !(b->flags & UI_BoxFlag_DisableFocusViz) && b->focus_active_t > 0.01f) + // rjf: draw focus border + if(b->flags & UI_BoxFlag_Clickable && !(b->flags & UI_BoxFlag_DisableFocusBorder) && b->focus_active_t > 0.01f) { Vec4F32 color = df_rgba_from_theme_color(DF_ThemeColor_FocusActive); color.w *= b->focus_active_t; @@ -7937,15 +7957,6 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) MemoryCopyArray(inst->corner_radii, b->corner_radii); } - // rjf: draw focus active disabled vis - if(b->flags & UI_BoxFlag_Clickable && !(b->flags & UI_BoxFlag_DisableFocusViz) && b->focus_active_disabled_t > 0.01f) - { - Vec4F32 color = df_rgba_from_theme_color(DF_ThemeColor_FocusInactive); - color.w *= b->focus_active_disabled_t; - R_Rect2DInst *inst = d_rect(pad_2f32(b->rect, 1.f), color, 0, 1.f, 1.f); - MemoryCopyArray(inst->corner_radii, b->corner_radii); - } - // rjf: disabled overlay if(b->disabled_t >= 0.005f) { @@ -9827,19 +9838,15 @@ df_cmd_binding_button(DF_CmdSpec *spec) ui_set_next_palette(palette); UI_Box *box = ui_build_box_from_stringf(UI_BoxFlag_DrawText| UI_BoxFlag_Clickable| - UI_BoxFlag_DrawActiveEffects, + UI_BoxFlag_DrawActiveEffects| + UI_BoxFlag_DrawHotEffects| + UI_BoxFlag_DrawBorder| + UI_BoxFlag_DrawBackground, "%S###bind_btn_%p", keybinding_str, spec); //- rjf: interaction UI_Signal sig = ui_signal_from_box(box); { - // rjf: hover => visualize clickability - if(ui_hovering(sig)) - { - box->flags |= UI_BoxFlag_DrawBorder; - box->flags |= UI_BoxFlag_DrawBackground; - } - // rjf: click => toggle activity if(!df_gfx_state->bind_change_active && ui_clicked(sig)) { @@ -10577,7 +10584,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ ui_set_next_child_layout_axis(Axis2_X); ui_set_next_pref_width(ui_px(params->line_text_max_width_px, 1)); ui_set_next_pref_height(ui_children_sum(1)); - top_container_box = ui_build_box_from_string(UI_BoxFlag_DisableFocusViz|UI_BoxFlag_DrawBorder, string); + top_container_box = ui_build_box_from_string(UI_BoxFlag_DisableFocusEffects|UI_BoxFlag_DrawBorder, string); clipped_top_container_rect = top_container_box->rect; for(UI_Box *b = top_container_box; !ui_box_is_nil(b); b = b->parent) { @@ -14173,6 +14180,18 @@ df_gfx_begin_frame(Arena *arena, DF_CmdList *cmds) df_gfx_state->cfg_palettes[DF_PaletteCode_MenuBar].text = current->colors[DF_ThemeColor_MenuBarText]; df_gfx_state->cfg_palettes[DF_PaletteCode_MenuBar].text_weak = current->colors[DF_ThemeColor_MenuBarTextWeak]; df_gfx_state->cfg_palettes[DF_PaletteCode_MenuBar].border = current->colors[DF_ThemeColor_MenuBarBorder]; + df_gfx_state->cfg_palettes[DF_PaletteCode_MenuBarPositive].background = current->colors[DF_ThemeColor_MenuBarBackground]; + df_gfx_state->cfg_palettes[DF_PaletteCode_MenuBarPositive].text = current->colors[DF_ThemeColor_MenuBarTextPositive]; + df_gfx_state->cfg_palettes[DF_PaletteCode_MenuBarPositive].text_weak = current->colors[DF_ThemeColor_MenuBarTextWeak]; + df_gfx_state->cfg_palettes[DF_PaletteCode_MenuBarPositive].border = current->colors[DF_ThemeColor_MenuBarBorder]; + df_gfx_state->cfg_palettes[DF_PaletteCode_MenuBarNegative].background = current->colors[DF_ThemeColor_MenuBarBackground]; + df_gfx_state->cfg_palettes[DF_PaletteCode_MenuBarNegative].text = current->colors[DF_ThemeColor_MenuBarTextNegative]; + df_gfx_state->cfg_palettes[DF_PaletteCode_MenuBarNegative].text_weak = current->colors[DF_ThemeColor_MenuBarTextWeak]; + df_gfx_state->cfg_palettes[DF_PaletteCode_MenuBarNegative].border = current->colors[DF_ThemeColor_MenuBarBorder]; + df_gfx_state->cfg_palettes[DF_PaletteCode_MenuBarNeutral].background = current->colors[DF_ThemeColor_MenuBarBackground]; + df_gfx_state->cfg_palettes[DF_PaletteCode_MenuBarNeutral].text = current->colors[DF_ThemeColor_DefaultTextNeutral]; + df_gfx_state->cfg_palettes[DF_PaletteCode_MenuBarNeutral].text_weak = current->colors[DF_ThemeColor_MenuBarTextWeak]; + df_gfx_state->cfg_palettes[DF_PaletteCode_MenuBarNeutral].border = current->colors[DF_ThemeColor_MenuBarBorder]; df_gfx_state->cfg_palettes[DF_PaletteCode_TabActive].background = current->colors[DF_ThemeColor_TabActiveBackground]; df_gfx_state->cfg_palettes[DF_PaletteCode_TabActive].text = current->colors[DF_ThemeColor_TabActiveText]; df_gfx_state->cfg_palettes[DF_PaletteCode_TabActive].text_weak = current->colors[DF_ThemeColor_TabActiveTextWeak]; diff --git a/src/df/gfx/df_gfx.h b/src/df/gfx/df_gfx.h index 8f08ee50..379dc1e4 100644 --- a/src/df/gfx/df_gfx.h +++ b/src/df/gfx/df_gfx.h @@ -386,6 +386,9 @@ typedef enum DF_PaletteCode DF_PaletteCode_SpecialNegative, DF_PaletteCode_SpecialNeutral, DF_PaletteCode_MenuBar, + DF_PaletteCode_MenuBarPositive, + DF_PaletteCode_MenuBarNegative, + DF_PaletteCode_MenuBarNeutral, DF_PaletteCode_TabActive, DF_PaletteCode_TabInactive, DF_PaletteCode_Code, diff --git a/src/df/gfx/df_views.c b/src/df/gfx/df_views.c index 310df2ba..ffd95093 100644 --- a/src/df/gfx/df_views.c +++ b/src/df/gfx/df_views.c @@ -1658,7 +1658,10 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS ui_set_next_flags(disabled_flags); ui_set_next_pref_width(ui_pct(1, 0)); ui_set_next_pref_height(ui_px(scroll_list_params.row_height_px*row->size_in_rows, 1.f)); - UI_Box *row_box = ui_build_box_from_stringf(UI_BoxFlag_DrawSideBottom|UI_BoxFlag_RequireFocusBackground|UI_BoxFlag_Clickable, "row_%I64x", row_hash); + ui_set_next_focus_hot(row_selected ? UI_FocusKind_On : UI_FocusKind_Off); + UI_Box *row_box = ui_build_box_from_stringf(UI_BoxFlag_DrawSideBottom|UI_BoxFlag_Clickable, "row_%I64x", row_hash); + ui_ts_vector_idx += 1; + ui_ts_cell_idx = 0; //////////////////////// //- rjf: canvas row -> fill with canvas ui build diff --git a/src/font_cache/font_cache.c b/src/font_cache/font_cache.c index 96d1a467..5832e05e 100644 --- a/src/font_cache/font_cache.c +++ b/src/font_cache/font_cache.c @@ -516,7 +516,7 @@ 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}; @@ -527,6 +527,7 @@ f_hash2style_from_tag_size(F_Tag tag, F32 size) tag.u64[0], tag.u64[1], *(U64 *)(&size_f64), + (U64)flags, }; style_hash = f_little_hash_from_string(str8((U8 *)buffer, sizeof(buffer))); } @@ -571,11 +572,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; @@ -683,7 +685,7 @@ 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, floor_f32(size), FP_RasterMode_Sharp, piece_substring); + FP_RasterResult 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; @@ -759,6 +761,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; @@ -811,7 +814,8 @@ 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; } } } @@ -829,6 +833,7 @@ 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.ascent = hash2style_node->ascent; run.descent = hash2style_node->descent; } diff --git a/src/font_cache/font_cache.h b/src/font_cache/font_cache.h index 0e4ab173..8cb72523 100644 --- a/src/font_cache/font_cache.h +++ b/src/font_cache/font_cache.h @@ -102,6 +102,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 +248,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); diff --git a/src/font_provider/dwrite/font_provider_dwrite.c b/src/font_provider/dwrite/font_provider_dwrite.c index a108fe49..79ead99b 100644 --- a/src/font_provider/dwrite/font_provider_dwrite.c +++ b/src/font_provider/dwrite/font_provider_dwrite.c @@ -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, + 1.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, + 1.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, + 1.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 @@ -415,7 +453,7 @@ fp_raster(Arena *arena, FP_Handle font_handle, F32 size, FP_RasterMode mode, Str result.atlas_dim = atlas_dim; result.atlas = push_array_no_zero(arena, U8, atlas_dim.x*atlas_dim.y*4); result.advance = floor_f32(advance); - result.height = bounding_box.bottom + 1.f; + result.bounding_box = r2s16p(bounding_box.left, bounding_box.top, bounding_box.right, bounding_box.bottom); // rjf: fill atlas { diff --git a/src/font_provider/dwrite/font_provider_dwrite.h b/src/font_provider/dwrite/font_provider_dwrite.h index c0b599b6..cd4a75f2 100644 --- a/src/font_provider/dwrite/font_provider_dwrite.h +++ b/src/font_provider/dwrite/font_provider_dwrite.h @@ -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]; diff --git a/src/font_provider/font_provider.h b/src/font_provider/font_provider.h index 9abf14c1..5377b453 100644 --- a/src/font_provider/font_provider.h +++ b/src/font_provider/font_provider.h @@ -39,7 +39,7 @@ struct FP_RasterResult Vec2S16 atlas_dim; void *atlas; F32 advance; - S16 height; + Rng2S16 bounding_box; }; //////////////////////////////// diff --git a/src/ui/ui_basic_widgets.c b/src/ui/ui_basic_widgets.c index 4d9fec5d..e2b72ba6 100644 --- a/src/ui/ui_basic_widgets.c +++ b/src/ui/ui_basic_widgets.c @@ -31,7 +31,7 @@ ui_divider(UI_Size size) 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; diff --git a/src/ui/ui_core.c b/src/ui/ui_core.c index c65f1f2b..d4a90085 100644 --- a/src/ui/ui_core.c +++ b/src/ui/ui_core.c @@ -1870,6 +1870,7 @@ ui_begin_ctx_menu(UI_Key key) 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; @@ -2376,7 +2377,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: @@ -2386,14 +2387,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; } diff --git a/src/ui/ui_core.h b/src/ui/ui_core.h index 2df508bd..cdf4f246 100644 --- a/src/ui/ui_core.h +++ b/src/ui/ui_core.h @@ -323,21 +323,22 @@ typedef U64 UI_BoxFlags; # 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_DisableFocusViz (UI_BoxFlags)(1ull<<47) -# define UI_BoxFlag_RequireFocusBackground (UI_BoxFlags)(1ull<<48) +# 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; From db5a7d4be2e37b04ae5a347235211a6751095a24 Mon Sep 17 00:00:00 2001 From: Ryan Fleury Date: Sat, 22 Jun 2024 16:12:53 -0700 Subject: [PATCH 08/47] adjust title bar --- src/df/gfx/df_gfx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/df/gfx/df_gfx.c b/src/df/gfx/df_gfx.c index b5ca9379..019d5992 100644 --- a/src/df/gfx/df_gfx.c +++ b/src/df/gfx/df_gfx.c @@ -5474,13 +5474,13 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) UI_Signal max_sig = {0}; UI_Signal cls_sig = {0}; Vec2F32 bar_dim = dim_2f32(top_bar_rect); - F32 button_dim = bar_dim.y; + F32 button_dim = floor_f32(bar_dim.y); UI_PrefWidth(ui_px(button_dim, 1.f)) { min_sig = df_icon_buttonf(DF_IconKind_Minus, 0, "##minimize"); max_sig = df_icon_buttonf(DF_IconKind_Window, 0, "##maximize"); } - UI_PrefWidth(ui_px(button_dim*2, 1.f)) + UI_PrefWidth(ui_px(button_dim, 1.f)) DF_Palette(DF_PaletteCode_SpecialNegative) { cls_sig = df_icon_buttonf(DF_IconKind_X, 0, "##close"); From f9abb397f332d130e727a02cf2f8a64e3c67ab3f Mon Sep 17 00:00:00 2001 From: Ryan Fleury Date: Sat, 22 Jun 2024 20:19:24 -0700 Subject: [PATCH 09/47] adjust px offset -> byte offset path for new text measuring fixes --- src/font_cache/font_cache.c | 37 +++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/src/font_cache/font_cache.c b/src/font_cache/font_cache.c index 5832e05e..3c6bb50a 100644 --- a/src/font_cache/font_cache.c +++ b/src/font_cache/font_cache.c @@ -685,7 +685,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, floor_f32(size), (flags & F_RunFlag_Smooth) ? FP_RasterMode_Smooth : 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; @@ -816,6 +820,7 @@ f_push_run_from_string(Arena *arena, F_Tag tag, F32 size, F32 base_align_px, F32 dim.x += piece->advance; 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); } } } @@ -993,29 +998,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; } //////////////////////////////// From 16863b1f5a68e113c30ba491fc2885571e9e0464 Mon Sep 17 00:00:00 2001 From: Ryan Fleury Date: Sat, 22 Jun 2024 20:29:38 -0700 Subject: [PATCH 10/47] fix run-list size calculation, accounting for advance vs. end pad --- src/draw/draw.c | 5 +++++ src/font_cache/font_cache.c | 1 + src/font_cache/font_cache.h | 1 + 3 files changed, 7 insertions(+) diff --git a/src/draw/draw.c b/src/draw/draw.c index 33292251..d9ae24d6 100644 --- a/src/draw/draw.c +++ b/src/draw/draw.c @@ -104,6 +104,11 @@ d_fancy_run_list_from_fancy_string_list(Arena *arena, F32 tab_size_px, F_RunFlag 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; diff --git a/src/font_cache/font_cache.c b/src/font_cache/font_cache.c index 3c6bb50a..aacbcddd 100644 --- a/src/font_cache/font_cache.c +++ b/src/font_cache/font_cache.c @@ -839,6 +839,7 @@ f_push_run_from_string(Arena *arena, F_Tag tag, F32 size, F32 base_align_px, F32 } 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; } diff --git a/src/font_cache/font_cache.h b/src/font_cache/font_cache.h index 8cb72523..c2042676 100644 --- a/src/font_cache/font_cache.h +++ b/src/font_cache/font_cache.h @@ -71,6 +71,7 @@ struct F_Run { F_PieceArray pieces; Vec2F32 dim; + F32 end_pad; F32 ascent; F32 descent; }; From 4d2b524400c976d9a01e0c2907cbadb3823a8682 Mon Sep 17 00:00:00 2001 From: Ryan Fleury Date: Sun, 23 Jun 2024 23:21:18 -0700 Subject: [PATCH 11/47] notes, ui pass tweaks --- src/df/core/df_core.mdesk | 8 ++++---- src/df/core/generated/df_core.meta.c | 8 ++++---- src/df/gfx/df_gfx.c | 9 ++++----- src/raddbg/raddbg.h | 9 ++++----- 4 files changed, 16 insertions(+), 18 deletions(-) diff --git a/src/df/core/df_core.mdesk b/src/df/core/df_core.mdesk index 8197011b..2a105c05 100644 --- a/src/df/core/df_core.mdesk +++ b/src/df/core/df_core.mdesk @@ -154,9 +154,9 @@ DF_CoreCmdTable:// | | | {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." "" } @@ -382,7 +382,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." "" } diff --git a/src/df/core/generated/df_core.meta.c b/src/df/core/generated/df_core.meta.c index 2d769713..ebfdd8b0 100644 --- a/src/df/core/generated/df_core.meta.c +++ b/src/df/core/generated/df_core.meta.c @@ -249,9 +249,9 @@ DF_CmdSpecInfo df_g_core_cmd_kind_spec_info_table[220] = { 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}, @@ -411,7 +411,7 @@ DF_CmdSpecInfo df_g_core_cmd_kind_spec_info_table[220] = { 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}, diff --git a/src/df/gfx/df_gfx.c b/src/df/gfx/df_gfx.c index 019d5992..3b64b061 100644 --- a/src/df/gfx/df_gfx.c +++ b/src/df/gfx/df_gfx.c @@ -7258,7 +7258,8 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) UI_Column { ui_spacer(ui_px(tab_bar_rv_diff/2.f, 1.f)); - UI_CornerRadius(tab_bar_vheight/2.f) + UI_CornerRadius00(corner_radius) + UI_CornerRadius10(corner_radius) UI_Font(df_font_from_slot(DF_FontSlot_Icons)) UI_FontSize(ui_top_font_size()) UI_RunFlags(F_RunFlag_Smooth) @@ -12543,10 +12544,8 @@ df_fancy_string_list_from_code_string(Arena *arena, F32 alpha, B32 indirection_s }break; case TXT_TokenKind_Numeric: { - Vec4F32 token_color_rgba_alt = token_color_rgba; - token_color_rgba_alt.x *= 0.7f; - token_color_rgba_alt.y *= 0.7f; - token_color_rgba_alt.z *= 0.7f; + Vec4F32 token_color_rgba_alt = df_rgba_from_theme_color(DF_ThemeColor_CodeNumericAltDigitGroup); + token_color_rgba_alt.w *= alpha; F32 font_size = ui_top_font_size() * (1.f - !!indirection_size_change*(indirection_counter/10.f)); // rjf: unpack string diff --git a/src/raddbg/raddbg.h b/src/raddbg/raddbg.h index e8535ad1..20798205 100644 --- a/src/raddbg/raddbg.h +++ b/src/raddbg/raddbg.h @@ -26,11 +26,6 @@ // threads you haven't? Or, there could even be a debugger-specific API // that you use to tag them. Just some way that would make it easier to // focus on your own threads. -// -// [ ] 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? //////////////////////////////// //~ rjf: Hot, High Priority Tasks (Complete Unusability, Crashes, Fire-Worthy) @@ -384,6 +379,10 @@ // [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? #ifndef RADDBG_H #define RADDBG_H From 6d75d6b63b33200d624fb466e65656208ed9fe6e Mon Sep 17 00:00:00 2001 From: Ryan Fleury Date: Mon, 24 Jun 2024 11:59:19 -0700 Subject: [PATCH 12/47] simplification/consolidation pass over theme colors --- src/df/gfx/df_gfx.c | 231 +++++----- src/df/gfx/df_gfx.h | 25 +- src/df/gfx/df_gfx.mdesk | 95 ++--- src/df/gfx/df_view_rules.c | 2 +- src/df/gfx/df_views.c | 50 ++- src/df/gfx/generated/df_gfx.meta.c | 659 +++++++++++++---------------- src/df/gfx/generated/df_gfx.meta.h | 101 ++--- 7 files changed, 520 insertions(+), 643 deletions(-) diff --git a/src/df/gfx/df_gfx.c b/src/df/gfx/df_gfx.c index 3b64b061..7797416c 100644 --- a/src/df/gfx/df_gfx.c +++ b/src/df/gfx/df_gfx.c @@ -3456,7 +3456,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) ui_push_font_size(main_font_size); ui_push_pref_width(ui_em(20.f, 1)); ui_push_pref_height(ui_em(2.75f, 1.f)); - ui_push_palette(df_palette_from_code(DF_PaletteCode_Default)); + ui_push_palette(df_palette_from_code(DF_PaletteCode_Base)); ui_push_blur_size(10.f); } @@ -3502,7 +3502,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) UI_Size main_width = ui_top_pref_width(); UI_Size main_height = ui_top_pref_height(); UI_TextAlign main_text_align = ui_top_text_alignment(); - DF_Palette(DF_PaletteCode_TabActive) + DF_Palette(DF_PaletteCode_Tab) UI_Tooltip UI_PrefWidth(main_width) UI_PrefHeight(main_height) @@ -3680,7 +3680,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) //- rjf: entity menu UI_CtxMenu(ws->entity_ctx_menu_key) UI_PrefWidth(ui_em(30.f, 1.f)) - DF_Palette(DF_PaletteCode_ImplicitContents) + DF_Palette(DF_PaletteCode_ImplicitButton) { DF_Entity *entity = df_entity_from_handle(ws->entity_ctx_menu_entity); DF_IconKind entity_icon = df_g_entity_kind_icon_kind_table[entity->kind]; @@ -3887,7 +3887,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) if(op_flags & DF_EntityOpFlag_Freeze) { B32 is_frozen = df_entity_is_frozen(entity); - ui_set_next_palette(df_palette_from_code(is_frozen ? DF_PaletteCode_SpecialNegative : DF_PaletteCode_SpecialPositive)); + ui_set_next_palette(df_palette_from_code(is_frozen ? DF_PaletteCode_NegativePopButton : DF_PaletteCode_PositivePopButton)); if(is_frozen && ui_clicked(df_icon_buttonf(DF_IconKind_Locked, 0, "Thaw###freeze_thaw"))) { DF_CmdParams params = df_cmd_params_from_window(ws); @@ -4221,7 +4221,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) //- rjf: tab menu UI_CtxMenu(ws->tab_ctx_menu_key) UI_PrefWidth(ui_em(25.f, 1.f)) UI_CornerRadius(0) - DF_Palette(DF_PaletteCode_ImplicitContents) + DF_Palette(DF_PaletteCode_ImplicitButton) { DF_View *view = df_view_from_handle(ws->tab_ctx_menu_view); DF_IconKind view_icon = df_icon_kind_from_view(view); @@ -4360,7 +4360,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) { UI_CornerRadius00(ui_top_font_size()*0.25f) UI_CornerRadius01(ui_top_font_size()*0.25f) - DF_Palette(DF_PaletteCode_SpecialNeutral) + DF_Palette(DF_PaletteCode_NeutralPopButton) if(ui_clicked(ui_buttonf("OK")) || (ui_key_match(bg_box->default_nav_focus_hot_key, ui_key_zero()) && ui_slot_press(UI_EventActionSlot_Accept))) { DF_CmdParams p = df_cmd_params_zero(); @@ -4636,7 +4636,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) UI_Font(df_font_from_slot(DF_FontSlot_Code)) UI_HoverCursor(OS_Cursor_HandPoint) UI_Focus(UI_FocusKind_Null) - DF_Palette(DF_PaletteCode_ImplicitContents) + DF_Palette(DF_PaletteCode_ImplicitButton) UI_Padding(ui_em(1.f, 1.f)) { for(U64 idx = 0; idx < item_array.count; idx += 1) @@ -4728,7 +4728,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) DF_Palette(DF_PaletteCode_Floating) UI_CtxMenu(file_menu_key) UI_PrefWidth(ui_em(40.f, 1.f)) - DF_Palette(DF_PaletteCode_ImplicitContents) + DF_Palette(DF_PaletteCode_ImplicitButton) { DF_CoreCmdKind cmds[] = { @@ -4755,7 +4755,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) DF_Palette(DF_PaletteCode_Floating) UI_CtxMenu(window_menu_key) UI_PrefWidth(ui_em(40.f, 1.f)) - DF_Palette(DF_PaletteCode_ImplicitContents) + DF_Palette(DF_PaletteCode_ImplicitButton) { DF_CoreCmdKind cmds[] = { @@ -4778,7 +4778,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) DF_Palette(DF_PaletteCode_Floating) UI_CtxMenu(panel_menu_key) UI_PrefWidth(ui_em(40.f, 1.f)) - DF_Palette(DF_PaletteCode_ImplicitContents) + DF_Palette(DF_PaletteCode_ImplicitButton) { DF_CoreCmdKind cmds[] = { @@ -4821,7 +4821,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) DF_Palette(DF_PaletteCode_Floating) UI_CtxMenu(view_menu_key) UI_PrefWidth(ui_em(40.f, 1.f)) - DF_Palette(DF_PaletteCode_ImplicitContents) + DF_Palette(DF_PaletteCode_ImplicitButton) { DF_CoreCmdKind cmds[] = { @@ -4878,7 +4878,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) DF_Palette(DF_PaletteCode_Floating) UI_CtxMenu(targets_menu_key) UI_PrefWidth(ui_em(40.f, 1.f)) - DF_Palette(DF_PaletteCode_ImplicitContents) + DF_Palette(DF_PaletteCode_ImplicitButton) { Temp scratch = scratch_begin(&arena, 1); DF_CoreCmdKind cmds[] = @@ -4926,7 +4926,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) DF_Palette(DF_PaletteCode_Floating) UI_CtxMenu(ctrl_menu_key) UI_PrefWidth(ui_em(40.f, 1.f)) - DF_Palette(DF_PaletteCode_ImplicitContents) + DF_Palette(DF_PaletteCode_ImplicitButton) { DF_CoreCmdKind cmds[] = { @@ -4961,7 +4961,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) DF_Palette(DF_PaletteCode_Floating) UI_CtxMenu(help_menu_key) UI_PrefWidth(ui_em(60.f, 1.f)) - DF_Palette(DF_PaletteCode_ImplicitContents) + DF_Palette(DF_PaletteCode_ImplicitButton) { UI_Row UI_TextAlignment(UI_TextAlign_Center) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_label(str8_lit(BUILD_TITLE_STRING_LITERAL)); @@ -5107,7 +5107,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) // rjf: conversion task visualization UI_PrefWidth(ui_text_dim(10, 1)) UI_HeightFill - DF_Palette(DF_PaletteCode_SpecialNeutral) + DF_Palette(DF_PaletteCode_NeutralPopButton) { Temp scratch = scratch_begin(&arena, 1); DF_EntityList tasks = df_query_cached_entity_list_with_kind(DF_EntityKind_ConversionTask); @@ -5155,7 +5155,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) if(can_play || !have_targets || processes.count == 0) UI_TextAlignment(UI_TextAlign_Center) UI_Flags((can_play ? 0 : UI_BoxFlag_Disabled)) - DF_Palette(DF_PaletteCode_MenuBarPositive) + DF_Palette(DF_PaletteCode_MenuBar) { UI_Signal sig = ui_button(df_g_icon_kind_text_table[DF_IconKind_Play]); os_window_push_custom_title_bar_client_area(ws->os, sig.box->rect); @@ -5196,7 +5196,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) //- rjf: restart button if(!can_play && processes.count != 0) UI_TextAlignment(UI_TextAlign_Center) - DF_Palette(DF_PaletteCode_MenuBarPositive) + UI_Palette(ui_build_palette(ui_top_palette(), .text = df_rgba_from_theme_color(DF_ThemeColor_TextPositive))) { UI_Signal sig = ui_button(df_g_icon_kind_text_table[DF_IconKind_Redo]); os_window_push_custom_title_bar_client_area(ws->os, sig.box->rect); @@ -5231,7 +5231,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) //- rjf: pause button UI_TextAlignment(UI_TextAlign_Center) UI_Flags(can_pause ? 0 : UI_BoxFlag_Disabled) - DF_Palette(DF_PaletteCode_MenuBarNeutral) + UI_Palette(ui_build_palette(ui_top_palette(), .text = df_rgba_from_theme_color(DF_ThemeColor_TextNeutral))) { UI_Signal sig = ui_button(df_g_icon_kind_text_table[DF_IconKind_Pause]); os_window_push_custom_title_bar_client_area(ws->os, sig.box->rect); @@ -5258,7 +5258,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) //- rjf: stop button UI_TextAlignment(UI_TextAlign_Center) UI_Flags(can_stop ? 0 : UI_BoxFlag_Disabled) - DF_Palette(DF_PaletteCode_MenuBarNegative) + UI_Palette(ui_build_palette(ui_top_palette(), .text = df_rgba_from_theme_color(DF_ThemeColor_TextNegative))) { UI_Signal sig = {0}; { @@ -5396,7 +5396,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) ui_spacer(ui_pct(1, 0)); // rjf: loaded user viz - if(do_user_prof) DF_Palette(DF_PaletteCode_SpecialNeutral) + if(do_user_prof) DF_Palette(DF_PaletteCode_NeutralPopButton) { ui_set_next_pref_width(ui_children_sum(1)); ui_set_next_child_layout_axis(Axis2_X); @@ -5433,7 +5433,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) } // rjf: loaded project viz - if(do_user_prof) DF_Palette(DF_PaletteCode_SpecialNeutral) + if(do_user_prof) DF_Palette(DF_PaletteCode_NeutralPopButton) { ui_set_next_pref_width(ui_children_sum(1)); ui_set_next_child_layout_axis(Axis2_X); @@ -5481,7 +5481,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) max_sig = df_icon_buttonf(DF_IconKind_Window, 0, "##maximize"); } UI_PrefWidth(ui_px(button_dim, 1.f)) - DF_Palette(DF_PaletteCode_SpecialNegative) + DF_Palette(DF_PaletteCode_NegativePopButton) { cls_sig = df_icon_buttonf(DF_IconKind_X, 0, "##close"); } @@ -5513,9 +5513,9 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) { B32 is_running = df_ctrl_targets_running() && df_ctrl_last_run_frame_idx() < df_frame_index(); CTRL_Event stop_event = df_ctrl_last_stop_event(); - UI_Palette *positive_scheme = df_palette_from_code(DF_PaletteCode_SpecialPositive); - UI_Palette *running_scheme = df_palette_from_code(DF_PaletteCode_SpecialNeutral); - UI_Palette *negative_scheme = df_palette_from_code(DF_PaletteCode_SpecialNegative); + UI_Palette *positive_scheme = df_palette_from_code(DF_PaletteCode_PositivePopButton); + UI_Palette *running_scheme = df_palette_from_code(DF_PaletteCode_NeutralPopButton); + UI_Palette *negative_scheme = df_palette_from_code(DF_PaletteCode_NegativePopButton); UI_Palette *palette = running_scheme; if(!is_running) { @@ -5603,7 +5603,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) UI_Flags(UI_BoxFlag_DrawBackground) UI_TextAlignment(UI_TextAlign_Center) UI_CornerRadius(4) - DF_Palette(DF_PaletteCode_SpecialNeutral) + DF_Palette(DF_PaletteCode_NeutralPopButton) ui_labelf("Currently rebinding \"%S\" hotkey", df_gfx_state->bind_change_cmd_spec->info.display_name); } @@ -5813,14 +5813,14 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) ws->query_view_selected = 1; } } - UI_PrefWidth(ui_em(5.f, 1.f)) UI_Focus(UI_FocusKind_Off) DF_Palette(DF_PaletteCode_SpecialPositive) + UI_PrefWidth(ui_em(5.f, 1.f)) UI_Focus(UI_FocusKind_Off) DF_Palette(DF_PaletteCode_PositivePopButton) { if(ui_clicked(df_icon_buttonf(DF_IconKind_RightArrow, 0, "##complete_query"))) { query_completed = 1; } } - UI_PrefWidth(ui_em(3.f, 1.f)) UI_Focus(UI_FocusKind_Off) DF_Palette(DF_PaletteCode_Default) + UI_PrefWidth(ui_em(3.f, 1.f)) UI_Focus(UI_FocusKind_Off) DF_Palette(DF_PaletteCode_PlainButton) { if(ui_clicked(df_icon_buttonf(DF_IconKind_X, 0, "##cancel_query"))) { @@ -6303,7 +6303,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) future_split_rect.p1.v[axis] += drop_site_major_dim_px; future_split_rect.p0.v[axis2_flip(axis)] = panel_rect.p0.v[axis2_flip(axis)]; future_split_rect.p1.v[axis2_flip(axis)] = panel_rect.p1.v[axis2_flip(axis)]; - UI_Rect(future_split_rect) DF_Palette(DF_PaletteCode_DropSite) + UI_Rect(future_split_rect) DF_Palette(DF_PaletteCode_DropSiteOverlay) { ui_build_box_from_key(UI_BoxFlag_DrawBackground, ui_key_zero()); } @@ -6388,7 +6388,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) future_split_rect.p1.v[split_axis] += drop_site_major_dim_px; future_split_rect.p0.v[axis2_flip(split_axis)] = child_rect.p0.v[axis2_flip(split_axis)]; future_split_rect.p1.v[axis2_flip(split_axis)] = child_rect.p1.v[axis2_flip(split_axis)]; - UI_Rect(future_split_rect) DF_Palette(DF_PaletteCode_DropSite) + UI_Rect(future_split_rect) DF_Palette(DF_PaletteCode_DropSiteOverlay) { ui_build_box_from_key(UI_BoxFlag_DrawBackground, ui_key_zero()); } @@ -6679,10 +6679,10 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) UI_Box *row_or_column = ui_build_box_from_key(0, ui_key_zero()); UI_Parent(row_or_column) UI_Padding(ui_px(padding, 1.f)) { if(split_side == Side_Min) { ui_set_next_flags(UI_BoxFlag_DrawBackground); } - DF_Palette(DF_PaletteCode_DropSite) ui_build_box_from_key(UI_BoxFlag_DrawBorder, ui_key_zero()); + DF_Palette(DF_PaletteCode_DropSiteOverlay) ui_build_box_from_key(UI_BoxFlag_DrawBorder, ui_key_zero()); ui_spacer(ui_px(padding, 1.f)); if(split_side == Side_Max) { ui_set_next_flags(UI_BoxFlag_DrawBackground); } - DF_Palette(DF_PaletteCode_DropSite) ui_build_box_from_key(UI_BoxFlag_DrawBorder, ui_key_zero()); + DF_Palette(DF_PaletteCode_DropSiteOverlay) ui_build_box_from_key(UI_BoxFlag_DrawBorder, ui_key_zero()); } } } @@ -6692,7 +6692,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) { ui_set_next_child_layout_axis(split_axis); UI_Box *row_or_column = ui_build_box_from_key(0, ui_key_zero()); - UI_Parent(row_or_column) UI_Padding(ui_px(padding, 1.f)) DF_Palette(DF_PaletteCode_DropSite) + UI_Parent(row_or_column) UI_Padding(ui_px(padding, 1.f)) DF_Palette(DF_PaletteCode_DropSiteOverlay) { ui_build_box_from_key(UI_BoxFlag_DrawBorder|UI_BoxFlag_DrawBackground, ui_key_zero()); } @@ -6735,7 +6735,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) Vec2F32 panel_center = center_2f32(panel_rect); future_split_rect.v[side_flip(split_side)].v[split_axis] = panel_center.v[split_axis]; } - UI_Rect(future_split_rect) DF_Palette(DF_PaletteCode_DropSite) + UI_Rect(future_split_rect) DF_Palette(DF_PaletteCode_DropSiteOverlay) { ui_build_box_from_key(UI_BoxFlag_DrawBackground, ui_key_zero()); } @@ -7077,7 +7077,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) ui_spacer(ui_em(0.2f, 1.f)); UI_CornerRadius00(corner_radius) UI_CornerRadius10(corner_radius) - DF_Palette(DF_PaletteCode_DropSite) + DF_Palette(DF_PaletteCode_DropSiteOverlay) { ui_build_box_from_key(UI_BoxFlag_DrawBackground|UI_BoxFlag_DrawBorder, ui_key_zero()); } @@ -7102,7 +7102,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) UI_Box *tab_column_box = ui_build_box_from_stringf(!is_changing_panel_boundaries*UI_BoxFlag_AnimatePosX, "tab_column_%p", view); // rjf: build tab container box - UI_Parent(tab_column_box) UI_PrefHeight(ui_px(tab_bar_vheight, 1)) DF_Palette(view_is_selected ? DF_PaletteCode_TabActive : DF_PaletteCode_TabInactive) + UI_Parent(tab_column_box) UI_PrefHeight(ui_px(tab_bar_vheight, 1)) DF_Palette(view_is_selected ? DF_PaletteCode_Tab : DF_PaletteCode_TabInactive) { if((!view_is_selected && panel->tab_side == Side_Min) || (view_is_selected && panel->tab_side == Side_Max)) @@ -7265,7 +7265,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) UI_RunFlags(F_RunFlag_Smooth) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_HoverCursor(OS_Cursor_HandPoint) - DF_Palette(DF_PaletteCode_ImplicitContents) + DF_Palette(DF_PaletteCode_ImplicitButton) { UI_Box *add_new_box = ui_build_box_from_stringf(UI_BoxFlag_DrawBackground| UI_BoxFlag_DrawText| @@ -7336,7 +7336,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) DF_Panel *drag_panel = df_panel_from_handle(df_g_drag_drop_payload.panel); if(!df_view_is_nil(view) && active_drop_site != 0) { - DF_Palette(DF_PaletteCode_DropSite) UI_Rect(tab_bar_rect) + DF_Palette(DF_PaletteCode_DropSiteOverlay) UI_Rect(tab_bar_rect) ui_build_box_from_key(UI_BoxFlag_DrawBackground, ui_key_zero()); } @@ -7395,7 +7395,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) { // rjf: vis { - DF_Palette(DF_PaletteCode_DropSite) UI_Rect(content_rect) + DF_Palette(DF_PaletteCode_DropSiteOverlay) UI_Rect(content_rect) ui_build_box_from_key(UI_BoxFlag_DrawBackground, ui_key_zero()); } @@ -7623,13 +7623,13 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) //- rjf: draw background color { - Vec4F32 bg_color = df_rgba_from_theme_color(DF_ThemeColor_DefaultBackground); + Vec4F32 bg_color = df_rgba_from_theme_color(DF_ThemeColor_BaseBackground); d_rect(os_client_rect_from_window(ws->os), bg_color, 0, 0, 0); } //- rjf: draw window border { - Vec4F32 color = df_rgba_from_theme_color(DF_ThemeColor_DefaultBorder); + Vec4F32 color = df_rgba_from_theme_color(DF_ThemeColor_BaseBorder); d_rect(os_client_rect_from_window(ws->os), color, 0, 1.f, 0.5f); } @@ -7943,7 +7943,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) // rjf: draw focus overlay if(b->flags & UI_BoxFlag_Clickable && !(b->flags & UI_BoxFlag_DisableFocusOverlay) && b->focus_hot_t > 0.01f) { - Vec4F32 color = df_rgba_from_theme_color(DF_ThemeColor_FocusActive); + Vec4F32 color = df_rgba_from_theme_color(DF_ThemeColor_Focus); color.w *= 0.2f*b->focus_hot_t; R_Rect2DInst *inst = d_rect(b->rect, color, 0, 0, 1.f); MemoryCopyArray(inst->corner_radii, b->corner_radii); @@ -7952,7 +7952,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) // rjf: draw focus border if(b->flags & UI_BoxFlag_Clickable && !(b->flags & UI_BoxFlag_DisableFocusBorder) && b->focus_active_t > 0.01f) { - Vec4F32 color = df_rgba_from_theme_color(DF_ThemeColor_FocusActive); + Vec4F32 color = df_rgba_from_theme_color(DF_ThemeColor_Focus); color.w *= b->focus_active_t; R_Rect2DInst *inst = d_rect(pad_2f32(b->rect, 1.f), color, 0, 1.f, 1.f); MemoryCopyArray(inst->corner_radii, b->corner_radii); @@ -8008,7 +8008,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) //- rjf: draw border/overlay color to signify error if(ws->error_t > 0.01f) { - Vec4F32 color = df_rgba_from_theme_color(DF_ThemeColor_SpecialNegativeBackground); + Vec4F32 color = df_rgba_from_theme_color(DF_ThemeColor_NegativePopButtonBackground); color.w *= ws->error_t; Rng2F32 rect = os_client_rect_from_window(ws->os); d_rect(pad_2f32(rect, 24.f), color, 0, 16.f, 12.f); @@ -9823,7 +9823,7 @@ df_cmd_binding_button(DF_CmdSpec *spec) MemoryCopyStruct(palette, ui_top_palette()); if(has_conflicts) { - palette->colors[UI_ColorCode_Text] = df_rgba_from_theme_color(DF_ThemeColor_DefaultTextNegative); + palette->colors[UI_ColorCode_Text] = df_rgba_from_theme_color(DF_ThemeColor_TextNegative); } if(df_gfx_state->bind_change_active && df_gfx_state->bind_change_cmd_spec == spec) { @@ -10055,7 +10055,7 @@ df_entity_tooltips(DF_Entity *entity) String8 explanation = df_stop_explanation_string_icon_from_ctrl_event(scratch.arena, &stop_event, &icon_kind); if(explanation.size != 0) { - UI_PrefWidth(ui_children_sum(1)) UI_Row DF_Palette(DF_PaletteCode_DefaultNegative) + UI_PrefWidth(ui_children_sum(1)) UI_Row DF_Palette(DF_PaletteCode_NegativePopButton) { UI_PrefWidth(ui_em(1.5f, 1.f)) UI_Font(df_font_from_slot(DF_FontSlot_Icons)) @@ -10113,7 +10113,7 @@ df_entity_tooltips(DF_Entity *entity) { UI_Font(df_font_from_slot(DF_FontSlot_Code))UI_PrefWidth(ui_text_dim(10, 1)) { - df_code_label(1.f, 0, df_rgba_from_theme_color(DF_ThemeColor_CodeProcedure), name); + df_code_label(1.f, 0, df_rgba_from_theme_color(DF_ThemeColor_CodeSymbol), name); } } else @@ -10180,7 +10180,7 @@ df_entity_desc_button(DF_Window *ws, DF_Entity *entity, FuzzyMatchRangeList *nam DF_Entity *selected_thread = df_entity_from_handle(ctrl_ctx.thread); if(selected_thread == entity) { - palette = df_palette_from_code(DF_PaletteCode_SpecialNeutral); + palette = df_palette_from_code(DF_PaletteCode_NeutralPopButton); } if(stopped_thread == entity && (stop_event.cause == CTRL_EventCause_UserBreakpoint || @@ -10188,16 +10188,16 @@ df_entity_desc_button(DF_Window *ws, DF_Entity *entity, FuzzyMatchRangeList *nam stop_event.cause == CTRL_EventCause_InterruptedByTrap || stop_event.cause == CTRL_EventCause_InterruptedByHalt)) { - palette = df_palette_from_code(DF_PaletteCode_SpecialNegative); + palette = df_palette_from_code(DF_PaletteCode_NegativePopButton); } } if(entity->cfg_src == DF_CfgSrc_CommandLine) { - palette = df_palette_from_code(DF_PaletteCode_SpecialNeutral); + palette = df_palette_from_code(DF_PaletteCode_NeutralPopButton); } else if(entity->kind == DF_EntityKind_Target && entity->b32 != 0) { - palette = df_palette_from_code(DF_PaletteCode_DefaultPositive); + palette = df_palette_from_code(DF_PaletteCode_PositivePopButton); } ui_set_next_hover_cursor(OS_Cursor_HandPoint); ui_set_next_palette(palette); @@ -10275,7 +10275,7 @@ df_entity_desc_button(DF_Window *ws, DF_Entity *entity, FuzzyMatchRangeList *nam if(entity->kind == DF_EntityKind_Thread) UI_FontSize(ui_top_font_size()*0.75f) UI_Font(df_font_from_slot(DF_FontSlot_Code)) - UI_Palette(ui_build_palette(ui_top_palette(), .text = df_rgba_from_theme_color(DF_ThemeColor_CodeProcedure))) + UI_Palette(ui_build_palette(ui_top_palette(), .text = df_rgba_from_theme_color(DF_ThemeColor_CodeSymbol))) UI_Flags(UI_BoxFlag_DisableTruncatedHover) { CTRL_Unwind unwind = df_query_cached_unwind_from_thread(entity); @@ -10480,7 +10480,7 @@ internal UI_BOX_CUSTOM_DRAW(df_thread_box_draw_extensions) if(u->is_frozen) { F32 lock_icon_off = ui_top_font_size()*0.2f; - Vec4F32 lock_icon_color = df_rgba_from_theme_color(DF_ThemeColor_DefaultTextNegative); + Vec4F32 lock_icon_color = df_rgba_from_theme_color(DF_ThemeColor_TextNegative); d_text(df_font_from_slot(DF_FontSlot_Icons), box->font_size, 0, 0, F_RunFlag_Smooth, v2f32((box->rect.x0 + box->rect.x1)/2 + lock_icon_off/2, @@ -10631,7 +10631,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ ctx_menu_keys[line_idx] = ui_key_from_stringf(top_container_box->key, "line_ctx_%I64d", line_num); DF_Palette(DF_PaletteCode_Floating) UI_CtxMenu(ctx_menu_keys[line_idx]) - DF_Palette(DF_PaletteCode_ImplicitContents) + DF_Palette(DF_PaletteCode_ImplicitButton) UI_PrefWidth(ui_em(37.f, 1.f)) { DF_TextLineSrc2DasmInfoList *line_src2dasm_list = ¶ms->line_src2dasm[line_idx]; @@ -11756,7 +11756,6 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ UI_Font(params->font) UI_FontSize(params->font_size) UI_CornerRadius(0) - DF_Palette(DF_PaletteCode_Code) { U64 line_idx = 0; for(S64 line_num = params->line_num_range.min; @@ -11832,7 +11831,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ if(voff != 0) { mapped_special = 1; - new_color_kind = DF_ThemeColor_CodeProcedure; + new_color_kind = DF_ThemeColor_CodeSymbol; mix_t = selected_thread_module->alive_t; } } @@ -12013,7 +12012,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ ui_box_text_position(line_box).x+cursor_off_pixels+cursor_thickness, line_box->rect.y1+params->font_size*0.25f, }; - d_rect(cursor_rect, ui_top_palette()->colors[UI_ColorCode_Cursor], 1.f, 0, 1.f); + d_rect(cursor_rect, df_rgba_from_theme_color(is_focused ? DF_ThemeColor_Cursor : DF_ThemeColor_CursorInactive), 1.f, 0, 1.f); } // rjf: extra rendering for lines with line-info that match the hovered @@ -13961,8 +13960,8 @@ df_gfx_begin_frame(Arena *arena, DF_CmdList *cmds) F32 closest_preset_bg_distance = 100000000; for(DF_ThemePreset p = (DF_ThemePreset)0; p < DF_ThemePreset_COUNT; p = (DF_ThemePreset)(p+1)) { - Vec4F32 cfg_bg = df_gfx_state->cfg_theme_target.colors[DF_ThemeColor_DefaultBackground]; - Vec4F32 pre_bg = df_g_theme_preset_colors_table[p][DF_ThemeColor_DefaultBackground]; + Vec4F32 cfg_bg = df_gfx_state->cfg_theme_target.colors[DF_ThemeColor_BaseBackground]; + Vec4F32 pre_bg = df_g_theme_preset_colors_table[p][DF_ThemeColor_BaseBackground]; Vec4F32 diff = sub_4f32(cfg_bg, pre_bg); Vec3F32 diff3 = diff.xyz; F32 distance = length_3f32(diff3); @@ -14136,77 +14135,57 @@ df_gfx_begin_frame(Arena *arena, DF_CmdList *cmds) for(EachEnumVal(DF_PaletteCode, code)) { df_gfx_state->cfg_palettes[code].null = v4f32(1, 0, 1, 1); - df_gfx_state->cfg_palettes[code].cursor = current->colors[DF_ThemeColor_CursorActive]; + df_gfx_state->cfg_palettes[code].cursor = current->colors[DF_ThemeColor_Cursor]; df_gfx_state->cfg_palettes[code].selection = current->colors[DF_ThemeColor_Selection]; } - df_gfx_state->cfg_palettes[DF_PaletteCode_Default].background = current->colors[DF_ThemeColor_DefaultBackground]; - df_gfx_state->cfg_palettes[DF_PaletteCode_Default].text = current->colors[DF_ThemeColor_DefaultText]; - df_gfx_state->cfg_palettes[DF_PaletteCode_Default].text_weak = current->colors[DF_ThemeColor_DefaultTextWeak]; - df_gfx_state->cfg_palettes[DF_PaletteCode_Default].border = current->colors[DF_ThemeColor_DefaultBorder]; - df_gfx_state->cfg_palettes[DF_PaletteCode_DefaultPositive].background = current->colors[DF_ThemeColor_DefaultBackground]; - df_gfx_state->cfg_palettes[DF_PaletteCode_DefaultPositive].text = current->colors[DF_ThemeColor_DefaultTextPositive]; - df_gfx_state->cfg_palettes[DF_PaletteCode_DefaultPositive].text_weak = current->colors[DF_ThemeColor_DefaultTextWeak]; - df_gfx_state->cfg_palettes[DF_PaletteCode_DefaultPositive].border = current->colors[DF_ThemeColor_DefaultBorder]; - df_gfx_state->cfg_palettes[DF_PaletteCode_DefaultNegative].background = current->colors[DF_ThemeColor_DefaultBackground]; - df_gfx_state->cfg_palettes[DF_PaletteCode_DefaultNegative].text = current->colors[DF_ThemeColor_DefaultTextNegative]; - df_gfx_state->cfg_palettes[DF_PaletteCode_DefaultNegative].text_weak = current->colors[DF_ThemeColor_DefaultTextWeak]; - df_gfx_state->cfg_palettes[DF_PaletteCode_DefaultNegative].border = current->colors[DF_ThemeColor_DefaultBorder]; - df_gfx_state->cfg_palettes[DF_PaletteCode_DefaultNeutral].background = current->colors[DF_ThemeColor_DefaultBackground]; - df_gfx_state->cfg_palettes[DF_PaletteCode_DefaultNeutral].text = current->colors[DF_ThemeColor_DefaultTextNeutral]; - df_gfx_state->cfg_palettes[DF_PaletteCode_DefaultNeutral].text_weak = current->colors[DF_ThemeColor_DefaultTextWeak]; - df_gfx_state->cfg_palettes[DF_PaletteCode_DefaultNeutral].border = current->colors[DF_ThemeColor_DefaultBorder]; - df_gfx_state->cfg_palettes[DF_PaletteCode_Floating].background = current->colors[DF_ThemeColor_FloatingBackground]; - df_gfx_state->cfg_palettes[DF_PaletteCode_Floating].text = current->colors[DF_ThemeColor_FloatingText]; - df_gfx_state->cfg_palettes[DF_PaletteCode_Floating].text_weak = current->colors[DF_ThemeColor_FloatingTextWeak]; - df_gfx_state->cfg_palettes[DF_PaletteCode_Floating].border = current->colors[DF_ThemeColor_FloatingBorder]; - df_gfx_state->cfg_palettes[DF_PaletteCode_ImplicitContents].background = v4f32(0, 0, 0, 0); - df_gfx_state->cfg_palettes[DF_PaletteCode_ImplicitContents].text = current->colors[DF_ThemeColor_FloatingText]; - df_gfx_state->cfg_palettes[DF_PaletteCode_ImplicitContents].text_weak = current->colors[DF_ThemeColor_FloatingTextWeak]; - df_gfx_state->cfg_palettes[DF_PaletteCode_ImplicitContents].border = v4f32(0, 0, 0, 0); - df_gfx_state->cfg_palettes[DF_PaletteCode_SpecialPositive].background = current->colors[DF_ThemeColor_SpecialPositiveBackground]; - df_gfx_state->cfg_palettes[DF_PaletteCode_SpecialPositive].text = current->colors[DF_ThemeColor_SpecialPositiveText]; - df_gfx_state->cfg_palettes[DF_PaletteCode_SpecialPositive].text_weak = current->colors[DF_ThemeColor_SpecialPositiveTextWeak]; - df_gfx_state->cfg_palettes[DF_PaletteCode_SpecialPositive].border = current->colors[DF_ThemeColor_SpecialPositiveBorder]; - df_gfx_state->cfg_palettes[DF_PaletteCode_SpecialNegative].background = current->colors[DF_ThemeColor_SpecialNegativeBackground]; - df_gfx_state->cfg_palettes[DF_PaletteCode_SpecialNegative].text = current->colors[DF_ThemeColor_SpecialNegativeText]; - df_gfx_state->cfg_palettes[DF_PaletteCode_SpecialNegative].text_weak = current->colors[DF_ThemeColor_SpecialNegativeTextWeak]; - df_gfx_state->cfg_palettes[DF_PaletteCode_SpecialNegative].border = current->colors[DF_ThemeColor_SpecialNegativeBorder]; - df_gfx_state->cfg_palettes[DF_PaletteCode_SpecialNeutral].background = current->colors[DF_ThemeColor_SpecialNeutralBackground]; - df_gfx_state->cfg_palettes[DF_PaletteCode_SpecialNeutral].text = current->colors[DF_ThemeColor_SpecialNeutralText]; - df_gfx_state->cfg_palettes[DF_PaletteCode_SpecialNeutral].text_weak = current->colors[DF_ThemeColor_SpecialNeutralTextWeak]; - df_gfx_state->cfg_palettes[DF_PaletteCode_SpecialNeutral].border = current->colors[DF_ThemeColor_SpecialNeutralBorder]; + df_gfx_state->cfg_palettes[DF_PaletteCode_Base].background = current->colors[DF_ThemeColor_BaseBackground]; + df_gfx_state->cfg_palettes[DF_PaletteCode_Base].text = current->colors[DF_ThemeColor_Text]; + df_gfx_state->cfg_palettes[DF_PaletteCode_Base].text_weak = current->colors[DF_ThemeColor_TextWeak]; + df_gfx_state->cfg_palettes[DF_PaletteCode_Base].border = current->colors[DF_ThemeColor_BaseBorder]; df_gfx_state->cfg_palettes[DF_PaletteCode_MenuBar].background = current->colors[DF_ThemeColor_MenuBarBackground]; - df_gfx_state->cfg_palettes[DF_PaletteCode_MenuBar].text = current->colors[DF_ThemeColor_MenuBarText]; - df_gfx_state->cfg_palettes[DF_PaletteCode_MenuBar].text_weak = current->colors[DF_ThemeColor_MenuBarTextWeak]; + df_gfx_state->cfg_palettes[DF_PaletteCode_MenuBar].text = current->colors[DF_ThemeColor_Text]; + df_gfx_state->cfg_palettes[DF_PaletteCode_MenuBar].text_weak = current->colors[DF_ThemeColor_TextWeak]; df_gfx_state->cfg_palettes[DF_PaletteCode_MenuBar].border = current->colors[DF_ThemeColor_MenuBarBorder]; - df_gfx_state->cfg_palettes[DF_PaletteCode_MenuBarPositive].background = current->colors[DF_ThemeColor_MenuBarBackground]; - df_gfx_state->cfg_palettes[DF_PaletteCode_MenuBarPositive].text = current->colors[DF_ThemeColor_MenuBarTextPositive]; - df_gfx_state->cfg_palettes[DF_PaletteCode_MenuBarPositive].text_weak = current->colors[DF_ThemeColor_MenuBarTextWeak]; - df_gfx_state->cfg_palettes[DF_PaletteCode_MenuBarPositive].border = current->colors[DF_ThemeColor_MenuBarBorder]; - df_gfx_state->cfg_palettes[DF_PaletteCode_MenuBarNegative].background = current->colors[DF_ThemeColor_MenuBarBackground]; - df_gfx_state->cfg_palettes[DF_PaletteCode_MenuBarNegative].text = current->colors[DF_ThemeColor_MenuBarTextNegative]; - df_gfx_state->cfg_palettes[DF_PaletteCode_MenuBarNegative].text_weak = current->colors[DF_ThemeColor_MenuBarTextWeak]; - df_gfx_state->cfg_palettes[DF_PaletteCode_MenuBarNegative].border = current->colors[DF_ThemeColor_MenuBarBorder]; - df_gfx_state->cfg_palettes[DF_PaletteCode_MenuBarNeutral].background = current->colors[DF_ThemeColor_MenuBarBackground]; - df_gfx_state->cfg_palettes[DF_PaletteCode_MenuBarNeutral].text = current->colors[DF_ThemeColor_DefaultTextNeutral]; - df_gfx_state->cfg_palettes[DF_PaletteCode_MenuBarNeutral].text_weak = current->colors[DF_ThemeColor_MenuBarTextWeak]; - df_gfx_state->cfg_palettes[DF_PaletteCode_MenuBarNeutral].border = current->colors[DF_ThemeColor_MenuBarBorder]; - df_gfx_state->cfg_palettes[DF_PaletteCode_TabActive].background = current->colors[DF_ThemeColor_TabActiveBackground]; - df_gfx_state->cfg_palettes[DF_PaletteCode_TabActive].text = current->colors[DF_ThemeColor_TabActiveText]; - df_gfx_state->cfg_palettes[DF_PaletteCode_TabActive].text_weak = current->colors[DF_ThemeColor_TabActiveTextWeak]; - df_gfx_state->cfg_palettes[DF_PaletteCode_TabActive].border = current->colors[DF_ThemeColor_TabActiveBorder]; - df_gfx_state->cfg_palettes[DF_PaletteCode_TabInactive].background = current->colors[DF_ThemeColor_TabInactiveBackground]; - df_gfx_state->cfg_palettes[DF_PaletteCode_TabInactive].text = current->colors[DF_ThemeColor_TabInactiveText]; - df_gfx_state->cfg_palettes[DF_PaletteCode_TabInactive].text_weak = current->colors[DF_ThemeColor_TabInactiveTextWeak]; - df_gfx_state->cfg_palettes[DF_PaletteCode_TabInactive].border = current->colors[DF_ThemeColor_TabInactiveBorder]; - df_gfx_state->cfg_palettes[DF_PaletteCode_Code].background = current->colors[DF_ThemeColor_DefaultBackground]; - df_gfx_state->cfg_palettes[DF_PaletteCode_Code].text = current->colors[DF_ThemeColor_CodeDefault]; - df_gfx_state->cfg_palettes[DF_PaletteCode_Code].text_weak = current->colors[DF_ThemeColor_CodeDefault]; - df_gfx_state->cfg_palettes[DF_PaletteCode_Code].border = current->colors[DF_ThemeColor_DefaultBorder]; - df_gfx_state->cfg_palettes[DF_PaletteCode_DropSite].background = current->colors[DF_ThemeColor_DropSiteOverlay]; - df_gfx_state->cfg_palettes[DF_PaletteCode_DropSite].text = current->colors[DF_ThemeColor_DropSiteOverlay]; - df_gfx_state->cfg_palettes[DF_PaletteCode_DropSite].text_weak = current->colors[DF_ThemeColor_DropSiteOverlay]; - df_gfx_state->cfg_palettes[DF_PaletteCode_DropSite].border = current->colors[DF_ThemeColor_DropSiteOverlay]; + df_gfx_state->cfg_palettes[DF_PaletteCode_Floating].background = current->colors[DF_ThemeColor_FloatingBackground]; + df_gfx_state->cfg_palettes[DF_PaletteCode_Floating].text = current->colors[DF_ThemeColor_Text]; + df_gfx_state->cfg_palettes[DF_PaletteCode_Floating].text_weak = current->colors[DF_ThemeColor_TextWeak]; + df_gfx_state->cfg_palettes[DF_PaletteCode_Floating].border = current->colors[DF_ThemeColor_FloatingBorder]; + df_gfx_state->cfg_palettes[DF_PaletteCode_ImplicitButton].background = current->colors[DF_ThemeColor_ImplicitButtonBackground]; + df_gfx_state->cfg_palettes[DF_PaletteCode_ImplicitButton].text = current->colors[DF_ThemeColor_Text]; + df_gfx_state->cfg_palettes[DF_PaletteCode_ImplicitButton].text_weak = current->colors[DF_ThemeColor_TextWeak]; + df_gfx_state->cfg_palettes[DF_PaletteCode_ImplicitButton].border = current->colors[DF_ThemeColor_ImplicitButtonBorder]; + df_gfx_state->cfg_palettes[DF_PaletteCode_PlainButton].background = current->colors[DF_ThemeColor_PlainButtonBackground]; + df_gfx_state->cfg_palettes[DF_PaletteCode_PlainButton].text = current->colors[DF_ThemeColor_Text]; + df_gfx_state->cfg_palettes[DF_PaletteCode_PlainButton].text_weak = current->colors[DF_ThemeColor_TextWeak]; + df_gfx_state->cfg_palettes[DF_PaletteCode_PlainButton].border = current->colors[DF_ThemeColor_PlainButtonBorder]; + df_gfx_state->cfg_palettes[DF_PaletteCode_PositivePopButton].background = current->colors[DF_ThemeColor_PositivePopButtonBackground]; + df_gfx_state->cfg_palettes[DF_PaletteCode_PositivePopButton].text = current->colors[DF_ThemeColor_Text]; + df_gfx_state->cfg_palettes[DF_PaletteCode_PositivePopButton].text_weak = current->colors[DF_ThemeColor_TextWeak]; + df_gfx_state->cfg_palettes[DF_PaletteCode_PositivePopButton].border = current->colors[DF_ThemeColor_PositivePopButtonBorder]; + df_gfx_state->cfg_palettes[DF_PaletteCode_NegativePopButton].background = current->colors[DF_ThemeColor_NegativePopButtonBackground]; + df_gfx_state->cfg_palettes[DF_PaletteCode_NegativePopButton].text = current->colors[DF_ThemeColor_Text]; + df_gfx_state->cfg_palettes[DF_PaletteCode_NegativePopButton].text_weak = current->colors[DF_ThemeColor_TextWeak]; + df_gfx_state->cfg_palettes[DF_PaletteCode_NegativePopButton].border = current->colors[DF_ThemeColor_NegativePopButtonBorder]; + df_gfx_state->cfg_palettes[DF_PaletteCode_NeutralPopButton].background = current->colors[DF_ThemeColor_NeutralPopButtonBackground]; + df_gfx_state->cfg_palettes[DF_PaletteCode_NeutralPopButton].text = current->colors[DF_ThemeColor_Text]; + df_gfx_state->cfg_palettes[DF_PaletteCode_NeutralPopButton].text_weak = current->colors[DF_ThemeColor_TextWeak]; + df_gfx_state->cfg_palettes[DF_PaletteCode_NeutralPopButton].border = current->colors[DF_ThemeColor_NeutralPopButtonBorder]; + df_gfx_state->cfg_palettes[DF_PaletteCode_ScrollBarButton].background = current->colors[DF_ThemeColor_ScrollBarButtonBackground]; + df_gfx_state->cfg_palettes[DF_PaletteCode_ScrollBarButton].text = current->colors[DF_ThemeColor_Text]; + df_gfx_state->cfg_palettes[DF_PaletteCode_ScrollBarButton].text_weak = current->colors[DF_ThemeColor_TextWeak]; + df_gfx_state->cfg_palettes[DF_PaletteCode_ScrollBarButton].border = current->colors[DF_ThemeColor_ScrollBarButtonBorder]; + df_gfx_state->cfg_palettes[DF_PaletteCode_Tab].background = current->colors[DF_ThemeColor_TabBackground]; + df_gfx_state->cfg_palettes[DF_PaletteCode_Tab].text = current->colors[DF_ThemeColor_Text]; + df_gfx_state->cfg_palettes[DF_PaletteCode_Tab].text_weak = current->colors[DF_ThemeColor_TextWeak]; + df_gfx_state->cfg_palettes[DF_PaletteCode_Tab].border = current->colors[DF_ThemeColor_TabBorder]; + df_gfx_state->cfg_palettes[DF_PaletteCode_TabInactive].background = current->colors[DF_ThemeColor_TabBackgroundInactive]; + df_gfx_state->cfg_palettes[DF_PaletteCode_TabInactive].text = current->colors[DF_ThemeColor_Text]; + df_gfx_state->cfg_palettes[DF_PaletteCode_TabInactive].text_weak = current->colors[DF_ThemeColor_TextWeak]; + df_gfx_state->cfg_palettes[DF_PaletteCode_TabInactive].border = current->colors[DF_ThemeColor_TabBorderInactive]; + df_gfx_state->cfg_palettes[DF_PaletteCode_DropSiteOverlay].background = current->colors[DF_ThemeColor_DropSiteOverlay]; + df_gfx_state->cfg_palettes[DF_PaletteCode_DropSiteOverlay].text = current->colors[DF_ThemeColor_DropSiteOverlay]; + df_gfx_state->cfg_palettes[DF_PaletteCode_DropSiteOverlay].text_weak = current->colors[DF_ThemeColor_DropSiteOverlay]; + df_gfx_state->cfg_palettes[DF_PaletteCode_DropSiteOverlay].border = current->colors[DF_ThemeColor_DropSiteOverlay]; } //- rjf: animate alive-transitions for entities diff --git a/src/df/gfx/df_gfx.h b/src/df/gfx/df_gfx.h index 379dc1e4..ad497292 100644 --- a/src/df/gfx/df_gfx.h +++ b/src/df/gfx/df_gfx.h @@ -376,23 +376,18 @@ DF_FontSlot; typedef enum DF_PaletteCode { - DF_PaletteCode_Default, - DF_PaletteCode_DefaultPositive, - DF_PaletteCode_DefaultNegative, - DF_PaletteCode_DefaultNeutral, - DF_PaletteCode_Floating, - DF_PaletteCode_ImplicitContents, - DF_PaletteCode_SpecialPositive, - DF_PaletteCode_SpecialNegative, - DF_PaletteCode_SpecialNeutral, + DF_PaletteCode_Base, DF_PaletteCode_MenuBar, - DF_PaletteCode_MenuBarPositive, - DF_PaletteCode_MenuBarNegative, - DF_PaletteCode_MenuBarNeutral, - DF_PaletteCode_TabActive, + 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_Code, - DF_PaletteCode_DropSite, + DF_PaletteCode_DropSiteOverlay, DF_PaletteCode_COUNT } DF_PaletteCode; diff --git a/src/df/gfx/df_gfx.mdesk b/src/df/gfx/df_gfx.mdesk index 8361de51..a4224cb7 100644 --- a/src/df/gfx/df_gfx.mdesk +++ b/src/df/gfx/df_gfx.mdesk @@ -374,71 +374,62 @@ DF_ThemeColorTable: //- rjf: global ui colors {Selection "Selection" selection 0x99ccff4c 0x99ccff4c 0x99ccff4c 0x99ccff4c 0x99ccff4c 0x99ccff4c 0x99ccff4c 0x99ccff4c 0x99ccff4c } {DropShadow "Drop Shadow" drop_shadow 0x0000007f 0x0000007f 0x0000007f 0x0000007f 0x0000007f 0x0000007f 0x0000007f 0x0000007f 0x0000007f } - {CursorActive "Cursor" cursor_active 0x8bff00ff 0x66e566e5 0x66e566e5 0x66e566e5 0x66e566e5 0x66e566e5 0x66e566e5 0x66e566e5 0x66e566e5 } + {Cursor "Cursor" cursor 0x8bff00ff 0x66e566e5 0x66e566e5 0x66e566e5 0x66e566e5 0x66e566e5 0x66e566e5 0x66e566e5 0x66e566e5 } {CursorInactive "Cursor (Inactive)" cursor_inactive 0xb23217ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff } - {FocusActive "Focus" focus_active 0xfea200ff 0xb27219ff 0xb27219ff 0xb27219ff 0xb27219ff 0xb27219ff 0xb27219ff 0xb27219ff 0xb27219ff } - {FocusInactive "Focus (Inactive)" focus_inactive 0x904334ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff } + {Focus "Focus" focus 0xfea200ff 0xb27219ff 0xb27219ff 0xb27219ff 0xb27219ff 0xb27219ff 0xb27219ff 0xb27219ff 0xb27219ff } + {Hover "Hover" hover 0x7bffc7ff 0xb27219ff 0xb27219ff 0xb27219ff 0xb27219ff 0xb27219ff 0xb27219ff 0xb27219ff 0xb27219ff } {Highlight0 "Highlight 0" highlight_0 0xfe9603ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff } {Highlight1 "Highlight 1" highlight_1 0x7bffc7ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff } {DisabledOverlay "Disabled Overlay" disabled_overlay 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f } + {DropSiteOverlay "Drop Site Overlay" drop_site_overlay 0xffffff0c 0xffffff0c 0xffffff0c 0xffffff0c 0xffffff0c 0xffffff0c 0xffffff0c 0xffffff0c 0xffffff0c } + {InactivePanelOverlay "Inactive Panel Overlay" inactive_panel_overlay 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f } + {Text "Text" text 0xbebebeff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff } + {TextPositive "Text (Positive)" text_positive 0x4dc221ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff } + {TextNegative "Text (Negative)" text_negative 0xc56553ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff } + {TextNeutral "Text (Neutral)" text_neutral 0x327fb2ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff } + {TextWeak "Text (Weak)" text_weak 0xa4a4a4fe 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f } - //- rjf: default ui colors - {DefaultText "Default Text" default_text 0xbebebeff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff } - {DefaultTextPositive "Default Text (Positive)" default_text_positive 0x4dc221ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff } - {DefaultTextNegative "Default Text (Negative)" default_text_negative 0xc56553ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff } - {DefaultTextNeutral "Default Text (Neutral)" default_text_neutral 0x327fb2ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff } - {DefaultTextWeak "Default Text (Weak)" default_text_weak 0xa4a4a4fe 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f } - {DefaultBackground "Default Background" default_background 0x1b1b1bfe 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f } - {DefaultBorder "Default Border" default_border 0x3f3f3ffe 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 } + //- rjf: base ui container colors + {BaseBackground "Base Background" base_background 0x1b1b1bfe 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f } + {BaseBackgroundAlt "Base Background (Alternate)" base_background_alt 0x2b2b2bfe 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f } + {BaseBorder "Base Border" base_border 0x3f3f3ffe 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 } - //- rjf: floating ui colors - {FloatingText "Floating Text" floating_text 0xbebebeff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff } - {FloatingTextPositive "Floating Text (Positive)" floating_text_positive 0x4dc220ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff } - {FloatingTextNegative "Floating Text (Negative)" floating_text_negative 0xc56452ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff } - {FloatingTextWeak "Floating Text (Weak)" floating_text_weak 0xa4a4a4ff 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f } - {FloatingBackground "Floating Background" floating_background 0x33333333 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f } - {FloatingBorder "Floating Border" floating_border 0x3f3f3ffd 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 } - - //- rjf: special button colors - {SpecialPositiveText "Special Positive Text" special_positive_text 0xfefefeff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff } - {SpecialPositiveTextWeak "Special Positive Text (Weak)" special_positive_text_weak 0xa4a4a4fe 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f } - {SpecialPositiveBackground "Special Positive Background" special_positive_background 0x2d7e3eff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff } - {SpecialPositiveBorder "Special Positive Border" special_positive_border 0x3f3f3ffd 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 } - {SpecialNegativeText "Special Negative Text" special_negative_text 0xfefefeff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff } - {SpecialNegativeTextWeak "Special Negative Text (Weak)" special_negative_text_weak 0xa4a4a4fd 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f } - {SpecialNegativeBackground "Special Negative Background" special_negative_background 0x803425ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff } - {SpecialNegativeBorder "Special Negative Border" special_negative_border 0x3f3f3ffd 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 } - {SpecialNeutralText "Special Neutral Text" special_neutral_text 0xfefefeff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff } - {SpecialNeutralTextWeak "Special Neutral Text (Weak)" special_neutral_text_weak 0xa4a4a4fd 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f } - {SpecialNeutralBackground "Special Neutral Background" special_neutral_background 0x355b6eff 0x327fb2ff 0x327fb2ff 0x327fb2ff 0x327fb2ff 0x327fb2ff 0x327fb2ff 0x327fb2ff 0x327fb2ff } - {SpecialNeutralBorder "Special Neutral Border" special_neutral_border 0x3f3f3ffd 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 } - - //- rjf: menu bar colors - {MenuBarText "Menu Bar Text" menu_bar_text 0xfefefeff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff } - {MenuBarTextWeak "Menu Bar Text (Weak)" menu_bar_text_weak 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f } - {MenuBarTextPositive "Menu Bar Text (Positive)" menu_bar_text_positive 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff } - {MenuBarTextNegative "Menu Bar Text (Negative)" menu_bar_text_negative 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff } + //- rjf: menu bar ui container colors {MenuBarBackground "Menu Bar Background" menu_bar_background 0x3e4c577f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f } + {MenuBarBackgroundAlt "Menu Bar Background (Alternate)" menu_bar_background_alt 0x3e4c577f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f } {MenuBarBorder "Menu Bar Border" menu_bar_border 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 } - //- rjf: tab colors - {TabActiveText "Tab Text" tab_active_text 0xffffffff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff } - {TabActiveTextWeak "Tab Text (Weak)" tab_active_text_weak 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f } - {TabActiveBackground "Tab Background" tab_active_background 0x7b4d27fe 0xa87a4c99 0xa87a4c99 0xa87a4c99 0xa87a4c99 0xa87a4c99 0xa87a4c99 0xa87a4c99 0xa87a4c99 } - {TabActiveBorder "Tab Border" tab_active_border 0xb48300fd 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 } - {TabInactiveText "Tab Text (Inactive)" tab_inactive_text 0xa4a4a4fd 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff } - {TabInactiveTextWeak "Tab Text (Inactive, Weak)" tab_inactive_text_weak 0x808080fd 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f } - {TabInactiveBackground "Tab Background (Inactive)" tab_inactive_background 0x3e4c577f 0x42474c7f 0x42474c7f 0x42474c7f 0x42474c7f 0x42474c7f 0x42474c7f 0x42474c7f 0x42474c7f } - {TabInactiveBorder "Tab Border (Inactive)" tab_inactive_border 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 } + //- rjf: floating ui container colors + {FloatingBackground "Floating Background" floating_background 0x33333333 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f } + {FloatingBackgroundAlt "Floating Background (Alternate)" floating_background_alt 0x33333333 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f } + {FloatingBorder "Floating Border" floating_border 0x3f3f3ffd 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 } + + //- 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 0x00000000 0x00000000 0x00000000 0x00000000 } + {PlainButtonBackground "Plain Button Background" plain_button_background 0x1b1b1bfe 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 } + {PlainButtonBorder "Plain Button Border" plain_button_border 0x3f3f3ffe 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 } + {PositivePopButtonBackground "Positive Pop Button Background" positive_pop_button_background 0x2d7e3eff 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 } + {PositivePopButtonBorder "Positive Pop Button Border" positive_pop_button_border 0x3f3f3ffd 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 } + {NegativePopButtonBackground "Negative Pop Button Background" negative_pop_button_background 0x803425ff 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 } + {NegativePopButtonBorder "Negative Pop Button Border" negative_pop_button_border 0x3f3f3ffd 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 } + {NeutralPopButtonBackground "Neutral Pop Button Background" neutral_pop_button_background 0x355b6eff 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 } + {NeutralPopButtonBorder "Neutral Pop Button Border" neutral_pop_button_border 0x3f3f3ffd 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 } + {ScrollBarButtonBackground "Scroll Bar Button Background" scroll_bar_button_background 0x2b2b2bfe 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 } + {ScrollBarButtonBorder "Scroll Bar Button Border" scroll_bar_button_border 0x3f3f3ffe 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 } + {TabBackground "Tab Background" tab_background 0x7b4d27fe 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 } + {TabBorder "Tab Border" tab_border 0xb48300fd 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 } + {TabBackgroundInactive "Tab Background (Inactive)" tab_background_inactive 0x3e4c577f 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 } + {TabBorderInactive "Tab Border (Inactive)" tab_border_inactive 0xffffff19 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 } //- rjf: code ui colors {CodeBackgroundNegative "Code Background (Negative)" code_background_negative 0x3b1f1ffe 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f } {CodeLineNumbersActive "Code Line Numbers" code_line_numbers_active 0xbebebeff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff } {CodeLineNumbersInactive "Code Line Numbers (Inactive)" code_line_numbers_inactive 0x7f7f7fff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff } - //- rjf: code text colors + //- rjf: code colors {CodeDefault "Code (Default)" code_default 0xbebebeff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff } - {CodeProcedure "Code (Procedure)" code_procedure 0x6093c2ff 0x7fcc99ff 0x7fcc99ff 0x7fcc99ff 0x7fcc99ff 0x7fcc99ff 0x7fcc99ff 0x7fcc99ff 0x7fcc99ff } + {CodeSymbol "Code (Symbol)" code_symbol 0x6093c2ff 0x7fcc99ff 0x7fcc99ff 0x7fcc99ff 0x7fcc99ff 0x7fcc99ff 0x7fcc99ff 0x7fcc99ff 0x7fcc99ff } {CodeType "Code (Type)" code_type 0xecb31aff 0x66b2e5ff 0x66b2e5ff 0x66b2e5ff 0x66b2e5ff 0x66b2e5ff 0x66b2e5ff 0x66b2e5ff 0x66b2e5ff } {CodeLocal "Code (Local)" code_local 0xadc9e0ff 0xfe9548ff 0xfe9548ff 0xfe9548ff 0xfe9548ff 0xfe9548ff 0xfe9548ff 0xfe9548ff 0xfe9548ff } {CodeRegister "Code (Register)" code_register 0xb7afd5ff 0xd45d90ff 0xd45d90ff 0xd45d90ff 0xd45d90ff 0xd45d90ff 0xd45d90ff 0xd45d90ff 0xd45d90ff } @@ -449,6 +440,8 @@ DF_ThemeColorTable: {CodeString "Code (String)" code_string 0x89b379ff 0xe5cc66ff 0xe5cc66ff 0xe5cc66ff 0xe5cc66ff 0xe5cc66ff 0xe5cc66ff 0xe5cc66ff 0xe5cc66ff } {CodeMeta "Code (Meta)" code_meta 0x906f81ff 0xe54c4cff 0xe54c4cff 0xe54c4cff 0xe54c4cff 0xe54c4cff 0xe54c4cff 0xe54c4cff 0xe54c4cff } {CodeComment "Code (Comment)" code_comment 0x717171ff 0x7f7f7fff 0x7f7f7fff 0x7f7f7fff 0x7f7f7fff 0x7f7f7fff 0x7f7f7fff 0x7f7f7fff 0x7f7f7fff } + {CodeLineNumbers "Code Line Numbers" code_line_numbers 0x7f7f7fff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff } + {CodeLineNumbersSelected "Code Line Numbers (Selected)" code_line_numbers_selected 0xbebebeff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff } //- rjf: debugging colors {LineInfoBackground0 "Line Info Background 0" line_info_background_0 0x99503d3f 0x99503d3f 0x99503d3f 0x99503d3f 0x99503d3f 0x99503d3f 0x99503d3f 0x99503d3f 0x99503d3f } @@ -470,10 +463,6 @@ DF_ThemeColorTable: {ThreadUnwound "Thread (Unwound)" thread_unwound 0xb2ccd8ff 0xb2ccd8ff 0xb2ccd8ff 0xb2ccd8ff 0xb2ccd8ff 0xb2ccd8ff 0xb2ccd8ff 0xb2ccd8ff 0xb2ccd8ff } {ThreadError "Thread (Error)" thread_error 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff } {Breakpoint "Breakpoint" breakpoint 0xa72a12ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff } - - //- rjf: behavioral colors - {DropSiteOverlay "Drop Site Overlay" drop_site_overlay 0xffffff0c 0xffffff0c 0xffffff0c 0xffffff0c 0xffffff0c 0xffffff0c 0xffffff0c 0xffffff0c 0xffffff0c } - {InactivePanelOverlay "Inactive Panel Overlay" inactive_panel_overlay 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f } } @table(old_name new_name) diff --git a/src/df/gfx/df_view_rules.c b/src/df/gfx/df_view_rules.c index edea627e..17cda6c6 100644 --- a/src/df/gfx/df_view_rules.c +++ b/src/df/gfx/df_view_rules.c @@ -1046,7 +1046,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_DefaultTextWeak); + 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); diff --git a/src/df/gfx/df_views.c b/src/df/gfx/df_views.c index ffd95093..8dafaf84 100644 --- a/src/df/gfx/df_views.c +++ b/src/df/gfx/df_views.c @@ -1775,8 +1775,7 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS { if(row->flags & DF_EvalVizRowFlag_ExprIsSpecial) { - palette = ui_build_palette(ui_top_palette(), .text = df_rgba_from_theme_color(DF_ThemeColor_SpecialNegativeText), - .background = df_rgba_from_theme_color(DF_ThemeColor_SpecialNegativeBackground)); + palette = ui_build_palette(ui_top_palette(), .text = df_rgba_from_theme_color(DF_ThemeColor_TextNeutral)); } } @@ -1932,8 +1931,7 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS { if(row_is_bad) { - palette = ui_build_palette(ui_top_palette(), .text = df_rgba_from_theme_color(DF_ThemeColor_SpecialNegativeText), - .background = df_rgba_from_theme_color(DF_ThemeColor_SpecialNegativeBackground)); + palette = ui_build_palette(ui_top_palette(), .text = df_rgba_from_theme_color(DF_ThemeColor_TextNegative)); } } @@ -2132,7 +2130,7 @@ DF_VIEW_UI_FUNCTION_DEF(Empty) UI_TextAlignment(UI_TextAlign_Center) UI_PrefWidth(ui_em(15.f, 1.f)) UI_CornerRadius(ui_top_font_size()/2.f) - DF_Palette(DF_PaletteCode_SpecialNegative) + DF_Palette(DF_PaletteCode_NegativePopButton) { if(ui_clicked(df_icon_buttonf(DF_IconKind_X, 0, "Close Panel"))) { @@ -2206,7 +2204,7 @@ DF_VIEW_UI_FUNCTION_DEF(GettingStarted) UI_TextAlignment(UI_TextAlign_Center) UI_PrefWidth(ui_em(22.f, 1.f)) UI_CornerRadius(ui_top_font_size()/2.f) - DF_Palette(DF_PaletteCode_SpecialNeutral) + DF_Palette(DF_PaletteCode_NeutralPopButton) if(ui_clicked(df_icon_buttonf(DF_IconKind_Add, 0, "Add Target"))) { DF_CmdParams params = df_cmd_params_from_view(ws, panel, view); @@ -2228,7 +2226,7 @@ DF_VIEW_UI_FUNCTION_DEF(GettingStarted) UI_TextAlignment(UI_TextAlign_Center) UI_PrefWidth(ui_em(22.f, 1.f)) UI_CornerRadius(ui_top_font_size()/2.f) - DF_Palette(DF_PaletteCode_SpecialNeutral) + DF_Palette(DF_PaletteCode_PositivePopButton) { if(ui_clicked(df_icon_buttonf(DF_IconKind_Play, 0, "Launch %S", target_name))) { @@ -3384,12 +3382,12 @@ DF_VIEW_UI_FUNCTION_DEF(SymbolLister) "###procedure_%I64x", item->idx); UI_Parent(box) UI_PrefWidth(ui_text_dim(10, 1)) { - UI_Box *box = df_code_label(1.f, 0, df_rgba_from_theme_color(DF_ThemeColor_CodeProcedure), name); + UI_Box *box = df_code_label(1.f, 0, df_rgba_from_theme_color(DF_ThemeColor_CodeSymbol), name); ui_box_equip_fuzzy_match_ranges(box, &item->match_ranges); if(!tg_key_match(tg_key_zero(), type_key) && graph != 0) { String8 type_string = tg_string_from_key(scratch.arena, graph, rdi, type_key); - df_code_label(0.5f, 0, df_rgba_from_theme_color(DF_ThemeColor_DefaultTextWeak), type_string); + df_code_label(0.5f, 0, df_rgba_from_theme_color(DF_ThemeColor_TextWeak), type_string); } } @@ -3408,7 +3406,7 @@ DF_VIEW_UI_FUNCTION_DEF(SymbolLister) DF_TextLineDasm2SrcInfo dasm2src_info = df_text_line_dasm2src_info_from_dbgi_key_voff(&dbgi_key, binary_voff, 0); String8 file_path = df_full_path_from_entity(scratch.arena, dasm2src_info.file); S64 line_num = dasm2src_info.pt.line; - df_code_label(1.f, 0, df_rgba_from_theme_color(DF_ThemeColor_CodeProcedure), name); + df_code_label(1.f, 0, df_rgba_from_theme_color(DF_ThemeColor_CodeSymbol), name); UI_Font(df_font_from_slot(DF_FontSlot_Main)) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_labelf("Procedure #%I64u", item->idx); if(!df_entity_is_nil(dasm2src_info.file)) @@ -3612,7 +3610,7 @@ DF_VIEW_UI_FUNCTION_DEF(Target) { ui_label_multiline(ui_top_font_size()*30.f, str8_lit("By default, the debugger attempts to find a target's entry point with a set of default names, such as:")); ui_spacer(ui_em(1.5f, 1.f)); - UI_Font(df_font_from_slot(DF_FontSlot_Code)) UI_Palette(ui_build_palette(ui_top_palette(), .text = df_rgba_from_theme_color(DF_ThemeColor_CodeProcedure))) + UI_Font(df_font_from_slot(DF_FontSlot_Code)) UI_Palette(ui_build_palette(ui_top_palette(), .text = df_rgba_from_theme_color(DF_ThemeColor_CodeSymbol))) { ui_label(str8_lit("WinMain")); ui_label(str8_lit("wWinMain")); @@ -4717,11 +4715,11 @@ DF_VIEW_UI_FUNCTION_DEF(Scheduler) } else if(frozen) { - palette = df_palette_from_code(DF_PaletteCode_SpecialNegative); + palette = df_palette_from_code(DF_PaletteCode_NegativePopButton); } else { - palette = df_palette_from_code(DF_PaletteCode_SpecialPositive); + palette = df_palette_from_code(DF_PaletteCode_PositivePopButton); } UI_Signal sig = {0}; UI_Palette(palette) sig = df_icon_buttonf(frozen ? DF_IconKind_Locked : DF_IconKind_Unlocked, 0, "###lock_%p", entity); @@ -4778,7 +4776,7 @@ DF_VIEW_UI_FUNCTION_DEF(Scheduler) } UI_TableCellSized(ui_em(2.25f, 1.f)) UI_FocusHot((row_is_selected && cursor.x == 4) ? UI_FocusKind_On : UI_FocusKind_Off) { - DF_Palette(DF_PaletteCode_SpecialNegative) + DF_Palette(DF_PaletteCode_NegativePopButton) if(ui_clicked(df_icon_buttonf(DF_IconKind_X, 0, "###kill"))) { DF_CmdParams params = df_cmd_params_from_view(ws, panel, view); @@ -5016,7 +5014,7 @@ DF_VIEW_UI_FUNCTION_DEF(CallStack) } else UI_WidthFill { - D_FancyStringList symbol_name_fstrs = df_fancy_string_list_from_code_string(scratch.arena, 1.f, 0, df_rgba_from_theme_color(DF_ThemeColor_CodeProcedure), symbol_name); + D_FancyStringList symbol_name_fstrs = df_fancy_string_list_from_code_string(scratch.arena, 1.f, 0, df_rgba_from_theme_color(DF_ThemeColor_CodeSymbol), symbol_name); D_FancyStringList symbol_type_fstrs = df_fancy_string_list_from_code_string(scratch.arena, 0.5f, 0, df_rgba_from_theme_color(DF_ThemeColor_CodeDefault), symbol_type_string); D_FancyStringList fstrs = {0}; d_fancy_string_list_concat_in_place(&fstrs, &symbol_name_fstrs); @@ -5332,7 +5330,7 @@ DF_VIEW_UI_FUNCTION_DEF(Modules) UI_FocusActive((txt_is_selected && mv->txt_editing) ? UI_FocusKind_On : UI_FocusKind_Off) UI_WidthFill { - DF_Palette(dbgi_is_valid ? DF_PaletteCode_DefaultPositive : DF_PaletteCode_Default) + UI_Palette(dbgi_is_valid ? ui_top_palette() : ui_build_palette(ui_top_palette(), .text = df_rgba_from_theme_color(DF_ThemeColor_TextNegative))) sig = df_line_editf(DF_LineEditFlag_NoBackground, 0, 0, &mv->txt_cursor, &mv->txt_mark, mv->txt_buffer, sizeof(mv->txt_buffer), &mv->txt_size, 0, dbgi_path, "###dbg_path_%p", entity); edit_commit = (edit_commit || ui_committed(sig)); } @@ -5999,7 +5997,7 @@ DF_VIEW_UI_FUNCTION_DEF(Code) UI_PrefWidth(ui_children_sum(1)) UI_PrefHeight(ui_em(3, 1)) UI_Row UI_Padding(ui_pct(1, 0)) UI_PrefWidth(ui_text_dim(10, 1)) - DF_Palette(DF_PaletteCode_DefaultNegative) + UI_Palette(ui_build_palette(ui_top_palette(), .text = df_rgba_from_theme_color(DF_ThemeColor_TextNegative))) { UI_Font(df_font_from_slot(DF_FontSlot_Icons)) UI_RunFlags(F_RunFlag_Smooth) @@ -6012,7 +6010,7 @@ DF_VIEW_UI_FUNCTION_DEF(Code) UI_CornerRadius(ui_top_font_size()/3) UI_PrefWidth(ui_text_dim(10, 1)) UI_Focus(UI_FocusKind_On) - DF_Palette(DF_PaletteCode_SpecialNeutral) + DF_Palette(DF_PaletteCode_NeutralPopButton) if(ui_clicked(ui_buttonf("Find alternative..."))) { DF_CmdParams params = df_cmd_params_from_view(ws, panel, view); @@ -6554,7 +6552,7 @@ DF_VIEW_UI_FUNCTION_DEF(Code) if(file_is_out_of_date) { UI_Box *box = &ui_g_nil_box; - DF_Palette(DF_PaletteCode_SpecialNegative) + UI_Palette(ui_build_palette(ui_top_palette(), .text = df_rgba_from_theme_color(DF_ThemeColor_TextNegative))) UI_Font(df_font_from_slot(DF_FontSlot_Icons)) UI_RunFlags(F_RunFlag_Smooth) { @@ -8489,8 +8487,8 @@ DF_VIEW_UI_FUNCTION_DEF(Memory) // D_FancyStringList byte_fancy_strings[256] = {0}; { - Vec4F32 full_color = df_rgba_from_theme_color(DF_ThemeColor_DefaultTextPositive); - Vec4F32 zero_color = df_rgba_from_theme_color(DF_ThemeColor_DefaultTextWeak); + Vec4F32 full_color = df_rgba_from_theme_color(DF_ThemeColor_TextPositive); + Vec4F32 zero_color = df_rgba_from_theme_color(DF_ThemeColor_TextWeak); for(U64 idx = 0; idx < ArrayCount(byte_fancy_strings); idx += 1) { U8 byte = (U8)idx; @@ -8612,7 +8610,7 @@ DF_VIEW_UI_FUNCTION_DEF(Memory) Annotation *annotation = push_array(scratch.arena, Annotation, 1); annotation->name_string = symbol_name.size != 0 ? symbol_name : str8_lit("[external code]"); annotation->kind_string = str8_lit("Call Stack Frame"); - annotation->color = symbol_name.size != 0 ? df_rgba_from_theme_color(DF_ThemeColor_CodeProcedure) : df_rgba_from_theme_color(DF_ThemeColor_DefaultTextWeak); + annotation->color = symbol_name.size != 0 ? df_rgba_from_theme_color(DF_ThemeColor_CodeSymbol) : df_rgba_from_theme_color(DF_ThemeColor_TextWeak); annotation->vaddr_range = frame_vaddr_range; for(U64 vaddr = frame_vaddr_range_in_viz.min; vaddr < frame_vaddr_range_in_viz.max; vaddr += 1) { @@ -8635,7 +8633,7 @@ DF_VIEW_UI_FUNCTION_DEF(Memory) Annotation *annotation = push_array(scratch.arena, Annotation, 1); annotation->name_string = df_display_string_from_entity(scratch.arena, thread); annotation->kind_string = str8_lit("Stack"); - annotation->color = thread->flags & DF_EntityFlag_HasColor ? df_rgba_from_entity(thread) : df_rgba_from_theme_color(DF_ThemeColor_DefaultText); + annotation->color = thread->flags & DF_EntityFlag_HasColor ? df_rgba_from_entity(thread) : df_rgba_from_theme_color(DF_ThemeColor_Text); annotation->vaddr_range = stack_vaddr_range; for(U64 vaddr = stack_vaddr_range_in_viz.min; vaddr < stack_vaddr_range_in_viz.max; vaddr += 1) { @@ -9648,9 +9646,9 @@ DF_VIEW_UI_FUNCTION_DEF(Theme) preset = (DF_ThemePreset)(preset+1)) { Vec4F32 *colors = df_g_theme_preset_colors_table[preset]; - Vec4F32 bg_color = colors[DF_ThemeColor_DefaultBackground]; - Vec4F32 tx_color = colors[DF_ThemeColor_DefaultText]; - Vec4F32 bd_color = colors[DF_ThemeColor_DefaultBorder]; + Vec4F32 bg_color = colors[DF_ThemeColor_BaseBackground]; + Vec4F32 tx_color = colors[DF_ThemeColor_Text]; + Vec4F32 bd_color = colors[DF_ThemeColor_BaseBorder]; ui_set_next_palette(ui_build_palette(ui_top_palette(), .text = tx_color, .border = bd_color, .background = bg_color)); diff --git a/src/df/gfx/generated/df_gfx.meta.c b/src/df/gfx/generated/df_gfx.meta.c index 248a1e9d..5f42e79a 100644 --- a/src/df/gfx/generated/df_gfx.meta.c +++ b/src/df/gfx/generated/df_gfx.meta.c @@ -319,7 +319,7 @@ str8_lit_comp("special_neutral_background"), str8_lit_comp("special_neutral_border"), }; -Vec4F32 df_g_theme_preset_colors__default_dark[85] = +Vec4F32 df_g_theme_preset_colors__default_dark[78] = { rgba_from_u32_lit_comp(0xff00ffff), rgba_from_u32_lit_comp(0x99ccff4c), @@ -327,47 +327,40 @@ rgba_from_u32_lit_comp(0x0000007f), rgba_from_u32_lit_comp(0x8bff00ff), rgba_from_u32_lit_comp(0xb23217ff), rgba_from_u32_lit_comp(0xfea200ff), -rgba_from_u32_lit_comp(0x904334ff), +rgba_from_u32_lit_comp(0x7bffc7ff), rgba_from_u32_lit_comp(0xfe9603ff), rgba_from_u32_lit_comp(0x7bffc7ff), rgba_from_u32_lit_comp(0x0000003f), +rgba_from_u32_lit_comp(0xffffff0c), +rgba_from_u32_lit_comp(0x0000003f), rgba_from_u32_lit_comp(0xbebebeff), rgba_from_u32_lit_comp(0x4dc221ff), rgba_from_u32_lit_comp(0xc56553ff), rgba_from_u32_lit_comp(0x327fb2ff), rgba_from_u32_lit_comp(0xa4a4a4fe), rgba_from_u32_lit_comp(0x1b1b1bfe), +rgba_from_u32_lit_comp(0x2b2b2bfe), rgba_from_u32_lit_comp(0x3f3f3ffe), -rgba_from_u32_lit_comp(0xbebebeff), -rgba_from_u32_lit_comp(0x4dc220ff), -rgba_from_u32_lit_comp(0xc56452ff), -rgba_from_u32_lit_comp(0xa4a4a4ff), -rgba_from_u32_lit_comp(0x33333333), -rgba_from_u32_lit_comp(0x3f3f3ffd), -rgba_from_u32_lit_comp(0xfefefeff), -rgba_from_u32_lit_comp(0xa4a4a4fe), -rgba_from_u32_lit_comp(0x2d7e3eff), -rgba_from_u32_lit_comp(0x3f3f3ffd), -rgba_from_u32_lit_comp(0xfefefeff), -rgba_from_u32_lit_comp(0xa4a4a4fd), -rgba_from_u32_lit_comp(0x803425ff), -rgba_from_u32_lit_comp(0x3f3f3ffd), -rgba_from_u32_lit_comp(0xfefefeff), -rgba_from_u32_lit_comp(0xa4a4a4fd), -rgba_from_u32_lit_comp(0x355b6eff), -rgba_from_u32_lit_comp(0x3f3f3ffd), -rgba_from_u32_lit_comp(0xfefefeff), -rgba_from_u32_lit_comp(0xffffff7f), -rgba_from_u32_lit_comp(0x32b219ff), -rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0x3e4c577f), rgba_from_u32_lit_comp(0x3e4c577f), rgba_from_u32_lit_comp(0xffffff19), -rgba_from_u32_lit_comp(0xffffffff), -rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0x33333333), +rgba_from_u32_lit_comp(0x33333333), +rgba_from_u32_lit_comp(0x3f3f3ffd), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x1b1b1bfe), +rgba_from_u32_lit_comp(0x3f3f3ffe), +rgba_from_u32_lit_comp(0x2d7e3eff), +rgba_from_u32_lit_comp(0x3f3f3ffd), +rgba_from_u32_lit_comp(0x803425ff), +rgba_from_u32_lit_comp(0x3f3f3ffd), +rgba_from_u32_lit_comp(0x355b6eff), +rgba_from_u32_lit_comp(0x3f3f3ffd), +rgba_from_u32_lit_comp(0x2b2b2bfe), +rgba_from_u32_lit_comp(0x3f3f3ffe), rgba_from_u32_lit_comp(0x7b4d27fe), rgba_from_u32_lit_comp(0xb48300fd), -rgba_from_u32_lit_comp(0xa4a4a4fd), -rgba_from_u32_lit_comp(0x808080fd), rgba_from_u32_lit_comp(0x3e4c577f), rgba_from_u32_lit_comp(0xffffff19), rgba_from_u32_lit_comp(0x3b1f1ffe), @@ -385,6 +378,8 @@ rgba_from_u32_lit_comp(0x608752ff), rgba_from_u32_lit_comp(0x89b379ff), rgba_from_u32_lit_comp(0x906f81ff), rgba_from_u32_lit_comp(0x717171ff), +rgba_from_u32_lit_comp(0x7f7f7fff), +rgba_from_u32_lit_comp(0xbebebeff), rgba_from_u32_lit_comp(0x99503d3f), rgba_from_u32_lit_comp(0xfe82493f), rgba_from_u32_lit_comp(0xffba173f), @@ -404,11 +399,9 @@ rgba_from_u32_lit_comp(0x65ff4cff), rgba_from_u32_lit_comp(0xb2ccd8ff), rgba_from_u32_lit_comp(0xb23219ff), rgba_from_u32_lit_comp(0xa72a12ff), -rgba_from_u32_lit_comp(0xffffff0c), -rgba_from_u32_lit_comp(0x0000003f), }; -Vec4F32 df_g_theme_preset_colors__default_light[85] = +Vec4F32 df_g_theme_preset_colors__default_light[78] = { rgba_from_u32_lit_comp(0xff00ffff), rgba_from_u32_lit_comp(0x99ccff4c), @@ -416,9 +409,11 @@ rgba_from_u32_lit_comp(0x0000007f), rgba_from_u32_lit_comp(0x66e566e5), rgba_from_u32_lit_comp(0xb23219ff), rgba_from_u32_lit_comp(0xb27219ff), +rgba_from_u32_lit_comp(0xb27219ff), rgba_from_u32_lit_comp(0xb23219ff), rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0x0000003f), +rgba_from_u32_lit_comp(0xffffff0c), rgba_from_u32_lit_comp(0x0000003f), rgba_from_u32_lit_comp(0xe5e5e5ff), rgba_from_u32_lit_comp(0x32b219ff), @@ -426,39 +421,30 @@ rgba_from_u32_lit_comp(0xb23219ff), rgba_from_u32_lit_comp(0xb23219ff), rgba_from_u32_lit_comp(0xffffff7f), rgba_from_u32_lit_comp(0x3333337f), -rgba_from_u32_lit_comp(0xffffff19), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0x32b219ff), -rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xffffff7f), rgba_from_u32_lit_comp(0x3333337f), rgba_from_u32_lit_comp(0xffffff19), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0xffffff7f), -rgba_from_u32_lit_comp(0x32b219ff), -rgba_from_u32_lit_comp(0xffffff33), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0xffffff7f), -rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xffffff33), -rgba_from_u32_lit_comp(0xffffffff), -rgba_from_u32_lit_comp(0xffffff7f), -rgba_from_u32_lit_comp(0x327fb2ff), -rgba_from_u32_lit_comp(0xffffff33), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0xffffff7f), -rgba_from_u32_lit_comp(0x32b219ff), -rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0x3333337f), rgba_from_u32_lit_comp(0x3333337f), rgba_from_u32_lit_comp(0xffffff19), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0xffffff7f), -rgba_from_u32_lit_comp(0xa87a4c99), -rgba_from_u32_lit_comp(0xffffff19), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0xffffff7f), -rgba_from_u32_lit_comp(0x42474c7f), +rgba_from_u32_lit_comp(0x3333337f), +rgba_from_u32_lit_comp(0x3333337f), rgba_from_u32_lit_comp(0xffffff19), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), rgba_from_u32_lit_comp(0x3333337f), rgba_from_u32_lit_comp(0xe5e5e5ff), rgba_from_u32_lit_comp(0xe5e5e5ff), @@ -474,6 +460,8 @@ rgba_from_u32_lit_comp(0x4ca54cff), rgba_from_u32_lit_comp(0xe5cc66ff), rgba_from_u32_lit_comp(0xe54c4cff), rgba_from_u32_lit_comp(0x7f7f7fff), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0xe5e5e5ff), rgba_from_u32_lit_comp(0x99503d3f), rgba_from_u32_lit_comp(0xfe82493f), rgba_from_u32_lit_comp(0xffba173f), @@ -493,11 +481,9 @@ rgba_from_u32_lit_comp(0x65ff4cff), rgba_from_u32_lit_comp(0xb2ccd8ff), rgba_from_u32_lit_comp(0xb23219ff), rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xffffff0c), -rgba_from_u32_lit_comp(0x0000003f), }; -Vec4F32 df_g_theme_preset_colors__vs_dark[85] = +Vec4F32 df_g_theme_preset_colors__vs_dark[78] = { rgba_from_u32_lit_comp(0xff00ffff), rgba_from_u32_lit_comp(0x99ccff4c), @@ -505,9 +491,11 @@ rgba_from_u32_lit_comp(0x0000007f), rgba_from_u32_lit_comp(0x66e566e5), rgba_from_u32_lit_comp(0xb23219ff), rgba_from_u32_lit_comp(0xb27219ff), +rgba_from_u32_lit_comp(0xb27219ff), rgba_from_u32_lit_comp(0xb23219ff), rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0x0000003f), +rgba_from_u32_lit_comp(0xffffff0c), rgba_from_u32_lit_comp(0x0000003f), rgba_from_u32_lit_comp(0xe5e5e5ff), rgba_from_u32_lit_comp(0x32b219ff), @@ -515,39 +503,30 @@ rgba_from_u32_lit_comp(0xb23219ff), rgba_from_u32_lit_comp(0xb23219ff), rgba_from_u32_lit_comp(0xffffff7f), rgba_from_u32_lit_comp(0x3333337f), -rgba_from_u32_lit_comp(0xffffff19), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0x32b219ff), -rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xffffff7f), rgba_from_u32_lit_comp(0x3333337f), rgba_from_u32_lit_comp(0xffffff19), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0xffffff7f), -rgba_from_u32_lit_comp(0x32b219ff), -rgba_from_u32_lit_comp(0xffffff33), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0xffffff7f), -rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xffffff33), -rgba_from_u32_lit_comp(0xffffffff), -rgba_from_u32_lit_comp(0xffffff7f), -rgba_from_u32_lit_comp(0x327fb2ff), -rgba_from_u32_lit_comp(0xffffff33), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0xffffff7f), -rgba_from_u32_lit_comp(0x32b219ff), -rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0x3333337f), rgba_from_u32_lit_comp(0x3333337f), rgba_from_u32_lit_comp(0xffffff19), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0xffffff7f), -rgba_from_u32_lit_comp(0xa87a4c99), -rgba_from_u32_lit_comp(0xffffff19), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0xffffff7f), -rgba_from_u32_lit_comp(0x42474c7f), +rgba_from_u32_lit_comp(0x3333337f), +rgba_from_u32_lit_comp(0x3333337f), rgba_from_u32_lit_comp(0xffffff19), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), rgba_from_u32_lit_comp(0x3333337f), rgba_from_u32_lit_comp(0xe5e5e5ff), rgba_from_u32_lit_comp(0xe5e5e5ff), @@ -563,6 +542,8 @@ rgba_from_u32_lit_comp(0x4ca54cff), rgba_from_u32_lit_comp(0xe5cc66ff), rgba_from_u32_lit_comp(0xe54c4cff), rgba_from_u32_lit_comp(0x7f7f7fff), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0xe5e5e5ff), rgba_from_u32_lit_comp(0x99503d3f), rgba_from_u32_lit_comp(0xfe82493f), rgba_from_u32_lit_comp(0xffba173f), @@ -582,11 +563,9 @@ rgba_from_u32_lit_comp(0x65ff4cff), rgba_from_u32_lit_comp(0xb2ccd8ff), rgba_from_u32_lit_comp(0xb23219ff), rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xffffff0c), -rgba_from_u32_lit_comp(0x0000003f), }; -Vec4F32 df_g_theme_preset_colors__vs_light[85] = +Vec4F32 df_g_theme_preset_colors__vs_light[78] = { rgba_from_u32_lit_comp(0xff00ffff), rgba_from_u32_lit_comp(0x99ccff4c), @@ -594,9 +573,11 @@ rgba_from_u32_lit_comp(0x0000007f), rgba_from_u32_lit_comp(0x66e566e5), rgba_from_u32_lit_comp(0xb23219ff), rgba_from_u32_lit_comp(0xb27219ff), +rgba_from_u32_lit_comp(0xb27219ff), rgba_from_u32_lit_comp(0xb23219ff), rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0x0000003f), +rgba_from_u32_lit_comp(0xffffff0c), rgba_from_u32_lit_comp(0x0000003f), rgba_from_u32_lit_comp(0xe5e5e5ff), rgba_from_u32_lit_comp(0x32b219ff), @@ -604,39 +585,30 @@ rgba_from_u32_lit_comp(0xb23219ff), rgba_from_u32_lit_comp(0xb23219ff), rgba_from_u32_lit_comp(0xffffff7f), rgba_from_u32_lit_comp(0x3333337f), -rgba_from_u32_lit_comp(0xffffff19), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0x32b219ff), -rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xffffff7f), rgba_from_u32_lit_comp(0x3333337f), rgba_from_u32_lit_comp(0xffffff19), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0xffffff7f), -rgba_from_u32_lit_comp(0x32b219ff), -rgba_from_u32_lit_comp(0xffffff33), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0xffffff7f), -rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xffffff33), -rgba_from_u32_lit_comp(0xffffffff), -rgba_from_u32_lit_comp(0xffffff7f), -rgba_from_u32_lit_comp(0x327fb2ff), -rgba_from_u32_lit_comp(0xffffff33), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0xffffff7f), -rgba_from_u32_lit_comp(0x32b219ff), -rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0x3333337f), rgba_from_u32_lit_comp(0x3333337f), rgba_from_u32_lit_comp(0xffffff19), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0xffffff7f), -rgba_from_u32_lit_comp(0xa87a4c99), -rgba_from_u32_lit_comp(0xffffff19), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0xffffff7f), -rgba_from_u32_lit_comp(0x42474c7f), +rgba_from_u32_lit_comp(0x3333337f), +rgba_from_u32_lit_comp(0x3333337f), rgba_from_u32_lit_comp(0xffffff19), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), rgba_from_u32_lit_comp(0x3333337f), rgba_from_u32_lit_comp(0xe5e5e5ff), rgba_from_u32_lit_comp(0xe5e5e5ff), @@ -652,6 +624,8 @@ rgba_from_u32_lit_comp(0x4ca54cff), rgba_from_u32_lit_comp(0xe5cc66ff), rgba_from_u32_lit_comp(0xe54c4cff), rgba_from_u32_lit_comp(0x7f7f7fff), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0xe5e5e5ff), rgba_from_u32_lit_comp(0x99503d3f), rgba_from_u32_lit_comp(0xfe82493f), rgba_from_u32_lit_comp(0xffba173f), @@ -671,11 +645,9 @@ rgba_from_u32_lit_comp(0x65ff4cff), rgba_from_u32_lit_comp(0xb2ccd8ff), rgba_from_u32_lit_comp(0xb23219ff), rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xffffff0c), -rgba_from_u32_lit_comp(0x0000003f), }; -Vec4F32 df_g_theme_preset_colors__solarized_dark[85] = +Vec4F32 df_g_theme_preset_colors__solarized_dark[78] = { rgba_from_u32_lit_comp(0xff00ffff), rgba_from_u32_lit_comp(0x99ccff4c), @@ -683,9 +655,11 @@ rgba_from_u32_lit_comp(0x0000007f), rgba_from_u32_lit_comp(0x66e566e5), rgba_from_u32_lit_comp(0xb23219ff), rgba_from_u32_lit_comp(0xb27219ff), +rgba_from_u32_lit_comp(0xb27219ff), rgba_from_u32_lit_comp(0xb23219ff), rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0x0000003f), +rgba_from_u32_lit_comp(0xffffff0c), rgba_from_u32_lit_comp(0x0000003f), rgba_from_u32_lit_comp(0xe5e5e5ff), rgba_from_u32_lit_comp(0x32b219ff), @@ -693,39 +667,30 @@ rgba_from_u32_lit_comp(0xb23219ff), rgba_from_u32_lit_comp(0xb23219ff), rgba_from_u32_lit_comp(0xffffff7f), rgba_from_u32_lit_comp(0x3333337f), -rgba_from_u32_lit_comp(0xffffff19), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0x32b219ff), -rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xffffff7f), rgba_from_u32_lit_comp(0x3333337f), rgba_from_u32_lit_comp(0xffffff19), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0xffffff7f), -rgba_from_u32_lit_comp(0x32b219ff), -rgba_from_u32_lit_comp(0xffffff33), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0xffffff7f), -rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xffffff33), -rgba_from_u32_lit_comp(0xffffffff), -rgba_from_u32_lit_comp(0xffffff7f), -rgba_from_u32_lit_comp(0x327fb2ff), -rgba_from_u32_lit_comp(0xffffff33), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0xffffff7f), -rgba_from_u32_lit_comp(0x32b219ff), -rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0x3333337f), rgba_from_u32_lit_comp(0x3333337f), rgba_from_u32_lit_comp(0xffffff19), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0xffffff7f), -rgba_from_u32_lit_comp(0xa87a4c99), -rgba_from_u32_lit_comp(0xffffff19), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0xffffff7f), -rgba_from_u32_lit_comp(0x42474c7f), +rgba_from_u32_lit_comp(0x3333337f), +rgba_from_u32_lit_comp(0x3333337f), rgba_from_u32_lit_comp(0xffffff19), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), rgba_from_u32_lit_comp(0x3333337f), rgba_from_u32_lit_comp(0xe5e5e5ff), rgba_from_u32_lit_comp(0xe5e5e5ff), @@ -741,6 +706,8 @@ rgba_from_u32_lit_comp(0x4ca54cff), rgba_from_u32_lit_comp(0xe5cc66ff), rgba_from_u32_lit_comp(0xe54c4cff), rgba_from_u32_lit_comp(0x7f7f7fff), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0xe5e5e5ff), rgba_from_u32_lit_comp(0x99503d3f), rgba_from_u32_lit_comp(0xfe82493f), rgba_from_u32_lit_comp(0xffba173f), @@ -760,11 +727,9 @@ rgba_from_u32_lit_comp(0x65ff4cff), rgba_from_u32_lit_comp(0xb2ccd8ff), rgba_from_u32_lit_comp(0xb23219ff), rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xffffff0c), -rgba_from_u32_lit_comp(0x0000003f), }; -Vec4F32 df_g_theme_preset_colors__solarized_light[85] = +Vec4F32 df_g_theme_preset_colors__solarized_light[78] = { rgba_from_u32_lit_comp(0xff00ffff), rgba_from_u32_lit_comp(0x99ccff4c), @@ -772,9 +737,11 @@ rgba_from_u32_lit_comp(0x0000007f), rgba_from_u32_lit_comp(0x66e566e5), rgba_from_u32_lit_comp(0xb23219ff), rgba_from_u32_lit_comp(0xb27219ff), +rgba_from_u32_lit_comp(0xb27219ff), rgba_from_u32_lit_comp(0xb23219ff), rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0x0000003f), +rgba_from_u32_lit_comp(0xffffff0c), rgba_from_u32_lit_comp(0x0000003f), rgba_from_u32_lit_comp(0xe5e5e5ff), rgba_from_u32_lit_comp(0x32b219ff), @@ -782,39 +749,30 @@ rgba_from_u32_lit_comp(0xb23219ff), rgba_from_u32_lit_comp(0xb23219ff), rgba_from_u32_lit_comp(0xffffff7f), rgba_from_u32_lit_comp(0x3333337f), -rgba_from_u32_lit_comp(0xffffff19), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0x32b219ff), -rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xffffff7f), rgba_from_u32_lit_comp(0x3333337f), rgba_from_u32_lit_comp(0xffffff19), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0xffffff7f), -rgba_from_u32_lit_comp(0x32b219ff), -rgba_from_u32_lit_comp(0xffffff33), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0xffffff7f), -rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xffffff33), -rgba_from_u32_lit_comp(0xffffffff), -rgba_from_u32_lit_comp(0xffffff7f), -rgba_from_u32_lit_comp(0x327fb2ff), -rgba_from_u32_lit_comp(0xffffff33), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0xffffff7f), -rgba_from_u32_lit_comp(0x32b219ff), -rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0x3333337f), rgba_from_u32_lit_comp(0x3333337f), rgba_from_u32_lit_comp(0xffffff19), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0xffffff7f), -rgba_from_u32_lit_comp(0xa87a4c99), -rgba_from_u32_lit_comp(0xffffff19), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0xffffff7f), -rgba_from_u32_lit_comp(0x42474c7f), +rgba_from_u32_lit_comp(0x3333337f), +rgba_from_u32_lit_comp(0x3333337f), rgba_from_u32_lit_comp(0xffffff19), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), rgba_from_u32_lit_comp(0x3333337f), rgba_from_u32_lit_comp(0xe5e5e5ff), rgba_from_u32_lit_comp(0xe5e5e5ff), @@ -830,6 +788,8 @@ rgba_from_u32_lit_comp(0x4ca54cff), rgba_from_u32_lit_comp(0xe5cc66ff), rgba_from_u32_lit_comp(0xe54c4cff), rgba_from_u32_lit_comp(0x7f7f7fff), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0xe5e5e5ff), rgba_from_u32_lit_comp(0x99503d3f), rgba_from_u32_lit_comp(0xfe82493f), rgba_from_u32_lit_comp(0xffba173f), @@ -849,11 +809,9 @@ rgba_from_u32_lit_comp(0x65ff4cff), rgba_from_u32_lit_comp(0xb2ccd8ff), rgba_from_u32_lit_comp(0xb23219ff), rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xffffff0c), -rgba_from_u32_lit_comp(0x0000003f), }; -Vec4F32 df_g_theme_preset_colors__handmade_hero[85] = +Vec4F32 df_g_theme_preset_colors__handmade_hero[78] = { rgba_from_u32_lit_comp(0xff00ffff), rgba_from_u32_lit_comp(0x99ccff4c), @@ -861,9 +819,11 @@ rgba_from_u32_lit_comp(0x0000007f), rgba_from_u32_lit_comp(0x66e566e5), rgba_from_u32_lit_comp(0xb23219ff), rgba_from_u32_lit_comp(0xb27219ff), +rgba_from_u32_lit_comp(0xb27219ff), rgba_from_u32_lit_comp(0xb23219ff), rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0x0000003f), +rgba_from_u32_lit_comp(0xffffff0c), rgba_from_u32_lit_comp(0x0000003f), rgba_from_u32_lit_comp(0xe5e5e5ff), rgba_from_u32_lit_comp(0x32b219ff), @@ -871,39 +831,30 @@ rgba_from_u32_lit_comp(0xb23219ff), rgba_from_u32_lit_comp(0xb23219ff), rgba_from_u32_lit_comp(0xffffff7f), rgba_from_u32_lit_comp(0x3333337f), -rgba_from_u32_lit_comp(0xffffff19), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0x32b219ff), -rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xffffff7f), rgba_from_u32_lit_comp(0x3333337f), rgba_from_u32_lit_comp(0xffffff19), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0xffffff7f), -rgba_from_u32_lit_comp(0x32b219ff), -rgba_from_u32_lit_comp(0xffffff33), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0xffffff7f), -rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xffffff33), -rgba_from_u32_lit_comp(0xffffffff), -rgba_from_u32_lit_comp(0xffffff7f), -rgba_from_u32_lit_comp(0x327fb2ff), -rgba_from_u32_lit_comp(0xffffff33), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0xffffff7f), -rgba_from_u32_lit_comp(0x32b219ff), -rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0x3333337f), rgba_from_u32_lit_comp(0x3333337f), rgba_from_u32_lit_comp(0xffffff19), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0xffffff7f), -rgba_from_u32_lit_comp(0xa87a4c99), -rgba_from_u32_lit_comp(0xffffff19), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0xffffff7f), -rgba_from_u32_lit_comp(0x42474c7f), +rgba_from_u32_lit_comp(0x3333337f), +rgba_from_u32_lit_comp(0x3333337f), rgba_from_u32_lit_comp(0xffffff19), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), rgba_from_u32_lit_comp(0x3333337f), rgba_from_u32_lit_comp(0xe5e5e5ff), rgba_from_u32_lit_comp(0xe5e5e5ff), @@ -919,6 +870,8 @@ rgba_from_u32_lit_comp(0x4ca54cff), rgba_from_u32_lit_comp(0xe5cc66ff), rgba_from_u32_lit_comp(0xe54c4cff), rgba_from_u32_lit_comp(0x7f7f7fff), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0xe5e5e5ff), rgba_from_u32_lit_comp(0x99503d3f), rgba_from_u32_lit_comp(0xfe82493f), rgba_from_u32_lit_comp(0xffba173f), @@ -938,11 +891,9 @@ rgba_from_u32_lit_comp(0x65ff4cff), rgba_from_u32_lit_comp(0xb2ccd8ff), rgba_from_u32_lit_comp(0xb23219ff), rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xffffff0c), -rgba_from_u32_lit_comp(0x0000003f), }; -Vec4F32 df_g_theme_preset_colors__four_coder[85] = +Vec4F32 df_g_theme_preset_colors__four_coder[78] = { rgba_from_u32_lit_comp(0xff00ffff), rgba_from_u32_lit_comp(0x99ccff4c), @@ -950,9 +901,11 @@ rgba_from_u32_lit_comp(0x0000007f), rgba_from_u32_lit_comp(0x66e566e5), rgba_from_u32_lit_comp(0xb23219ff), rgba_from_u32_lit_comp(0xb27219ff), +rgba_from_u32_lit_comp(0xb27219ff), rgba_from_u32_lit_comp(0xb23219ff), rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0x0000003f), +rgba_from_u32_lit_comp(0xffffff0c), rgba_from_u32_lit_comp(0x0000003f), rgba_from_u32_lit_comp(0xe5e5e5ff), rgba_from_u32_lit_comp(0x32b219ff), @@ -960,39 +913,30 @@ rgba_from_u32_lit_comp(0xb23219ff), rgba_from_u32_lit_comp(0xb23219ff), rgba_from_u32_lit_comp(0xffffff7f), rgba_from_u32_lit_comp(0x3333337f), -rgba_from_u32_lit_comp(0xffffff19), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0x32b219ff), -rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xffffff7f), rgba_from_u32_lit_comp(0x3333337f), rgba_from_u32_lit_comp(0xffffff19), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0xffffff7f), -rgba_from_u32_lit_comp(0x32b219ff), -rgba_from_u32_lit_comp(0xffffff33), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0xffffff7f), -rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xffffff33), -rgba_from_u32_lit_comp(0xffffffff), -rgba_from_u32_lit_comp(0xffffff7f), -rgba_from_u32_lit_comp(0x327fb2ff), -rgba_from_u32_lit_comp(0xffffff33), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0xffffff7f), -rgba_from_u32_lit_comp(0x32b219ff), -rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0x3333337f), rgba_from_u32_lit_comp(0x3333337f), rgba_from_u32_lit_comp(0xffffff19), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0xffffff7f), -rgba_from_u32_lit_comp(0xa87a4c99), -rgba_from_u32_lit_comp(0xffffff19), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0xffffff7f), -rgba_from_u32_lit_comp(0x42474c7f), +rgba_from_u32_lit_comp(0x3333337f), +rgba_from_u32_lit_comp(0x3333337f), rgba_from_u32_lit_comp(0xffffff19), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), rgba_from_u32_lit_comp(0x3333337f), rgba_from_u32_lit_comp(0xe5e5e5ff), rgba_from_u32_lit_comp(0xe5e5e5ff), @@ -1008,6 +952,8 @@ rgba_from_u32_lit_comp(0x4ca54cff), rgba_from_u32_lit_comp(0xe5cc66ff), rgba_from_u32_lit_comp(0xe54c4cff), rgba_from_u32_lit_comp(0x7f7f7fff), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0xe5e5e5ff), rgba_from_u32_lit_comp(0x99503d3f), rgba_from_u32_lit_comp(0xfe82493f), rgba_from_u32_lit_comp(0xffba173f), @@ -1027,11 +973,9 @@ rgba_from_u32_lit_comp(0x65ff4cff), rgba_from_u32_lit_comp(0xb2ccd8ff), rgba_from_u32_lit_comp(0xb23219ff), rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xffffff0c), -rgba_from_u32_lit_comp(0x0000003f), }; -Vec4F32 df_g_theme_preset_colors__far_manager[85] = +Vec4F32 df_g_theme_preset_colors__far_manager[78] = { rgba_from_u32_lit_comp(0xff00ffff), rgba_from_u32_lit_comp(0x99ccff4c), @@ -1039,9 +983,11 @@ rgba_from_u32_lit_comp(0x0000007f), rgba_from_u32_lit_comp(0x66e566e5), rgba_from_u32_lit_comp(0xb23219ff), rgba_from_u32_lit_comp(0xb27219ff), +rgba_from_u32_lit_comp(0xb27219ff), rgba_from_u32_lit_comp(0xb23219ff), rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0x0000003f), +rgba_from_u32_lit_comp(0xffffff0c), rgba_from_u32_lit_comp(0x0000003f), rgba_from_u32_lit_comp(0xe5e5e5ff), rgba_from_u32_lit_comp(0x32b219ff), @@ -1049,39 +995,30 @@ rgba_from_u32_lit_comp(0xb23219ff), rgba_from_u32_lit_comp(0xb23219ff), rgba_from_u32_lit_comp(0xffffff7f), rgba_from_u32_lit_comp(0x3333337f), -rgba_from_u32_lit_comp(0xffffff19), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0x32b219ff), -rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xffffff7f), rgba_from_u32_lit_comp(0x3333337f), rgba_from_u32_lit_comp(0xffffff19), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0xffffff7f), -rgba_from_u32_lit_comp(0x32b219ff), -rgba_from_u32_lit_comp(0xffffff33), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0xffffff7f), -rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xffffff33), -rgba_from_u32_lit_comp(0xffffffff), -rgba_from_u32_lit_comp(0xffffff7f), -rgba_from_u32_lit_comp(0x327fb2ff), -rgba_from_u32_lit_comp(0xffffff33), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0xffffff7f), -rgba_from_u32_lit_comp(0x32b219ff), -rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0x3333337f), rgba_from_u32_lit_comp(0x3333337f), rgba_from_u32_lit_comp(0xffffff19), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0xffffff7f), -rgba_from_u32_lit_comp(0xa87a4c99), -rgba_from_u32_lit_comp(0xffffff19), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0xffffff7f), -rgba_from_u32_lit_comp(0x42474c7f), +rgba_from_u32_lit_comp(0x3333337f), +rgba_from_u32_lit_comp(0x3333337f), rgba_from_u32_lit_comp(0xffffff19), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), rgba_from_u32_lit_comp(0x3333337f), rgba_from_u32_lit_comp(0xe5e5e5ff), rgba_from_u32_lit_comp(0xe5e5e5ff), @@ -1097,6 +1034,8 @@ rgba_from_u32_lit_comp(0x4ca54cff), rgba_from_u32_lit_comp(0xe5cc66ff), rgba_from_u32_lit_comp(0xe54c4cff), rgba_from_u32_lit_comp(0x7f7f7fff), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0xe5e5e5ff), rgba_from_u32_lit_comp(0x99503d3f), rgba_from_u32_lit_comp(0xfe82493f), rgba_from_u32_lit_comp(0xffba173f), @@ -1116,8 +1055,6 @@ rgba_from_u32_lit_comp(0x65ff4cff), rgba_from_u32_lit_comp(0xb2ccd8ff), rgba_from_u32_lit_comp(0xb23219ff), rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xffffff0c), -rgba_from_u32_lit_comp(0x0000003f), }; Vec4F32* df_g_theme_preset_colors_table[9] = @@ -1133,7 +1070,7 @@ df_g_theme_preset_colors__four_coder, df_g_theme_preset_colors__far_manager, }; -String8 df_g_theme_color_display_string_table[85] = +String8 df_g_theme_color_display_string_table[78] = { str8_lit_comp("Null"), str8_lit_comp("Selection"), @@ -1141,54 +1078,47 @@ str8_lit_comp("Drop Shadow"), str8_lit_comp("Cursor"), str8_lit_comp("Cursor (Inactive)"), str8_lit_comp("Focus"), -str8_lit_comp("Focus (Inactive)"), +str8_lit_comp("Hover"), str8_lit_comp("Highlight 0"), str8_lit_comp("Highlight 1"), str8_lit_comp("Disabled Overlay"), -str8_lit_comp("Default Text"), -str8_lit_comp("Default Text (Positive)"), -str8_lit_comp("Default Text (Negative)"), -str8_lit_comp("Default Text (Neutral)"), -str8_lit_comp("Default Text (Weak)"), -str8_lit_comp("Default Background"), -str8_lit_comp("Default Border"), -str8_lit_comp("Floating Text"), -str8_lit_comp("Floating Text (Positive)"), -str8_lit_comp("Floating Text (Negative)"), -str8_lit_comp("Floating Text (Weak)"), -str8_lit_comp("Floating Background"), -str8_lit_comp("Floating Border"), -str8_lit_comp("Special Positive Text"), -str8_lit_comp("Special Positive Text (Weak)"), -str8_lit_comp("Special Positive Background"), -str8_lit_comp("Special Positive Border"), -str8_lit_comp("Special Negative Text"), -str8_lit_comp("Special Negative Text (Weak)"), -str8_lit_comp("Special Negative Background"), -str8_lit_comp("Special Negative Border"), -str8_lit_comp("Special Neutral Text"), -str8_lit_comp("Special Neutral Text (Weak)"), -str8_lit_comp("Special Neutral Background"), -str8_lit_comp("Special Neutral Border"), -str8_lit_comp("Menu Bar Text"), -str8_lit_comp("Menu Bar Text (Weak)"), -str8_lit_comp("Menu Bar Text (Positive)"), -str8_lit_comp("Menu Bar Text (Negative)"), +str8_lit_comp("Drop Site Overlay"), +str8_lit_comp("Inactive Panel Overlay"), +str8_lit_comp("Text"), +str8_lit_comp("Text (Positive)"), +str8_lit_comp("Text (Negative)"), +str8_lit_comp("Text (Neutral)"), +str8_lit_comp("Text (Weak)"), +str8_lit_comp("Base Background"), +str8_lit_comp("Base Background (Alternate)"), +str8_lit_comp("Base Border"), str8_lit_comp("Menu Bar Background"), +str8_lit_comp("Menu Bar Background (Alternate)"), str8_lit_comp("Menu Bar Border"), -str8_lit_comp("Tab Text"), -str8_lit_comp("Tab Text (Weak)"), +str8_lit_comp("Floating Background"), +str8_lit_comp("Floating Background (Alternate)"), +str8_lit_comp("Floating Border"), +str8_lit_comp("Implicit Button Background"), +str8_lit_comp("Implicit Button Border"), +str8_lit_comp("Plain Button Background"), +str8_lit_comp("Plain Button Border"), +str8_lit_comp("Positive Pop Button Background"), +str8_lit_comp("Positive Pop Button Border"), +str8_lit_comp("Negative Pop Button Background"), +str8_lit_comp("Negative Pop Button Border"), +str8_lit_comp("Neutral Pop Button Background"), +str8_lit_comp("Neutral Pop Button Border"), +str8_lit_comp("Scroll Bar Button Background"), +str8_lit_comp("Scroll Bar Button Border"), str8_lit_comp("Tab Background"), str8_lit_comp("Tab Border"), -str8_lit_comp("Tab Text (Inactive)"), -str8_lit_comp("Tab Text (Inactive, Weak)"), str8_lit_comp("Tab Background (Inactive)"), str8_lit_comp("Tab Border (Inactive)"), str8_lit_comp("Code Background (Negative)"), str8_lit_comp("Code Line Numbers"), str8_lit_comp("Code Line Numbers (Inactive)"), str8_lit_comp("Code (Default)"), -str8_lit_comp("Code (Procedure)"), +str8_lit_comp("Code (Symbol)"), str8_lit_comp("Code (Type)"), str8_lit_comp("Code (Local)"), str8_lit_comp("Code (Register)"), @@ -1199,6 +1129,8 @@ str8_lit_comp("Code (Numeric, Alt. Digit Group)"), str8_lit_comp("Code (String)"), str8_lit_comp("Code (Meta)"), str8_lit_comp("Code (Comment)"), +str8_lit_comp("Code Line Numbers"), +str8_lit_comp("Code Line Numbers (Selected)"), str8_lit_comp("Line Info Background 0"), str8_lit_comp("Line Info Background 1"), str8_lit_comp("Line Info Background 2"), @@ -1218,66 +1150,57 @@ str8_lit_comp("Thread 7"), str8_lit_comp("Thread (Unwound)"), str8_lit_comp("Thread (Error)"), str8_lit_comp("Breakpoint"), -str8_lit_comp("Drop Site Overlay"), -str8_lit_comp("Inactive Panel Overlay"), }; -String8 df_g_theme_color_cfg_string_table[85] = +String8 df_g_theme_color_cfg_string_table[78] = { str8_lit_comp("null"), str8_lit_comp("selection"), str8_lit_comp("drop_shadow"), -str8_lit_comp("cursor_active"), +str8_lit_comp("cursor"), str8_lit_comp("cursor_inactive"), -str8_lit_comp("focus_active"), -str8_lit_comp("focus_inactive"), +str8_lit_comp("focus"), +str8_lit_comp("hover"), str8_lit_comp("highlight_0"), str8_lit_comp("highlight_1"), str8_lit_comp("disabled_overlay"), -str8_lit_comp("default_text"), -str8_lit_comp("default_text_positive"), -str8_lit_comp("default_text_negative"), -str8_lit_comp("default_text_neutral"), -str8_lit_comp("default_text_weak"), -str8_lit_comp("default_background"), -str8_lit_comp("default_border"), -str8_lit_comp("floating_text"), -str8_lit_comp("floating_text_positive"), -str8_lit_comp("floating_text_negative"), -str8_lit_comp("floating_text_weak"), -str8_lit_comp("floating_background"), -str8_lit_comp("floating_border"), -str8_lit_comp("special_positive_text"), -str8_lit_comp("special_positive_text_weak"), -str8_lit_comp("special_positive_background"), -str8_lit_comp("special_positive_border"), -str8_lit_comp("special_negative_text"), -str8_lit_comp("special_negative_text_weak"), -str8_lit_comp("special_negative_background"), -str8_lit_comp("special_negative_border"), -str8_lit_comp("special_neutral_text"), -str8_lit_comp("special_neutral_text_weak"), -str8_lit_comp("special_neutral_background"), -str8_lit_comp("special_neutral_border"), -str8_lit_comp("menu_bar_text"), -str8_lit_comp("menu_bar_text_weak"), -str8_lit_comp("menu_bar_text_positive"), -str8_lit_comp("menu_bar_text_negative"), +str8_lit_comp("drop_site_overlay"), +str8_lit_comp("inactive_panel_overlay"), +str8_lit_comp("text"), +str8_lit_comp("text_positive"), +str8_lit_comp("text_negative"), +str8_lit_comp("text_neutral"), +str8_lit_comp("text_weak"), +str8_lit_comp("base_background"), +str8_lit_comp("base_background_alt"), +str8_lit_comp("base_border"), str8_lit_comp("menu_bar_background"), +str8_lit_comp("menu_bar_background_alt"), str8_lit_comp("menu_bar_border"), -str8_lit_comp("tab_active_text"), -str8_lit_comp("tab_active_text_weak"), -str8_lit_comp("tab_active_background"), -str8_lit_comp("tab_active_border"), -str8_lit_comp("tab_inactive_text"), -str8_lit_comp("tab_inactive_text_weak"), -str8_lit_comp("tab_inactive_background"), -str8_lit_comp("tab_inactive_border"), +str8_lit_comp("floating_background"), +str8_lit_comp("floating_background_alt"), +str8_lit_comp("floating_border"), +str8_lit_comp("implicit_button_background"), +str8_lit_comp("implicit_button_border"), +str8_lit_comp("plain_button_background"), +str8_lit_comp("plain_button_border"), +str8_lit_comp("positive_pop_button_background"), +str8_lit_comp("positive_pop_button_border"), +str8_lit_comp("negative_pop_button_background"), +str8_lit_comp("negative_pop_button_border"), +str8_lit_comp("neutral_pop_button_background"), +str8_lit_comp("neutral_pop_button_border"), +str8_lit_comp("scroll_bar_button_background"), +str8_lit_comp("scroll_bar_button_border"), +str8_lit_comp("tab_background"), +str8_lit_comp("tab_border"), +str8_lit_comp("tab_background_inactive"), +str8_lit_comp("tab_border_inactive"), str8_lit_comp("code_background_negative"), str8_lit_comp("code_line_numbers_active"), str8_lit_comp("code_line_numbers_inactive"), str8_lit_comp("code_default"), -str8_lit_comp("code_procedure"), +str8_lit_comp("code_symbol"), str8_lit_comp("code_type"), str8_lit_comp("code_local"), str8_lit_comp("code_register"), @@ -1288,6 +1211,8 @@ str8_lit_comp("code_numeric_alt_digit_group"), str8_lit_comp("code_string"), str8_lit_comp("code_meta"), str8_lit_comp("code_comment"), +str8_lit_comp("code_line_numbers"), +str8_lit_comp("code_line_numbers_selected"), str8_lit_comp("line_info_background_0"), str8_lit_comp("line_info_background_1"), str8_lit_comp("line_info_background_2"), @@ -1307,8 +1232,6 @@ str8_lit_comp("thread_7"), str8_lit_comp("thread_unwound"), str8_lit_comp("thread_error"), str8_lit_comp("breakpoint"), -str8_lit_comp("drop_site_overlay"), -str8_lit_comp("inactive_panel_overlay"), }; C_LINKAGE_END diff --git a/src/df/gfx/generated/df_gfx.meta.h b/src/df/gfx/generated/df_gfx.meta.h index 8b3989bf..f28b14c2 100644 --- a/src/df/gfx/generated/df_gfx.meta.h +++ b/src/df/gfx/generated/df_gfx.meta.h @@ -47,57 +47,50 @@ typedef enum DF_ThemeColor DF_ThemeColor_Null, DF_ThemeColor_Selection, DF_ThemeColor_DropShadow, -DF_ThemeColor_CursorActive, +DF_ThemeColor_Cursor, DF_ThemeColor_CursorInactive, -DF_ThemeColor_FocusActive, -DF_ThemeColor_FocusInactive, +DF_ThemeColor_Focus, +DF_ThemeColor_Hover, DF_ThemeColor_Highlight0, DF_ThemeColor_Highlight1, DF_ThemeColor_DisabledOverlay, -DF_ThemeColor_DefaultText, -DF_ThemeColor_DefaultTextPositive, -DF_ThemeColor_DefaultTextNegative, -DF_ThemeColor_DefaultTextNeutral, -DF_ThemeColor_DefaultTextWeak, -DF_ThemeColor_DefaultBackground, -DF_ThemeColor_DefaultBorder, -DF_ThemeColor_FloatingText, -DF_ThemeColor_FloatingTextPositive, -DF_ThemeColor_FloatingTextNegative, -DF_ThemeColor_FloatingTextWeak, -DF_ThemeColor_FloatingBackground, -DF_ThemeColor_FloatingBorder, -DF_ThemeColor_SpecialPositiveText, -DF_ThemeColor_SpecialPositiveTextWeak, -DF_ThemeColor_SpecialPositiveBackground, -DF_ThemeColor_SpecialPositiveBorder, -DF_ThemeColor_SpecialNegativeText, -DF_ThemeColor_SpecialNegativeTextWeak, -DF_ThemeColor_SpecialNegativeBackground, -DF_ThemeColor_SpecialNegativeBorder, -DF_ThemeColor_SpecialNeutralText, -DF_ThemeColor_SpecialNeutralTextWeak, -DF_ThemeColor_SpecialNeutralBackground, -DF_ThemeColor_SpecialNeutralBorder, -DF_ThemeColor_MenuBarText, -DF_ThemeColor_MenuBarTextWeak, -DF_ThemeColor_MenuBarTextPositive, -DF_ThemeColor_MenuBarTextNegative, +DF_ThemeColor_DropSiteOverlay, +DF_ThemeColor_InactivePanelOverlay, +DF_ThemeColor_Text, +DF_ThemeColor_TextPositive, +DF_ThemeColor_TextNegative, +DF_ThemeColor_TextNeutral, +DF_ThemeColor_TextWeak, +DF_ThemeColor_BaseBackground, +DF_ThemeColor_BaseBackgroundAlt, +DF_ThemeColor_BaseBorder, DF_ThemeColor_MenuBarBackground, +DF_ThemeColor_MenuBarBackgroundAlt, DF_ThemeColor_MenuBarBorder, -DF_ThemeColor_TabActiveText, -DF_ThemeColor_TabActiveTextWeak, -DF_ThemeColor_TabActiveBackground, -DF_ThemeColor_TabActiveBorder, -DF_ThemeColor_TabInactiveText, -DF_ThemeColor_TabInactiveTextWeak, -DF_ThemeColor_TabInactiveBackground, -DF_ThemeColor_TabInactiveBorder, +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_CodeBackgroundNegative, DF_ThemeColor_CodeLineNumbersActive, DF_ThemeColor_CodeLineNumbersInactive, DF_ThemeColor_CodeDefault, -DF_ThemeColor_CodeProcedure, +DF_ThemeColor_CodeSymbol, DF_ThemeColor_CodeType, DF_ThemeColor_CodeLocal, DF_ThemeColor_CodeRegister, @@ -108,6 +101,8 @@ DF_ThemeColor_CodeNumericAltDigitGroup, DF_ThemeColor_CodeString, DF_ThemeColor_CodeMeta, DF_ThemeColor_CodeComment, +DF_ThemeColor_CodeLineNumbers, +DF_ThemeColor_CodeLineNumbersSelected, DF_ThemeColor_LineInfoBackground0, DF_ThemeColor_LineInfoBackground1, DF_ThemeColor_LineInfoBackground2, @@ -127,8 +122,6 @@ DF_ThemeColor_Thread7, DF_ThemeColor_ThreadUnwound, DF_ThemeColor_ThreadError, DF_ThemeColor_Breakpoint, -DF_ThemeColor_DropSiteOverlay, -DF_ThemeColor_InactivePanelOverlay, DF_ThemeColor_COUNT, } DF_ThemeColor; @@ -317,18 +310,18 @@ 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[30]; extern String8 df_g_theme_color_version_remap_new_name_table[30]; -extern Vec4F32 df_g_theme_preset_colors__default_dark[85]; -extern Vec4F32 df_g_theme_preset_colors__default_light[85]; -extern Vec4F32 df_g_theme_preset_colors__vs_dark[85]; -extern Vec4F32 df_g_theme_preset_colors__vs_light[85]; -extern Vec4F32 df_g_theme_preset_colors__solarized_dark[85]; -extern Vec4F32 df_g_theme_preset_colors__solarized_light[85]; -extern Vec4F32 df_g_theme_preset_colors__handmade_hero[85]; -extern Vec4F32 df_g_theme_preset_colors__four_coder[85]; -extern Vec4F32 df_g_theme_preset_colors__far_manager[85]; +extern Vec4F32 df_g_theme_preset_colors__default_dark[78]; +extern Vec4F32 df_g_theme_preset_colors__default_light[78]; +extern Vec4F32 df_g_theme_preset_colors__vs_dark[78]; +extern Vec4F32 df_g_theme_preset_colors__vs_light[78]; +extern Vec4F32 df_g_theme_preset_colors__solarized_dark[78]; +extern Vec4F32 df_g_theme_preset_colors__solarized_light[78]; +extern Vec4F32 df_g_theme_preset_colors__handmade_hero[78]; +extern Vec4F32 df_g_theme_preset_colors__four_coder[78]; +extern Vec4F32 df_g_theme_preset_colors__far_manager[78]; extern Vec4F32* df_g_theme_preset_colors_table[9]; -extern String8 df_g_theme_color_display_string_table[85]; -extern String8 df_g_theme_color_cfg_string_table[85]; +extern String8 df_g_theme_color_display_string_table[78]; +extern String8 df_g_theme_color_cfg_string_table[78]; 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, From 31c671e3f589f6fb5c85efe267dd842bd27d8990 Mon Sep 17 00:00:00 2001 From: Ryan Fleury Date: Mon, 24 Jun 2024 14:08:28 -0700 Subject: [PATCH 13/47] more progress on simplifying/condensing new theme colors --- src/df/core/df_core.c | 53 +---- src/df/core/df_core.h | 1 - src/df/core/df_core.mdesk | 4 - src/df/core/generated/df_core.meta.c | 4 +- src/df/core/generated/df_core.meta.h | 2 - src/df/gfx/df_gfx.c | 57 ++--- src/df/gfx/df_gfx.mdesk | 158 +++++++------ src/df/gfx/df_views.c | 65 +++--- src/df/gfx/generated/df_gfx.meta.c | 327 ++++++++++++--------------- src/df/gfx/generated/df_gfx.meta.h | 47 ++-- 10 files changed, 304 insertions(+), 414 deletions(-) diff --git a/src/df/core/df_core.c b/src/df/core/df_core.c index a8784f16..e281ace6 100644 --- a/src/df/core/df_core.c +++ b/src/df/core/df_core.c @@ -3963,25 +3963,16 @@ df_ctrl_run(DF_RunKind run, DF_Entity *run_thread, CTRL_RunFlags flags, CTRL_Tra } } } - if(df_state->ctrl_solo_stepping_mode && !df_entity_is_nil(run_thread)) + for(DF_HandleNode *n = df_state->frozen_threads.first; n != 0; n = n->next) { - msg.freeze_state_is_frozen = 0; - CTRL_MachineIDHandlePair pair = {run_thread->ctrl_machine_id, run_thread->ctrl_handle}; - ctrl_machine_id_handle_pair_list_push(scratch.arena, &msg.freeze_state_threads, &pair); - } - else - { - for(DF_HandleNode *n = df_state->frozen_threads.first; n != 0; n = n->next) + DF_Entity *thread = df_entity_from_handle(n->handle); + if(!df_entity_is_nil(thread)) { - DF_Entity *thread = df_entity_from_handle(n->handle); - if(!df_entity_is_nil(thread)) - { - CTRL_MachineIDHandlePair pair = {thread->ctrl_machine_id, thread->ctrl_handle}; - ctrl_machine_id_handle_pair_list_push(scratch.arena, &msg.freeze_state_threads, &pair); - } + CTRL_MachineIDHandlePair pair = {thread->ctrl_machine_id, thread->ctrl_handle}; + ctrl_machine_id_handle_pair_list_push(scratch.arena, &msg.freeze_state_threads, &pair); } - msg.freeze_state_is_frozen = 1; } + msg.freeze_state_is_frozen = 1; } // rjf: push msg @@ -6192,15 +6183,6 @@ df_cfg_strings_from_core(Arena *arena, String8 root_path, DF_CfgSrc source) str8_list_push(arena, &strs, str8_lit("}\n\n")); } - //- rjf: write control settings - if(source == DF_CfgSrc_Project) - { - str8_list_push(arena, &strs, str8_lit("/// control settings //////////////////////////////////////////////////////////\n")); - str8_list_push(arena, &strs, str8_lit("\n")); - str8_list_pushf(arena, &strs, "solo_stepping_mode: %i\n", df_state->ctrl_solo_stepping_mode); - str8_list_push(arena, &strs, str8_lit("\n")); - } - //- rjf: write eval view cache #if 0 if(source == DF_CfgSrc_Project) @@ -7738,16 +7720,6 @@ df_core_begin_frame(Arena *arena, DF_CmdList *cmds, F32 dt) } }break; - //- rjf: solo-stepping mode - case DF_CoreCmdKind_EnableSoloSteppingMode: - { - df_state->ctrl_solo_stepping_mode = 1; - }break; - case DF_CoreCmdKind_DisableSoloSteppingMode: - { - df_state->ctrl_solo_stepping_mode = 0; - }break; - //- rjf: debug control context management operations case DF_CoreCmdKind_SelectThread: { @@ -8455,19 +8427,6 @@ df_core_begin_frame(Arena *arena, DF_CmdList *cmds, F32 dt) } } } - - //- rjf: apply control settings - { - DF_CfgVal *solo_stepping_mode_cfg_val = df_cfg_val_from_string(table, str8_lit("solo_stepping_mode")); - if(solo_stepping_mode_cfg_val != &df_g_nil_cfg_val) - { - DF_CfgNode *value_cfg = solo_stepping_mode_cfg_val->last->first; - U64 val = 0; - try_u64_from_str8_c_rules(value_cfg->string, &val); - df_state->ctrl_solo_stepping_mode = (B32)val; - } - } - }break; //- rjf: writing config changes diff --git a/src/df/core/df_core.h b/src/df/core/df_core.h index 240258c6..dc43b278 100644 --- a/src/df/core/df_core.h +++ b/src/df/core/df_core.h @@ -1242,7 +1242,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; diff --git a/src/df/core/df_core.mdesk b/src/df/core/df_core.mdesk index 2a105c05..ee4fd76d 100644 --- a/src/df/core/df_core.mdesk +++ b/src/df/core/df_core.mdesk @@ -145,10 +145,6 @@ 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." "" } diff --git a/src/df/core/generated/df_core.meta.c b/src/df/core/generated/df_core.meta.c index ebfdd8b0..b0c3d6ef 100644 --- a/src/df/core/generated/df_core.meta.c +++ b/src/df/core/generated/df_core.meta.c @@ -214,7 +214,7 @@ DF_CoreCmdKind_Null, DF_CoreCmdKind_Null, }; -DF_CmdSpecInfo df_g_core_cmd_kind_spec_info_table[220] = +DF_CmdSpecInfo df_g_core_cmd_kind_spec_info_table[218] = { { 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,8 +243,6 @@ DF_CmdSpecInfo df_g_core_cmd_kind_spec_info_table[220] = { 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}, diff --git a/src/df/core/generated/df_core.meta.h b/src/df/core/generated/df_core.meta.h index 2fce54de..9f857b6e 100644 --- a/src/df/core/generated/df_core.meta.h +++ b/src/df/core/generated/df_core.meta.h @@ -75,8 +75,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, diff --git a/src/df/gfx/df_gfx.c b/src/df/gfx/df_gfx.c index 7797416c..f4e06627 100644 --- a/src/df/gfx/df_gfx.c +++ b/src/df/gfx/df_gfx.c @@ -4692,7 +4692,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) os_window_clear_custom_border_data(ws->os); os_window_push_custom_edges(ws->os, window_edge_px); os_window_push_custom_title_bar(ws->os, dim_2f32(top_bar_rect).y); - ui_set_next_flags(UI_BoxFlag_DefaultFocusNav); + ui_set_next_flags(UI_BoxFlag_DefaultFocusNav|UI_BoxFlag_DisableFocusOverlay); DF_Palette(DF_PaletteCode_MenuBar) UI_Focus((ws->menu_bar_focused && window_is_focused && !ui_any_ctx_menu_is_open() && !hover_eval_is_open) ? UI_FocusKind_On : UI_FocusKind_Null) UI_Pane(top_bar_rect, str8_lit("###top_bar")) @@ -5155,7 +5155,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) if(can_play || !have_targets || processes.count == 0) UI_TextAlignment(UI_TextAlign_Center) UI_Flags((can_play ? 0 : UI_BoxFlag_Disabled)) - DF_Palette(DF_PaletteCode_MenuBar) + UI_Palette(ui_build_palette(ui_top_palette(), .text = df_rgba_from_theme_color(DF_ThemeColor_TextPositive))) { UI_Signal sig = ui_button(df_g_icon_kind_text_table[DF_IconKind_Play]); os_window_push_custom_title_bar_client_area(ws->os, sig.box->rect); @@ -6091,8 +6091,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) { if(row_is_fresh) { - Vec4F32 rgba = df_rgba_from_theme_color(DF_ThemeColor_Highlight0); - rgba.w *= 0.2f; + Vec4F32 rgba = df_rgba_from_theme_color(DF_ThemeColor_HighlightOverlay); ui_set_next_palette(ui_build_palette(ui_top_palette(), .background = rgba)); } UI_Signal sig = df_line_editf(DF_LineEditFlag_CodeContents| @@ -6118,8 +6117,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) { if(row_is_fresh) { - Vec4F32 rgba = df_rgba_from_theme_color(DF_ThemeColor_Highlight0); - rgba.w *= 0.2f; + Vec4F32 rgba = df_rgba_from_theme_color(DF_ThemeColor_HighlightOverlay); ui_set_next_palette(ui_build_palette(ui_top_palette(), .background = rgba)); ui_set_next_flags(UI_BoxFlag_DrawBackground); } @@ -6276,7 +6274,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) ui_set_next_child_layout_axis(axis2_flip(axis)); if(ui_key_match(key, ui_drop_hot_key())) { - ui_set_next_palette(ui_build_palette(ui_top_palette(), .border = df_rgba_from_theme_color(DF_ThemeColor_Highlight0))); + ui_set_next_palette(ui_build_palette(ui_top_palette(), .border = df_rgba_from_theme_color(DF_ThemeColor_Hover))); } site_box_viz = ui_build_box_from_key(UI_BoxFlag_DrawBackground| UI_BoxFlag_DrawBorder| @@ -6361,7 +6359,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) ui_set_next_child_layout_axis(axis2_flip(split_axis)); if(ui_key_match(key, ui_drop_hot_key())) { - ui_set_next_palette(ui_build_palette(ui_top_palette(), .border = df_rgba_from_theme_color(DF_ThemeColor_Highlight0))); + ui_set_next_palette(ui_build_palette(ui_top_palette(), .border = df_rgba_from_theme_color(DF_ThemeColor_Hover))); } site_box_viz = ui_build_box_from_key(UI_BoxFlag_DrawBackground| UI_BoxFlag_DrawBorder| @@ -6664,7 +6662,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) ui_set_next_child_layout_axis(axis2_flip(split_axis)); if(ui_key_match(key, ui_drop_hot_key())) { - ui_set_next_palette(ui_build_palette(ui_top_palette(), .border = df_rgba_from_theme_color(DF_ThemeColor_Highlight0))); + ui_set_next_palette(ui_build_palette(ui_top_palette(), .border = df_rgba_from_theme_color(DF_ThemeColor_Hover))); } site_box_viz = ui_build_box_from_key(UI_BoxFlag_DrawBackground| UI_BoxFlag_DrawBorder| @@ -6865,7 +6863,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) // rjf: colors Vec4F32 bg_color = v4f32(0.1f, 0.1f, 0.1f, 1); Vec4F32 bd_color = df_rgba_from_theme_color(DF_ThemeColor_FloatingBorder); - Vec4F32 hl_color = df_rgba_from_theme_color(DF_ThemeColor_Highlight0); + Vec4F32 hl_color = df_rgba_from_theme_color(DF_ThemeColor_TextNeutral); bg_color.w *= view->loading_t; bd_color.w *= view->loading_t; hl_color.w *= view->loading_t; @@ -7104,10 +7102,9 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) // rjf: build tab container box UI_Parent(tab_column_box) UI_PrefHeight(ui_px(tab_bar_vheight, 1)) DF_Palette(view_is_selected ? DF_PaletteCode_Tab : DF_PaletteCode_TabInactive) { - if((!view_is_selected && panel->tab_side == Side_Min) || - (view_is_selected && panel->tab_side == Side_Max)) + if(panel->tab_side == Side_Max) { - ui_spacer(ui_px(1.f, 1.f)); + ui_spacer(ui_px(tab_bar_rv_diff, 1.f)); } else { @@ -7118,7 +7115,6 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) UI_BoxFlag_DrawBackground| UI_BoxFlag_DrawBorder| (UI_BoxFlag_DrawDropShadow*view_is_selected)| - UI_BoxFlag_AnimatePosY| UI_BoxFlag_Clickable, "tab_%p", view); @@ -7708,7 +7704,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) // rjf: brighten { R_Rect2DInst *inst = d_rect(box->rect, v4f32(0, 0, 0, 0), 0, 0, 1.f); - Vec4F32 color = df_rgba_from_theme_color(DF_ThemeColor_Highlight1); + Vec4F32 color = df_rgba_from_theme_color(DF_ThemeColor_Hover); color.w *= t*0.2f; inst->colors[Corner_00] = color; inst->colors[Corner_01] = color; @@ -7738,7 +7734,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) // rjf: active effect extension if(box->flags & UI_BoxFlag_DrawActiveEffects) { - Vec4F32 shadow_color = df_rgba_from_theme_color(DF_ThemeColor_Highlight1); + Vec4F32 shadow_color = df_rgba_from_theme_color(DF_ThemeColor_Hover); shadow_color.x *= 0.3f; shadow_color.y *= 0.3f; shadow_color.z *= 0.3f; @@ -7806,8 +7802,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) d_truncated_fancy_run_list(text_position, &box->display_string_runs, max_x, ellipses_run); if(box->flags & UI_BoxFlag_HasFuzzyMatchRanges) { - Vec4F32 match_color = df_rgba_from_theme_color(DF_ThemeColor_Highlight0); - match_color.w *= 0.25f; + Vec4F32 match_color = df_rgba_from_theme_color(DF_ThemeColor_HighlightOverlay); d_truncated_fancy_run_fuzzy_matches(text_position, &box->display_string_runs, max_x, &box->fuzzy_match_ranges, match_color); } } @@ -7903,8 +7898,8 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) // rjf: hover effect if(b->flags & UI_BoxFlag_DrawHotEffects) { - Vec4F32 color = df_rgba_from_theme_color(DF_ThemeColor_Highlight1); - color.w *= 0.5f*b->hot_t; + Vec4F32 color = df_rgba_from_theme_color(DF_ThemeColor_Hover); + color.w *= b->hot_t; R_Rect2DInst *inst = d_rect(pad_2f32(b->rect, 1.f), color, 0, 1.f, 1.f); MemoryCopyArray(inst->corner_radii, b->corner_radii); } @@ -9827,8 +9822,8 @@ df_cmd_binding_button(DF_CmdSpec *spec) } if(df_gfx_state->bind_change_active && df_gfx_state->bind_change_cmd_spec == spec) { - palette->colors[UI_ColorCode_Border] = df_rgba_from_theme_color(DF_ThemeColor_Highlight1); - palette->colors[UI_ColorCode_Background] = df_rgba_from_theme_color(DF_ThemeColor_Highlight1); + palette->colors[UI_ColorCode_Border] = df_rgba_from_theme_color(DF_ThemeColor_Hover); + palette->colors[UI_ColorCode_Background] = df_rgba_from_theme_color(DF_ThemeColor_Hover); palette->colors[UI_ColorCode_Background].w *= 0.25f; } } @@ -10197,7 +10192,7 @@ df_entity_desc_button(DF_Window *ws, DF_Entity *entity, FuzzyMatchRangeList *nam } else if(entity->kind == DF_EntityKind_Target && entity->b32 != 0) { - palette = df_palette_from_code(DF_PaletteCode_PositivePopButton); + palette = df_palette_from_code(DF_PaletteCode_NeutralPopButton); } ui_set_next_hover_cursor(OS_Cursor_HandPoint); ui_set_next_palette(palette); @@ -10612,7 +10607,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ { if(n->entity == stopper_thread && (stop_event.cause == CTRL_EventCause_InterruptedByTrap || stop_event.cause == CTRL_EventCause_InterruptedByException)) { - line_bg_colors[line_idx] = df_rgba_from_theme_color(DF_ThemeColor_CodeBackgroundNegative); + line_bg_colors[line_idx] = df_rgba_from_theme_color(DF_ThemeColor_HighlightOverlayError); } } } @@ -11656,8 +11651,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ { TxtRngColorPairNode *n = push_array(scratch.arena, TxtRngColorPairNode, 1); n->rng = result.mouse_expr_rng; - n->color = df_rgba_from_theme_color(DF_ThemeColor_Highlight0); - n->color.w *= 0.3f; + n->color = df_rgba_from_theme_color(DF_ThemeColor_HighlightOverlay); SLLQueuePush(first_txt_rng_color_pair, last_txt_rng_color_pair, n); } } @@ -11668,8 +11662,8 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ if(params->flags & DF_CodeSliceFlag_LineNums) UI_Parent(text_container_box) ProfScope("build line numbers") UI_Focus(UI_FocusKind_Off) { TxtRng select_rng = txt_rng(*cursor, *mark); - Vec4F32 active_color = df_rgba_from_theme_color(DF_ThemeColor_CodeLineNumbersActive); - Vec4F32 inactive_color = df_rgba_from_theme_color(DF_ThemeColor_CodeLineNumbersInactive); + Vec4F32 active_color = df_rgba_from_theme_color(DF_ThemeColor_CodeLineNumbersSelected); + Vec4F32 inactive_color = df_rgba_from_theme_color(DF_ThemeColor_CodeLineNumbers); if(params->margin_float_off_px != 0) { ui_set_next_pref_width(ui_px(params->line_num_width_px, 1.f)); @@ -11927,8 +11921,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ line_box->rect.x0+match_column_pixel_off_range.max+2.f, line_box->rect.y1, }; - Vec4F32 color = df_rgba_from_theme_color(DF_ThemeColor_Highlight0); - color.w *= 0.8f; + Vec4F32 color = df_rgba_from_theme_color(DF_ThemeColor_HighlightOverlay); if(cursor->line == line_num && needle_pos+1 <= cursor->column && cursor->column < needle_pos+params->search_query.size+1) { color.x += (1.f - color.x) * 0.5f; @@ -12462,7 +12455,7 @@ df_error_label(String8 string) { UI_Box *box = ui_build_box_from_stringf(UI_BoxFlag_Clickable, "###%S_error_label", string); UI_Signal sig = ui_signal_from_box(box); - UI_Parent(box) + UI_Parent(box) UI_Palette(ui_build_palette(ui_top_palette(), .text = df_rgba_from_theme_color(DF_ThemeColor_TextNegative), .text_weak = df_rgba_from_theme_color(DF_ThemeColor_TextNegative))) { ui_set_next_font(df_font_from_slot(DF_FontSlot_Icons)); ui_set_next_run_flags(F_RunFlag_Smooth); @@ -14136,7 +14129,7 @@ df_gfx_begin_frame(Arena *arena, DF_CmdList *cmds) { df_gfx_state->cfg_palettes[code].null = v4f32(1, 0, 1, 1); df_gfx_state->cfg_palettes[code].cursor = current->colors[DF_ThemeColor_Cursor]; - df_gfx_state->cfg_palettes[code].selection = current->colors[DF_ThemeColor_Selection]; + df_gfx_state->cfg_palettes[code].selection = current->colors[DF_ThemeColor_SelectionOverlay]; } df_gfx_state->cfg_palettes[DF_PaletteCode_Base].background = current->colors[DF_ThemeColor_BaseBackground]; df_gfx_state->cfg_palettes[DF_PaletteCode_Base].text = current->colors[DF_ThemeColor_Text]; diff --git a/src/df/gfx/df_gfx.mdesk b/src/df/gfx/df_gfx.mdesk index a4224cb7..d331a67b 100644 --- a/src/df/gfx/df_gfx.mdesk +++ b/src/df/gfx/df_gfx.mdesk @@ -366,103 +366,99 @@ DF_ThemePresetTable: { FarManager far_manager "Far Manager" } } -@table(name display_name name_lower default_dark default_light vs_dark vs_light solarized_dark solarized_light handmade_hero four_coder far_manager) +@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: { - {Null "Null" null 0xff00ffff 0xff00ffff 0xff00ffff 0xff00ffff 0xff00ffff 0xff00ffff 0xff00ffff 0xff00ffff 0xff00ffff } + {Null "Null" null 0xff00ffff 0xff00ffff 0xff00ffff 0xff00ffff 0xff00ffff 0xff00ffff 0xff00ffff 0xff00ffff 0xff00ffff ""} //- rjf: global ui colors - {Selection "Selection" selection 0x99ccff4c 0x99ccff4c 0x99ccff4c 0x99ccff4c 0x99ccff4c 0x99ccff4c 0x99ccff4c 0x99ccff4c 0x99ccff4c } - {DropShadow "Drop Shadow" drop_shadow 0x0000007f 0x0000007f 0x0000007f 0x0000007f 0x0000007f 0x0000007f 0x0000007f 0x0000007f 0x0000007f } - {Cursor "Cursor" cursor 0x8bff00ff 0x66e566e5 0x66e566e5 0x66e566e5 0x66e566e5 0x66e566e5 0x66e566e5 0x66e566e5 0x66e566e5 } - {CursorInactive "Cursor (Inactive)" cursor_inactive 0xb23217ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff } - {Focus "Focus" focus 0xfea200ff 0xb27219ff 0xb27219ff 0xb27219ff 0xb27219ff 0xb27219ff 0xb27219ff 0xb27219ff 0xb27219ff } - {Hover "Hover" hover 0x7bffc7ff 0xb27219ff 0xb27219ff 0xb27219ff 0xb27219ff 0xb27219ff 0xb27219ff 0xb27219ff 0xb27219ff } - {Highlight0 "Highlight 0" highlight_0 0xfe9603ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff } - {Highlight1 "Highlight 1" highlight_1 0x7bffc7ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff } - {DisabledOverlay "Disabled Overlay" disabled_overlay 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f } - {DropSiteOverlay "Drop Site Overlay" drop_site_overlay 0xffffff0c 0xffffff0c 0xffffff0c 0xffffff0c 0xffffff0c 0xffffff0c 0xffffff0c 0xffffff0c 0xffffff0c } - {InactivePanelOverlay "Inactive Panel Overlay" inactive_panel_overlay 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f } - {Text "Text" text 0xbebebeff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff } - {TextPositive "Text (Positive)" text_positive 0x4dc221ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff } - {TextNegative "Text (Negative)" text_negative 0xc56553ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff } - {TextNeutral "Text (Neutral)" text_neutral 0x327fb2ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff } - {TextWeak "Text (Weak)" text_weak 0xa4a4a4fe 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f } + {Text "Text" text 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff ""} + {TextPositive "Text (Positive)" text_positive 0x4dc221ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff ""} + {TextNegative "Text (Negative)" text_negative 0xc56452ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff ""} + {TextNeutral "Text (Neutral)" text_neutral 0x307eb2ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff ""} + {TextWeak "Text (Weak)" text_weak 0xa4a4a4fe 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f ""} + {Cursor "Cursor" cursor 0x8aff00ff 0x66e566e5 0x66e566e5 0x66e566e5 0x66e566e5 0x66e566e5 0x66e566e5 0x66e566e5 0x66e566e5 ""} + {CursorInactive "Cursor (Inactive)" cursor_inactive 0xb23217ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff ""} + {Focus "Focus" focus 0xfda200ff 0xb27219ff 0xb27219ff 0xb27219ff 0xb27219ff 0xb27219ff 0xb27219ff 0xb27219ff 0xb27219ff ""} + {Hover "Hover" hover 0xffffffff 0xb27219ff 0xb27219ff 0xb27219ff 0xb27219ff 0xb27219ff 0xb27219ff 0xb27219ff 0xb27219ff ""} + {DropShadow "Drop Shadow" drop_shadow 0x0000007f 0x0000007f 0x0000007f 0x0000007f 0x0000007f 0x0000007f 0x0000007f 0x0000007f 0x0000007f ""} + {DisabledOverlay "Disabled Overlay" disabled_overlay 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f ""} + {DropSiteOverlay "Drop Site Overlay" drop_site_overlay 0xffffff0c 0xffffff0c 0xffffff0c 0xffffff0c 0xffffff0c 0xffffff0c 0xffffff0c 0xffffff0c 0xffffff0c ""} + {InactivePanelOverlay "Inactive Panel Overlay" inactive_panel_overlay 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f ""} + {SelectionOverlay "Selection Overlay" selection_overlay 0x99ccff4c 0x99ccff4c 0x99ccff4c 0x99ccff4c 0x99ccff4c 0x99ccff4c 0x99ccff4c 0x99ccff4c 0x99ccff4c ""} + {HighlightOverlay "Highlight Overlay" highlight_overlay 0x3b4a515f + 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f ""} + {HighlightOverlayError "Error Highlight Overlay" error_highlight_overlay 0x5f12005f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f ""} //- rjf: base ui container colors - {BaseBackground "Base Background" base_background 0x1b1b1bfe 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f } - {BaseBackgroundAlt "Base Background (Alternate)" base_background_alt 0x2b2b2bfe 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f } - {BaseBorder "Base Border" base_border 0x3f3f3ffe 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 } + {BaseBackground "Base Background" base_background 0x1b1b1bfe 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f ""} + {BaseBackgroundAlt "Base Background (Alternate)" base_background_alt 0x2b2b2bfe 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f ""} + {BaseBorder "Base Border" base_border 0x3f3f3ffe 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 ""} //- rjf: menu bar ui container colors - {MenuBarBackground "Menu Bar Background" menu_bar_background 0x3e4c577f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f } - {MenuBarBackgroundAlt "Menu Bar Background (Alternate)" menu_bar_background_alt 0x3e4c577f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f } - {MenuBarBorder "Menu Bar Border" menu_bar_border 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 } + {MenuBarBackground "Menu Bar Background" menu_bar_background 0x3e4c577f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f ""} + {MenuBarBackgroundAlt "Menu Bar Background (Alternate)" menu_bar_background_alt 0x3e4c577f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f ""} + {MenuBarBorder "Menu Bar Border" menu_bar_border 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 ""} //- rjf: floating ui container colors - {FloatingBackground "Floating Background" floating_background 0x33333333 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f } - {FloatingBackgroundAlt "Floating Background (Alternate)" floating_background_alt 0x33333333 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f } - {FloatingBorder "Floating Border" floating_border 0x3f3f3ffd 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 } + {FloatingBackground "Floating Background" floating_background 0x33333333 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f ""} + {FloatingBackgroundAlt "Floating Background (Alternate)" floating_background_alt 0x33333333 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f ""} + {FloatingBorder "Floating Border" floating_border 0x3f3f3ffd 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 ""} //- 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 0x00000000 0x00000000 0x00000000 0x00000000 } - {PlainButtonBackground "Plain Button Background" plain_button_background 0x1b1b1bfe 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 } - {PlainButtonBorder "Plain Button Border" plain_button_border 0x3f3f3ffe 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 } - {PositivePopButtonBackground "Positive Pop Button Background" positive_pop_button_background 0x2d7e3eff 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 } - {PositivePopButtonBorder "Positive Pop Button Border" positive_pop_button_border 0x3f3f3ffd 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 } - {NegativePopButtonBackground "Negative Pop Button Background" negative_pop_button_background 0x803425ff 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 } - {NegativePopButtonBorder "Negative Pop Button Border" negative_pop_button_border 0x3f3f3ffd 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 } - {NeutralPopButtonBackground "Neutral Pop Button Background" neutral_pop_button_background 0x355b6eff 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 } - {NeutralPopButtonBorder "Neutral Pop Button Border" neutral_pop_button_border 0x3f3f3ffd 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 } - {ScrollBarButtonBackground "Scroll Bar Button Background" scroll_bar_button_background 0x2b2b2bfe 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 } - {ScrollBarButtonBorder "Scroll Bar Button Border" scroll_bar_button_border 0x3f3f3ffe 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 } - {TabBackground "Tab Background" tab_background 0x7b4d27fe 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 } - {TabBorder "Tab Border" tab_border 0xb48300fd 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 } - {TabBackgroundInactive "Tab Background (Inactive)" tab_background_inactive 0x3e4c577f 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 } - {TabBorderInactive "Tab Border (Inactive)" tab_border_inactive 0xffffff19 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 } - - //- rjf: code ui colors - {CodeBackgroundNegative "Code Background (Negative)" code_background_negative 0x3b1f1ffe 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f } - {CodeLineNumbersActive "Code Line Numbers" code_line_numbers_active 0xbebebeff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff } - {CodeLineNumbersInactive "Code Line Numbers (Inactive)" code_line_numbers_inactive 0x7f7f7fff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff } + {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 0x00000000 0x00000000 0x00000000 0x00000000 ""} + {PlainButtonBackground "Plain Button Background" plain_button_background 0x1b1b1bfe 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 ""} + {PlainButtonBorder "Plain Button Border" plain_button_border 0x3f3f3ffe 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 ""} + {PositivePopButtonBackground "Positive Pop Button Background" positive_pop_button_background 0x2c5b36ff 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 ""} + {PositivePopButtonBorder "Positive Pop Button Border" positive_pop_button_border 0x3f3f3ffd 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 ""} + {NegativePopButtonBackground "Negative Pop Button Background" negative_pop_button_background 0x803425ff 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 ""} + {NegativePopButtonBorder "Negative Pop Button Border" negative_pop_button_border 0x3f3f3ffd 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 ""} + {NeutralPopButtonBackground "Neutral Pop Button Background" neutral_pop_button_background 0x355b6eff 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 ""} + {NeutralPopButtonBorder "Neutral Pop Button Border" neutral_pop_button_border 0x3f3f3ffd 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 ""} + {ScrollBarButtonBackground "Scroll Bar Button Background" scroll_bar_button_background 0x2b2b2bfe 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 ""} + {ScrollBarButtonBorder "Scroll Bar Button Border" scroll_bar_button_border 0x3f3f3ffe 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 ""} + {TabBackground "Tab Background" tab_background 0x6f5135fe 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 ""} + {TabBorder "Tab Border" tab_border 0xfefefe4d 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 ""} + {TabBackgroundInactive "Tab Background (Inactive)" tab_background_inactive 0x3e4c577f 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 ""} + {TabBorderInactive "Tab Border (Inactive)" tab_border_inactive 0xffffff19 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 ""} //- rjf: code colors - {CodeDefault "Code (Default)" code_default 0xbebebeff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff } - {CodeSymbol "Code (Symbol)" code_symbol 0x6093c2ff 0x7fcc99ff 0x7fcc99ff 0x7fcc99ff 0x7fcc99ff 0x7fcc99ff 0x7fcc99ff 0x7fcc99ff 0x7fcc99ff } - {CodeType "Code (Type)" code_type 0xecb31aff 0x66b2e5ff 0x66b2e5ff 0x66b2e5ff 0x66b2e5ff 0x66b2e5ff 0x66b2e5ff 0x66b2e5ff 0x66b2e5ff } - {CodeLocal "Code (Local)" code_local 0xadc9e0ff 0xfe9548ff 0xfe9548ff 0xfe9548ff 0xfe9548ff 0xfe9548ff 0xfe9548ff 0xfe9548ff 0xfe9548ff } - {CodeRegister "Code (Register)" code_register 0xb7afd5ff 0xd45d90ff 0xd45d90ff 0xd45d90ff 0xd45d90ff 0xd45d90ff 0xd45d90ff 0xd45d90ff 0xd45d90ff } - {CodeKeyword "Code (Keyword)" code_keyword 0xb18e32ff 0xf7bf5eff 0xf7bf5eff 0xf7bf5eff 0xf7bf5eff 0xf7bf5eff 0xf7bf5eff 0xf7bf5eff 0xf7bf5eff } - {CodeDelimiterOperator "Code (Delimiters/Operators)" code_delimiter_operator 0x7f7f7fff 0x994c32ff 0x994c32ff 0x994c32ff 0x994c32ff 0x994c32ff 0x994c32ff 0x994c32ff 0x994c32ff } - {CodeNumeric "Code (Numeric)" code_numeric 0x89b379ff 0x4ce54cff 0x4ce54cff 0x4ce54cff 0x4ce54cff 0x4ce54cff 0x4ce54cff 0x4ce54cff 0x4ce54cff } - {CodeNumericAltDigitGroup "Code (Numeric, Alt. Digit Group)" code_numeric_alt_digit_group 0x608752ff 0x4ca54cff 0x4ca54cff 0x4ca54cff 0x4ca54cff 0x4ca54cff 0x4ca54cff 0x4ca54cff 0x4ca54cff } - {CodeString "Code (String)" code_string 0x89b379ff 0xe5cc66ff 0xe5cc66ff 0xe5cc66ff 0xe5cc66ff 0xe5cc66ff 0xe5cc66ff 0xe5cc66ff 0xe5cc66ff } - {CodeMeta "Code (Meta)" code_meta 0x906f81ff 0xe54c4cff 0xe54c4cff 0xe54c4cff 0xe54c4cff 0xe54c4cff 0xe54c4cff 0xe54c4cff 0xe54c4cff } - {CodeComment "Code (Comment)" code_comment 0x717171ff 0x7f7f7fff 0x7f7f7fff 0x7f7f7fff 0x7f7f7fff 0x7f7f7fff 0x7f7f7fff 0x7f7f7fff 0x7f7f7fff } - {CodeLineNumbers "Code Line Numbers" code_line_numbers 0x7f7f7fff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff } - {CodeLineNumbersSelected "Code Line Numbers (Selected)" code_line_numbers_selected 0xbebebeff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff } + {CodeDefault "Code (Default)" code_default 0xcbcbcbff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff ""} + {CodeSymbol "Code (Symbol)" code_symbol 0x42a2cffe 0x7fcc99ff 0x7fcc99ff 0x7fcc99ff 0x7fcc99ff 0x7fcc99ff 0x7fcc99ff 0x7fcc99ff 0x7fcc99ff ""} + {CodeType "Code (Type)" code_type 0xfec746ff 0x66b2e5ff 0x66b2e5ff 0x66b2e5ff 0x66b2e5ff 0x66b2e5ff 0x66b2e5ff 0x66b2e5ff 0x66b2e5ff ""} + {CodeLocal "Code (Local)" code_local 0x98bc80ff 0xfe9548ff 0xfe9548ff 0xfe9548ff 0xfe9548ff 0xfe9548ff 0xfe9548ff 0xfe9548ff 0xfe9548ff ""} + {CodeRegister "Code (Register)" code_register 0xb7afd5ff 0xd45d90ff 0xd45d90ff 0xd45d90ff 0xd45d90ff 0xd45d90ff 0xd45d90ff 0xd45d90ff 0xd45d90ff ""} + {CodeKeyword "Code (Keyword)" code_keyword 0xb38d4cff 0xf7bf5eff 0xf7bf5eff 0xf7bf5eff 0xf7bf5eff 0xf7bf5eff 0xf7bf5eff 0xf7bf5eff 0xf7bf5eff ""} + {CodeDelimiterOperator "Code (Delimiters/Operators)" code_delimiter_operator 0x767676ff 0x994c32ff 0x994c32ff 0x994c32ff 0x994c32ff 0x994c32ff 0x994c32ff 0x994c32ff 0x994c32ff ""} + {CodeNumeric "Code (Numeric)" code_numeric 0x98abb1ff 0x4ce54cff 0x4ce54cff 0x4ce54cff 0x4ce54cff 0x4ce54cff 0x4ce54cff 0x4ce54cff 0x4ce54cff ""} + {CodeNumericAltDigitGroup "Code (Numeric, Alt. Digit Group)" code_numeric_alt_digit_group 0x738287ff 0x4ca54cff 0x4ca54cff 0x4ca54cff 0x4ca54cff 0x4ca54cff 0x4ca54cff 0x4ca54cff 0x4ca54cff ""} + {CodeString "Code (String)" code_string 0x98abb1ff 0xe5cc66ff 0xe5cc66ff 0xe5cc66ff 0xe5cc66ff 0xe5cc66ff 0xe5cc66ff 0xe5cc66ff 0xe5cc66ff ""} + {CodeMeta "Code (Meta)" code_meta 0xd96759ff 0xe54c4cff 0xe54c4cff 0xe54c4cff 0xe54c4cff 0xe54c4cff 0xe54c4cff 0xe54c4cff 0xe54c4cff ""} + {CodeComment "Code (Comment)" code_comment 0x717171ff 0x7f7f7fff 0x7f7f7fff 0x7f7f7fff 0x7f7f7fff 0x7f7f7fff 0x7f7f7fff 0x7f7f7fff 0x7f7f7fff ""} + {CodeLineNumbers "Code Line Numbers" code_line_numbers 0x7f7f7fff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff ""} + {CodeLineNumbersSelected "Code Line Numbers (Selected)" code_line_numbers_selected 0xbebebeff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff ""} //- 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 0x99503d3f 0x99503d3f 0x99503d3f 0x99503d3f 0x99503d3f 0x99503d3f 0x99503d3f 0x99503d3f } - {Thread0 "Thread 0" thread_0 0xffcb7fff 0xffcb7fff 0xffcb7fff 0xffcb7fff 0xffcb7fff 0xffcb7fff 0xffcb7fff 0xffcb7fff 0xffcb7fff } - {Thread1 "Thread 1" thread_1 0xb2ff65ff 0xb2ff65ff 0xb2ff65ff 0xb2ff65ff 0xb2ff65ff 0xb2ff65ff 0xb2ff65ff 0xb2ff65ff 0xb2ff65ff } - {Thread2 "Thread 2" thread_2 0xff99e5ff 0xff99e5ff 0xff99e5ff 0xff99e5ff 0xff99e5ff 0xff99e5ff 0xff99e5ff 0xff99e5ff 0xff99e5ff } - {Thread3 "Thread 3" thread_3 0x6598ffff 0x6598ffff 0x6598ffff 0x6598ffff 0x6598ffff 0x6598ffff 0x6598ffff 0x6598ffff 0x6598ffff } - {Thread4 "Thread 4" thread_4 0x65ffcbff 0x65ffcbff 0x65ffcbff 0x65ffcbff 0x65ffcbff 0x65ffcbff 0x65ffcbff 0x65ffcbff 0x65ffcbff } - {Thread5 "Thread 5" thread_5 0xff9819ff 0xff9819ff 0xff9819ff 0xff9819ff 0xff9819ff 0xff9819ff 0xff9819ff 0xff9819ff 0xff9819ff } - {Thread6 "Thread 6" thread_6 0x9932ffff 0x9932ffff 0x9932ffff 0x9932ffff 0x9932ffff 0x9932ffff 0x9932ffff 0x9932ffff 0x9932ffff } - {Thread7 "Thread 7" thread_7 0x65ff4cff 0x65ff4cff 0x65ff4cff 0x65ff4cff 0x65ff4cff 0x65ff4cff 0x65ff4cff 0x65ff4cff 0x65ff4cff } - {ThreadUnwound "Thread (Unwound)" thread_unwound 0xb2ccd8ff 0xb2ccd8ff 0xb2ccd8ff 0xb2ccd8ff 0xb2ccd8ff 0xb2ccd8ff 0xb2ccd8ff 0xb2ccd8ff 0xb2ccd8ff } - {ThreadError "Thread (Error)" thread_error 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff } - {Breakpoint "Breakpoint" breakpoint 0xa72a12ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff } + {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 0x99503d3f 0x99503d3f 0x99503d3f 0x99503d3f 0x99503d3f 0x99503d3f 0x99503d3f 0x99503d3f ""} + {Thread0 "Thread 0" thread_0 0xffcb7fff 0xffcb7fff 0xffcb7fff 0xffcb7fff 0xffcb7fff 0xffcb7fff 0xffcb7fff 0xffcb7fff 0xffcb7fff ""} + {Thread1 "Thread 1" thread_1 0xb2ff65ff 0xb2ff65ff 0xb2ff65ff 0xb2ff65ff 0xb2ff65ff 0xb2ff65ff 0xb2ff65ff 0xb2ff65ff 0xb2ff65ff ""} + {Thread2 "Thread 2" thread_2 0xff99e5ff 0xff99e5ff 0xff99e5ff 0xff99e5ff 0xff99e5ff 0xff99e5ff 0xff99e5ff 0xff99e5ff 0xff99e5ff ""} + {Thread3 "Thread 3" thread_3 0x6598ffff 0x6598ffff 0x6598ffff 0x6598ffff 0x6598ffff 0x6598ffff 0x6598ffff 0x6598ffff 0x6598ffff ""} + {Thread4 "Thread 4" thread_4 0x65ffcbff 0x65ffcbff 0x65ffcbff 0x65ffcbff 0x65ffcbff 0x65ffcbff 0x65ffcbff 0x65ffcbff 0x65ffcbff ""} + {Thread5 "Thread 5" thread_5 0xff9819ff 0xff9819ff 0xff9819ff 0xff9819ff 0xff9819ff 0xff9819ff 0xff9819ff 0xff9819ff 0xff9819ff ""} + {Thread6 "Thread 6" thread_6 0x9932ffff 0x9932ffff 0x9932ffff 0x9932ffff 0x9932ffff 0x9932ffff 0x9932ffff 0x9932ffff 0x9932ffff ""} + {Thread7 "Thread 7" thread_7 0x65ff4cff 0x65ff4cff 0x65ff4cff 0x65ff4cff 0x65ff4cff 0x65ff4cff 0x65ff4cff 0x65ff4cff 0x65ff4cff ""} + {ThreadUnwound "Thread (Unwound)" thread_unwound 0xb2ccd8ff 0xb2ccd8ff 0xb2ccd8ff 0xb2ccd8ff 0xb2ccd8ff 0xb2ccd8ff 0xb2ccd8ff 0xb2ccd8ff 0xb2ccd8ff ""} + {ThreadError "Thread (Error)" thread_error 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff ""} + {Breakpoint "Breakpoint" breakpoint 0xa72911ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff ""} } @table(old_name new_name) diff --git a/src/df/gfx/df_views.c b/src/df/gfx/df_views.c index 8dafaf84..c93a4cf2 100644 --- a/src/df/gfx/df_views.c +++ b/src/df/gfx/df_views.c @@ -1643,11 +1643,13 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS //////////////////////// //- rjf: determine row's color palette // + UI_BoxFlags row_flags = 0; UI_Palette *palette = ui_top_palette(); { if(row_is_fresh) { - palette = ui_build_palette(ui_top_palette(), .background = mul_4f32(df_rgba_from_theme_color(DF_ThemeColor_Highlight0), v4f32(1, 1, 1, 0.2f))); + palette = ui_build_palette(ui_top_palette(), .background = df_rgba_from_theme_color(DF_ThemeColor_HighlightOverlay)); + row_flags |= UI_BoxFlag_DrawBackground; } } @@ -1659,7 +1661,7 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS ui_set_next_pref_width(ui_pct(1, 0)); ui_set_next_pref_height(ui_px(scroll_list_params.row_height_px*row->size_in_rows, 1.f)); ui_set_next_focus_hot(row_selected ? UI_FocusKind_On : UI_FocusKind_Off); - UI_Box *row_box = ui_build_box_from_stringf(UI_BoxFlag_DrawSideBottom|UI_BoxFlag_Clickable, "row_%I64x", row_hash); + UI_Box *row_box = ui_build_box_from_stringf(row_flags|UI_BoxFlag_DrawSideBottom|UI_BoxFlag_Clickable|UI_BoxFlag_DisableFocusOverlay, "row_%I64x", row_hash); ui_ts_vector_idx += 1; ui_ts_cell_idx = 0; @@ -1734,7 +1736,7 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS ui_set_next_fixed_x(0); ui_set_next_fixed_y(0); ui_set_next_fixed_height(ui_top_font_size()*0.1f); - ui_set_next_palette(ui_build_palette(ui_top_palette(), .background = df_rgba_from_theme_color(DF_ThemeColor_Highlight0))); + ui_set_next_palette(ui_build_palette(ui_top_palette(), .background = df_rgba_from_theme_color(DF_ThemeColor_HighlightOverlay))); ui_build_box_from_key(UI_BoxFlag_Floating|UI_BoxFlag_DrawBackground, ui_key_zero()); } @@ -1753,8 +1755,7 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS ui_set_next_fixed_x(0); ui_set_next_fixed_y(scroll_list_params.row_height_px - ui_top_font_size()*0.5f); ui_set_next_fixed_height(ui_top_font_size()*1.f); - Vec4F32 boundary_color = df_rgba_from_theme_color(DF_ThemeColor_Highlight0); - boundary_color.w *= 0.25f; + Vec4F32 boundary_color = df_rgba_from_theme_color(DF_ThemeColor_HighlightOverlay); ui_set_next_palette(ui_build_palette(ui_top_palette(), .background = boundary_color)); ui_build_box_from_key(UI_BoxFlag_Floating|UI_BoxFlag_DrawBackground, ui_key_zero()); } @@ -1770,15 +1771,6 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS B32 cell_selected = (row_selected && selection_tbl.min.x <= pt.column_kind && pt.column_kind <= selection_tbl.max.x); B32 can_edit_expr = !(row->depth > 0 || modifiable == 0); - // rjf: unpack palette - UI_Palette *palette = ui_top_palette(); - { - if(row->flags & DF_EvalVizRowFlag_ExprIsSpecial) - { - palette = ui_build_palette(ui_top_palette(), .text = df_rgba_from_theme_color(DF_ThemeColor_TextNeutral)); - } - } - // rjf: build UI_Signal sig = {0}; B32 next_expanded = row_expanded; @@ -1788,14 +1780,8 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS { B32 expr_editing_active = ui_is_focus_active(); B32 is_inherited = (row->inherited_type_key_chain.count != 0); - UI_Font(code_font) UI_Palette(palette) UI_FlagsAdd(row->depth > 0 ? UI_BoxFlag_DrawTextWeak : 0) + UI_Font(code_font) UI_FlagsAdd(row->depth > 0 ? UI_BoxFlag_DrawTextWeak : 0) { - if(is_inherited) - { - Vec4F32 inherited_bg_color = df_rgba_from_theme_color(DF_ThemeColor_Highlight1); - inherited_bg_color.w *= 0.2f; - ui_set_next_palette(ui_build_palette(ui_top_palette(), .background = inherited_bg_color)); - } FuzzyMatchRangeList matches = {0}; if(filter.size != 0) { @@ -1927,16 +1913,19 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS B32 value_is_simple = (!value_is_error && !value_is_hook && (row->flags & DF_EvalVizRowFlag_CanEditValue)); // rjf: unpack palette + UI_BoxFlags cell_flags = 0; UI_Palette *palette = ui_top_palette(); { - if(row_is_bad) + if(row_is_bad || value_is_error) { - palette = ui_build_palette(ui_top_palette(), .text = df_rgba_from_theme_color(DF_ThemeColor_TextNegative)); + palette = ui_build_palette(ui_top_palette(), .text = df_rgba_from_theme_color(DF_ThemeColor_TextNegative), .text_weak = df_rgba_from_theme_color(DF_ThemeColor_TextNegative), .background = df_rgba_from_theme_color(DF_ThemeColor_HighlightOverlayError)); + cell_flags |= UI_BoxFlag_DrawBackground; } } // rjf: build UI_Signal sig = {0}; + ui_set_next_flags(cell_flags); UI_Palette(palette) UI_TableCell UI_Font(code_font) UI_FocusHot(cell_selected ? UI_FocusKind_On : UI_FocusKind_Off) UI_FocusActive((cell_selected && ewv->text_editing) ? UI_FocusKind_On : UI_FocusKind_Off) @@ -4706,14 +4695,9 @@ DF_VIEW_UI_FUNCTION_DEF(Scheduler) UI_TableCellSized(ui_em(1.5f*depth, 1.f)) {} UI_TableCellSized(ui_em(2.25f, 1.f)) UI_FocusHot((row_is_selected && cursor.x == 0) ? UI_FocusKind_On : UI_FocusKind_Off) { - B32 frozen_by_solo_mode = (entity->kind == DF_EntityKind_Thread && entity != df_entity_from_handle(ctrl_ctx.thread) && df_state->ctrl_solo_stepping_mode); B32 frozen = df_entity_is_frozen(entity); UI_Palette *palette = ui_top_palette(); - if(frozen_by_solo_mode) - { - palette = ui_build_palette(ui_top_palette(), .background = df_rgba_from_theme_color(DF_ThemeColor_Highlight0)); - } - else if(frozen) + if(frozen) { palette = df_palette_from_code(DF_PaletteCode_NegativePopButton); } @@ -4723,10 +4707,6 @@ DF_VIEW_UI_FUNCTION_DEF(Scheduler) } UI_Signal sig = {0}; UI_Palette(palette) sig = df_icon_buttonf(frozen ? DF_IconKind_Locked : DF_IconKind_Unlocked, 0, "###lock_%p", entity); - if(frozen_by_solo_mode && ui_hovering(sig)) UI_Tooltip - { - ui_label(str8_lit("This thread is frozen during stepping operations because it isn't selected, and Solo Stepping Mode is enabled.")); - } if(ui_clicked(sig)) { DF_CoreCmdKind cmd_kind = frozen ? DF_CoreCmdKind_ThawEntity : DF_CoreCmdKind_FreezeEntity; @@ -6460,6 +6440,7 @@ DF_VIEW_UI_FUNCTION_DEF(Code) ui_set_next_fixed_y(code_area_dim.y); ui_set_next_fixed_width(panel_box_dim.x - scroll_bar_dim); ui_set_next_fixed_height(scroll_bar_dim); + DF_Palette(DF_PaletteCode_ScrollBarButton) { view->scroll_pos.x = ui_scroll_bar(Axis2_X, ui_px(scroll_bar_dim, 1.f), @@ -6478,6 +6459,7 @@ DF_VIEW_UI_FUNCTION_DEF(Code) ui_set_next_fixed_y(0); ui_set_next_fixed_width(scroll_bar_dim); ui_set_next_fixed_height(panel_box_dim.y - bottom_bar_dim.y - scroll_bar_dim); + DF_Palette(DF_PaletteCode_ScrollBarButton) { view->scroll_pos.y = ui_scroll_bar(Axis2_Y, ui_px(scroll_bar_dim, 1.f), @@ -6564,7 +6546,7 @@ DF_VIEW_UI_FUNCTION_DEF(Code) UI_PrefWidth(ui_children_sum(1)) UI_Row UI_PrefWidth(ui_text_dim(1, 1)) { ui_labelf("This file has changed since ", out_of_date_dbgi_name); - UI_Palette(ui_build_palette(ui_top_palette(), .text = df_rgba_from_theme_color(DF_ThemeColor_Highlight0))) ui_label(out_of_date_dbgi_name); + UI_Palette(ui_build_palette(ui_top_palette(), .text = df_rgba_from_theme_color(DF_ThemeColor_TextNeutral))) ui_label(out_of_date_dbgi_name); ui_labelf(" was produced."); } } @@ -7359,6 +7341,7 @@ DF_VIEW_UI_FUNCTION_DEF(Disassembly) ui_set_next_fixed_y(code_area_dim.y); ui_set_next_fixed_width(panel_box_dim.x - scroll_bar_dim); ui_set_next_fixed_height(scroll_bar_dim); + DF_Palette(DF_PaletteCode_ScrollBarButton) { view->scroll_pos.x = ui_scroll_bar(Axis2_X, ui_px(scroll_bar_dim, 1.f), @@ -7377,6 +7360,7 @@ DF_VIEW_UI_FUNCTION_DEF(Disassembly) ui_set_next_fixed_y(0); ui_set_next_fixed_width(scroll_bar_dim); ui_set_next_fixed_height(panel_box_dim.y - bottom_bar_dim.y - scroll_bar_dim); + DF_Palette(DF_PaletteCode_ScrollBarButton) { view->scroll_pos.y = ui_scroll_bar(Axis2_Y, ui_px(scroll_bar_dim, 1.f), @@ -8160,6 +8144,7 @@ DF_VIEW_UI_FUNCTION_DEF(Output) ui_set_next_fixed_y(code_area_dim.y); ui_set_next_fixed_width(panel_box_dim.x - scroll_bar_dim); ui_set_next_fixed_height(scroll_bar_dim); + DF_Palette(DF_PaletteCode_ScrollBarButton) { view->scroll_pos.x = ui_scroll_bar(Axis2_X, ui_px(scroll_bar_dim, 1.f), @@ -8178,6 +8163,7 @@ DF_VIEW_UI_FUNCTION_DEF(Output) ui_set_next_fixed_y(0); ui_set_next_fixed_width(scroll_bar_dim); ui_set_next_fixed_height(panel_box_dim.y - bottom_bar_dim.y - scroll_bar_dim); + DF_Palette(DF_PaletteCode_ScrollBarButton) { view->scroll_pos.y = ui_scroll_bar(Axis2_Y, ui_px(scroll_bar_dim, 1.f), @@ -8744,6 +8730,7 @@ DF_VIEW_UI_FUNCTION_DEF(Memory) ui_set_next_fixed_y(content_rect.y0); ui_set_next_fixed_width(scroll_bar_dim); ui_set_next_fixed_height(dim_2f32(content_rect).y); + DF_Palette(DF_PaletteCode_ScrollBarButton) { view->scroll_pos.y = ui_scroll_bar(Axis2_Y, ui_px(scroll_bar_dim, 1.f), @@ -8886,7 +8873,7 @@ DF_VIEW_UI_FUNCTION_DEF(Memory) if(row_range_bytes.min%64 == 0) { row_is_boundary = 1; - row_boundary_color = df_rgba_from_theme_color(DF_ThemeColor_Highlight0); + row_boundary_color = df_rgba_from_theme_color(DF_ThemeColor_BaseBorder); } UI_Box *row = ui_build_box_from_stringf(UI_BoxFlag_DrawSideTop*!!row_is_boundary, "row_%I64x", row_range_bytes.min); UI_Parent(row) @@ -8916,7 +8903,7 @@ DF_VIEW_UI_FUNCTION_DEF(Memory) if(global_byte_num == mouse_hover_byte_num) { cell_flags |= UI_BoxFlag_DrawBorder|UI_BoxFlag_DrawSideTop|UI_BoxFlag_DrawSideBottom|UI_BoxFlag_DrawSideLeft|UI_BoxFlag_DrawSideRight; - cell_border_rgba = df_rgba_from_theme_color(DF_ThemeColor_Highlight0); + cell_border_rgba = df_rgba_from_theme_color(DF_ThemeColor_HighlightOverlay); } if(annotation != 0) { @@ -8934,7 +8921,7 @@ DF_VIEW_UI_FUNCTION_DEF(Memory) if(selection.min <= global_byte_idx && global_byte_idx <= selection.max) { cell_flags |= UI_BoxFlag_DrawBackground; - cell_bg_rgba = df_rgba_from_theme_color(DF_ThemeColor_Selection); + cell_bg_rgba = df_rgba_from_theme_color(DF_ThemeColor_SelectionOverlay); } UI_Box *cell_box = ui_build_box_from_key(UI_BoxFlag_DrawText|cell_flags, ui_key_zero()); ui_box_equip_display_fancy_strings(cell_box, &byte_fancy_strings[byte_value]); @@ -9006,7 +8993,7 @@ DF_VIEW_UI_FUNCTION_DEF(Memory) ascii_box->rect.y0, text_pos.x + f_dim_from_tag_size_string(font, font_size, 0, 0, str8_prefix(ascii_text, selection_in_row.max+1-row_range_bytes.min)).x + font_size/4.f, ascii_box->rect.y1), - df_rgba_from_theme_color(DF_ThemeColor_Selection), + df_rgba_from_theme_color(DF_ThemeColor_SelectionOverlay), 0, 0, 1.f); } ui_box_equip_draw_bucket(ascii_box, bucket); @@ -9017,7 +9004,7 @@ DF_VIEW_UI_FUNCTION_DEF(Memory) D_BucketScope(bucket) { Vec2F32 text_pos = ui_box_text_position(ascii_box); - Vec4F32 color = df_rgba_from_theme_color(DF_ThemeColor_Highlight0); + Vec4F32 color = df_rgba_from_theme_color(DF_ThemeColor_HighlightOverlay); d_rect(r2f32p(text_pos.x + f_dim_from_tag_size_string(font, font_size, 0, 0, str8_prefix(ascii_text, mouse_hover_byte_num-1-row_range_bytes.min)).x - font_size/8.f, ascii_box->rect.y0, text_pos.x + f_dim_from_tag_size_string(font, font_size, 0, 0, str8_prefix(ascii_text, mouse_hover_byte_num+0-row_range_bytes.min)).x + font_size/4.f, diff --git a/src/df/gfx/generated/df_gfx.meta.c b/src/df/gfx/generated/df_gfx.meta.c index 5f42e79a..9e327f41 100644 --- a/src/df/gfx/generated/df_gfx.meta.c +++ b/src/df/gfx/generated/df_gfx.meta.c @@ -319,25 +319,25 @@ str8_lit_comp("special_neutral_background"), str8_lit_comp("special_neutral_border"), }; -Vec4F32 df_g_theme_preset_colors__default_dark[78] = +Vec4F32 df_g_theme_preset_colors__default_dark[75] = { rgba_from_u32_lit_comp(0xff00ffff), -rgba_from_u32_lit_comp(0x99ccff4c), -rgba_from_u32_lit_comp(0x0000007f), -rgba_from_u32_lit_comp(0x8bff00ff), +rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0x4dc221ff), +rgba_from_u32_lit_comp(0xc56452ff), +rgba_from_u32_lit_comp(0x307eb2ff), +rgba_from_u32_lit_comp(0xa4a4a4fe), +rgba_from_u32_lit_comp(0x8aff00ff), rgba_from_u32_lit_comp(0xb23217ff), -rgba_from_u32_lit_comp(0xfea200ff), -rgba_from_u32_lit_comp(0x7bffc7ff), -rgba_from_u32_lit_comp(0xfe9603ff), -rgba_from_u32_lit_comp(0x7bffc7ff), +rgba_from_u32_lit_comp(0xfda200ff), +rgba_from_u32_lit_comp(0xffffffff), +rgba_from_u32_lit_comp(0x0000007f), rgba_from_u32_lit_comp(0x0000003f), rgba_from_u32_lit_comp(0xffffff0c), rgba_from_u32_lit_comp(0x0000003f), -rgba_from_u32_lit_comp(0xbebebeff), -rgba_from_u32_lit_comp(0x4dc221ff), -rgba_from_u32_lit_comp(0xc56553ff), -rgba_from_u32_lit_comp(0x327fb2ff), -rgba_from_u32_lit_comp(0xa4a4a4fe), +rgba_from_u32_lit_comp(0x99ccff4c), +rgba_from_u32_lit_comp(0x3b4a515f), +rgba_from_u32_lit_comp(0x5f12005f), rgba_from_u32_lit_comp(0x1b1b1bfe), rgba_from_u32_lit_comp(0x2b2b2bfe), rgba_from_u32_lit_comp(0x3f3f3ffe), @@ -351,7 +351,7 @@ rgba_from_u32_lit_comp(0x00000000), rgba_from_u32_lit_comp(0x00000000), rgba_from_u32_lit_comp(0x1b1b1bfe), rgba_from_u32_lit_comp(0x3f3f3ffe), -rgba_from_u32_lit_comp(0x2d7e3eff), +rgba_from_u32_lit_comp(0x2c5b36ff), rgba_from_u32_lit_comp(0x3f3f3ffd), rgba_from_u32_lit_comp(0x803425ff), rgba_from_u32_lit_comp(0x3f3f3ffd), @@ -359,24 +359,21 @@ rgba_from_u32_lit_comp(0x355b6eff), rgba_from_u32_lit_comp(0x3f3f3ffd), rgba_from_u32_lit_comp(0x2b2b2bfe), rgba_from_u32_lit_comp(0x3f3f3ffe), -rgba_from_u32_lit_comp(0x7b4d27fe), -rgba_from_u32_lit_comp(0xb48300fd), +rgba_from_u32_lit_comp(0x6f5135fe), +rgba_from_u32_lit_comp(0xfefefe4d), rgba_from_u32_lit_comp(0x3e4c577f), rgba_from_u32_lit_comp(0xffffff19), -rgba_from_u32_lit_comp(0x3b1f1ffe), -rgba_from_u32_lit_comp(0xbebebeff), -rgba_from_u32_lit_comp(0x7f7f7fff), -rgba_from_u32_lit_comp(0xbebebeff), -rgba_from_u32_lit_comp(0x6093c2ff), -rgba_from_u32_lit_comp(0xecb31aff), -rgba_from_u32_lit_comp(0xadc9e0ff), +rgba_from_u32_lit_comp(0xcbcbcbff), +rgba_from_u32_lit_comp(0x42a2cffe), +rgba_from_u32_lit_comp(0xfec746ff), +rgba_from_u32_lit_comp(0x98bc80ff), rgba_from_u32_lit_comp(0xb7afd5ff), -rgba_from_u32_lit_comp(0xb18e32ff), -rgba_from_u32_lit_comp(0x7f7f7fff), -rgba_from_u32_lit_comp(0x89b379ff), -rgba_from_u32_lit_comp(0x608752ff), -rgba_from_u32_lit_comp(0x89b379ff), -rgba_from_u32_lit_comp(0x906f81ff), +rgba_from_u32_lit_comp(0xb38d4cff), +rgba_from_u32_lit_comp(0x767676ff), +rgba_from_u32_lit_comp(0x98abb1ff), +rgba_from_u32_lit_comp(0x738287ff), +rgba_from_u32_lit_comp(0x98abb1ff), +rgba_from_u32_lit_comp(0xd96759ff), rgba_from_u32_lit_comp(0x717171ff), rgba_from_u32_lit_comp(0x7f7f7fff), rgba_from_u32_lit_comp(0xbebebeff), @@ -398,28 +395,28 @@ rgba_from_u32_lit_comp(0x9932ffff), rgba_from_u32_lit_comp(0x65ff4cff), rgba_from_u32_lit_comp(0xb2ccd8ff), rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xa72a12ff), +rgba_from_u32_lit_comp(0xa72911ff), }; -Vec4F32 df_g_theme_preset_colors__default_light[78] = +Vec4F32 df_g_theme_preset_colors__default_light[75] = { rgba_from_u32_lit_comp(0xff00ffff), -rgba_from_u32_lit_comp(0x99ccff4c), -rgba_from_u32_lit_comp(0x0000007f), -rgba_from_u32_lit_comp(0x66e566e5), -rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xb27219ff), -rgba_from_u32_lit_comp(0xb27219ff), -rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0x0000003f), -rgba_from_u32_lit_comp(0xffffff0c), -rgba_from_u32_lit_comp(0x0000003f), rgba_from_u32_lit_comp(0xe5e5e5ff), rgba_from_u32_lit_comp(0x32b219ff), rgba_from_u32_lit_comp(0xb23219ff), rgba_from_u32_lit_comp(0xb23219ff), rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0x66e566e5), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xb27219ff), +rgba_from_u32_lit_comp(0xb27219ff), +rgba_from_u32_lit_comp(0x0000007f), +rgba_from_u32_lit_comp(0x0000003f), +rgba_from_u32_lit_comp(0xffffff0c), +rgba_from_u32_lit_comp(0x0000003f), +rgba_from_u32_lit_comp(0x99ccff4c), +rgba_from_u32_lit_comp(0x0000003f), +rgba_from_u32_lit_comp(0x0000003f), rgba_from_u32_lit_comp(0x3333337f), rgba_from_u32_lit_comp(0x3333337f), rgba_from_u32_lit_comp(0xffffff19), @@ -445,9 +442,6 @@ rgba_from_u32_lit_comp(0x00000000), rgba_from_u32_lit_comp(0x00000000), rgba_from_u32_lit_comp(0x00000000), rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x3333337f), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0xe5e5e5ff), rgba_from_u32_lit_comp(0xe5e5e5ff), rgba_from_u32_lit_comp(0x7fcc99ff), rgba_from_u32_lit_comp(0x66b2e5ff), @@ -483,25 +477,25 @@ rgba_from_u32_lit_comp(0xb23219ff), rgba_from_u32_lit_comp(0xb23219ff), }; -Vec4F32 df_g_theme_preset_colors__vs_dark[78] = +Vec4F32 df_g_theme_preset_colors__vs_dark[75] = { rgba_from_u32_lit_comp(0xff00ffff), -rgba_from_u32_lit_comp(0x99ccff4c), -rgba_from_u32_lit_comp(0x0000007f), -rgba_from_u32_lit_comp(0x66e566e5), -rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xb27219ff), -rgba_from_u32_lit_comp(0xb27219ff), -rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0x0000003f), -rgba_from_u32_lit_comp(0xffffff0c), -rgba_from_u32_lit_comp(0x0000003f), rgba_from_u32_lit_comp(0xe5e5e5ff), rgba_from_u32_lit_comp(0x32b219ff), rgba_from_u32_lit_comp(0xb23219ff), rgba_from_u32_lit_comp(0xb23219ff), rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0x66e566e5), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xb27219ff), +rgba_from_u32_lit_comp(0xb27219ff), +rgba_from_u32_lit_comp(0x0000007f), +rgba_from_u32_lit_comp(0x0000003f), +rgba_from_u32_lit_comp(0xffffff0c), +rgba_from_u32_lit_comp(0x0000003f), +rgba_from_u32_lit_comp(0x99ccff4c), +rgba_from_u32_lit_comp(0x0000003f), +rgba_from_u32_lit_comp(0x0000003f), rgba_from_u32_lit_comp(0x3333337f), rgba_from_u32_lit_comp(0x3333337f), rgba_from_u32_lit_comp(0xffffff19), @@ -527,9 +521,6 @@ rgba_from_u32_lit_comp(0x00000000), rgba_from_u32_lit_comp(0x00000000), rgba_from_u32_lit_comp(0x00000000), rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x3333337f), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0xe5e5e5ff), rgba_from_u32_lit_comp(0xe5e5e5ff), rgba_from_u32_lit_comp(0x7fcc99ff), rgba_from_u32_lit_comp(0x66b2e5ff), @@ -565,25 +556,25 @@ rgba_from_u32_lit_comp(0xb23219ff), rgba_from_u32_lit_comp(0xb23219ff), }; -Vec4F32 df_g_theme_preset_colors__vs_light[78] = +Vec4F32 df_g_theme_preset_colors__vs_light[75] = { rgba_from_u32_lit_comp(0xff00ffff), -rgba_from_u32_lit_comp(0x99ccff4c), -rgba_from_u32_lit_comp(0x0000007f), -rgba_from_u32_lit_comp(0x66e566e5), -rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xb27219ff), -rgba_from_u32_lit_comp(0xb27219ff), -rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0x0000003f), -rgba_from_u32_lit_comp(0xffffff0c), -rgba_from_u32_lit_comp(0x0000003f), rgba_from_u32_lit_comp(0xe5e5e5ff), rgba_from_u32_lit_comp(0x32b219ff), rgba_from_u32_lit_comp(0xb23219ff), rgba_from_u32_lit_comp(0xb23219ff), rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0x66e566e5), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xb27219ff), +rgba_from_u32_lit_comp(0xb27219ff), +rgba_from_u32_lit_comp(0x0000007f), +rgba_from_u32_lit_comp(0x0000003f), +rgba_from_u32_lit_comp(0xffffff0c), +rgba_from_u32_lit_comp(0x0000003f), +rgba_from_u32_lit_comp(0x99ccff4c), +rgba_from_u32_lit_comp(0x0000003f), +rgba_from_u32_lit_comp(0x0000003f), rgba_from_u32_lit_comp(0x3333337f), rgba_from_u32_lit_comp(0x3333337f), rgba_from_u32_lit_comp(0xffffff19), @@ -609,9 +600,6 @@ rgba_from_u32_lit_comp(0x00000000), rgba_from_u32_lit_comp(0x00000000), rgba_from_u32_lit_comp(0x00000000), rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x3333337f), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0xe5e5e5ff), rgba_from_u32_lit_comp(0xe5e5e5ff), rgba_from_u32_lit_comp(0x7fcc99ff), rgba_from_u32_lit_comp(0x66b2e5ff), @@ -647,25 +635,25 @@ rgba_from_u32_lit_comp(0xb23219ff), rgba_from_u32_lit_comp(0xb23219ff), }; -Vec4F32 df_g_theme_preset_colors__solarized_dark[78] = +Vec4F32 df_g_theme_preset_colors__solarized_dark[75] = { rgba_from_u32_lit_comp(0xff00ffff), -rgba_from_u32_lit_comp(0x99ccff4c), -rgba_from_u32_lit_comp(0x0000007f), -rgba_from_u32_lit_comp(0x66e566e5), -rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xb27219ff), -rgba_from_u32_lit_comp(0xb27219ff), -rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0x0000003f), -rgba_from_u32_lit_comp(0xffffff0c), -rgba_from_u32_lit_comp(0x0000003f), rgba_from_u32_lit_comp(0xe5e5e5ff), rgba_from_u32_lit_comp(0x32b219ff), rgba_from_u32_lit_comp(0xb23219ff), rgba_from_u32_lit_comp(0xb23219ff), rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0x66e566e5), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xb27219ff), +rgba_from_u32_lit_comp(0xb27219ff), +rgba_from_u32_lit_comp(0x0000007f), +rgba_from_u32_lit_comp(0x0000003f), +rgba_from_u32_lit_comp(0xffffff0c), +rgba_from_u32_lit_comp(0x0000003f), +rgba_from_u32_lit_comp(0x99ccff4c), +rgba_from_u32_lit_comp(0x0000003f), +rgba_from_u32_lit_comp(0x0000003f), rgba_from_u32_lit_comp(0x3333337f), rgba_from_u32_lit_comp(0x3333337f), rgba_from_u32_lit_comp(0xffffff19), @@ -691,9 +679,6 @@ rgba_from_u32_lit_comp(0x00000000), rgba_from_u32_lit_comp(0x00000000), rgba_from_u32_lit_comp(0x00000000), rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x3333337f), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0xe5e5e5ff), rgba_from_u32_lit_comp(0xe5e5e5ff), rgba_from_u32_lit_comp(0x7fcc99ff), rgba_from_u32_lit_comp(0x66b2e5ff), @@ -729,25 +714,25 @@ rgba_from_u32_lit_comp(0xb23219ff), rgba_from_u32_lit_comp(0xb23219ff), }; -Vec4F32 df_g_theme_preset_colors__solarized_light[78] = +Vec4F32 df_g_theme_preset_colors__solarized_light[75] = { rgba_from_u32_lit_comp(0xff00ffff), -rgba_from_u32_lit_comp(0x99ccff4c), -rgba_from_u32_lit_comp(0x0000007f), -rgba_from_u32_lit_comp(0x66e566e5), -rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xb27219ff), -rgba_from_u32_lit_comp(0xb27219ff), -rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0x0000003f), -rgba_from_u32_lit_comp(0xffffff0c), -rgba_from_u32_lit_comp(0x0000003f), rgba_from_u32_lit_comp(0xe5e5e5ff), rgba_from_u32_lit_comp(0x32b219ff), rgba_from_u32_lit_comp(0xb23219ff), rgba_from_u32_lit_comp(0xb23219ff), rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0x66e566e5), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xb27219ff), +rgba_from_u32_lit_comp(0xb27219ff), +rgba_from_u32_lit_comp(0x0000007f), +rgba_from_u32_lit_comp(0x0000003f), +rgba_from_u32_lit_comp(0xffffff0c), +rgba_from_u32_lit_comp(0x0000003f), +rgba_from_u32_lit_comp(0x99ccff4c), +rgba_from_u32_lit_comp(0x0000003f), +rgba_from_u32_lit_comp(0x0000003f), rgba_from_u32_lit_comp(0x3333337f), rgba_from_u32_lit_comp(0x3333337f), rgba_from_u32_lit_comp(0xffffff19), @@ -773,9 +758,6 @@ rgba_from_u32_lit_comp(0x00000000), rgba_from_u32_lit_comp(0x00000000), rgba_from_u32_lit_comp(0x00000000), rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x3333337f), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0xe5e5e5ff), rgba_from_u32_lit_comp(0xe5e5e5ff), rgba_from_u32_lit_comp(0x7fcc99ff), rgba_from_u32_lit_comp(0x66b2e5ff), @@ -811,25 +793,25 @@ rgba_from_u32_lit_comp(0xb23219ff), rgba_from_u32_lit_comp(0xb23219ff), }; -Vec4F32 df_g_theme_preset_colors__handmade_hero[78] = +Vec4F32 df_g_theme_preset_colors__handmade_hero[75] = { rgba_from_u32_lit_comp(0xff00ffff), -rgba_from_u32_lit_comp(0x99ccff4c), -rgba_from_u32_lit_comp(0x0000007f), -rgba_from_u32_lit_comp(0x66e566e5), -rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xb27219ff), -rgba_from_u32_lit_comp(0xb27219ff), -rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0x0000003f), -rgba_from_u32_lit_comp(0xffffff0c), -rgba_from_u32_lit_comp(0x0000003f), rgba_from_u32_lit_comp(0xe5e5e5ff), rgba_from_u32_lit_comp(0x32b219ff), rgba_from_u32_lit_comp(0xb23219ff), rgba_from_u32_lit_comp(0xb23219ff), rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0x66e566e5), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xb27219ff), +rgba_from_u32_lit_comp(0xb27219ff), +rgba_from_u32_lit_comp(0x0000007f), +rgba_from_u32_lit_comp(0x0000003f), +rgba_from_u32_lit_comp(0xffffff0c), +rgba_from_u32_lit_comp(0x0000003f), +rgba_from_u32_lit_comp(0x99ccff4c), +rgba_from_u32_lit_comp(0x0000003f), +rgba_from_u32_lit_comp(0x0000003f), rgba_from_u32_lit_comp(0x3333337f), rgba_from_u32_lit_comp(0x3333337f), rgba_from_u32_lit_comp(0xffffff19), @@ -855,9 +837,6 @@ rgba_from_u32_lit_comp(0x00000000), rgba_from_u32_lit_comp(0x00000000), rgba_from_u32_lit_comp(0x00000000), rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x3333337f), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0xe5e5e5ff), rgba_from_u32_lit_comp(0xe5e5e5ff), rgba_from_u32_lit_comp(0x7fcc99ff), rgba_from_u32_lit_comp(0x66b2e5ff), @@ -893,25 +872,25 @@ rgba_from_u32_lit_comp(0xb23219ff), rgba_from_u32_lit_comp(0xb23219ff), }; -Vec4F32 df_g_theme_preset_colors__four_coder[78] = +Vec4F32 df_g_theme_preset_colors__four_coder[75] = { rgba_from_u32_lit_comp(0xff00ffff), -rgba_from_u32_lit_comp(0x99ccff4c), -rgba_from_u32_lit_comp(0x0000007f), -rgba_from_u32_lit_comp(0x66e566e5), -rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xb27219ff), -rgba_from_u32_lit_comp(0xb27219ff), -rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0x0000003f), -rgba_from_u32_lit_comp(0xffffff0c), -rgba_from_u32_lit_comp(0x0000003f), rgba_from_u32_lit_comp(0xe5e5e5ff), rgba_from_u32_lit_comp(0x32b219ff), rgba_from_u32_lit_comp(0xb23219ff), rgba_from_u32_lit_comp(0xb23219ff), rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0x66e566e5), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xb27219ff), +rgba_from_u32_lit_comp(0xb27219ff), +rgba_from_u32_lit_comp(0x0000007f), +rgba_from_u32_lit_comp(0x0000003f), +rgba_from_u32_lit_comp(0xffffff0c), +rgba_from_u32_lit_comp(0x0000003f), +rgba_from_u32_lit_comp(0x99ccff4c), +rgba_from_u32_lit_comp(0x0000003f), +rgba_from_u32_lit_comp(0x0000003f), rgba_from_u32_lit_comp(0x3333337f), rgba_from_u32_lit_comp(0x3333337f), rgba_from_u32_lit_comp(0xffffff19), @@ -937,9 +916,6 @@ rgba_from_u32_lit_comp(0x00000000), rgba_from_u32_lit_comp(0x00000000), rgba_from_u32_lit_comp(0x00000000), rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x3333337f), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0xe5e5e5ff), rgba_from_u32_lit_comp(0xe5e5e5ff), rgba_from_u32_lit_comp(0x7fcc99ff), rgba_from_u32_lit_comp(0x66b2e5ff), @@ -975,25 +951,25 @@ rgba_from_u32_lit_comp(0xb23219ff), rgba_from_u32_lit_comp(0xb23219ff), }; -Vec4F32 df_g_theme_preset_colors__far_manager[78] = +Vec4F32 df_g_theme_preset_colors__far_manager[75] = { rgba_from_u32_lit_comp(0xff00ffff), -rgba_from_u32_lit_comp(0x99ccff4c), -rgba_from_u32_lit_comp(0x0000007f), -rgba_from_u32_lit_comp(0x66e566e5), -rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xb27219ff), -rgba_from_u32_lit_comp(0xb27219ff), -rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0x0000003f), -rgba_from_u32_lit_comp(0xffffff0c), -rgba_from_u32_lit_comp(0x0000003f), rgba_from_u32_lit_comp(0xe5e5e5ff), rgba_from_u32_lit_comp(0x32b219ff), rgba_from_u32_lit_comp(0xb23219ff), rgba_from_u32_lit_comp(0xb23219ff), rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0x66e566e5), +rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xb27219ff), +rgba_from_u32_lit_comp(0xb27219ff), +rgba_from_u32_lit_comp(0x0000007f), +rgba_from_u32_lit_comp(0x0000003f), +rgba_from_u32_lit_comp(0xffffff0c), +rgba_from_u32_lit_comp(0x0000003f), +rgba_from_u32_lit_comp(0x99ccff4c), +rgba_from_u32_lit_comp(0x0000003f), +rgba_from_u32_lit_comp(0x0000003f), rgba_from_u32_lit_comp(0x3333337f), rgba_from_u32_lit_comp(0x3333337f), rgba_from_u32_lit_comp(0xffffff19), @@ -1019,9 +995,6 @@ rgba_from_u32_lit_comp(0x00000000), rgba_from_u32_lit_comp(0x00000000), rgba_from_u32_lit_comp(0x00000000), rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x3333337f), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0xe5e5e5ff), rgba_from_u32_lit_comp(0xe5e5e5ff), rgba_from_u32_lit_comp(0x7fcc99ff), rgba_from_u32_lit_comp(0x66b2e5ff), @@ -1070,25 +1043,25 @@ df_g_theme_preset_colors__four_coder, df_g_theme_preset_colors__far_manager, }; -String8 df_g_theme_color_display_string_table[78] = +String8 df_g_theme_color_display_string_table[75] = { str8_lit_comp("Null"), -str8_lit_comp("Selection"), -str8_lit_comp("Drop Shadow"), -str8_lit_comp("Cursor"), -str8_lit_comp("Cursor (Inactive)"), -str8_lit_comp("Focus"), -str8_lit_comp("Hover"), -str8_lit_comp("Highlight 0"), -str8_lit_comp("Highlight 1"), -str8_lit_comp("Disabled Overlay"), -str8_lit_comp("Drop Site Overlay"), -str8_lit_comp("Inactive Panel Overlay"), str8_lit_comp("Text"), str8_lit_comp("Text (Positive)"), str8_lit_comp("Text (Negative)"), str8_lit_comp("Text (Neutral)"), str8_lit_comp("Text (Weak)"), +str8_lit_comp("Cursor"), +str8_lit_comp("Cursor (Inactive)"), +str8_lit_comp("Focus"), +str8_lit_comp("Hover"), +str8_lit_comp("Drop Shadow"), +str8_lit_comp("Disabled Overlay"), +str8_lit_comp("Drop Site Overlay"), +str8_lit_comp("Inactive Panel Overlay"), +str8_lit_comp("Selection Overlay"), +str8_lit_comp("Highlight Overlay"), +str8_lit_comp("Error Highlight Overlay"), str8_lit_comp("Base Background"), str8_lit_comp("Base Background (Alternate)"), str8_lit_comp("Base Border"), @@ -1114,9 +1087,6 @@ str8_lit_comp("Tab Background"), str8_lit_comp("Tab Border"), str8_lit_comp("Tab Background (Inactive)"), str8_lit_comp("Tab Border (Inactive)"), -str8_lit_comp("Code Background (Negative)"), -str8_lit_comp("Code Line Numbers"), -str8_lit_comp("Code Line Numbers (Inactive)"), str8_lit_comp("Code (Default)"), str8_lit_comp("Code (Symbol)"), str8_lit_comp("Code (Type)"), @@ -1152,25 +1122,25 @@ str8_lit_comp("Thread (Error)"), str8_lit_comp("Breakpoint"), }; -String8 df_g_theme_color_cfg_string_table[78] = +String8 df_g_theme_color_cfg_string_table[75] = { str8_lit_comp("null"), -str8_lit_comp("selection"), -str8_lit_comp("drop_shadow"), -str8_lit_comp("cursor"), -str8_lit_comp("cursor_inactive"), -str8_lit_comp("focus"), -str8_lit_comp("hover"), -str8_lit_comp("highlight_0"), -str8_lit_comp("highlight_1"), -str8_lit_comp("disabled_overlay"), -str8_lit_comp("drop_site_overlay"), -str8_lit_comp("inactive_panel_overlay"), str8_lit_comp("text"), str8_lit_comp("text_positive"), str8_lit_comp("text_negative"), str8_lit_comp("text_neutral"), str8_lit_comp("text_weak"), +str8_lit_comp("cursor"), +str8_lit_comp("cursor_inactive"), +str8_lit_comp("focus"), +str8_lit_comp("hover"), +str8_lit_comp("drop_shadow"), +str8_lit_comp("disabled_overlay"), +str8_lit_comp("drop_site_overlay"), +str8_lit_comp("inactive_panel_overlay"), +str8_lit_comp("selection_overlay"), +str8_lit_comp("highlight_overlay"), +str8_lit_comp("error_highlight_overlay"), str8_lit_comp("base_background"), str8_lit_comp("base_background_alt"), str8_lit_comp("base_border"), @@ -1196,9 +1166,6 @@ str8_lit_comp("tab_background"), str8_lit_comp("tab_border"), str8_lit_comp("tab_background_inactive"), str8_lit_comp("tab_border_inactive"), -str8_lit_comp("code_background_negative"), -str8_lit_comp("code_line_numbers_active"), -str8_lit_comp("code_line_numbers_inactive"), str8_lit_comp("code_default"), str8_lit_comp("code_symbol"), str8_lit_comp("code_type"), diff --git a/src/df/gfx/generated/df_gfx.meta.h b/src/df/gfx/generated/df_gfx.meta.h index f28b14c2..42f19245 100644 --- a/src/df/gfx/generated/df_gfx.meta.h +++ b/src/df/gfx/generated/df_gfx.meta.h @@ -45,22 +45,22 @@ DF_GfxViewKind_COUNT, typedef enum DF_ThemeColor { DF_ThemeColor_Null, -DF_ThemeColor_Selection, -DF_ThemeColor_DropShadow, -DF_ThemeColor_Cursor, -DF_ThemeColor_CursorInactive, -DF_ThemeColor_Focus, -DF_ThemeColor_Hover, -DF_ThemeColor_Highlight0, -DF_ThemeColor_Highlight1, -DF_ThemeColor_DisabledOverlay, -DF_ThemeColor_DropSiteOverlay, -DF_ThemeColor_InactivePanelOverlay, 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, @@ -86,9 +86,6 @@ DF_ThemeColor_TabBackground, DF_ThemeColor_TabBorder, DF_ThemeColor_TabBackgroundInactive, DF_ThemeColor_TabBorderInactive, -DF_ThemeColor_CodeBackgroundNegative, -DF_ThemeColor_CodeLineNumbersActive, -DF_ThemeColor_CodeLineNumbersInactive, DF_ThemeColor_CodeDefault, DF_ThemeColor_CodeSymbol, DF_ThemeColor_CodeType, @@ -310,18 +307,18 @@ 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[30]; extern String8 df_g_theme_color_version_remap_new_name_table[30]; -extern Vec4F32 df_g_theme_preset_colors__default_dark[78]; -extern Vec4F32 df_g_theme_preset_colors__default_light[78]; -extern Vec4F32 df_g_theme_preset_colors__vs_dark[78]; -extern Vec4F32 df_g_theme_preset_colors__vs_light[78]; -extern Vec4F32 df_g_theme_preset_colors__solarized_dark[78]; -extern Vec4F32 df_g_theme_preset_colors__solarized_light[78]; -extern Vec4F32 df_g_theme_preset_colors__handmade_hero[78]; -extern Vec4F32 df_g_theme_preset_colors__four_coder[78]; -extern Vec4F32 df_g_theme_preset_colors__far_manager[78]; +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[78]; -extern String8 df_g_theme_color_cfg_string_table[78]; +extern String8 df_g_theme_color_display_string_table[75]; +extern String8 df_g_theme_color_cfg_string_table[75]; 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, From 614954b7ef195ecf05888ffe45eef4151656647e Mon Sep 17 00:00:00 2001 From: Ryan Fleury Date: Mon, 24 Jun 2024 14:46:16 -0700 Subject: [PATCH 14/47] checkpoint on palettes, fix source view overlay margin building/drawing --- src/df/gfx/df_gfx.c | 180 ++++++++++++++++++-------------- src/df/gfx/df_views.c | 20 +--- src/draw/draw.c | 1 + src/render/d3d11/render_d3d11.c | 30 ++++++ src/render/render_core.h | 1 + src/ui/ui_basic_widgets.c | 14 +-- src/ui/ui_basic_widgets.h | 1 - src/ui/ui_core.c | 27 ++++- src/ui/ui_core.h | 16 ++- 9 files changed, 178 insertions(+), 112 deletions(-) diff --git a/src/df/gfx/df_gfx.c b/src/df/gfx/df_gfx.c index f4e06627..aa363f13 100644 --- a/src/df/gfx/df_gfx.c +++ b/src/df/gfx/df_gfx.c @@ -3450,8 +3450,16 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) icon_info.icon_kind_text_map[UI_IconKind_CheckFilled] = df_g_icon_kind_text_table[DF_IconKind_CheckFilled]; } + // rjf: build widget palette info + UI_WidgetPaletteInfo widget_palette_info = {0}; + { + widget_palette_info.tooltip_palette = df_palette_from_code(DF_PaletteCode_Floating); + widget_palette_info.ctx_menu_palette = df_palette_from_code(DF_PaletteCode_Floating); + widget_palette_info.scrollbar_palette = df_palette_from_code(DF_PaletteCode_ScrollBarButton); + } + // rjf: begin & push initial stack values - ui_begin_build(ws->os, &events, &icon_info, df_dt(), df_dt()); + ui_begin_build(ws->os, &events, &icon_info, &widget_palette_info, df_dt(), df_dt()); ui_push_font(main_font); ui_push_font_size(main_font_size); ui_push_pref_width(ui_em(20.f, 1)); @@ -10570,6 +10578,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ UI_Palette *margin_palette = df_palette_from_code(DF_PaletteCode_Floating); UI_Palette *margin_contents_palette = ui_build_palette(df_palette_from_code(DF_PaletteCode_Floating)); margin_contents_palette->background = v4f32(0, 0, 0, 0); + F32 line_num_padding_px = ui_top_font_size()*1.f; ////////////////////////////// //- rjf: build top-level container @@ -10700,7 +10709,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ ui_set_next_pref_width(ui_px(params->priority_margin_width_px, 1)); ui_set_next_pref_height(ui_px(params->line_height_px*(dim_1s64(params->line_num_range)+1), 1.f)); ui_build_box_from_key(0, ui_key_zero()); - ui_set_next_fixed_x(params->margin_float_off_px); + ui_set_next_fixed_x(floor_f32(params->margin_float_off_px)); } ui_set_next_pref_width(ui_px(params->priority_margin_width_px, 1)); ui_set_next_pref_height(ui_px(params->line_height_px*(dim_1s64(params->line_num_range)+1), 1.f)); @@ -10862,7 +10871,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ ui_set_next_pref_width(ui_px(params->catchall_margin_width_px, 1)); ui_set_next_pref_height(ui_px(params->line_height_px*(dim_1s64(params->line_num_range)+1), 1.f)); ui_build_box_from_key(0, ui_key_zero()); - ui_set_next_fixed_x(params->margin_float_off_px + params->priority_margin_width_px); + ui_set_next_fixed_x(floor_f32(params->margin_float_off_px + params->priority_margin_width_px)); } ui_set_next_pref_width(ui_px(params->catchall_margin_width_px, 1)); ui_set_next_pref_height(ui_px(params->line_height_px*(dim_1s64(params->line_num_range)+1), 1.f)); @@ -11186,6 +11195,92 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ } } + ////////////////////////////// + //- rjf: build line numbers + // + if(params->flags & DF_CodeSliceFlag_LineNums) UI_Parent(top_container_box) ProfScope("build line numbers") UI_Focus(UI_FocusKind_Off) + { + TxtRng select_rng = txt_rng(*cursor, *mark); + Vec4F32 active_color = df_rgba_from_theme_color(DF_ThemeColor_CodeLineNumbersSelected); + Vec4F32 inactive_color = df_rgba_from_theme_color(DF_ThemeColor_CodeLineNumbers); + ui_set_next_fixed_x(floor_f32(params->margin_float_off_px + params->priority_margin_width_px + params->catchall_margin_width_px)); + ui_set_next_pref_width(ui_px(params->line_num_width_px, 1.f)); + ui_set_next_pref_height(ui_px(params->line_height_px*(dim_1s64(params->line_num_range)+1), 1.f)); + ui_set_next_flags(UI_BoxFlag_DrawSideLeft|UI_BoxFlag_DrawSideRight); + UI_Column + UI_PrefHeight(ui_px(params->line_height_px, 1.f)) + UI_Font(params->font) + UI_FontSize(params->font_size) + UI_CornerRadius(0) + { + U64 line_idx = 0; + for(S64 line_num = params->line_num_range.min; + line_num <= params->line_num_range.max; + line_num += 1, line_idx += 1) + { + Vec4F32 text_color = (select_rng.min.line <= line_num && line_num <= select_rng.max.line) ? active_color : inactive_color; + Vec4F32 bg_color = v4f32(0, 0, 0, 0); + + // rjf: line info on this line -> adjust bg color to visualize + B32 has_line_info = 0; + { + S64 line_info_line_num = 0; + F32 line_info_t = 0; + DF_TextLineSrc2DasmInfoList *src2dasm_list = ¶ms->line_src2dasm[line_idx]; + DF_TextLineDasm2SrcInfoList *dasm2src_list = ¶ms->line_dasm2src[line_idx]; + if(src2dasm_list->first != 0) + { + has_line_info = (src2dasm_list->first->v.remap_line == line_num); + line_info_line_num = line_num; + line_info_t = selected_thread_module->alive_t; + } + if(dasm2src_list->first != 0) + { + DF_TextLineDasm2SrcInfo *dasm2src_info = 0; + U64 best_stamp = 0; + for(DF_TextLineDasm2SrcInfoNode *n = dasm2src_list->first; n != 0; n = n->next) + { + if(n->v.file->timestamp > best_stamp) + { + dasm2src_info = &n->v; + best_stamp = n->v.file->timestamp; + } + } + if(dasm2src_info != 0) + { + has_line_info = 1; + line_info_line_num = dasm2src_info->pt.line; + line_info_t = selected_thread_module->alive_t; + } + } + if(has_line_info) + { + Vec4F32 color = code_line_bgs[line_info_line_num % ArrayCount(code_line_bgs)]; + color.w *= line_info_t; + bg_color = color; + } + } + + // rjf: build line num box + ui_set_next_palette(ui_build_palette(ui_top_palette(), .text = text_color, .background = bg_color)); + ui_build_box_from_stringf(UI_BoxFlag_DrawText|(UI_BoxFlag_DrawBackground*!!has_line_info), "%I64u##line_num", line_num); + } + } + } + + ////////////////////////////// + //- rjf: build background for line numbers & margins + // + { + UI_Parent(top_container_box) DF_Palette(DF_PaletteCode_Floating) + { + ui_set_next_pref_width(ui_px(params->priority_margin_width_px + params->catchall_margin_width_px + params->line_num_width_px, 1)); + ui_set_next_pref_height(ui_px(params->line_height_px*(dim_1s64(params->line_num_range)+1), 1.f)); + ui_set_next_fixed_x(floor_f32(params->margin_float_off_px)); + ui_build_box_from_key(UI_BoxFlag_DrawBackgroundBlur|UI_BoxFlag_DrawBackground|UI_BoxFlag_DrawDropShadow, ui_key_zero()); + } + } + ////////////////////////////// //- rjf: build main text container box, for mouse interaction on both lines & line numbers // @@ -11356,7 +11451,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ String8 line_string = (params->line_num_range.min <= line_num && line_num <= params->line_num_range.max) ? (params->line_text[mouse_y_line_idx]) : str8_zero(); // rjf: mouse x * string => column - S64 column = f_char_pos_from_tag_size_string_p(params->font, params->font_size, 0, params->tab_size, line_string, mouse.x-text_container_box->rect.x0-params->line_num_width_px)+1; + S64 column = f_char_pos_from_tag_size_string_p(params->font, params->font_size, 0, params->tab_size, line_string, mouse.x-text_container_box->rect.x0-params->line_num_width_px-line_num_padding_px)+1; // rjf: bundle mouse_pt = txt_pt(line_num, column); @@ -11657,82 +11752,13 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ } ////////////////////////////// - //- rjf: build line numbers + //- rjf: build line numbers region (line number interaction should be basically identical to lines) // - if(params->flags & DF_CodeSliceFlag_LineNums) UI_Parent(text_container_box) ProfScope("build line numbers") UI_Focus(UI_FocusKind_Off) + if(params->flags & DF_CodeSliceFlag_LineNums) UI_Parent(text_container_box) ProfScope("build line number interaction box") UI_Focus(UI_FocusKind_Off) { - TxtRng select_rng = txt_rng(*cursor, *mark); - Vec4F32 active_color = df_rgba_from_theme_color(DF_ThemeColor_CodeLineNumbersSelected); - Vec4F32 inactive_color = df_rgba_from_theme_color(DF_ThemeColor_CodeLineNumbers); - if(params->margin_float_off_px != 0) - { - ui_set_next_pref_width(ui_px(params->line_num_width_px, 1.f)); - ui_set_next_pref_height(ui_px(params->line_height_px*(dim_1s64(params->line_num_range)+1), 1.f)); - ui_build_box_from_key(0, ui_key_zero()); - ui_set_next_fixed_x(params->margin_float_off_px); - } - ui_set_next_flags(UI_BoxFlag_DrawSideRight|UI_BoxFlag_DrawSideLeft); - ui_set_next_pref_width(ui_px(params->line_num_width_px, 1.f)); + ui_set_next_pref_width(ui_px(params->line_num_width_px + line_num_padding_px, 1.f)); ui_set_next_pref_height(ui_px(params->line_height_px*(dim_1s64(params->line_num_range)+1), 1.f)); - UI_Column - UI_PrefHeight(ui_px(params->line_height_px, 1.f)) - UI_Font(params->font) - UI_FontSize(params->font_size) - UI_CornerRadius(0) - { - U64 line_idx = 0; - for(S64 line_num = params->line_num_range.min; - line_num <= params->line_num_range.max; - line_num += 1, line_idx += 1) - { - Vec4F32 text_color = (select_rng.min.line <= line_num && line_num <= select_rng.max.line) ? active_color : inactive_color; - Vec4F32 bg_color = v4f32(0, 0, 0, 0); - - // rjf: line info on this line -> adjust bg color to visualize - B32 has_line_info = 0; - { - S64 line_info_line_num = 0; - F32 line_info_t = 0; - DF_TextLineSrc2DasmInfoList *src2dasm_list = ¶ms->line_src2dasm[line_idx]; - DF_TextLineDasm2SrcInfoList *dasm2src_list = ¶ms->line_dasm2src[line_idx]; - if(src2dasm_list->first != 0) - { - has_line_info = (src2dasm_list->first->v.remap_line == line_num); - line_info_line_num = line_num; - line_info_t = selected_thread_module->alive_t; - } - if(dasm2src_list->first != 0) - { - DF_TextLineDasm2SrcInfo *dasm2src_info = 0; - U64 best_stamp = 0; - for(DF_TextLineDasm2SrcInfoNode *n = dasm2src_list->first; n != 0; n = n->next) - { - if(n->v.file->timestamp > best_stamp) - { - dasm2src_info = &n->v; - best_stamp = n->v.file->timestamp; - } - } - if(dasm2src_info != 0) - { - has_line_info = 1; - line_info_line_num = dasm2src_info->pt.line; - line_info_t = selected_thread_module->alive_t; - } - } - if(has_line_info) - { - Vec4F32 color = code_line_bgs[line_info_line_num % ArrayCount(code_line_bgs)]; - color.w *= line_info_t; - bg_color = color; - } - } - - // rjf: build line num box - ui_set_next_palette(ui_build_palette(ui_top_palette(), .text = text_color, .background = bg_color)); - ui_build_box_from_stringf(UI_BoxFlag_DrawText|(UI_BoxFlag_DrawBackground*!!has_line_info), "%I64u##line_num", line_num); - } - } + ui_build_box_from_key(0, ui_key_zero()); } ////////////////////////////// diff --git a/src/df/gfx/df_views.c b/src/df/gfx/df_views.c index c93a4cf2..3b60d407 100644 --- a/src/df/gfx/df_views.c +++ b/src/df/gfx/df_views.c @@ -5883,10 +5883,6 @@ DF_VIEW_UI_FUNCTION_DEF(Code) code_slice_params.line_text_max_width_px = (F32)line_size_x; code_slice_params.flash_ranges = df_push_entity_child_list_with_kind(scratch.arena, entity, DF_EntityKind_FlashMarker); code_slice_params.margin_float_off_px = view->scroll_pos.x.idx + view->scroll_pos.x.off; - if(code_slice_params.margin_float_off_px < 1) - { - code_slice_params.margin_float_off_px = 0; - } // rjf: fill text info { @@ -6440,7 +6436,6 @@ DF_VIEW_UI_FUNCTION_DEF(Code) ui_set_next_fixed_y(code_area_dim.y); ui_set_next_fixed_width(panel_box_dim.x - scroll_bar_dim); ui_set_next_fixed_height(scroll_bar_dim); - DF_Palette(DF_PaletteCode_ScrollBarButton) { view->scroll_pos.x = ui_scroll_bar(Axis2_X, ui_px(scroll_bar_dim, 1.f), @@ -6459,7 +6454,6 @@ DF_VIEW_UI_FUNCTION_DEF(Code) ui_set_next_fixed_y(0); ui_set_next_fixed_width(scroll_bar_dim); ui_set_next_fixed_height(panel_box_dim.y - bottom_bar_dim.y - scroll_bar_dim); - DF_Palette(DF_PaletteCode_ScrollBarButton) { view->scroll_pos.y = ui_scroll_bar(Axis2_Y, ui_px(scroll_bar_dim, 1.f), @@ -6977,10 +6971,7 @@ DF_VIEW_UI_FUNCTION_DEF(Disassembly) code_slice_params.line_text_max_width_px = (F32)line_size_x; code_slice_params.flash_ranges = df_push_entity_child_list_with_kind(scratch.arena, process, DF_EntityKind_FlashMarker); code_slice_params.margin_float_off_px = view->scroll_pos.x.idx + view->scroll_pos.x.off; - if(code_slice_params.margin_float_off_px < 1) - { - code_slice_params.margin_float_off_px = 0; - } + di_key_list_push(scratch.arena, &code_slice_params.relevant_dbgi_keys, &dbgi_key); // rjf: fill text info @@ -7341,7 +7332,6 @@ DF_VIEW_UI_FUNCTION_DEF(Disassembly) ui_set_next_fixed_y(code_area_dim.y); ui_set_next_fixed_width(panel_box_dim.x - scroll_bar_dim); ui_set_next_fixed_height(scroll_bar_dim); - DF_Palette(DF_PaletteCode_ScrollBarButton) { view->scroll_pos.x = ui_scroll_bar(Axis2_X, ui_px(scroll_bar_dim, 1.f), @@ -7360,7 +7350,6 @@ DF_VIEW_UI_FUNCTION_DEF(Disassembly) ui_set_next_fixed_y(0); ui_set_next_fixed_width(scroll_bar_dim); ui_set_next_fixed_height(panel_box_dim.y - bottom_bar_dim.y - scroll_bar_dim); - DF_Palette(DF_PaletteCode_ScrollBarButton) { view->scroll_pos.y = ui_scroll_bar(Axis2_Y, ui_px(scroll_bar_dim, 1.f), @@ -7822,10 +7811,6 @@ DF_VIEW_UI_FUNCTION_DEF(Output) code_slice_params.line_text_max_width_px = (F32)line_size_x; code_slice_params.flash_ranges = df_push_entity_child_list_with_kind(scratch.arena, entity, DF_EntityKind_FlashMarker); code_slice_params.margin_float_off_px = view->scroll_pos.x.idx + view->scroll_pos.x.off; - if(code_slice_params.margin_float_off_px < 1) - { - code_slice_params.margin_float_off_px = 0; - } } ////////////////////////////// @@ -8144,7 +8129,6 @@ DF_VIEW_UI_FUNCTION_DEF(Output) ui_set_next_fixed_y(code_area_dim.y); ui_set_next_fixed_width(panel_box_dim.x - scroll_bar_dim); ui_set_next_fixed_height(scroll_bar_dim); - DF_Palette(DF_PaletteCode_ScrollBarButton) { view->scroll_pos.x = ui_scroll_bar(Axis2_X, ui_px(scroll_bar_dim, 1.f), @@ -8163,7 +8147,6 @@ DF_VIEW_UI_FUNCTION_DEF(Output) ui_set_next_fixed_y(0); ui_set_next_fixed_width(scroll_bar_dim); ui_set_next_fixed_height(panel_box_dim.y - bottom_bar_dim.y - scroll_bar_dim); - DF_Palette(DF_PaletteCode_ScrollBarButton) { view->scroll_pos.y = ui_scroll_bar(Axis2_Y, ui_px(scroll_bar_dim, 1.f), @@ -8730,7 +8713,6 @@ DF_VIEW_UI_FUNCTION_DEF(Memory) ui_set_next_fixed_y(content_rect.y0); ui_set_next_fixed_width(scroll_bar_dim); ui_set_next_fixed_height(dim_2f32(content_rect).y); - DF_Palette(DF_PaletteCode_ScrollBarButton) { view->scroll_pos.y = ui_scroll_bar(Axis2_Y, ui_px(scroll_bar_dim, 1.f), diff --git a/src/draw/draw.c b/src/draw/draw.c index d9ae24d6..222ed34e 100644 --- a/src/draw/draw.c +++ b/src/draw/draw.c @@ -312,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; diff --git a/src/render/d3d11/render_d3d11.c b/src/render/d3d11/render_d3d11.c index b417243d..6e7af460 100644 --- a/src/render/d3d11/render_d3d11.c +++ b/src/render/d3d11/render_d3d11.c @@ -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; diff --git a/src/render/render_core.h b/src/render/render_core.h index d2c130a6..89cda8e0 100644 --- a/src/render/render_core.h +++ b/src/render/render_core.h @@ -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]; }; diff --git a/src/ui/ui_basic_widgets.c b/src/ui/ui_basic_widgets.c index e2b72ba6..4e9c2981 100644 --- a/src/ui/ui_basic_widgets.c +++ b/src/ui/ui_basic_widgets.c @@ -4,16 +4,6 @@ //////////////////////////////// //~ rjf: Basic Widgets -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; -} - internal void ui_divider(UI_Size size) { @@ -1190,6 +1180,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); @@ -1307,6 +1299,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; } diff --git a/src/ui/ui_basic_widgets.h b/src/ui/ui_basic_widgets.h index befcb4cc..172b0545 100644 --- a/src/ui/ui_basic_widgets.h +++ b/src/ui/ui_basic_widgets.h @@ -68,7 +68,6 @@ 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, ...); diff --git a/src/ui/ui_core.c b/src/ui/ui_core.c index d4a90085..37f4ea13 100644 --- a/src/ui/ui_core.c +++ b/src/ui/ui_core.c @@ -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, F32 real_dt, F32 animation_dt) { //- rjf: reset per-build ui state { @@ -758,6 +758,7 @@ 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); } //- rjf: do default navigation @@ -1724,11 +1725,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<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<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<view_off.v[axis]; + child->rect.p0.v[axis] = root->rect.p0.v[axis] + child->fixed_position.v[axis] - !(child->flags&(UI_BoxFlag_SkipViewOffX<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); @@ -1772,6 +1773,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 @@ -1781,11 +1794,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(); @@ -1795,6 +1812,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) @@ -1826,6 +1844,7 @@ ui_tooltip_end(void) ui_row_end(); UI_PrefWidth(ui_px(0, 1)) ui_spacer(ui_em(1.f, 1.f)); ui_column_end(); + ui_pop_palette(); ui_tooltip_end_base(); } @@ -1863,6 +1882,7 @@ ui_begin_ctx_menu(UI_Key key) 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) { @@ -1891,6 +1911,7 @@ ui_end_ctx_menu(void) 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(); diff --git a/src/ui/ui_core.h b/src/ui/ui_core.h index cdf4f246..a0031a5a 100644 --- a/src/ui/ui_core.h +++ b/src/ui/ui_core.h @@ -196,7 +196,7 @@ struct UI_Size }; //////////////////////////////// -//~ rjf: Color Schemes +//~ rjf: Palettes typedef enum UI_ColorCode { @@ -232,6 +232,14 @@ struct UI_Palette }; }; +typedef struct UI_WidgetPaletteInfo UI_WidgetPaletteInfo; +struct UI_WidgetPaletteInfo +{ + UI_Palette *tooltip_palette; + UI_Palette *ctx_menu_palette; + UI_Palette *scrollbar_palette; +}; + //////////////////////////////// //~ rjf: Scroll Positions @@ -565,6 +573,7 @@ struct UI_State //- rjf: build parameters UI_IconInfo icon_info; + UI_WidgetPaletteInfo widget_palette_info; OS_Handle window; UI_EventList *events; Vec2F32 mouse; @@ -729,7 +738,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, 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); @@ -741,6 +750,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); From ff32449ba2a413cab412356c0f2a9d0873fd9969 Mon Sep 17 00:00:00 2001 From: Ryan Fleury Date: Mon, 24 Jun 2024 15:14:13 -0700 Subject: [PATCH 15/47] adjust rich hover info in source/disasm view to be less noisy; require hovering over line number margin, rather than always displaying it for whatever line the mouse is over --- src/df/gfx/df_gfx.c | 14 +++++++------- src/raddbg/raddbg.h | 10 ++++++++-- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/src/df/gfx/df_gfx.c b/src/df/gfx/df_gfx.c index aa363f13..054a5e0f 100644 --- a/src/df/gfx/df_gfx.c +++ b/src/df/gfx/df_gfx.c @@ -11655,7 +11655,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ ////////////////////////////// //- rjf: mouse -> set global frontend hovered line info // - if(ui_hovering(text_container_sig) && contains_1s64(params->line_num_range, mouse_pt.line)) + if(ui_hovering(text_container_sig) && contains_1s64(params->line_num_range, mouse_pt.line) && (ui_mouse().x - text_container_box->rect.x0 < params->line_num_width_px + line_num_padding_px)) { U64 line_slice_idx = mouse_pt.line-params->line_num_range.min; if(params->line_src2dasm[line_slice_idx].first != 0 && @@ -11756,7 +11756,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ // if(params->flags & DF_CodeSliceFlag_LineNums) UI_Parent(text_container_box) ProfScope("build line number interaction box") UI_Focus(UI_FocusKind_Off) { - ui_set_next_pref_width(ui_px(params->line_num_width_px + line_num_padding_px, 1.f)); + ui_set_next_pref_width(ui_px(params->line_num_width_px, 1.f)); ui_set_next_pref_height(ui_px(params->line_height_px*(dim_1s64(params->line_num_range)+1), 1.f)); ui_build_box_from_key(0, ui_key_zero()); } @@ -11784,7 +11784,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ String8 line_string = params->line_text[line_idx]; Rng1U64 line_range = params->line_ranges[line_idx]; TXT_TokenArray *line_tokens = ¶ms->line_tokens[line_idx]; - ui_set_next_text_padding(-2); + ui_set_next_text_padding(line_num_padding_px-2); UI_Key line_key = ui_key_from_stringf(top_container_box->key, "ln_%I64x", line_num); Vec4F32 line_bg_color = line_bg_colors[line_idx]; if(line_bg_color.w != 0) @@ -11942,9 +11942,9 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ }; Rng2F32 match_rect = { - line_box->rect.x0+match_column_pixel_off_range.min, + line_box->rect.x0+line_num_padding_px+match_column_pixel_off_range.min, line_box->rect.y0, - line_box->rect.x0+match_column_pixel_off_range.max+2.f, + line_box->rect.x0+line_num_padding_px+match_column_pixel_off_range.max+2.f, line_box->rect.y1, }; Vec4F32 color = df_rgba_from_theme_color(DF_ThemeColor_HighlightOverlay); @@ -11997,9 +11997,9 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ }; Rng2F32 select_rect = { - line_box->rect.x0+select_column_pixel_off_range.min, + line_box->rect.x0+line_num_padding_px+select_column_pixel_off_range.min, floorf(line_box->rect.y0) - 1.f, - line_box->rect.x0+select_column_pixel_off_range.max+2.f, + line_box->rect.x0+line_num_padding_px+select_column_pixel_off_range.max+2.f, ceilf(line_box->rect.y1) + 1.f, }; Vec4F32 color = n->color; diff --git a/src/raddbg/raddbg.h b/src/raddbg/raddbg.h index 20798205..6fc2e550 100644 --- a/src/raddbg/raddbg.h +++ b/src/raddbg/raddbg.h @@ -8,11 +8,10 @@ // [ ] n-row table selection, in watch window & other UIs, multi-selection // ctrl+C // -// [ ] theme colors -> more explicit about e.g. opaque backgrounds vs. floating +// [x] 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 @@ -26,6 +25,13 @@ // threads you haven't? Or, there could even be a debugger-specific API // that you use to tag them. Just some way that would make it easier to // focus on your own threads. +// +// [ ] "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) From 0a5cc5df6fd87c40b24d2340e19879186639c413 Mon Sep 17 00:00:00 2001 From: Ryan Fleury Date: Mon, 24 Jun 2024 15:23:56 -0700 Subject: [PATCH 16/47] ui: group key, for menu-bar-style interactions, where you have several distinct boxes, but want one interaction to continuously flow between them --- src/df/gfx/df_gfx.c | 3 ++- src/raddbg/raddbg.h | 12 ++++++------ src/ui/generated/ui.meta.c | 6 ++++++ src/ui/generated/ui.meta.h | 11 +++++++++++ src/ui/ui.mdesk | 1 + src/ui/ui_core.c | 21 +++++++++++++++++++++ src/ui/ui_core.h | 7 +++++++ 7 files changed, 54 insertions(+), 7 deletions(-) diff --git a/src/df/gfx/df_gfx.c b/src/df/gfx/df_gfx.c index 054a5e0f..7172f861 100644 --- a/src/df/gfx/df_gfx.c +++ b/src/df/gfx/df_gfx.c @@ -4707,6 +4707,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) UI_WidthFill UI_Row UI_Focus(UI_FocusKind_Null) { + UI_Key menu_bar_group_key = ui_key_from_string(ui_key_zero(), str8_lit("###top_bar_group")); MemoryZeroArray(ui_top_parent()->parent->corner_radii); //- rjf: left column @@ -4729,7 +4730,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) //- rjf: menu items ui_set_next_flags(UI_BoxFlag_DrawBackground); - UI_PrefWidth(ui_children_sum(1)) UI_Row UI_PrefWidth(ui_text_dim(20, 1)) + UI_PrefWidth(ui_children_sum(1)) UI_Row UI_PrefWidth(ui_text_dim(20, 1)) UI_GroupKey(menu_bar_group_key) { // rjf: file menu UI_Key file_menu_key = ui_key_from_string(ui_key_zero(), str8_lit("_file_menu_key_")); diff --git a/src/raddbg/raddbg.h b/src/raddbg/raddbg.h index 6fc2e550..307b61d3 100644 --- a/src/raddbg/raddbg.h +++ b/src/raddbg/raddbg.h @@ -105,7 +105,7 @@ // [ ] lock icon // [ ] "rotation arrow" icon next to executables // -// [ ] Using the word "symbol" in "Code (Symbol)" seems like a bad idea, since +// [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. // @@ -118,16 +118,16 @@ // 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 +// [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? // -// [ ] ** Scrollbars are barely visible for me, for some reason. I could not +// [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. // -// [ ] Many of the UI elements, like the menus, would like better if they had +// [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. // @@ -144,11 +144,11 @@ // [ ] 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 +// [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. -// [ ] Similarly, pressing the left mouse button on a menu and dragging to an +// [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. // diff --git a/src/ui/generated/ui.meta.c b/src/ui/generated/ui.meta.c index 6b8d711b..6f0d82e5 100644 --- a/src/ui/generated/ui.meta.c +++ b/src/ui/generated/ui.meta.c @@ -16,6 +16,7 @@ #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_Palette(v) DeferLoop(ui_push_palette(v), ui_pop_palette()) #define UI_Squish(v) DeferLoop(ui_push_squish(v), ui_pop_squish()) @@ -44,6 +45,7 @@ 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 UI_Palette* ui_top_palette(void) { UI_StackTopImpl(ui_state, Palette, palette) } internal F32 ui_top_squish(void) { UI_StackTopImpl(ui_state, Squish, squish) } @@ -71,6 +73,7 @@ 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 UI_Palette* ui_bottom_palette(void) { UI_StackBottomImpl(ui_state, Palette, palette) } internal F32 ui_bottom_squish(void) { UI_StackBottomImpl(ui_state, Squish, squish) } @@ -98,6 +101,7 @@ 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 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) } @@ -125,6 +129,7 @@ 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 UI_Palette* ui_pop_palette(void) { UI_StackPopImpl(ui_state, Palette, palette) } internal F32 ui_pop_squish(void) { UI_StackPopImpl(ui_state, Squish, squish) } @@ -152,6 +157,7 @@ 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 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) } diff --git a/src/ui/generated/ui.meta.h b/src/ui/generated/ui.meta.h index 1b2c1683..9573288f 100644 --- a/src/ui/generated/ui.meta.h +++ b/src/ui/generated/ui.meta.h @@ -18,6 +18,7 @@ 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_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;}; @@ -48,6 +49,7 @@ 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_PaletteNode palette_nil_stack_top;\ UI_SquishNode squish_nil_stack_top;\ @@ -77,6 +79,7 @@ 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->palette_nil_stack_top.v = &ui_g_nil_palette;\ state->squish_nil_stack_top.v = 0;\ @@ -108,6 +111,7 @@ 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_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;\ @@ -137,6 +141,7 @@ 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->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;\ @@ -166,6 +171,7 @@ 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->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; }\ @@ -194,6 +200,7 @@ 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 UI_Palette* ui_top_palette(void); internal F32 ui_top_squish(void); @@ -221,6 +228,7 @@ 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 UI_Palette* ui_bottom_palette(void); internal F32 ui_bottom_squish(void); @@ -248,6 +256,7 @@ 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 UI_Palette* ui_push_palette(UI_Palette* v); internal F32 ui_push_squish(F32 v); @@ -275,6 +284,7 @@ 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 UI_Palette* ui_pop_palette(void); internal F32 ui_pop_squish(void); @@ -302,6 +312,7 @@ 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 UI_Palette* ui_set_next_palette(UI_Palette* v); internal F32 ui_set_next_squish(F32 v); diff --git a/src/ui/ui.mdesk b/src/ui/ui.mdesk index 0f9cdcc0..1f1e3a6a 100644 --- a/src/ui/ui.mdesk +++ b/src/ui/ui.mdesk @@ -27,6 +27,7 @@ UI_StackTable: { 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 } diff --git a/src/ui/ui_core.c b/src/ui/ui_core.c index 37f4ea13..697c09fe 100644 --- a/src/ui/ui_core.c +++ b/src/ui/ui_core.c @@ -2142,6 +2142,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())) { @@ -2771,6 +2772,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< set drop hot key // diff --git a/src/ui/ui_core.h b/src/ui/ui_core.h index a0031a5a..6048ebf7 100644 --- a/src/ui/ui_core.h +++ b/src/ui/ui_core.h @@ -375,6 +375,7 @@ 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; @@ -821,6 +822,7 @@ 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 UI_Palette* ui_top_palette(void); internal F32 ui_top_squish(void); @@ -848,6 +850,7 @@ 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 UI_Palette* ui_bottom_palette(void); internal F32 ui_bottom_squish(void); @@ -875,6 +878,7 @@ 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 UI_Palette* ui_push_palette(UI_Palette* v); internal F32 ui_push_squish(F32 v); @@ -902,6 +906,7 @@ 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 UI_Palette* ui_pop_palette(void); internal F32 ui_pop_squish(void); @@ -929,6 +934,7 @@ 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 UI_Palette* ui_set_next_palette(UI_Palette* v); internal F32 ui_set_next_squish(F32 v); @@ -970,6 +976,7 @@ 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_Palette(v) DeferLoop(ui_push_palette(v), ui_pop_palette()) #define UI_Squish(v) DeferLoop(ui_push_squish(v), ui_pop_squish()) From 2588bbcd12f9a137cfbdcb55b0f49be94939d732 Mon Sep 17 00:00:00 2001 From: Ryan Fleury Date: Mon, 24 Jun 2024 15:25:22 -0700 Subject: [PATCH 17/47] notes --- src/raddbg/raddbg.h | 57 ++++++++++++++++++++++++--------------------- 1 file changed, 30 insertions(+), 27 deletions(-) diff --git a/src/raddbg/raddbg.h b/src/raddbg/raddbg.h index 307b61d3..7afea840 100644 --- a/src/raddbg/raddbg.h +++ b/src/raddbg/raddbg.h @@ -8,8 +8,6 @@ // [ ] n-row table selection, in watch window & other UIs, multi-selection // ctrl+C // -// [x] theme colors -> more explicit about e.g. opaque backgrounds vs. floating -// & scrollbars etc. // [ ] target/breakpoint/watch-pin reordering // // [ ] theme lister -> fonts & font sizes @@ -105,10 +103,6 @@ // [ ] lock icon // [ ] "rotation arrow" icon next to executables // -// [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. -// // [ ] 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? @@ -118,19 +112,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. // -// [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. -// // [ ] 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. @@ -144,14 +125,6 @@ // [ ] 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. // -// [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. -// // [ ] 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 @@ -389,6 +362,36 @@ // 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. #ifndef RADDBG_H #define RADDBG_H From 586b3e3072b0a77ebffdace82c9e57938094978f Mon Sep 17 00:00:00 2001 From: Ryan Fleury Date: Mon, 24 Jun 2024 15:32:50 -0700 Subject: [PATCH 18/47] fix incorrect margin measurement in output view --- src/df/gfx/df_gfx.mdesk | 3 +-- src/df/gfx/df_views.c | 4 ++-- src/df/gfx/generated/df_gfx.meta.c | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/df/gfx/df_gfx.mdesk b/src/df/gfx/df_gfx.mdesk index d331a67b..40ff39da 100644 --- a/src/df/gfx/df_gfx.mdesk +++ b/src/df/gfx/df_gfx.mdesk @@ -386,8 +386,7 @@ DF_ThemeColorTable: {DropSiteOverlay "Drop Site Overlay" drop_site_overlay 0xffffff0c 0xffffff0c 0xffffff0c 0xffffff0c 0xffffff0c 0xffffff0c 0xffffff0c 0xffffff0c 0xffffff0c ""} {InactivePanelOverlay "Inactive Panel Overlay" inactive_panel_overlay 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f ""} {SelectionOverlay "Selection Overlay" selection_overlay 0x99ccff4c 0x99ccff4c 0x99ccff4c 0x99ccff4c 0x99ccff4c 0x99ccff4c 0x99ccff4c 0x99ccff4c 0x99ccff4c ""} - {HighlightOverlay "Highlight Overlay" highlight_overlay 0x3b4a515f - 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f ""} + {HighlightOverlay "Highlight Overlay" highlight_overlay 0xffffff1e 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f ""} {HighlightOverlayError "Error Highlight Overlay" error_highlight_overlay 0x5f12005f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f ""} //- rjf: base ui container colors diff --git a/src/df/gfx/df_views.c b/src/df/gfx/df_views.c index 3b60d407..cf74a5a7 100644 --- a/src/df/gfx/df_views.c +++ b/src/df/gfx/df_views.c @@ -7805,8 +7805,8 @@ DF_VIEW_UI_FUNCTION_DEF(Output) code_slice_params.tab_size = code_tab_size; code_slice_params.line_height_px = code_line_height; code_slice_params.search_query = search_query; - code_slice_params.priority_margin_width_px = priority_margin_width_px; - code_slice_params.catchall_margin_width_px = catchall_margin_width_px; + code_slice_params.priority_margin_width_px = 0.f; + code_slice_params.catchall_margin_width_px = 0.f; code_slice_params.line_num_width_px = line_num_width_px; code_slice_params.line_text_max_width_px = (F32)line_size_x; code_slice_params.flash_ranges = df_push_entity_child_list_with_kind(scratch.arena, entity, DF_EntityKind_FlashMarker); diff --git a/src/df/gfx/generated/df_gfx.meta.c b/src/df/gfx/generated/df_gfx.meta.c index 9e327f41..d79299c9 100644 --- a/src/df/gfx/generated/df_gfx.meta.c +++ b/src/df/gfx/generated/df_gfx.meta.c @@ -336,7 +336,7 @@ rgba_from_u32_lit_comp(0x0000003f), rgba_from_u32_lit_comp(0xffffff0c), rgba_from_u32_lit_comp(0x0000003f), rgba_from_u32_lit_comp(0x99ccff4c), -rgba_from_u32_lit_comp(0x3b4a515f), +rgba_from_u32_lit_comp(0xffffff1e), rgba_from_u32_lit_comp(0x5f12005f), rgba_from_u32_lit_comp(0x1b1b1bfe), rgba_from_u32_lit_comp(0x2b2b2bfe), From 883aa2d1de5f2326b30104028a547447f54fd113 Mon Sep 17 00:00:00 2001 From: Ryan Fleury Date: Mon, 24 Jun 2024 15:34:56 -0700 Subject: [PATCH 19/47] fix binding ui interaction with group keys --- src/df/gfx/df_gfx.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/df/gfx/df_gfx.c b/src/df/gfx/df_gfx.c index 7172f861..95deae8e 100644 --- a/src/df/gfx/df_gfx.c +++ b/src/df/gfx/df_gfx.c @@ -9841,6 +9841,7 @@ df_cmd_binding_button(DF_CmdSpec *spec) ui_set_next_hover_cursor(OS_Cursor_HandPoint); ui_set_next_text_alignment(UI_TextAlign_Center); ui_set_next_palette(palette); + ui_set_next_group_key(ui_key_zero()); UI_Box *box = ui_build_box_from_stringf(UI_BoxFlag_DrawText| UI_BoxFlag_Clickable| UI_BoxFlag_DrawActiveEffects| From 15d42027e70e9d4aac880b3368a0ae3d6f9fc924 Mon Sep 17 00:00:00 2001 From: Ryan Fleury Date: Mon, 24 Jun 2024 15:39:12 -0700 Subject: [PATCH 20/47] adjust memory view for new ui palettes & themes --- src/df/gfx/df_views.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/df/gfx/df_views.c b/src/df/gfx/df_views.c index cf74a5a7..e0bbda90 100644 --- a/src/df/gfx/df_views.c +++ b/src/df/gfx/df_views.c @@ -8885,7 +8885,7 @@ DF_VIEW_UI_FUNCTION_DEF(Memory) if(global_byte_num == mouse_hover_byte_num) { cell_flags |= UI_BoxFlag_DrawBorder|UI_BoxFlag_DrawSideTop|UI_BoxFlag_DrawSideBottom|UI_BoxFlag_DrawSideLeft|UI_BoxFlag_DrawSideRight; - cell_border_rgba = df_rgba_from_theme_color(DF_ThemeColor_HighlightOverlay); + cell_border_rgba = df_rgba_from_theme_color(DF_ThemeColor_Hover); } if(annotation != 0) { @@ -8905,6 +8905,7 @@ DF_VIEW_UI_FUNCTION_DEF(Memory) cell_flags |= UI_BoxFlag_DrawBackground; cell_bg_rgba = df_rgba_from_theme_color(DF_ThemeColor_SelectionOverlay); } + ui_set_next_palette(ui_build_palette(ui_top_palette(), .background = cell_bg_rgba)); UI_Box *cell_box = ui_build_box_from_key(UI_BoxFlag_DrawText|cell_flags, ui_key_zero()); ui_box_equip_display_fancy_strings(cell_box, &byte_fancy_strings[byte_value]); { From b4b8f5f0abb40d6c1132ceec5881de4e3de8f1be Mon Sep 17 00:00:00 2001 From: Ryan Fleury Date: Mon, 24 Jun 2024 16:14:06 -0700 Subject: [PATCH 21/47] fix some escape-to-cancel & context menu behavior; notes --- src/df/gfx/df_gfx.c | 57 ++++++++------------------------------- src/raddbg/raddbg.h | 31 +++++++++++---------- src/ui/ui_basic_widgets.c | 30 +++++++++++++++++++++ 3 files changed, 56 insertions(+), 62 deletions(-) diff --git a/src/df/gfx/df_gfx.c b/src/df/gfx/df_gfx.c index 95deae8e..5218142f 100644 --- a/src/df/gfx/df_gfx.c +++ b/src/df/gfx/df_gfx.c @@ -10343,15 +10343,8 @@ df_entity_desc_button(DF_Window *ws, DF_Entity *entity, FuzzyMatchRangeList *nam else if(ui_right_clicked(sig)) { DF_Handle handle = df_handle_from_entity(entity); - if(ui_ctx_menu_is_open(ws->entity_ctx_menu_key) && df_handle_match(ws->entity_ctx_menu_entity, handle)) - { - ui_ctx_menu_close(); - } - else - { - ui_ctx_menu_open(ws->entity_ctx_menu_key, sig.box->key, v2f32(0, sig.box->rect.y1 - sig.box->rect.y0)); - ws->entity_ctx_menu_entity = handle; - } + ui_ctx_menu_open(ws->entity_ctx_menu_key, sig.box->key, v2f32(0, sig.box->rect.y1 - sig.box->rect.y0)); + ws->entity_ctx_menu_entity = handle; } // rjf: drag+drop @@ -10837,15 +10830,8 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ if(ui_right_clicked(thread_sig)) { DF_Handle handle = df_handle_from_entity(thread); - if(ui_ctx_menu_is_open(ws->entity_ctx_menu_key) && df_handle_match(ws->entity_ctx_menu_entity, handle)) - { - ui_ctx_menu_close(); - } - else - { - ui_ctx_menu_open(ws->entity_ctx_menu_key, thread_box->key, v2f32(0, thread_box->rect.y1-thread_box->rect.y0)); - ws->entity_ctx_menu_entity = handle; - } + ui_ctx_menu_open(ws->entity_ctx_menu_key, thread_box->key, v2f32(0, thread_box->rect.y1-thread_box->rect.y0)); + ws->entity_ctx_menu_entity = handle; } // rjf: drag start @@ -11001,15 +10987,8 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ if(ui_right_clicked(thread_sig)) { DF_Handle handle = df_handle_from_entity(thread); - if(ui_ctx_menu_is_open(ws->entity_ctx_menu_key) && df_handle_match(ws->entity_ctx_menu_entity, handle)) - { - ui_ctx_menu_close(); - } - else - { - ui_ctx_menu_open(ws->entity_ctx_menu_key, thread_box->key, v2f32(0, thread_box->rect.y1-thread_box->rect.y0)); - ws->entity_ctx_menu_entity = handle; - } + ui_ctx_menu_open(ws->entity_ctx_menu_key, thread_box->key, v2f32(0, thread_box->rect.y1-thread_box->rect.y0)); + ws->entity_ctx_menu_entity = handle; } // rjf: double click => select @@ -11109,15 +11088,8 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ if(ui_right_clicked(bp_sig)) { DF_Handle handle = df_handle_from_entity(bp); - if(ui_ctx_menu_is_open(ws->entity_ctx_menu_key) && df_handle_match(ws->entity_ctx_menu_entity, handle)) - { - ui_ctx_menu_close(); - } - else - { - ui_ctx_menu_open(ws->entity_ctx_menu_key, bp_box->key, v2f32(0, bp_box->rect.y1-bp_box->rect.y0)); - ws->entity_ctx_menu_entity = handle; - } + ui_ctx_menu_open(ws->entity_ctx_menu_key, bp_box->key, v2f32(0, bp_box->rect.y1-bp_box->rect.y0)); + ws->entity_ctx_menu_entity = handle; } } @@ -11176,15 +11148,8 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ if(ui_right_clicked(pin_sig)) { DF_Handle handle = df_handle_from_entity(pin); - if(ui_ctx_menu_is_open(ws->entity_ctx_menu_key) && df_handle_match(ws->entity_ctx_menu_entity, handle)) - { - ui_ctx_menu_close(); - } - else - { - ui_ctx_menu_open(ws->entity_ctx_menu_key, pin_box->key, v2f32(0, pin_box->rect.y1-pin_box->rect.y0)); - ws->entity_ctx_menu_entity = handle; - } + ui_ctx_menu_open(ws->entity_ctx_menu_key, pin_box->key, v2f32(0, pin_box->rect.y1-pin_box->rect.y0)); + ws->entity_ctx_menu_entity = handle; } } } @@ -11417,7 +11382,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ payload.entity = df_handle_from_entity(pin); df_drag_begin(&payload); } - if(ui_clicked(sig) || ui_right_clicked(sig)) + if(ui_right_clicked(sig)) { ui_ctx_menu_open(ws->entity_ctx_menu_key, sig.box->key, v2f32(0, sig.box->rect.y1-sig.box->rect.y0)); ws->entity_ctx_menu_entity = df_handle_from_entity(pin); diff --git a/src/raddbg/raddbg.h b/src/raddbg/raddbg.h index 7afea840..5b89f3cc 100644 --- a/src/raddbg/raddbg.h +++ b/src/raddbg/raddbg.h @@ -125,12 +125,6 @@ // [ ] 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. // -// [ ] 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 @@ -169,16 +163,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 @@ -392,6 +376,21 @@ // [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? +// #ifndef RADDBG_H #define RADDBG_H diff --git a/src/ui/ui_basic_widgets.c b/src/ui/ui_basic_widgets.c index 4e9c2981..56d1f63c 100644 --- a/src/ui/ui_basic_widgets.c +++ b/src/ui/ui_basic_widgets.c @@ -614,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 @@ -709,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 @@ -787,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 From 0d581694e6d9e6e2f67c7e550d92d67e71d8ee26 Mon Sep 17 00:00:00 2001 From: Ryan Fleury Date: Mon, 24 Jun 2024 16:35:23 -0700 Subject: [PATCH 22/47] notes; tweaks; fixes --- src/df/gfx/df_gfx.c | 1 + src/df/gfx/df_views.c | 2 +- src/raddbg/raddbg.h | 74 ++++++++++++++++++++++++++++++------------- 3 files changed, 54 insertions(+), 23 deletions(-) diff --git a/src/df/gfx/df_gfx.c b/src/df/gfx/df_gfx.c index 5218142f..435aaf23 100644 --- a/src/df/gfx/df_gfx.c +++ b/src/df/gfx/df_gfx.c @@ -11313,6 +11313,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ DF_IconKind icon = DF_IconKind_WarningBig; String8 explanation = df_stop_explanation_string_icon_from_ctrl_event(scratch.arena, &stop_event, &icon); UI_Parent(line_extras_boxes[line_idx]) UI_PrefWidth(ui_children_sum(1)) UI_PrefHeight(ui_px(params->line_height_px, 1.f)) + UI_Palette(ui_build_palette(ui_top_palette(), .text = df_rgba_from_theme_color(DF_ThemeColor_TextNegative))) { UI_Box *box = ui_build_box_from_stringf(UI_BoxFlag_DrawBorder, "###exception_info"); UI_Parent(box) UI_PrefWidth(ui_text_dim(10, 1)) diff --git a/src/df/gfx/df_views.c b/src/df/gfx/df_views.c index e0bbda90..97700d6e 100644 --- a/src/df/gfx/df_views.c +++ b/src/df/gfx/df_views.c @@ -1661,7 +1661,7 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS ui_set_next_pref_width(ui_pct(1, 0)); ui_set_next_pref_height(ui_px(scroll_list_params.row_height_px*row->size_in_rows, 1.f)); ui_set_next_focus_hot(row_selected ? UI_FocusKind_On : UI_FocusKind_Off); - UI_Box *row_box = ui_build_box_from_stringf(row_flags|UI_BoxFlag_DrawSideBottom|UI_BoxFlag_Clickable|UI_BoxFlag_DisableFocusOverlay, "row_%I64x", row_hash); + UI_Box *row_box = ui_build_box_from_stringf(row_flags|UI_BoxFlag_DrawSideBottom|UI_BoxFlag_Clickable|(!(row->flags & DF_EvalVizRowFlag_Canvas) * UI_BoxFlag_DisableFocusOverlay), "row_%I64x", row_hash); ui_ts_vector_idx += 1; ui_ts_cell_idx = 0; diff --git a/src/raddbg/raddbg.h b/src/raddbg/raddbg.h index 5b89f3cc..7098987f 100644 --- a/src/raddbg/raddbg.h +++ b/src/raddbg/raddbg.h @@ -2,15 +2,52 @@ // Licensed under the MIT license (https://opensource.org/license/mit/) //////////////////////////////// -//~ rjf: Frontend/UI Pass Tasks +//~ rjf: 0.9.11 TODO +// +// [ ] user settings (ui & functionality - generally need a story for it) +// [ ] hover animations +// [ ] press animations +// [ ] focus animations +// [ ] tooltip animations +// [ ] context menu animations +// [ ] scrolling animations +// [ ] background blur +// [ ] tab width +// [ ] auto-scroll output window +// +// [ ] 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. +// +// [ ] inline breakpoint hit_count +// [ ] to count hit counts, resolve all bps to addresses, check addresses +// against stopper thread's +// +// [ ] colors: fill out rest of theme presets for new theme setup // // [ ] editing multiple bindings for commands +// [ ] theme lister -> fonts & font sizes +// [ ] "Browse..." buttons should adopt a more relevant starting search path, +// if possible +// +// [ ] highlighted text & ctrl+f -> auto-fill search query +// [ ] double click on procedure in procedures tab to jump to source +// [ ] double-click any part of frame in callstack view -> snap to function + +//////////////////////////////// +//~ rjf: Frontend/UI Pass Tasks +// // [ ] n-row table selection, in watch window & other UIs, multi-selection // ctrl+C // // [ ] target/breakpoint/watch-pin reordering // -// [ ] theme lister -> fonts & font sizes // [ ] font lister // [ ] per-panel font size overrides // @@ -34,31 +71,26 @@ //////////////////////////////// //~ rjf: Hot, High Priority Tasks (Complete Unusability, Crashes, Fire-Worthy) // -// [ ] "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 + +//////////////////////////////// +//~ 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 @@ -78,6 +110,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 @@ -89,11 +125,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 @@ -125,14 +156,7 @@ // [ ] 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. // -// [ ] 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 @@ -187,6 +211,12 @@ //////////////////////////////// //~ 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 From 7a185f956071923f0e46fb5aad0f74fd75ccbc01 Mon Sep 17 00:00:00 2001 From: Ryan Fleury Date: Tue, 25 Jun 2024 08:04:00 -0700 Subject: [PATCH 23/47] auto-fill ctrl+f query from selection; fix single-cell copy/paste in watch views; tweaks/fixes --- src/df/core/df_core.h | 3 - src/df/gfx/df_gfx.c | 142 ++++++++++++++++++-------------------- src/df/gfx/df_views.c | 24 +++++-- src/raddbg/raddbg.h | 2 +- src/ui/ui_basic_widgets.c | 6 +- src/ui/ui_basic_widgets.h | 2 +- src/ui/ui_core.c | 2 +- 7 files changed, 93 insertions(+), 88 deletions(-) diff --git a/src/df/core/df_core.h b/src/df/core/df_core.h index dc43b278..9f7dfdc8 100644 --- a/src/df/core/df_core.h +++ b/src/df/core/df_core.h @@ -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; diff --git a/src/df/gfx/df_gfx.c b/src/df/gfx/df_gfx.c index 435aaf23..ca09d491 100644 --- a/src/df/gfx/df_gfx.c +++ b/src/df/gfx/df_gfx.c @@ -3572,99 +3572,91 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) //////////////////////////// //- rjf: developer menu // - if(ws->dev_menu_is_open) - UI_Font(df_font_from_slot(DF_FontSlot_Code)) - UI_PaneF(r2f32p(30, 30, 30+ui_top_font_size()*100, ui_top_font_size()*150), "###dev_ctx_menu") + if(ws->dev_menu_is_open) UI_Font(df_font_from_slot(DF_FontSlot_Code)) { - //- rjf: toggles - for(U64 idx = 0; idx < ArrayCount(DEV_toggle_table); idx += 1) + ui_set_next_flags(UI_BoxFlag_ViewScrollY|UI_BoxFlag_AllowOverflowY|UI_BoxFlag_ViewClamp); + UI_PaneF(r2f32p(30, 30, 30+ui_top_font_size()*100, ui_top_font_size()*150), "###dev_ctx_menu") { - if(ui_clicked(df_icon_button(*DEV_toggle_table[idx].value_ptr ? DF_IconKind_CheckFilled : DF_IconKind_CheckHollow, 0, DEV_toggle_table[idx].name))) + //- rjf: toggles + for(U64 idx = 0; idx < ArrayCount(DEV_toggle_table); idx += 1) { - *DEV_toggle_table[idx].value_ptr ^= 1; - } - } - - //- rjf: stats & info - { - //- rjf: draw per-window stats - for(DF_Window *window = df_gfx_state->first_window; window != 0; window = window->next) - { - // rjf: calc ui hash chain length - F64 avg_ui_hash_chain_length = 0; + if(ui_clicked(df_icon_button(*DEV_toggle_table[idx].value_ptr ? DF_IconKind_CheckFilled : DF_IconKind_CheckHollow, 0, DEV_toggle_table[idx].name))) { - F64 chain_count = 0; - F64 chain_length_sum = 0; - for(U64 idx = 0; idx < ws->ui->box_table_size; idx += 1) - { - F64 chain_length = 0; - for(UI_Box *b = ws->ui->box_table[idx].hash_first; !ui_box_is_nil(b); b = b->hash_next) - { - chain_length += 1; - } - if(chain_length > 0) - { - chain_length_sum += chain_length; - chain_count += 1; - } - } - avg_ui_hash_chain_length = chain_length_sum / chain_count; - } - ui_labelf("Target Hz: %.2f", 1.f/df_dt()); - ui_labelf("Ctrl Run Index: %I64u", ctrl_run_gen()); - ui_labelf("Ctrl Mem Gen Index: %I64u", ctrl_mem_gen()); - ui_labelf("Window %p", window); - ui_set_next_pref_width(ui_children_sum(1)); - ui_set_next_pref_height(ui_children_sum(1)); - UI_Row - { - ui_spacer(ui_em(2.f, 1.f)); - ui_labelf("Box Count: %I64u", window->ui->last_build_box_count); - } - ui_set_next_pref_width(ui_children_sum(1)); - ui_set_next_pref_height(ui_children_sum(1)); - UI_Row - { - ui_spacer(ui_em(2.f, 1.f)); - ui_labelf("Average UI Hash Chain Length: %f", avg_ui_hash_chain_length); + *DEV_toggle_table[idx].value_ptr ^= 1; } } - //- rjf: draw entity file tree -#if 0 - DF_EntityRec rec = {0}; - S32 indent = 0; - UI_PrefWidth(ui_text_dim(10, 1)) ui_labelf("Entity File Tree:"); - for(DF_Entity *e = df_entity_root(); !df_entity_is_nil(e); e = rec.next) + //- rjf: stats & info { - switch(e->kind) + //- rjf: draw per-window stats + for(DF_Window *window = df_gfx_state->first_window; window != 0; window = window->next) { - default:{}break; - case DF_EntityKind_File: - case DF_EntityKind_OverrideFileLink: + // rjf: calc ui hash chain length + F64 avg_ui_hash_chain_length = 0; { - ui_set_next_pref_width(ui_children_sum(1)); - ui_set_next_pref_height(ui_children_sum(1)); - UI_Row + F64 chain_count = 0; + F64 chain_length_sum = 0; + for(U64 idx = 0; idx < ws->ui->box_table_size; idx += 1) { - ui_spacer(ui_em(2.f*indent, 1.f)); - if(e->kind == DF_EntityKind_File) + F64 chain_length = 0; + for(UI_Box *b = ws->ui->box_table[idx].hash_first; !ui_box_is_nil(b); b = b->hash_next) { - ui_label(e->name); + chain_length += 1; } - if(e->kind == DF_EntityKind_OverrideFileLink) + if(chain_length > 0) { - DF_Entity *dst = df_entity_from_handle(e->entity_handle); - ui_labelf("[link] %S -> %S", e->name, dst->name); + chain_length_sum += chain_length; + chain_count += 1; } } - }break; + avg_ui_hash_chain_length = chain_length_sum / chain_count; + } + ui_labelf("Target Hz: %.2f", 1.f/df_dt()); + ui_labelf("Ctrl Run Index: %I64u", ctrl_run_gen()); + ui_labelf("Ctrl Mem Gen Index: %I64u", ctrl_mem_gen()); + ui_labelf("Window %p", window); + ui_set_next_pref_width(ui_children_sum(1)); + ui_set_next_pref_height(ui_children_sum(1)); + UI_Row + { + ui_spacer(ui_em(2.f, 1.f)); + ui_labelf("Box Count: %I64u", window->ui->last_build_box_count); + } + ui_set_next_pref_width(ui_children_sum(1)); + ui_set_next_pref_height(ui_children_sum(1)); + UI_Row + { + ui_spacer(ui_em(2.f, 1.f)); + ui_labelf("Average UI Hash Chain Length: %f", avg_ui_hash_chain_length); + } + } + + //- rjf: draw entity tree + DF_EntityRec rec = {0}; + S32 indent = 0; + UI_PrefWidth(ui_text_dim(10, 1)) ui_labelf("Entity Tree:"); + for(DF_Entity *e = df_entity_root(); !df_entity_is_nil(e); e = rec.next) + { + ui_set_next_pref_width(ui_children_sum(1)); + ui_set_next_pref_height(ui_children_sum(1)); + UI_Row + { + ui_spacer(ui_em(2.f*indent, 1.f)); + if(e->kind == DF_EntityKind_OverrideFileLink) + { + DF_Entity *dst = df_entity_from_handle(e->entity_handle); + ui_labelf("[link] %S -> %S", e->name, dst->name); + } + else + { + ui_labelf("%S: %S", df_g_entity_kind_display_string_table[e->kind], e->name); + } + } + rec = df_entity_rec_df_pre(e, df_entity_root()); + indent += rec.push_count; + indent -= rec.pop_count; } - rec = df_entity_rec_df_pre(e, df_entity_root()); - indent += rec.push_count; - indent -= rec.pop_count; } -#endif } } diff --git a/src/df/gfx/df_views.c b/src/df/gfx/df_views.c index 97700d6e..c11212a3 100644 --- a/src/df/gfx/df_views.c +++ b/src/df/gfx/df_views.c @@ -1264,11 +1264,18 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS String8 cell_string = df_string_from_eval_viz_row_column_kind(scratch.arena, eval_view, parse_ctx.type_graph, parse_ctx.rdi, row, (DF_WatchViewColumnKind)x, 0); cell_string = str8_skip_chop_whitespace(cell_string); U64 comma_pos = str8_find_needle(cell_string, 0, str8_lit(","), 0); - str8_list_pushf(scratch.arena, &strs, "%s%S%s%s", - comma_pos < cell_string.size ? "\"" : "", - cell_string, - comma_pos < cell_string.size ? "\"" : "", - x+1 <= selection_tbl.max.x ? "," : ""); + if(selection_tbl.min.x != selection_tbl.max.x || selection_tbl.min.y != selection_tbl.max.y) + { + str8_list_pushf(scratch.arena, &strs, "%s%S%s%s", + comma_pos < cell_string.size ? "\"" : "", + cell_string, + comma_pos < cell_string.size ? "\"" : "", + x+1 <= selection_tbl.max.x ? "," : ""); + } + else + { + str8_list_push(scratch.arena, &strs, cell_string); + } } if(y+1 <= selection_tbl.max.y) { @@ -6298,6 +6305,13 @@ DF_VIEW_UI_FUNCTION_DEF(Code) os_set_clipboard_text(text); } + //- rjf: selected text on single line, no query? -> set search text + if(!txt_pt_match(tv->cursor, tv->mark) && tv->cursor.line == tv->mark.line && search_query.size == 0) + { + String8 text = txt_string_from_info_data_txt_rng(&text_info, data, txt_rng(tv->cursor, tv->mark)); + df_set_search_string(text); + } + //- rjf: toggle cursor watch if(sig.toggle_cursor_watch) { diff --git a/src/raddbg/raddbg.h b/src/raddbg/raddbg.h index 7098987f..62209438 100644 --- a/src/raddbg/raddbg.h +++ b/src/raddbg/raddbg.h @@ -36,7 +36,7 @@ // [ ] "Browse..." buttons should adopt a more relevant starting search path, // if possible // -// [ ] highlighted text & ctrl+f -> auto-fill search query +// [x] highlighted text & ctrl+f -> auto-fill search query // [ ] double click on procedure in procedures tab to jump to source // [ ] double-click any part of frame in callstack view -> snap to function diff --git a/src/ui/ui_basic_widgets.c b/src/ui/ui_basic_widgets.c index 56d1f63c..5fe1ed9d 100644 --- a/src/ui/ui_basic_widgets.c +++ b/src/ui/ui_basic_widgets.c @@ -908,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; } //////////////////////////////// diff --git a/src/ui/ui_basic_widgets.h b/src/ui/ui_basic_widgets.h index 172b0545..b500e187 100644 --- a/src/ui/ui_basic_widgets.h +++ b/src/ui/ui_basic_widgets.h @@ -130,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 diff --git a/src/ui/ui_core.c b/src/ui/ui_core.c index 697c09fe..aeaa4173 100644 --- a/src/ui/ui_core.c +++ b/src/ui/ui_core.c @@ -1417,7 +1417,7 @@ 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), From c10ac170a8ea377583667cc0038b2548da4c256d Mon Sep 17 00:00:00 2001 From: Ryan Fleury Date: Tue, 25 Jun 2024 09:09:10 -0700 Subject: [PATCH 24/47] config settings, for top-level toggles or simple numeric parameters; use to mask off animations, background blurs, and so on; use to control tab width --- src/df/core/df_core.c | 15 ---- src/df/core/df_core.h | 1 - src/df/gfx/df_gfx.c | 109 ++++++++++++++++++++++++++--- src/df/gfx/df_gfx.h | 17 +++++ src/df/gfx/df_gfx.mdesk | 47 +++++++++++-- src/df/gfx/df_view_rules.c | 4 +- src/df/gfx/df_views.c | 6 +- src/df/gfx/generated/df_gfx.meta.c | 48 +++++++++++++ src/df/gfx/generated/df_gfx.meta.h | 17 +++++ src/ui/ui_core.c | 15 ++-- src/ui/ui_core.h | 24 ++++++- 11 files changed, 258 insertions(+), 45 deletions(-) diff --git a/src/df/core/df_core.c b/src/df/core/df_core.c index e281ace6..48c05da7 100644 --- a/src/df/core/df_core.c +++ b/src/df/core/df_core.c @@ -248,21 +248,6 @@ df_expand_tree_table_init(Arena *arena, DF_ExpandTreeTable *table, U64 slot_coun table->slots = push_array(arena, DF_ExpandSlot, table->slots_count); } -internal void -df_expand_tree_table_animate(DF_ExpandTreeTable *table, F32 dt) -{ - F32 rate = 1 - pow_f32(2, (-50.f * dt)); - for(U64 slot_idx = 0; slot_idx < table->slots_count; slot_idx += 1) - { - for(DF_ExpandNode *node = table->slots[slot_idx].first; - node != 0; - node = node->hash_next) - { - node->expanded_t += (((F32)!!node->expanded) - node->expanded_t) * rate; - } - } -} - internal DF_ExpandNode * df_expand_node_from_key(DF_ExpandTreeTable *table, DF_ExpandKey key) { diff --git a/src/df/core/df_core.h b/src/df/core/df_core.h index 9f7dfdc8..bf34f047 100644 --- a/src/df/core/df_core.h +++ b/src/df/core/df_core.h @@ -1363,7 +1363,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); diff --git a/src/df/gfx/df_gfx.c b/src/df/gfx/df_gfx.c index ca09d491..392a6d17 100644 --- a/src/df/gfx/df_gfx.c +++ b/src/df/gfx/df_gfx.c @@ -3458,8 +3458,19 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) widget_palette_info.scrollbar_palette = df_palette_from_code(DF_PaletteCode_ScrollBarButton); } + // rjf: build animation info + UI_AnimationInfo animation_info = {0}; + { + if(df_setting_val_from_code(DF_SettingCode_HoverAnimations).s32) {animation_info.flags |= UI_AnimationInfoFlag_HotAnimations;} + if(df_setting_val_from_code(DF_SettingCode_PressAnimations).s32) {animation_info.flags |= UI_AnimationInfoFlag_ActiveAnimations;} + if(df_setting_val_from_code(DF_SettingCode_FocusAnimations).s32) {animation_info.flags |= UI_AnimationInfoFlag_FocusAnimations;} + if(df_setting_val_from_code(DF_SettingCode_TooltipAnimations).s32) {animation_info.flags |= UI_AnimationInfoFlag_TooltipAnimations;} + if(df_setting_val_from_code(DF_SettingCode_MenuAnimations).s32) {animation_info.flags |= UI_AnimationInfoFlag_ContextMenuAnimations;} + if(df_setting_val_from_code(DF_SettingCode_ScrollingAnimations).s32) {animation_info.flags |= UI_AnimationInfoFlag_ScrollingAnimations;} + } + // rjf: begin & push initial stack values - ui_begin_build(ws->os, &events, &icon_info, &widget_palette_info, df_dt(), df_dt()); + ui_begin_build(ws->os, &events, &icon_info, &widget_palette_info, &animation_info, df_dt(), df_dt()); ui_push_font(main_font); ui_push_font_size(main_font_size); ui_push_pref_width(ui_em(20.f, 1)); @@ -4569,7 +4580,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) { // rjf: animate target # of rows { - F32 rate = 1 - pow_f32(2, (-60.f * df_dt())); + F32 rate = df_setting_val_from_code(DF_SettingCode_MenuAnimations).s32 ? (1 - pow_f32(2, (-60.f * df_dt()))) : 1.f; F32 target = Min((F32)item_array.count, 16.f); if(abs_f32(target - ws->autocomp_num_visible_rows_t) > 0.01f) { @@ -4584,7 +4595,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) // rjf: animate open { - F32 rate = 1 - pow_f32(2, (-60.f * df_dt())); + F32 rate = df_setting_val_from_code(DF_SettingCode_MenuAnimations).s32 ? 1 - pow_f32(2, (-60.f * df_dt())) : 1.f; F32 diff = 1.f-ws->autocomp_open_t; ws->autocomp_open_t += diff*rate; if(abs_f32(diff) < 0.05f) @@ -5690,7 +5701,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) //- rjf: animate query info // { - F32 rate = 1 - pow_f32(2, (-60.f * df_dt())); + F32 rate = df_setting_val_from_code(DF_SettingCode_MenuAnimations).s32 ? 1 - pow_f32(2, (-60.f * df_dt())) : 1.f; // rjf: animate query view selection transition { @@ -5965,7 +5976,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) { // rjf: animate height { - F32 fish_rate = 1 - pow_f32(2, (-60.f * df_dt())); + F32 fish_rate = df_setting_val_from_code(DF_SettingCode_MenuAnimations).s32 ? 1 - pow_f32(2, (-60.f * df_dt())) : 1.f; F32 hover_eval_container_height_target = row_height * Min(30, viz_blocks.total_visual_row_count); ws->hover_eval_num_visible_rows_t += (hover_eval_container_height_target - ws->hover_eval_num_visible_rows_t) * fish_rate; if(abs_f32(hover_eval_container_height_target - ws->hover_eval_num_visible_rows_t) > 0.5f) @@ -5980,7 +5991,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) // rjf: animate open { - F32 fish_rate = 1 - pow_f32(2, (-60.f * df_dt())); + F32 fish_rate = df_setting_val_from_code(DF_SettingCode_MenuAnimations).s32 ? 1 - pow_f32(2, (-60.f * df_dt())) : 1.f; F32 diff = 1.f - ws->hover_eval_open_t; ws->hover_eval_open_t += diff*fish_rate; if(abs_f32(diff) < 0.01f) @@ -6495,7 +6506,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) //- rjf: animate panels // { - F32 rate = 1 - pow_f32(2, (-50.f * df_dt())); + F32 rate = df_setting_val_from_code(DF_SettingCode_MenuAnimations).s32 ? 1 - pow_f32(2, (-50.f * df_dt())) : 1.f; Vec2F32 content_rect_dim = dim_2f32(content_rect); for(DF_Panel *panel = ws->root_panel; !df_panel_is_nil(panel); panel = df_panel_rec_df_pre(panel).next) { @@ -7470,8 +7481,8 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) } view->loading_t += (view->loading_t_target - view->loading_t) * rate; view->is_filtering_t += ((F32)!!view->is_filtering - view->is_filtering_t) * fast_rate; - view->scroll_pos.x.off -= view->scroll_pos.x.off*fast_rate; - view->scroll_pos.y.off -= view->scroll_pos.y.off*fast_rate; + view->scroll_pos.x.off -= view->scroll_pos.x.off * (df_setting_val_from_code(DF_SettingCode_ScrollingAnimations).s32 ? fast_rate : 1.f); + view->scroll_pos.y.off -= view->scroll_pos.y.off * (df_setting_val_from_code(DF_SettingCode_ScrollingAnimations).s32 ? fast_rate : 1.f); if(abs_f32(view->scroll_pos.x.off) < 0.01f) { view->scroll_pos.x.off = 0; @@ -7677,7 +7688,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) } // rjf: blur background - if(box->flags & UI_BoxFlag_DrawBackgroundBlur) + if(box->flags & UI_BoxFlag_DrawBackgroundBlur && df_setting_val_from_code(DF_SettingCode_BackgroundBlur).s32) { R_PassParams_Blur *params = d_blur(box->rect, box->blur_size*(1-box->transparency), 0); MemoryCopyArray(params->corner_radii, box->corner_radii); @@ -9343,6 +9354,23 @@ df_font_size_from_slot(DF_Window *ws, DF_FontSlot slot) return result; } +//- rjf: settings + +internal DF_SettingVal +df_setting_val_from_code(DF_SettingCode code) +{ + DF_SettingVal result = {0}; + for(EachEnumVal(DF_CfgSrc, src)) + { + if(df_gfx_state->cfg_setting_vals[src][code].set) + { + result = df_gfx_state->cfg_setting_vals[src][code]; + break; + } + } + return result; +} + //- rjf: config serialization internal int @@ -9638,6 +9666,29 @@ df_cfg_strings_from_gfx(Arena *arena, String8 root_path, DF_CfgSrc source) str8_list_push(arena, &strs, str8_lit("\n")); } + //- rjf: serialize settings + { + B32 first = 1; + for(EachEnumVal(DF_SettingCode, code)) + { + DF_SettingVal current = df_gfx_state->cfg_setting_vals[source][code]; + if(current.set) + { + if(first) + { + first = 0; + str8_list_push(arena, &strs, str8_lit("/// settings //////////////////////////////////////////////////////////////////\n")); + str8_list_push(arena, &strs, str8_lit("\n")); + } + str8_list_pushf(arena, &strs, "%S: %i\n", df_g_setting_code_lower_string_table[code], current.s32); + } + } + if(!first) + { + str8_list_push(arena, &strs, str8_lit("\n")); + } + } + ProfEnd(); return strs; } @@ -13226,7 +13277,7 @@ df_gfx_begin_frame(Arena *arena, DF_CmdList *cmds) //- rjf: animate confirmation { - F32 rate = 1 - pow_f32(2, (-10.f * df_dt())); + F32 rate = df_setting_val_from_code(DF_SettingCode_MenuAnimations).s32 ? 1 - pow_f32(2, (-10.f * df_dt())) : 1.f; B32 confirm_open = df_gfx_state->confirm_active; df_gfx_state->confirm_t += rate * ((F32)!!confirm_open-df_gfx_state->confirm_t); if(abs_f32(df_gfx_state->confirm_t - (F32)!!confirm_open) > 0.005f) @@ -13980,6 +14031,42 @@ df_gfx_begin_frame(Arena *arena, DF_CmdList *cmds) } } + //- rjf: apply settings + B8 setting_codes_hit[DF_SettingCode_COUNT] = {0}; + MemoryZero(&df_gfx_state->cfg_setting_vals[src][0], sizeof(DF_SettingVal)*DF_SettingCode_COUNT); + for(EachEnumVal(DF_SettingCode, code)) + { + String8 name = df_g_setting_code_lower_string_table[code]; + DF_CfgVal *code_cfg_val = df_cfg_val_from_string(table, name); + DF_CfgNode *root_node = code_cfg_val->last; + if(root_node->source == src) + { + DF_CfgNode *val_node = root_node->first; + S64 val = 0; + if(try_s64_from_str8_c_rules(val_node->string, &val)) + { + df_gfx_state->cfg_setting_vals[src][code].set = 1; + df_gfx_state->cfg_setting_vals[src][code].s32 = (S32)val; + } + if(val_node != &df_g_nil_cfg_node) + { + setting_codes_hit[code] = 1; + } + } + } + + //- rjf: if config applied 0 settings, we need to do some sensible default + if(src == DF_CfgSrc_User) + { + for(EachEnumVal(DF_SettingCode, code)) + { + if(!setting_codes_hit[code]) + { + df_gfx_state->cfg_setting_vals[src][code] = df_g_setting_code_default_val_table[code]; + } + } + } + //- rjf: if config opened 0 windows, we need to do some sensible default if(src == DF_CfgSrc_User && windows->first == &df_g_nil_cfg_node) { diff --git a/src/df/gfx/df_gfx.h b/src/df/gfx/df_gfx.h index ad497292..8d059dd9 100644 --- a/src/df/gfx/df_gfx.h +++ b/src/df/gfx/df_gfx.h @@ -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 @@ -766,6 +776,9 @@ struct DF_GfxState 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; }; @@ -1017,7 +1030,11 @@ internal UI_Palette *df_palette_from_code(DF_PaletteCode code); 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); //////////////////////////////// diff --git a/src/df/gfx/df_gfx.mdesk b/src/df/gfx/df_gfx.mdesk index 40ff39da..3f42d688 100644 --- a/src/df/gfx/df_gfx.mdesk +++ b/src/df/gfx/df_gfx.mdesk @@ -602,11 +602,6 @@ DF_ThemePresetColorTable: (drop_shadow 0x0000007f 0x0000003b 0x0000007f 0x0000003b 0x0000007f 0x0000003b 0x0000007f 0x0000007f 0x0000007f ) } -//////////////////////////////// -//~ rjf: Generators - -//- rjf: theme color tables - @data(String8) df_g_theme_color_display_string_table: { @expand(DF_ThemeColorTable a) `str8_lit_comp("$(a.display_name)")` @@ -617,6 +612,48 @@ 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 } + {TabWidth tab_width "Tab Width" 4 0 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 diff --git a/src/df/gfx/df_view_rules.c b/src/df/gfx/df_view_rules.c index 17cda6c6..8939cb36 100644 --- a/src/df/gfx/df_view_rules.c +++ b/src/df/gfx/df_view_rules.c @@ -568,7 +568,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; @@ -730,7 +730,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; diff --git a/src/df/gfx/df_views.c b/src/df/gfx/df_views.c index c11212a3..61e79457 100644 --- a/src/df/gfx/df_views.c +++ b/src/df/gfx/df_views.c @@ -5765,7 +5765,7 @@ DF_VIEW_UI_FUNCTION_DEF(Code) DF_CtrlCtx ctrl_ctx = df_ctrl_ctx_from_view(ws, view); F_Tag code_font = df_font_from_slot(DF_FontSlot_Code); F32 code_font_size = df_font_size_from_slot(ws, DF_FontSlot_Code); - F32 code_tab_size = f_column_size_from_tag_size(code_font, code_font_size)*4.f; + F32 code_tab_size = f_column_size_from_tag_size(code_font, code_font_size)*df_setting_val_from_code(DF_SettingCode_TabWidth).s32; F_Metrics code_font_metrics = f_metrics_from_tag_size(code_font, code_font_size); F32 code_line_height = ceil_f32(f_line_height_from_metrics(&code_font_metrics) * 1.5f); F32 big_glyph_advance = f_dim_from_tag_size_string(code_font, code_font_size, 0, 0, str8_lit("H")).x; @@ -6837,7 +6837,7 @@ DF_VIEW_UI_FUNCTION_DEF(Disassembly) DF_CtrlCtx ctrl_ctx = df_ctrl_ctx_from_view(ws, view); F_Tag code_font = df_font_from_slot(DF_FontSlot_Code); F32 code_font_size = df_font_size_from_slot(ws, DF_FontSlot_Code); - F32 code_tab_size = f_column_size_from_tag_size(code_font, code_font_size)*4.f; + F32 code_tab_size = f_column_size_from_tag_size(code_font, code_font_size)*df_setting_val_from_code(DF_SettingCode_TabWidth).s32; F_Metrics code_font_metrics = f_metrics_from_tag_size(code_font, code_font_size); F32 code_line_height = ceil_f32(f_line_height_from_metrics(&code_font_metrics) * 1.5f); F32 big_glyph_advance = f_dim_from_tag_size_string(code_font, code_font_size, 0, 0, str8_lit("H")).x; @@ -7704,7 +7704,7 @@ DF_VIEW_UI_FUNCTION_DEF(Output) DF_CtrlCtx ctrl_ctx = df_ctrl_ctx_from_view(ws, view); F_Tag code_font = df_font_from_slot(DF_FontSlot_Code); F32 code_font_size = df_font_size_from_slot(ws, DF_FontSlot_Code); - F32 code_tab_size = f_column_size_from_tag_size(code_font, code_font_size)*4.f; + F32 code_tab_size = f_column_size_from_tag_size(code_font, code_font_size)*df_setting_val_from_code(DF_SettingCode_TabWidth).s32; F_Metrics code_font_metrics = f_metrics_from_tag_size(code_font, code_font_size); F32 code_line_height = ceil_f32(f_line_height_from_metrics(&code_font_metrics) * 1.5f); F32 big_glyph_advance = f_dim_from_tag_size_string(code_font, code_font_size, 0, 0, str8_lit("H")).x; diff --git a/src/df/gfx/generated/df_gfx.meta.c b/src/df/gfx/generated/df_gfx.meta.c index d79299c9..f9029467 100644 --- a/src/df/gfx/generated/df_gfx.meta.c +++ b/src/df/gfx/generated/df_gfx.meta.c @@ -1201,5 +1201,53 @@ str8_lit_comp("thread_error"), str8_lit_comp("breakpoint"), }; +String8 df_g_setting_code_display_string_table[8] = +{ +str8_lit_comp("Hover Animations"), +str8_lit_comp("Press Animations"), +str8_lit_comp("Focus Animations"), +str8_lit_comp("Tooltip Animations"), +str8_lit_comp("Menu Animations"), +str8_lit_comp("Scrolling Animations"), +str8_lit_comp("Background Blur"), +str8_lit_comp("Tab Width"), +}; + +String8 df_g_setting_code_lower_string_table[8] = +{ +str8_lit_comp("hover_animations"), +str8_lit_comp("press_animations"), +str8_lit_comp("focus_animations"), +str8_lit_comp("tooltip_animations"), +str8_lit_comp("menu_animations"), +str8_lit_comp("scrolling_animations"), +str8_lit_comp("background_blur"), +str8_lit_comp("tab_width"), +}; + +DF_SettingVal df_g_setting_code_default_val_table[8] = +{ +{1, 1}, +{1, 1}, +{1, 1}, +{1, 1}, +{1, 1}, +{1, 1}, +{1, 1}, +{1, 4}, +}; + +Rng1S32 df_g_setting_code_s32_range_table[8] = +{ +{0, 1}, +{0, 1}, +{0, 1}, +{0, 1}, +{0, 1}, +{0, 1}, +{0, 1}, +{0, 32}, +}; + C_LINKAGE_END diff --git a/src/df/gfx/generated/df_gfx.meta.h b/src/df/gfx/generated/df_gfx.meta.h index 42f19245..f84ec142 100644 --- a/src/df/gfx/generated/df_gfx.meta.h +++ b/src/df/gfx/generated/df_gfx.meta.h @@ -136,6 +136,19 @@ 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_TabWidth, +DF_SettingCode_COUNT, +} DF_SettingCode; + DF_VIEW_SETUP_FUNCTION_DEF(Null); DF_VIEW_SETUP_FUNCTION_DEF(Empty); DF_VIEW_SETUP_FUNCTION_DEF(GettingStarted); @@ -319,6 +332,10 @@ 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[8]; +extern String8 df_g_setting_code_lower_string_table[8]; +extern DF_SettingVal df_g_setting_code_default_val_table[8]; +extern Rng1S32 df_g_setting_code_s32_range_table[8]; 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, diff --git a/src/ui/ui_core.c b/src/ui/ui_core.c index aeaa4173..3256d05b 100644 --- a/src/ui/ui_core.c +++ b/src/ui/ui_core.c @@ -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, UI_WidgetPaletteInfo *widget_palette_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 { @@ -759,6 +759,7 @@ ui_begin_build(OS_Handle window, UI_EventList *events, UI_IconInfo *icon_info, U 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 @@ -1200,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) { @@ -1228,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; diff --git a/src/ui/ui_core.h b/src/ui/ui_core.h index 6048ebf7..f830adee 100644 --- a/src/ui/ui_core.h +++ b/src/ui/ui_core.h @@ -240,6 +240,27 @@ struct UI_WidgetPaletteInfo 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 @@ -575,6 +596,7 @@ 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; @@ -739,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, UI_WidgetPaletteInfo *widget_palette_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); From d12c5ec2e81d465bb3d0ed425d9892541380dc3b Mon Sep 17 00:00:00 2001 From: Ryan Fleury Date: Tue, 25 Jun 2024 11:09:02 -0700 Subject: [PATCH 25/47] first pass at mutable text layer, which allows debugger-produced/controlled buffers to be fed into text visualization systems; start pulling out code view into single path, which will be used for disassembly/source/output --- src/base/base_entry_point.c | 3 + src/df/core/df_core.c | 4 + src/df/core/df_core.mdesk | 3 - src/df/core/generated/df_core.meta.c | 15 +- src/df/core/generated/df_core.meta.h | 11 +- src/df/gfx/df_gfx.c | 27 +- src/df/gfx/df_gfx.h | 1 - src/df/gfx/df_gfx.mdesk | 3 +- src/df/gfx/df_views.c | 737 ++++++++++++++++++++++++++- src/df/gfx/df_views.h | 7 + src/df/gfx/generated/df_gfx.meta.c | 14 +- src/df/gfx/generated/df_gfx.meta.h | 9 +- src/mutable_text/mutable_text.c | 142 ++++++ src/mutable_text/mutable_text.h | 96 ++++ src/raddbg/raddbg_main.c | 2 + 15 files changed, 1022 insertions(+), 52 deletions(-) create mode 100644 src/mutable_text/mutable_text.c create mode 100644 src/mutable_text/mutable_text.h diff --git a/src/base/base_entry_point.c b/src/base/base_entry_point.c index 3c4b9926..7a0e5db6 100644 --- a/src/base/base_entry_point.c +++ b/src/base/base_entry_point.c @@ -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 diff --git a/src/df/core/df_core.c b/src/df/core/df_core.c index 48c05da7..2a75b09f 100644 --- a/src/df/core/df_core.c +++ b/src/df/core/df_core.c @@ -7129,6 +7129,9 @@ df_core_begin_frame(Arena *arena, DF_CmdList *cmds, F32 dt) case CTRL_EventKind_DebugString: { + //MTX_Op op = {r1u64(max_U64, max_U64), event->string}; + //mtx_push_op(u128_zero(), op); +#if 1 String8 string = event->string; DF_Entity *root = df_entity_root(); DF_Entity *thread = df_entity_from_ctrl_handle(event->machine_id, event->entity); @@ -7146,6 +7149,7 @@ df_core_begin_frame(Arena *arena, DF_CmdList *cmds, F32 dt) txti_append(thread_log_handle, string); txti_append(process_log_handle, string); txti_append(machine_log_handle, string); +#endif }break; case CTRL_EventKind_ThreadName: diff --git a/src/df/core/df_core.mdesk b/src/df/core/df_core.mdesk index ee4fd76d..331ac04c 100644 --- a/src/df/core/df_core.mdesk +++ b/src/df/core/df_core.mdesk @@ -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" } diff --git a/src/df/core/generated/df_core.meta.c b/src/df/core/generated/df_core.meta.c index b0c3d6ef..b8e5b2cc 100644 --- a/src/df/core/generated/df_core.meta.c +++ b/src/df/core/generated/df_core.meta.c @@ -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), diff --git a/src/df/core/generated/df_core.meta.h b/src/df/core/generated/df_core.meta.h index 9f857b6e..722ecbb4 100644 --- a/src/df/core/generated/df_core.meta.h +++ b/src/df/core/generated/df_core.meta.h @@ -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, @@ -1532,11 +1531,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]; diff --git a/src/df/gfx/df_gfx.c b/src/df/gfx/df_gfx.c index 392a6d17..e967dace 100644 --- a/src/df/gfx/df_gfx.c +++ b/src/df/gfx/df_gfx.c @@ -11737,21 +11737,6 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ SLLQueuePush(first_txt_rng_color_pair, last_txt_rng_color_pair, n); } - // rjf: push for flash ranges - for(DF_EntityNode *n = params->flash_ranges.first; n != 0; n = n->next) - { - DF_Entity *flash_range = n->entity; - if(flash_range->flags & DF_EntityFlag_HasTextPoint && - flash_range->flags & DF_EntityFlag_HasTextPointAlt) - { - TxtRngColorPairNode *pair = push_array(scratch.arena, TxtRngColorPairNode, 1); - pair->rng = txt_rng(flash_range->text_point, flash_range->text_point_alt); - pair->color = df_rgba_from_entity(flash_range); - pair->color.w *= ClampTop(flash_range->life_left, 1.f); - SLLQueuePush(first_txt_rng_color_pair, last_txt_rng_color_pair, pair); - } - } - // rjf: push for ctrlified mouse expr if(ctrlified && !txt_pt_match(result.mouse_expr_rng.max, result.mouse_expr_rng.min)) { @@ -14252,6 +14237,18 @@ df_gfx_begin_frame(Arena *arena, DF_CmdList *cmds) df_gfx_state->cfg_palettes[DF_PaletteCode_DropSiteOverlay].text = current->colors[DF_ThemeColor_DropSiteOverlay]; df_gfx_state->cfg_palettes[DF_PaletteCode_DropSiteOverlay].text_weak = current->colors[DF_ThemeColor_DropSiteOverlay]; df_gfx_state->cfg_palettes[DF_PaletteCode_DropSiteOverlay].border = current->colors[DF_ThemeColor_DropSiteOverlay]; + if(df_setting_val_from_code(DF_SettingCode_OpaqueBackgrounds).s32) + { + for(EachEnumVal(DF_PaletteCode, code)) + { + if(df_gfx_state->cfg_palettes[code].background.x != 0 || + df_gfx_state->cfg_palettes[code].background.y != 0 || + df_gfx_state->cfg_palettes[code].background.z != 0) + { + df_gfx_state->cfg_palettes[code].background.w = 1; + } + } + } } //- rjf: animate alive-transitions for entities diff --git a/src/df/gfx/df_gfx.h b/src/df/gfx/df_gfx.h index 8d059dd9..cb710dfc 100644 --- a/src/df/gfx/df_gfx.h +++ b/src/df/gfx/df_gfx.h @@ -458,7 +458,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; }; diff --git a/src/df/gfx/df_gfx.mdesk b/src/df/gfx/df_gfx.mdesk index 3f42d688..87a1e8a4 100644 --- a/src/df/gfx/df_gfx.mdesk +++ b/src/df/gfx/df_gfx.mdesk @@ -236,7 +236,7 @@ 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." } @@ -625,6 +625,7 @@ DF_SettingTable: {MenuAnimations menu_animations "Menu Animations" 1 0 1 } {ScrollingAnimations scrolling_animations "Scrolling Animations" 1 0 1 } {BackgroundBlur background_blur "Background Blur" 1 0 1 } + {OpaqueBackgrounds opaque_backgrounds "Opaque Backgrounds" 0 0 1 } {TabWidth tab_width "Tab Width" 4 0 32 } } diff --git a/src/df/gfx/df_views.c b/src/df/gfx/df_views.c index 61e79457..a3dde09e 100644 --- a/src/df/gfx/df_views.c +++ b/src/df/gfx/df_views.c @@ -369,6 +369,718 @@ df_entity_lister_item_array_sort_by_strength__in_place(DF_EntityListerItemArray quick_sort(array.v, array.count, sizeof(DF_EntityListerItem), df_qsort_compare_entity_lister__strength); } +//////////////////////////////// +//~ rjf: Code Views + +internal void +df_code_view_init(DF_CodeViewState *cv, DF_View *view) +{ + if(cv->initialized == 0) + { + cv->initialized = 1; + cv->cursor = cv->mark = txt_pt(1, 1); + cv->preferred_column = 1; + cv->find_text_arena = df_view_push_arena_ext(view); + } + df_view_equip_loading_info(view, 1, 0, 0); + view->loading_t = view->loading_t_target = 1.f; +} + +internal void +df_code_view_cmds(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewState *cv, DF_CmdList *cmds, U128 key, TXT_LangKind lang_kind) +{ + for(DF_CmdNode *n = cmds->first; n != 0; n = n->next) + { + DF_Cmd *cmd = &n->cmd; + + // rjf: mismatched window/panel => skip + if(df_window_from_handle(cmd->params.window) != ws || + df_panel_from_handle(cmd->params.panel) != panel) + { + continue; + } + + // rjf: process + DF_CoreCmdKind core_cmd_kind = df_core_cmd_kind_from_string(cmd->spec->info.string); + switch(core_cmd_kind) + { + default: break; + case DF_CoreCmdKind_GoToLine: + { + cv->goto_line_num = cmd->params.text_point.line; + }break; + case DF_CoreCmdKind_CenterCursor: + { + cv->center_cursor = 1; + }break; + case DF_CoreCmdKind_ContainCursor: + { + cv->contain_cursor = 1; + }break; + case DF_CoreCmdKind_FindTextForward: + { + arena_clear(cv->find_text_arena); + cv->find_text_fwd = push_str8_copy(cv->find_text_arena, cmd->params.string); + }break; + case DF_CoreCmdKind_FindTextBackward: + { + arena_clear(cv->find_text_arena); + cv->find_text_bwd = push_str8_copy(cv->find_text_arena, cmd->params.string); + }break; + case DF_CoreCmdKind_GoToNameAtCursor: + { + Temp scratch = scratch_begin(0, 0); + TXT_Scope *txt_scope = txt_scope_open(); + HS_Scope *hs_scope = hs_scope_open(); + { + // rjf: unpack entity info + U128 hash = {0}; + TXT_TextInfo text_info = txt_text_info_from_key_lang(txt_scope, key, lang_kind, &hash); + String8 data = hs_data_from_hash(hs_scope, hash); + + // rjf: determine expression range + Rng1U64 expr_range = {0}; + { + TxtRng selection_range = txt_rng(cv->cursor, cv->mark); + if(txt_pt_match(selection_range.min, selection_range.max)) + { + expr_range = txt_expr_off_range_from_info_data_pt(&text_info, data, cv->cursor); + } + else + { + expr_range = r1u64(txt_off_from_info_pt(&text_info, selection_range.min), txt_off_from_info_pt(&text_info, selection_range.max)); + } + } + + // rjf: expression range -> text + String8 expr_text = str8_substr(data, expr_range); + + // rjf: go to name + DF_CmdParams params = df_cmd_params_from_view(ws, panel, view); + params.string = expr_text; + df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_String); + df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_GoToName)); + } + hs_scope_close(hs_scope); + txt_scope_close(txt_scope); + scratch_end(scratch); + }break; + case DF_CoreCmdKind_ToggleWatchExpressionAtCursor: + { + Temp scratch = scratch_begin(0, 0); + TXT_Scope *txt_scope = txt_scope_open(); + HS_Scope *hs_scope = hs_scope_open(); + { + // rjf: unpack entity info + U128 hash = {0}; + TXT_TextInfo text_info = txt_text_info_from_key_lang(txt_scope, key, lang_kind, &hash); + String8 data = hs_data_from_hash(hs_scope, hash); + + // rjf: determine expression range + Rng1U64 expr_range = {0}; + { + TxtRng selection_range = txt_rng(cv->cursor, cv->mark); + if(txt_pt_match(selection_range.min, selection_range.max)) + { + expr_range = txt_expr_off_range_from_info_data_pt(&text_info, data, cv->cursor); + } + else + { + expr_range = r1u64(txt_off_from_info_pt(&text_info, selection_range.min), txt_off_from_info_pt(&text_info, selection_range.max)); + } + } + + // rjf: expression range -> text + String8 expr_text = str8_substr(data, expr_range); + + // rjf: toggle watch expr + DF_CmdParams params = df_cmd_params_from_view(ws, panel, view); + params.string = expr_text; + df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_String); + df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_ToggleWatchExpression)); + scratch_end(scratch); + } + hs_scope_close(hs_scope); + txt_scope_close(txt_scope); + scratch_end(scratch); + }break; + } + } +} + +internal void +df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewState *cv, Rng2F32 rect, U128 key, TXT_LangKind lang_kind) +{ + ProfBeginFunction(); + Temp scratch = scratch_begin(0, 0); + HS_Scope *hs_scope = hs_scope_open(); + DI_Scope *di_scope = di_scope_open(); + TXT_Scope *txt_scope = txt_scope_open(); + + ////////////////////////////// + //- rjf: extract invariants + // + DF_CtrlCtx ctrl_ctx = df_ctrl_ctx_from_view(ws, view); + F_Tag code_font = df_font_from_slot(DF_FontSlot_Code); + F32 code_font_size = df_font_size_from_slot(ws, DF_FontSlot_Code); + F32 code_tab_size = f_column_size_from_tag_size(code_font, code_font_size)*df_setting_val_from_code(DF_SettingCode_TabWidth).s32; + F_Metrics code_font_metrics = f_metrics_from_tag_size(code_font, code_font_size); + F32 code_line_height = ceil_f32(f_line_height_from_metrics(&code_font_metrics) * 1.5f); + F32 big_glyph_advance = f_dim_from_tag_size_string(code_font, code_font_size, 0, 0, str8_lit("H")).x; + Vec2F32 panel_box_dim = dim_2f32(rect); + Vec2F32 bottom_bar_dim = {panel_box_dim.x, ui_em(1.8f, 0).value}; + F32 scroll_bar_dim = floor_f32(ui_top_font_size()*1.5f); + Vec2F32 code_area_dim = v2f32(panel_box_dim.x - scroll_bar_dim, panel_box_dim.y - scroll_bar_dim - bottom_bar_dim.y); + S64 num_possible_visible_lines = (S64)(code_area_dim.y/code_line_height)+1; + + ////////////////////////////// + //- rjf: unpack ctrl ctx & make parse ctx + // + DF_Entity *thread = df_entity_from_handle(ctrl_ctx.thread); + U64 unwind_count = ctrl_ctx.unwind_count; + U64 rip_vaddr = df_query_cached_rip_from_thread_unwind(thread, unwind_count); + DF_Entity *process = df_entity_ancestor_from_kind(thread, DF_EntityKind_Process); + EVAL_ParseCtx parse_ctx = df_eval_parse_ctx_from_process_vaddr(di_scope, process, rip_vaddr); + + ////////////////////////////// + //- rjf: unpack text info + // + U128 hash = {0}; + TXT_TextInfo text_info = txt_text_info_from_key_lang(txt_scope, key, lang_kind, &hash); + String8 data = hs_data_from_hash(hs_scope, hash); + B32 text_info_is_ready = (text_info.lines_count != 0); + + ////////////////////////////// + //- rjf: buffer is pending -> equip view with loading information + // + if(!text_info_is_ready) + { + df_view_equip_loading_info(view, 1, text_info.bytes_processed, text_info.bytes_to_process); + } + + ////////////////////////////// + //- rjf: determine visible line range / count + // + Rng1S64 visible_line_num_range = r1s64(view->scroll_pos.y.idx + (S64)(view->scroll_pos.y.off) + 1 - !!(view->scroll_pos.y.off < 0), + view->scroll_pos.y.idx + (S64)(view->scroll_pos.y.off) + 1 + num_possible_visible_lines); + Rng1S64 target_visible_line_num_range = r1s64(view->scroll_pos.y.idx + 1, + view->scroll_pos.y.idx + 1 + num_possible_visible_lines); + U64 visible_line_count = 0; + { + visible_line_num_range.min = Clamp(1, visible_line_num_range.min, (S64)text_info.lines_count); + visible_line_num_range.max = Clamp(1, visible_line_num_range.max, (S64)text_info.lines_count); + visible_line_num_range.min = Max(1, visible_line_num_range.min); + visible_line_num_range.max = Max(1, visible_line_num_range.max); + target_visible_line_num_range.min = Clamp(1, target_visible_line_num_range.min, (S64)text_info.lines_count); + target_visible_line_num_range.max = Clamp(1, target_visible_line_num_range.max, (S64)text_info.lines_count); + target_visible_line_num_range.min = Max(1, target_visible_line_num_range.min); + target_visible_line_num_range.max = Max(1, target_visible_line_num_range.max); + visible_line_count = (U64)dim_1s64(visible_line_num_range)+1; + } + + ////////////////////////////// + //- rjf: calculate scroll bounds + // + S64 line_size_x = 0; + Rng1S64 scroll_idx_rng[Axis2_COUNT] = {0}; + { + line_size_x = (text_info.lines_max_size*big_glyph_advance*3)/2; + line_size_x = ClampBot(line_size_x, (S64)big_glyph_advance*120); + line_size_x = ClampBot(line_size_x, (S64)code_area_dim.x); + scroll_idx_rng[Axis2_X] = r1s64(0, line_size_x-(S64)code_area_dim.x); + scroll_idx_rng[Axis2_Y] = r1s64(0, (S64)text_info.lines_count-1); + } + + ////////////////////////////// + //- rjf: calculate line-range-dependent info + // + F32 priority_margin_width_px = big_glyph_advance*3.5f; + F32 catchall_margin_width_px = big_glyph_advance*3.5f; + F32 line_num_width_px = big_glyph_advance * (log10(visible_line_num_range.max) + 3); + TXT_LineTokensSlice slice = txt_line_tokens_slice_from_info_data_line_range(scratch.arena, &text_info, data, visible_line_num_range); + + ////////////////////////////// + //- rjf: get active search query + // + String8 search_query = {0}; + Side search_query_side = Side_Invalid; + B32 search_query_is_active = 0; + { + DF_CoreCmdKind query_cmd_kind = df_core_cmd_kind_from_string(ws->query_cmd_spec->info.string); + if(query_cmd_kind == DF_CoreCmdKind_FindTextForward || + query_cmd_kind == DF_CoreCmdKind_FindTextBackward) + { + search_query = str8(ws->query_view_stack_top->query_buffer, ws->query_view_stack_top->query_string_size); + search_query_is_active = 1; + search_query_side = (query_cmd_kind == DF_CoreCmdKind_FindTextForward) ? Side_Max : Side_Min; + } + } + + ////////////////////////////// + //- rjf: prepare code slice info bundle, for the viewable region of text + // + DF_CodeSliceParams code_slice_params = {0}; + if(text_info_is_ready) + { + // rjf: fill basics + code_slice_params.flags = DF_CodeSliceFlag_PriorityMargin|DF_CodeSliceFlag_CatchallMargin|DF_CodeSliceFlag_LineNums|DF_CodeSliceFlag_Clickable; + code_slice_params.line_num_range = visible_line_num_range; + code_slice_params.line_text = push_array(scratch.arena, String8, visible_line_count); + code_slice_params.line_ranges = push_array(scratch.arena, Rng1U64, visible_line_count); + code_slice_params.line_tokens = push_array(scratch.arena, TXT_TokenArray, visible_line_count); + code_slice_params.line_bps = push_array(scratch.arena, DF_EntityList, visible_line_count); + code_slice_params.line_ips = push_array(scratch.arena, DF_EntityList, visible_line_count); + code_slice_params.line_pins = push_array(scratch.arena, DF_EntityList, visible_line_count); + code_slice_params.line_dasm2src = push_array(scratch.arena, DF_TextLineDasm2SrcInfoList, visible_line_count); + code_slice_params.line_src2dasm = push_array(scratch.arena, DF_TextLineSrc2DasmInfoList, visible_line_count); + code_slice_params.font = code_font; + code_slice_params.font_size = code_font_size; + code_slice_params.tab_size = code_tab_size; + code_slice_params.line_height_px = code_line_height; + code_slice_params.search_query = search_query; + code_slice_params.priority_margin_width_px = priority_margin_width_px; + code_slice_params.catchall_margin_width_px = catchall_margin_width_px; + code_slice_params.line_num_width_px = line_num_width_px; + code_slice_params.line_text_max_width_px = (F32)line_size_x; + code_slice_params.margin_float_off_px = view->scroll_pos.x.idx + view->scroll_pos.x.off; + + // rjf: fill text info + { + S64 line_num = visible_line_num_range.min; + U64 line_idx = visible_line_num_range.min-1; + for(U64 visible_line_idx = 0; visible_line_idx < visible_line_count; visible_line_idx += 1, line_idx += 1, line_num += 1) + { + code_slice_params.line_text[visible_line_idx] = str8_substr(data, text_info.lines_ranges[line_idx]); + code_slice_params.line_ranges[visible_line_idx] = text_info.lines_ranges[line_idx]; + code_slice_params.line_tokens[visible_line_idx] = slice.line_tokens[visible_line_idx]; + } + } + } + + ////////////////////////////// + //- rjf: build container + // + UI_Box *container_box = &ui_g_nil_box; + if(text_info_is_ready) + { + ui_set_next_pref_width(ui_px(code_area_dim.x, 1)); + ui_set_next_pref_height(ui_px(code_area_dim.y, 1)); + ui_set_next_child_layout_axis(Axis2_Y); + container_box = ui_build_box_from_stringf(UI_BoxFlag_Clip| + UI_BoxFlag_Scroll| + UI_BoxFlag_AllowOverflowX| + UI_BoxFlag_AllowOverflowY, + "###code_area_%p", view); + } + + ////////////////////////////// + //- rjf: cancelled search query -> center cursor + // + if(!search_query_is_active && cv->drifted_for_search) + { + cv->drifted_for_search = 0; + cv->center_cursor = 1; + } + + ////////////////////////////// + //- rjf: do searching operations + // + if(text_info_is_ready) + { + //- rjf: find text (forward) + if(cv->find_text_fwd.size != 0) + { + Temp scratch = scratch_begin(0, 0); + B32 found = 0; + B32 first = 1; + S64 line_num_start = cv->cursor.line; + S64 line_num_last = (S64)text_info.lines_count; + for(S64 line_num = line_num_start;; first = 0) + { + // rjf: pop scratch + temp_end(scratch); + + // rjf: gather line info + String8 line_string = str8_substr(data, text_info.lines_ranges[line_num-1]); + U64 search_start = 0; + if(cv->cursor.line == line_num && first) + { + search_start = cv->cursor.column; + } + + // rjf: search string + U64 needle_pos = str8_find_needle(line_string, search_start, cv->find_text_fwd, StringMatchFlag_CaseInsensitive); + if(needle_pos < line_string.size) + { + cv->cursor.line = line_num; + cv->cursor.column = needle_pos+1; + cv->mark = cv->cursor; + found = 1; + break; + } + + // rjf: break if circled back around to cursor + else if(line_num == line_num_start && !first) + { + break; + } + + // rjf: increment + line_num += 1; + if(line_num > line_num_last) + { + line_num = 1; + } + } + cv->center_cursor = found; + if(found == 0) + { + DF_CmdParams params = df_cmd_params_from_view(ws, panel, view); + params.string = push_str8f(scratch.arena, "Could not find \"%S\"", cv->find_text_fwd); + df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_String); + df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_Error)); + } + scratch_end(scratch); + } + + //- rjf: find text (backward) + if(cv->find_text_bwd.size != 0) + { + Temp scratch = scratch_begin(0, 0); + B32 found = 0; + B32 first = 1; + S64 line_num_start = cv->cursor.line; + S64 line_num_last = (S64)text_info.lines_count; + for(S64 line_num = line_num_start;; first = 0) + { + // rjf: pop scratch + temp_end(scratch); + + // rjf: gather line info + String8 line_string = str8_substr(data, text_info.lines_ranges[line_num-1]); + if(cv->cursor.line == line_num && first) + { + line_string = str8_prefix(line_string, cv->cursor.column-1); + } + + // rjf: search string + U64 next_needle_pos = line_string.size; + for(U64 needle_pos = 0; needle_pos < line_string.size;) + { + needle_pos = str8_find_needle(line_string, needle_pos, cv->find_text_bwd, StringMatchFlag_CaseInsensitive); + if(needle_pos < line_string.size) + { + next_needle_pos = needle_pos; + needle_pos += 1; + } + } + if(next_needle_pos < line_string.size) + { + cv->cursor.line = line_num; + cv->cursor.column = next_needle_pos+1; + cv->mark = cv->cursor; + found = 1; + break; + } + + // rjf: break if circled back around to cursor line + else if(line_num == line_num_start && !first) + { + break; + } + + // rjf: increment + line_num -= 1; + if(line_num == 0) + { + line_num = line_num_last; + } + } + cv->center_cursor = found; + if(found == 0) + { + DF_CmdParams params = df_cmd_params_from_view(ws, panel, view); + params.string = push_str8f(scratch.arena, "Could not find \"%S\"", cv->find_text_bwd); + df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_String); + df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_Error)); + } + scratch_end(scratch); + } + + MemoryZeroStruct(&cv->find_text_fwd); + MemoryZeroStruct(&cv->find_text_bwd); + arena_clear(cv->find_text_arena); + } + + ////////////////////////////// + //- rjf: do goto line + // + if(text_info_is_ready) if(cv->goto_line_num != 0) + { + S64 line_num = cv->goto_line_num; + cv->goto_line_num = 0; + line_num = Clamp(1, line_num, text_info.lines_count); + cv->cursor = cv->mark = txt_pt(line_num, 1); + cv->center_cursor = !cv->contain_cursor || (line_num < target_visible_line_num_range.min+4 || target_visible_line_num_range.max-4 < line_num); + } + + ////////////////////////////// + //- rjf: do keyboard interaction + // + B32 snap[Axis2_COUNT] = {0}; + UI_Focus(UI_FocusKind_On) + { + if(ui_is_focus_active() && text_info_is_ready && visible_line_num_range.max >= visible_line_num_range.min) + { + snap[Axis2_X] = snap[Axis2_Y] = df_do_txt_controls(&text_info, data, ClampBot(num_possible_visible_lines, 10) - 10, &cv->cursor, &cv->mark, &cv->preferred_column); + } + } + + ////////////////////////////// + //- rjf: build container contents + // + if(text_info_is_ready) UI_Parent(container_box) + { + //- rjf: build fractional space + container_box->view_off.x = container_box->view_off_target.x = view->scroll_pos.x.idx + view->scroll_pos.x.off; + container_box->view_off.y = container_box->view_off_target.y = code_line_height*mod_f32(view->scroll_pos.y.off, 1.f) + code_line_height*(view->scroll_pos.y.off < 0) - code_line_height*(view->scroll_pos.y.off == -1.f && view->scroll_pos.y.idx == 1); + + //- rjf: build code slice + DF_CodeSliceSignal sig = {0}; + UI_Focus(UI_FocusKind_On) + { + sig = df_code_slicef(ws, &ctrl_ctx, &parse_ctx, &code_slice_params, &cv->cursor, &cv->mark, &cv->preferred_column, "txt_view_%p", view); + } + + //- rjf: press code slice? -> focus panel + if(ui_pressed(sig.base)) + { + DF_CmdParams p = df_cmd_params_from_panel(ws, panel); + df_push_cmd__root(&p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_FocusPanel)); + } + + //- rjf: dragging & outside region? -> contain cursor + if(ui_dragging(sig.base) && sig.base.event_flags == 0) + { + if(!contains_2f32(sig.base.box->rect, ui_mouse())) + { + cv->contain_cursor = 1; + } + else + { + snap[Axis2_X] = 1; + } + } + + //- rjf: ctrl+pressed? -> go to name + if(ui_pressed(sig.base) && sig.base.event_flags & OS_EventFlag_Ctrl) + { + ui_kill_action(); + DF_CmdParams params = df_cmd_params_from_view(ws, panel, view); + params.string = txt_string_from_info_data_txt_rng(&text_info, data, sig.mouse_expr_rng); + df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_String); + df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_GoToName)); + } + + //- rjf: copy text + if(!txt_pt_match(sig.copy_range.min, sig.copy_range.max)) + { + String8 text = txt_string_from_info_data_txt_rng(&text_info, data, sig.copy_range); + os_set_clipboard_text(text); + } + + //- rjf: selected text on single line, no query? -> set search text + if(!txt_pt_match(cv->cursor, cv->mark) && cv->cursor.line == cv->mark.line && search_query.size == 0) + { + String8 text = txt_string_from_info_data_txt_rng(&text_info, data, txt_rng(cv->cursor, cv->mark)); + df_set_search_string(text); + } + + //- rjf: toggle cursor watch + if(sig.toggle_cursor_watch) + { + DF_CmdParams params = df_cmd_params_from_view(ws, panel, view); + df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_ToggleWatchExpressionAtCursor)); + } + + //- rjf: set next statement + if(sig.set_next_statement_line_num != 0 && contains_1s64(visible_line_num_range, sig.set_next_statement_line_num)) + { + DF_CmdParams params = df_cmd_params_from_view(ws, panel, view); + params.text_point = txt_pt(sig.set_next_statement_line_num, 1); + df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_SetNextStatement)); + } + + //- rjf: go to disasm + if(sig.goto_disasm_line_num != 0 && contains_1s64(visible_line_num_range, sig.goto_disasm_line_num)) + { + U64 line_idx = (sig.goto_disasm_line_num-visible_line_num_range.min); + DF_TextLineSrc2DasmInfoList *src2dasm_list = &code_slice_params.line_src2dasm[line_idx]; + if(src2dasm_list->first != 0) + { + Rng1U64 voff_rng = src2dasm_list->first->v.voff_range; + DI_Key dbgi_key = src2dasm_list->first->v.dbgi_key; + DF_EntityList possible_modules = df_modules_from_dbgi_key(scratch.arena, &dbgi_key); + DF_Entity *thread = df_entity_from_handle(ctrl_ctx.thread); + DF_Entity *thread_dst_module = df_module_from_thread_candidates(thread, &possible_modules); + DF_Entity *process = df_entity_ancestor_from_kind(thread, DF_EntityKind_Process); + DF_Entity *module = thread_dst_module; + if(df_entity_is_nil(module)) + { + module = df_first_entity_from_list(&possible_modules); + } + U64 voff = voff_rng.min; + if(!df_entity_is_nil(module) && voff != 0) + { + DF_CmdParams params = df_cmd_params_from_window(ws); + params.entity = df_handle_from_entity(process); + params.vaddr = df_vaddr_from_voff(module, voff); + df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_Entity); + df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_VirtualAddr); + df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_FindCodeLocation)); + } + } + } + } + + ////////////////////////////// + //- rjf: apply post-build view snapping rules + // + if(text_info_is_ready) + { + // rjf: contain => snap + if(cv->contain_cursor) + { + cv->contain_cursor = 0; + snap[Axis2_X] = 1; + snap[Axis2_Y] = 1; + } + + // rjf: center cursor + if(cv->center_cursor) + { + cv->center_cursor = 0; + String8 cursor_line = str8_substr(data, text_info.lines_ranges[cv->cursor.line-1]); + F32 cursor_advance = f_dim_from_tag_size_string(code_font, code_font_size, 0, code_tab_size, str8_prefix(cursor_line, cv->cursor.column-1)).x; + + // rjf: scroll x + { + S64 new_idx = (S64)(cursor_advance - code_area_dim.x/2); + new_idx = Clamp(scroll_idx_rng[Axis2_X].min, new_idx, scroll_idx_rng[Axis2_X].max); + ui_scroll_pt_target_idx(&view->scroll_pos.x, new_idx); + snap[Axis2_X] = 0; + } + + // rjf: scroll y + { + S64 new_idx = (cv->cursor.line-1) - num_possible_visible_lines/2 + 2; + new_idx = Clamp(scroll_idx_rng[Axis2_Y].min, new_idx, scroll_idx_rng[Axis2_Y].max); + ui_scroll_pt_target_idx(&view->scroll_pos.y, new_idx); + snap[Axis2_Y] = 0; + } + } + + // rjf: snap in X + if(snap[Axis2_X]) + { + String8 cursor_line = str8_substr(data, text_info.lines_ranges[cv->cursor.line-1]); + S64 cursor_off = (S64)(f_dim_from_tag_size_string(code_font, code_font_size, 0, code_tab_size, str8_prefix(cursor_line, cv->cursor.column-1)).x + priority_margin_width_px + catchall_margin_width_px + line_num_width_px); + Rng1S64 visible_pixel_range = + { + view->scroll_pos.x.idx, + view->scroll_pos.x.idx + (S64)code_area_dim.x, + }; + Rng1S64 cursor_pixel_range = + { + cursor_off - (S64)(big_glyph_advance*4) - (S64)(priority_margin_width_px + catchall_margin_width_px + line_num_width_px), + cursor_off + (S64)(big_glyph_advance*4), + }; + S64 min_delta = Min(0, cursor_pixel_range.min - visible_pixel_range.min); + S64 max_delta = Max(0, cursor_pixel_range.max - visible_pixel_range.max); + S64 new_idx = view->scroll_pos.x.idx+min_delta+max_delta; + new_idx = Clamp(scroll_idx_rng[Axis2_X].min, new_idx, scroll_idx_rng[Axis2_X].max); + ui_scroll_pt_target_idx(&view->scroll_pos.x, new_idx); + } + + // rjf: snap in Y + if(snap[Axis2_Y]) + { + Rng1S64 cursor_visibility_range = r1s64(cv->cursor.line-4, cv->cursor.line+4); + cursor_visibility_range.min = ClampBot(0, cursor_visibility_range.min); + cursor_visibility_range.max = ClampBot(0, cursor_visibility_range.max); + S64 min_delta = Min(0, cursor_visibility_range.min-(target_visible_line_num_range.min)); + S64 max_delta = Max(0, cursor_visibility_range.max-(target_visible_line_num_range.min+num_possible_visible_lines)); + S64 new_idx = view->scroll_pos.y.idx+min_delta+max_delta; + new_idx = Clamp(0, new_idx, (S64)text_info.lines_count-1); + ui_scroll_pt_target_idx(&view->scroll_pos.y, new_idx); + } + } + + ////////////////////////////// + //- rjf: build horizontal scroll bar + // + if(text_info_is_ready) + { + ui_set_next_fixed_x(0); + ui_set_next_fixed_y(code_area_dim.y); + ui_set_next_fixed_width(panel_box_dim.x - scroll_bar_dim); + ui_set_next_fixed_height(scroll_bar_dim); + { + view->scroll_pos.x = ui_scroll_bar(Axis2_X, + ui_px(scroll_bar_dim, 1.f), + view->scroll_pos.x, + scroll_idx_rng[Axis2_X], + (S64)code_area_dim.x); + } + } + + ////////////////////////////// + //- rjf: build vertical scroll bar + // + if(text_info_is_ready) + { + ui_set_next_fixed_x(code_area_dim.x); + ui_set_next_fixed_y(0); + ui_set_next_fixed_width(scroll_bar_dim); + ui_set_next_fixed_height(panel_box_dim.y - bottom_bar_dim.y - scroll_bar_dim); + { + view->scroll_pos.y = ui_scroll_bar(Axis2_Y, + ui_px(scroll_bar_dim, 1.f), + view->scroll_pos.y, + scroll_idx_rng[Axis2_Y], + num_possible_visible_lines); + } + } + + ////////////////////////////// + //- rjf: top-level container interaction (scrolling) + // + if(text_info_is_ready) + { + UI_Signal sig = ui_signal_from_box(container_box); + if(sig.scroll.x != 0) + { + S64 new_idx = view->scroll_pos.x.idx+sig.scroll.x*big_glyph_advance; + new_idx = clamp_1s64(scroll_idx_rng[Axis2_X], new_idx); + ui_scroll_pt_target_idx(&view->scroll_pos.x, new_idx); + } + if(sig.scroll.y != 0) + { + S64 new_idx = view->scroll_pos.y.idx + sig.scroll.y; + new_idx = clamp_1s64(scroll_idx_rng[Axis2_Y], new_idx); + ui_scroll_pt_target_idx(&view->scroll_pos.y, new_idx); + } + ui_scroll_pt_clamp_idx(&view->scroll_pos.x, scroll_idx_rng[Axis2_X]); + ui_scroll_pt_clamp_idx(&view->scroll_pos.y, scroll_idx_rng[Axis2_Y]); + } + + txt_scope_close(txt_scope); + di_scope_close(di_scope); + hs_scope_close(hs_scope); + scratch_end(scratch); + ProfEnd(); +} + //////////////////////////////// //~ rjf: Watch Views @@ -5888,7 +6600,6 @@ DF_VIEW_UI_FUNCTION_DEF(Code) code_slice_params.catchall_margin_width_px = catchall_margin_width_px; code_slice_params.line_num_width_px = line_num_width_px; code_slice_params.line_text_max_width_px = (F32)line_size_x; - code_slice_params.flash_ranges = df_push_entity_child_list_with_kind(scratch.arena, entity, DF_EntityKind_FlashMarker); code_slice_params.margin_float_off_px = view->scroll_pos.x.idx + view->scroll_pos.x.off; // rjf: fill text info @@ -6224,9 +6935,16 @@ DF_VIEW_UI_FUNCTION_DEF(Code) } //- rjf: dragging & outside region? -> contain cursor - if(ui_dragging(sig.base) && !contains_2f32(sig.base.box->rect, ui_mouse()) && sig.base.event_flags == 0) + if(ui_dragging(sig.base) && sig.base.event_flags == 0) { - tv->contain_cursor = 1; + if(!contains_2f32(sig.base.box->rect, ui_mouse())) + { + tv->contain_cursor = 1; + } + else + { + snap[Axis2_X] = 1; + } } //- rjf: ctrl+pressed? -> go to name @@ -6983,7 +7701,6 @@ DF_VIEW_UI_FUNCTION_DEF(Disassembly) code_slice_params.catchall_margin_width_px = catchall_margin_width_px; code_slice_params.line_num_width_px = line_num_width_px; code_slice_params.line_text_max_width_px = (F32)line_size_x; - code_slice_params.flash_ranges = df_push_entity_child_list_with_kind(scratch.arena, process, DF_EntityKind_FlashMarker); code_slice_params.margin_float_off_px = view->scroll_pos.x.idx + view->scroll_pos.x.off; di_key_list_push(scratch.arena, &code_slice_params.relevant_dbgi_keys, &dbgi_key); @@ -7165,9 +7882,16 @@ DF_VIEW_UI_FUNCTION_DEF(Disassembly) } //- rjf: dragging & outside region? -> contain cursor - if(ui_dragging(sig.base) && !contains_2f32(sig.base.box->rect, ui_mouse()) && sig.base.event_flags == 0) + if(ui_dragging(sig.base) && sig.base.event_flags == 0) { - dv->contain_cursor = 1; + if(!contains_2f32(sig.base.box->rect, ui_mouse())) + { + dv->contain_cursor = 1; + } + else + { + snap[Axis2_X] = 1; + } } //- rjf: clicked margin? -> place breakpoint @@ -7823,7 +8547,6 @@ DF_VIEW_UI_FUNCTION_DEF(Output) code_slice_params.catchall_margin_width_px = 0.f; code_slice_params.line_num_width_px = line_num_width_px; code_slice_params.line_text_max_width_px = (F32)line_size_x; - code_slice_params.flash_ranges = df_push_entity_child_list_with_kind(scratch.arena, entity, DF_EntityKind_FlashMarker); code_slice_params.margin_float_off_px = view->scroll_pos.x.idx + view->scroll_pos.x.off; } diff --git a/src/df/gfx/df_views.h b/src/df/gfx/df_views.h index 80af1789..22c374ee 100644 --- a/src/df/gfx/df_views.h +++ b/src/df/gfx/df_views.h @@ -467,6 +467,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, U128 key, TXT_LangKind lang_kind); +internal void df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewState *cv, Rng2F32 rect, U128 key, TXT_LangKind lang_kind); + //////////////////////////////// //~ rjf: Watch Views diff --git a/src/df/gfx/generated/df_gfx.meta.c b/src/df/gfx/generated/df_gfx.meta.c index f9029467..07261700 100644 --- a/src/df/gfx/generated/df_gfx.meta.c +++ b/src/df/gfx/generated/df_gfx.meta.c @@ -159,7 +159,7 @@ DF_ViewSpecInfo df_g_gfx_view_kind_spec_info_table[31] = {(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_ProjectSpecific|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|1*DF_ViewSpecFlag_CanFilter|1*DF_ViewSpecFlag_FilterIsCode|1*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("types"), str8_lit_comp("Types"), DF_NameKind_Null, DF_IconKind_Binoculars, DF_VIEW_SETUP_FUNCTION_NAME(Types), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(Types), DF_VIEW_CMD_FUNCTION_NAME(Types), DF_VIEW_UI_FUNCTION_NAME(Types)}, {(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_ProjectSpecific|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|1*DF_ViewSpecFlag_CanFilter|1*DF_ViewSpecFlag_FilterIsCode|1*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("procedures"), str8_lit_comp("Procedures"), DF_NameKind_Null, DF_IconKind_Binoculars, DF_VIEW_SETUP_FUNCTION_NAME(Procedures), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(Procedures), DF_VIEW_CMD_FUNCTION_NAME(Procedures), DF_VIEW_UI_FUNCTION_NAME(Procedures)}, {(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_ProjectSpecific|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|0*DF_ViewSpecFlag_CanFilter|0*DF_ViewSpecFlag_FilterIsCode|0*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("output"), str8_lit_comp("Output"), DF_NameKind_Null, DF_IconKind_List, DF_VIEW_SETUP_FUNCTION_NAME(Output), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(Output), DF_VIEW_CMD_FUNCTION_NAME(Output), DF_VIEW_UI_FUNCTION_NAME(Output)}, -{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_ProjectSpecific|1*DF_ViewSpecFlag_CanSerialize|1*DF_ViewSpecFlag_CanSerializeEntityPath|0*DF_ViewSpecFlag_CanFilter|0*DF_ViewSpecFlag_FilterIsCode|0*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("memory"), str8_lit_comp("Memory"), DF_NameKind_Null, DF_IconKind_Grid, DF_VIEW_SETUP_FUNCTION_NAME(Memory), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(Memory), DF_VIEW_CMD_FUNCTION_NAME(Memory), DF_VIEW_UI_FUNCTION_NAME(Memory)}, +{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_ProjectSpecific|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|0*DF_ViewSpecFlag_CanFilter|0*DF_ViewSpecFlag_FilterIsCode|0*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("memory"), str8_lit_comp("Memory"), DF_NameKind_Null, DF_IconKind_Grid, DF_VIEW_SETUP_FUNCTION_NAME(Memory), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(Memory), DF_VIEW_CMD_FUNCTION_NAME(Memory), DF_VIEW_UI_FUNCTION_NAME(Memory)}, {(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_ProjectSpecific|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|1*DF_ViewSpecFlag_CanFilter|0*DF_ViewSpecFlag_FilterIsCode|1*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("breakpoints"), str8_lit_comp("Breakpoints"), DF_NameKind_Null, DF_IconKind_CircleFilled, DF_VIEW_SETUP_FUNCTION_NAME(Breakpoints), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(Breakpoints), DF_VIEW_CMD_FUNCTION_NAME(Breakpoints), DF_VIEW_UI_FUNCTION_NAME(Breakpoints)}, {(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_ProjectSpecific|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|1*DF_ViewSpecFlag_CanFilter|1*DF_ViewSpecFlag_FilterIsCode|1*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("watch_pins"), str8_lit_comp("Watch Pins"), DF_NameKind_Null, DF_IconKind_Pin, DF_VIEW_SETUP_FUNCTION_NAME(WatchPins), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(WatchPins), DF_VIEW_CMD_FUNCTION_NAME(WatchPins), DF_VIEW_UI_FUNCTION_NAME(WatchPins)}, {(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_ProjectSpecific|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|1*DF_ViewSpecFlag_CanFilter|0*DF_ViewSpecFlag_FilterIsCode|1*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("exception_filters"), str8_lit_comp("Exception Filters"), DF_NameKind_Null, DF_IconKind_Gear, DF_VIEW_SETUP_FUNCTION_NAME(ExceptionFilters), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(ExceptionFilters), DF_VIEW_CMD_FUNCTION_NAME(ExceptionFilters), DF_VIEW_UI_FUNCTION_NAME(ExceptionFilters)}, @@ -1201,7 +1201,7 @@ str8_lit_comp("thread_error"), str8_lit_comp("breakpoint"), }; -String8 df_g_setting_code_display_string_table[8] = +String8 df_g_setting_code_display_string_table[9] = { str8_lit_comp("Hover Animations"), str8_lit_comp("Press Animations"), @@ -1210,10 +1210,11 @@ str8_lit_comp("Tooltip Animations"), str8_lit_comp("Menu Animations"), str8_lit_comp("Scrolling Animations"), str8_lit_comp("Background Blur"), +str8_lit_comp("Opaque Backgrounds"), str8_lit_comp("Tab Width"), }; -String8 df_g_setting_code_lower_string_table[8] = +String8 df_g_setting_code_lower_string_table[9] = { str8_lit_comp("hover_animations"), str8_lit_comp("press_animations"), @@ -1222,10 +1223,11 @@ str8_lit_comp("tooltip_animations"), str8_lit_comp("menu_animations"), str8_lit_comp("scrolling_animations"), str8_lit_comp("background_blur"), +str8_lit_comp("opaque_backgrounds"), str8_lit_comp("tab_width"), }; -DF_SettingVal df_g_setting_code_default_val_table[8] = +DF_SettingVal df_g_setting_code_default_val_table[9] = { {1, 1}, {1, 1}, @@ -1234,10 +1236,11 @@ DF_SettingVal df_g_setting_code_default_val_table[8] = {1, 1}, {1, 1}, {1, 1}, +{1, 0}, {1, 4}, }; -Rng1S32 df_g_setting_code_s32_range_table[8] = +Rng1S32 df_g_setting_code_s32_range_table[9] = { {0, 1}, {0, 1}, @@ -1246,6 +1249,7 @@ Rng1S32 df_g_setting_code_s32_range_table[8] = {0, 1}, {0, 1}, {0, 1}, +{0, 1}, {0, 32}, }; diff --git a/src/df/gfx/generated/df_gfx.meta.h b/src/df/gfx/generated/df_gfx.meta.h index f84ec142..f0292711 100644 --- a/src/df/gfx/generated/df_gfx.meta.h +++ b/src/df/gfx/generated/df_gfx.meta.h @@ -145,6 +145,7 @@ DF_SettingCode_TooltipAnimations, DF_SettingCode_MenuAnimations, DF_SettingCode_ScrollingAnimations, DF_SettingCode_BackgroundBlur, +DF_SettingCode_OpaqueBackgrounds, DF_SettingCode_TabWidth, DF_SettingCode_COUNT, } DF_SettingCode; @@ -332,10 +333,10 @@ 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[8]; -extern String8 df_g_setting_code_lower_string_table[8]; -extern DF_SettingVal df_g_setting_code_default_val_table[8]; -extern Rng1S32 df_g_setting_code_s32_range_table[8]; +extern String8 df_g_setting_code_display_string_table[9]; +extern String8 df_g_setting_code_lower_string_table[9]; +extern DF_SettingVal df_g_setting_code_default_val_table[9]; +extern Rng1S32 df_g_setting_code_s32_range_table[9]; 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, diff --git a/src/mutable_text/mutable_text.c b/src/mutable_text/mutable_text.c new file mode 100644 index 00000000..92f2c0ed --- /dev/null +++ b/src/mutable_text/mutable_text.c @@ -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) + { + Arena *arena = arena_alloc(); + U64 new_data_size = data.size + op.replace.size - dim_1u64(op.range); + 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); + } +} diff --git a/src/mutable_text/mutable_text.h b/src/mutable_text/mutable_text.h new file mode 100644 index 00000000..716faa6d --- /dev/null +++ b/src/mutable_text/mutable_text.h @@ -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 diff --git a/src/raddbg/raddbg_main.c b/src/raddbg/raddbg_main.c index 024d0aa4..f68eb1b4 100644 --- a/src/raddbg/raddbg_main.c +++ b/src/raddbg/raddbg_main.c @@ -36,6 +36,7 @@ #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" @@ -76,6 +77,7 @@ #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" From 010d5609c68de7bbc328ad1689f79c554a3f80e2 Mon Sep 17 00:00:00 2001 From: Ryan Fleury Date: Tue, 25 Jun 2024 12:00:50 -0700 Subject: [PATCH 26/47] checkpoint in first pass at new unified code view impl.; start setting up unified top-level code ctx menu --- src/df/core/df_core.c | 7 +- src/df/core/df_core.h | 3 + src/df/gfx/df_gfx.c | 32 ++-- src/df/gfx/df_gfx.h | 6 + src/df/gfx/df_views.c | 288 +++++++++++++++++++++++++++--------- src/df/gfx/df_views.h | 4 +- src/hash_store/hash_store.c | 5 +- src/ui/ui_core.c | 10 ++ src/ui/ui_core.h | 1 + 9 files changed, 275 insertions(+), 81 deletions(-) diff --git a/src/df/core/df_core.c b/src/df/core/df_core.c index 2a75b09f..76191291 100644 --- a/src/df/core/df_core.c +++ b/src/df/core/df_core.c @@ -6643,6 +6643,7 @@ df_core_init(CmdLine *cmdln, DF_StateDeltaHistory *hist) df_state = push_array(arena, DF_State, 1); df_state->arena = arena; df_state->root_cmd_arena = arena_alloc(); + df_state->output_log_key = hs_hash_from_data(str8_lit("df_output_log_key")); df_state->entities_arena = arena_alloc__sized(GB(64), KB(64)); df_state->entities_root = &df_g_nil_entity; df_state->entities_base = push_array(df_state->entities_arena, DF_Entity, 0); @@ -7129,9 +7130,9 @@ df_core_begin_frame(Arena *arena, DF_CmdList *cmds, F32 dt) case CTRL_EventKind_DebugString: { - //MTX_Op op = {r1u64(max_U64, max_U64), event->string}; - //mtx_push_op(u128_zero(), op); -#if 1 + MTX_Op op = {r1u64(max_U64, max_U64), event->string}; + mtx_push_op(df_state->output_log_key, op); +#if 0 String8 string = event->string; DF_Entity *root = df_entity_root(); DF_Entity *thread = df_entity_from_ctrl_handle(event->machine_id, event->entity); diff --git a/src/df/core/df_core.h b/src/df/core/df_core.h index bf34f047..9b09e319 100644 --- a/src/df/core/df_core.h +++ b/src/df/core/df_core.h @@ -1171,6 +1171,9 @@ struct DF_State Arena *root_cmd_arena; DF_CmdList root_cmds; + // rjf: output log key + U128 output_log_key; + // rjf: history cache DF_StateDeltaHistory *hist; diff --git a/src/df/gfx/df_gfx.c b/src/df/gfx/df_gfx.c index e967dace..ba9d31f3 100644 --- a/src/df/gfx/df_gfx.c +++ b/src/df/gfx/df_gfx.c @@ -1026,6 +1026,7 @@ df_window_open(Vec2F32 size, OS_Handle preferred_monitor, DF_CfgSrc cfg_src) window->r = r_window_equip(window->os); window->ui = ui_state_alloc(); window->view_state_hist = df_state_delta_history_alloc(); + window->code_ctx_menu_key = ui_key_from_string(ui_key_zero(), str8_lit("_code_ctx_menu_")); window->entity_ctx_menu_key = ui_key_from_string(ui_key_zero(), str8_lit("_entity_ctx_menu_")); window->tab_ctx_menu_key = ui_key_from_string(ui_key_zero(), str8_lit("_tab_ctx_menu_")); window->hover_eval_arena = arena_alloc(); @@ -3688,6 +3689,16 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) } } + //- rjf: code ctx menu + UI_CtxMenu(ws->code_ctx_menu_key) + UI_PrefWidth(ui_em(30.f, 1.f)) + DF_Palette(DF_PaletteCode_ImplicitButton) + { + ui_buttonf("Foo"); + ui_buttonf("Bar"); + ui_buttonf("Baz"); + } + //- rjf: entity menu UI_CtxMenu(ws->entity_ctx_menu_key) UI_PrefWidth(ui_em(30.f, 1.f)) @@ -7468,16 +7479,19 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) DF_View *list_first = list_firsts[idx]; for(DF_View *view = list_first; !df_view_is_nil(view); view = view->next) { - if(abs_f32(view->loading_t_target - view->loading_t) > 0.01f || - abs_f32(view->scroll_pos.x.off) > 0.01f || - abs_f32(view->scroll_pos.y.off) > 0.01f || - abs_f32(view->is_filtering_t - (F32)!!view->is_filtering)) + if(window_is_focused) { - df_gfx_request_frame(); - } - if(view->loading_t_target != 0 && view == df_selected_tab_from_panel(panel)) - { - df_gfx_request_frame(); + if(abs_f32(view->loading_t_target - view->loading_t) > 0.01f || + abs_f32(view->scroll_pos.x.off) > 0.01f || + abs_f32(view->scroll_pos.y.off) > 0.01f || + abs_f32(view->is_filtering_t - (F32)!!view->is_filtering)) + { + df_gfx_request_frame(); + } + if(view->loading_t_target != 0 && view == df_selected_tab_from_panel(panel)) + { + df_gfx_request_frame(); + } } view->loading_t += (view->loading_t_target - view->loading_t) * rate; view->is_filtering_t += ((F32)!!view->is_filtering - view->is_filtering_t) * fast_rate; diff --git a/src/df/gfx/df_gfx.h b/src/df/gfx/df_gfx.h index cb710dfc..337fe601 100644 --- a/src/df/gfx/df_gfx.h +++ b/src/df/gfx/df_gfx.h @@ -569,6 +569,12 @@ struct DF_Window B32 menu_bar_key_held; B32 menu_bar_focus_press_started; + // rjf: code context menu state + UI_Key code_ctx_menu_key; + DF_Handle code_ctx_menu_entity; + U128 code_ctx_menu_text_key; + TxtRng code_ctx_menu_range; + // rjf: entity context menu state UI_Key entity_ctx_menu_key; DF_Handle entity_ctx_menu_entity; diff --git a/src/df/gfx/df_views.c b/src/df/gfx/df_views.c index a3dde09e..52b35955 100644 --- a/src/df/gfx/df_views.c +++ b/src/df/gfx/df_views.c @@ -387,7 +387,7 @@ 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, U128 key, TXT_LangKind lang_kind) +df_code_view_cmds(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewState *cv, DF_CmdList *cmds, String8 data, TXT_TextInfo *info) { for(DF_CmdNode *n = cmds->first; n != 0; n = n->next) { @@ -433,22 +433,17 @@ df_code_view_cmds(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewStat TXT_Scope *txt_scope = txt_scope_open(); HS_Scope *hs_scope = hs_scope_open(); { - // rjf: unpack entity info - U128 hash = {0}; - TXT_TextInfo text_info = txt_text_info_from_key_lang(txt_scope, key, lang_kind, &hash); - String8 data = hs_data_from_hash(hs_scope, hash); - // rjf: determine expression range Rng1U64 expr_range = {0}; { TxtRng selection_range = txt_rng(cv->cursor, cv->mark); if(txt_pt_match(selection_range.min, selection_range.max)) { - expr_range = txt_expr_off_range_from_info_data_pt(&text_info, data, cv->cursor); + expr_range = txt_expr_off_range_from_info_data_pt(info, data, cv->cursor); } else { - expr_range = r1u64(txt_off_from_info_pt(&text_info, selection_range.min), txt_off_from_info_pt(&text_info, selection_range.max)); + expr_range = r1u64(txt_off_from_info_pt(info, selection_range.min), txt_off_from_info_pt(info, selection_range.max)); } } @@ -471,22 +466,17 @@ df_code_view_cmds(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewStat TXT_Scope *txt_scope = txt_scope_open(); HS_Scope *hs_scope = hs_scope_open(); { - // rjf: unpack entity info - U128 hash = {0}; - TXT_TextInfo text_info = txt_text_info_from_key_lang(txt_scope, key, lang_kind, &hash); - String8 data = hs_data_from_hash(hs_scope, hash); - // rjf: determine expression range Rng1U64 expr_range = {0}; { TxtRng selection_range = txt_rng(cv->cursor, cv->mark); if(txt_pt_match(selection_range.min, selection_range.max)) { - expr_range = txt_expr_off_range_from_info_data_pt(&text_info, data, cv->cursor); + expr_range = txt_expr_off_range_from_info_data_pt(info, data, cv->cursor); } else { - expr_range = r1u64(txt_off_from_info_pt(&text_info, selection_range.min), txt_off_from_info_pt(&text_info, selection_range.max)); + expr_range = r1u64(txt_off_from_info_pt(info, selection_range.min), txt_off_from_info_pt(info, selection_range.max)); } } @@ -509,7 +499,7 @@ df_code_view_cmds(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewStat } internal void -df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewState *cv, Rng2F32 rect, U128 key, TXT_LangKind lang_kind) +df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewState *cv, Rng2F32 rect, String8 data, TXT_TextInfo *info) { ProfBeginFunction(); Temp scratch = scratch_begin(0, 0); @@ -528,9 +518,8 @@ df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewSta F32 code_line_height = ceil_f32(f_line_height_from_metrics(&code_font_metrics) * 1.5f); F32 big_glyph_advance = f_dim_from_tag_size_string(code_font, code_font_size, 0, 0, str8_lit("H")).x; Vec2F32 panel_box_dim = dim_2f32(rect); - Vec2F32 bottom_bar_dim = {panel_box_dim.x, ui_em(1.8f, 0).value}; F32 scroll_bar_dim = floor_f32(ui_top_font_size()*1.5f); - Vec2F32 code_area_dim = v2f32(panel_box_dim.x - scroll_bar_dim, panel_box_dim.y - scroll_bar_dim - bottom_bar_dim.y); + Vec2F32 code_area_dim = v2f32(panel_box_dim.x - scroll_bar_dim, panel_box_dim.y - scroll_bar_dim); S64 num_possible_visible_lines = (S64)(code_area_dim.y/code_line_height)+1; ////////////////////////////// @@ -542,22 +531,6 @@ df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewSta DF_Entity *process = df_entity_ancestor_from_kind(thread, DF_EntityKind_Process); EVAL_ParseCtx parse_ctx = df_eval_parse_ctx_from_process_vaddr(di_scope, process, rip_vaddr); - ////////////////////////////// - //- rjf: unpack text info - // - U128 hash = {0}; - TXT_TextInfo text_info = txt_text_info_from_key_lang(txt_scope, key, lang_kind, &hash); - String8 data = hs_data_from_hash(hs_scope, hash); - B32 text_info_is_ready = (text_info.lines_count != 0); - - ////////////////////////////// - //- rjf: buffer is pending -> equip view with loading information - // - if(!text_info_is_ready) - { - df_view_equip_loading_info(view, 1, text_info.bytes_processed, text_info.bytes_to_process); - } - ////////////////////////////// //- rjf: determine visible line range / count // @@ -567,12 +540,12 @@ df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewSta view->scroll_pos.y.idx + 1 + num_possible_visible_lines); U64 visible_line_count = 0; { - visible_line_num_range.min = Clamp(1, visible_line_num_range.min, (S64)text_info.lines_count); - visible_line_num_range.max = Clamp(1, visible_line_num_range.max, (S64)text_info.lines_count); + visible_line_num_range.min = Clamp(1, visible_line_num_range.min, (S64)info->lines_count); + visible_line_num_range.max = Clamp(1, visible_line_num_range.max, (S64)info->lines_count); visible_line_num_range.min = Max(1, visible_line_num_range.min); visible_line_num_range.max = Max(1, visible_line_num_range.max); - target_visible_line_num_range.min = Clamp(1, target_visible_line_num_range.min, (S64)text_info.lines_count); - target_visible_line_num_range.max = Clamp(1, target_visible_line_num_range.max, (S64)text_info.lines_count); + target_visible_line_num_range.min = Clamp(1, target_visible_line_num_range.min, (S64)info->lines_count); + target_visible_line_num_range.max = Clamp(1, target_visible_line_num_range.max, (S64)info->lines_count); target_visible_line_num_range.min = Max(1, target_visible_line_num_range.min); target_visible_line_num_range.max = Max(1, target_visible_line_num_range.max); visible_line_count = (U64)dim_1s64(visible_line_num_range)+1; @@ -584,11 +557,11 @@ df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewSta S64 line_size_x = 0; Rng1S64 scroll_idx_rng[Axis2_COUNT] = {0}; { - line_size_x = (text_info.lines_max_size*big_glyph_advance*3)/2; + line_size_x = (info->lines_max_size*big_glyph_advance*3)/2; line_size_x = ClampBot(line_size_x, (S64)big_glyph_advance*120); line_size_x = ClampBot(line_size_x, (S64)code_area_dim.x); scroll_idx_rng[Axis2_X] = r1s64(0, line_size_x-(S64)code_area_dim.x); - scroll_idx_rng[Axis2_Y] = r1s64(0, (S64)text_info.lines_count-1); + scroll_idx_rng[Axis2_Y] = r1s64(0, (S64)info->lines_count-1); } ////////////////////////////// @@ -597,7 +570,7 @@ df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewSta F32 priority_margin_width_px = big_glyph_advance*3.5f; F32 catchall_margin_width_px = big_glyph_advance*3.5f; F32 line_num_width_px = big_glyph_advance * (log10(visible_line_num_range.max) + 3); - TXT_LineTokensSlice slice = txt_line_tokens_slice_from_info_data_line_range(scratch.arena, &text_info, data, visible_line_num_range); + TXT_LineTokensSlice slice = txt_line_tokens_slice_from_info_data_line_range(scratch.arena, info, data, visible_line_num_range); ////////////////////////////// //- rjf: get active search query @@ -620,7 +593,6 @@ df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewSta //- rjf: prepare code slice info bundle, for the viewable region of text // DF_CodeSliceParams code_slice_params = {0}; - if(text_info_is_ready) { // rjf: fill basics code_slice_params.flags = DF_CodeSliceFlag_PriorityMargin|DF_CodeSliceFlag_CatchallMargin|DF_CodeSliceFlag_LineNums|DF_CodeSliceFlag_Clickable; @@ -650,8 +622,8 @@ df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewSta U64 line_idx = visible_line_num_range.min-1; for(U64 visible_line_idx = 0; visible_line_idx < visible_line_count; visible_line_idx += 1, line_idx += 1, line_num += 1) { - code_slice_params.line_text[visible_line_idx] = str8_substr(data, text_info.lines_ranges[line_idx]); - code_slice_params.line_ranges[visible_line_idx] = text_info.lines_ranges[line_idx]; + code_slice_params.line_text[visible_line_idx] = str8_substr(data, info->lines_ranges[line_idx]); + code_slice_params.line_ranges[visible_line_idx] = info->lines_ranges[line_idx]; code_slice_params.line_tokens[visible_line_idx] = slice.line_tokens[visible_line_idx]; } } @@ -661,7 +633,6 @@ df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewSta //- rjf: build container // UI_Box *container_box = &ui_g_nil_box; - if(text_info_is_ready) { ui_set_next_pref_width(ui_px(code_area_dim.x, 1)); ui_set_next_pref_height(ui_px(code_area_dim.y, 1)); @@ -685,7 +656,6 @@ df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewSta ////////////////////////////// //- rjf: do searching operations // - if(text_info_is_ready) { //- rjf: find text (forward) if(cv->find_text_fwd.size != 0) @@ -694,14 +664,14 @@ df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewSta B32 found = 0; B32 first = 1; S64 line_num_start = cv->cursor.line; - S64 line_num_last = (S64)text_info.lines_count; + S64 line_num_last = (S64)info->lines_count; for(S64 line_num = line_num_start;; first = 0) { // rjf: pop scratch temp_end(scratch); // rjf: gather line info - String8 line_string = str8_substr(data, text_info.lines_ranges[line_num-1]); + String8 line_string = str8_substr(data, info->lines_ranges[line_num-1]); U64 search_start = 0; if(cv->cursor.line == line_num && first) { @@ -750,14 +720,14 @@ df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewSta B32 found = 0; B32 first = 1; S64 line_num_start = cv->cursor.line; - S64 line_num_last = (S64)text_info.lines_count; + S64 line_num_last = (S64)info->lines_count; for(S64 line_num = line_num_start;; first = 0) { // rjf: pop scratch temp_end(scratch); // rjf: gather line info - String8 line_string = str8_substr(data, text_info.lines_ranges[line_num-1]); + String8 line_string = str8_substr(data, info->lines_ranges[line_num-1]); if(cv->cursor.line == line_num && first) { line_string = str8_prefix(line_string, cv->cursor.column-1); @@ -815,11 +785,11 @@ df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewSta ////////////////////////////// //- rjf: do goto line // - if(text_info_is_ready) if(cv->goto_line_num != 0) + if(cv->goto_line_num != 0) { S64 line_num = cv->goto_line_num; cv->goto_line_num = 0; - line_num = Clamp(1, line_num, text_info.lines_count); + line_num = Clamp(1, line_num, info->lines_count); cv->cursor = cv->mark = txt_pt(line_num, 1); cv->center_cursor = !cv->contain_cursor || (line_num < target_visible_line_num_range.min+4 || target_visible_line_num_range.max-4 < line_num); } @@ -830,16 +800,16 @@ df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewSta B32 snap[Axis2_COUNT] = {0}; UI_Focus(UI_FocusKind_On) { - if(ui_is_focus_active() && text_info_is_ready && visible_line_num_range.max >= visible_line_num_range.min) + if(ui_is_focus_active() && visible_line_num_range.max >= visible_line_num_range.min) { - snap[Axis2_X] = snap[Axis2_Y] = df_do_txt_controls(&text_info, data, ClampBot(num_possible_visible_lines, 10) - 10, &cv->cursor, &cv->mark, &cv->preferred_column); + snap[Axis2_X] = snap[Axis2_Y] = df_do_txt_controls(info, data, ClampBot(num_possible_visible_lines, 10) - 10, &cv->cursor, &cv->mark, &cv->preferred_column); } } ////////////////////////////// //- rjf: build container contents // - if(text_info_is_ready) UI_Parent(container_box) + UI_Parent(container_box) { //- rjf: build fractional space container_box->view_off.x = container_box->view_off_target.x = view->scroll_pos.x.idx + view->scroll_pos.x.off; @@ -877,7 +847,7 @@ df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewSta { ui_kill_action(); DF_CmdParams params = df_cmd_params_from_view(ws, panel, view); - params.string = txt_string_from_info_data_txt_rng(&text_info, data, sig.mouse_expr_rng); + params.string = txt_string_from_info_data_txt_rng(info, data, sig.mouse_expr_rng); df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_String); df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_GoToName)); } @@ -885,14 +855,14 @@ df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewSta //- rjf: copy text if(!txt_pt_match(sig.copy_range.min, sig.copy_range.max)) { - String8 text = txt_string_from_info_data_txt_rng(&text_info, data, sig.copy_range); + String8 text = txt_string_from_info_data_txt_rng(info, data, sig.copy_range); os_set_clipboard_text(text); } //- rjf: selected text on single line, no query? -> set search text if(!txt_pt_match(cv->cursor, cv->mark) && cv->cursor.line == cv->mark.line && search_query.size == 0) { - String8 text = txt_string_from_info_data_txt_rng(&text_info, data, txt_rng(cv->cursor, cv->mark)); + String8 text = txt_string_from_info_data_txt_rng(info, data, txt_rng(cv->cursor, cv->mark)); df_set_search_string(text); } @@ -946,7 +916,6 @@ df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewSta ////////////////////////////// //- rjf: apply post-build view snapping rules // - if(text_info_is_ready) { // rjf: contain => snap if(cv->contain_cursor) @@ -960,7 +929,7 @@ df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewSta if(cv->center_cursor) { cv->center_cursor = 0; - String8 cursor_line = str8_substr(data, text_info.lines_ranges[cv->cursor.line-1]); + String8 cursor_line = str8_substr(data, info->lines_ranges[cv->cursor.line-1]); F32 cursor_advance = f_dim_from_tag_size_string(code_font, code_font_size, 0, code_tab_size, str8_prefix(cursor_line, cv->cursor.column-1)).x; // rjf: scroll x @@ -983,7 +952,7 @@ df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewSta // rjf: snap in X if(snap[Axis2_X]) { - String8 cursor_line = str8_substr(data, text_info.lines_ranges[cv->cursor.line-1]); + String8 cursor_line = str8_substr(data, info->lines_ranges[cv->cursor.line-1]); S64 cursor_off = (S64)(f_dim_from_tag_size_string(code_font, code_font_size, 0, code_tab_size, str8_prefix(cursor_line, cv->cursor.column-1)).x + priority_margin_width_px + catchall_margin_width_px + line_num_width_px); Rng1S64 visible_pixel_range = { @@ -1011,7 +980,7 @@ df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewSta S64 min_delta = Min(0, cursor_visibility_range.min-(target_visible_line_num_range.min)); S64 max_delta = Max(0, cursor_visibility_range.max-(target_visible_line_num_range.min+num_possible_visible_lines)); S64 new_idx = view->scroll_pos.y.idx+min_delta+max_delta; - new_idx = Clamp(0, new_idx, (S64)text_info.lines_count-1); + new_idx = Clamp(0, new_idx, (S64)info->lines_count-1); ui_scroll_pt_target_idx(&view->scroll_pos.y, new_idx); } } @@ -1019,7 +988,6 @@ df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewSta ////////////////////////////// //- rjf: build horizontal scroll bar // - if(text_info_is_ready) { ui_set_next_fixed_x(0); ui_set_next_fixed_y(code_area_dim.y); @@ -1037,12 +1005,11 @@ df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewSta ////////////////////////////// //- rjf: build vertical scroll bar // - if(text_info_is_ready) { ui_set_next_fixed_x(code_area_dim.x); ui_set_next_fixed_y(0); ui_set_next_fixed_width(scroll_bar_dim); - ui_set_next_fixed_height(panel_box_dim.y - bottom_bar_dim.y - scroll_bar_dim); + ui_set_next_fixed_height(panel_box_dim.y - scroll_bar_dim); { view->scroll_pos.y = ui_scroll_bar(Axis2_Y, ui_px(scroll_bar_dim, 1.f), @@ -1055,7 +1022,6 @@ df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewSta ////////////////////////////// //- rjf: top-level container interaction (scrolling) // - if(text_info_is_ready) { UI_Signal sig = ui_signal_from_box(container_box); if(sig.scroll.x != 0) @@ -6225,6 +6191,195 @@ DF_VIEW_UI_FUNCTION_DEF(PendingEntity) //////////////////////////////// //~ rjf: Code @view_hook_impl +#if 0 +DF_VIEW_SETUP_FUNCTION_DEF(Code) +{ + // rjf: set up state + DF_CodeViewState *cv = df_view_user_state(view, DF_CodeViewState); + df_code_view_init(cv, view); + + // rjf: deserialize cursor + DF_CfgNode *cursor_cfg = df_cfg_node_child_from_string(cfg_root, str8_lit("cursor"), StringMatchFlag_CaseInsensitive); + if(cursor_cfg != &df_g_nil_cfg_node) + { + TxtPt cursor = txt_pt(1, 1); + cursor.line = s64_from_str8(cursor_cfg->first->string, 10); + cursor.column = s64_from_str8(cursor_cfg->first->first->string, 10); + if(cursor.line == 0) { cursor.line = 1; } + if(cursor.column == 0) { cursor.column = 1; } + cv->cursor = cv->mark = cursor; + cv->center_cursor = 1; + } + + // rjf: default to loading + df_view_equip_loading_info(view, 1, 0, 0); + view->loading_t = view->loading_t_target = 1.f; +} + +DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(Code) +{ + DF_CodeViewState *tvs = df_view_user_state(view, DF_CodeViewState); + String8 string = push_str8f(arena, " cursor:%I64d:%I64d", tvs->cursor.line, tvs->cursor.column); + return string; +} + +DF_VIEW_CMD_FUNCTION_DEF(Code) +{ + DF_CodeViewState *cv = df_view_user_state(view, DF_CodeViewState); + Temp scratch = scratch_begin(0, 0); + HS_Scope *hs_scope = hs_scope_open(); + TXT_Scope *txt_scope = txt_scope_open(); + String8 path = df_full_path_from_entity(scratch.arena, df_entity_from_handle(view->entity)); + TXT_LangKind lang_kind = txt_lang_kind_from_extension(str8_skip_last_dot(path)); + U128 key = fs_key_from_path(path); + U128 hash = {0}; + TXT_TextInfo info = txt_text_info_from_key_lang(txt_scope, key, lang_kind, &hash); + String8 data = hs_data_from_hash(hs_scope, hash); + df_code_view_cmds(ws, panel, view, cv, cmds, data, &info); + txt_scope_close(txt_scope); + hs_scope_close(hs_scope); + scratch_end(scratch); +} + +DF_VIEW_UI_FUNCTION_DEF(Code) +{ + DF_CodeViewState *cv = df_view_user_state(view, DF_CodeViewState); + Temp scratch = scratch_begin(0, 0); + HS_Scope *hs_scope = hs_scope_open(); + TXT_Scope *txt_scope = txt_scope_open(); + + ////////////////////////////// + //- rjf: set up invariants + // + F32 bottom_bar_height = ui_top_font_size()*2.f; + Rng2F32 code_area_rect = r2f32p(rect.x0, rect.y0, rect.x1, rect.y1 - bottom_bar_height); + Rng2F32 bottom_bar_rect = r2f32p(rect.x0, rect.y1 - bottom_bar_height, rect.x1, rect.y1); + + ////////////////////////////// + //- rjf: unpack entity info + // + DF_Entity *entity = df_entity_from_handle(view->entity); + String8 path = df_full_path_from_entity(scratch.arena, entity); + TXT_LangKind lang_kind = txt_lang_kind_from_extension(str8_skip_last_dot(path)); + U128 key = fs_key_from_path(path); + U128 hash = {0}; + TXT_TextInfo info = txt_text_info_from_key_lang(txt_scope, key, lang_kind, &hash); + String8 data = hs_data_from_hash(hs_scope, hash); + B32 entity_is_missing = !!(entity->flags & DF_EntityFlag_IsMissing); + B32 key_has_data = !u128_match(hash, u128_zero()) && info.lines_count; + B32 file_is_out_of_date = 0; + String8 out_of_date_dbgi_name = {0}; + + ////////////////////////////// + //- rjf: build missing file interface + // + if(entity_is_missing && !key_has_data) + { + UI_WidthFill UI_HeightFill UI_Column UI_Padding(ui_pct(1, 0)) + { + Temp scratch = scratch_begin(0, 0); + String8 full_path = df_full_path_from_entity(scratch.arena, entity); + UI_PrefWidth(ui_children_sum(1)) UI_PrefHeight(ui_em(3, 1)) + UI_Row UI_Padding(ui_pct(1, 0)) + UI_PrefWidth(ui_text_dim(10, 1)) + UI_Palette(ui_build_palette(ui_top_palette(), .text = df_rgba_from_theme_color(DF_ThemeColor_TextNegative))) + { + UI_Font(df_font_from_slot(DF_FontSlot_Icons)) + UI_RunFlags(F_RunFlag_Smooth) + ui_label(df_g_icon_kind_text_table[DF_IconKind_WarningBig]); + ui_labelf("Could not find \"%S\".", full_path); + } + UI_PrefHeight(ui_em(3, 1)) + UI_Row UI_Padding(ui_pct(1, 0)) + UI_PrefWidth(ui_text_dim(10, 1)) + UI_CornerRadius(ui_top_font_size()/3) + UI_PrefWidth(ui_text_dim(10, 1)) + UI_Focus(UI_FocusKind_On) + DF_Palette(DF_PaletteCode_NeutralPopButton) + if(ui_clicked(ui_buttonf("Find alternative..."))) + { + DF_CmdParams params = df_cmd_params_from_view(ws, panel, view); + params.cmd_spec = df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_PickFile); + df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_CmdSpec); + df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_RunCommand)); + cv->pick_file_override_target = view->entity; + } + scratch_end(scratch); + } + } + + ////////////////////////////// + //- rjf: code is not missing, but not ready -> equip loading info to this view + // + if(!entity_is_missing && info.lines_count == 0) + { + df_view_equip_loading_info(view, 1, info.bytes_processed, info.bytes_to_process); + } + + ////////////////////////////// + //- rjf: build code contents + // + if(!entity_is_missing && key_has_data) + { + df_code_view_build(ws, panel, view, cv, code_area_rect, data, &info); + } + + ////////////////////////////// + //- rjf: build bottom bar + // + if(!entity_is_missing && key_has_data) + { + ui_set_next_rect(shift_2f32(bottom_bar_rect, scale_2f32(rect.p0, -1.f))); + ui_set_next_flags(UI_BoxFlag_DrawBackground); + UI_Row + UI_TextAlignment(UI_TextAlign_Center) + UI_PrefWidth(ui_text_dim(10, 1)) + UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) + { + if(file_is_out_of_date) + { + UI_Box *box = &ui_g_nil_box; + UI_Palette(ui_build_palette(ui_top_palette(), .text = df_rgba_from_theme_color(DF_ThemeColor_TextNegative))) + UI_Font(df_font_from_slot(DF_FontSlot_Icons)) + UI_RunFlags(F_RunFlag_Smooth) + { + box = ui_build_box_from_stringf(UI_BoxFlag_DrawText|UI_BoxFlag_Clickable, "%S###file_ood_warning", df_g_icon_kind_text_table[DF_IconKind_WarningBig]); + } + UI_Signal sig = ui_signal_from_box(box); + if(ui_hovering(sig)) UI_Tooltip + { + UI_PrefWidth(ui_children_sum(1)) UI_Row UI_PrefWidth(ui_text_dim(1, 1)) + { + ui_labelf("This file has changed since ", out_of_date_dbgi_name); + UI_Palette(ui_build_palette(ui_top_palette(), .text = df_rgba_from_theme_color(DF_ThemeColor_TextNeutral))) ui_label(out_of_date_dbgi_name); + ui_labelf(" was produced."); + } + } + } + UI_Font(df_font_from_slot(DF_FontSlot_Code)) + { + ui_label(path); + ui_spacer(ui_em(1.5f, 1)); + ui_labelf("Line: %I64d, Column: %I64d", cv->cursor.line, cv->cursor.column); + ui_spacer(ui_pct(1, 0)); + ui_labelf("(read only)"); + ui_labelf("%s", + info.line_end_kind == TXT_LineEndKind_LF ? "lf" : + info.line_end_kind == TXT_LineEndKind_CRLF ? "crlf" : + "bin"); + } + } + } + + txt_scope_close(txt_scope); + hs_scope_close(hs_scope); + scratch_end(scratch); +} +#endif + +//~ TODO(rjf): OLD vvvvvvvv + +#if 1 DF_VIEW_SETUP_FUNCTION_DEF(Code) { // rjf: set up state @@ -7298,6 +7453,7 @@ DF_VIEW_UI_FUNCTION_DEF(Code) scratch_end(scratch); ProfEnd(); } +#endif //////////////////////////////// //~ rjf: Disassembly @view_hook_impl diff --git a/src/df/gfx/df_views.h b/src/df/gfx/df_views.h index 22c374ee..efa2d6b9 100644 --- a/src/df/gfx/df_views.h +++ b/src/df/gfx/df_views.h @@ -471,8 +471,8 @@ internal void df_entity_lister_item_array_sort_by_strength__in_place(DF_EntityLi //~ 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, U128 key, TXT_LangKind lang_kind); -internal void df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewState *cv, Rng2F32 rect, U128 key, TXT_LangKind lang_kind); +internal void df_code_view_cmds(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewState *cv, DF_CmdList *cmds, String8 data, TXT_TextInfo *info); +internal void df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewState *cv, Rng2F32 rect, String8 data, TXT_TextInfo *info); //////////////////////////////// //~ rjf: Watch Views diff --git a/src/hash_store/hash_store.c b/src/hash_store/hash_store.c index 501d888a..6d3d852d 100644 --- a/src/hash_store/hash_store.c +++ b/src/hash_store/hash_store.c @@ -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; } diff --git a/src/ui/ui_core.c b/src/ui/ui_core.c index 3256d05b..311f49dc 100644 --- a/src/ui/ui_core.c +++ b/src/ui/ui_core.c @@ -2885,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) { diff --git a/src/ui/ui_core.h b/src/ui/ui_core.h index f830adee..f1bfa4e6 100644 --- a/src/ui/ui_core.h +++ b/src/ui/ui_core.h @@ -976,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); From 6fa8af5e1a4bf35ecdbd90dfaa33e50a7fe3f831 Mon Sep 17 00:00:00 2001 From: Ryan Fleury Date: Tue, 25 Jun 2024 16:31:31 -0700 Subject: [PATCH 27/47] checkpoint on unified code ctx menu & all of its operations --- src/df/core/df_core.c | 533 +++++++++++------- src/df/core/df_core.h | 56 +- src/df/core/df_core.mdesk | 4 + src/df/core/generated/df_core.meta.c | 4 +- src/df/core/generated/df_core.meta.h | 2 + src/df/gfx/df_gfx.c | 510 +++++++++-------- src/df/gfx/df_gfx.h | 23 +- src/df/gfx/df_view_rules.c | 20 +- src/df/gfx/df_views.c | 296 ++++++++-- src/df/gfx/df_views.h | 6 +- .../dwrite/font_provider_dwrite.c | 6 +- 11 files changed, 947 insertions(+), 513 deletions(-) diff --git a/src/df/core/df_core.c b/src/df/core/df_core.c index 76191291..2f896e03 100644 --- a/src/df/core/df_core.c +++ b/src/df/core/df_core.c @@ -837,6 +837,24 @@ df_single_inst_from_machine_code(Arena *arena, Architecture arch, U64 start_voff return result; } +//////////////////////////////// +//~ rjf: Debug Info Extraction Type Pure Functions + +internal DF_LineList +df_line_list_copy(Arena *arena, DF_LineList *list) +{ + DF_LineList dst = {0}; + for(DF_LineNode *src_n = list->first; src_n != 0; src_n = src_n->next) + { + DF_LineNode *dst_n = push_array(arena, DF_LineNode, 1); + MemoryCopyStruct(dst_n, src_n); + dst_n->v.dbgi_key = di_key_copy(arena, &src_n->v.dbgi_key); + SLLQueuePush(dst.first, dst.last, dst_n); + dst.count += 1; + } + return dst; +} + //////////////////////////////// //~ rjf: Control Flow Analysis Functions @@ -2862,14 +2880,17 @@ df_trap_net_from_thread__step_over_line(Arena *arena, DF_Entity *thread) Rng1U64 line_vaddr_rng = {0}; { U64 ip_voff = df_voff_from_vaddr(module, ip_vaddr); - DF_TextLineDasm2SrcInfo line_info = df_text_line_dasm2src_info_from_dbgi_key_voff(&dbgi_key, ip_voff, 0); - Rng1U64 line_voff_rng = line_info.voff_range; - if(line_voff_rng.max != 0) + DF_LineList lines = df_lines_from_dbgi_key_voff(scratch.arena, &dbgi_key, ip_voff); + Rng1U64 line_voff_rng = {0}; + if(lines.first != 0) { + line_voff_rng = lines.first->v.voff_range; line_vaddr_rng = df_vaddr_range_from_voff_range(module, line_voff_rng); + DF_Entity *file = df_entity_from_handle(lines.first->v.file); + log_infof("line: {%S:%I64i}\n", file->name, lines.first->v.pt.line); } - log_infof("line: {%S:%I64i}\n", line_info.file->name, line_info.pt.line); - log_infof("voff_range: {0x%I64x, 0x%I64x}\n", line_info.voff_range.min, line_info.voff_range.max); + log_infof("voff_range: {0x%I64x, 0x%I64x}\n", line_voff_rng.min, line_voff_rng.max); + log_infof("vaddr_range: {0x%I64x, 0x%I64x}\n", line_vaddr_rng.min, line_vaddr_rng.max); } // rjf: opl line_vaddr_rng -> 0xf00f00 or 0xfeefee? => include in line vaddr range @@ -2878,10 +2899,10 @@ df_trap_net_from_thread__step_over_line(Arena *arena, DF_Entity *thread) // is enabled. This is enabled by default normally. { U64 opl_line_voff_rng = df_voff_from_vaddr(module, line_vaddr_rng.max); - DF_TextLineDasm2SrcInfo line_info = df_text_line_dasm2src_info_from_dbgi_key_voff(&dbgi_key, opl_line_voff_rng, 0); - if(line_info.pt.line == 0xf00f00 || line_info.pt.line == 0xfeefee) + DF_LineList lines = df_lines_from_dbgi_key_voff(scratch.arena, &dbgi_key, opl_line_voff_rng); + if(lines.first != 0 && (lines.first->v.pt.line == 0xf00f00 || lines.first->v.pt.line == 0xfeefee)) { - line_vaddr_rng.max = df_vaddr_from_voff(module, line_info.voff_range.max); + line_vaddr_rng.max = df_vaddr_from_voff(module, lines.first->v.voff_range.max); } } @@ -3020,10 +3041,11 @@ df_trap_net_from_thread__step_into_line(Arena *arena, DF_Entity *thread) Rng1U64 line_vaddr_rng = {0}; { U64 ip_voff = df_voff_from_vaddr(module, ip_vaddr); - DF_TextLineDasm2SrcInfo line_info = df_text_line_dasm2src_info_from_dbgi_key_voff(&dbgi_key, ip_voff, 0); - Rng1U64 line_voff_rng = line_info.voff_range; - if(line_voff_rng.max != 0) + DF_LineList lines = df_lines_from_dbgi_key_voff(scratch.arena, &dbgi_key, ip_voff); + Rng1U64 line_voff_rng = {0}; + if(lines.first != 0) { + line_voff_rng = lines.first->v.voff_range; line_vaddr_rng = df_vaddr_range_from_voff_range(module, line_voff_rng); } } @@ -3034,10 +3056,10 @@ df_trap_net_from_thread__step_into_line(Arena *arena, DF_Entity *thread) // is enabled. This is enabled by default normally. { U64 opl_line_voff_rng = df_voff_from_vaddr(module, line_vaddr_rng.max); - DF_TextLineDasm2SrcInfo line_info = df_text_line_dasm2src_info_from_dbgi_key_voff(&dbgi_key, opl_line_voff_rng, 0); - if(line_info.pt.line == 0xf00f00 || line_info.pt.line == 0xfeefee) + DF_LineList lines = df_lines_from_dbgi_key_voff(scratch.arena, &dbgi_key, opl_line_voff_rng); + if(lines.first != 0 && (lines.first->v.pt.line == 0xf00f00 || lines.first->v.pt.line == 0xfeefee)) { - line_vaddr_rng.max = df_vaddr_from_voff(module, line_info.voff_range.max); + line_vaddr_rng.max = df_vaddr_from_voff(module, lines.first->v.voff_range.max); } } @@ -3247,186 +3269,6 @@ df_symbol_name_from_process_vaddr(Arena *arena, DF_Entity *process, U64 vaddr) return result; } -//- 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) -{ - DF_TextLineSrc2DasmInfoListArray src2dasm_array = {0}; - { - src2dasm_array.count = dim_1s64(line_num_range)+1; - src2dasm_array.v = push_array(arena, DF_TextLineSrc2DasmInfoList, src2dasm_array.count); - } - Temp scratch = scratch_begin(&arena, 1); - DI_Scope *scope = di_scope_open(); - DI_KeyList dbgi_keys = df_push_active_dbgi_key_list(scratch.arena); - DF_EntityList overrides = df_possible_overrides_from_entity(scratch.arena, file); - for(DF_EntityNode *override_n = overrides.first; - override_n != 0; - override_n = override_n->next) - { - DF_Entity *override = override_n->entity; - String8 file_path = df_full_path_from_entity(scratch.arena, override); - String8 file_path_normalized = lower_from_str8(scratch.arena, file_path); - for(DI_KeyNode *dbgi_key_n = dbgi_keys.first; - dbgi_key_n != 0; - dbgi_key_n = dbgi_key_n->next) - { - // rjf: binary -> rdi - DI_Key key = dbgi_key_n->v; - RDI_Parsed *rdi = di_rdi_from_key(scope, &key, 0); - - // rjf: file_path_normalized * rdi -> src_id - B32 good_src_id = 0; - U32 src_id = 0; - if(rdi != &di_rdi_parsed_nil) - { - RDI_NameMap *mapptr = rdi_element_from_name_idx(rdi, NameMaps, RDI_NameMapKind_NormalSourcePaths); - RDI_ParsedNameMap map = {0}; - rdi_parsed_from_name_map(rdi, mapptr, &map); - RDI_NameMapNode *node = rdi_name_map_lookup(rdi, &map, file_path_normalized.str, file_path_normalized.size); - if(node != 0) - { - U32 id_count = 0; - U32 *ids = rdi_matches_from_map_node(rdi, node, &id_count); - if(id_count > 0) - { - good_src_id = 1; - src_id = ids[0]; - } - } - } - - // rjf: good src-id -> look up line info for visible range - if(good_src_id) - { - RDI_SourceFile *src = rdi_element_from_name_idx(rdi, SourceFiles, src_id); - RDI_SourceLineMap *src_line_map = rdi_element_from_name_idx(rdi, SourceLineMaps, src->source_line_map_idx); - RDI_ParsedSourceLineMap line_map = {0}; - rdi_parsed_from_source_line_map(rdi, src_line_map, &line_map); - U64 line_idx = 0; - for(S64 line_num = line_num_range.min; - line_num <= line_num_range.max; - line_num += 1, line_idx += 1) - { - DF_TextLineSrc2DasmInfoList *src2dasm_list = &src2dasm_array.v[line_idx]; - U32 voff_count = 0; - U64 *voffs = rdi_line_voffs_from_num(&line_map, u32_from_u64_saturate((U64)line_num), &voff_count); - for(U64 idx = 0; idx < voff_count; idx += 1) - { - U64 base_voff = voffs[idx]; - U64 unit_idx = rdi_vmap_idx_from_section_kind_voff(rdi, RDI_SectionKind_UnitVMap, base_voff); - RDI_Unit *unit = rdi_element_from_name_idx(rdi, Units, unit_idx); - RDI_LineTable *line_table = rdi_element_from_name_idx(rdi, LineTables, unit->line_table_idx); - RDI_ParsedLineTable unit_line_info = {0}; - rdi_parsed_from_line_table(rdi, line_table, &unit_line_info); - U64 line_info_idx = rdi_line_info_idx_from_voff(&unit_line_info, base_voff); - if(unit_line_info.voffs != 0) - { - Rng1U64 range = r1u64(base_voff, unit_line_info.voffs[line_info_idx+1]); - S64 actual_line = (S64)unit_line_info.lines[line_info_idx].line_num; - DF_TextLineSrc2DasmInfoNode *src2dasm_n = push_array(arena, DF_TextLineSrc2DasmInfoNode, 1); - src2dasm_n->v.voff_range = range; - src2dasm_n->v.remap_line = (S64)actual_line; - src2dasm_n->v.dbgi_key = key; - SLLQueuePush(src2dasm_list->first, src2dasm_list->last, src2dasm_n); - src2dasm_list->count += 1; - } - } - } - } - - // rjf: good src id -> push to relevant dbgi keys - if(good_src_id) - { - di_key_list_push(arena, &src2dasm_array.dbgi_keys, &key); - } - } - } - di_scope_close(scope); - scratch_end(scratch); - return src2dasm_array; -} - -//- 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) -{ - Temp scratch = scratch_begin(0, 0); - DI_Scope *scope = di_scope_open(); - RDI_Parsed *rdi = di_rdi_from_key(scope, dbgi_key, 0); - DF_TextLineDasm2SrcInfo result = {0}; - result.file = &df_g_nil_entity; - { - RDI_Unit *unit = rdi_unit_from_voff(rdi, voff); - RDI_LineTable *unit_line_table = rdi_line_table_from_unit(rdi, unit); - typedef struct LineTableNode LineTableNode; - struct LineTableNode - { - LineTableNode *next; - RDI_ParsedLineTable parsed_line_table; - }; - LineTableNode start_line_table = {0}; - rdi_parsed_from_line_table(rdi, unit_line_table, &start_line_table.parsed_line_table); - LineTableNode *top_line_table = &start_line_table; - RDI_Scope *scope = rdi_scope_from_voff(rdi, voff); - { - U64 idx = 0; - for(RDI_Scope *s = scope; - s->inline_site_idx != 0 && idx <= inline_unwind_idx; - s = rdi_element_from_name_idx(rdi, Scopes, s->parent_scope_idx), idx += 1) - { - if(idx == inline_unwind_idx) - { - RDI_InlineSite *inline_site = rdi_element_from_name_idx(rdi, InlineSites, s->inline_site_idx); - if(inline_site->line_table_idx != 0) - { - LineTableNode *n = push_array(scratch.arena, LineTableNode, 1); - SLLStackPush(top_line_table, n); - RDI_LineTable *line_table = rdi_element_from_name_idx(rdi, LineTables, inline_site->line_table_idx); - rdi_parsed_from_line_table(rdi, line_table, &n->parsed_line_table); - } - break; - } - } - } - for(LineTableNode *n = top_line_table; n == top_line_table; n = n->next) - { - RDI_ParsedLineTable parsed_line_table = n->parsed_line_table; - U64 line_info_idx = rdi_line_info_idx_from_voff(&parsed_line_table, voff); - if(line_info_idx < parsed_line_table.count) - { - RDI_Line *line = &parsed_line_table.lines[line_info_idx]; - RDI_Column *column = (line_info_idx < parsed_line_table.col_count) ? &parsed_line_table.cols[line_info_idx] : 0; - RDI_SourceFile *file = rdi_element_from_name_idx(rdi, SourceFiles, line->file_idx); - String8 file_normalized_full_path = {0}; - file_normalized_full_path.str = rdi_string_from_idx(rdi, file->normal_full_path_string_idx, &file_normalized_full_path.size); - MemoryCopyStruct(&result.dbgi_key, dbgi_key); - if(line->file_idx != 0 && file_normalized_full_path.size != 0) - { - result.file = df_entity_from_path(file_normalized_full_path, DF_EntityFromPathFlag_All); - } - result.pt = txt_pt(line->line_num, column ? column->col_first : 1); - result.voff_range = r1u64(parsed_line_table.voffs[line_info_idx], parsed_line_table.voffs[line_info_idx+1]); - } - } - for(LineTableNode *n = top_line_table->next; n != 0; n = n->next) - { - RDI_ParsedLineTable parsed_line_table = n->parsed_line_table; - U64 line_info_idx = rdi_line_info_idx_from_voff(&parsed_line_table, voff); - if(line_info_idx < parsed_line_table.count) - { - Rng1U64 voff_range = r1u64(parsed_line_table.voffs[line_info_idx], parsed_line_table.voffs[line_info_idx+1]); - result.voff_range = intersect_1u64(result.voff_range, voff_range); - } - } - } - di_scope_close(scope); - scratch_end(scratch); - return result; -} - //- rjf: symbol -> voff lookups internal U64 @@ -3549,6 +3391,298 @@ df_type_num_from_dbgi_key_name(DI_Key *dbgi_key, String8 name) return result; } +//- rjf: voff -> line info + +internal DF_LineList +df_lines_from_dbgi_key_voff(Arena *arena, DI_Key *dbgi_key, U64 voff) +{ + Temp scratch = scratch_begin(&arena, 1); + DI_Scope *scope = di_scope_open(); + RDI_Parsed *rdi = di_rdi_from_key(scope, dbgi_key, 0); + DF_LineList result = {0}; + { + //- rjf: gather line tables + typedef struct LineTableNode LineTableNode; + struct LineTableNode + { + LineTableNode *next; + RDI_ParsedLineTable parsed_line_table; + }; + LineTableNode start_line_table = {0}; + RDI_Unit *unit = rdi_unit_from_voff(rdi, voff); + RDI_LineTable *unit_line_table = rdi_line_table_from_unit(rdi, unit); + rdi_parsed_from_line_table(rdi, unit_line_table, &start_line_table.parsed_line_table); + LineTableNode *top_line_table = &start_line_table; + RDI_Scope *scope = rdi_scope_from_voff(rdi, voff); + { + for(RDI_Scope *s = scope; + s->inline_site_idx != 0; + s = rdi_element_from_name_idx(rdi, Scopes, s->parent_scope_idx)) + { + RDI_InlineSite *inline_site = rdi_element_from_name_idx(rdi, InlineSites, s->inline_site_idx); + if(inline_site->line_table_idx != 0) + { + LineTableNode *n = push_array(scratch.arena, LineTableNode, 1); + SLLStackPush(top_line_table, n); + RDI_LineTable *line_table = rdi_element_from_name_idx(rdi, LineTables, inline_site->line_table_idx); + rdi_parsed_from_line_table(rdi, line_table, &n->parsed_line_table); + } + } + } + + //- rjf: gather lines in each line table + Rng1U64 shallowest_voff_range = {0}; + for(LineTableNode *n = top_line_table; n != 0; n = n->next) + { + RDI_ParsedLineTable parsed_line_table = n->parsed_line_table; + U64 line_info_idx = rdi_line_info_idx_from_voff(&parsed_line_table, voff); + if(line_info_idx < parsed_line_table.count) + { + RDI_Line *line = &parsed_line_table.lines[line_info_idx]; + RDI_Column *column = (line_info_idx < parsed_line_table.col_count) ? &parsed_line_table.cols[line_info_idx] : 0; + RDI_SourceFile *file = rdi_element_from_name_idx(rdi, SourceFiles, line->file_idx); + String8 file_normalized_full_path = {0}; + file_normalized_full_path.str = rdi_string_from_idx(rdi, file->normal_full_path_string_idx, &file_normalized_full_path.size); + DF_LineNode *n = push_array(arena, DF_LineNode, 1); + SLLQueuePush(result.first, result.last, n); + result.count += 1; + if(line->file_idx != 0 && file_normalized_full_path.size != 0) + { + n->v.file = df_handle_from_entity(df_entity_from_path(file_normalized_full_path, DF_EntityFromPathFlag_All)); + } + n->v.pt = txt_pt(line->line_num, column ? column->col_first : 1); + n->v.voff_range = r1u64(parsed_line_table.voffs[line_info_idx], parsed_line_table.voffs[line_info_idx+1]); + n->v.dbgi_key = *dbgi_key; + shallowest_voff_range = n->v.voff_range; + } + } + + //- rjf: clamp all lines from all tables by shallowest (most unwound) range + for(DF_LineNode *n = result.first; n != 0; n = n->next) + { + n->v.voff_range = intersect_1u64(n->v.voff_range, shallowest_voff_range); + } + } + di_scope_close(scope); + scratch_end(scratch); + return result; +} + +//- rjf: file:line -> line info + +internal DF_LineListArray +df_lines_array_from_file_line_range(Arena *arena, DF_Entity *file, Rng1S64 line_num_range) +{ + DF_LineListArray array = {0}; + { + array.count = dim_1s64(line_num_range)+1; + array.v = push_array(arena, DF_LineList, array.count); + } + Temp scratch = scratch_begin(&arena, 1); + DI_Scope *scope = di_scope_open(); + DI_KeyList dbgi_keys = df_push_active_dbgi_key_list(scratch.arena); + DF_EntityList overrides = df_possible_overrides_from_entity(scratch.arena, file); + for(DF_EntityNode *override_n = overrides.first; + override_n != 0; + override_n = override_n->next) + { + DF_Entity *override = override_n->entity; + String8 file_path = df_full_path_from_entity(scratch.arena, override); + String8 file_path_normalized = lower_from_str8(scratch.arena, file_path); + for(DI_KeyNode *dbgi_key_n = dbgi_keys.first; + dbgi_key_n != 0; + dbgi_key_n = dbgi_key_n->next) + { + // rjf: binary -> rdi + DI_Key key = dbgi_key_n->v; + RDI_Parsed *rdi = di_rdi_from_key(scope, &key, 0); + + // rjf: file_path_normalized * rdi -> src_id + B32 good_src_id = 0; + U32 src_id = 0; + if(rdi != &di_rdi_parsed_nil) + { + RDI_NameMap *mapptr = rdi_element_from_name_idx(rdi, NameMaps, RDI_NameMapKind_NormalSourcePaths); + RDI_ParsedNameMap map = {0}; + rdi_parsed_from_name_map(rdi, mapptr, &map); + RDI_NameMapNode *node = rdi_name_map_lookup(rdi, &map, file_path_normalized.str, file_path_normalized.size); + if(node != 0) + { + U32 id_count = 0; + U32 *ids = rdi_matches_from_map_node(rdi, node, &id_count); + if(id_count > 0) + { + good_src_id = 1; + src_id = ids[0]; + } + } + } + + // rjf: good src-id -> look up line info for visible range + if(good_src_id) + { + RDI_SourceFile *src = rdi_element_from_name_idx(rdi, SourceFiles, src_id); + RDI_SourceLineMap *src_line_map = rdi_element_from_name_idx(rdi, SourceLineMaps, src->source_line_map_idx); + RDI_ParsedSourceLineMap line_map = {0}; + rdi_parsed_from_source_line_map(rdi, src_line_map, &line_map); + U64 line_idx = 0; + for(S64 line_num = line_num_range.min; + line_num <= line_num_range.max; + line_num += 1, line_idx += 1) + { + DF_LineList *list = &array.v[line_idx]; + U32 voff_count = 0; + U64 *voffs = rdi_line_voffs_from_num(&line_map, u32_from_u64_saturate((U64)line_num), &voff_count); + for(U64 idx = 0; idx < voff_count; idx += 1) + { + U64 base_voff = voffs[idx]; + U64 unit_idx = rdi_vmap_idx_from_section_kind_voff(rdi, RDI_SectionKind_UnitVMap, base_voff); + RDI_Unit *unit = rdi_element_from_name_idx(rdi, Units, unit_idx); + RDI_LineTable *line_table = rdi_element_from_name_idx(rdi, LineTables, unit->line_table_idx); + RDI_ParsedLineTable unit_line_info = {0}; + rdi_parsed_from_line_table(rdi, line_table, &unit_line_info); + U64 line_info_idx = rdi_line_info_idx_from_voff(&unit_line_info, base_voff); + if(unit_line_info.voffs != 0) + { + Rng1U64 range = r1u64(base_voff, unit_line_info.voffs[line_info_idx+1]); + S64 actual_line = (S64)unit_line_info.lines[line_info_idx].line_num; + DF_LineNode *n = push_array(arena, DF_LineNode, 1); + n->v.voff_range = range; + n->v.pt.line = (S64)actual_line; + n->v.pt.column = 1; + n->v.dbgi_key = key; + SLLQueuePush(list->first, list->last, n); + list->count += 1; + } + } + } + } + + // rjf: good src id -> push to relevant dbgi keys + if(good_src_id) + { + di_key_list_push(arena, &array.dbgi_keys, &key); + } + } + } + di_scope_close(scope); + scratch_end(scratch); + return array; +} + +internal DF_LineList +df_lines_from_file_line_num(Arena *arena, DF_Entity *file, S64 line_num) +{ + DF_LineListArray array = df_lines_array_from_file_line_range(arena, file, r1s64(line_num, line_num+1)); + DF_LineList list = {0}; + if(array.count != 0) + { + list = array.v[0]; + } + return list; +} + +//- 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) +{ + DF_TextLineSrc2DasmInfoListArray src2dasm_array = {0}; + { + src2dasm_array.count = dim_1s64(line_num_range)+1; + src2dasm_array.v = push_array(arena, DF_TextLineSrc2DasmInfoList, src2dasm_array.count); + } + Temp scratch = scratch_begin(&arena, 1); + DI_Scope *scope = di_scope_open(); + DI_KeyList dbgi_keys = df_push_active_dbgi_key_list(scratch.arena); + DF_EntityList overrides = df_possible_overrides_from_entity(scratch.arena, file); + for(DF_EntityNode *override_n = overrides.first; + override_n != 0; + override_n = override_n->next) + { + DF_Entity *override = override_n->entity; + String8 file_path = df_full_path_from_entity(scratch.arena, override); + String8 file_path_normalized = lower_from_str8(scratch.arena, file_path); + for(DI_KeyNode *dbgi_key_n = dbgi_keys.first; + dbgi_key_n != 0; + dbgi_key_n = dbgi_key_n->next) + { + // rjf: binary -> rdi + DI_Key key = dbgi_key_n->v; + RDI_Parsed *rdi = di_rdi_from_key(scope, &key, 0); + + // rjf: file_path_normalized * rdi -> src_id + B32 good_src_id = 0; + U32 src_id = 0; + if(rdi != &di_rdi_parsed_nil) + { + RDI_NameMap *mapptr = rdi_element_from_name_idx(rdi, NameMaps, RDI_NameMapKind_NormalSourcePaths); + RDI_ParsedNameMap map = {0}; + rdi_parsed_from_name_map(rdi, mapptr, &map); + RDI_NameMapNode *node = rdi_name_map_lookup(rdi, &map, file_path_normalized.str, file_path_normalized.size); + if(node != 0) + { + U32 id_count = 0; + U32 *ids = rdi_matches_from_map_node(rdi, node, &id_count); + if(id_count > 0) + { + good_src_id = 1; + src_id = ids[0]; + } + } + } + + // rjf: good src-id -> look up line info for visible range + if(good_src_id) + { + RDI_SourceFile *src = rdi_element_from_name_idx(rdi, SourceFiles, src_id); + RDI_SourceLineMap *src_line_map = rdi_element_from_name_idx(rdi, SourceLineMaps, src->source_line_map_idx); + RDI_ParsedSourceLineMap line_map = {0}; + rdi_parsed_from_source_line_map(rdi, src_line_map, &line_map); + U64 line_idx = 0; + for(S64 line_num = line_num_range.min; + line_num <= line_num_range.max; + line_num += 1, line_idx += 1) + { + DF_TextLineSrc2DasmInfoList *src2dasm_list = &src2dasm_array.v[line_idx]; + U32 voff_count = 0; + U64 *voffs = rdi_line_voffs_from_num(&line_map, u32_from_u64_saturate((U64)line_num), &voff_count); + for(U64 idx = 0; idx < voff_count; idx += 1) + { + U64 base_voff = voffs[idx]; + U64 unit_idx = rdi_vmap_idx_from_section_kind_voff(rdi, RDI_SectionKind_UnitVMap, base_voff); + RDI_Unit *unit = rdi_element_from_name_idx(rdi, Units, unit_idx); + RDI_LineTable *line_table = rdi_element_from_name_idx(rdi, LineTables, unit->line_table_idx); + RDI_ParsedLineTable unit_line_info = {0}; + rdi_parsed_from_line_table(rdi, line_table, &unit_line_info); + U64 line_info_idx = rdi_line_info_idx_from_voff(&unit_line_info, base_voff); + if(unit_line_info.voffs != 0) + { + Rng1U64 range = r1u64(base_voff, unit_line_info.voffs[line_info_idx+1]); + S64 actual_line = (S64)unit_line_info.lines[line_info_idx].line_num; + DF_TextLineSrc2DasmInfoNode *src2dasm_n = push_array(arena, DF_TextLineSrc2DasmInfoNode, 1); + src2dasm_n->v.voff_range = range; + src2dasm_n->v.remap_line = (S64)actual_line; + src2dasm_n->v.dbgi_key = key; + SLLQueuePush(src2dasm_list->first, src2dasm_list->last, src2dasm_n); + src2dasm_list->count += 1; + } + } + } + } + + // rjf: good src id -> push to relevant dbgi keys + if(good_src_id) + { + di_key_list_push(arena, &src2dasm_array.dbgi_keys, &key); + } + } + } + di_scope_close(scope); + scratch_end(scratch); + return src2dasm_array; +} + //////////////////////////////// //~ rjf: Process/Thread/Module Info Lookups @@ -6886,7 +7020,6 @@ df_core_begin_frame(Arena *arena, DF_CmdList *cmds, F32 dt) DF_Entity *module = df_module_from_process_vaddr(process, stop_thread_vaddr); DI_Key dbgi_key = df_dbgi_key_from_module(module); U64 stop_thread_voff = df_voff_from_vaddr(module, stop_thread_vaddr); - DF_TextLineDasm2SrcInfo dasm2src_info = df_text_line_dasm2src_info_from_dbgi_key_voff(&dbgi_key, stop_thread_voff, 0); DF_EntityList user_bps = df_query_cached_entity_list_with_kind(DF_EntityKind_Breakpoint); for(DF_EntityNode *n = user_bps.first; n != 0; n = n->next) { @@ -6898,9 +7031,14 @@ df_core_begin_frame(Arena *arena, DF_CmdList *cmds, F32 dt) if(bp->flags & DF_EntityFlag_HasTextPoint) { DF_Entity *bp_file = df_entity_ancestor_from_kind(bp, DF_EntityKind_File); - if(bp_file == dasm2src_info.file && bp->text_point.line == dasm2src_info.pt.line) + DF_LineList lines = df_lines_from_file_line_num(scratch.arena, bp_file, bp_file->text_point.line); + for(DF_LineNode *n = lines.first; n != 0; n = n->next) { - bp->u64 += 1; + if(contains_1u64(n->v.voff_range, stop_thread_voff)) + { + bp->u64 += 1; + break; + } } } } @@ -7631,6 +7769,7 @@ df_core_begin_frame(Arena *arena, DF_CmdList *cmds, F32 dt) { DF_Entity *bp = df_entity_alloc(0, df_entity_root(), DF_EntityKind_Breakpoint); bp->flags |= DF_EntityFlag_DiesOnRunStop; + df_entity_equip_b32(bp, 1); df_entity_equip_vaddr(bp, params.vaddr); df_entity_equip_cfg_src(bp, DF_CfgSrc_Transient); DF_CmdParams p = df_cmd_params_zero(); diff --git a/src/df/core/df_core.h b/src/df/core/df_core.h index 9b09e319..41e1534c 100644 --- a/src/df/core/df_core.h +++ b/src/df/core/df_core.h @@ -556,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 @@ -1391,6 +1426,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 @@ -1582,16 +1622,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 diff --git a/src/df/core/df_core.mdesk b/src/df/core/df_core.mdesk index 331ac04c..28732b74 100644 --- a/src/df/core/df_core.mdesk +++ b/src/df/core/df_core.mdesk @@ -222,6 +222,10 @@ DF_CoreCmdTable:// | | | {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." "" } diff --git a/src/df/core/generated/df_core.meta.c b/src/df/core/generated/df_core.meta.c index b8e5b2cc..3fc0a521 100644 --- a/src/df/core/generated/df_core.meta.c +++ b/src/df/core/generated/df_core.meta.c @@ -209,7 +209,7 @@ DF_CoreCmdKind_Null, DF_CoreCmdKind_Null, }; -DF_CmdSpecInfo df_g_core_cmd_kind_spec_info_table[218] = +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}, @@ -294,6 +294,8 @@ DF_CmdSpecInfo df_g_core_cmd_kind_spec_info_table[218] = { 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("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}, diff --git a/src/df/core/generated/df_core.meta.h b/src/df/core/generated/df_core.meta.h index 722ecbb4..462a6852 100644 --- a/src/df/core/generated/df_core.meta.h +++ b/src/df/core/generated/df_core.meta.h @@ -130,6 +130,8 @@ DF_CoreCmdKind_SetCurrentPath, DF_CoreCmdKind_Open, DF_CoreCmdKind_Switch, DF_CoreCmdKind_SwitchToPartnerFile, +DF_CoreCmdKind_GoToDisassembly, +DF_CoreCmdKind_GoToSource, DF_CoreCmdKind_SetFileOverrideLinkSrc, DF_CoreCmdKind_SetFileOverrideLinkDst, DF_CoreCmdKind_SetFileReplacementPath, diff --git a/src/df/gfx/df_gfx.c b/src/df/gfx/df_gfx.c index ba9d31f3..3e7d24ab 100644 --- a/src/df/gfx/df_gfx.c +++ b/src/df/gfx/df_gfx.c @@ -1029,6 +1029,7 @@ df_window_open(Vec2F32 size, OS_Handle preferred_monitor, DF_CfgSrc cfg_src) window->code_ctx_menu_key = ui_key_from_string(ui_key_zero(), str8_lit("_code_ctx_menu_")); window->entity_ctx_menu_key = ui_key_from_string(ui_key_zero(), str8_lit("_entity_ctx_menu_")); window->tab_ctx_menu_key = ui_key_from_string(ui_key_zero(), str8_lit("_tab_ctx_menu_")); + window->code_ctx_menu_arena = arena_alloc(); window->hover_eval_arena = arena_alloc(); window->autocomp_lister_params_arena = arena_alloc(); window->free_panel = &df_g_nil_panel; @@ -2585,13 +2586,25 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) DI_Key dbgi_key = df_dbgi_key_from_module(module); RDI_Parsed *rdi = di_rdi_from_key(scope, &dbgi_key, 0); U64 rip_voff = df_voff_from_vaddr(module, rip_vaddr); - DF_TextLineDasm2SrcInfo line_info = df_text_line_dasm2src_info_from_dbgi_key_voff(&dbgi_key, rip_voff, inline_unwind_index); + DF_LineList lines = df_lines_from_dbgi_key_voff(scratch.arena, &dbgi_key, rip_voff); + DF_Line line = {0}; + { + U64 idx = 0; + for(DF_LineNode *n = lines.first; n != 0; n = n->next, idx += 1) + { + line = n->v; + if(idx == inline_unwind_index) + { + break; + } + } + } // rjf: snap to resolved line B32 missing_rip = (rip_vaddr == 0); B32 dbgi_missing = (dbgi_key.min_timestamp == 0 || dbgi_key.path.size == 0); B32 dbgi_pending = !dbgi_missing && rdi == &di_rdi_parsed_nil; - B32 has_line_info = (line_info.voff_range.max != line_info.voff_range.min); + B32 has_line_info = (line.voff_range.max != line.voff_range.min); B32 has_module = !df_entity_is_nil(module); B32 has_dbg_info = has_module && !dbgi_missing; if(!dbgi_pending && (has_line_info || has_module)) @@ -2599,8 +2612,8 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) DF_CmdParams params = df_cmd_params_from_window(ws); if(has_line_info) { - params.file_path = df_full_path_from_entity(scratch.arena, line_info.file); - params.text_point = line_info.pt; + params.file_path = df_full_path_from_entity(scratch.arena, df_entity_from_handle(line.file)); + params.text_point = line.pt; df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_FilePath); df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_TextPoint); } @@ -2783,28 +2796,31 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) // rjf: name resolved to voff * dbg info if(name_resolved != 0 && voff != 0) { - DF_TextLineDasm2SrcInfo dasm2src_info = df_text_line_dasm2src_info_from_dbgi_key_voff(&voff_dbgi_key, voff, 0); - DF_CmdParams p = params; + DF_LineList lines = df_lines_from_dbgi_key_voff(scratch.arena, &voff_dbgi_key, voff); + if(lines.first != 0) { - p.file_path = df_full_path_from_entity(scratch.arena, dasm2src_info.file); - p.text_point = dasm2src_info.pt; - df_cmd_params_mark_slot(&p, DF_CmdParamSlot_FilePath); - df_cmd_params_mark_slot(&p, DF_CmdParamSlot_TextPoint); - if(voff_dbgi_key.path.size != 0) + DF_CmdParams p = params; { - DF_EntityList modules = df_modules_from_dbgi_key(scratch.arena, &voff_dbgi_key); - DF_Entity *module = df_first_entity_from_list(&modules); - DF_Entity *process = df_entity_ancestor_from_kind(module, DF_EntityKind_Process); - if(!df_entity_is_nil(process)) + p.file_path = df_full_path_from_entity(scratch.arena, df_entity_from_handle(lines.first->v.file)); + p.text_point = lines.first->v.pt; + df_cmd_params_mark_slot(&p, DF_CmdParamSlot_FilePath); + df_cmd_params_mark_slot(&p, DF_CmdParamSlot_TextPoint); + if(voff_dbgi_key.path.size != 0) { - p.entity = df_handle_from_entity(process); - p.vaddr = module->vaddr_rng.min + dasm2src_info.voff_range.min; - df_cmd_params_mark_slot(&p, DF_CmdParamSlot_Entity); - df_cmd_params_mark_slot(&p, DF_CmdParamSlot_VirtualAddr); + DF_EntityList modules = df_modules_from_dbgi_key(scratch.arena, &voff_dbgi_key); + DF_Entity *module = df_first_entity_from_list(&modules); + DF_Entity *process = df_entity_ancestor_from_kind(module, DF_EntityKind_Process); + if(!df_entity_is_nil(process)) + { + p.entity = df_handle_from_entity(process); + p.vaddr = module->vaddr_rng.min + lines.first->v.voff_range.min; + df_cmd_params_mark_slot(&p, DF_CmdParamSlot_Entity); + df_cmd_params_mark_slot(&p, DF_CmdParamSlot_VirtualAddr); + } } } + df_cmd_list_push(arena, cmds, &p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_FindCodeLocation)); } - df_cmd_list_push(arena, cmds, &p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_FindCodeLocation)); } // rjf: name resolved to a file @@ -3694,9 +3710,154 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) UI_PrefWidth(ui_em(30.f, 1.f)) DF_Palette(DF_PaletteCode_ImplicitButton) { - ui_buttonf("Foo"); - ui_buttonf("Bar"); - ui_buttonf("Baz"); + TXT_Scope *txt_scope = txt_scope_open(); + HS_Scope *hs_scope = hs_scope_open(); + DF_CtrlCtx ctrl_ctx = df_ctrl_ctx_from_window(ws); + TxtRng range = ws->code_ctx_menu_range; + DF_LineList lines = ws->code_ctx_menu_lines; + if(!txt_pt_match(range.min, range.max) && ui_clicked(df_cmd_spec_button(df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_Copy)))) + { + U128 hash = {0}; + TXT_TextInfo info = txt_text_info_from_key_lang(txt_scope, ws->code_ctx_menu_text_key, ws->code_ctx_menu_lang_kind, &hash); + String8 data = hs_data_from_hash(hs_scope, hash); + String8 copy_data = txt_string_from_info_data_txt_rng(&info, data, ws->code_ctx_menu_range); + os_set_clipboard_text(copy_data); + ui_ctx_menu_close(); + } + if(range.min.line == range.max.line && ui_clicked(df_icon_buttonf(DF_IconKind_RightArrow, 0, "Move Thread Here"))) + { + DF_Entity *thread = df_entity_from_handle(ctrl_ctx.thread); + U64 new_rip_vaddr = ws->code_ctx_menu_vaddr; + if(!df_entity_is_nil(df_entity_from_handle(ws->code_ctx_menu_file))) + { + for(DF_LineNode *n = lines.first; n != 0; n = n->next) + { + DF_EntityList modules = df_modules_from_dbgi_key(scratch.arena, &n->v.dbgi_key); + DF_Entity *module = df_module_from_thread_candidates(thread, &modules); + if(!df_entity_is_nil(module)) + { + new_rip_vaddr = df_vaddr_from_voff(module, n->v.voff_range.min); + break; + } + } + } + DF_CmdParams p = df_cmd_params_from_window(ws); + p.entity = df_handle_from_entity(thread); + p.vaddr = new_rip_vaddr; + df_push_cmd__root(&p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_SetThreadIP)); + ui_ctx_menu_close(); + } + if(range.min.line == range.max.line && ui_clicked(df_icon_buttonf(DF_IconKind_Play, 0, "Run To Line"))) + { + if(!df_entity_is_nil(df_entity_from_handle(ws->code_ctx_menu_file))) + { + DF_CmdParams p = df_cmd_params_from_window(ws); + p.entity = ws->code_ctx_menu_file; + p.text_point = range.min; + df_push_cmd__root(&p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_RunToLine)); + } + else + { + DF_CmdParams p = df_cmd_params_from_window(ws); + p.vaddr = ws->code_ctx_menu_vaddr; + df_push_cmd__root(&p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_RunToAddress)); + } + ui_ctx_menu_close(); + } + if(range.min.line == range.max.line && ui_clicked(df_icon_buttonf(DF_IconKind_Null, 0, "Go To Name"))) + { + U128 hash = {0}; + TXT_TextInfo info = txt_text_info_from_key_lang(txt_scope, ws->code_ctx_menu_text_key, ws->code_ctx_menu_lang_kind, &hash); + String8 data = hs_data_from_hash(hs_scope, hash); + Rng1U64 expr_off_range = {0}; + if(range.min.column != range.max.column) + { + expr_off_range = r1u64(txt_off_from_info_pt(&info, range.min), txt_off_from_info_pt(&info, range.max)); + } + else + { + expr_off_range = txt_expr_off_range_from_info_data_pt(&info, data, range.min); + } + String8 expr = str8_substr(data, expr_off_range); + DF_CmdParams p = df_cmd_params_from_window(ws); + p.string = expr; + df_push_cmd__root(&p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_GoToName)); + ui_ctx_menu_close(); + } + if(range.min.line == range.max.line && ui_clicked(df_icon_buttonf(DF_IconKind_CircleFilled, 0, "Toggle Breakpoint"))) + { + if(ws->code_ctx_menu_vaddr != 0) + { + DF_CmdParams p = df_cmd_params_from_window(ws); + p.vaddr = ws->code_ctx_menu_vaddr; + df_push_cmd__root(&p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_AddressBreakpoint)); + } + else + { + DF_CmdParams p = df_cmd_params_from_window(ws); + p.entity = ws->code_ctx_menu_file; + p.text_point = range.min; + df_push_cmd__root(&p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_TextBreakpoint)); + } + ui_ctx_menu_close(); + } + if(range.min.line == range.max.line && ui_clicked(df_icon_buttonf(DF_IconKind_Binoculars, 0, "Toggle Watch Expression"))) + { + U128 hash = {0}; + TXT_TextInfo info = txt_text_info_from_key_lang(txt_scope, ws->code_ctx_menu_text_key, ws->code_ctx_menu_lang_kind, &hash); + String8 data = hs_data_from_hash(hs_scope, hash); + Rng1U64 expr_off_range = {0}; + if(range.min.column != range.max.column) + { + expr_off_range = r1u64(txt_off_from_info_pt(&info, range.min), txt_off_from_info_pt(&info, range.max)); + } + else + { + expr_off_range = txt_expr_off_range_from_info_data_pt(&info, data, range.min); + } + String8 expr = str8_substr(data, expr_off_range); + DF_CmdParams p = df_cmd_params_from_window(ws); + p.string = expr; + df_push_cmd__root(&p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_ToggleWatchExpression)); + ui_ctx_menu_close(); + } + if(df_entity_is_nil(df_entity_from_handle(ws->code_ctx_menu_file)) && range.min.line == range.max.line && ui_clicked(df_icon_buttonf(DF_IconKind_FileOutline, 0, "Go To Source"))) + { + if(lines.first != 0) + { + DF_CmdParams params = df_cmd_params_from_window(ws); + params.file_path = df_full_path_from_entity(scratch.arena, df_entity_from_handle(lines.first->v.file)); + params.text_point = lines.first->v.pt; + df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_FilePath); + df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_TextPoint); + df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_FindCodeLocation)); + } + ui_ctx_menu_close(); + } + if(!df_entity_is_nil(df_entity_from_handle(ws->code_ctx_menu_file)) && range.min.line == range.max.line && ui_clicked(df_icon_buttonf(DF_IconKind_FileOutline, 0, "Go To Disassembly"))) + { + DF_Entity *thread = df_entity_from_handle(ctrl_ctx.thread); + U64 vaddr = 0; + for(DF_LineNode *n = lines.first; n != 0; n = n->next) + { + DF_EntityList modules = df_modules_from_dbgi_key(scratch.arena, &n->v.dbgi_key); + DF_Entity *module = df_module_from_thread_candidates(thread, &modules); + if(!df_entity_is_nil(module)) + { + vaddr = df_vaddr_from_voff(module, n->v.voff_range.min); + break; + } + } + DF_CmdParams params = df_cmd_params_from_window(ws); + df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_Entity); + df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_VirtualAddr); + params.entity = df_handle_from_entity(thread); + params.vaddr = vaddr; + df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_FindCodeLocation)); + ui_ctx_menu_close(); + } + hs_scope_close(hs_scope); + txt_scope_close(txt_scope); } //- rjf: entity menu @@ -10607,7 +10768,7 @@ internal UI_BOX_CUSTOM_DRAW(df_bp_box_draw_extensions) } internal DF_CodeSliceSignal -df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_CodeSliceParams *params, TxtPt *cursor, TxtPt *mark, S64 *preferred_column, String8 string) +df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_CodeCtx *code_ctx, DF_CodeSliceParams *params, TxtPt *cursor, TxtPt *mark, S64 *preferred_column, String8 string) { DF_CodeSliceSignal result = {0}; ProfBeginFunction(); @@ -10674,82 +10835,6 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ } } - ////////////////////////////// - //- rjf: build per-line context menus - // - UI_Key *ctx_menu_keys = push_array(scratch.arena, UI_Key, dim_1s64(params->line_num_range)+1); - { - U64 line_idx = 0; - for(S64 line_num = params->line_num_range.min; - line_num < params->line_num_range.max; - line_num += 1, line_idx += 1) - { - ctx_menu_keys[line_idx] = ui_key_from_stringf(top_container_box->key, "line_ctx_%I64d", line_num); - DF_Palette(DF_PaletteCode_Floating) - UI_CtxMenu(ctx_menu_keys[line_idx]) - DF_Palette(DF_PaletteCode_ImplicitButton) - UI_PrefWidth(ui_em(37.f, 1.f)) - { - DF_TextLineSrc2DasmInfoList *line_src2dasm_list = ¶ms->line_src2dasm[line_idx]; - DF_TextLineDasm2SrcInfoList *line_dasm2src_list = ¶ms->line_dasm2src[line_idx]; - - //- rjf: copy selection - if(!txt_pt_match(*cursor, *mark) && ui_clicked(df_cmd_spec_button(df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_Copy)))) - { - result.copy_range = txt_rng(*cursor, *mark); - ui_ctx_menu_close(); - } - - //- rjf: watch selection - if(ui_clicked(df_cmd_spec_button(df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_ToggleWatchExpressionAtCursor)))) - { - result.toggle_cursor_watch = 1; - ui_ctx_menu_close(); - } - - //- rjf: set-next-statement - if(ui_clicked(df_cmd_spec_button(df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_SetNextStatement)))) - { - result.set_next_statement_line_num = line_num; - ui_ctx_menu_close(); - } - - //- rjf: run-to-line - if(ui_clicked(df_icon_buttonf(DF_IconKind_Play, 0, "Run To Line"))) - { - result.run_to_line_num = line_num; - ui_ctx_menu_close(); - } - - //- rjf: breakpoint placing - if((params->line_bps[line_idx].count == 0 && - ui_clicked(df_icon_buttonf(DF_IconKind_CircleFilled, 0, "Place Breakpoint"))) || - (params->line_bps[line_idx].count != 0 && - ui_clicked(df_icon_buttonf(DF_IconKind_CircleFilled, 0, "Remove Breakpoint")))) - { - result.clicked_margin_line_num = line_num; - ui_ctx_menu_close(); - } - - //- rjf: go from src -> disasm - if(line_src2dasm_list->first != 0 && - ui_clicked(df_icon_buttonf(DF_IconKind_Find, 0, "Go To Disassembly"))) - { - result.goto_disasm_line_num = line_num; - ui_ctx_menu_close(); - } - - //- rjf: go from disasm -> src - if(line_dasm2src_list->first != 0 && - ui_clicked(df_icon_buttonf(DF_IconKind_Find, 0, "Go To Source"))) - { - result.goto_src_line_num = line_num; - ui_ctx_menu_close(); - } - } - } - } - ////////////////////////////// //- rjf: build priority margin // @@ -10851,23 +10936,21 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ // rjf: fill out progress t (progress into range of current line's // voff range) - if(params->line_src2dasm[line_idx].first != 0) + if(params->line_infos[line_idx].first != 0) { - DF_TextLineSrc2DasmInfoList *line_info_list = ¶ms->line_src2dasm[line_idx]; - DF_TextLineSrc2DasmInfo *line_info = 0; - for(DF_TextLineSrc2DasmInfoNode *n = line_info_list->first; - n != 0; - n = n->next) + DF_LineList *lines = ¶ms->line_infos[line_idx]; + DF_Line *line = 0; + for(DF_LineNode *n = lines->first; n != 0; n = n->next) { if(di_key_match(&n->v.dbgi_key, &dbgi_key)) { - line_info = &n->v; + line = &n->v; break; } } - if(line_info != 0) + if(line != 0) { - Rng1U64 line_voff_rng = line_info->voff_range; + Rng1U64 line_voff_rng = line->voff_range; Vec4F32 weak_thread_color = color; weak_thread_color.w *= 0.4f; F32 progress_t = (line_voff_rng.max != line_voff_rng.min) ? ((F32)(thread_rip_voff - line_voff_rng.min) / (F32)(line_voff_rng.max - line_voff_rng.min)) : 0; @@ -11008,23 +11091,21 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ // rjf: fill out progress t (progress into range of current line's // voff range) - if(params->line_src2dasm[line_idx].first != 0) + if(code_ctx->file != &df_g_nil_entity && params->line_infos[line_idx].first != 0) { - DF_TextLineSrc2DasmInfoList *line_info_list = ¶ms->line_src2dasm[line_idx]; - DF_TextLineSrc2DasmInfo *line_info = 0; - for(DF_TextLineSrc2DasmInfoNode *n = line_info_list->first; - n != 0; - n = n->next) + DF_LineList *lines = ¶ms->line_infos[line_idx]; + DF_Line *line = 0; + for(DF_LineNode *n = lines->first; n != 0; n = n->next) { if(di_key_match(&n->v.dbgi_key, &dbgi_key)) { - line_info = &n->v; + line = &n->v; break; } } - if(line_info != 0) + if(line != 0) { - Rng1U64 line_voff_rng = line_info->voff_range; + Rng1U64 line_voff_rng = line->voff_range; Vec4F32 weak_thread_color = color; weak_thread_color.w *= 0.4f; F32 progress_t = (line_voff_rng.max != line_voff_rng.min) ? ((F32)(thread_rip_voff - line_voff_rng.min) / (F32)(line_voff_rng.max - line_voff_rng.min)) : 0; @@ -11086,17 +11167,20 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ DF_BreakpointBoxDrawExtData *bp_draw = push_array(ui_build_arena(), DF_BreakpointBoxDrawExtData, 1); { bp_draw->color = bp_color; - DF_TextLineSrc2DasmInfoList *src2dasm_list = ¶ms->line_src2dasm[line_idx]; - for(DF_TextLineSrc2DasmInfoNode *n = src2dasm_list->first; n != 0; n = n->next) + bp_draw->alive_t = bp->alive_t; + if(code_ctx->file != &df_g_nil_entity) { - S64 remap_line = (S64)n->v.remap_line; - if(remap_line != line_num) + DF_LineList *lines = ¶ms->line_infos[line_idx]; + for(DF_LineNode *n = lines->first; n != 0; n = n->next) { - bp_draw->remap_px_delta = (remap_line - line_num) * params->line_height_px; - break; + S64 remap_line = n->v.pt.line; + if(remap_line != line_num) + { + bp_draw->remap_px_delta = (remap_line - line_num) * params->line_height_px; + break; + } } } - bp_draw->alive_t = bp->alive_t; } // rjf: build box for breakpoint @@ -11248,33 +11332,17 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ // rjf: line info on this line -> adjust bg color to visualize B32 has_line_info = 0; { + U64 best_stamp = 0; S64 line_info_line_num = 0; - F32 line_info_t = 0; - DF_TextLineSrc2DasmInfoList *src2dasm_list = ¶ms->line_src2dasm[line_idx]; - DF_TextLineDasm2SrcInfoList *dasm2src_list = ¶ms->line_dasm2src[line_idx]; - if(src2dasm_list->first != 0) + F32 line_info_t = selected_thread_module->alive_t; + DF_LineList *lines = ¶ms->line_infos[line_idx]; + for(DF_LineNode *n = lines->first; n != 0; n = n->next) { - has_line_info = (src2dasm_list->first->v.remap_line == line_num); - line_info_line_num = line_num; - line_info_t = selected_thread_module->alive_t; - } - if(dasm2src_list->first != 0) - { - DF_TextLineDasm2SrcInfo *dasm2src_info = 0; - U64 best_stamp = 0; - for(DF_TextLineDasm2SrcInfoNode *n = dasm2src_list->first; n != 0; n = n->next) + if(n->v.dbgi_key.min_timestamp >= best_stamp) { - if(n->v.file->timestamp > best_stamp) - { - dasm2src_info = &n->v; - best_stamp = n->v.file->timestamp; - } - } - if(dasm2src_info != 0) - { - has_line_info = 1; - line_info_line_num = dasm2src_info->pt.line; - line_info_t = selected_thread_module->alive_t; + has_line_info = (n->v.pt.line == line_num || code_ctx->file == &df_g_nil_entity); + line_info_line_num = n->v.pt.line; + best_stamp = n->v.dbgi_key.min_timestamp; } } if(has_line_info) @@ -11575,42 +11643,26 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ *preferred_column = cursor->column; } - //- rjf: right-click => active context menu for line + //- rjf: right-click => code context menu if(ui_right_clicked(text_container_sig)) { - S64 line_idx = mouse_pt.line-params->line_num_range.min; - if(0 <= line_idx && line_idx < dim_1s64(params->line_num_range)) + if(txt_pt_match(*cursor, *mark)) { - ui_ctx_menu_open(ctx_menu_keys[line_idx], ui_key_zero(), sub_2f32(ui_mouse(), v2f32(2, 2))); - if(txt_pt_match(*cursor, *mark)) - { - *cursor = *mark = mouse_pt; - } + *cursor = *mark = mouse_pt; } - } - - //- rjf: hovering text container & ctrl+scroll -> change font size - if(ui_hovering(text_container_sig)) - { - UI_EventList *events = ui_events(); - for(UI_EventNode *n = events->first, *next = 0; n != 0; n = next) + ui_ctx_menu_open(ws->code_ctx_menu_key, ui_key_zero(), sub_2f32(ui_mouse(), v2f32(2, 2))); + arena_clear(ws->code_ctx_menu_arena); + ws->code_ctx_menu_file = df_handle_from_entity(code_ctx->file); + ws->code_ctx_menu_text_key = code_ctx->text_key; + ws->code_ctx_menu_lang_kind = code_ctx->lang_kind; + ws->code_ctx_menu_range = txt_rng(*cursor, *mark); + if(params->line_num_range.min <= cursor->line && cursor->line < params->line_num_range.max) { - next = n->next; - UI_Event *event = &n->v; - if(event->kind == UI_EventKind_Scroll && event->modifiers & OS_EventFlag_Ctrl) - { - ui_eat_event(events, n); - if(event->delta_2f32.y < 0) - { - DF_CmdParams params = df_cmd_params_from_window(ws); - df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_IncCodeFontScale)); - } - else if(event->delta_2f32.y > 0) - { - DF_CmdParams params = df_cmd_params_from_window(ws); - df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_DecCodeFontScale)); - } - } + ws->code_ctx_menu_vaddr = params->line_vaddrs[cursor->line - params->line_num_range.min]; + } + if(params->line_num_range.min <= cursor->line && cursor->line < params->line_num_range.max) + { + ws->code_ctx_menu_lines = df_line_list_copy(ws->code_ctx_menu_arena, ¶ms->line_infos[cursor->line - params->line_num_range.min]); } } @@ -11629,6 +11681,8 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ } //- rjf: drop target is dropped -> process + // TODO(rjf): @src_collapse +#if 0 { DF_DragDropPayload payload = {0}; if(!df_entity_is_nil(line_drag_entity) && df_drag_drop(&payload)) @@ -11637,6 +11691,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ result.dropped_entity_line_num = mouse_pt.line; } } +#endif //- rjf: commit text container signal to main output result.base = text_container_sig; @@ -11645,6 +11700,8 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ ////////////////////////////// //- rjf: mouse -> expression range info // + TxtRng mouse_expr_rng = {0}; + Vec2F32 mouse_expr_baseline_pos = {0}; if(ui_hovering(text_container_sig) && contains_1s64(params->line_num_range, mouse_pt.line)) ProfScope("mouse -> expression range") { TxtRng selected_rng = txt_rng(*cursor, *mark); @@ -11655,9 +11712,9 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ U64 line_slice_idx = mouse_pt.line-params->line_num_range.min; String8 line_text = params->line_text[line_slice_idx]; F32 expr_hoff_px = params->line_num_width_px + f_dim_from_tag_size_string(params->font, params->font_size, 0, params->tab_size, str8_prefix(line_text, selected_rng.min.column-1)).x; - result.mouse_expr_rng = selected_rng; - result.mouse_expr_baseline_pos = v2f32(text_container_box->rect.x0+expr_hoff_px, - text_container_box->rect.y0+line_slice_idx*params->line_height_px + params->line_height_px*0.85f); + result.mouse_expr_rng = mouse_expr_rng = selected_rng; + result.mouse_expr_baseline_pos = mouse_expr_baseline_pos = v2f32(text_container_box->rect.x0+expr_hoff_px, + text_container_box->rect.y0+line_slice_idx*params->line_height_px + params->line_height_px*0.85f); } else { @@ -11670,9 +11727,9 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ if(expr_off_rng.max != expr_off_rng.min) { F32 expr_hoff_px = params->line_num_width_px + f_dim_from_tag_size_string(params->font, params->font_size, 0, params->tab_size, str8_prefix(line_text, expr_off_rng.min-line_range.min)).x; - result.mouse_expr_rng = txt_rng(txt_pt(mouse_pt.line, 1+(expr_off_rng.min-line_range.min)), txt_pt(mouse_pt.line, 1+(expr_off_rng.max-line_range.min))); - result.mouse_expr_baseline_pos = v2f32(text_container_box->rect.x0+expr_hoff_px, - text_container_box->rect.y0+line_slice_idx*params->line_height_px + params->line_height_px*0.85f); + result.mouse_expr_rng = mouse_expr_rng = txt_rng(txt_pt(mouse_pt.line, 1+(expr_off_rng.min-line_range.min)), txt_pt(mouse_pt.line, 1+(expr_off_rng.max-line_range.min))); + result.mouse_expr_baseline_pos = mouse_expr_baseline_pos = v2f32(text_container_box->rect.x0+expr_hoff_px, + text_container_box->rect.y0+line_slice_idx*params->line_height_px + params->line_height_px*0.85f); } } } @@ -11683,29 +11740,38 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ if(ui_hovering(text_container_sig) && contains_1s64(params->line_num_range, mouse_pt.line) && (ui_mouse().x - text_container_box->rect.x0 < params->line_num_width_px + line_num_padding_px)) { U64 line_slice_idx = mouse_pt.line-params->line_num_range.min; - if(params->line_src2dasm[line_slice_idx].first != 0 && - params->line_src2dasm[line_slice_idx].first->v.remap_line == mouse_pt.line) + DF_LineList *lines = ¶ms->line_infos[line_slice_idx]; + if(lines->first != 0 && (code_ctx->file == &df_g_nil_entity || lines->first->v.pt.line == mouse_pt.line)) { DF_RichHoverInfo info = {0}; info.process = df_handle_from_entity(selected_thread_process); - info.vaddr_range = df_vaddr_range_from_voff_range(selected_thread_module, params->line_src2dasm[line_slice_idx].first->v.voff_range); + info.vaddr_range = df_vaddr_range_from_voff_range(selected_thread_module, lines->first->v.voff_range); info.module = df_handle_from_entity(selected_thread_module); - info.dbgi_key = params->line_src2dasm[line_slice_idx].first->v.dbgi_key; - info.voff_range = params->line_src2dasm[line_slice_idx].first->v.voff_range; - df_set_rich_hover_info(&info); - } - if(params->line_dasm2src[line_slice_idx].first != 0) - { - DF_RichHoverInfo info = {0}; - info.process = df_handle_from_entity(selected_thread_process); - info.vaddr_range = df_vaddr_range_from_voff_range(selected_thread_module, params->line_dasm2src[line_slice_idx].first->v.voff_range); - info.module = df_handle_from_entity(selected_thread_module); - info.dbgi_key = params->line_dasm2src[line_slice_idx].first->v.dbgi_key; - info.voff_range = params->line_dasm2src[line_slice_idx].first->v.voff_range; + info.dbgi_key = lines->first->v.dbgi_key; + info.voff_range = lines->first->v.voff_range; df_set_rich_hover_info(&info); } } + ////////////////////////////// + //- rjf: hover eval + // +#if 0 + if(!ui_dragging(text_container_sig) && sig.mouse_expr_rng.min.line != 0 && sig.base.event_flags == 0) + { + TxtRng expr_rng = mouse_expr_rng; + String8 expr = txt_string_from_info_data_txt_rng(&text_info, data, expr_rng); + if(expr.size != 0) + { + DF_Eval eval = df_eval_from_string(scratch.arena, di_scope, &ctrl_ctx, &parse_ctx, &eval_string2expr_map_nil, expr); + if(eval.mode != EVAL_EvalMode_NULL) + { + df_set_hover_eval(ws, mouse_expr_baseline_pos, ctrl_ctx, entity, sig.mouse_pt, 0, expr); + } + } + } +#endif + ////////////////////////////// //- rjf: dragging entity which applies to lines over this slice -> visualize // @@ -12048,37 +12114,16 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ { B32 matches = 0; S64 line_info_line_num = 0; - DF_TextLineSrc2DasmInfoList *src2dasm_list = ¶ms->line_src2dasm[line_idx]; - DF_TextLineDasm2SrcInfoList *dasm2src_list = ¶ms->line_dasm2src[line_idx]; - - // rjf: check src2dasm - if(src2dasm_list->first != 0) + DF_LineList *lines = ¶ms->line_infos[line_idx]; + for(DF_LineNode *n = lines->first; n != 0; n = n->next) { - for(DF_TextLineSrc2DasmInfoNode *n = src2dasm_list->first; n != 0; n = n->next) + if((n->v.pt.line == line_num || code_ctx->file == &df_g_nil_entity) && + di_key_match(&n->v.dbgi_key, &hovered_line_dbgi_key) && + n->v.voff_range.min <= hovered_line_voff && hovered_line_voff < n->v.voff_range.max) { - if(n->v.remap_line == line_num && - di_key_match(&n->v.dbgi_key, &hovered_line_dbgi_key) && - n->v.voff_range.min <= hovered_line_voff && hovered_line_voff < n->v.voff_range.max) - { - matches = 1; - line_info_line_num = line_num; - break; - } - } - } - - // rjf: check dasm2src - if(dasm2src_list->first != 0) - { - for(DF_TextLineDasm2SrcInfoNode *n = dasm2src_list->first; n != 0; n = n->next) - { - if(n->v.voff_range.min <= hovered_line_voff && - hovered_line_voff < n->v.voff_range.max) - { - line_info_line_num = n->v.pt.line; - matches = 1; - break; - } + matches = 1; + line_info_line_num = n->v.pt.line; + break; } } @@ -12108,13 +12153,13 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ } 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, ...) +df_code_slicef(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_CodeCtx *code_ctx, DF_CodeSliceParams *params, TxtPt *cursor, TxtPt *mark, S64 *preferred_column, char *fmt, ...) { Temp scratch = scratch_begin(0, 0); va_list args; va_start(args, fmt); String8 string = push_str8fv(scratch.arena, fmt, args); - DF_CodeSliceSignal sig = df_code_slice(ws, ctrl_ctx, parse_ctx, params, cursor, mark, preferred_column, string); + DF_CodeSliceSignal sig = df_code_slice(ws, ctrl_ctx, parse_ctx, code_ctx, params, cursor, mark, preferred_column, string); va_end(args); scratch_end(scratch); return sig; @@ -13414,6 +13459,7 @@ df_gfx_begin_frame(Arena *arena, DF_CmdList *cmds) r_window_unequip(ws->os, ws->r); os_window_close(ws->os); arena_release(ws->query_cmd_arena); + arena_release(ws->code_ctx_menu_arena); arena_release(ws->hover_eval_arena); arena_release(ws->autocomp_lister_params_arena); arena_release(ws->arena); diff --git a/src/df/gfx/df_gfx.h b/src/df/gfx/df_gfx.h index 337fe601..afe3e7ab 100644 --- a/src/df/gfx/df_gfx.h +++ b/src/df/gfx/df_gfx.h @@ -432,6 +432,14 @@ enum DF_CodeSliceFlag_LineNums = (1<<3), }; +typedef struct DF_CodeCtx DF_CodeCtx; +struct DF_CodeCtx +{ + DF_Entity *file; // the source file, if any, from which the code was derived + U128 text_key; // the text info cache key for the backing textual data + TXT_LangKind lang_kind; // the language for which the text is parsed/analyzed +}; + typedef struct DF_CodeSliceParams DF_CodeSliceParams; struct DF_CodeSliceParams { @@ -444,8 +452,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 @@ -570,10 +578,14 @@ struct DF_Window B32 menu_bar_focus_press_started; // rjf: code context menu state + Arena *code_ctx_menu_arena; UI_Key code_ctx_menu_key; - DF_Handle code_ctx_menu_entity; + 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; @@ -620,6 +632,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; @@ -1071,8 +1084,8 @@ internal void df_entity_src_loc_button(DF_Window *ws, DF_Entity *entity, TxtPt p internal UI_BOX_CUSTOM_DRAW(df_thread_box_draw_extensions); internal UI_BOX_CUSTOM_DRAW(df_bp_box_draw_extensions); -internal DF_CodeSliceSignal df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_CodeSliceParams *params, TxtPt *cursor, TxtPt *mark, S64 *preferred_column, String8 string); -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 DF_CodeSliceSignal df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_CodeCtx *code_ctx, DF_CodeSliceParams *params, TxtPt *cursor, TxtPt *mark, S64 *preferred_column, String8 string); +internal DF_CodeSliceSignal df_code_slicef(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_CodeCtx *code_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); diff --git a/src/df/gfx/df_view_rules.c b/src/df/gfx/df_view_rules.c index 8939cb36..15a34f0c 100644 --- a/src/df/gfx/df_view_rules.c +++ b/src/df/gfx/df_view_rules.c @@ -537,9 +537,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)); @@ -558,8 +559,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]); @@ -591,7 +592,8 @@ DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(text) //- rjf: build code slice UI_WidthFill UI_HeightFill UI_Parent(container) { - DF_CodeSliceSignal slice_sig = df_code_slice(ws, ctrl_ctx, parse_ctx, &code_slice_params, &state->cursor, &state->mark, &state->preferred_column, str8_lit("###slice")); + DF_CodeCtx code_ctx = {&df_g_nil_entity, text_key, top.lang}; + DF_CodeSliceSignal slice_sig = df_code_slice(ws, ctrl_ctx, parse_ctx, &code_ctx, &code_slice_params, &state->cursor, &state->mark, &state->preferred_column, str8_lit("###slice")); } } @@ -697,11 +699,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; @@ -720,8 +723,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); @@ -742,7 +745,8 @@ DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(disasm) if(dasm_info.insts.count != 0 && dasm_text_info.lines_count != 0) UI_Padding(ui_pct(1, 0)) UI_PrefWidth(ui_px(dasm_text_info.lines_max_size*ui_top_font_size()*1.2f, 1.f)) UI_Column UI_Padding(ui_pct(1, 0)) { - DF_CodeSliceSignal sig = df_code_slice(ws, ctrl_ctx, parse_ctx, &code_slice_params, &state->cursor, &state->mark, &state->preferred_column, str8_lit("###code_slice")); + DF_CodeCtx code_ctx = {&df_g_nil_entity, dasm_info.text_key, lang_kind}; + DF_CodeSliceSignal sig = df_code_slice(ws, ctrl_ctx, parse_ctx, &code_ctx, &code_slice_params, &state->cursor, &state->mark, &state->preferred_column, str8_lit("###code_slice")); } } dasm_scope_close(dasm_scope); diff --git a/src/df/gfx/df_views.c b/src/df/gfx/df_views.c index 52b35955..2a7d9eaf 100644 --- a/src/df/gfx/df_views.c +++ b/src/df/gfx/df_views.c @@ -387,7 +387,7 @@ 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 data, TXT_TextInfo *info) +df_code_view_cmds(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewState *cv, DF_CmdList *cmds, String8 data, TXT_TextInfo *info, DF_CodeCtx *code_ctx) { for(DF_CmdNode *n = cmds->first; n != 0; n = n->next) { @@ -499,7 +499,7 @@ df_code_view_cmds(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewStat } internal void -df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewState *cv, Rng2F32 rect, String8 data, TXT_TextInfo *info) +df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewState *cv, Rng2F32 rect, String8 data, TXT_TextInfo *info, DF_CodeCtx *code_ctx) { ProfBeginFunction(); Temp scratch = scratch_begin(0, 0); @@ -603,8 +603,8 @@ df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewSta code_slice_params.line_bps = push_array(scratch.arena, DF_EntityList, visible_line_count); code_slice_params.line_ips = push_array(scratch.arena, DF_EntityList, visible_line_count); code_slice_params.line_pins = push_array(scratch.arena, DF_EntityList, visible_line_count); - code_slice_params.line_dasm2src = push_array(scratch.arena, DF_TextLineDasm2SrcInfoList, visible_line_count); - code_slice_params.line_src2dasm = push_array(scratch.arena, DF_TextLineSrc2DasmInfoList, visible_line_count); + code_slice_params.line_vaddrs = push_array(scratch.arena, U64, visible_line_count); + code_slice_params.line_infos = push_array(scratch.arena, DF_LineList, visible_line_count); code_slice_params.font = code_font; code_slice_params.font_size = code_font_size; code_slice_params.tab_size = code_tab_size; @@ -627,6 +627,73 @@ df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewSta code_slice_params.line_tokens[visible_line_idx] = slice.line_tokens[visible_line_idx]; } } + + // rjf: find visible breakpoints + ProfScope("find visible breakpoints") + { + for(DF_Entity *bp = code_ctx->file->first; !df_entity_is_nil(bp); bp = bp->next) + { + if(bp->deleted || bp->kind != DF_EntityKind_Breakpoint) { continue; } + if(visible_line_num_range.min <= bp->text_point.line && bp->text_point.line <= visible_line_num_range.max) + { + U64 slice_line_idx = (bp->text_point.line-visible_line_num_range.min); + df_entity_list_push(scratch.arena, &code_slice_params.line_bps[slice_line_idx], bp); + } + } + } + + // rjf: find live threads mapping to this file + ProfScope("find live threads mapping to this file") + { + DF_Entity *selected_thread = df_entity_from_handle(ctrl_ctx.thread); + DF_EntityList threads = df_query_cached_entity_list_with_kind(DF_EntityKind_Thread); + for(DF_EntityNode *thread_n = threads.first; thread_n != 0; thread_n = thread_n->next) + { + DF_Entity *thread = thread_n->entity; + DF_Entity *process = df_entity_ancestor_from_kind(thread, DF_EntityKind_Process); + U64 base_unwind_count = (thread == selected_thread) ? ctrl_ctx.unwind_count : 0; + U64 inline_unwind_count = (thread == selected_thread) ? ctrl_ctx.inline_unwind_count : 0; + U64 rip_vaddr = df_query_cached_rip_from_thread_unwind(thread, unwind_count); + U64 last_inst_on_unwound_rip_vaddr = rip_vaddr - !!unwind_count; + DF_Entity *module = df_module_from_process_vaddr(process, last_inst_on_unwound_rip_vaddr); + U64 rip_voff = df_voff_from_vaddr(module, last_inst_on_unwound_rip_vaddr); + DI_Key dbgi_key = df_dbgi_key_from_module(module); + DF_LineList lines = df_lines_from_dbgi_key_voff(scratch.arena, &dbgi_key, rip_voff); + for(DF_LineNode *n = lines.first; n != 0; n = n->next) + { + if(df_entity_from_handle(n->v.file) == code_ctx->file && visible_line_num_range.min <= n->v.pt.line && n->v.pt.line <= visible_line_num_range.max) + { + U64 slice_line_idx = lines.first->v.pt.line-visible_line_num_range.min; + df_entity_list_push(scratch.arena, &code_slice_params.line_ips[slice_line_idx], thread); + } + } + } + } + + // rjf: find visible watch pins + ProfScope("find visible watch pins") + { + for(DF_Entity *wp = code_ctx->file->first; !df_entity_is_nil(wp); wp = wp->next) + { + if(wp->deleted || wp->kind != DF_EntityKind_WatchPin) { continue; } + if(visible_line_num_range.min <= wp->text_point.line && wp->text_point.line <= visible_line_num_range.max) + { + U64 slice_line_idx = (wp->text_point.line-visible_line_num_range.min); + df_entity_list_push(scratch.arena, &code_slice_params.line_pins[slice_line_idx], wp); + } + } + } + + // rjf: find all src -> dasm info + ProfScope("find all src -> dasm info") + { + DF_LineListArray lines_array = df_lines_array_from_file_line_range(scratch.arena, code_ctx->file, visible_line_num_range); + if(lines_array.count != 0) + { + MemoryCopy(code_slice_params.line_infos, lines_array.v, sizeof(DF_LineList)*lines_array.count); + } + code_slice_params.relevant_dbgi_keys = lines_array.dbgi_keys; + } } ////////////////////////////// @@ -819,7 +886,7 @@ df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewSta DF_CodeSliceSignal sig = {0}; UI_Focus(UI_FocusKind_On) { - sig = df_code_slicef(ws, &ctrl_ctx, &parse_ctx, &code_slice_params, &cv->cursor, &cv->mark, &cv->preferred_column, "txt_view_%p", view); + sig = df_code_slicef(ws, &ctrl_ctx, &parse_ctx, code_ctx, &code_slice_params, &cv->cursor, &cv->mark, &cv->preferred_column, "txt_view_%p", view); } //- rjf: press code slice? -> focus panel @@ -852,13 +919,6 @@ df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewSta df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_GoToName)); } - //- rjf: copy text - if(!txt_pt_match(sig.copy_range.min, sig.copy_range.max)) - { - String8 text = txt_string_from_info_data_txt_rng(info, data, sig.copy_range); - os_set_clipboard_text(text); - } - //- rjf: selected text on single line, no query? -> set search text if(!txt_pt_match(cv->cursor, cv->mark) && cv->cursor.line == cv->mark.line && search_query.size == 0) { @@ -866,22 +926,9 @@ df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewSta df_set_search_string(text); } - //- rjf: toggle cursor watch - if(sig.toggle_cursor_watch) - { - DF_CmdParams params = df_cmd_params_from_view(ws, panel, view); - df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_ToggleWatchExpressionAtCursor)); - } - - //- rjf: set next statement - if(sig.set_next_statement_line_num != 0 && contains_1s64(visible_line_num_range, sig.set_next_statement_line_num)) - { - DF_CmdParams params = df_cmd_params_from_view(ws, panel, view); - params.text_point = txt_pt(sig.set_next_statement_line_num, 1); - df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_SetNextStatement)); - } - //- rjf: go to disasm + // TODO(rjf): @src_collapse +#if 0 if(sig.goto_disasm_line_num != 0 && contains_1s64(visible_line_num_range, sig.goto_disasm_line_num)) { U64 line_idx = (sig.goto_disasm_line_num-visible_line_num_range.min); @@ -911,6 +958,7 @@ df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewSta } } } +#endif } ////////////////////////////// @@ -1038,6 +1086,29 @@ df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewSta } ui_scroll_pt_clamp_idx(&view->scroll_pos.x, scroll_idx_rng[Axis2_X]); ui_scroll_pt_clamp_idx(&view->scroll_pos.y, scroll_idx_rng[Axis2_Y]); + if(ui_mouse_over(sig)) + { + UI_EventList *events = ui_events(); + for(UI_EventNode *n = events->first, *next = 0; n != 0; n = next) + { + next = n->next; + UI_Event *event = &n->v; + if(event->kind == UI_EventKind_Scroll && event->modifiers & OS_EventFlag_Ctrl) + { + ui_eat_event(events, n); + if(event->delta_2f32.y < 0) + { + DF_CmdParams params = df_cmd_params_from_window(ws); + df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_IncCodeFontScale)); + } + else if(event->delta_2f32.y > 0) + { + DF_CmdParams params = df_cmd_params_from_window(ws); + df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_DecCodeFontScale)); + } + } + } + } } txt_scope_close(txt_scope); @@ -4076,15 +4147,15 @@ DF_VIEW_UI_FUNCTION_DEF(SymbolLister) } if(ui_hovering(sig)) UI_Tooltip { - U64 binary_voff = df_voff_from_dbgi_key_symbol_name(&dbgi_key, name); - DF_TextLineDasm2SrcInfo dasm2src_info = df_text_line_dasm2src_info_from_dbgi_key_voff(&dbgi_key, binary_voff, 0); - String8 file_path = df_full_path_from_entity(scratch.arena, dasm2src_info.file); - S64 line_num = dasm2src_info.pt.line; df_code_label(1.f, 0, df_rgba_from_theme_color(DF_ThemeColor_CodeSymbol), name); UI_Font(df_font_from_slot(DF_FontSlot_Main)) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_labelf("Procedure #%I64u", item->idx); - if(!df_entity_is_nil(dasm2src_info.file)) + U64 binary_voff = df_voff_from_dbgi_key_symbol_name(&dbgi_key, name); + DF_LineList lines = df_lines_from_dbgi_key_voff(scratch.arena, &dbgi_key, binary_voff); + if(lines.first != 0) { + String8 file_path = df_full_path_from_entity(scratch.arena, df_entity_from_handle(lines.first->v.file)); + S64 line_num = lines.first->v.pt.line; UI_Font(df_font_from_slot(DF_FontSlot_Main)) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_labelf("%S:%I64d", file_path, line_num); } @@ -5460,10 +5531,14 @@ DF_VIEW_UI_FUNCTION_DEF(Scheduler) DF_Entity *module = df_module_from_process_vaddr(process, rip_vaddr); U64 rip_voff = df_voff_from_vaddr(module, rip_vaddr); DI_Key dbgi_key = df_dbgi_key_from_module(module); - DF_TextLineDasm2SrcInfo line_info = df_text_line_dasm2src_info_from_dbgi_key_voff(&dbgi_key, rip_voff, 0); - if(!df_entity_is_nil(line_info.file)) + DF_LineList lines = df_lines_from_dbgi_key_voff(scratch.arena, &dbgi_key, rip_voff); + if(lines.first != 0) { - UI_PrefWidth(ui_children_sum(0)) df_entity_src_loc_button(ws, line_info.file, line_info.pt); + DF_Entity *file = df_entity_from_handle(lines.first->v.file); + if(!df_entity_is_nil(file)) + { + UI_PrefWidth(ui_children_sum(0)) df_entity_src_loc_button(ws, file, lines.first->v.pt); + } } } }break; @@ -6191,7 +6266,7 @@ DF_VIEW_UI_FUNCTION_DEF(PendingEntity) //////////////////////////////// //~ rjf: Code @view_hook_impl -#if 0 +#if 1 DF_VIEW_SETUP_FUNCTION_DEF(Code) { // rjf: set up state @@ -6229,13 +6304,15 @@ DF_VIEW_CMD_FUNCTION_DEF(Code) Temp scratch = scratch_begin(0, 0); HS_Scope *hs_scope = hs_scope_open(); TXT_Scope *txt_scope = txt_scope_open(); - String8 path = df_full_path_from_entity(scratch.arena, df_entity_from_handle(view->entity)); + DF_Entity *entity = df_entity_from_handle(view->entity); + String8 path = df_full_path_from_entity(scratch.arena, entity); TXT_LangKind lang_kind = txt_lang_kind_from_extension(str8_skip_last_dot(path)); U128 key = fs_key_from_path(path); U128 hash = {0}; TXT_TextInfo info = txt_text_info_from_key_lang(txt_scope, key, lang_kind, &hash); String8 data = hs_data_from_hash(hs_scope, hash); - df_code_view_cmds(ws, panel, view, cv, cmds, data, &info); + DF_CodeCtx code_ctx = {entity, key, lang_kind}; + df_code_view_cmds(ws, panel, view, cv, cmds, data, &info, &code_ctx); txt_scope_close(txt_scope); hs_scope_close(hs_scope); scratch_end(scratch); @@ -6321,7 +6398,8 @@ DF_VIEW_UI_FUNCTION_DEF(Code) // if(!entity_is_missing && key_has_data) { - df_code_view_build(ws, panel, view, cv, code_area_rect, data, &info); + DF_CodeCtx code_ctx = {entity, key, lang_kind}; + df_code_view_build(ws, panel, view, cv, code_area_rect, data, &info, &code_ctx); } ////////////////////////////// @@ -6377,9 +6455,9 @@ DF_VIEW_UI_FUNCTION_DEF(Code) } #endif -//~ TODO(rjf): OLD vvvvvvvv +//~ TODO(rjf): OLD vvvvvvvv @src_collapse -#if 1 +#if 0 DF_VIEW_SETUP_FUNCTION_DEF(Code) { // rjf: set up state @@ -6744,6 +6822,7 @@ DF_VIEW_UI_FUNCTION_DEF(Code) code_slice_params.line_bps = push_array(scratch.arena, DF_EntityList, visible_line_count); code_slice_params.line_ips = push_array(scratch.arena, DF_EntityList, visible_line_count); code_slice_params.line_pins = push_array(scratch.arena, DF_EntityList, visible_line_count); + code_slice_params.line_vaddrs = push_array(scratch.arena, U64, visible_line_count); code_slice_params.line_dasm2src = push_array(scratch.arena, DF_TextLineDasm2SrcInfoList, visible_line_count); code_slice_params.line_src2dasm = push_array(scratch.arena, DF_TextLineSrc2DasmInfoList, visible_line_count); code_slice_params.font = code_font; @@ -7761,8 +7840,9 @@ DF_VIEW_UI_FUNCTION_DEF(Disassembly) dasm_params.dbgi_key = dasm_dbgi_key; } DASM_Info dasm_info = dasm_info_from_key_params(dasm_scope, dasm_key, &dasm_params, &dasm_data_hash); + TXT_LangKind lang_kind = txt_lang_kind_from_architecture(arch); U128 dasm_text_hash = {0}; - TXT_TextInfo dasm_text_info = txt_text_info_from_key_lang(txt_scope, dasm_info.text_key, txt_lang_kind_from_architecture(arch), &dasm_text_hash); + TXT_TextInfo dasm_text_info = txt_text_info_from_key_lang(txt_scope, dasm_info.text_key, lang_kind, &dasm_text_hash); String8 dasm_text_data = hs_data_from_hash(hs_scope, dasm_text_hash); B32 has_disasm = (dasm_info.insts.count != 0 && dasm_text_info.lines_count != 0); B32 is_loading = (!has_disasm && !df_entity_is_nil(process) && dim_1u64(dasm_vaddr_range) != 0); @@ -7846,8 +7926,8 @@ DF_VIEW_UI_FUNCTION_DEF(Disassembly) code_slice_params.line_bps = push_array(scratch.arena, DF_EntityList, visible_line_count); code_slice_params.line_ips = push_array(scratch.arena, DF_EntityList, visible_line_count); code_slice_params.line_pins = push_array(scratch.arena, DF_EntityList, visible_line_count); - code_slice_params.line_dasm2src = push_array(scratch.arena, DF_TextLineDasm2SrcInfoList, visible_line_count); - code_slice_params.line_src2dasm = push_array(scratch.arena, DF_TextLineSrc2DasmInfoList, visible_line_count); + code_slice_params.line_vaddrs = push_array(scratch.arena, U64, visible_line_count); + code_slice_params.line_infos = push_array(scratch.arena, DF_LineList, visible_line_count); code_slice_params.font = code_font; code_slice_params.font_size = code_font_size; code_slice_params.tab_size = code_tab_size; @@ -7858,7 +7938,6 @@ DF_VIEW_UI_FUNCTION_DEF(Disassembly) code_slice_params.line_num_width_px = line_num_width_px; code_slice_params.line_text_max_width_px = (F32)line_size_x; code_slice_params.margin_float_off_px = view->scroll_pos.x.idx + view->scroll_pos.x.off; - di_key_list_push(scratch.arena, &code_slice_params.relevant_dbgi_keys, &dbgi_key); // rjf: fill text info @@ -7947,10 +8026,8 @@ DF_VIEW_UI_FUNCTION_DEF(Disassembly) U64 vaddr = dasm_vaddr_range.min + dasm_inst_array_code_off_from_idx(&dasm_info.insts, line_num-1); U64 voff = df_voff_from_vaddr(module, vaddr); U64 slice_idx = line_num-visible_line_num_range.min; - DF_TextLineDasm2SrcInfoNode *dasm2src_n = push_array(scratch.arena, DF_TextLineDasm2SrcInfoNode, 1); - SLLQueuePush(code_slice_params.line_dasm2src[slice_idx].first, code_slice_params.line_dasm2src[slice_idx].last, dasm2src_n); - code_slice_params.line_dasm2src[slice_idx].count += 1; - dasm2src_n->v = df_text_line_dasm2src_info_from_dbgi_key_voff(&dbgi_key, voff, 0); + code_slice_params.line_vaddrs[slice_idx] = vaddr; + code_slice_params.line_infos[slice_idx] = df_lines_from_dbgi_key_voff(scratch.arena, &dbgi_key, voff); } } } @@ -8010,7 +8087,8 @@ DF_VIEW_UI_FUNCTION_DEF(Disassembly) DF_CodeSliceSignal sig = {0}; UI_Focus(UI_FocusKind_On) { - sig = df_code_slicef(ws, &ctrl_ctx, &parse_ctx, &code_slice_params, &dv->cursor, &dv->mark, &dv->preferred_column, "dasm_slice_%p", view); + DF_CodeCtx code_ctx = {&df_g_nil_entity, dasm_info.text_key, lang_kind}; + sig = df_code_slicef(ws, &ctrl_ctx, &parse_ctx, &code_ctx, &code_slice_params, &dv->cursor, &dv->mark, &dv->preferred_column, "dasm_slice_%p", view); } //- rjf: hover eval @@ -8129,14 +8207,17 @@ DF_VIEW_UI_FUNCTION_DEF(Disassembly) DF_Entity *module = df_module_from_process_vaddr(process, vaddr); DI_Key dbgi_key = df_dbgi_key_from_module(module); U64 voff = df_voff_from_vaddr(module, vaddr); - DF_TextLineDasm2SrcInfo dasm2src = df_text_line_dasm2src_info_from_dbgi_key_voff(&dbgi_key, voff, 0); - String8 file_path = df_full_path_from_entity(scratch.arena, dasm2src.file); - DF_CmdParams params = df_cmd_params_from_view(ws, panel, view); - params.text_point = dasm2src.pt; - params.file_path = file_path; - df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_TextPoint); - df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_FilePath); - df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_FindCodeLocation)); + DF_LineList lines = df_lines_from_dbgi_key_voff(scratch.arena, &dbgi_key, voff); + if(lines.first != 0) + { + String8 file_path = df_full_path_from_entity(scratch.arena, df_entity_from_handle(lines.first->v.file)); + DF_CmdParams params = df_cmd_params_from_view(ws, panel, view); + params.text_point = lines.first->v.pt; + params.file_path = file_path; + df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_TextPoint); + df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_FilePath); + df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_FindCodeLocation)); + } } } @@ -8485,6 +8566,103 @@ DF_VIEW_UI_FUNCTION_DEF(Procedures) //////////////////////////////// //~ rjf: Output @view_hook_impl +#if 1 +DF_VIEW_SETUP_FUNCTION_DEF(Output) +{ + DF_CodeViewState *cv = df_view_user_state(view, DF_CodeViewState); + df_code_view_init(cv, view); +} + +DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(Output) +{ + return str8_zero(); +} + +DF_VIEW_CMD_FUNCTION_DEF(Output) +{ + DF_CodeViewState *cv = df_view_user_state(view, DF_CodeViewState); + Temp scratch = scratch_begin(0, 0); + HS_Scope *hs_scope = hs_scope_open(); + TXT_Scope *txt_scope = txt_scope_open(); + U128 key = df_state->output_log_key; + TXT_LangKind lang_kind = TXT_LangKind_Null; + U128 hash = {0}; + TXT_TextInfo info = txt_text_info_from_key_lang(txt_scope, key, lang_kind, &hash); + String8 data = hs_data_from_hash(hs_scope, hash); + DF_CodeCtx code_ctx = {&df_g_nil_entity, key, lang_kind}; + df_code_view_cmds(ws, panel, view, cv, cmds, data, &info, &code_ctx); + txt_scope_close(txt_scope); + hs_scope_close(hs_scope); + scratch_end(scratch); +} + +DF_VIEW_UI_FUNCTION_DEF(Output) +{ + DF_CodeViewState *cv = df_view_user_state(view, DF_CodeViewState); + Temp scratch = scratch_begin(0, 0); + HS_Scope *hs_scope = hs_scope_open(); + TXT_Scope *txt_scope = txt_scope_open(); + + ////////////////////////////// + //- rjf: set up invariants + // + F32 bottom_bar_height = ui_top_font_size()*2.f; + Rng2F32 code_area_rect = r2f32p(rect.x0, rect.y0, rect.x1, rect.y1 - bottom_bar_height); + Rng2F32 bottom_bar_rect = r2f32p(rect.x0, rect.y1 - bottom_bar_height, rect.x1, rect.y1); + + ////////////////////////////// + //- rjf: unpack text info + // + U128 key = df_state->output_log_key; + TXT_LangKind lang_kind = TXT_LangKind_Null; + U128 hash = {0}; + TXT_TextInfo info = txt_text_info_from_key_lang(txt_scope, key, lang_kind, &hash); + String8 data = hs_data_from_hash(hs_scope, hash); + Rng1U64 empty_range = {0}; + if(info.lines_count == 0) + { + info.lines_count = 1; + info.lines_ranges = &empty_range; + } + + ////////////////////////////// + //- rjf: build code contents + // + { + DF_CodeCtx code_ctx = {&df_g_nil_entity, key, lang_kind}; + df_code_view_build(ws, panel, view, cv, code_area_rect, data, &info, &code_ctx); + } + + ////////////////////////////// + //- rjf: build bottom bar + // + { + ui_set_next_rect(shift_2f32(bottom_bar_rect, scale_2f32(rect.p0, -1.f))); + ui_set_next_flags(UI_BoxFlag_DrawBackground); + UI_Row + UI_TextAlignment(UI_TextAlign_Center) + UI_PrefWidth(ui_text_dim(10, 1)) + UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) + { + UI_Font(df_font_from_slot(DF_FontSlot_Code)) + { + ui_labelf("(Debug String Output)"); + ui_spacer(ui_em(1.5f, 1)); + ui_labelf("Line: %I64d, Column: %I64d", cv->cursor.line, cv->cursor.column); + ui_spacer(ui_pct(1, 0)); + ui_labelf("(read only)"); + } + } + } + + txt_scope_close(txt_scope); + hs_scope_close(hs_scope); + scratch_end(scratch); +} +#endif + +//~ TODO(rjf): OLD vvvvvvvvvvvvvvvvvvvv @src_collapse +#if 0 DF_VIEW_SETUP_FUNCTION_DEF(Output) { // rjf: set up state @@ -8692,6 +8870,7 @@ DF_VIEW_UI_FUNCTION_DEF(Output) code_slice_params.line_bps = push_array(scratch.arena, DF_EntityList, slice.line_count); code_slice_params.line_ips = push_array(scratch.arena, DF_EntityList, slice.line_count); code_slice_params.line_pins = push_array(scratch.arena, DF_EntityList, slice.line_count); + code_slice_params.line_vaddrs = push_array(scratch.arena, U64, visible_line_count); code_slice_params.line_dasm2src = push_array(scratch.arena, DF_TextLineDasm2SrcInfoList, slice.line_count); code_slice_params.line_src2dasm = push_array(scratch.arena, DF_TextLineSrc2DasmInfoList, slice.line_count); code_slice_params.font = code_font; @@ -9097,6 +9276,7 @@ DF_VIEW_UI_FUNCTION_DEF(Output) scratch_end(scratch); ProfEnd(); } +#endif //////////////////////////////// //~ rjf: Memory @view_hook_impl diff --git a/src/df/gfx/df_views.h b/src/df/gfx/df_views.h index efa2d6b9..90f030a6 100644 --- a/src/df/gfx/df_views.h +++ b/src/df/gfx/df_views.h @@ -359,7 +359,7 @@ struct DF_WatchViewState }; //////////////////////////////// -//~ rjf: Code @view_types +//~ rjf: Code, Output @view_types typedef struct DF_CodeViewState DF_CodeViewState; struct DF_CodeViewState @@ -471,8 +471,8 @@ internal void df_entity_lister_item_array_sort_by_strength__in_place(DF_EntityLi //~ 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 data, TXT_TextInfo *info); -internal void df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewState *cv, Rng2F32 rect, String8 data, TXT_TextInfo *info); +internal void df_code_view_cmds(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewState *cv, DF_CmdList *cmds, String8 data, TXT_TextInfo *info, DF_CodeCtx *code_ctx); +internal void df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewState *cv, Rng2F32 rect, String8 data, TXT_TextInfo *info, DF_CodeCtx *code_ctx); //////////////////////////////// //~ rjf: Watch Views diff --git a/src/font_provider/dwrite/font_provider_dwrite.c b/src/font_provider/dwrite/font_provider_dwrite.c index 79ead99b..7050323a 100644 --- a/src/font_provider/dwrite/font_provider_dwrite.c +++ b/src/font_provider/dwrite/font_provider_dwrite.c @@ -198,7 +198,7 @@ fp_init(void) gamma, enhanced_contrast, enhanced_contrast, - 1.f, + 0.f, DWRITE_PIXEL_GEOMETRY_FLAT, DWRITE_RENDERING_MODE_GDI_NATURAL, DWRITE_GRID_FIT_MODE_ENABLED, @@ -209,7 +209,7 @@ fp_init(void) error = IDWriteFactory_CreateCustomRenderingParams(fp_dwrite_state->factory, gamma, enhanced_contrast, - 1.f, + 0.f, DWRITE_PIXEL_GEOMETRY_FLAT, DWRITE_RENDERING_MODE_GDI_NATURAL, &fp_dwrite_state->rendering_params[FP_RasterMode_Sharp]); @@ -226,7 +226,7 @@ fp_init(void) gamma, enhanced_contrast, enhanced_contrast, - 1.f, + 0.f, DWRITE_PIXEL_GEOMETRY_FLAT, DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL_SYMMETRIC, DWRITE_GRID_FIT_MODE_DISABLED, From 9be3c2affc40fc1d3ed052b31889c439dd3bf29e Mon Sep 17 00:00:00 2001 From: Ryan Fleury Date: Tue, 25 Jun 2024 17:02:43 -0700 Subject: [PATCH 28/47] sketch out 'interaction registers'; fix bp hit count tracking --- src/df/core/df_core.c | 2 +- src/df/core/df_core.h | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/src/df/core/df_core.c b/src/df/core/df_core.c index 2f896e03..0a0b4569 100644 --- a/src/df/core/df_core.c +++ b/src/df/core/df_core.c @@ -7031,7 +7031,7 @@ df_core_begin_frame(Arena *arena, DF_CmdList *cmds, F32 dt) if(bp->flags & DF_EntityFlag_HasTextPoint) { DF_Entity *bp_file = df_entity_ancestor_from_kind(bp, DF_EntityKind_File); - DF_LineList lines = df_lines_from_file_line_num(scratch.arena, bp_file, bp_file->text_point.line); + DF_LineList lines = df_lines_from_file_line_num(scratch.arena, bp_file, bp->text_point.line); for(DF_LineNode *n = lines.first; n != 0; n = n->next) { if(contains_1u64(n->v.voff_range, stop_thread_voff)) diff --git a/src/df/core/df_core.h b/src/df/core/df_core.h index 41e1534c..8f594ed2 100644 --- a/src/df/core/df_core.h +++ b/src/df/core/df_core.h @@ -653,6 +653,34 @@ struct DF_TextLineDasm2SrcInfoList U64 count; }; +//////////////////////////////// +//~ rjf: Interaction Context Register Types + +typedef struct DF_InteractRegs DF_InteractRegs; +struct DF_InteractRegs +{ + DF_Handle window; + DF_Handle panel; + DF_Handle view; + DF_Handle thread; + DF_Handle file; + TxtPt cursor; + TxtPt mark; + U64 unwind_count; + U64 inline_unwind_count; + U128 text_key; + TXT_LangKind lang_kind; + DF_LineList lines; + U64 vaddr; +}; + +typedef struct DF_InteractRegsNode DF_InteractRegsNode; +struct DF_InteractRegsNode +{ + DF_InteractRegsNode *next; + DF_InteractRegs v; +}; + //////////////////////////////// //~ rjf: Evaluation Visualization Types @@ -1202,6 +1230,11 @@ 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; @@ -1734,6 +1767,9 @@ internal F32 df_dt(void); internal U64 df_frame_index(void); internal F64 df_time_in_seconds(void); +//- rjf: interaction registers +internal DF_InteractRegs *df_interact_regs(void); + //- rjf: undo/redo history internal DF_StateDeltaHistory *df_state_delta_history(void); From 653eb08d439bac3dc7b5c430f902a9cbb4a338de Mon Sep 17 00:00:00 2001 From: Ryan Fleury Date: Tue, 25 Jun 2024 17:21:59 -0700 Subject: [PATCH 29/47] set up interaction register stack --- src/df/core/df_core.c | 46 ++++++++++++++++++++++++++++++++++++++++++- src/df/core/df_core.h | 5 ++++- 2 files changed, 49 insertions(+), 2 deletions(-) diff --git a/src/df/core/df_core.c b/src/df/core/df_core.c index 0a0b4569..208c2e48 100644 --- a/src/df/core/df_core.c +++ b/src/df/core/df_core.c @@ -5870,7 +5870,7 @@ df_eval_viz_row_list_push_new(Arena *arena, EVAL_ParseCtx *parse_ctx, DF_EvalViz //////////////////////////////// //~ rjf: Main State Accessors/Mutators -//- rjf: frame metadata +//- rjf: frame data internal F32 df_dt(void) @@ -5884,12 +5884,49 @@ df_frame_index(void) return df_state->frame_index; } +internal Arena * +df_frame_arena(void) +{ + return df_state->frame_arenas[df_state->frame_index%ArrayCount(df_state->frame_arenas)]; +} + internal F64 df_time_in_seconds(void) { return df_state->time_in_seconds; } +//- rjf: interaction registers + +internal DF_InteractRegs * +df_interact_regs(void) +{ + DF_InteractRegs *regs = &df_state->top_interact_regs->v; + return regs; +} + +internal DF_InteractRegs * +df_push_interact_regs(void) +{ + DF_InteractRegs *top = df_interact_regs(); + DF_InteractRegsNode *n = push_array(df_frame_arena(), DF_InteractRegsNode, 1); + MemoryCopyStruct(&n->v, top); + SLLStackPush(df_state->top_interact_regs, n); + return &n->v; +} + +internal DF_InteractRegs * +df_pop_interact_regs(void) +{ + DF_InteractRegs *regs = &df_state->top_interact_regs->v; + SLLStackPop(df_state->top_interact_regs); + if(df_state->top_interact_regs == 0) + { + df_state->top_interact_regs = &df_state->base_interact_regs; + } + return regs; +} + //- rjf: undo/redo history internal DF_StateDeltaHistory * @@ -6776,6 +6813,10 @@ df_core_init(CmdLine *cmdln, DF_StateDeltaHistory *hist) Arena *arena = arena_alloc(); df_state = push_array(arena, DF_State, 1); df_state->arena = arena; + for(U64 idx = 0; idx < ArrayCount(df_state->frame_arenas); idx += 1) + { + df_state->frame_arenas[idx] = arena_alloc(); + } df_state->root_cmd_arena = arena_alloc(); df_state->output_log_key = hs_hash_from_data(str8_lit("df_output_log_key")); df_state->entities_arena = arena_alloc__sized(GB(64), KB(64)); @@ -6936,8 +6977,11 @@ df_core_begin_frame(Arena *arena, DF_CmdList *cmds, F32 dt) { ProfBeginFunction(); df_state->frame_index += 1; + arena_clear(df_frame_arena()); df_state->dt = dt; df_state->time_in_seconds += dt; + df_state->top_interact_regs = &df_state->base_interact_regs; + MemoryZeroStruct(df_state->top_interact_regs); //- rjf: sync with ctrl thread ProfScope("sync with ctrl thread") diff --git a/src/df/core/df_core.h b/src/df/core/df_core.h index 8f594ed2..5d4df49e 100644 --- a/src/df/core/df_core.h +++ b/src/df/core/df_core.h @@ -1762,13 +1762,16 @@ 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); From 2e12b1485a6dd21b3052ac392c9f9b76af1d1131 Mon Sep 17 00:00:00 2001 From: Ryan Fleury Date: Tue, 25 Jun 2024 17:53:39 -0700 Subject: [PATCH 30/47] some light mode fixes, light mode theme preset re-filled --- src/df/gfx/df_gfx.c | 2 +- src/df/gfx/df_gfx.mdesk | 152 +++--- src/df/gfx/generated/df_gfx.meta.c | 786 ++++++++++++++--------------- 3 files changed, 470 insertions(+), 470 deletions(-) diff --git a/src/df/gfx/df_gfx.c b/src/df/gfx/df_gfx.c index 3e7d24ab..5cd0e511 100644 --- a/src/df/gfx/df_gfx.c +++ b/src/df/gfx/df_gfx.c @@ -7045,7 +7045,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) Rng2F32 panel_rect = panel_box->rect; // rjf: colors - Vec4F32 bg_color = v4f32(0.1f, 0.1f, 0.1f, 1); + Vec4F32 bg_color = df_rgba_from_theme_color(DF_ThemeColor_FloatingBackground); Vec4F32 bd_color = df_rgba_from_theme_color(DF_ThemeColor_FloatingBorder); Vec4F32 hl_color = df_rgba_from_theme_color(DF_ThemeColor_TextNeutral); bg_color.w *= view->loading_t; diff --git a/src/df/gfx/df_gfx.mdesk b/src/df/gfx/df_gfx.mdesk index 87a1e8a4..b86819b8 100644 --- a/src/df/gfx/df_gfx.mdesk +++ b/src/df/gfx/df_gfx.mdesk @@ -366,98 +366,98 @@ DF_ThemePresetTable: { FarManager far_manager "Far Manager" } } -@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) +@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: { - {Null "Null" null 0xff00ffff 0xff00ffff 0xff00ffff 0xff00ffff 0xff00ffff 0xff00ffff 0xff00ffff 0xff00ffff 0xff00ffff ""} + {Null "Null" null 0xff00ffff 0xff00ffff 0xff00ffff 0xff00ffff 0xff00ffff 0xff00ffff 0xff00ffff 0xff00ffff 0xff00ffff ""} //- rjf: global ui colors - {Text "Text" text 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff ""} - {TextPositive "Text (Positive)" text_positive 0x4dc221ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff ""} - {TextNegative "Text (Negative)" text_negative 0xc56452ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff ""} - {TextNeutral "Text (Neutral)" text_neutral 0x307eb2ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff ""} - {TextWeak "Text (Weak)" text_weak 0xa4a4a4fe 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f 0xffffff7f ""} - {Cursor "Cursor" cursor 0x8aff00ff 0x66e566e5 0x66e566e5 0x66e566e5 0x66e566e5 0x66e566e5 0x66e566e5 0x66e566e5 0x66e566e5 ""} - {CursorInactive "Cursor (Inactive)" cursor_inactive 0xb23217ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff ""} - {Focus "Focus" focus 0xfda200ff 0xb27219ff 0xb27219ff 0xb27219ff 0xb27219ff 0xb27219ff 0xb27219ff 0xb27219ff 0xb27219ff ""} - {Hover "Hover" hover 0xffffffff 0xb27219ff 0xb27219ff 0xb27219ff 0xb27219ff 0xb27219ff 0xb27219ff 0xb27219ff 0xb27219ff ""} - {DropShadow "Drop Shadow" drop_shadow 0x0000007f 0x0000007f 0x0000007f 0x0000007f 0x0000007f 0x0000007f 0x0000007f 0x0000007f 0x0000007f ""} - {DisabledOverlay "Disabled Overlay" disabled_overlay 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f ""} - {DropSiteOverlay "Drop Site Overlay" drop_site_overlay 0xffffff0c 0xffffff0c 0xffffff0c 0xffffff0c 0xffffff0c 0xffffff0c 0xffffff0c 0xffffff0c 0xffffff0c ""} - {InactivePanelOverlay "Inactive Panel Overlay" inactive_panel_overlay 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f ""} - {SelectionOverlay "Selection Overlay" selection_overlay 0x99ccff4c 0x99ccff4c 0x99ccff4c 0x99ccff4c 0x99ccff4c 0x99ccff4c 0x99ccff4c 0x99ccff4c 0x99ccff4c ""} - {HighlightOverlay "Highlight Overlay" highlight_overlay 0xffffff1e 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f ""} - {HighlightOverlayError "Error Highlight Overlay" error_highlight_overlay 0x5f12005f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f ""} + {Text "Text" text 0xe5e5e5ff 0x4c4c4cff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff ""} + {TextPositive "Text (Positive)" text_positive 0x4dc221ff 0x4d9e2eff 0x4dc221ff 0x4dc221ff 0x4dc221ff 0x4dc221ff 0x4dc221ff 0x4dc221ff 0x4dc221ff ""} + {TextNegative "Text (Negative)" text_negative 0xc56452ff 0xbd371eff 0xc56452ff 0xc56452ff 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 0xa4a4a4fe 0xa4a4a4fe 0xa4a4a4fe 0xa4a4a4fe 0xa4a4a4fe 0xa4a4a4fe ""} + {Cursor "Cursor" cursor 0x8aff00ff 0x699830ff 0x8aff00ff 0x8aff00ff 0x8aff00ff 0x8aff00ff 0x8aff00ff 0x8aff00ff 0x8aff00ff ""} + {CursorInactive "Cursor (Inactive)" cursor_inactive 0xb23217ff 0xb23217ff 0xb23217ff 0xb23217ff 0xb23217ff 0xb23217ff 0xb23217ff 0xb23217ff 0xb23217ff ""} + {Focus "Focus" focus 0xfda200ff 0x9c5900ff 0xfda200ff 0xfda200ff 0xfda200ff 0xfda200ff 0xfda200ff 0xfda200ff 0xfda200ff ""} + {Hover "Hover" hover 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff ""} + {DropShadow "Drop Shadow" drop_shadow 0x0000007f 0x0000004c 0x0000007f 0x0000007f 0x0000007f 0x0000007f 0x0000007f 0x0000007f 0x0000007f ""} + {DisabledOverlay "Disabled Overlay" disabled_overlay 0x0000003f 0xa6a6a63f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f ""} + {DropSiteOverlay "Drop Site Overlay" drop_site_overlay 0xffffff0c 0x4848480c 0xffffff0c 0xffffff0c 0xffffff0c 0xffffff0c 0xffffff0c 0xffffff0c 0xffffff0c ""} + {InactivePanelOverlay "Inactive Panel Overlay" inactive_panel_overlay 0x0000003f 0xa4a4a43f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f ""} + {SelectionOverlay "Selection Overlay" selection_overlay 0x99ccff4c 0x003d7a48 0x99ccff4c 0x99ccff4c 0x99ccff4c 0x99ccff4c 0x99ccff4c 0x99ccff4c 0x99ccff4c ""} + {HighlightOverlay "Highlight Overlay" highlight_overlay 0xffffff1e 0xffffff1e 0xffffff1e 0xffffff1e 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 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f ""} - {BaseBackgroundAlt "Base Background (Alternate)" base_background_alt 0x2b2b2bfe 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f ""} - {BaseBorder "Base Border" base_border 0x3f3f3ffe 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 ""} + {BaseBackground "Base Background" base_background 0x1b1b1bfe 0xccccccfe 0x1b1b1bfe 0x1b1b1bfe 0x1b1b1bfe 0x1b1b1bfe 0x1b1b1bfe 0x1b1b1bfe 0x1b1b1bfe ""} + {BaseBackgroundAlt "Base Background (Alternate)" base_background_alt 0x2b2b2bfe 0x2b2b2bfe 0x2b2b2bfe 0x2b2b2bfe 0x2b2b2bfe 0x2b2b2bfe 0x2b2b2bfe 0x2b2b2bfe 0x2b2b2bfe ""} + {BaseBorder "Base Border" base_border 0x3f3f3ffe 0xa4a4a4fe 0x3f3f3ffe 0x3f3f3ffe 0x3f3f3ffe 0x3f3f3ffe 0x3f3f3ffe 0x3f3f3ffe 0x3f3f3ffe ""} //- rjf: menu bar ui container colors - {MenuBarBackground "Menu Bar Background" menu_bar_background 0x3e4c577f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f ""} - {MenuBarBackgroundAlt "Menu Bar Background (Alternate)" menu_bar_background_alt 0x3e4c577f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f ""} - {MenuBarBorder "Menu Bar Border" menu_bar_border 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 ""} + {MenuBarBackground "Menu Bar Background" menu_bar_background 0x3e4c577f 0xeaeaea7f 0x3e4c577f 0x3e4c577f 0x3e4c577f 0x3e4c577f 0x3e4c577f 0x3e4c577f 0x3e4c577f ""} + {MenuBarBackgroundAlt "Menu Bar Background (Alternate)" menu_bar_background_alt 0x3e4c577f 0x3e4c577f 0x3e4c577f 0x3e4c577f 0x3e4c577f 0x3e4c577f 0x3e4c577f 0x3e4c577f 0x3e4c577f ""} + {MenuBarBorder "Menu Bar Border" menu_bar_border 0xffffff19 0xa4a4a4fe 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 ""} //- rjf: floating ui container colors - {FloatingBackground "Floating Background" floating_background 0x33333333 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f ""} - {FloatingBackgroundAlt "Floating Background (Alternate)" floating_background_alt 0x33333333 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f 0x3333337f ""} - {FloatingBorder "Floating Border" floating_border 0x3f3f3ffd 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 ""} + {FloatingBackground "Floating Background" floating_background 0x33333333 0xccccccc0 0x33333333 0x33333333 0x33333333 0x33333333 0x33333333 0x33333333 0x33333333 ""} + {FloatingBackgroundAlt "Floating Background (Alternate)" floating_background_alt 0x33333333 0x33333333 0x33333333 0x33333333 0x33333333 0x33333333 0x33333333 0x33333333 0x33333333 ""} + {FloatingBorder "Floating Border" floating_border 0x3f3f3ffd 0xa4a4a4fe 0x3f3f3ffd 0x3f3f3ffd 0x3f3f3ffd 0x3f3f3ffd 0x3f3f3ffd 0x3f3f3ffd 0x3f3f3ffd ""} //- 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 0x00000000 0x00000000 0x00000000 0x00000000 ""} - {PlainButtonBackground "Plain Button Background" plain_button_background 0x1b1b1bfe 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 ""} - {PlainButtonBorder "Plain Button Border" plain_button_border 0x3f3f3ffe 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 ""} - {PositivePopButtonBackground "Positive Pop Button Background" positive_pop_button_background 0x2c5b36ff 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 ""} - {PositivePopButtonBorder "Positive Pop Button Border" positive_pop_button_border 0x3f3f3ffd 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 ""} - {NegativePopButtonBackground "Negative Pop Button Background" negative_pop_button_background 0x803425ff 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 ""} - {NegativePopButtonBorder "Negative Pop Button Border" negative_pop_button_border 0x3f3f3ffd 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 ""} - {NeutralPopButtonBackground "Neutral Pop Button Background" neutral_pop_button_background 0x355b6eff 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 ""} - {NeutralPopButtonBorder "Neutral Pop Button Border" neutral_pop_button_border 0x3f3f3ffd 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 ""} - {ScrollBarButtonBackground "Scroll Bar Button Background" scroll_bar_button_background 0x2b2b2bfe 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 ""} - {ScrollBarButtonBorder "Scroll Bar Button Border" scroll_bar_button_border 0x3f3f3ffe 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 ""} - {TabBackground "Tab Background" tab_background 0x6f5135fe 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 ""} - {TabBorder "Tab Border" tab_border 0xfefefe4d 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 ""} - {TabBackgroundInactive "Tab Background (Inactive)" tab_background_inactive 0x3e4c577f 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 ""} - {TabBorderInactive "Tab Border (Inactive)" tab_border_inactive 0xffffff19 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 ""} + {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 0x00000000 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 0x3f3f3ffe 0x3f3f3ffe 0x3f3f3ffe 0x3f3f3ffe 0x3f3f3ffe 0x3f3f3ffe ""} + {PositivePopButtonBackground "Positive Pop Button Background" positive_pop_button_background 0x2c5b36ff 0x65f534ff 0x2c5b36ff 0x2c5b36ff 0x2c5b36ff 0x2c5b36ff 0x2c5b36ff 0x2c5b36ff 0x2c5b36ff ""} + {PositivePopButtonBorder "Positive Pop Button Border" positive_pop_button_border 0x3f3f3ffd 0x3f3f3ffd 0x3f3f3ffd 0x3f3f3ffd 0x3f3f3ffd 0x3f3f3ffd 0x3f3f3ffd 0x3f3f3ffd 0x3f3f3ffd ""} + {NegativePopButtonBackground "Negative Pop Button Background" negative_pop_button_background 0x803425ff 0xff694cff 0x803425ff 0x803425ff 0x803425ff 0x803425ff 0x803425ff 0x803425ff 0x803425ff ""} + {NegativePopButtonBorder "Negative Pop Button Border" negative_pop_button_border 0x3f3f3ffd 0x3f3f3ffd 0x3f3f3ffd 0x3f3f3ffd 0x3f3f3ffd 0x3f3f3ffd 0x3f3f3ffd 0x3f3f3ffd 0x3f3f3ffd ""} + {NeutralPopButtonBackground "Neutral Pop Button Background" neutral_pop_button_background 0x355b6eff 0xa6becaff 0x355b6eff 0x355b6eff 0x355b6eff 0x355b6eff 0x355b6eff 0x355b6eff 0x355b6eff ""} + {NeutralPopButtonBorder "Neutral Pop Button Border" neutral_pop_button_border 0x3f3f3ffd 0xa6a6a6fd 0x3f3f3ffd 0x3f3f3ffd 0x3f3f3ffd 0x3f3f3ffd 0x3f3f3ffd 0x3f3f3ffd 0x3f3f3ffd ""} + {ScrollBarButtonBackground "Scroll Bar Button Background" scroll_bar_button_background 0x2b2b2bfe 0xa9a9a9fe 0x2b2b2bfe 0x2b2b2bfe 0x2b2b2bfe 0x2b2b2bfe 0x2b2b2bfe 0x2b2b2bfe 0x2b2b2bfe ""} + {ScrollBarButtonBorder "Scroll Bar Button Border" scroll_bar_button_border 0x3f3f3ffe 0xc0c0c0fe 0x3f3f3ffe 0x3f3f3ffe 0x3f3f3ffe 0x3f3f3ffe 0x3f3f3ffe 0x3f3f3ffe 0x3f3f3ffe ""} + {TabBackground "Tab Background" tab_background 0x6f5135fe 0xa98b6fff 0x6f5135fe 0x6f5135fe 0x6f5135fe 0x6f5135fe 0x6f5135fe 0x6f5135fe 0x6f5135fe ""} + {TabBorder "Tab Border" tab_border 0xfefefe4d 0xffffff4d 0xfefefe4d 0xfefefe4d 0xfefefe4d 0xfefefe4d 0xfefefe4d 0xfefefe4d 0xfefefe4d ""} + {TabBackgroundInactive "Tab Background (Inactive)" tab_background_inactive 0x3e4c577f 0x8282827f 0x3e4c577f 0x3e4c577f 0x3e4c577f 0x3e4c577f 0x3e4c577f 0x3e4c577f 0x3e4c577f ""} + {TabBorderInactive "Tab Border (Inactive)" tab_border_inactive 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 ""} //- rjf: code colors - {CodeDefault "Code (Default)" code_default 0xcbcbcbff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff ""} - {CodeSymbol "Code (Symbol)" code_symbol 0x42a2cffe 0x7fcc99ff 0x7fcc99ff 0x7fcc99ff 0x7fcc99ff 0x7fcc99ff 0x7fcc99ff 0x7fcc99ff 0x7fcc99ff ""} - {CodeType "Code (Type)" code_type 0xfec746ff 0x66b2e5ff 0x66b2e5ff 0x66b2e5ff 0x66b2e5ff 0x66b2e5ff 0x66b2e5ff 0x66b2e5ff 0x66b2e5ff ""} - {CodeLocal "Code (Local)" code_local 0x98bc80ff 0xfe9548ff 0xfe9548ff 0xfe9548ff 0xfe9548ff 0xfe9548ff 0xfe9548ff 0xfe9548ff 0xfe9548ff ""} - {CodeRegister "Code (Register)" code_register 0xb7afd5ff 0xd45d90ff 0xd45d90ff 0xd45d90ff 0xd45d90ff 0xd45d90ff 0xd45d90ff 0xd45d90ff 0xd45d90ff ""} - {CodeKeyword "Code (Keyword)" code_keyword 0xb38d4cff 0xf7bf5eff 0xf7bf5eff 0xf7bf5eff 0xf7bf5eff 0xf7bf5eff 0xf7bf5eff 0xf7bf5eff 0xf7bf5eff ""} - {CodeDelimiterOperator "Code (Delimiters/Operators)" code_delimiter_operator 0x767676ff 0x994c32ff 0x994c32ff 0x994c32ff 0x994c32ff 0x994c32ff 0x994c32ff 0x994c32ff 0x994c32ff ""} - {CodeNumeric "Code (Numeric)" code_numeric 0x98abb1ff 0x4ce54cff 0x4ce54cff 0x4ce54cff 0x4ce54cff 0x4ce54cff 0x4ce54cff 0x4ce54cff 0x4ce54cff ""} - {CodeNumericAltDigitGroup "Code (Numeric, Alt. Digit Group)" code_numeric_alt_digit_group 0x738287ff 0x4ca54cff 0x4ca54cff 0x4ca54cff 0x4ca54cff 0x4ca54cff 0x4ca54cff 0x4ca54cff 0x4ca54cff ""} - {CodeString "Code (String)" code_string 0x98abb1ff 0xe5cc66ff 0xe5cc66ff 0xe5cc66ff 0xe5cc66ff 0xe5cc66ff 0xe5cc66ff 0xe5cc66ff 0xe5cc66ff ""} - {CodeMeta "Code (Meta)" code_meta 0xd96759ff 0xe54c4cff 0xe54c4cff 0xe54c4cff 0xe54c4cff 0xe54c4cff 0xe54c4cff 0xe54c4cff 0xe54c4cff ""} - {CodeComment "Code (Comment)" code_comment 0x717171ff 0x7f7f7fff 0x7f7f7fff 0x7f7f7fff 0x7f7f7fff 0x7f7f7fff 0x7f7f7fff 0x7f7f7fff 0x7f7f7fff ""} - {CodeLineNumbers "Code Line Numbers" code_line_numbers 0x7f7f7fff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff ""} - {CodeLineNumbersSelected "Code Line Numbers (Selected)" code_line_numbers_selected 0xbebebeff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff ""} + {CodeDefault "Code (Default)" code_default 0xcbcbcbff 0x4d4d4dff 0xcbcbcbff 0xcbcbcbff 0xcbcbcbff 0xcbcbcbff 0xcbcbcbff 0xcbcbcbff 0xcbcbcbff ""} + {CodeSymbol "Code (Symbol)" code_symbol 0x42a2cffe 0x205670fe 0x42a2cffe 0x42a2cffe 0x42a2cffe 0x42a2cffe 0x42a2cffe 0x42a2cffe 0x42a2cffe ""} + {CodeType "Code (Type)" code_type 0xfec746ff 0x996b00ff 0xfec746ff 0xfec746ff 0xfec746ff 0xfec746ff 0xfec746ff 0xfec746ff 0xfec746ff ""} + {CodeLocal "Code (Local)" code_local 0x98bc80ff 0x446a2bff 0x98bc80ff 0x98bc80ff 0x98bc80ff 0x98bc80ff 0x98bc80ff 0x98bc80ff 0x98bc80ff ""} + {CodeRegister "Code (Register)" code_register 0xb7afd5ff 0x4c35a1ff 0xb7afd5ff 0xb7afd5ff 0xb7afd5ff 0xb7afd5ff 0xb7afd5ff 0xb7afd5ff 0xb7afd5ff ""} + {CodeKeyword "Code (Keyword)" code_keyword 0xb38d4cff 0x573700ff 0xb38d4cff 0xb38d4cff 0xb38d4cff 0xb38d4cff 0xb38d4cff 0xb38d4cff 0xb38d4cff ""} + {CodeDelimiterOperator "Code (Delimiters/Operators)" code_delimiter_operator 0x767676ff 0x767676ff 0x767676ff 0x767676ff 0x767676ff 0x767676ff 0x767676ff 0x767676ff 0x767676ff ""} + {CodeNumeric "Code (Numeric)" code_numeric 0x98abb1ff 0x3f6e7dff 0x98abb1ff 0x98abb1ff 0x98abb1ff 0x98abb1ff 0x98abb1ff 0x98abb1ff 0x98abb1ff ""} + {CodeNumericAltDigitGroup "Code (Numeric, Alt. Digit Group)" code_numeric_alt_digit_group 0x738287ff 0x1f4450ff 0x738287ff 0x738287ff 0x738287ff 0x738287ff 0x738287ff 0x738287ff 0x738287ff ""} + {CodeString "Code (String)" code_string 0x98abb1ff 0x3c606bff 0x98abb1ff 0x98abb1ff 0x98abb1ff 0x98abb1ff 0x98abb1ff 0x98abb1ff 0x98abb1ff ""} + {CodeMeta "Code (Meta)" code_meta 0xd96759ff 0xad3627ff 0xd96759ff 0xd96759ff 0xd96759ff 0xd96759ff 0xd96759ff 0xd96759ff 0xd96759ff ""} + {CodeComment "Code (Comment)" code_comment 0x717171ff 0x4b4b4bff 0x717171ff 0x717171ff 0x717171ff 0x717171ff 0x717171ff 0x717171ff 0x717171ff ""} + {CodeLineNumbers "Code Line Numbers" code_line_numbers 0x7f7f7fff 0x4b4b4bff 0x7f7f7fff 0x7f7f7fff 0x7f7f7fff 0x7f7f7fff 0x7f7f7fff 0x7f7f7fff 0x7f7f7fff ""} + {CodeLineNumbersSelected "Code Line Numbers (Selected)" code_line_numbers_selected 0xbebebeff 0x000000ff 0xbebebeff 0xbebebeff 0xbebebeff 0xbebebeff 0xbebebeff 0xbebebeff 0xbebebeff ""} //- 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 0x99503d3f 0x99503d3f 0x99503d3f 0x99503d3f 0x99503d3f 0x99503d3f 0x99503d3f 0x99503d3f ""} - {Thread0 "Thread 0" thread_0 0xffcb7fff 0xffcb7fff 0xffcb7fff 0xffcb7fff 0xffcb7fff 0xffcb7fff 0xffcb7fff 0xffcb7fff 0xffcb7fff ""} - {Thread1 "Thread 1" thread_1 0xb2ff65ff 0xb2ff65ff 0xb2ff65ff 0xb2ff65ff 0xb2ff65ff 0xb2ff65ff 0xb2ff65ff 0xb2ff65ff 0xb2ff65ff ""} - {Thread2 "Thread 2" thread_2 0xff99e5ff 0xff99e5ff 0xff99e5ff 0xff99e5ff 0xff99e5ff 0xff99e5ff 0xff99e5ff 0xff99e5ff 0xff99e5ff ""} - {Thread3 "Thread 3" thread_3 0x6598ffff 0x6598ffff 0x6598ffff 0x6598ffff 0x6598ffff 0x6598ffff 0x6598ffff 0x6598ffff 0x6598ffff ""} - {Thread4 "Thread 4" thread_4 0x65ffcbff 0x65ffcbff 0x65ffcbff 0x65ffcbff 0x65ffcbff 0x65ffcbff 0x65ffcbff 0x65ffcbff 0x65ffcbff ""} - {Thread5 "Thread 5" thread_5 0xff9819ff 0xff9819ff 0xff9819ff 0xff9819ff 0xff9819ff 0xff9819ff 0xff9819ff 0xff9819ff 0xff9819ff ""} - {Thread6 "Thread 6" thread_6 0x9932ffff 0x9932ffff 0x9932ffff 0x9932ffff 0x9932ffff 0x9932ffff 0x9932ffff 0x9932ffff 0x9932ffff ""} - {Thread7 "Thread 7" thread_7 0x65ff4cff 0x65ff4cff 0x65ff4cff 0x65ff4cff 0x65ff4cff 0x65ff4cff 0x65ff4cff 0x65ff4cff 0x65ff4cff ""} - {ThreadUnwound "Thread (Unwound)" thread_unwound 0xb2ccd8ff 0xb2ccd8ff 0xb2ccd8ff 0xb2ccd8ff 0xb2ccd8ff 0xb2ccd8ff 0xb2ccd8ff 0xb2ccd8ff 0xb2ccd8ff ""} - {ThreadError "Thread (Error)" thread_error 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff ""} - {Breakpoint "Breakpoint" breakpoint 0xa72911ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff ""} + {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 0xd07c00ff 0xffcb7fff 0xffcb7fff 0xffcb7fff 0xffcb7fff 0xffcb7fff 0xffcb7fff 0xffcb7fff ""} + {Thread1 "Thread 1" thread_1 0xb2ff65ff 0xb2ff65ff 0xb2ff65ff 0xb2ff65ff 0xb2ff65ff 0xb2ff65ff 0xb2ff65ff 0xb2ff65ff 0xb2ff65ff ""} + {Thread2 "Thread 2" thread_2 0xff99e5ff 0xff99e5ff 0xff99e5ff 0xff99e5ff 0xff99e5ff 0xff99e5ff 0xff99e5ff 0xff99e5ff 0xff99e5ff ""} + {Thread3 "Thread 3" thread_3 0x6598ffff 0x6598ffff 0x6598ffff 0x6598ffff 0x6598ffff 0x6598ffff 0x6598ffff 0x6598ffff 0x6598ffff ""} + {Thread4 "Thread 4" thread_4 0x65ffcbff 0x65ffcbff 0x65ffcbff 0x65ffcbff 0x65ffcbff 0x65ffcbff 0x65ffcbff 0x65ffcbff 0x65ffcbff ""} + {Thread5 "Thread 5" thread_5 0xff9819ff 0xff9819ff 0xff9819ff 0xff9819ff 0xff9819ff 0xff9819ff 0xff9819ff 0xff9819ff 0xff9819ff ""} + {Thread6 "Thread 6" thread_6 0x9932ffff 0x9932ffff 0x9932ffff 0x9932ffff 0x9932ffff 0x9932ffff 0x9932ffff 0x9932ffff 0x9932ffff ""} + {Thread7 "Thread 7" thread_7 0x65ff4cff 0x65ff4cff 0x65ff4cff 0x65ff4cff 0x65ff4cff 0x65ff4cff 0x65ff4cff 0x65ff4cff 0x65ff4cff ""} + {ThreadUnwound "Thread (Unwound)" thread_unwound 0xb2ccd8ff 0xb2ccd8ff 0xb2ccd8ff 0xb2ccd8ff 0xb2ccd8ff 0xb2ccd8ff 0xb2ccd8ff 0xb2ccd8ff 0xb2ccd8ff ""} + {ThreadError "Thread (Error)" thread_error 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff ""} + {Breakpoint "Breakpoint" breakpoint 0xa72911ff 0xff2800ff 0xa72911ff 0xa72911ff 0xa72911ff 0xa72911ff 0xa72911ff 0xa72911ff 0xa72911ff ""} } @table(old_name new_name) diff --git a/src/df/gfx/generated/df_gfx.meta.c b/src/df/gfx/generated/df_gfx.meta.c index 07261700..e32943fc 100644 --- a/src/df/gfx/generated/df_gfx.meta.c +++ b/src/df/gfx/generated/df_gfx.meta.c @@ -401,61 +401,61 @@ rgba_from_u32_lit_comp(0xa72911ff), Vec4F32 df_g_theme_preset_colors__default_light[75] = { rgba_from_u32_lit_comp(0xff00ffff), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0x32b219ff), -rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xffffff7f), -rgba_from_u32_lit_comp(0x66e566e5), -rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xb27219ff), -rgba_from_u32_lit_comp(0xb27219ff), -rgba_from_u32_lit_comp(0x0000007f), -rgba_from_u32_lit_comp(0x0000003f), -rgba_from_u32_lit_comp(0xffffff0c), -rgba_from_u32_lit_comp(0x0000003f), -rgba_from_u32_lit_comp(0x99ccff4c), -rgba_from_u32_lit_comp(0x0000003f), -rgba_from_u32_lit_comp(0x0000003f), -rgba_from_u32_lit_comp(0x3333337f), -rgba_from_u32_lit_comp(0x3333337f), +rgba_from_u32_lit_comp(0x4c4c4cff), +rgba_from_u32_lit_comp(0x4d9e2eff), +rgba_from_u32_lit_comp(0xbd371eff), +rgba_from_u32_lit_comp(0x0064a7ff), +rgba_from_u32_lit_comp(0x4c4c4cff), +rgba_from_u32_lit_comp(0x699830ff), +rgba_from_u32_lit_comp(0xb23217ff), +rgba_from_u32_lit_comp(0x9c5900ff), +rgba_from_u32_lit_comp(0xffffffff), +rgba_from_u32_lit_comp(0x0000004c), +rgba_from_u32_lit_comp(0xa6a6a63f), +rgba_from_u32_lit_comp(0x4848480c), +rgba_from_u32_lit_comp(0xa4a4a43f), +rgba_from_u32_lit_comp(0x003d7a48), +rgba_from_u32_lit_comp(0xffffff1e), +rgba_from_u32_lit_comp(0xff30005f), +rgba_from_u32_lit_comp(0xccccccfe), +rgba_from_u32_lit_comp(0x2b2b2bfe), +rgba_from_u32_lit_comp(0xa4a4a4fe), +rgba_from_u32_lit_comp(0xeaeaea7f), +rgba_from_u32_lit_comp(0x3e4c577f), +rgba_from_u32_lit_comp(0xa4a4a4fe), +rgba_from_u32_lit_comp(0xccccccc0), +rgba_from_u32_lit_comp(0x33333333), +rgba_from_u32_lit_comp(0xa4a4a4fe), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x1b1b1bfe), +rgba_from_u32_lit_comp(0x3f3f3ffe), +rgba_from_u32_lit_comp(0x65f534ff), +rgba_from_u32_lit_comp(0x3f3f3ffd), +rgba_from_u32_lit_comp(0xff694cff), +rgba_from_u32_lit_comp(0x3f3f3ffd), +rgba_from_u32_lit_comp(0xa6becaff), +rgba_from_u32_lit_comp(0xa6a6a6fd), +rgba_from_u32_lit_comp(0xa9a9a9fe), +rgba_from_u32_lit_comp(0xc0c0c0fe), +rgba_from_u32_lit_comp(0xa98b6fff), +rgba_from_u32_lit_comp(0xffffff4d), +rgba_from_u32_lit_comp(0x8282827f), rgba_from_u32_lit_comp(0xffffff19), -rgba_from_u32_lit_comp(0x3333337f), -rgba_from_u32_lit_comp(0x3333337f), -rgba_from_u32_lit_comp(0xffffff19), -rgba_from_u32_lit_comp(0x3333337f), -rgba_from_u32_lit_comp(0x3333337f), -rgba_from_u32_lit_comp(0xffffff19), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0x7fcc99ff), -rgba_from_u32_lit_comp(0x66b2e5ff), -rgba_from_u32_lit_comp(0xfe9548ff), -rgba_from_u32_lit_comp(0xd45d90ff), -rgba_from_u32_lit_comp(0xf7bf5eff), -rgba_from_u32_lit_comp(0x994c32ff), -rgba_from_u32_lit_comp(0x4ce54cff), -rgba_from_u32_lit_comp(0x4ca54cff), -rgba_from_u32_lit_comp(0xe5cc66ff), -rgba_from_u32_lit_comp(0xe54c4cff), -rgba_from_u32_lit_comp(0x7f7f7fff), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0x4d4d4dff), +rgba_from_u32_lit_comp(0x205670fe), +rgba_from_u32_lit_comp(0x996b00ff), +rgba_from_u32_lit_comp(0x446a2bff), +rgba_from_u32_lit_comp(0x4c35a1ff), +rgba_from_u32_lit_comp(0x573700ff), +rgba_from_u32_lit_comp(0x767676ff), +rgba_from_u32_lit_comp(0x3f6e7dff), +rgba_from_u32_lit_comp(0x1f4450ff), +rgba_from_u32_lit_comp(0x3c606bff), +rgba_from_u32_lit_comp(0xad3627ff), +rgba_from_u32_lit_comp(0x4b4b4bff), +rgba_from_u32_lit_comp(0x4b4b4bff), +rgba_from_u32_lit_comp(0x000000ff), rgba_from_u32_lit_comp(0x99503d3f), rgba_from_u32_lit_comp(0xfe82493f), rgba_from_u32_lit_comp(0xffba173f), @@ -463,8 +463,8 @@ rgba_from_u32_lit_comp(0xcefd693f), rgba_from_u32_lit_comp(0x99503d3f), rgba_from_u32_lit_comp(0xfe82493f), rgba_from_u32_lit_comp(0xffba173f), -rgba_from_u32_lit_comp(0x99503d3f), -rgba_from_u32_lit_comp(0xffcb7fff), +rgba_from_u32_lit_comp(0xcefd693f), +rgba_from_u32_lit_comp(0xd07c00ff), rgba_from_u32_lit_comp(0xb2ff65ff), rgba_from_u32_lit_comp(0xff99e5ff), rgba_from_u32_lit_comp(0x6598ffff), @@ -474,67 +474,67 @@ rgba_from_u32_lit_comp(0x9932ffff), rgba_from_u32_lit_comp(0x65ff4cff), rgba_from_u32_lit_comp(0xb2ccd8ff), rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xff2800ff), }; Vec4F32 df_g_theme_preset_colors__vs_dark[75] = { rgba_from_u32_lit_comp(0xff00ffff), rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0x32b219ff), -rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xffffff7f), -rgba_from_u32_lit_comp(0x66e566e5), -rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xb27219ff), -rgba_from_u32_lit_comp(0xb27219ff), +rgba_from_u32_lit_comp(0x4dc221ff), +rgba_from_u32_lit_comp(0xc56452ff), +rgba_from_u32_lit_comp(0x307eb2ff), +rgba_from_u32_lit_comp(0xa4a4a4fe), +rgba_from_u32_lit_comp(0x8aff00ff), +rgba_from_u32_lit_comp(0xb23217ff), +rgba_from_u32_lit_comp(0xfda200ff), +rgba_from_u32_lit_comp(0xffffffff), rgba_from_u32_lit_comp(0x0000007f), rgba_from_u32_lit_comp(0x0000003f), rgba_from_u32_lit_comp(0xffffff0c), rgba_from_u32_lit_comp(0x0000003f), rgba_from_u32_lit_comp(0x99ccff4c), -rgba_from_u32_lit_comp(0x0000003f), -rgba_from_u32_lit_comp(0x0000003f), -rgba_from_u32_lit_comp(0x3333337f), -rgba_from_u32_lit_comp(0x3333337f), +rgba_from_u32_lit_comp(0xffffff1e), +rgba_from_u32_lit_comp(0x5f12005f), +rgba_from_u32_lit_comp(0x1b1b1bfe), +rgba_from_u32_lit_comp(0x2b2b2bfe), +rgba_from_u32_lit_comp(0x3f3f3ffe), +rgba_from_u32_lit_comp(0x3e4c577f), +rgba_from_u32_lit_comp(0x3e4c577f), rgba_from_u32_lit_comp(0xffffff19), -rgba_from_u32_lit_comp(0x3333337f), -rgba_from_u32_lit_comp(0x3333337f), +rgba_from_u32_lit_comp(0x33333333), +rgba_from_u32_lit_comp(0x33333333), +rgba_from_u32_lit_comp(0x3f3f3ffd), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x1b1b1bfe), +rgba_from_u32_lit_comp(0x3f3f3ffe), +rgba_from_u32_lit_comp(0x2c5b36ff), +rgba_from_u32_lit_comp(0x3f3f3ffd), +rgba_from_u32_lit_comp(0x803425ff), +rgba_from_u32_lit_comp(0x3f3f3ffd), +rgba_from_u32_lit_comp(0x355b6eff), +rgba_from_u32_lit_comp(0x3f3f3ffd), +rgba_from_u32_lit_comp(0x2b2b2bfe), +rgba_from_u32_lit_comp(0x3f3f3ffe), +rgba_from_u32_lit_comp(0x6f5135fe), +rgba_from_u32_lit_comp(0xfefefe4d), +rgba_from_u32_lit_comp(0x3e4c577f), rgba_from_u32_lit_comp(0xffffff19), -rgba_from_u32_lit_comp(0x3333337f), -rgba_from_u32_lit_comp(0x3333337f), -rgba_from_u32_lit_comp(0xffffff19), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0x7fcc99ff), -rgba_from_u32_lit_comp(0x66b2e5ff), -rgba_from_u32_lit_comp(0xfe9548ff), -rgba_from_u32_lit_comp(0xd45d90ff), -rgba_from_u32_lit_comp(0xf7bf5eff), -rgba_from_u32_lit_comp(0x994c32ff), -rgba_from_u32_lit_comp(0x4ce54cff), -rgba_from_u32_lit_comp(0x4ca54cff), -rgba_from_u32_lit_comp(0xe5cc66ff), -rgba_from_u32_lit_comp(0xe54c4cff), +rgba_from_u32_lit_comp(0xcbcbcbff), +rgba_from_u32_lit_comp(0x42a2cffe), +rgba_from_u32_lit_comp(0xfec746ff), +rgba_from_u32_lit_comp(0x98bc80ff), +rgba_from_u32_lit_comp(0xb7afd5ff), +rgba_from_u32_lit_comp(0xb38d4cff), +rgba_from_u32_lit_comp(0x767676ff), +rgba_from_u32_lit_comp(0x98abb1ff), +rgba_from_u32_lit_comp(0x738287ff), +rgba_from_u32_lit_comp(0x98abb1ff), +rgba_from_u32_lit_comp(0xd96759ff), +rgba_from_u32_lit_comp(0x717171ff), rgba_from_u32_lit_comp(0x7f7f7fff), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0xbebebeff), rgba_from_u32_lit_comp(0x99503d3f), rgba_from_u32_lit_comp(0xfe82493f), rgba_from_u32_lit_comp(0xffba173f), @@ -542,7 +542,7 @@ rgba_from_u32_lit_comp(0xcefd693f), rgba_from_u32_lit_comp(0x99503d3f), rgba_from_u32_lit_comp(0xfe82493f), rgba_from_u32_lit_comp(0xffba173f), -rgba_from_u32_lit_comp(0x99503d3f), +rgba_from_u32_lit_comp(0xcefd693f), rgba_from_u32_lit_comp(0xffcb7fff), rgba_from_u32_lit_comp(0xb2ff65ff), rgba_from_u32_lit_comp(0xff99e5ff), @@ -553,67 +553,67 @@ rgba_from_u32_lit_comp(0x9932ffff), rgba_from_u32_lit_comp(0x65ff4cff), rgba_from_u32_lit_comp(0xb2ccd8ff), rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xa72911ff), }; Vec4F32 df_g_theme_preset_colors__vs_light[75] = { rgba_from_u32_lit_comp(0xff00ffff), rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0x32b219ff), -rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xffffff7f), -rgba_from_u32_lit_comp(0x66e566e5), -rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xb27219ff), -rgba_from_u32_lit_comp(0xb27219ff), +rgba_from_u32_lit_comp(0x4dc221ff), +rgba_from_u32_lit_comp(0xc56452ff), +rgba_from_u32_lit_comp(0x307eb2ff), +rgba_from_u32_lit_comp(0xa4a4a4fe), +rgba_from_u32_lit_comp(0x8aff00ff), +rgba_from_u32_lit_comp(0xb23217ff), +rgba_from_u32_lit_comp(0xfda200ff), +rgba_from_u32_lit_comp(0xffffffff), rgba_from_u32_lit_comp(0x0000007f), rgba_from_u32_lit_comp(0x0000003f), rgba_from_u32_lit_comp(0xffffff0c), rgba_from_u32_lit_comp(0x0000003f), rgba_from_u32_lit_comp(0x99ccff4c), -rgba_from_u32_lit_comp(0x0000003f), -rgba_from_u32_lit_comp(0x0000003f), -rgba_from_u32_lit_comp(0x3333337f), -rgba_from_u32_lit_comp(0x3333337f), +rgba_from_u32_lit_comp(0xffffff1e), +rgba_from_u32_lit_comp(0x5f12005f), +rgba_from_u32_lit_comp(0x1b1b1bfe), +rgba_from_u32_lit_comp(0x2b2b2bfe), +rgba_from_u32_lit_comp(0x3f3f3ffe), +rgba_from_u32_lit_comp(0x3e4c577f), +rgba_from_u32_lit_comp(0x3e4c577f), rgba_from_u32_lit_comp(0xffffff19), -rgba_from_u32_lit_comp(0x3333337f), -rgba_from_u32_lit_comp(0x3333337f), +rgba_from_u32_lit_comp(0x33333333), +rgba_from_u32_lit_comp(0x33333333), +rgba_from_u32_lit_comp(0x3f3f3ffd), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x1b1b1bfe), +rgba_from_u32_lit_comp(0x3f3f3ffe), +rgba_from_u32_lit_comp(0x2c5b36ff), +rgba_from_u32_lit_comp(0x3f3f3ffd), +rgba_from_u32_lit_comp(0x803425ff), +rgba_from_u32_lit_comp(0x3f3f3ffd), +rgba_from_u32_lit_comp(0x355b6eff), +rgba_from_u32_lit_comp(0x3f3f3ffd), +rgba_from_u32_lit_comp(0x2b2b2bfe), +rgba_from_u32_lit_comp(0x3f3f3ffe), +rgba_from_u32_lit_comp(0x6f5135fe), +rgba_from_u32_lit_comp(0xfefefe4d), +rgba_from_u32_lit_comp(0x3e4c577f), rgba_from_u32_lit_comp(0xffffff19), -rgba_from_u32_lit_comp(0x3333337f), -rgba_from_u32_lit_comp(0x3333337f), -rgba_from_u32_lit_comp(0xffffff19), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0x7fcc99ff), -rgba_from_u32_lit_comp(0x66b2e5ff), -rgba_from_u32_lit_comp(0xfe9548ff), -rgba_from_u32_lit_comp(0xd45d90ff), -rgba_from_u32_lit_comp(0xf7bf5eff), -rgba_from_u32_lit_comp(0x994c32ff), -rgba_from_u32_lit_comp(0x4ce54cff), -rgba_from_u32_lit_comp(0x4ca54cff), -rgba_from_u32_lit_comp(0xe5cc66ff), -rgba_from_u32_lit_comp(0xe54c4cff), +rgba_from_u32_lit_comp(0xcbcbcbff), +rgba_from_u32_lit_comp(0x42a2cffe), +rgba_from_u32_lit_comp(0xfec746ff), +rgba_from_u32_lit_comp(0x98bc80ff), +rgba_from_u32_lit_comp(0xb7afd5ff), +rgba_from_u32_lit_comp(0xb38d4cff), +rgba_from_u32_lit_comp(0x767676ff), +rgba_from_u32_lit_comp(0x98abb1ff), +rgba_from_u32_lit_comp(0x738287ff), +rgba_from_u32_lit_comp(0x98abb1ff), +rgba_from_u32_lit_comp(0xd96759ff), +rgba_from_u32_lit_comp(0x717171ff), rgba_from_u32_lit_comp(0x7f7f7fff), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0xbebebeff), rgba_from_u32_lit_comp(0x99503d3f), rgba_from_u32_lit_comp(0xfe82493f), rgba_from_u32_lit_comp(0xffba173f), @@ -621,7 +621,7 @@ rgba_from_u32_lit_comp(0xcefd693f), rgba_from_u32_lit_comp(0x99503d3f), rgba_from_u32_lit_comp(0xfe82493f), rgba_from_u32_lit_comp(0xffba173f), -rgba_from_u32_lit_comp(0x99503d3f), +rgba_from_u32_lit_comp(0xcefd693f), rgba_from_u32_lit_comp(0xffcb7fff), rgba_from_u32_lit_comp(0xb2ff65ff), rgba_from_u32_lit_comp(0xff99e5ff), @@ -632,67 +632,67 @@ rgba_from_u32_lit_comp(0x9932ffff), rgba_from_u32_lit_comp(0x65ff4cff), rgba_from_u32_lit_comp(0xb2ccd8ff), rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xa72911ff), }; Vec4F32 df_g_theme_preset_colors__solarized_dark[75] = { rgba_from_u32_lit_comp(0xff00ffff), rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0x32b219ff), -rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xffffff7f), -rgba_from_u32_lit_comp(0x66e566e5), -rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xb27219ff), -rgba_from_u32_lit_comp(0xb27219ff), +rgba_from_u32_lit_comp(0x4dc221ff), +rgba_from_u32_lit_comp(0xc56452ff), +rgba_from_u32_lit_comp(0x307eb2ff), +rgba_from_u32_lit_comp(0xa4a4a4fe), +rgba_from_u32_lit_comp(0x8aff00ff), +rgba_from_u32_lit_comp(0xb23217ff), +rgba_from_u32_lit_comp(0xfda200ff), +rgba_from_u32_lit_comp(0xffffffff), rgba_from_u32_lit_comp(0x0000007f), rgba_from_u32_lit_comp(0x0000003f), rgba_from_u32_lit_comp(0xffffff0c), rgba_from_u32_lit_comp(0x0000003f), rgba_from_u32_lit_comp(0x99ccff4c), -rgba_from_u32_lit_comp(0x0000003f), -rgba_from_u32_lit_comp(0x0000003f), -rgba_from_u32_lit_comp(0x3333337f), -rgba_from_u32_lit_comp(0x3333337f), +rgba_from_u32_lit_comp(0xffffff1e), +rgba_from_u32_lit_comp(0x5f12005f), +rgba_from_u32_lit_comp(0x1b1b1bfe), +rgba_from_u32_lit_comp(0x2b2b2bfe), +rgba_from_u32_lit_comp(0x3f3f3ffe), +rgba_from_u32_lit_comp(0x3e4c577f), +rgba_from_u32_lit_comp(0x3e4c577f), rgba_from_u32_lit_comp(0xffffff19), -rgba_from_u32_lit_comp(0x3333337f), -rgba_from_u32_lit_comp(0x3333337f), +rgba_from_u32_lit_comp(0x33333333), +rgba_from_u32_lit_comp(0x33333333), +rgba_from_u32_lit_comp(0x3f3f3ffd), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x1b1b1bfe), +rgba_from_u32_lit_comp(0x3f3f3ffe), +rgba_from_u32_lit_comp(0x2c5b36ff), +rgba_from_u32_lit_comp(0x3f3f3ffd), +rgba_from_u32_lit_comp(0x803425ff), +rgba_from_u32_lit_comp(0x3f3f3ffd), +rgba_from_u32_lit_comp(0x355b6eff), +rgba_from_u32_lit_comp(0x3f3f3ffd), +rgba_from_u32_lit_comp(0x2b2b2bfe), +rgba_from_u32_lit_comp(0x3f3f3ffe), +rgba_from_u32_lit_comp(0x6f5135fe), +rgba_from_u32_lit_comp(0xfefefe4d), +rgba_from_u32_lit_comp(0x3e4c577f), rgba_from_u32_lit_comp(0xffffff19), -rgba_from_u32_lit_comp(0x3333337f), -rgba_from_u32_lit_comp(0x3333337f), -rgba_from_u32_lit_comp(0xffffff19), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0x7fcc99ff), -rgba_from_u32_lit_comp(0x66b2e5ff), -rgba_from_u32_lit_comp(0xfe9548ff), -rgba_from_u32_lit_comp(0xd45d90ff), -rgba_from_u32_lit_comp(0xf7bf5eff), -rgba_from_u32_lit_comp(0x994c32ff), -rgba_from_u32_lit_comp(0x4ce54cff), -rgba_from_u32_lit_comp(0x4ca54cff), -rgba_from_u32_lit_comp(0xe5cc66ff), -rgba_from_u32_lit_comp(0xe54c4cff), +rgba_from_u32_lit_comp(0xcbcbcbff), +rgba_from_u32_lit_comp(0x42a2cffe), +rgba_from_u32_lit_comp(0xfec746ff), +rgba_from_u32_lit_comp(0x98bc80ff), +rgba_from_u32_lit_comp(0xb7afd5ff), +rgba_from_u32_lit_comp(0xb38d4cff), +rgba_from_u32_lit_comp(0x767676ff), +rgba_from_u32_lit_comp(0x98abb1ff), +rgba_from_u32_lit_comp(0x738287ff), +rgba_from_u32_lit_comp(0x98abb1ff), +rgba_from_u32_lit_comp(0xd96759ff), +rgba_from_u32_lit_comp(0x717171ff), rgba_from_u32_lit_comp(0x7f7f7fff), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0xbebebeff), rgba_from_u32_lit_comp(0x99503d3f), rgba_from_u32_lit_comp(0xfe82493f), rgba_from_u32_lit_comp(0xffba173f), @@ -700,7 +700,7 @@ rgba_from_u32_lit_comp(0xcefd693f), rgba_from_u32_lit_comp(0x99503d3f), rgba_from_u32_lit_comp(0xfe82493f), rgba_from_u32_lit_comp(0xffba173f), -rgba_from_u32_lit_comp(0x99503d3f), +rgba_from_u32_lit_comp(0xcefd693f), rgba_from_u32_lit_comp(0xffcb7fff), rgba_from_u32_lit_comp(0xb2ff65ff), rgba_from_u32_lit_comp(0xff99e5ff), @@ -711,67 +711,67 @@ rgba_from_u32_lit_comp(0x9932ffff), rgba_from_u32_lit_comp(0x65ff4cff), rgba_from_u32_lit_comp(0xb2ccd8ff), rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xa72911ff), }; Vec4F32 df_g_theme_preset_colors__solarized_light[75] = { rgba_from_u32_lit_comp(0xff00ffff), rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0x32b219ff), -rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xffffff7f), -rgba_from_u32_lit_comp(0x66e566e5), -rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xb27219ff), -rgba_from_u32_lit_comp(0xb27219ff), +rgba_from_u32_lit_comp(0x4dc221ff), +rgba_from_u32_lit_comp(0xc56452ff), +rgba_from_u32_lit_comp(0x307eb2ff), +rgba_from_u32_lit_comp(0xa4a4a4fe), +rgba_from_u32_lit_comp(0x8aff00ff), +rgba_from_u32_lit_comp(0xb23217ff), +rgba_from_u32_lit_comp(0xfda200ff), +rgba_from_u32_lit_comp(0xffffffff), rgba_from_u32_lit_comp(0x0000007f), rgba_from_u32_lit_comp(0x0000003f), rgba_from_u32_lit_comp(0xffffff0c), rgba_from_u32_lit_comp(0x0000003f), rgba_from_u32_lit_comp(0x99ccff4c), -rgba_from_u32_lit_comp(0x0000003f), -rgba_from_u32_lit_comp(0x0000003f), -rgba_from_u32_lit_comp(0x3333337f), -rgba_from_u32_lit_comp(0x3333337f), +rgba_from_u32_lit_comp(0xffffff1e), +rgba_from_u32_lit_comp(0x5f12005f), +rgba_from_u32_lit_comp(0x1b1b1bfe), +rgba_from_u32_lit_comp(0x2b2b2bfe), +rgba_from_u32_lit_comp(0x3f3f3ffe), +rgba_from_u32_lit_comp(0x3e4c577f), +rgba_from_u32_lit_comp(0x3e4c577f), rgba_from_u32_lit_comp(0xffffff19), -rgba_from_u32_lit_comp(0x3333337f), -rgba_from_u32_lit_comp(0x3333337f), +rgba_from_u32_lit_comp(0x33333333), +rgba_from_u32_lit_comp(0x33333333), +rgba_from_u32_lit_comp(0x3f3f3ffd), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x1b1b1bfe), +rgba_from_u32_lit_comp(0x3f3f3ffe), +rgba_from_u32_lit_comp(0x2c5b36ff), +rgba_from_u32_lit_comp(0x3f3f3ffd), +rgba_from_u32_lit_comp(0x803425ff), +rgba_from_u32_lit_comp(0x3f3f3ffd), +rgba_from_u32_lit_comp(0x355b6eff), +rgba_from_u32_lit_comp(0x3f3f3ffd), +rgba_from_u32_lit_comp(0x2b2b2bfe), +rgba_from_u32_lit_comp(0x3f3f3ffe), +rgba_from_u32_lit_comp(0x6f5135fe), +rgba_from_u32_lit_comp(0xfefefe4d), +rgba_from_u32_lit_comp(0x3e4c577f), rgba_from_u32_lit_comp(0xffffff19), -rgba_from_u32_lit_comp(0x3333337f), -rgba_from_u32_lit_comp(0x3333337f), -rgba_from_u32_lit_comp(0xffffff19), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0x7fcc99ff), -rgba_from_u32_lit_comp(0x66b2e5ff), -rgba_from_u32_lit_comp(0xfe9548ff), -rgba_from_u32_lit_comp(0xd45d90ff), -rgba_from_u32_lit_comp(0xf7bf5eff), -rgba_from_u32_lit_comp(0x994c32ff), -rgba_from_u32_lit_comp(0x4ce54cff), -rgba_from_u32_lit_comp(0x4ca54cff), -rgba_from_u32_lit_comp(0xe5cc66ff), -rgba_from_u32_lit_comp(0xe54c4cff), +rgba_from_u32_lit_comp(0xcbcbcbff), +rgba_from_u32_lit_comp(0x42a2cffe), +rgba_from_u32_lit_comp(0xfec746ff), +rgba_from_u32_lit_comp(0x98bc80ff), +rgba_from_u32_lit_comp(0xb7afd5ff), +rgba_from_u32_lit_comp(0xb38d4cff), +rgba_from_u32_lit_comp(0x767676ff), +rgba_from_u32_lit_comp(0x98abb1ff), +rgba_from_u32_lit_comp(0x738287ff), +rgba_from_u32_lit_comp(0x98abb1ff), +rgba_from_u32_lit_comp(0xd96759ff), +rgba_from_u32_lit_comp(0x717171ff), rgba_from_u32_lit_comp(0x7f7f7fff), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0xbebebeff), rgba_from_u32_lit_comp(0x99503d3f), rgba_from_u32_lit_comp(0xfe82493f), rgba_from_u32_lit_comp(0xffba173f), @@ -779,7 +779,7 @@ rgba_from_u32_lit_comp(0xcefd693f), rgba_from_u32_lit_comp(0x99503d3f), rgba_from_u32_lit_comp(0xfe82493f), rgba_from_u32_lit_comp(0xffba173f), -rgba_from_u32_lit_comp(0x99503d3f), +rgba_from_u32_lit_comp(0xcefd693f), rgba_from_u32_lit_comp(0xffcb7fff), rgba_from_u32_lit_comp(0xb2ff65ff), rgba_from_u32_lit_comp(0xff99e5ff), @@ -790,67 +790,67 @@ rgba_from_u32_lit_comp(0x9932ffff), rgba_from_u32_lit_comp(0x65ff4cff), rgba_from_u32_lit_comp(0xb2ccd8ff), rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xa72911ff), }; Vec4F32 df_g_theme_preset_colors__handmade_hero[75] = { rgba_from_u32_lit_comp(0xff00ffff), rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0x32b219ff), -rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xffffff7f), -rgba_from_u32_lit_comp(0x66e566e5), -rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xb27219ff), -rgba_from_u32_lit_comp(0xb27219ff), +rgba_from_u32_lit_comp(0x4dc221ff), +rgba_from_u32_lit_comp(0xc56452ff), +rgba_from_u32_lit_comp(0x307eb2ff), +rgba_from_u32_lit_comp(0xa4a4a4fe), +rgba_from_u32_lit_comp(0x8aff00ff), +rgba_from_u32_lit_comp(0xb23217ff), +rgba_from_u32_lit_comp(0xfda200ff), +rgba_from_u32_lit_comp(0xffffffff), rgba_from_u32_lit_comp(0x0000007f), rgba_from_u32_lit_comp(0x0000003f), rgba_from_u32_lit_comp(0xffffff0c), rgba_from_u32_lit_comp(0x0000003f), rgba_from_u32_lit_comp(0x99ccff4c), -rgba_from_u32_lit_comp(0x0000003f), -rgba_from_u32_lit_comp(0x0000003f), -rgba_from_u32_lit_comp(0x3333337f), -rgba_from_u32_lit_comp(0x3333337f), +rgba_from_u32_lit_comp(0xffffff1e), +rgba_from_u32_lit_comp(0x5f12005f), +rgba_from_u32_lit_comp(0x1b1b1bfe), +rgba_from_u32_lit_comp(0x2b2b2bfe), +rgba_from_u32_lit_comp(0x3f3f3ffe), +rgba_from_u32_lit_comp(0x3e4c577f), +rgba_from_u32_lit_comp(0x3e4c577f), rgba_from_u32_lit_comp(0xffffff19), -rgba_from_u32_lit_comp(0x3333337f), -rgba_from_u32_lit_comp(0x3333337f), +rgba_from_u32_lit_comp(0x33333333), +rgba_from_u32_lit_comp(0x33333333), +rgba_from_u32_lit_comp(0x3f3f3ffd), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x1b1b1bfe), +rgba_from_u32_lit_comp(0x3f3f3ffe), +rgba_from_u32_lit_comp(0x2c5b36ff), +rgba_from_u32_lit_comp(0x3f3f3ffd), +rgba_from_u32_lit_comp(0x803425ff), +rgba_from_u32_lit_comp(0x3f3f3ffd), +rgba_from_u32_lit_comp(0x355b6eff), +rgba_from_u32_lit_comp(0x3f3f3ffd), +rgba_from_u32_lit_comp(0x2b2b2bfe), +rgba_from_u32_lit_comp(0x3f3f3ffe), +rgba_from_u32_lit_comp(0x6f5135fe), +rgba_from_u32_lit_comp(0xfefefe4d), +rgba_from_u32_lit_comp(0x3e4c577f), rgba_from_u32_lit_comp(0xffffff19), -rgba_from_u32_lit_comp(0x3333337f), -rgba_from_u32_lit_comp(0x3333337f), -rgba_from_u32_lit_comp(0xffffff19), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0x7fcc99ff), -rgba_from_u32_lit_comp(0x66b2e5ff), -rgba_from_u32_lit_comp(0xfe9548ff), -rgba_from_u32_lit_comp(0xd45d90ff), -rgba_from_u32_lit_comp(0xf7bf5eff), -rgba_from_u32_lit_comp(0x994c32ff), -rgba_from_u32_lit_comp(0x4ce54cff), -rgba_from_u32_lit_comp(0x4ca54cff), -rgba_from_u32_lit_comp(0xe5cc66ff), -rgba_from_u32_lit_comp(0xe54c4cff), +rgba_from_u32_lit_comp(0xcbcbcbff), +rgba_from_u32_lit_comp(0x42a2cffe), +rgba_from_u32_lit_comp(0xfec746ff), +rgba_from_u32_lit_comp(0x98bc80ff), +rgba_from_u32_lit_comp(0xb7afd5ff), +rgba_from_u32_lit_comp(0xb38d4cff), +rgba_from_u32_lit_comp(0x767676ff), +rgba_from_u32_lit_comp(0x98abb1ff), +rgba_from_u32_lit_comp(0x738287ff), +rgba_from_u32_lit_comp(0x98abb1ff), +rgba_from_u32_lit_comp(0xd96759ff), +rgba_from_u32_lit_comp(0x717171ff), rgba_from_u32_lit_comp(0x7f7f7fff), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0xbebebeff), rgba_from_u32_lit_comp(0x99503d3f), rgba_from_u32_lit_comp(0xfe82493f), rgba_from_u32_lit_comp(0xffba173f), @@ -858,7 +858,7 @@ rgba_from_u32_lit_comp(0xcefd693f), rgba_from_u32_lit_comp(0x99503d3f), rgba_from_u32_lit_comp(0xfe82493f), rgba_from_u32_lit_comp(0xffba173f), -rgba_from_u32_lit_comp(0x99503d3f), +rgba_from_u32_lit_comp(0xcefd693f), rgba_from_u32_lit_comp(0xffcb7fff), rgba_from_u32_lit_comp(0xb2ff65ff), rgba_from_u32_lit_comp(0xff99e5ff), @@ -869,67 +869,67 @@ rgba_from_u32_lit_comp(0x9932ffff), rgba_from_u32_lit_comp(0x65ff4cff), rgba_from_u32_lit_comp(0xb2ccd8ff), rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xa72911ff), }; Vec4F32 df_g_theme_preset_colors__four_coder[75] = { rgba_from_u32_lit_comp(0xff00ffff), rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0x32b219ff), -rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xffffff7f), -rgba_from_u32_lit_comp(0x66e566e5), -rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xb27219ff), -rgba_from_u32_lit_comp(0xb27219ff), +rgba_from_u32_lit_comp(0x4dc221ff), +rgba_from_u32_lit_comp(0xc56452ff), +rgba_from_u32_lit_comp(0x307eb2ff), +rgba_from_u32_lit_comp(0xa4a4a4fe), +rgba_from_u32_lit_comp(0x8aff00ff), +rgba_from_u32_lit_comp(0xb23217ff), +rgba_from_u32_lit_comp(0xfda200ff), +rgba_from_u32_lit_comp(0xffffffff), rgba_from_u32_lit_comp(0x0000007f), rgba_from_u32_lit_comp(0x0000003f), rgba_from_u32_lit_comp(0xffffff0c), rgba_from_u32_lit_comp(0x0000003f), rgba_from_u32_lit_comp(0x99ccff4c), -rgba_from_u32_lit_comp(0x0000003f), -rgba_from_u32_lit_comp(0x0000003f), -rgba_from_u32_lit_comp(0x3333337f), -rgba_from_u32_lit_comp(0x3333337f), +rgba_from_u32_lit_comp(0xffffff1e), +rgba_from_u32_lit_comp(0x5f12005f), +rgba_from_u32_lit_comp(0x1b1b1bfe), +rgba_from_u32_lit_comp(0x2b2b2bfe), +rgba_from_u32_lit_comp(0x3f3f3ffe), +rgba_from_u32_lit_comp(0x3e4c577f), +rgba_from_u32_lit_comp(0x3e4c577f), rgba_from_u32_lit_comp(0xffffff19), -rgba_from_u32_lit_comp(0x3333337f), -rgba_from_u32_lit_comp(0x3333337f), +rgba_from_u32_lit_comp(0x33333333), +rgba_from_u32_lit_comp(0x33333333), +rgba_from_u32_lit_comp(0x3f3f3ffd), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x1b1b1bfe), +rgba_from_u32_lit_comp(0x3f3f3ffe), +rgba_from_u32_lit_comp(0x2c5b36ff), +rgba_from_u32_lit_comp(0x3f3f3ffd), +rgba_from_u32_lit_comp(0x803425ff), +rgba_from_u32_lit_comp(0x3f3f3ffd), +rgba_from_u32_lit_comp(0x355b6eff), +rgba_from_u32_lit_comp(0x3f3f3ffd), +rgba_from_u32_lit_comp(0x2b2b2bfe), +rgba_from_u32_lit_comp(0x3f3f3ffe), +rgba_from_u32_lit_comp(0x6f5135fe), +rgba_from_u32_lit_comp(0xfefefe4d), +rgba_from_u32_lit_comp(0x3e4c577f), rgba_from_u32_lit_comp(0xffffff19), -rgba_from_u32_lit_comp(0x3333337f), -rgba_from_u32_lit_comp(0x3333337f), -rgba_from_u32_lit_comp(0xffffff19), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0x7fcc99ff), -rgba_from_u32_lit_comp(0x66b2e5ff), -rgba_from_u32_lit_comp(0xfe9548ff), -rgba_from_u32_lit_comp(0xd45d90ff), -rgba_from_u32_lit_comp(0xf7bf5eff), -rgba_from_u32_lit_comp(0x994c32ff), -rgba_from_u32_lit_comp(0x4ce54cff), -rgba_from_u32_lit_comp(0x4ca54cff), -rgba_from_u32_lit_comp(0xe5cc66ff), -rgba_from_u32_lit_comp(0xe54c4cff), +rgba_from_u32_lit_comp(0xcbcbcbff), +rgba_from_u32_lit_comp(0x42a2cffe), +rgba_from_u32_lit_comp(0xfec746ff), +rgba_from_u32_lit_comp(0x98bc80ff), +rgba_from_u32_lit_comp(0xb7afd5ff), +rgba_from_u32_lit_comp(0xb38d4cff), +rgba_from_u32_lit_comp(0x767676ff), +rgba_from_u32_lit_comp(0x98abb1ff), +rgba_from_u32_lit_comp(0x738287ff), +rgba_from_u32_lit_comp(0x98abb1ff), +rgba_from_u32_lit_comp(0xd96759ff), +rgba_from_u32_lit_comp(0x717171ff), rgba_from_u32_lit_comp(0x7f7f7fff), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0xbebebeff), rgba_from_u32_lit_comp(0x99503d3f), rgba_from_u32_lit_comp(0xfe82493f), rgba_from_u32_lit_comp(0xffba173f), @@ -937,7 +937,7 @@ rgba_from_u32_lit_comp(0xcefd693f), rgba_from_u32_lit_comp(0x99503d3f), rgba_from_u32_lit_comp(0xfe82493f), rgba_from_u32_lit_comp(0xffba173f), -rgba_from_u32_lit_comp(0x99503d3f), +rgba_from_u32_lit_comp(0xcefd693f), rgba_from_u32_lit_comp(0xffcb7fff), rgba_from_u32_lit_comp(0xb2ff65ff), rgba_from_u32_lit_comp(0xff99e5ff), @@ -948,67 +948,67 @@ rgba_from_u32_lit_comp(0x9932ffff), rgba_from_u32_lit_comp(0x65ff4cff), rgba_from_u32_lit_comp(0xb2ccd8ff), rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xa72911ff), }; Vec4F32 df_g_theme_preset_colors__far_manager[75] = { rgba_from_u32_lit_comp(0xff00ffff), rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0x32b219ff), -rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xffffff7f), -rgba_from_u32_lit_comp(0x66e566e5), -rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xb27219ff), -rgba_from_u32_lit_comp(0xb27219ff), +rgba_from_u32_lit_comp(0x4dc221ff), +rgba_from_u32_lit_comp(0xc56452ff), +rgba_from_u32_lit_comp(0x307eb2ff), +rgba_from_u32_lit_comp(0xa4a4a4fe), +rgba_from_u32_lit_comp(0x8aff00ff), +rgba_from_u32_lit_comp(0xb23217ff), +rgba_from_u32_lit_comp(0xfda200ff), +rgba_from_u32_lit_comp(0xffffffff), rgba_from_u32_lit_comp(0x0000007f), rgba_from_u32_lit_comp(0x0000003f), rgba_from_u32_lit_comp(0xffffff0c), rgba_from_u32_lit_comp(0x0000003f), rgba_from_u32_lit_comp(0x99ccff4c), -rgba_from_u32_lit_comp(0x0000003f), -rgba_from_u32_lit_comp(0x0000003f), -rgba_from_u32_lit_comp(0x3333337f), -rgba_from_u32_lit_comp(0x3333337f), +rgba_from_u32_lit_comp(0xffffff1e), +rgba_from_u32_lit_comp(0x5f12005f), +rgba_from_u32_lit_comp(0x1b1b1bfe), +rgba_from_u32_lit_comp(0x2b2b2bfe), +rgba_from_u32_lit_comp(0x3f3f3ffe), +rgba_from_u32_lit_comp(0x3e4c577f), +rgba_from_u32_lit_comp(0x3e4c577f), rgba_from_u32_lit_comp(0xffffff19), -rgba_from_u32_lit_comp(0x3333337f), -rgba_from_u32_lit_comp(0x3333337f), +rgba_from_u32_lit_comp(0x33333333), +rgba_from_u32_lit_comp(0x33333333), +rgba_from_u32_lit_comp(0x3f3f3ffd), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0x1b1b1bfe), +rgba_from_u32_lit_comp(0x3f3f3ffe), +rgba_from_u32_lit_comp(0x2c5b36ff), +rgba_from_u32_lit_comp(0x3f3f3ffd), +rgba_from_u32_lit_comp(0x803425ff), +rgba_from_u32_lit_comp(0x3f3f3ffd), +rgba_from_u32_lit_comp(0x355b6eff), +rgba_from_u32_lit_comp(0x3f3f3ffd), +rgba_from_u32_lit_comp(0x2b2b2bfe), +rgba_from_u32_lit_comp(0x3f3f3ffe), +rgba_from_u32_lit_comp(0x6f5135fe), +rgba_from_u32_lit_comp(0xfefefe4d), +rgba_from_u32_lit_comp(0x3e4c577f), rgba_from_u32_lit_comp(0xffffff19), -rgba_from_u32_lit_comp(0x3333337f), -rgba_from_u32_lit_comp(0x3333337f), -rgba_from_u32_lit_comp(0xffffff19), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0x00000000), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0x7fcc99ff), -rgba_from_u32_lit_comp(0x66b2e5ff), -rgba_from_u32_lit_comp(0xfe9548ff), -rgba_from_u32_lit_comp(0xd45d90ff), -rgba_from_u32_lit_comp(0xf7bf5eff), -rgba_from_u32_lit_comp(0x994c32ff), -rgba_from_u32_lit_comp(0x4ce54cff), -rgba_from_u32_lit_comp(0x4ca54cff), -rgba_from_u32_lit_comp(0xe5cc66ff), -rgba_from_u32_lit_comp(0xe54c4cff), +rgba_from_u32_lit_comp(0xcbcbcbff), +rgba_from_u32_lit_comp(0x42a2cffe), +rgba_from_u32_lit_comp(0xfec746ff), +rgba_from_u32_lit_comp(0x98bc80ff), +rgba_from_u32_lit_comp(0xb7afd5ff), +rgba_from_u32_lit_comp(0xb38d4cff), +rgba_from_u32_lit_comp(0x767676ff), +rgba_from_u32_lit_comp(0x98abb1ff), +rgba_from_u32_lit_comp(0x738287ff), +rgba_from_u32_lit_comp(0x98abb1ff), +rgba_from_u32_lit_comp(0xd96759ff), +rgba_from_u32_lit_comp(0x717171ff), rgba_from_u32_lit_comp(0x7f7f7fff), -rgba_from_u32_lit_comp(0xe5e5e5ff), -rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0xbebebeff), rgba_from_u32_lit_comp(0x99503d3f), rgba_from_u32_lit_comp(0xfe82493f), rgba_from_u32_lit_comp(0xffba173f), @@ -1016,7 +1016,7 @@ rgba_from_u32_lit_comp(0xcefd693f), rgba_from_u32_lit_comp(0x99503d3f), rgba_from_u32_lit_comp(0xfe82493f), rgba_from_u32_lit_comp(0xffba173f), -rgba_from_u32_lit_comp(0x99503d3f), +rgba_from_u32_lit_comp(0xcefd693f), rgba_from_u32_lit_comp(0xffcb7fff), rgba_from_u32_lit_comp(0xb2ff65ff), rgba_from_u32_lit_comp(0xff99e5ff), @@ -1027,7 +1027,7 @@ rgba_from_u32_lit_comp(0x9932ffff), rgba_from_u32_lit_comp(0x65ff4cff), rgba_from_u32_lit_comp(0xb2ccd8ff), rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xb23219ff), +rgba_from_u32_lit_comp(0xa72911ff), }; Vec4F32* df_g_theme_preset_colors_table[9] = From 7d351d03c59adcf5ccf6329aa9ce65a0c040a176 Mon Sep 17 00:00:00 2001 From: Ryan Fleury Date: Wed, 26 Jun 2024 07:37:52 -0700 Subject: [PATCH 31/47] txt: split symbol tokens in language lexers to defaultly do single-char symbols unless in special cases; this resolves weird indirection-size-change code label displays --- src/text_cache/text_cache.c | 240 ++++++++++++++++++++++++++++++++++-- 1 file changed, 232 insertions(+), 8 deletions(-) diff --git a/src/text_cache/text_cache.c b/src/text_cache/text_cache.c index 11924354..3e8b7d60 100644 --- a/src/text_cache/text_cache.c +++ b/src/text_cache/text_cache.c @@ -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; From c2ddffd4243c218b5c15d1a30102c0f1d67e8cb4 Mon Sep 17 00:00:00 2001 From: Ryan Fleury Date: Wed, 26 Jun 2024 09:21:51 -0700 Subject: [PATCH 32/47] set up interaction register push/pops for windows & views; use to implement top-level cursor-breakpoint operations; more convergence with new unified src view path --- src/df/core/df_core.c | 25 ++- src/df/core/df_core.h | 6 +- src/df/gfx/df_gfx.c | 288 +++++++++++++++++++++-------- src/df/gfx/df_gfx.h | 4 + src/df/gfx/df_gfx.mdesk | 4 + src/df/gfx/df_views.c | 65 ++++--- src/df/gfx/df_views.h | 2 - src/df/gfx/generated/df_gfx.meta.c | 24 ++- src/df/gfx/generated/df_gfx.meta.h | 12 +- src/raddbg/raddbg.c | 6 + 10 files changed, 310 insertions(+), 126 deletions(-) diff --git a/src/df/core/df_core.c b/src/df/core/df_core.c index 208c2e48..38445b33 100644 --- a/src/df/core/df_core.c +++ b/src/df/core/df_core.c @@ -6981,7 +6981,8 @@ df_core_begin_frame(Arena *arena, DF_CmdList *cmds, F32 dt) df_state->dt = dt; df_state->time_in_seconds += dt; df_state->top_interact_regs = &df_state->base_interact_regs; - MemoryZeroStruct(df_state->top_interact_regs); + df_state->top_interact_regs->v.lines = df_line_list_copy(df_frame_arena(), &df_state->top_interact_regs->v.lines); + df_state->top_interact_regs->v.dbgi_key = di_key_copy(df_frame_arena(), &df_state->top_interact_regs->v.dbgi_key); //- rjf: sync with ctrl thread ProfScope("sync with ctrl thread") @@ -8877,6 +8878,10 @@ df_core_begin_frame(Arena *arena, DF_CmdList *cmds, F32 dt) case DF_CoreCmdKind_TextBreakpoint: { DF_Entity *entity = df_entity_from_handle(params.entity); + if(df_entity_is_nil(entity)) + { + entity = df_entity_from_path(params.file_path, 0); + } if(!df_entity_is_nil(entity)) { S64 line_num = params.text_point.line; @@ -8952,6 +8957,24 @@ df_core_begin_frame(Arena *arena, DF_CmdList *cmds, F32 dt) } } }break; + case DF_CoreCmdKind_ToggleBreakpointAtCursor: + { + DF_InteractRegs *regs = df_interact_regs(); + DF_Entity *file = df_entity_from_handle(regs->file); + if(file->kind == DF_EntityKind_File && regs->cursor.line != 0) + { + DF_CmdParams p = df_cmd_params_zero(); + p.entity = df_handle_from_entity(file); + p.text_point = regs->cursor; + df_cmd_list_push(arena, cmds, &p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_TextBreakpoint)); + } + else if(regs->vaddr_range.min != 0) + { + DF_CmdParams p = df_cmd_params_zero(); + p.vaddr = regs->vaddr_range.min; + df_cmd_list_push(arena, cmds, &p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_AddressBreakpoint)); + } + }break; //- rjf: watches case DF_CoreCmdKind_ToggleWatchPin: diff --git a/src/df/core/df_core.h b/src/df/core/df_core.h index 5d4df49e..e10c1f38 100644 --- a/src/df/core/df_core.h +++ b/src/df/core/df_core.h @@ -662,6 +662,8 @@ struct DF_InteractRegs DF_Handle window; DF_Handle panel; DF_Handle view; + DF_Handle module; + DF_Handle process; DF_Handle thread; DF_Handle file; TxtPt cursor; @@ -670,8 +672,10 @@ struct DF_InteractRegs U64 inline_unwind_count; U128 text_key; TXT_LangKind lang_kind; + Rng1U64 vaddr_range; + Rng1U64 voff_range; DF_LineList lines; - U64 vaddr; + DI_Key dbgi_key; }; typedef struct DF_InteractRegsNode DF_InteractRegsNode; diff --git a/src/df/gfx/df_gfx.c b/src/df/gfx/df_gfx.c index 5cd0e511..01b634e3 100644 --- a/src/df/gfx/df_gfx.c +++ b/src/df/gfx/df_gfx.c @@ -3413,6 +3413,13 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) } } + ////////////////////////////// + //- rjf: fill window/panel/view interaction registers + // + df_interact_regs()->window = df_handle_from_window(ws); + df_interact_regs()->panel = df_handle_from_panel(ws->focused_panel); + df_interact_regs()->view = ws->focused_panel->selected_tab_view; + ////////////////////////////// //- rjf: process view-level commands on leaf panels // @@ -3429,8 +3436,14 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) DF_View *view = df_selected_tab_from_panel(panel); if(!df_view_is_nil(view)) { + df_push_interact_regs(); DF_ViewCmdFunctionType *do_view_cmds_function = view->spec->info.cmd_hook; do_view_cmds_function(ws, panel, view, cmds); + DF_InteractRegs *view_regs = df_pop_interact_regs(); + if(panel == ws->focused_panel) + { + MemoryCopyStruct(df_interact_regs(), view_regs); + } } } } @@ -3614,76 +3627,101 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) } } - //- rjf: stats & info + ui_divider(ui_em(1.f, 1.f)); + + //- rjf: draw current interaction regs { - //- rjf: draw per-window stats - for(DF_Window *window = df_gfx_state->first_window; window != 0; window = window->next) + DF_InteractRegs *regs = df_interact_regs(); +#define Handle(name) ui_labelf("%s: [0x%I64x, 0x%I64x]", #name, (regs->name).u64[0], (regs->name).u64[1]) + Handle(window); + Handle(panel); + Handle(view); + Handle(module); + Handle(process); + Handle(thread); + Handle(file); +#undef Handle + ui_labelf("cursor: (L:%I64d, C:%I64d)", regs->cursor.line, regs->cursor.column); + ui_labelf("mark: (L:%I64d, C:%I64d)", regs->mark.line, regs->mark.column); + ui_labelf("unwind_count: %I64u", regs->unwind_count); + ui_labelf("inline_unwind_count: %I64u", regs->inline_unwind_count); + ui_labelf("text_key: [0x%I64x, 0x%I64x]", regs->text_key.u64[0], regs->text_key.u64[1]); + ui_labelf("lang_kind: '%S'", txt_extension_from_lang_kind(regs->lang_kind)); + ui_labelf("vaddr_range: [0x%I64x, 0x%I64x)", regs->vaddr_range.min, regs->vaddr_range.max); + ui_labelf("voff_range: [0x%I64x, 0x%I64x)", regs->voff_range.min, regs->voff_range.max); + } + + ui_divider(ui_em(1.f, 1.f)); + + //- rjf: draw per-window stats + for(DF_Window *window = df_gfx_state->first_window; window != 0; window = window->next) + { + // rjf: calc ui hash chain length + F64 avg_ui_hash_chain_length = 0; { - // rjf: calc ui hash chain length - F64 avg_ui_hash_chain_length = 0; + F64 chain_count = 0; + F64 chain_length_sum = 0; + for(U64 idx = 0; idx < ws->ui->box_table_size; idx += 1) { - F64 chain_count = 0; - F64 chain_length_sum = 0; - for(U64 idx = 0; idx < ws->ui->box_table_size; idx += 1) + F64 chain_length = 0; + for(UI_Box *b = ws->ui->box_table[idx].hash_first; !ui_box_is_nil(b); b = b->hash_next) { - F64 chain_length = 0; - for(UI_Box *b = ws->ui->box_table[idx].hash_first; !ui_box_is_nil(b); b = b->hash_next) - { - chain_length += 1; - } - if(chain_length > 0) - { - chain_length_sum += chain_length; - chain_count += 1; - } + chain_length += 1; + } + if(chain_length > 0) + { + chain_length_sum += chain_length; + chain_count += 1; } - avg_ui_hash_chain_length = chain_length_sum / chain_count; } - ui_labelf("Target Hz: %.2f", 1.f/df_dt()); - ui_labelf("Ctrl Run Index: %I64u", ctrl_run_gen()); - ui_labelf("Ctrl Mem Gen Index: %I64u", ctrl_mem_gen()); - ui_labelf("Window %p", window); - ui_set_next_pref_width(ui_children_sum(1)); - ui_set_next_pref_height(ui_children_sum(1)); - UI_Row + avg_ui_hash_chain_length = chain_length_sum / chain_count; + } + ui_labelf("Target Hz: %.2f", 1.f/df_dt()); + ui_labelf("Ctrl Run Index: %I64u", ctrl_run_gen()); + ui_labelf("Ctrl Mem Gen Index: %I64u", ctrl_mem_gen()); + ui_labelf("Window %p", window); + ui_set_next_pref_width(ui_children_sum(1)); + ui_set_next_pref_height(ui_children_sum(1)); + UI_Row + { + ui_spacer(ui_em(2.f, 1.f)); + ui_labelf("Box Count: %I64u", window->ui->last_build_box_count); + } + ui_set_next_pref_width(ui_children_sum(1)); + ui_set_next_pref_height(ui_children_sum(1)); + UI_Row + { + ui_spacer(ui_em(2.f, 1.f)); + ui_labelf("Average UI Hash Chain Length: %f", avg_ui_hash_chain_length); + } + } + + ui_divider(ui_em(1.f, 1.f)); + + //- rjf: draw entity tree + DF_EntityRec rec = {0}; + S32 indent = 0; + UI_PrefWidth(ui_text_dim(10, 1)) ui_labelf("Entity Tree:"); + for(DF_Entity *e = df_entity_root(); !df_entity_is_nil(e); e = rec.next) + { + ui_set_next_pref_width(ui_children_sum(1)); + ui_set_next_pref_height(ui_children_sum(1)); + UI_Row + { + ui_spacer(ui_em(2.f*indent, 1.f)); + if(e->kind == DF_EntityKind_OverrideFileLink) { - ui_spacer(ui_em(2.f, 1.f)); - ui_labelf("Box Count: %I64u", window->ui->last_build_box_count); + DF_Entity *dst = df_entity_from_handle(e->entity_handle); + ui_labelf("[link] %S -> %S", e->name, dst->name); } - ui_set_next_pref_width(ui_children_sum(1)); - ui_set_next_pref_height(ui_children_sum(1)); - UI_Row + else { - ui_spacer(ui_em(2.f, 1.f)); - ui_labelf("Average UI Hash Chain Length: %f", avg_ui_hash_chain_length); + ui_labelf("%S: %S", df_g_entity_kind_display_string_table[e->kind], e->name); } } - - //- rjf: draw entity tree - DF_EntityRec rec = {0}; - S32 indent = 0; - UI_PrefWidth(ui_text_dim(10, 1)) ui_labelf("Entity Tree:"); - for(DF_Entity *e = df_entity_root(); !df_entity_is_nil(e); e = rec.next) - { - ui_set_next_pref_width(ui_children_sum(1)); - ui_set_next_pref_height(ui_children_sum(1)); - UI_Row - { - ui_spacer(ui_em(2.f*indent, 1.f)); - if(e->kind == DF_EntityKind_OverrideFileLink) - { - DF_Entity *dst = df_entity_from_handle(e->entity_handle); - ui_labelf("[link] %S -> %S", e->name, dst->name); - } - else - { - ui_labelf("%S: %S", df_g_entity_kind_display_string_table[e->kind], e->name); - } - } - rec = df_entity_rec_df_pre(e, df_entity_root()); - indent += rec.push_count; - indent -= rec.pop_count; - } + rec = df_entity_rec_df_pre(e, df_entity_root()); + indent += rec.push_count; + indent -= rec.pop_count; } } } @@ -3724,7 +3762,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) os_set_clipboard_text(copy_data); ui_ctx_menu_close(); } - if(range.min.line == range.max.line && ui_clicked(df_icon_buttonf(DF_IconKind_RightArrow, 0, "Move Thread Here"))) + if(range.min.line == range.max.line && ui_clicked(df_icon_buttonf(DF_IconKind_RightArrow, 0, "Set Next Statement"))) { DF_Entity *thread = df_entity_from_handle(ctrl_ctx.thread); U64 new_rip_vaddr = ws->code_ctx_menu_vaddr; @@ -7121,6 +7159,20 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) UI_Focus(panel_is_focused ? UI_FocusKind_Null : UI_FocusKind_Off) UI_WidthFill { + //- rjf: push interaction registers, fill with per-view states + df_push_interact_regs(); + { + DF_View *view = df_selected_tab_from_panel(panel); + DF_Entity *entity = df_entity_from_handle(view->entity); + df_interact_regs()->cursor = view->cursor; + df_interact_regs()->mark = view->mark; + switch(entity->kind) + { + default:{}break; + case DF_EntityKind_File:{df_interact_regs()->file = view->entity;}break; + } + } + //- rjf: build view container UI_Box *view_container_box = &ui_g_nil_box; UI_FixedWidth(dim_2f32(content_rect).x) @@ -7143,6 +7195,13 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) DF_ViewUIFunctionType *build_view_ui_function = view->spec->info.ui_hook; build_view_ui_function(ws, panel, view, content_rect); } + + //- rjf: pop interaction registers; commit if this is the selected view + DF_InteractRegs *view_regs = df_pop_interact_regs(); + if(panel_is_focused) + { + MemoryCopyStruct(df_interact_regs(), view_regs); + } } ////////////////////////// @@ -10278,7 +10337,15 @@ df_entity_tooltips(DF_Entity *entity) String8 explanation = df_stop_explanation_string_icon_from_ctrl_event(scratch.arena, &stop_event, &icon_kind); if(explanation.size != 0) { - UI_PrefWidth(ui_children_sum(1)) UI_Row DF_Palette(DF_PaletteCode_NegativePopButton) + UI_Palette *palette = ui_top_palette(); + if(stop_event.cause == CTRL_EventCause_Error || + stop_event.cause == CTRL_EventCause_InterruptedByException || + stop_event.cause == CTRL_EventCause_InterruptedByTrap || + stop_event.cause == CTRL_EventCause_UserBreakpoint) + { + palette = ui_build_palette(ui_top_palette(), .text = df_rgba_from_theme_color(DF_ThemeColor_TextNegative)); + } + UI_PrefWidth(ui_children_sum(1)) UI_Row UI_Palette(palette) { UI_PrefWidth(ui_em(1.5f, 1.f)) UI_Font(df_font_from_slot(DF_FontSlot_Icons)) @@ -10655,6 +10722,7 @@ internal UI_BOX_CUSTOM_DRAW(df_thread_box_draw_extensions) DF_ThreadBoxDrawExtData *u = (DF_ThreadBoxDrawExtData *)box->custom_draw_user_data; // rjf: draw line before next-to-execute line + if(df_setting_val_from_code(DF_SettingCode_ThreadLines).s32) { R_Rect2DInst *inst = d_rect(r2f32p(box->parent->parent->parent->rect.x0, box->parent->rect.y0 - box->font_size*0.125f, @@ -10679,7 +10747,7 @@ internal UI_BOX_CUSTOM_DRAW(df_thread_box_draw_extensions) } // rjf: draw slight fill on selected thread - if(u->is_selected) + if(u->is_selected && df_setting_val_from_code(DF_SettingCode_ThreadGlow).s32) { Vec4F32 weak_thread_color = u->thread_color; weak_thread_color.w *= 0.3f; @@ -10719,6 +10787,7 @@ internal UI_BOX_CUSTOM_DRAW(df_bp_box_draw_extensions) DF_BreakpointBoxDrawExtData *u = (DF_BreakpointBoxDrawExtData *)box->custom_draw_user_data; // rjf: draw line before next-to-execute line + if(df_setting_val_from_code(DF_SettingCode_BreakpointLines).s32) { R_Rect2DInst *inst = d_rect(r2f32p(box->parent->parent->parent->rect.x0, box->parent->rect.y0 - box->font_size*0.125f, @@ -10730,6 +10799,7 @@ internal UI_BOX_CUSTOM_DRAW(df_bp_box_draw_extensions) } // rjf: draw slight fill + if(df_setting_val_from_code(DF_SettingCode_BreakpointGlow).s32) { Vec4F32 weak_thread_color = u->color; weak_thread_color.w *= 0.3f; @@ -11294,10 +11364,25 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ } } } + + // rjf: empty margin interaction UI_Signal line_margin_sig = ui_signal_from_box(line_margin_box); if(ui_clicked(line_margin_sig)) { - result.clicked_margin_line_num = line_num; + if(!df_entity_is_nil(code_ctx->file)) + { + TxtPt pt = txt_pt(line_num, 1); + DF_CmdParams p = df_cmd_params_from_window(ws); + p.entity = df_handle_from_entity(code_ctx->file); + p.text_point = pt; + df_push_cmd__root(&p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_TextBreakpoint)); + } + else if(params->line_vaddrs[line_idx] != 0) + { + DF_CmdParams p = df_cmd_params_from_window(ws); + p.vaddr = params->line_vaddrs[line_idx]; + df_push_cmd__root(&p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_AddressBreakpoint)); + } } } } @@ -11681,17 +11766,60 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ } //- rjf: drop target is dropped -> process - // TODO(rjf): @src_collapse -#if 0 { DF_DragDropPayload payload = {0}; - if(!df_entity_is_nil(line_drag_entity) && df_drag_drop(&payload)) + if(!df_entity_is_nil(line_drag_entity) && df_drag_drop(&payload) && contains_1s64(params->line_num_range, mouse_pt.line)) { - result.dropped_entity = line_drag_entity; - result.dropped_entity_line_num = mouse_pt.line; + DF_Entity *dropped_entity = line_drag_entity; + S64 line_num = mouse_pt.line; + U64 line_idx = line_num - params->line_num_range.min; + U64 line_vaddr = params->line_vaddrs[line_idx]; + switch(dropped_entity->kind) + { + default:{}break; + case DF_EntityKind_Breakpoint: + case DF_EntityKind_WatchPin: + { + if(!df_entity_is_nil(code_ctx->file)) + { + df_entity_change_parent(0, dropped_entity, dropped_entity->parent, code_ctx->file); + df_entity_equip_txt_pt(dropped_entity, txt_pt(line_num, 1)); + if(dropped_entity->flags & DF_EntityFlag_HasVAddr) + { + dropped_entity->flags &= ~DF_EntityFlag_HasVAddr; + } + } + else if(line_vaddr != 0) + { + df_entity_change_parent(0, dropped_entity, dropped_entity->parent, df_entity_root()); + df_entity_equip_vaddr(dropped_entity, line_vaddr); + } + }break; + case DF_EntityKind_Thread: + { + U64 new_rip_vaddr = line_vaddr; + if(!df_entity_is_nil(code_ctx->file)) + { + DF_LineList *lines = ¶ms->line_infos[line_idx]; + for(DF_LineNode *n = lines->first; n != 0; n = n->next) + { + DF_EntityList modules = df_modules_from_dbgi_key(scratch.arena, &n->v.dbgi_key); + DF_Entity *module = df_module_from_thread_candidates(dropped_entity, &modules); + if(!df_entity_is_nil(module)) + { + new_rip_vaddr = df_vaddr_from_voff(module, n->v.voff_range.min); + break; + } + } + } + DF_CmdParams p = df_cmd_params_from_window(ws); + p.entity = df_handle_from_entity(dropped_entity); + p.vaddr = new_rip_vaddr; + df_push_cmd__root(&p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_SetThreadIP)); + }break; + } } } -#endif //- rjf: commit text container signal to main output result.base = text_container_sig; @@ -11702,6 +11830,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ // TxtRng mouse_expr_rng = {0}; Vec2F32 mouse_expr_baseline_pos = {0}; + String8 mouse_expr = {0}; if(ui_hovering(text_container_sig) && contains_1s64(params->line_num_range, mouse_pt.line)) ProfScope("mouse -> expression range") { TxtRng selected_rng = txt_rng(*cursor, *mark); @@ -11715,6 +11844,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ result.mouse_expr_rng = mouse_expr_rng = selected_rng; result.mouse_expr_baseline_pos = mouse_expr_baseline_pos = v2f32(text_container_box->rect.x0+expr_hoff_px, text_container_box->rect.y0+line_slice_idx*params->line_height_px + params->line_height_px*0.85f); + mouse_expr = str8_substr(line_text, r1u64(selected_rng.min.column-1, selected_rng.max.column-1)); } else { @@ -11723,13 +11853,14 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ TXT_TokenArray line_tokens = params->line_tokens[line_slice_idx]; Rng1U64 line_range = params->line_ranges[line_slice_idx]; U64 mouse_pt_off = line_range.min + (mouse_pt.column-1); - Rng1U64 expr_off_rng = txti_expr_range_from_line_off_range_string_tokens(mouse_pt_off, line_range, line_text, &line_tokens); + Rng1U64 expr_off_rng = txt_expr_off_range_from_line_off_range_string_tokens(mouse_pt_off, line_range, line_text, &line_tokens); if(expr_off_rng.max != expr_off_rng.min) { F32 expr_hoff_px = params->line_num_width_px + f_dim_from_tag_size_string(params->font, params->font_size, 0, params->tab_size, str8_prefix(line_text, expr_off_rng.min-line_range.min)).x; result.mouse_expr_rng = mouse_expr_rng = txt_rng(txt_pt(mouse_pt.line, 1+(expr_off_rng.min-line_range.min)), txt_pt(mouse_pt.line, 1+(expr_off_rng.max-line_range.min))); result.mouse_expr_baseline_pos = mouse_expr_baseline_pos = v2f32(text_container_box->rect.x0+expr_hoff_px, text_container_box->rect.y0+line_slice_idx*params->line_height_px + params->line_height_px*0.85f); + mouse_expr = str8_substr(line_text, r1u64(expr_off_rng.min-line_range.min, expr_off_rng.max-line_range.min)); } } } @@ -11756,21 +11887,16 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ ////////////////////////////// //- rjf: hover eval // -#if 0 - if(!ui_dragging(text_container_sig) && sig.mouse_expr_rng.min.line != 0 && sig.base.event_flags == 0) + if(!ui_dragging(text_container_sig) && text_container_sig.event_flags == 0 && mouse_expr.size != 0) { - TxtRng expr_rng = mouse_expr_rng; - String8 expr = txt_string_from_info_data_txt_rng(&text_info, data, expr_rng); - if(expr.size != 0) + DI_Scope *di_scope = di_scope_open(); + DF_Eval eval = df_eval_from_string(scratch.arena, di_scope, ctrl_ctx, parse_ctx, &eval_string2expr_map_nil, mouse_expr); + if(eval.mode != EVAL_EvalMode_NULL) { - DF_Eval eval = df_eval_from_string(scratch.arena, di_scope, &ctrl_ctx, &parse_ctx, &eval_string2expr_map_nil, expr); - if(eval.mode != EVAL_EvalMode_NULL) - { - df_set_hover_eval(ws, mouse_expr_baseline_pos, ctrl_ctx, entity, sig.mouse_pt, 0, expr); - } + df_set_hover_eval(ws, mouse_expr_baseline_pos, *ctrl_ctx, code_ctx->file, mouse_pt, 0, mouse_expr); } + di_scope_close(di_scope); } -#endif ////////////////////////////// //- rjf: dragging entity which applies to lines over this slice -> visualize diff --git a/src/df/gfx/df_gfx.h b/src/df/gfx/df_gfx.h index afe3e7ab..5eb09b77 100644 --- a/src/df/gfx/df_gfx.h +++ b/src/df/gfx/df_gfx.h @@ -199,6 +199,8 @@ struct DF_View // rjf: view state UI_ScrollPt2 scroll_pos; + TxtPt cursor; + TxtPt mark; // rjf: ctrl context overrides DF_CtrlCtx ctrl_ctx_overrides; @@ -836,6 +838,8 @@ read_only global DF_View df_g_nil_view = 0, {0}, {0}, + {0}, + {0}, 0, 0, 0, diff --git a/src/df/gfx/df_gfx.mdesk b/src/df/gfx/df_gfx.mdesk index b86819b8..6c6814b5 100644 --- a/src/df/gfx/df_gfx.mdesk +++ b/src/df/gfx/df_gfx.mdesk @@ -625,6 +625,10 @@ DF_SettingTable: {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 0 32 } } diff --git a/src/df/gfx/df_views.c b/src/df/gfx/df_views.c index 2a7d9eaf..3bc78c32 100644 --- a/src/df/gfx/df_views.c +++ b/src/df/gfx/df_views.c @@ -378,9 +378,9 @@ df_code_view_init(DF_CodeViewState *cv, DF_View *view) if(cv->initialized == 0) { cv->initialized = 1; - cv->cursor = cv->mark = txt_pt(1, 1); cv->preferred_column = 1; cv->find_text_arena = df_view_push_arena_ext(view); + view->cursor = view->mark = txt_pt(1, 1); } df_view_equip_loading_info(view, 1, 0, 0); view->loading_t = view->loading_t_target = 1.f; @@ -436,10 +436,10 @@ df_code_view_cmds(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewStat // rjf: determine expression range Rng1U64 expr_range = {0}; { - TxtRng selection_range = txt_rng(cv->cursor, cv->mark); + TxtRng selection_range = txt_rng(view->cursor, view->mark); if(txt_pt_match(selection_range.min, selection_range.max)) { - expr_range = txt_expr_off_range_from_info_data_pt(info, data, cv->cursor); + expr_range = txt_expr_off_range_from_info_data_pt(info, data, view->cursor); } else { @@ -469,10 +469,10 @@ df_code_view_cmds(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewStat // rjf: determine expression range Rng1U64 expr_range = {0}; { - TxtRng selection_range = txt_rng(cv->cursor, cv->mark); + TxtRng selection_range = txt_rng(view->cursor, view->mark); if(txt_pt_match(selection_range.min, selection_range.max)) { - expr_range = txt_expr_off_range_from_info_data_pt(info, data, cv->cursor); + expr_range = txt_expr_off_range_from_info_data_pt(info, data, view->cursor); } else { @@ -730,7 +730,7 @@ df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewSta Temp scratch = scratch_begin(0, 0); B32 found = 0; B32 first = 1; - S64 line_num_start = cv->cursor.line; + S64 line_num_start = view->cursor.line; S64 line_num_last = (S64)info->lines_count; for(S64 line_num = line_num_start;; first = 0) { @@ -740,18 +740,18 @@ df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewSta // rjf: gather line info String8 line_string = str8_substr(data, info->lines_ranges[line_num-1]); U64 search_start = 0; - if(cv->cursor.line == line_num && first) + if(view->cursor.line == line_num && first) { - search_start = cv->cursor.column; + search_start = view->cursor.column; } // rjf: search string U64 needle_pos = str8_find_needle(line_string, search_start, cv->find_text_fwd, StringMatchFlag_CaseInsensitive); if(needle_pos < line_string.size) { - cv->cursor.line = line_num; - cv->cursor.column = needle_pos+1; - cv->mark = cv->cursor; + view->cursor.line = line_num; + view->cursor.column = needle_pos+1; + view->mark = view->cursor; found = 1; break; } @@ -786,7 +786,7 @@ df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewSta Temp scratch = scratch_begin(0, 0); B32 found = 0; B32 first = 1; - S64 line_num_start = cv->cursor.line; + S64 line_num_start = view->cursor.line; S64 line_num_last = (S64)info->lines_count; for(S64 line_num = line_num_start;; first = 0) { @@ -795,9 +795,9 @@ df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewSta // rjf: gather line info String8 line_string = str8_substr(data, info->lines_ranges[line_num-1]); - if(cv->cursor.line == line_num && first) + if(view->cursor.line == line_num && first) { - line_string = str8_prefix(line_string, cv->cursor.column-1); + line_string = str8_prefix(line_string, view->cursor.column-1); } // rjf: search string @@ -813,9 +813,9 @@ df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewSta } if(next_needle_pos < line_string.size) { - cv->cursor.line = line_num; - cv->cursor.column = next_needle_pos+1; - cv->mark = cv->cursor; + view->cursor.line = line_num; + view->cursor.column = next_needle_pos+1; + view->mark = view->cursor; found = 1; break; } @@ -857,7 +857,7 @@ df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewSta S64 line_num = cv->goto_line_num; cv->goto_line_num = 0; line_num = Clamp(1, line_num, info->lines_count); - cv->cursor = cv->mark = txt_pt(line_num, 1); + view->cursor = view->mark = txt_pt(line_num, 1); cv->center_cursor = !cv->contain_cursor || (line_num < target_visible_line_num_range.min+4 || target_visible_line_num_range.max-4 < line_num); } @@ -869,7 +869,7 @@ df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewSta { if(ui_is_focus_active() && visible_line_num_range.max >= visible_line_num_range.min) { - snap[Axis2_X] = snap[Axis2_Y] = df_do_txt_controls(info, data, ClampBot(num_possible_visible_lines, 10) - 10, &cv->cursor, &cv->mark, &cv->preferred_column); + snap[Axis2_X] = snap[Axis2_Y] = df_do_txt_controls(info, data, ClampBot(num_possible_visible_lines, 10) - 10, &view->cursor, &view->mark, &cv->preferred_column); } } @@ -886,7 +886,7 @@ df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewSta DF_CodeSliceSignal sig = {0}; UI_Focus(UI_FocusKind_On) { - sig = df_code_slicef(ws, &ctrl_ctx, &parse_ctx, code_ctx, &code_slice_params, &cv->cursor, &cv->mark, &cv->preferred_column, "txt_view_%p", view); + sig = df_code_slicef(ws, &ctrl_ctx, &parse_ctx, code_ctx, &code_slice_params, &view->cursor, &view->mark, &cv->preferred_column, "txt_view_%p", view); } //- rjf: press code slice? -> focus panel @@ -920,9 +920,9 @@ df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewSta } //- rjf: selected text on single line, no query? -> set search text - if(!txt_pt_match(cv->cursor, cv->mark) && cv->cursor.line == cv->mark.line && search_query.size == 0) + if(!txt_pt_match(view->cursor, view->mark) && view->cursor.line == view->mark.line && search_query.size == 0) { - String8 text = txt_string_from_info_data_txt_rng(info, data, txt_rng(cv->cursor, cv->mark)); + String8 text = txt_string_from_info_data_txt_rng(info, data, txt_rng(view->cursor, view->mark)); df_set_search_string(text); } @@ -977,8 +977,8 @@ df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewSta if(cv->center_cursor) { cv->center_cursor = 0; - String8 cursor_line = str8_substr(data, info->lines_ranges[cv->cursor.line-1]); - F32 cursor_advance = f_dim_from_tag_size_string(code_font, code_font_size, 0, code_tab_size, str8_prefix(cursor_line, cv->cursor.column-1)).x; + String8 cursor_line = str8_substr(data, info->lines_ranges[view->cursor.line-1]); + F32 cursor_advance = f_dim_from_tag_size_string(code_font, code_font_size, 0, code_tab_size, str8_prefix(cursor_line, view->cursor.column-1)).x; // rjf: scroll x { @@ -990,7 +990,7 @@ df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewSta // rjf: scroll y { - S64 new_idx = (cv->cursor.line-1) - num_possible_visible_lines/2 + 2; + S64 new_idx = (view->cursor.line-1) - num_possible_visible_lines/2 + 2; new_idx = Clamp(scroll_idx_rng[Axis2_Y].min, new_idx, scroll_idx_rng[Axis2_Y].max); ui_scroll_pt_target_idx(&view->scroll_pos.y, new_idx); snap[Axis2_Y] = 0; @@ -1000,8 +1000,8 @@ df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewSta // rjf: snap in X if(snap[Axis2_X]) { - String8 cursor_line = str8_substr(data, info->lines_ranges[cv->cursor.line-1]); - S64 cursor_off = (S64)(f_dim_from_tag_size_string(code_font, code_font_size, 0, code_tab_size, str8_prefix(cursor_line, cv->cursor.column-1)).x + priority_margin_width_px + catchall_margin_width_px + line_num_width_px); + String8 cursor_line = str8_substr(data, info->lines_ranges[view->cursor.line-1]); + S64 cursor_off = (S64)(f_dim_from_tag_size_string(code_font, code_font_size, 0, code_tab_size, str8_prefix(cursor_line, view->cursor.column-1)).x + priority_margin_width_px + catchall_margin_width_px + line_num_width_px); Rng1S64 visible_pixel_range = { view->scroll_pos.x.idx, @@ -1022,7 +1022,7 @@ df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewSta // rjf: snap in Y if(snap[Axis2_Y]) { - Rng1S64 cursor_visibility_range = r1s64(cv->cursor.line-4, cv->cursor.line+4); + Rng1S64 cursor_visibility_range = r1s64(view->cursor.line-4, view->cursor.line+4); cursor_visibility_range.min = ClampBot(0, cursor_visibility_range.min); cursor_visibility_range.max = ClampBot(0, cursor_visibility_range.max); S64 min_delta = Min(0, cursor_visibility_range.min-(target_visible_line_num_range.min)); @@ -6282,8 +6282,8 @@ DF_VIEW_SETUP_FUNCTION_DEF(Code) cursor.column = s64_from_str8(cursor_cfg->first->first->string, 10); if(cursor.line == 0) { cursor.line = 1; } if(cursor.column == 0) { cursor.column = 1; } - cv->cursor = cv->mark = cursor; cv->center_cursor = 1; + view->cursor = view->mark = cursor; } // rjf: default to loading @@ -6293,8 +6293,7 @@ DF_VIEW_SETUP_FUNCTION_DEF(Code) DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(Code) { - DF_CodeViewState *tvs = df_view_user_state(view, DF_CodeViewState); - String8 string = push_str8f(arena, " cursor:%I64d:%I64d", tvs->cursor.line, tvs->cursor.column); + String8 string = push_str8f(arena, " cursor:%I64d:%I64d", view->cursor.line, view->cursor.column); return string; } @@ -6438,7 +6437,7 @@ DF_VIEW_UI_FUNCTION_DEF(Code) { ui_label(path); ui_spacer(ui_em(1.5f, 1)); - ui_labelf("Line: %I64d, Column: %I64d", cv->cursor.line, cv->cursor.column); + ui_labelf("Line: %I64d, Column: %I64d", view->cursor.line, view->cursor.column); ui_spacer(ui_pct(1, 0)); ui_labelf("(read only)"); ui_labelf("%s", @@ -8648,7 +8647,7 @@ DF_VIEW_UI_FUNCTION_DEF(Output) { ui_labelf("(Debug String Output)"); ui_spacer(ui_em(1.5f, 1)); - ui_labelf("Line: %I64d, Column: %I64d", cv->cursor.line, cv->cursor.column); + ui_labelf("Line: %I64d, Column: %I64d", view->cursor.line, view->cursor.column); ui_spacer(ui_pct(1, 0)); ui_labelf("(read only)"); } diff --git a/src/df/gfx/df_views.h b/src/df/gfx/df_views.h index 90f030a6..65768bad 100644 --- a/src/df/gfx/df_views.h +++ b/src/df/gfx/df_views.h @@ -366,8 +366,6 @@ 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; diff --git a/src/df/gfx/generated/df_gfx.meta.c b/src/df/gfx/generated/df_gfx.meta.c index e32943fc..de598c95 100644 --- a/src/df/gfx/generated/df_gfx.meta.c +++ b/src/df/gfx/generated/df_gfx.meta.c @@ -1201,7 +1201,7 @@ str8_lit_comp("thread_error"), str8_lit_comp("breakpoint"), }; -String8 df_g_setting_code_display_string_table[9] = +String8 df_g_setting_code_display_string_table[13] = { str8_lit_comp("Hover Animations"), str8_lit_comp("Press Animations"), @@ -1210,11 +1210,15 @@ str8_lit_comp("Tooltip Animations"), str8_lit_comp("Menu Animations"), str8_lit_comp("Scrolling Animations"), str8_lit_comp("Background Blur"), +str8_lit_comp("Thread Lines"), +str8_lit_comp("Breakpoint Lines"), +str8_lit_comp("Thread Glow"), +str8_lit_comp("Breakpoint Glow"), str8_lit_comp("Opaque Backgrounds"), str8_lit_comp("Tab Width"), }; -String8 df_g_setting_code_lower_string_table[9] = +String8 df_g_setting_code_lower_string_table[13] = { str8_lit_comp("hover_animations"), str8_lit_comp("press_animations"), @@ -1223,11 +1227,15 @@ str8_lit_comp("tooltip_animations"), str8_lit_comp("menu_animations"), str8_lit_comp("scrolling_animations"), str8_lit_comp("background_blur"), +str8_lit_comp("thread_lines"), +str8_lit_comp("breakpoint_lines"), +str8_lit_comp("thread_glow"), +str8_lit_comp("breakpoint_glow"), str8_lit_comp("opaque_backgrounds"), str8_lit_comp("tab_width"), }; -DF_SettingVal df_g_setting_code_default_val_table[9] = +DF_SettingVal df_g_setting_code_default_val_table[13] = { {1, 1}, {1, 1}, @@ -1236,11 +1244,15 @@ DF_SettingVal df_g_setting_code_default_val_table[9] = {1, 1}, {1, 1}, {1, 1}, +{1, 1}, +{1, 1}, +{1, 1}, +{1, 1}, {1, 0}, {1, 4}, }; -Rng1S32 df_g_setting_code_s32_range_table[9] = +Rng1S32 df_g_setting_code_s32_range_table[13] = { {0, 1}, {0, 1}, @@ -1250,6 +1262,10 @@ Rng1S32 df_g_setting_code_s32_range_table[9] = {0, 1}, {0, 1}, {0, 1}, +{0, 1}, +{0, 1}, +{0, 1}, +{0, 1}, {0, 32}, }; diff --git a/src/df/gfx/generated/df_gfx.meta.h b/src/df/gfx/generated/df_gfx.meta.h index f0292711..e9b4dd89 100644 --- a/src/df/gfx/generated/df_gfx.meta.h +++ b/src/df/gfx/generated/df_gfx.meta.h @@ -145,6 +145,10 @@ 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, @@ -333,10 +337,10 @@ 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[9]; -extern String8 df_g_setting_code_lower_string_table[9]; -extern DF_SettingVal df_g_setting_code_default_val_table[9]; -extern Rng1S32 df_g_setting_code_s32_range_table[9]; +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, diff --git a/src/raddbg/raddbg.c b/src/raddbg/raddbg.c index 2b636d6a..f69d40ed 100644 --- a/src/raddbg/raddbg.c +++ b/src/raddbg/raddbg.c @@ -343,7 +343,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); + } } } From 9ad52d25b5ef63af8de5c1f904c75ca45ec3b699 Mon Sep 17 00:00:00 2001 From: Ryan Fleury Date: Wed, 26 Jun 2024 10:02:26 -0700 Subject: [PATCH 33/47] more progress on top-level interaction-register-based cursor commands, getting more out of unified source view --- src/df/core/df_core.c | 142 +++++++++++++++++++++++++++---- src/df/core/df_core.h | 10 +-- src/df/gfx/df_gfx.c | 37 ++++---- src/df/gfx/df_gfx.h | 12 +-- src/df/gfx/df_view_rules.c | 6 +- src/df/gfx/df_views.c | 169 ++++++++----------------------------- src/df/gfx/df_views.h | 4 +- 7 files changed, 191 insertions(+), 189 deletions(-) diff --git a/src/df/core/df_core.c b/src/df/core/df_core.c index 38445b33..4b3feae2 100644 --- a/src/df/core/df_core.c +++ b/src/df/core/df_core.c @@ -8957,24 +8957,6 @@ df_core_begin_frame(Arena *arena, DF_CmdList *cmds, F32 dt) } } }break; - case DF_CoreCmdKind_ToggleBreakpointAtCursor: - { - DF_InteractRegs *regs = df_interact_regs(); - DF_Entity *file = df_entity_from_handle(regs->file); - if(file->kind == DF_EntityKind_File && regs->cursor.line != 0) - { - DF_CmdParams p = df_cmd_params_zero(); - p.entity = df_handle_from_entity(file); - p.text_point = regs->cursor; - df_cmd_list_push(arena, cmds, &p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_TextBreakpoint)); - } - else if(regs->vaddr_range.min != 0) - { - DF_CmdParams p = df_cmd_params_zero(); - p.vaddr = regs->vaddr_range.min; - df_cmd_list_push(arena, cmds, &p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_AddressBreakpoint)); - } - }break; //- rjf: watches case DF_CoreCmdKind_ToggleWatchPin: @@ -9028,6 +9010,117 @@ df_core_begin_frame(Arena *arena, DF_CmdList *cmds, F32 dt) } }break; + //- rjf: cursor operations + case DF_CoreCmdKind_ToggleBreakpointAtCursor: + { + DF_InteractRegs *regs = df_interact_regs(); + DF_Entity *file = df_entity_from_handle(regs->file); + if(file->kind == DF_EntityKind_File && regs->cursor.line != 0) + { + DF_CmdParams p = df_cmd_params_zero(); + p.entity = df_handle_from_entity(file); + p.text_point = regs->cursor; + df_cmd_list_push(arena, cmds, &p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_TextBreakpoint)); + } + else if(regs->vaddr_range.min != 0) + { + DF_CmdParams p = df_cmd_params_zero(); + p.vaddr = regs->vaddr_range.min; + df_cmd_list_push(arena, cmds, &p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_AddressBreakpoint)); + } + }break; + case DF_CoreCmdKind_ToggleWatchPinAtCursor: + { + DF_InteractRegs *regs = df_interact_regs(); + DF_Entity *file = df_entity_from_handle(regs->file); + if(file->kind == DF_EntityKind_File && regs->cursor.line != 0) + { + DF_CmdParams p = df_cmd_params_zero(); + p.entity = df_handle_from_entity(file); + p.text_point = regs->cursor; + p.string = params.string; + df_cmd_list_push(arena, cmds, &p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_ToggleWatchPin)); + } + else if(regs->vaddr_range.min != 0) + { + DF_CmdParams p = df_cmd_params_zero(); + p.vaddr = regs->vaddr_range.min; + p.string = params.string; + df_cmd_list_push(arena, cmds, &p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_ToggleWatchPin)); + } + }break; + case DF_CoreCmdKind_GoToNameAtCursor: + case DF_CoreCmdKind_ToggleWatchExpressionAtCursor: + { + HS_Scope *hs_scope = hs_scope_open(); + TXT_Scope *txt_scope = txt_scope_open(); + DF_InteractRegs *regs = df_interact_regs(); + U128 text_key = regs->text_key; + TXT_LangKind lang_kind = regs->lang_kind; + TxtRng range = txt_rng(regs->cursor, regs->mark); + U128 hash = {0}; + TXT_TextInfo info = txt_text_info_from_key_lang(txt_scope, text_key, lang_kind, &hash); + String8 data = hs_data_from_hash(hs_scope, hash); + Rng1U64 expr_off_range = {0}; + if(range.min.column != range.max.column) + { + expr_off_range = r1u64(txt_off_from_info_pt(&info, range.min), txt_off_from_info_pt(&info, range.max)); + } + else + { + expr_off_range = txt_expr_off_range_from_info_data_pt(&info, data, range.min); + } + String8 expr = str8_substr(data, expr_off_range); + DF_CmdParams p = df_cmd_params_zero(); + p.string = expr; + df_cmd_list_push(arena, cmds, &p, df_cmd_spec_from_core_cmd_kind(core_cmd_kind == DF_CoreCmdKind_GoToNameAtCursor ? DF_CoreCmdKind_GoToName : + core_cmd_kind == DF_CoreCmdKind_ToggleWatchExpressionAtCursor ? DF_CoreCmdKind_ToggleWatchExpression : + DF_CoreCmdKind_GoToName)); + txt_scope_close(txt_scope); + hs_scope_close(hs_scope); + }break; + case DF_CoreCmdKind_RunToCursor: + { + DF_Entity *file = df_entity_from_handle(df_interact_regs()->file); + if(!df_entity_is_nil(file)) + { + DF_CmdParams p = df_cmd_params_zero(); + p.entity = df_handle_from_entity(file); + p.text_point = df_interact_regs()->cursor; + df_push_cmd__root(&p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_RunToLine)); + } + else + { + DF_CmdParams p = df_cmd_params_zero(); + p.vaddr = df_interact_regs()->vaddr_range.min; + df_push_cmd__root(&p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_RunToAddress)); + } + }break; + case DF_CoreCmdKind_SetNextStatement: + { + DF_Entity *file = df_entity_from_handle(df_interact_regs()->file); + DF_Entity *thread = df_entity_from_handle(df_interact_regs()->thread); + U64 new_rip_vaddr = df_interact_regs()->vaddr_range.min; + if(!df_entity_is_nil(file)) + { + DF_LineList *lines = &df_interact_regs()->lines; + for(DF_LineNode *n = lines->first; n != 0; n = n->next) + { + DF_EntityList modules = df_modules_from_dbgi_key(scratch.arena, &n->v.dbgi_key); + DF_Entity *module = df_module_from_thread_candidates(thread, &modules); + if(!df_entity_is_nil(module)) + { + new_rip_vaddr = df_vaddr_from_voff(module, n->v.voff_range.min); + break; + } + } + } + DF_CmdParams p = df_cmd_params_zero(); + p.entity = df_handle_from_entity(thread); + p.vaddr = new_rip_vaddr; + df_cmd_list_push(arena, cmds, &p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_SetThreadIP)); + }break; + //- rjf: targets case DF_CoreCmdKind_AddTarget: { @@ -9157,6 +9250,19 @@ df_core_begin_frame(Arena *arena, DF_CmdList *cmds, F32 dt) } scratch_end(scratch); } + + //- rjf: fill core interaction register info + { + DF_Entity *thread = df_entity_from_handle(df_state->ctrl_ctx.thread); + DF_Entity *module = df_module_from_thread(thread); + DF_Entity *process = df_entity_ancestor_from_kind(thread, DF_EntityKind_Process); + df_interact_regs()->thread = df_handle_from_entity(thread); + df_interact_regs()->module = df_handle_from_entity(module); + df_interact_regs()->process = df_handle_from_entity(process); + df_interact_regs()->unwind_count = df_state->ctrl_ctx.unwind_count; + df_interact_regs()->inline_unwind_count = df_state->ctrl_ctx.inline_unwind_count; + } + ProfEnd(); } diff --git a/src/df/core/df_core.h b/src/df/core/df_core.h index e10c1f38..ead3bd9f 100644 --- a/src/df/core/df_core.h +++ b/src/df/core/df_core.h @@ -659,17 +659,17 @@ struct DF_TextLineDasm2SrcInfoList typedef struct DF_InteractRegs DF_InteractRegs; struct DF_InteractRegs { - DF_Handle window; - DF_Handle panel; - DF_Handle view; 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; - U64 unwind_count; - U64 inline_unwind_count; U128 text_key; TXT_LangKind lang_kind; Rng1U64 vaddr_range; diff --git a/src/df/gfx/df_gfx.c b/src/df/gfx/df_gfx.c index 01b634e3..0d3a1f04 100644 --- a/src/df/gfx/df_gfx.c +++ b/src/df/gfx/df_gfx.c @@ -7166,6 +7166,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) DF_Entity *entity = df_entity_from_handle(view->entity); df_interact_regs()->cursor = view->cursor; df_interact_regs()->mark = view->mark; + df_interact_regs()->file = df_handle_zero(); switch(entity->kind) { default:{}break; @@ -10838,7 +10839,7 @@ internal UI_BOX_CUSTOM_DRAW(df_bp_box_draw_extensions) } internal DF_CodeSliceSignal -df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_CodeCtx *code_ctx, DF_CodeSliceParams *params, TxtPt *cursor, TxtPt *mark, S64 *preferred_column, String8 string) +df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_CodeSliceParams *params, TxtPt *cursor, TxtPt *mark, S64 *preferred_column, String8 string) { DF_CodeSliceSignal result = {0}; ProfBeginFunction(); @@ -11161,7 +11162,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ // rjf: fill out progress t (progress into range of current line's // voff range) - if(code_ctx->file != &df_g_nil_entity && params->line_infos[line_idx].first != 0) + if(!df_entity_is_nil(df_entity_from_handle(df_interact_regs()->file)) && params->line_infos[line_idx].first != 0) { DF_LineList *lines = ¶ms->line_infos[line_idx]; DF_Line *line = 0; @@ -11238,7 +11239,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ { bp_draw->color = bp_color; bp_draw->alive_t = bp->alive_t; - if(code_ctx->file != &df_g_nil_entity) + if(!df_entity_is_nil(df_entity_from_handle(df_interact_regs()->file))) { DF_LineList *lines = ¶ms->line_infos[line_idx]; for(DF_LineNode *n = lines->first; n != 0; n = n->next) @@ -11369,11 +11370,11 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ UI_Signal line_margin_sig = ui_signal_from_box(line_margin_box); if(ui_clicked(line_margin_sig)) { - if(!df_entity_is_nil(code_ctx->file)) + if(!df_entity_is_nil(df_entity_from_handle(df_interact_regs()->file))) { TxtPt pt = txt_pt(line_num, 1); DF_CmdParams p = df_cmd_params_from_window(ws); - p.entity = df_handle_from_entity(code_ctx->file); + p.entity = df_interact_regs()->file; p.text_point = pt; df_push_cmd__root(&p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_TextBreakpoint)); } @@ -11425,7 +11426,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ { if(n->v.dbgi_key.min_timestamp >= best_stamp) { - has_line_info = (n->v.pt.line == line_num || code_ctx->file == &df_g_nil_entity); + has_line_info = (n->v.pt.line == line_num || df_entity_is_nil(df_entity_from_handle(df_interact_regs()->file))); line_info_line_num = n->v.pt.line; best_stamp = n->v.dbgi_key.min_timestamp; } @@ -11737,10 +11738,10 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ } ui_ctx_menu_open(ws->code_ctx_menu_key, ui_key_zero(), sub_2f32(ui_mouse(), v2f32(2, 2))); arena_clear(ws->code_ctx_menu_arena); - ws->code_ctx_menu_file = df_handle_from_entity(code_ctx->file); - ws->code_ctx_menu_text_key = code_ctx->text_key; - ws->code_ctx_menu_lang_kind = code_ctx->lang_kind; - ws->code_ctx_menu_range = txt_rng(*cursor, *mark); + ws->code_ctx_menu_file = df_interact_regs()->file; + ws->code_ctx_menu_text_key = df_interact_regs()->text_key; + ws->code_ctx_menu_lang_kind = df_interact_regs()->lang_kind; + ws->code_ctx_menu_range = txt_rng(*cursor, *mark); if(params->line_num_range.min <= cursor->line && cursor->line < params->line_num_range.max) { ws->code_ctx_menu_vaddr = params->line_vaddrs[cursor->line - params->line_num_range.min]; @@ -11780,9 +11781,9 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ case DF_EntityKind_Breakpoint: case DF_EntityKind_WatchPin: { - if(!df_entity_is_nil(code_ctx->file)) + if(!df_entity_is_nil(df_entity_from_handle(df_interact_regs()->file))) { - df_entity_change_parent(0, dropped_entity, dropped_entity->parent, code_ctx->file); + df_entity_change_parent(0, dropped_entity, dropped_entity->parent, df_entity_from_handle(df_interact_regs()->file)); df_entity_equip_txt_pt(dropped_entity, txt_pt(line_num, 1)); if(dropped_entity->flags & DF_EntityFlag_HasVAddr) { @@ -11798,7 +11799,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ case DF_EntityKind_Thread: { U64 new_rip_vaddr = line_vaddr; - if(!df_entity_is_nil(code_ctx->file)) + if(!df_entity_is_nil(df_entity_from_handle(df_interact_regs()->file))) { DF_LineList *lines = ¶ms->line_infos[line_idx]; for(DF_LineNode *n = lines->first; n != 0; n = n->next) @@ -11872,7 +11873,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ { U64 line_slice_idx = mouse_pt.line-params->line_num_range.min; DF_LineList *lines = ¶ms->line_infos[line_slice_idx]; - if(lines->first != 0 && (code_ctx->file == &df_g_nil_entity || lines->first->v.pt.line == mouse_pt.line)) + if(lines->first != 0 && (df_entity_is_nil(df_entity_from_handle(df_interact_regs()->file)) || lines->first->v.pt.line == mouse_pt.line)) { DF_RichHoverInfo info = {0}; info.process = df_handle_from_entity(selected_thread_process); @@ -11893,7 +11894,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ DF_Eval eval = df_eval_from_string(scratch.arena, di_scope, ctrl_ctx, parse_ctx, &eval_string2expr_map_nil, mouse_expr); if(eval.mode != EVAL_EvalMode_NULL) { - df_set_hover_eval(ws, mouse_expr_baseline_pos, *ctrl_ctx, code_ctx->file, mouse_pt, 0, mouse_expr); + df_set_hover_eval(ws, mouse_expr_baseline_pos, *ctrl_ctx, df_entity_from_handle(df_interact_regs()->file), mouse_pt, 0, mouse_expr); } di_scope_close(di_scope); } @@ -12243,7 +12244,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ DF_LineList *lines = ¶ms->line_infos[line_idx]; for(DF_LineNode *n = lines->first; n != 0; n = n->next) { - if((n->v.pt.line == line_num || code_ctx->file == &df_g_nil_entity) && + if((n->v.pt.line == line_num || df_entity_is_nil(df_entity_from_handle(df_interact_regs()->file))) && di_key_match(&n->v.dbgi_key, &hovered_line_dbgi_key) && n->v.voff_range.min <= hovered_line_voff && hovered_line_voff < n->v.voff_range.max) { @@ -12279,13 +12280,13 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ } internal DF_CodeSliceSignal -df_code_slicef(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_CodeCtx *code_ctx, DF_CodeSliceParams *params, TxtPt *cursor, TxtPt *mark, S64 *preferred_column, char *fmt, ...) +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, ...) { Temp scratch = scratch_begin(0, 0); va_list args; va_start(args, fmt); String8 string = push_str8fv(scratch.arena, fmt, args); - DF_CodeSliceSignal sig = df_code_slice(ws, ctrl_ctx, parse_ctx, code_ctx, params, cursor, mark, preferred_column, string); + DF_CodeSliceSignal sig = df_code_slice(ws, ctrl_ctx, parse_ctx, params, cursor, mark, preferred_column, string); va_end(args); scratch_end(scratch); return sig; diff --git a/src/df/gfx/df_gfx.h b/src/df/gfx/df_gfx.h index 5eb09b77..9e8244c9 100644 --- a/src/df/gfx/df_gfx.h +++ b/src/df/gfx/df_gfx.h @@ -434,14 +434,6 @@ enum DF_CodeSliceFlag_LineNums = (1<<3), }; -typedef struct DF_CodeCtx DF_CodeCtx; -struct DF_CodeCtx -{ - DF_Entity *file; // the source file, if any, from which the code was derived - U128 text_key; // the text info cache key for the backing textual data - TXT_LangKind lang_kind; // the language for which the text is parsed/analyzed -}; - typedef struct DF_CodeSliceParams DF_CodeSliceParams; struct DF_CodeSliceParams { @@ -1088,8 +1080,8 @@ internal void df_entity_src_loc_button(DF_Window *ws, DF_Entity *entity, TxtPt p internal UI_BOX_CUSTOM_DRAW(df_thread_box_draw_extensions); internal UI_BOX_CUSTOM_DRAW(df_bp_box_draw_extensions); -internal DF_CodeSliceSignal df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_CodeCtx *code_ctx, DF_CodeSliceParams *params, TxtPt *cursor, TxtPt *mark, S64 *preferred_column, String8 string); -internal DF_CodeSliceSignal df_code_slicef(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_CodeCtx *code_ctx, DF_CodeSliceParams *params, TxtPt *cursor, TxtPt *mark, S64 *preferred_column, char *fmt, ...); +internal DF_CodeSliceSignal df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_CodeSliceParams *params, TxtPt *cursor, TxtPt *mark, S64 *preferred_column, String8 string); +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); diff --git a/src/df/gfx/df_view_rules.c b/src/df/gfx/df_view_rules.c index 15a34f0c..e76f2035 100644 --- a/src/df/gfx/df_view_rules.c +++ b/src/df/gfx/df_view_rules.c @@ -592,8 +592,7 @@ DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(text) //- rjf: build code slice UI_WidthFill UI_HeightFill UI_Parent(container) { - DF_CodeCtx code_ctx = {&df_g_nil_entity, text_key, top.lang}; - DF_CodeSliceSignal slice_sig = df_code_slice(ws, ctrl_ctx, parse_ctx, &code_ctx, &code_slice_params, &state->cursor, &state->mark, &state->preferred_column, str8_lit("###slice")); + DF_CodeSliceSignal slice_sig = df_code_slice(ws, ctrl_ctx, parse_ctx, &code_slice_params, &state->cursor, &state->mark, &state->preferred_column, str8_lit("###slice")); } } @@ -745,8 +744,7 @@ DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(disasm) if(dasm_info.insts.count != 0 && dasm_text_info.lines_count != 0) UI_Padding(ui_pct(1, 0)) UI_PrefWidth(ui_px(dasm_text_info.lines_max_size*ui_top_font_size()*1.2f, 1.f)) UI_Column UI_Padding(ui_pct(1, 0)) { - DF_CodeCtx code_ctx = {&df_g_nil_entity, dasm_info.text_key, lang_kind}; - DF_CodeSliceSignal sig = df_code_slice(ws, ctrl_ctx, parse_ctx, &code_ctx, &code_slice_params, &state->cursor, &state->mark, &state->preferred_column, str8_lit("###code_slice")); + DF_CodeSliceSignal sig = df_code_slice(ws, ctrl_ctx, parse_ctx, &code_slice_params, &state->cursor, &state->mark, &state->preferred_column, str8_lit("###code_slice")); } } dasm_scope_close(dasm_scope); diff --git a/src/df/gfx/df_views.c b/src/df/gfx/df_views.c index 3bc78c32..4ac962cd 100644 --- a/src/df/gfx/df_views.c +++ b/src/df/gfx/df_views.c @@ -387,7 +387,7 @@ 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 data, TXT_TextInfo *info, DF_CodeCtx *code_ctx) +df_code_view_cmds(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewState *cv, DF_CmdList *cmds, String8 data, TXT_TextInfo *info) { for(DF_CmdNode *n = cmds->first; n != 0; n = n->next) { @@ -427,79 +427,12 @@ df_code_view_cmds(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewStat arena_clear(cv->find_text_arena); cv->find_text_bwd = push_str8_copy(cv->find_text_arena, cmd->params.string); }break; - case DF_CoreCmdKind_GoToNameAtCursor: - { - Temp scratch = scratch_begin(0, 0); - TXT_Scope *txt_scope = txt_scope_open(); - HS_Scope *hs_scope = hs_scope_open(); - { - // rjf: determine expression range - Rng1U64 expr_range = {0}; - { - TxtRng selection_range = txt_rng(view->cursor, view->mark); - if(txt_pt_match(selection_range.min, selection_range.max)) - { - expr_range = txt_expr_off_range_from_info_data_pt(info, data, view->cursor); - } - else - { - expr_range = r1u64(txt_off_from_info_pt(info, selection_range.min), txt_off_from_info_pt(info, selection_range.max)); - } - } - - // rjf: expression range -> text - String8 expr_text = str8_substr(data, expr_range); - - // rjf: go to name - DF_CmdParams params = df_cmd_params_from_view(ws, panel, view); - params.string = expr_text; - df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_String); - df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_GoToName)); - } - hs_scope_close(hs_scope); - txt_scope_close(txt_scope); - scratch_end(scratch); - }break; - case DF_CoreCmdKind_ToggleWatchExpressionAtCursor: - { - Temp scratch = scratch_begin(0, 0); - TXT_Scope *txt_scope = txt_scope_open(); - HS_Scope *hs_scope = hs_scope_open(); - { - // rjf: determine expression range - Rng1U64 expr_range = {0}; - { - TxtRng selection_range = txt_rng(view->cursor, view->mark); - if(txt_pt_match(selection_range.min, selection_range.max)) - { - expr_range = txt_expr_off_range_from_info_data_pt(info, data, view->cursor); - } - else - { - expr_range = r1u64(txt_off_from_info_pt(info, selection_range.min), txt_off_from_info_pt(info, selection_range.max)); - } - } - - // rjf: expression range -> text - String8 expr_text = str8_substr(data, expr_range); - - // rjf: toggle watch expr - DF_CmdParams params = df_cmd_params_from_view(ws, panel, view); - params.string = expr_text; - df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_String); - df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_ToggleWatchExpression)); - scratch_end(scratch); - } - hs_scope_close(hs_scope); - txt_scope_close(txt_scope); - scratch_end(scratch); - }break; } } } internal void -df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewState *cv, Rng2F32 rect, String8 data, TXT_TextInfo *info, DF_CodeCtx *code_ctx) +df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewState *cv, Rng2F32 rect, String8 data, TXT_TextInfo *info) { ProfBeginFunction(); Temp scratch = scratch_begin(0, 0); @@ -631,7 +564,8 @@ df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewSta // rjf: find visible breakpoints ProfScope("find visible breakpoints") { - for(DF_Entity *bp = code_ctx->file->first; !df_entity_is_nil(bp); bp = bp->next) + DF_Entity *file = df_entity_from_handle(df_interact_regs()->file); + for(DF_Entity *bp = file->first; !df_entity_is_nil(bp); bp = bp->next) { if(bp->deleted || bp->kind != DF_EntityKind_Breakpoint) { continue; } if(visible_line_num_range.min <= bp->text_point.line && bp->text_point.line <= visible_line_num_range.max) @@ -645,6 +579,7 @@ df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewSta // rjf: find live threads mapping to this file ProfScope("find live threads mapping to this file") { + DF_Entity *file = df_entity_from_handle(df_interact_regs()->file); DF_Entity *selected_thread = df_entity_from_handle(ctrl_ctx.thread); DF_EntityList threads = df_query_cached_entity_list_with_kind(DF_EntityKind_Thread); for(DF_EntityNode *thread_n = threads.first; thread_n != 0; thread_n = thread_n->next) @@ -661,7 +596,7 @@ df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewSta DF_LineList lines = df_lines_from_dbgi_key_voff(scratch.arena, &dbgi_key, rip_voff); for(DF_LineNode *n = lines.first; n != 0; n = n->next) { - if(df_entity_from_handle(n->v.file) == code_ctx->file && visible_line_num_range.min <= n->v.pt.line && n->v.pt.line <= visible_line_num_range.max) + if(df_entity_from_handle(n->v.file) == file && visible_line_num_range.min <= n->v.pt.line && n->v.pt.line <= visible_line_num_range.max) { U64 slice_line_idx = lines.first->v.pt.line-visible_line_num_range.min; df_entity_list_push(scratch.arena, &code_slice_params.line_ips[slice_line_idx], thread); @@ -673,7 +608,8 @@ df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewSta // rjf: find visible watch pins ProfScope("find visible watch pins") { - for(DF_Entity *wp = code_ctx->file->first; !df_entity_is_nil(wp); wp = wp->next) + DF_Entity *file = df_entity_from_handle(df_interact_regs()->file); + for(DF_Entity *wp = file->first; !df_entity_is_nil(wp); wp = wp->next) { if(wp->deleted || wp->kind != DF_EntityKind_WatchPin) { continue; } if(visible_line_num_range.min <= wp->text_point.line && wp->text_point.line <= visible_line_num_range.max) @@ -687,7 +623,8 @@ df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewSta // rjf: find all src -> dasm info ProfScope("find all src -> dasm info") { - DF_LineListArray lines_array = df_lines_array_from_file_line_range(scratch.arena, code_ctx->file, visible_line_num_range); + DF_Entity *file = df_entity_from_handle(df_interact_regs()->file); + DF_LineListArray lines_array = df_lines_array_from_file_line_range(scratch.arena, file, visible_line_num_range); if(lines_array.count != 0) { MemoryCopy(code_slice_params.line_infos, lines_array.v, sizeof(DF_LineList)*lines_array.count); @@ -886,7 +823,7 @@ df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewSta DF_CodeSliceSignal sig = {0}; UI_Focus(UI_FocusKind_On) { - sig = df_code_slicef(ws, &ctrl_ctx, &parse_ctx, code_ctx, &code_slice_params, &view->cursor, &view->mark, &cv->preferred_column, "txt_view_%p", view); + sig = df_code_slicef(ws, &ctrl_ctx, &parse_ctx, &code_slice_params, &view->cursor, &view->mark, &cv->preferred_column, "txt_view_%p", view); } //- rjf: press code slice? -> focus panel @@ -925,40 +862,6 @@ df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewSta String8 text = txt_string_from_info_data_txt_rng(info, data, txt_rng(view->cursor, view->mark)); df_set_search_string(text); } - - //- rjf: go to disasm - // TODO(rjf): @src_collapse -#if 0 - if(sig.goto_disasm_line_num != 0 && contains_1s64(visible_line_num_range, sig.goto_disasm_line_num)) - { - U64 line_idx = (sig.goto_disasm_line_num-visible_line_num_range.min); - DF_TextLineSrc2DasmInfoList *src2dasm_list = &code_slice_params.line_src2dasm[line_idx]; - if(src2dasm_list->first != 0) - { - Rng1U64 voff_rng = src2dasm_list->first->v.voff_range; - DI_Key dbgi_key = src2dasm_list->first->v.dbgi_key; - DF_EntityList possible_modules = df_modules_from_dbgi_key(scratch.arena, &dbgi_key); - DF_Entity *thread = df_entity_from_handle(ctrl_ctx.thread); - DF_Entity *thread_dst_module = df_module_from_thread_candidates(thread, &possible_modules); - DF_Entity *process = df_entity_ancestor_from_kind(thread, DF_EntityKind_Process); - DF_Entity *module = thread_dst_module; - if(df_entity_is_nil(module)) - { - module = df_first_entity_from_list(&possible_modules); - } - U64 voff = voff_rng.min; - if(!df_entity_is_nil(module) && voff != 0) - { - DF_CmdParams params = df_cmd_params_from_window(ws); - params.entity = df_handle_from_entity(process); - params.vaddr = df_vaddr_from_voff(module, voff); - df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_Entity); - df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_VirtualAddr); - df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_FindCodeLocation)); - } - } - } -#endif } ////////////////////////////// @@ -6303,15 +6206,14 @@ DF_VIEW_CMD_FUNCTION_DEF(Code) Temp scratch = scratch_begin(0, 0); HS_Scope *hs_scope = hs_scope_open(); TXT_Scope *txt_scope = txt_scope_open(); - DF_Entity *entity = df_entity_from_handle(view->entity); + DF_Entity *entity = df_entity_from_handle(df_interact_regs()->file); String8 path = df_full_path_from_entity(scratch.arena, entity); - TXT_LangKind lang_kind = txt_lang_kind_from_extension(str8_skip_last_dot(path)); - U128 key = fs_key_from_path(path); + df_interact_regs()->text_key = fs_key_from_path(path); + df_interact_regs()->lang_kind = txt_lang_kind_from_extension(str8_skip_last_dot(path)); U128 hash = {0}; - TXT_TextInfo info = txt_text_info_from_key_lang(txt_scope, key, lang_kind, &hash); + TXT_TextInfo info = txt_text_info_from_key_lang(txt_scope, df_interact_regs()->text_key, df_interact_regs()->lang_kind, &hash); String8 data = hs_data_from_hash(hs_scope, hash); - DF_CodeCtx code_ctx = {entity, key, lang_kind}; - df_code_view_cmds(ws, panel, view, cv, cmds, data, &info, &code_ctx); + df_code_view_cmds(ws, panel, view, cv, cmds, data, &info); txt_scope_close(txt_scope); hs_scope_close(hs_scope); scratch_end(scratch); @@ -6334,12 +6236,12 @@ DF_VIEW_UI_FUNCTION_DEF(Code) ////////////////////////////// //- rjf: unpack entity info // - DF_Entity *entity = df_entity_from_handle(view->entity); + DF_Entity *entity = df_entity_from_handle(df_interact_regs()->file); String8 path = df_full_path_from_entity(scratch.arena, entity); - TXT_LangKind lang_kind = txt_lang_kind_from_extension(str8_skip_last_dot(path)); - U128 key = fs_key_from_path(path); + df_interact_regs()->text_key = fs_key_from_path(path); + df_interact_regs()->lang_kind = txt_lang_kind_from_extension(str8_skip_last_dot(path)); U128 hash = {0}; - TXT_TextInfo info = txt_text_info_from_key_lang(txt_scope, key, lang_kind, &hash); + TXT_TextInfo info = txt_text_info_from_key_lang(txt_scope, df_interact_regs()->text_key, df_interact_regs()->lang_kind, &hash); String8 data = hs_data_from_hash(hs_scope, hash); B32 entity_is_missing = !!(entity->flags & DF_EntityFlag_IsMissing); B32 key_has_data = !u128_match(hash, u128_zero()) && info.lines_count; @@ -6397,8 +6299,14 @@ DF_VIEW_UI_FUNCTION_DEF(Code) // if(!entity_is_missing && key_has_data) { - DF_CodeCtx code_ctx = {entity, key, lang_kind}; - df_code_view_build(ws, panel, view, cv, code_area_rect, data, &info, &code_ctx); + df_code_view_build(ws, panel, view, cv, code_area_rect, data, &info); + } + + ////////////////////////////// + //- rjf: unpack cursor info + // + { + df_interact_regs()->lines = df_lines_from_file_line_num(df_frame_arena(), entity, df_interact_regs()->cursor.line); } ////////////////////////////// @@ -6733,10 +6641,10 @@ DF_VIEW_UI_FUNCTION_DEF(Code) // B32 entity_is_missing = !!(entity->flags & DF_EntityFlag_IsMissing && !(entity->flags & DF_EntityFlag_Output)); String8 path = df_full_path_from_entity(scratch.arena, entity); - U128 key = fs_key_from_path(path); - TXT_LangKind lang_kind = txt_lang_kind_from_extension(str8_skip_last_dot(path)); + df_interact_regs()->text_key = fs_key_from_path(path); + df_interact_regs()->lang_kind = txt_lang_kind_from_extension(str8_skip_last_dot(path)); U128 hash = {0}; - TXT_TextInfo text_info = txt_text_info_from_key_lang(txt_scope, key, lang_kind, &hash); + TXT_TextInfo text_info = txt_text_info_from_key_lang(txt_scope, df_interact_regs()->text_key, df_interact_regs()->lang_kind, &hash); String8 data = hs_data_from_hash(hs_scope, hash); B32 text_info_is_ready = (text_info.lines_count != 0); @@ -8086,8 +7994,7 @@ DF_VIEW_UI_FUNCTION_DEF(Disassembly) DF_CodeSliceSignal sig = {0}; UI_Focus(UI_FocusKind_On) { - DF_CodeCtx code_ctx = {&df_g_nil_entity, dasm_info.text_key, lang_kind}; - sig = df_code_slicef(ws, &ctrl_ctx, &parse_ctx, &code_ctx, &code_slice_params, &dv->cursor, &dv->mark, &dv->preferred_column, "dasm_slice_%p", view); + sig = df_code_slicef(ws, &ctrl_ctx, &parse_ctx, &code_slice_params, &dv->cursor, &dv->mark, &dv->preferred_column, "dasm_slice_%p", view); } //- rjf: hover eval @@ -8583,13 +8490,12 @@ DF_VIEW_CMD_FUNCTION_DEF(Output) Temp scratch = scratch_begin(0, 0); HS_Scope *hs_scope = hs_scope_open(); TXT_Scope *txt_scope = txt_scope_open(); - U128 key = df_state->output_log_key; - TXT_LangKind lang_kind = TXT_LangKind_Null; + df_interact_regs()->text_key = df_state->output_log_key; + df_interact_regs()->lang_kind = TXT_LangKind_Null; U128 hash = {0}; - TXT_TextInfo info = txt_text_info_from_key_lang(txt_scope, key, lang_kind, &hash); + TXT_TextInfo info = txt_text_info_from_key_lang(txt_scope, df_interact_regs()->text_key, df_interact_regs()->lang_kind, &hash); String8 data = hs_data_from_hash(hs_scope, hash); - DF_CodeCtx code_ctx = {&df_g_nil_entity, key, lang_kind}; - df_code_view_cmds(ws, panel, view, cv, cmds, data, &info, &code_ctx); + df_code_view_cmds(ws, panel, view, cv, cmds, data, &info); txt_scope_close(txt_scope); hs_scope_close(hs_scope); scratch_end(scratch); @@ -8628,8 +8534,7 @@ DF_VIEW_UI_FUNCTION_DEF(Output) //- rjf: build code contents // { - DF_CodeCtx code_ctx = {&df_g_nil_entity, key, lang_kind}; - df_code_view_build(ws, panel, view, cv, code_area_rect, data, &info, &code_ctx); + df_code_view_build(ws, panel, view, cv, code_area_rect, data, &info); } ////////////////////////////// diff --git a/src/df/gfx/df_views.h b/src/df/gfx/df_views.h index 65768bad..a3ad66ee 100644 --- a/src/df/gfx/df_views.h +++ b/src/df/gfx/df_views.h @@ -469,8 +469,8 @@ internal void df_entity_lister_item_array_sort_by_strength__in_place(DF_EntityLi //~ 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 data, TXT_TextInfo *info, DF_CodeCtx *code_ctx); -internal void df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewState *cv, Rng2F32 rect, String8 data, TXT_TextInfo *info, DF_CodeCtx *code_ctx); +internal void df_code_view_cmds(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewState *cv, DF_CmdList *cmds, String8 data, TXT_TextInfo *info); +internal void df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewState *cv, Rng2F32 rect, String8 data, TXT_TextInfo *info); //////////////////////////////// //~ rjf: Watch Views From e3077cf6f5d579e82945851fddbe9ff94dc22189 Mon Sep 17 00:00:00 2001 From: Ryan Fleury Date: Wed, 26 Jun 2024 10:06:16 -0700 Subject: [PATCH 34/47] pick-file path for new code view --- src/df/gfx/df_views.c | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/src/df/gfx/df_views.c b/src/df/gfx/df_views.c index 4ac962cd..aaad81a2 100644 --- a/src/df/gfx/df_views.c +++ b/src/df/gfx/df_views.c @@ -6213,7 +6213,46 @@ DF_VIEW_CMD_FUNCTION_DEF(Code) U128 hash = {0}; TXT_TextInfo info = txt_text_info_from_key_lang(txt_scope, df_interact_regs()->text_key, df_interact_regs()->lang_kind, &hash); String8 data = hs_data_from_hash(hs_scope, hash); + + //- rjf: process general code-view commands df_code_view_cmds(ws, panel, view, cv, cmds, data, &info); + + //- rjf: process code-file commands + for(DF_CmdNode *n = cmds->first; n != 0; n = n->next) + { + DF_Cmd *cmd = &n->cmd; + + // rjf: mismatched window/panel => skip + if(df_window_from_handle(cmd->params.window) != ws || + df_panel_from_handle(cmd->params.panel) != panel) + { + continue; + } + + // rjf: process + DF_CoreCmdKind core_cmd_kind = df_core_cmd_kind_from_string(cmd->spec->info.string); + switch(core_cmd_kind) + { + default:{}break; + case DF_CoreCmdKind_PickFile: + { + DF_Entity *missing_file = df_entity_from_handle(cv->pick_file_override_target); + String8 pick_string = cmd->params.file_path; + if(!df_entity_is_nil(missing_file) && pick_string.size != 0) + { + DF_Entity *replacement = df_entity_from_path(pick_string, DF_EntityFromPathFlag_OpenAsNeeded|DF_EntityFromPathFlag_OpenMissing); + view->entity = df_handle_from_entity(replacement); + DF_CmdParams p = df_cmd_params_from_view(ws, panel, view); + p.entity = df_handle_from_entity(missing_file); + p.file_path = pick_string; + df_cmd_params_mark_slot(&p, DF_CmdParamSlot_Entity); + df_cmd_params_mark_slot(&p, DF_CmdParamSlot_FilePath); + df_push_cmd__root(&p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_SetFileReplacementPath)); + } + }break; + } + } + txt_scope_close(txt_scope); hs_scope_close(hs_scope); scratch_end(scratch); From 0904de74ded0f626a88d3bcf6e1414cc12b6e2c5 Mon Sep 17 00:00:00 2001 From: Ryan Fleury Date: Wed, 26 Jun 2024 10:07:26 -0700 Subject: [PATCH 35/47] eliminate old duplicative code/output views --- src/df/gfx/df_views.c | 1700 ----------------------------------------- 1 file changed, 1700 deletions(-) diff --git a/src/df/gfx/df_views.c b/src/df/gfx/df_views.c index aaad81a2..dd8107e0 100644 --- a/src/df/gfx/df_views.c +++ b/src/df/gfx/df_views.c @@ -6169,7 +6169,6 @@ DF_VIEW_UI_FUNCTION_DEF(PendingEntity) //////////////////////////////// //~ rjf: Code @view_hook_impl -#if 1 DF_VIEW_SETUP_FUNCTION_DEF(Code) { // rjf: set up state @@ -6399,1086 +6398,6 @@ DF_VIEW_UI_FUNCTION_DEF(Code) hs_scope_close(hs_scope); scratch_end(scratch); } -#endif - -//~ TODO(rjf): OLD vvvvvvvv @src_collapse - -#if 0 -DF_VIEW_SETUP_FUNCTION_DEF(Code) -{ - // rjf: set up state - DF_CodeViewState *tv = df_view_user_state(view, DF_CodeViewState); - if(tv->initialized == 0) - { - tv->initialized = 1; - tv->cursor = tv->mark = txt_pt(1, 1); - tv->preferred_column = 1; - tv->find_text_arena = df_view_push_arena_ext(view); - } - - // rjf: deserialize cursor - DF_CfgNode *cursor_cfg = df_cfg_node_child_from_string(cfg_root, str8_lit("cursor"), StringMatchFlag_CaseInsensitive); - if(cursor_cfg != &df_g_nil_cfg_node) - { - TxtPt cursor = txt_pt(1, 1); - cursor.line = s64_from_str8(cursor_cfg->first->string, 10); - cursor.column = s64_from_str8(cursor_cfg->first->first->string, 10); - if(cursor.line == 0) { cursor.line = 1; } - if(cursor.column == 0) { cursor.column = 1; } - tv->cursor = tv->mark = cursor; - tv->center_cursor = 1; - } - - // rjf: default to loading - df_view_equip_loading_info(view, 1, 0, 0); - view->loading_t = view->loading_t_target = 1.f; -} - -DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(Code) -{ - DF_CodeViewState *tvs = df_view_user_state(view, DF_CodeViewState); - String8 string = push_str8f(arena, " cursor:%I64d:%I64d", tvs->cursor.line, tvs->cursor.column); - return string; -} - -DF_VIEW_CMD_FUNCTION_DEF(Code) -{ - DF_CodeViewState *tv = df_view_user_state(view, DF_CodeViewState); - DF_Entity *entity = df_entity_from_handle(view->entity); - for(DF_CmdNode *n = cmds->first; n != 0; n = n->next) - { - DF_Cmd *cmd = &n->cmd; - - // rjf: mismatched window/panel => skip - if(df_window_from_handle(cmd->params.window) != ws || - df_panel_from_handle(cmd->params.panel) != panel) - { - continue; - } - - // rjf: process - DF_CoreCmdKind core_cmd_kind = df_core_cmd_kind_from_string(cmd->spec->info.string); - switch(core_cmd_kind) - { - default: break; - case DF_CoreCmdKind_GoToLine: - { - tv->goto_line_num = cmd->params.text_point.line; - }break; - case DF_CoreCmdKind_CenterCursor: - { - tv->center_cursor = 1; - }break; - case DF_CoreCmdKind_ContainCursor: - { - tv->contain_cursor = 1; - }break; - case DF_CoreCmdKind_FindTextForward: - { - arena_clear(tv->find_text_arena); - tv->find_text_fwd = push_str8_copy(tv->find_text_arena, cmd->params.string); - }break; - case DF_CoreCmdKind_FindTextBackward: - { - arena_clear(tv->find_text_arena); - tv->find_text_bwd = push_str8_copy(tv->find_text_arena, cmd->params.string); - }break; - case DF_CoreCmdKind_ToggleBreakpointAtCursor: - { - DF_CmdParams params = df_cmd_params_from_view(ws, panel, view); - params.entity = view->entity; - params.text_point = tv->cursor; - df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_TextBreakpoint)); - tv->contain_cursor = 1; - }break; - case DF_CoreCmdKind_ToggleWatchPinAtCursor: - { - DF_CmdParams params = df_cmd_params_from_view(ws, panel, view); - params.entity = view->entity; - params.text_point = tv->cursor; - params.string = cmd->params.string; - df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_ToggleWatchPin)); - tv->contain_cursor = 1; - }break; - case DF_CoreCmdKind_RunToCursor: - { - DF_CmdParams params = df_cmd_params_from_view(ws, panel, view); - params.entity = view->entity; - params.text_point = tv->cursor; - df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_RunToLine)); - }break; - case DF_CoreCmdKind_SetNextStatement: - { - Temp scratch = scratch_begin(0, 0); - DF_Entity *thread = df_entity_from_handle(cmd->params.entity); - S64 line_num = (cmd->params.text_point.line == 0 ? tv->cursor.line : cmd->params.text_point.line); - DF_TextLineSrc2DasmInfoListArray src2dasm = df_text_line_src2dasm_info_list_array_from_src_line_range(scratch.arena, entity, r1s64(line_num, line_num)); - if(!df_entity_is_nil(thread) && src2dasm.count != 0) - { - DF_TextLineSrc2DasmInfoList *src2dasm_list = &src2dasm.v[0]; - if(src2dasm_list->first != 0) - { - Rng1U64 voff_rng = src2dasm_list->first->v.voff_range; - DI_Key dbgi_key = src2dasm_list->first->v.dbgi_key; - DF_EntityList possible_modules = df_modules_from_dbgi_key(scratch.arena, &dbgi_key); - DF_Entity *thread_dst_module = df_module_from_thread_candidates(thread, &possible_modules); - U64 thread_dst_voff = voff_rng.min; - if(!df_entity_is_nil(thread_dst_module) && thread_dst_voff != 0) - { - DF_CmdParams params = df_cmd_params_from_window(ws); - params.entity = df_handle_from_entity(thread); - params.vaddr = df_vaddr_from_voff(thread_dst_module, thread_dst_voff); - df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_Entity); - df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_VirtualAddr); - df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_SetThreadIP)); - } - } - } - scratch_end(scratch); - }break; - case DF_CoreCmdKind_GoToNameAtCursor: - { - Temp scratch = scratch_begin(0, 0); - TXT_Scope *txt_scope = txt_scope_open(); - HS_Scope *hs_scope = hs_scope_open(); - { - // rjf: unpack entity info - String8 path = df_full_path_from_entity(scratch.arena, entity); - U128 key = fs_key_from_path(path); - TXT_LangKind lang_kind = txt_lang_kind_from_extension(str8_skip_last_dot(path)); - U128 hash = {0}; - TXT_TextInfo text_info = txt_text_info_from_key_lang(txt_scope, key, lang_kind, &hash); - String8 data = hs_data_from_hash(hs_scope, hash); - - // rjf: determine expression range - Rng1U64 expr_range = {0}; - { - TxtRng selection_range = txt_rng(tv->cursor, tv->mark); - if(txt_pt_match(selection_range.min, selection_range.max)) - { - expr_range = txt_expr_off_range_from_info_data_pt(&text_info, data, tv->cursor); - } - else - { - expr_range = r1u64(txt_off_from_info_pt(&text_info, selection_range.min), txt_off_from_info_pt(&text_info, selection_range.max)); - } - } - - // rjf: expression range -> text - String8 expr_text = str8_substr(data, expr_range); - - // rjf: go to name - DF_CmdParams params = df_cmd_params_from_view(ws, panel, view); - params.entity = df_handle_from_entity(entity); - params.string = expr_text; - df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_String); - df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_GoToName)); - } - hs_scope_close(hs_scope); - txt_scope_close(txt_scope); - scratch_end(scratch); - }break; - case DF_CoreCmdKind_ToggleWatchExpressionAtCursor: - { - Temp scratch = scratch_begin(0, 0); - TXT_Scope *txt_scope = txt_scope_open(); - HS_Scope *hs_scope = hs_scope_open(); - { - // rjf: unpack entity info - String8 path = df_full_path_from_entity(scratch.arena, entity); - U128 key = fs_key_from_path(path); - TXT_LangKind lang_kind = txt_lang_kind_from_extension(str8_skip_last_dot(path)); - U128 hash = {0}; - TXT_TextInfo text_info = txt_text_info_from_key_lang(txt_scope, key, lang_kind, &hash); - String8 data = hs_data_from_hash(hs_scope, hash); - - // rjf: determine expression range - Rng1U64 expr_range = {0}; - { - TxtRng selection_range = txt_rng(tv->cursor, tv->mark); - if(txt_pt_match(selection_range.min, selection_range.max)) - { - expr_range = txt_expr_off_range_from_info_data_pt(&text_info, data, tv->cursor); - } - else - { - expr_range = r1u64(txt_off_from_info_pt(&text_info, selection_range.min), txt_off_from_info_pt(&text_info, selection_range.max)); - } - } - - // rjf: expression range -> text - String8 expr_text = str8_substr(data, expr_range); - - // rjf: toggle watch expr - DF_CmdParams params = df_cmd_params_from_view(ws, panel, view); - params.string = expr_text; - df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_String); - df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_ToggleWatchExpression)); - scratch_end(scratch); - } - hs_scope_close(hs_scope); - txt_scope_close(txt_scope); - scratch_end(scratch); - }break; - case DF_CoreCmdKind_PickFile: - { - DF_Entity *missing_file = df_entity_from_handle(tv->pick_file_override_target); - String8 pick_string = cmd->params.file_path; - if(!df_entity_is_nil(missing_file) && pick_string.size != 0) - { - DF_Entity *replacement = df_entity_from_path(pick_string, DF_EntityFromPathFlag_OpenAsNeeded|DF_EntityFromPathFlag_OpenMissing); - view->entity = df_handle_from_entity(replacement); - DF_CmdParams p = df_cmd_params_from_view(ws, panel, view); - p.entity = df_handle_from_entity(missing_file); - p.file_path = pick_string; - df_cmd_params_mark_slot(&p, DF_CmdParamSlot_Entity); - df_cmd_params_mark_slot(&p, DF_CmdParamSlot_FilePath); - df_push_cmd__root(&p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_SetFileReplacementPath)); - } - }break; - } - } -} - -DF_VIEW_UI_FUNCTION_DEF(Code) -{ - ProfBeginFunction(); - Temp scratch = scratch_begin(0, 0); - HS_Scope *hs_scope = hs_scope_open(); - DI_Scope *di_scope = di_scope_open(); - TXT_Scope *txt_scope = txt_scope_open(); - DF_CodeViewState *tv = df_view_user_state(view, DF_CodeViewState); - - ////////////////////////////// - //- rjf: extract invariants - // - DF_Entity *entity = df_entity_from_handle(view->entity); - DF_CtrlCtx ctrl_ctx = df_ctrl_ctx_from_view(ws, view); - F_Tag code_font = df_font_from_slot(DF_FontSlot_Code); - F32 code_font_size = df_font_size_from_slot(ws, DF_FontSlot_Code); - F32 code_tab_size = f_column_size_from_tag_size(code_font, code_font_size)*df_setting_val_from_code(DF_SettingCode_TabWidth).s32; - F_Metrics code_font_metrics = f_metrics_from_tag_size(code_font, code_font_size); - F32 code_line_height = ceil_f32(f_line_height_from_metrics(&code_font_metrics) * 1.5f); - F32 big_glyph_advance = f_dim_from_tag_size_string(code_font, code_font_size, 0, 0, str8_lit("H")).x; - Vec2F32 panel_box_dim = dim_2f32(rect); - Vec2F32 bottom_bar_dim = {panel_box_dim.x, ui_em(1.8f, 0).value}; - F32 scroll_bar_dim = floor_f32(ui_top_font_size()*1.5f); - Vec2F32 code_area_dim = v2f32(panel_box_dim.x - scroll_bar_dim, panel_box_dim.y - scroll_bar_dim - bottom_bar_dim.y); - S64 num_possible_visible_lines = (S64)(code_area_dim.y/code_line_height)+1; - - ////////////////////////////// - //- rjf: unpack ctrl ctx & make parse ctx - // - DF_Entity *thread = df_entity_from_handle(ctrl_ctx.thread); - U64 unwind_count = ctrl_ctx.unwind_count; - U64 rip_vaddr = df_query_cached_rip_from_thread_unwind(thread, unwind_count); - DF_Entity *process = df_entity_ancestor_from_kind(thread, DF_EntityKind_Process); - EVAL_ParseCtx parse_ctx = df_eval_parse_ctx_from_process_vaddr(di_scope, process, rip_vaddr); - - ////////////////////////////// - //- rjf: unpack file/text entity info - // - B32 entity_is_missing = !!(entity->flags & DF_EntityFlag_IsMissing && !(entity->flags & DF_EntityFlag_Output)); - String8 path = df_full_path_from_entity(scratch.arena, entity); - df_interact_regs()->text_key = fs_key_from_path(path); - df_interact_regs()->lang_kind = txt_lang_kind_from_extension(str8_skip_last_dot(path)); - U128 hash = {0}; - TXT_TextInfo text_info = txt_text_info_from_key_lang(txt_scope, df_interact_regs()->text_key, df_interact_regs()->lang_kind, &hash); - String8 data = hs_data_from_hash(hs_scope, hash); - B32 text_info_is_ready = (text_info.lines_count != 0); - - ////////////////////////////// - //- rjf: buffer is pending -> equip view with loading information - // - if(!entity_is_missing && !text_info_is_ready) - { - df_view_equip_loading_info(view, 1, text_info.bytes_processed, text_info.bytes_to_process); - } - - ////////////////////////////// - //- rjf: determine visible line range / count - // - Rng1S64 visible_line_num_range = r1s64(view->scroll_pos.y.idx + (S64)(view->scroll_pos.y.off) + 1 - !!(view->scroll_pos.y.off < 0), - view->scroll_pos.y.idx + (S64)(view->scroll_pos.y.off) + 1 + num_possible_visible_lines); - Rng1S64 target_visible_line_num_range = r1s64(view->scroll_pos.y.idx + 1, - view->scroll_pos.y.idx + 1 + num_possible_visible_lines); - U64 visible_line_count = 0; - { - visible_line_num_range.min = Clamp(1, visible_line_num_range.min, (S64)text_info.lines_count); - visible_line_num_range.max = Clamp(1, visible_line_num_range.max, (S64)text_info.lines_count); - visible_line_num_range.min = Max(1, visible_line_num_range.min); - visible_line_num_range.max = Max(1, visible_line_num_range.max); - target_visible_line_num_range.min = Clamp(1, target_visible_line_num_range.min, (S64)text_info.lines_count); - target_visible_line_num_range.max = Clamp(1, target_visible_line_num_range.max, (S64)text_info.lines_count); - target_visible_line_num_range.min = Max(1, target_visible_line_num_range.min); - target_visible_line_num_range.max = Max(1, target_visible_line_num_range.max); - visible_line_count = (U64)dim_1s64(visible_line_num_range)+1; - } - - ////////////////////////////// - //- rjf: calculate scroll bounds - // - S64 line_size_x = 0; - Rng1S64 scroll_idx_rng[Axis2_COUNT] = {0}; - { - line_size_x = (text_info.lines_max_size*big_glyph_advance*3)/2; - line_size_x = ClampBot(line_size_x, (S64)big_glyph_advance*120); - line_size_x = ClampBot(line_size_x, (S64)code_area_dim.x); - scroll_idx_rng[Axis2_X] = r1s64(0, line_size_x-(S64)code_area_dim.x); - scroll_idx_rng[Axis2_Y] = r1s64(0, (S64)text_info.lines_count-1); - } - - ////////////////////////////// - //- rjf: calculate line-range-dependent info - // - F32 priority_margin_width_px = big_glyph_advance*3.5f; - F32 catchall_margin_width_px = big_glyph_advance*3.5f; - F32 line_num_width_px = big_glyph_advance * (log10(visible_line_num_range.max) + 3); - TXT_LineTokensSlice slice = txt_line_tokens_slice_from_info_data_line_range(scratch.arena, &text_info, data, visible_line_num_range); - - ////////////////////////////// - //- rjf: get active search query - // - String8 search_query = {0}; - Side search_query_side = Side_Invalid; - B32 search_query_is_active = 0; - { - DF_CoreCmdKind query_cmd_kind = df_core_cmd_kind_from_string(ws->query_cmd_spec->info.string); - if(query_cmd_kind == DF_CoreCmdKind_FindTextForward || - query_cmd_kind == DF_CoreCmdKind_FindTextBackward) - { - search_query = str8(ws->query_view_stack_top->query_buffer, ws->query_view_stack_top->query_string_size); - search_query_is_active = 1; - search_query_side = (query_cmd_kind == DF_CoreCmdKind_FindTextForward) ? Side_Max : Side_Min; - } - } - - ////////////////////////////// - //- rjf: prepare code slice info bundle, for the viewable region of text - // - DF_CodeSliceParams code_slice_params = {0}; - if(text_info_is_ready) - { - // rjf: fill basics - code_slice_params.flags = DF_CodeSliceFlag_PriorityMargin|DF_CodeSliceFlag_CatchallMargin|DF_CodeSliceFlag_LineNums|DF_CodeSliceFlag_Clickable; - code_slice_params.line_num_range = visible_line_num_range; - code_slice_params.line_text = push_array(scratch.arena, String8, visible_line_count); - code_slice_params.line_ranges = push_array(scratch.arena, Rng1U64, visible_line_count); - code_slice_params.line_tokens = push_array(scratch.arena, TXT_TokenArray, visible_line_count); - code_slice_params.line_bps = push_array(scratch.arena, DF_EntityList, visible_line_count); - code_slice_params.line_ips = push_array(scratch.arena, DF_EntityList, visible_line_count); - code_slice_params.line_pins = push_array(scratch.arena, DF_EntityList, visible_line_count); - code_slice_params.line_vaddrs = push_array(scratch.arena, U64, visible_line_count); - code_slice_params.line_dasm2src = push_array(scratch.arena, DF_TextLineDasm2SrcInfoList, visible_line_count); - code_slice_params.line_src2dasm = push_array(scratch.arena, DF_TextLineSrc2DasmInfoList, visible_line_count); - code_slice_params.font = code_font; - code_slice_params.font_size = code_font_size; - code_slice_params.tab_size = code_tab_size; - code_slice_params.line_height_px = code_line_height; - code_slice_params.search_query = search_query; - code_slice_params.priority_margin_width_px = priority_margin_width_px; - code_slice_params.catchall_margin_width_px = catchall_margin_width_px; - code_slice_params.line_num_width_px = line_num_width_px; - code_slice_params.line_text_max_width_px = (F32)line_size_x; - code_slice_params.margin_float_off_px = view->scroll_pos.x.idx + view->scroll_pos.x.off; - - // rjf: fill text info - { - S64 line_num = visible_line_num_range.min; - U64 line_idx = visible_line_num_range.min-1; - for(U64 visible_line_idx = 0; visible_line_idx < visible_line_count; visible_line_idx += 1, line_idx += 1, line_num += 1) - { - code_slice_params.line_text[visible_line_idx] = str8_substr(data, text_info.lines_ranges[line_idx]); - code_slice_params.line_ranges[visible_line_idx] = text_info.lines_ranges[line_idx]; - code_slice_params.line_tokens[visible_line_idx] = slice.line_tokens[visible_line_idx]; - } - } - - // rjf: find visible breakpoints - ProfScope("find visible breakpoints") - { - for(DF_Entity *bp = entity->first; !df_entity_is_nil(bp); bp = bp->next) - { - if(bp->deleted || bp->kind != DF_EntityKind_Breakpoint) { continue; } - if(visible_line_num_range.min <= bp->text_point.line && bp->text_point.line <= visible_line_num_range.max) - { - U64 slice_line_idx = (bp->text_point.line-visible_line_num_range.min); - df_entity_list_push(scratch.arena, &code_slice_params.line_bps[slice_line_idx], bp); - } - } - } - - // rjf: find live threads mapping to this file - ProfScope("find live threads mapping to this file") - { - DF_Entity *selected_thread = df_entity_from_handle(ctrl_ctx.thread); - DF_EntityList threads = df_query_cached_entity_list_with_kind(DF_EntityKind_Thread); - for(DF_EntityNode *thread_n = threads.first; thread_n != 0; thread_n = thread_n->next) - { - DF_Entity *thread = thread_n->entity; - DF_Entity *process = df_entity_ancestor_from_kind(thread, DF_EntityKind_Process); - U64 base_unwind_count = (thread == selected_thread) ? ctrl_ctx.unwind_count : 0; - U64 inline_unwind_count = (thread == selected_thread) ? ctrl_ctx.inline_unwind_count : 0; - U64 rip_vaddr = df_query_cached_rip_from_thread_unwind(thread, unwind_count); - U64 last_inst_on_unwound_rip_vaddr = rip_vaddr - !!unwind_count; - DF_Entity *module = df_module_from_process_vaddr(process, last_inst_on_unwound_rip_vaddr); - U64 rip_voff = df_voff_from_vaddr(module, last_inst_on_unwound_rip_vaddr); - DI_Key dbgi_key = df_dbgi_key_from_module(module); - DF_TextLineDasm2SrcInfo dasm2src_info = df_text_line_dasm2src_info_from_dbgi_key_voff(&dbgi_key, rip_voff, inline_unwind_count); - if(dasm2src_info.file == entity && visible_line_num_range.min <= dasm2src_info.pt.line && dasm2src_info.pt.line <= visible_line_num_range.max) - { - U64 slice_line_idx = dasm2src_info.pt.line-visible_line_num_range.min; - df_entity_list_push(scratch.arena, &code_slice_params.line_ips[slice_line_idx], thread); - } - } - } - - // rjf: find visible watch pins - ProfScope("find visible watch pins") - { - for(DF_Entity *wp = entity->first; !df_entity_is_nil(wp); wp = wp->next) - { - if(wp->deleted || wp->kind != DF_EntityKind_WatchPin) { continue; } - if(visible_line_num_range.min <= wp->text_point.line && wp->text_point.line <= visible_line_num_range.max) - { - U64 slice_line_idx = (wp->text_point.line-visible_line_num_range.min); - df_entity_list_push(scratch.arena, &code_slice_params.line_pins[slice_line_idx], wp); - } - } - } - - // rjf: find all src -> dasm info - ProfScope("find all src -> dasm info") - { - DF_TextLineSrc2DasmInfoListArray src2dasm = df_text_line_src2dasm_info_list_array_from_src_line_range(scratch.arena, entity, visible_line_num_range); - if(src2dasm.count != 0) - { - MemoryCopy(code_slice_params.line_src2dasm, src2dasm.v, sizeof(DF_TextLineSrc2DasmInfoList)*src2dasm.count); - } - code_slice_params.relevant_dbgi_keys = src2dasm.dbgi_keys; - } - } - - ////////////////////////////// - //- rjf: build missing & override interface - // - if(entity_is_missing && !text_info_is_ready) - { - UI_WidthFill UI_HeightFill UI_Column UI_Padding(ui_pct(1, 0)) - { - Temp scratch = scratch_begin(0, 0); - String8 full_path = df_full_path_from_entity(scratch.arena, entity); - UI_PrefWidth(ui_children_sum(1)) UI_PrefHeight(ui_em(3, 1)) - UI_Row UI_Padding(ui_pct(1, 0)) - UI_PrefWidth(ui_text_dim(10, 1)) - UI_Palette(ui_build_palette(ui_top_palette(), .text = df_rgba_from_theme_color(DF_ThemeColor_TextNegative))) - { - UI_Font(df_font_from_slot(DF_FontSlot_Icons)) - UI_RunFlags(F_RunFlag_Smooth) - ui_label(df_g_icon_kind_text_table[DF_IconKind_WarningBig]); - ui_labelf("Could not find \"%S\".", full_path); - } - UI_PrefHeight(ui_em(3, 1)) - UI_Row UI_Padding(ui_pct(1, 0)) - UI_PrefWidth(ui_text_dim(10, 1)) - UI_CornerRadius(ui_top_font_size()/3) - UI_PrefWidth(ui_text_dim(10, 1)) - UI_Focus(UI_FocusKind_On) - DF_Palette(DF_PaletteCode_NeutralPopButton) - if(ui_clicked(ui_buttonf("Find alternative..."))) - { - DF_CmdParams params = df_cmd_params_from_view(ws, panel, view); - params.cmd_spec = df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_PickFile); - df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_CmdSpec); - df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_RunCommand)); - tv->pick_file_override_target = df_handle_from_entity(entity); - } - scratch_end(scratch); - } - } - - ////////////////////////////// - //- rjf: build container - // - UI_Box *container_box = &ui_g_nil_box; - if(text_info_is_ready) - { - ui_set_next_pref_width(ui_px(code_area_dim.x, 1)); - ui_set_next_pref_height(ui_px(code_area_dim.y, 1)); - ui_set_next_child_layout_axis(Axis2_Y); - container_box = ui_build_box_from_stringf(UI_BoxFlag_Clip| - UI_BoxFlag_Scroll| - UI_BoxFlag_AllowOverflowX| - UI_BoxFlag_AllowOverflowY, - "###code_area_%p", view); - } - - ////////////////////////////// - //- rjf: cancelled search query -> center cursor - // - if(!search_query_is_active && tv->drifted_for_search) - { - tv->drifted_for_search = 0; - tv->center_cursor = 1; - } - - ////////////////////////////// - //- rjf: do searching operations - // - if(text_info_is_ready) - { - //- rjf: find text (forward) - if(tv->find_text_fwd.size != 0) - { - Temp scratch = scratch_begin(0, 0); - B32 found = 0; - B32 first = 1; - S64 line_num_start = tv->cursor.line; - S64 line_num_last = (S64)text_info.lines_count; - for(S64 line_num = line_num_start;; first = 0) - { - // rjf: pop scratch - temp_end(scratch); - - // rjf: gather line info - String8 line_string = str8_substr(data, text_info.lines_ranges[line_num-1]); - U64 search_start = 0; - if(tv->cursor.line == line_num && first) - { - search_start = tv->cursor.column; - } - - // rjf: search string - U64 needle_pos = str8_find_needle(line_string, search_start, tv->find_text_fwd, StringMatchFlag_CaseInsensitive); - if(needle_pos < line_string.size) - { - tv->cursor.line = line_num; - tv->cursor.column = needle_pos+1; - tv->mark = tv->cursor; - found = 1; - break; - } - - // rjf: break if circled back around to cursor - else if(line_num == line_num_start && !first) - { - break; - } - - // rjf: increment - line_num += 1; - if(line_num > line_num_last) - { - line_num = 1; - } - } - tv->center_cursor = found; - if(found == 0) - { - DF_CmdParams params = df_cmd_params_from_view(ws, panel, view); - params.string = push_str8f(scratch.arena, "Could not find \"%S\"", tv->find_text_fwd); - df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_String); - df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_Error)); - } - scratch_end(scratch); - } - - //- rjf: find text (backward) - if(tv->find_text_bwd.size != 0) - { - Temp scratch = scratch_begin(0, 0); - B32 found = 0; - B32 first = 1; - S64 line_num_start = tv->cursor.line; - S64 line_num_last = (S64)text_info.lines_count; - for(S64 line_num = line_num_start;; first = 0) - { - // rjf: pop scratch - temp_end(scratch); - - // rjf: gather line info - String8 line_string = str8_substr(data, text_info.lines_ranges[line_num-1]); - if(tv->cursor.line == line_num && first) - { - line_string = str8_prefix(line_string, tv->cursor.column-1); - } - - // rjf: search string - U64 next_needle_pos = line_string.size; - for(U64 needle_pos = 0; needle_pos < line_string.size;) - { - needle_pos = str8_find_needle(line_string, needle_pos, tv->find_text_bwd, StringMatchFlag_CaseInsensitive); - if(needle_pos < line_string.size) - { - next_needle_pos = needle_pos; - needle_pos += 1; - } - } - if(next_needle_pos < line_string.size) - { - tv->cursor.line = line_num; - tv->cursor.column = next_needle_pos+1; - tv->mark = tv->cursor; - found = 1; - break; - } - - // rjf: break if circled back around to cursor line - else if(line_num == line_num_start && !first) - { - break; - } - - // rjf: increment - line_num -= 1; - if(line_num == 0) - { - line_num = line_num_last; - } - } - tv->center_cursor = found; - if(found == 0) - { - DF_CmdParams params = df_cmd_params_from_view(ws, panel, view); - params.string = push_str8f(scratch.arena, "Could not find \"%S\"", tv->find_text_bwd); - df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_String); - df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_Error)); - } - scratch_end(scratch); - } - - MemoryZeroStruct(&tv->find_text_fwd); - MemoryZeroStruct(&tv->find_text_bwd); - arena_clear(tv->find_text_arena); - } - - ////////////////////////////// - //- rjf: do goto line - // - if(text_info_is_ready) if(tv->goto_line_num != 0) - { - S64 line_num = tv->goto_line_num; - tv->goto_line_num = 0; - line_num = Clamp(1, line_num, text_info.lines_count); - tv->cursor = tv->mark = txt_pt(line_num, 1); - tv->center_cursor = !tv->contain_cursor || (line_num < target_visible_line_num_range.min+4 || target_visible_line_num_range.max-4 < line_num); - } - - ////////////////////////////// - //- rjf: do keyboard interaction - // - B32 snap[Axis2_COUNT] = {0}; - UI_Focus(UI_FocusKind_On) - { - if(ui_is_focus_active() && text_info_is_ready && visible_line_num_range.max >= visible_line_num_range.min) - { - snap[Axis2_X] = snap[Axis2_Y] = df_do_txt_controls(&text_info, data, ClampBot(num_possible_visible_lines, 10) - 10, &tv->cursor, &tv->mark, &tv->preferred_column); - } - } - - ////////////////////////////// - //- rjf: build container contents - // - if(text_info_is_ready) UI_Parent(container_box) - { - //- rjf: build fractional space - container_box->view_off.x = container_box->view_off_target.x = view->scroll_pos.x.idx + view->scroll_pos.x.off; - container_box->view_off.y = container_box->view_off_target.y = code_line_height*mod_f32(view->scroll_pos.y.off, 1.f) + code_line_height*(view->scroll_pos.y.off < 0) - code_line_height*(view->scroll_pos.y.off == -1.f && view->scroll_pos.y.idx == 1); - - //- rjf: build code slice - DF_CodeSliceSignal sig = {0}; - UI_Focus(UI_FocusKind_On) - { - sig = df_code_slicef(ws, &ctrl_ctx, &parse_ctx, &code_slice_params, &tv->cursor, &tv->mark, &tv->preferred_column, "txt_view_%p", view); - } - - //- rjf: hover eval - if(!ui_dragging(sig.base) && sig.mouse_expr_rng.min.line != 0 && sig.base.event_flags == 0) - { - TxtRng expr_rng = sig.mouse_expr_rng; - String8 expr = txt_string_from_info_data_txt_rng(&text_info, data, expr_rng); - if(expr.size != 0) - { - DF_Eval eval = df_eval_from_string(scratch.arena, di_scope, &ctrl_ctx, &parse_ctx, &eval_string2expr_map_nil, expr); - if(eval.mode != EVAL_EvalMode_NULL) - { - df_set_hover_eval(ws, sig.mouse_expr_baseline_pos, ctrl_ctx, entity, sig.mouse_pt, 0, expr); - } - } - } - - //- rjf: press code slice? -> focus panel - if(ui_pressed(sig.base)) - { - DF_CmdParams p = df_cmd_params_from_panel(ws, panel); - df_push_cmd__root(&p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_FocusPanel)); - } - - //- rjf: dragging & outside region? -> contain cursor - if(ui_dragging(sig.base) && sig.base.event_flags == 0) - { - if(!contains_2f32(sig.base.box->rect, ui_mouse())) - { - tv->contain_cursor = 1; - } - else - { - snap[Axis2_X] = 1; - } - } - - //- rjf: ctrl+pressed? -> go to name - if(ui_pressed(sig.base) && sig.base.event_flags & OS_EventFlag_Ctrl) - { - ui_kill_action(); - DF_CmdParams params = df_cmd_params_from_view(ws, panel, view); - params.entity = df_handle_from_entity(entity); - params.string = txt_string_from_info_data_txt_rng(&text_info, data, sig.mouse_expr_rng); - df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_String); - df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_GoToName)); - } - - //- rjf: clicked margin? -> place breakpoint - if(sig.clicked_margin_line_num != 0) - { - DF_CmdParams params = df_cmd_params_from_view(ws, panel, view); - params.text_point = txt_pt(sig.clicked_margin_line_num, 1); - params.entity = df_handle_from_entity(entity); - df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_TextPoint); - df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_Entity); - df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_TextBreakpoint)); - } - - //- rjf: dropped entity onto line? -> do drop - if(sig.dropped_entity_line_num != 0 && !df_entity_is_nil(sig.dropped_entity)) - { - DF_Entity *dropped_entity = sig.dropped_entity; - switch(dropped_entity->kind) - { - default:{}break; - case DF_EntityKind_Breakpoint: - case DF_EntityKind_WatchPin: - { - DF_StateDeltaHistory *hist = df_state_delta_history(); - df_state_delta_history_push_batch(hist, &dropped_entity->generation); - df_state_delta_history_push_struct_delta(hist, &dropped_entity->text_point); - df_entity_change_parent(hist, dropped_entity, dropped_entity->parent, entity); - df_entity_equip_txt_pt(dropped_entity, txt_pt(sig.dropped_entity_line_num, 1)); - if(dropped_entity->flags & DF_EntityFlag_HasVAddr) - { - df_state_delta_history_push_struct_delta(hist, &dropped_entity->vaddr); - df_entity_equip_vaddr(dropped_entity, 0); - } - }break; - case DF_EntityKind_Thread: - if(contains_1s64(visible_line_num_range, sig.dropped_entity_line_num)) - { - U64 line_idx = (sig.dropped_entity_line_num-visible_line_num_range.min); - DF_TextLineSrc2DasmInfoList *src2dasm_list = &code_slice_params.line_src2dasm[line_idx]; - if(src2dasm_list->first != 0) - { - Rng1U64 voff_rng = src2dasm_list->first->v.voff_range; - DI_Key dbgi_key = src2dasm_list->first->v.dbgi_key; - DF_EntityList possible_modules = df_modules_from_dbgi_key(scratch.arena, &dbgi_key); - DF_Entity *thread_dst_module = df_module_from_thread_candidates(dropped_entity, &possible_modules); - U64 thread_dst_voff = voff_rng.min; - if(!df_entity_is_nil(thread_dst_module) && thread_dst_voff != 0) - { - DF_CmdParams params = df_cmd_params_from_window(ws); - params.entity = df_handle_from_entity(dropped_entity); - params.vaddr = df_vaddr_from_voff(thread_dst_module, thread_dst_voff); - df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_Entity); - df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_VirtualAddr); - df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_SetThreadIP)); - } - } - }break; - } - } - - //- rjf: copy text - if(!txt_pt_match(sig.copy_range.min, sig.copy_range.max)) - { - String8 text = txt_string_from_info_data_txt_rng(&text_info, data, sig.copy_range); - os_set_clipboard_text(text); - } - - //- rjf: selected text on single line, no query? -> set search text - if(!txt_pt_match(tv->cursor, tv->mark) && tv->cursor.line == tv->mark.line && search_query.size == 0) - { - String8 text = txt_string_from_info_data_txt_rng(&text_info, data, txt_rng(tv->cursor, tv->mark)); - df_set_search_string(text); - } - - //- rjf: toggle cursor watch - if(sig.toggle_cursor_watch) - { - DF_CmdParams params = df_cmd_params_from_view(ws, panel, view); - df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_ToggleWatchExpressionAtCursor)); - } - - //- rjf: set next statement - if(sig.set_next_statement_line_num != 0 && contains_1s64(visible_line_num_range, sig.set_next_statement_line_num)) - { - DF_CmdParams params = df_cmd_params_from_view(ws, panel, view); - params.text_point = txt_pt(sig.set_next_statement_line_num, 1); - df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_SetNextStatement)); - } - - //- rjf: run-to-line - if(sig.run_to_line_num != 0 && contains_1s64(visible_line_num_range, sig.run_to_line_num)) - { - DF_CmdParams params = df_cmd_params_from_view(ws, panel, view); - params.entity = df_handle_from_entity(entity); - params.text_point = txt_pt(sig.run_to_line_num, 1); - df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_RunToLine)); - } - - //- rjf: go to disasm - if(sig.goto_disasm_line_num != 0 && contains_1s64(visible_line_num_range, sig.goto_disasm_line_num)) - { - U64 line_idx = (sig.goto_disasm_line_num-visible_line_num_range.min); - DF_TextLineSrc2DasmInfoList *src2dasm_list = &code_slice_params.line_src2dasm[line_idx]; - if(src2dasm_list->first != 0) - { - Rng1U64 voff_rng = src2dasm_list->first->v.voff_range; - DI_Key dbgi_key = src2dasm_list->first->v.dbgi_key; - DF_EntityList possible_modules = df_modules_from_dbgi_key(scratch.arena, &dbgi_key); - DF_Entity *thread = df_entity_from_handle(ctrl_ctx.thread); - DF_Entity *thread_dst_module = df_module_from_thread_candidates(thread, &possible_modules); - DF_Entity *process = df_entity_ancestor_from_kind(thread, DF_EntityKind_Process); - DF_Entity *module = thread_dst_module; - if(df_entity_is_nil(module)) - { - module = df_first_entity_from_list(&possible_modules); - } - U64 voff = voff_rng.min; - if(!df_entity_is_nil(module) && voff != 0) - { - DF_CmdParams params = df_cmd_params_from_window(ws); - params.entity = df_handle_from_entity(process); - params.vaddr = df_vaddr_from_voff(module, voff); - df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_Entity); - df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_VirtualAddr); - df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_FindCodeLocation)); - } - } - } - } - - ////////////////////////////// - //- rjf: apply post-build view snapping rules - // - if(text_info_is_ready) - { - // rjf: contain => snap - if(tv->contain_cursor) - { - tv->contain_cursor = 0; - snap[Axis2_X] = 1; - snap[Axis2_Y] = 1; - } - - // rjf: center cursor - if(tv->center_cursor) - { - tv->center_cursor = 0; - String8 cursor_line = str8_substr(data, text_info.lines_ranges[tv->cursor.line-1]); - F32 cursor_advance = f_dim_from_tag_size_string(code_font, code_font_size, 0, code_tab_size, str8_prefix(cursor_line, tv->cursor.column-1)).x; - - // rjf: scroll x - { - S64 new_idx = (S64)(cursor_advance - code_area_dim.x/2); - new_idx = Clamp(scroll_idx_rng[Axis2_X].min, new_idx, scroll_idx_rng[Axis2_X].max); - ui_scroll_pt_target_idx(&view->scroll_pos.x, new_idx); - snap[Axis2_X] = 0; - } - - // rjf: scroll y - { - S64 new_idx = (tv->cursor.line-1) - num_possible_visible_lines/2 + 2; - new_idx = Clamp(scroll_idx_rng[Axis2_Y].min, new_idx, scroll_idx_rng[Axis2_Y].max); - ui_scroll_pt_target_idx(&view->scroll_pos.y, new_idx); - snap[Axis2_Y] = 0; - } - } - - // rjf: snap in X - if(snap[Axis2_X]) - { - String8 cursor_line = str8_substr(data, text_info.lines_ranges[tv->cursor.line-1]); - S64 cursor_off = (S64)(f_dim_from_tag_size_string(code_font, code_font_size, 0, code_tab_size, str8_prefix(cursor_line, tv->cursor.column-1)).x + priority_margin_width_px + catchall_margin_width_px + line_num_width_px); - Rng1S64 visible_pixel_range = - { - view->scroll_pos.x.idx, - view->scroll_pos.x.idx + (S64)code_area_dim.x, - }; - Rng1S64 cursor_pixel_range = - { - cursor_off - (S64)(big_glyph_advance*4) - (S64)(priority_margin_width_px + catchall_margin_width_px + line_num_width_px), - cursor_off + (S64)(big_glyph_advance*4), - }; - S64 min_delta = Min(0, cursor_pixel_range.min - visible_pixel_range.min); - S64 max_delta = Max(0, cursor_pixel_range.max - visible_pixel_range.max); - S64 new_idx = view->scroll_pos.x.idx+min_delta+max_delta; - new_idx = Clamp(scroll_idx_rng[Axis2_X].min, new_idx, scroll_idx_rng[Axis2_X].max); - ui_scroll_pt_target_idx(&view->scroll_pos.x, new_idx); - } - - // rjf: snap in Y - if(snap[Axis2_Y]) - { - Rng1S64 cursor_visibility_range = r1s64(tv->cursor.line-4, tv->cursor.line+4); - cursor_visibility_range.min = ClampBot(0, cursor_visibility_range.min); - cursor_visibility_range.max = ClampBot(0, cursor_visibility_range.max); - S64 min_delta = Min(0, cursor_visibility_range.min-(target_visible_line_num_range.min)); - S64 max_delta = Max(0, cursor_visibility_range.max-(target_visible_line_num_range.min+num_possible_visible_lines)); - S64 new_idx = view->scroll_pos.y.idx+min_delta+max_delta; - new_idx = Clamp(0, new_idx, (S64)text_info.lines_count-1); - ui_scroll_pt_target_idx(&view->scroll_pos.y, new_idx); - } - } - - ////////////////////////////// - //- rjf: build horizontal scroll bar - // - if(text_info_is_ready) - { - ui_set_next_fixed_x(0); - ui_set_next_fixed_y(code_area_dim.y); - ui_set_next_fixed_width(panel_box_dim.x - scroll_bar_dim); - ui_set_next_fixed_height(scroll_bar_dim); - { - view->scroll_pos.x = ui_scroll_bar(Axis2_X, - ui_px(scroll_bar_dim, 1.f), - view->scroll_pos.x, - scroll_idx_rng[Axis2_X], - (S64)code_area_dim.x); - } - } - - ////////////////////////////// - //- rjf: build vertical scroll bar - // - if(text_info_is_ready) - { - ui_set_next_fixed_x(code_area_dim.x); - ui_set_next_fixed_y(0); - ui_set_next_fixed_width(scroll_bar_dim); - ui_set_next_fixed_height(panel_box_dim.y - bottom_bar_dim.y - scroll_bar_dim); - { - view->scroll_pos.y = ui_scroll_bar(Axis2_Y, - ui_px(scroll_bar_dim, 1.f), - view->scroll_pos.y, - scroll_idx_rng[Axis2_Y], - num_possible_visible_lines); - } - } - - ////////////////////////////// - //- rjf: top-level container interaction (scrolling) - // - if(text_info_is_ready) - { - UI_Signal sig = ui_signal_from_box(container_box); - if(sig.scroll.x != 0) - { - S64 new_idx = view->scroll_pos.x.idx+sig.scroll.x*big_glyph_advance; - new_idx = clamp_1s64(scroll_idx_rng[Axis2_X], new_idx); - ui_scroll_pt_target_idx(&view->scroll_pos.x, new_idx); - } - if(sig.scroll.y != 0) - { - S64 new_idx = view->scroll_pos.y.idx + sig.scroll.y; - new_idx = clamp_1s64(scroll_idx_rng[Axis2_Y], new_idx); - ui_scroll_pt_target_idx(&view->scroll_pos.y, new_idx); - } - ui_scroll_pt_clamp_idx(&view->scroll_pos.x, scroll_idx_rng[Axis2_X]); - ui_scroll_pt_clamp_idx(&view->scroll_pos.y, scroll_idx_rng[Axis2_Y]); - } - - ////////////////////////////// - //- rjf: determine up-to-dateness of source file - // - B32 file_is_out_of_date = 0; - String8 out_of_date_dbgi_name = {0}; - for(DI_KeyNode *n = code_slice_params.relevant_dbgi_keys.first; n != 0; n = n->next) - { - DI_Key key = n->v; - if(key.path.size != 0) - { - String8 full_path = df_full_path_from_entity(scratch.arena, entity); - TXTI_Handle handle = txti_handle_from_path(full_path); - TXTI_BufferInfo info = txti_buffer_info_from_handle(scratch.arena, handle); - if(key.min_timestamp < info.timestamp) - { - file_is_out_of_date = 1; - out_of_date_dbgi_name = str8_skip_last_slash(key.path); - break; - } - } - } - - ////////////////////////////// - //- rjf: build bottom info bar - // - if(text_info_is_ready) - { - ui_set_next_fixed_x(0); - ui_set_next_fixed_y(code_area_dim.y + scroll_bar_dim); - ui_set_next_pref_width(ui_px(bottom_bar_dim.x, 1)); - ui_set_next_pref_height(ui_px(bottom_bar_dim.y, 1)); - ui_set_next_flags(UI_BoxFlag_DrawBackground); - UI_Row - UI_TextAlignment(UI_TextAlign_Center) - UI_PrefWidth(ui_text_dim(10, 1)) - UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) - { - String8 full_path = df_full_path_from_entity(scratch.arena, entity); - TXTI_Handle handle = txti_handle_from_path(full_path); - TXTI_BufferInfo info = txti_buffer_info_from_handle(scratch.arena, handle); - if(file_is_out_of_date) - { - UI_Box *box = &ui_g_nil_box; - UI_Palette(ui_build_palette(ui_top_palette(), .text = df_rgba_from_theme_color(DF_ThemeColor_TextNegative))) - UI_Font(df_font_from_slot(DF_FontSlot_Icons)) - UI_RunFlags(F_RunFlag_Smooth) - { - box = ui_build_box_from_stringf(UI_BoxFlag_DrawText|UI_BoxFlag_Clickable, "%S###file_ood_warning", df_g_icon_kind_text_table[DF_IconKind_WarningBig]); - } - UI_Signal sig = ui_signal_from_box(box); - if(ui_hovering(sig)) UI_Tooltip - { - UI_PrefWidth(ui_children_sum(1)) UI_Row UI_PrefWidth(ui_text_dim(1, 1)) - { - ui_labelf("This file has changed since ", out_of_date_dbgi_name); - UI_Palette(ui_build_palette(ui_top_palette(), .text = df_rgba_from_theme_color(DF_ThemeColor_TextNeutral))) ui_label(out_of_date_dbgi_name); - ui_labelf(" was produced."); - } - } - } - UI_Font(code_font) - { - ui_label(full_path); - ui_spacer(ui_em(1.5f, 1)); - ui_labelf("Line: %I64d, Column: %I64d", tv->cursor.line, tv->cursor.column); - ui_spacer(ui_pct(1, 0)); - ui_labelf("(read only)"); - ui_labelf("%s", - info.line_end_kind == TXT_LineEndKind_LF ? "lf" : - info.line_end_kind == TXT_LineEndKind_CRLF ? "crlf" : - "bin"); - } - } - } - - txt_scope_close(txt_scope); - di_scope_close(di_scope); - hs_scope_close(hs_scope); - scratch_end(scratch); - ProfEnd(); -} -#endif //////////////////////////////// //~ rjf: Disassembly @view_hook_impl @@ -8511,7 +7430,6 @@ DF_VIEW_UI_FUNCTION_DEF(Procedures) //////////////////////////////// //~ rjf: Output @view_hook_impl -#if 1 DF_VIEW_SETUP_FUNCTION_DEF(Output) { DF_CodeViewState *cv = df_view_user_state(view, DF_CodeViewState); @@ -8602,624 +7520,6 @@ DF_VIEW_UI_FUNCTION_DEF(Output) hs_scope_close(hs_scope); scratch_end(scratch); } -#endif - -//~ TODO(rjf): OLD vvvvvvvvvvvvvvvvvvvv @src_collapse -#if 0 -DF_VIEW_SETUP_FUNCTION_DEF(Output) -{ - // rjf: set up state - DF_CodeViewState *tv = df_view_user_state(view, DF_CodeViewState); - if(tv->initialized == 0) - { - tv->initialized = 1; - tv->cursor = tv->mark = txt_pt(1, 1); - tv->preferred_column = 1; - tv->find_text_arena = df_view_push_arena_ext(view); - } - - // rjf: default to loading - df_view_equip_loading_info(view, 1, 0, 0); - view->loading_t = view->loading_t_target = 1.f; -} - -DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(Output) -{ - return str8_lit(""); -} - -DF_VIEW_CMD_FUNCTION_DEF(Output) -{ - DF_CodeViewState *tv = df_view_user_state(view, DF_CodeViewState); - DF_Entity *entity = df_entity_from_handle(view->entity); - for(DF_CmdNode *n = cmds->first; n != 0; n = n->next) - { - DF_Cmd *cmd = &n->cmd; - - // rjf: mismatched window/panel => skip - if(df_window_from_handle(cmd->params.window) != ws || - df_panel_from_handle(cmd->params.panel) != panel) - { - continue; - } - - // rjf: process - DF_CoreCmdKind core_cmd_kind = df_core_cmd_kind_from_string(cmd->spec->info.string); - switch(core_cmd_kind) - { - default: break; - case DF_CoreCmdKind_GoToLine: - { - tv->goto_line_num = cmd->params.text_point.line; - }break; - case DF_CoreCmdKind_CenterCursor: - { - tv->center_cursor = 1; - }break; - case DF_CoreCmdKind_ContainCursor: - { - tv->contain_cursor = 1; - }break; - case DF_CoreCmdKind_FindTextForward: - { - arena_clear(tv->find_text_arena); - tv->find_text_fwd = push_str8_copy(tv->find_text_arena, cmd->params.string); - }break; - case DF_CoreCmdKind_FindTextBackward: - { - arena_clear(tv->find_text_arena); - tv->find_text_bwd = push_str8_copy(tv->find_text_arena, cmd->params.string); - }break; - case DF_CoreCmdKind_ToggleBreakpointAtCursor: - { - DF_CmdParams params = df_cmd_params_from_view(ws, panel, view); - params.entity = view->entity; - params.text_point = tv->cursor; - df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_TextBreakpoint)); - tv->contain_cursor = 1; - }break; - case DF_CoreCmdKind_ToggleWatchPinAtCursor: - { - DF_CmdParams params = df_cmd_params_from_view(ws, panel, view); - params.entity = view->entity; - params.text_point = tv->cursor; - params.string = cmd->params.string; - df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_ToggleWatchPin)); - tv->contain_cursor = 1; - }break; - } - } -} - -DF_VIEW_UI_FUNCTION_DEF(Output) -{ - ProfBeginFunction(); - Temp scratch = scratch_begin(0, 0); - DI_Scope *scope = di_scope_open(); - DF_CodeViewState *tv = df_view_user_state(view, DF_CodeViewState); - - ////////////////////////////// - //- rjf: extract invariants - // - DF_Entity *entity = df_log_from_entity(df_entity_root()); - DF_CtrlCtx ctrl_ctx = df_ctrl_ctx_from_view(ws, view); - F_Tag code_font = df_font_from_slot(DF_FontSlot_Code); - F32 code_font_size = df_font_size_from_slot(ws, DF_FontSlot_Code); - F32 code_tab_size = f_column_size_from_tag_size(code_font, code_font_size)*df_setting_val_from_code(DF_SettingCode_TabWidth).s32; - F_Metrics code_font_metrics = f_metrics_from_tag_size(code_font, code_font_size); - F32 code_line_height = ceil_f32(f_line_height_from_metrics(&code_font_metrics) * 1.5f); - F32 big_glyph_advance = f_dim_from_tag_size_string(code_font, code_font_size, 0, 0, str8_lit("H")).x; - Vec2F32 panel_box_dim = dim_2f32(rect); - Vec2F32 bottom_bar_dim = {panel_box_dim.x, ui_top_font_size()*1.8f}; - F32 scroll_bar_dim = floor_f32(ui_top_font_size()*1.5f); - Vec2F32 code_area_dim = v2f32(panel_box_dim.x - scroll_bar_dim, panel_box_dim.y - scroll_bar_dim - bottom_bar_dim.y); - S64 num_possible_visible_lines = (S64)(code_area_dim.y/code_line_height)+1; - - ////////////////////////////// - //- rjf: unpack ctrl ctx & make parse ctx - // - DF_Entity *thread = df_entity_from_handle(ctrl_ctx.thread); - U64 unwind_count = ctrl_ctx.unwind_count; - U64 rip_vaddr = df_query_cached_rip_from_thread_unwind(thread, unwind_count); - DF_Entity *process = df_entity_ancestor_from_kind(thread, DF_EntityKind_Process); - EVAL_ParseCtx parse_ctx = df_eval_parse_ctx_from_process_vaddr(scope, process, rip_vaddr); - - ////////////////////////////// - //- rjf: unpack entity info - // - TXTI_Handle txti_handle = df_txti_handle_from_entity(entity); - TXTI_BufferInfo txti_buffer_info = txti_buffer_info_from_handle(scratch.arena, txti_handle); - B32 txti_buffer_is_ready = ((txti_buffer_info.timestamp != 0 || entity->flags & DF_EntityFlag_Output) && - (txti_buffer_info.bytes_processed == txti_buffer_info.bytes_to_process || txti_buffer_info.buffer_apply_gen != 0)); - - ////////////////////////////// - //- rjf: buffer is pending -> equip view with loading information - // - if(!txti_buffer_is_ready) - { - df_view_equip_loading_info(view, 1, txti_buffer_info.bytes_processed, txti_buffer_info.bytes_to_process); - } - - ////////////////////////////// - //- rjf: determine visible line range / count - // - Rng1S64 visible_line_num_range = r1s64(view->scroll_pos.y.idx + (S64)(view->scroll_pos.y.off) + 1 - !!(view->scroll_pos.y.off < 0), - view->scroll_pos.y.idx + (S64)(view->scroll_pos.y.off) + 1 + num_possible_visible_lines); - Rng1S64 target_visible_line_num_range = r1s64(view->scroll_pos.y.idx + 1, - view->scroll_pos.y.idx + 1 + num_possible_visible_lines); - U64 visible_line_count = 0; - { - visible_line_num_range.min = Clamp(1, visible_line_num_range.min, (S64)txti_buffer_info.total_line_count); - visible_line_num_range.max = Clamp(1, visible_line_num_range.max, (S64)txti_buffer_info.total_line_count); - visible_line_num_range.min = Max(1, visible_line_num_range.min); - visible_line_num_range.max = Max(1, visible_line_num_range.max); - target_visible_line_num_range.min = Clamp(1, target_visible_line_num_range.min, (S64)txti_buffer_info.total_line_count); - target_visible_line_num_range.max = Clamp(1, target_visible_line_num_range.max, (S64)txti_buffer_info.total_line_count); - target_visible_line_num_range.min = Max(1, target_visible_line_num_range.min); - target_visible_line_num_range.max = Max(1, target_visible_line_num_range.max); - visible_line_count = (U64)dim_1s64(visible_line_num_range)+1; - } - - ////////////////////////////// - //- rjf: calculate scroll bounds - // - S64 line_size_x = 0; - Rng1S64 scroll_idx_rng[Axis2_COUNT] = {0}; - { - line_size_x = (txti_buffer_info.max_line_size*big_glyph_advance*3)/2; - line_size_x = ClampBot(line_size_x, (S64)big_glyph_advance*120); - line_size_x = ClampBot(line_size_x, (S64)code_area_dim.x); - scroll_idx_rng[Axis2_X] = r1s64(0, line_size_x-(S64)code_area_dim.x); - scroll_idx_rng[Axis2_Y] = r1s64(0, (S64)txti_buffer_info.total_line_count-1); - } - - ////////////////////////////// - //- rjf: calculate line-range-dependent info - // - F32 priority_margin_width_px = big_glyph_advance*3.5f; - F32 catchall_margin_width_px = big_glyph_advance*3.5f; - F32 line_num_width_px = big_glyph_advance * (log10(visible_line_num_range.max) + 3); - TXTI_Slice slice = txti_slice_from_handle_line_range(scratch.arena, txti_handle, visible_line_num_range); - - ////////////////////////////// - //- rjf: get active search query - // - String8 search_query = {0}; - Side search_query_side = Side_Invalid; - B32 search_query_is_active = 0; - { - DF_CoreCmdKind query_cmd_kind = df_core_cmd_kind_from_string(ws->query_cmd_spec->info.string); - if(query_cmd_kind == DF_CoreCmdKind_FindTextForward || - query_cmd_kind == DF_CoreCmdKind_FindTextBackward) - { - search_query = str8(ws->query_view_stack_top->query_buffer, ws->query_view_stack_top->query_string_size); - search_query_is_active = 1; - search_query_side = (query_cmd_kind == DF_CoreCmdKind_FindTextForward) ? Side_Max : Side_Min; - } - } - - ////////////////////////////// - //- rjf: prepare code slice info bundle, for the viewable region of text - // - DF_CodeSliceParams code_slice_params = {0}; - if(txti_buffer_is_ready) - { - // rjf: fill basics - code_slice_params.flags = DF_CodeSliceFlag_LineNums|DF_CodeSliceFlag_Clickable; - code_slice_params.line_num_range = visible_line_num_range; - code_slice_params.line_text = slice.line_text; - code_slice_params.line_ranges = slice.line_ranges; - code_slice_params.line_tokens = slice.line_tokens; - code_slice_params.line_bps = push_array(scratch.arena, DF_EntityList, slice.line_count); - code_slice_params.line_ips = push_array(scratch.arena, DF_EntityList, slice.line_count); - code_slice_params.line_pins = push_array(scratch.arena, DF_EntityList, slice.line_count); - code_slice_params.line_vaddrs = push_array(scratch.arena, U64, visible_line_count); - code_slice_params.line_dasm2src = push_array(scratch.arena, DF_TextLineDasm2SrcInfoList, slice.line_count); - code_slice_params.line_src2dasm = push_array(scratch.arena, DF_TextLineSrc2DasmInfoList, slice.line_count); - code_slice_params.font = code_font; - code_slice_params.font_size = code_font_size; - code_slice_params.tab_size = code_tab_size; - code_slice_params.line_height_px = code_line_height; - code_slice_params.search_query = search_query; - code_slice_params.priority_margin_width_px = 0.f; - code_slice_params.catchall_margin_width_px = 0.f; - code_slice_params.line_num_width_px = line_num_width_px; - code_slice_params.line_text_max_width_px = (F32)line_size_x; - code_slice_params.margin_float_off_px = view->scroll_pos.x.idx + view->scroll_pos.x.off; - } - - ////////////////////////////// - //- rjf: build container - // - UI_Box *container_box = &ui_g_nil_box; - if(txti_buffer_is_ready) - { - ui_set_next_pref_width(ui_px(code_area_dim.x, 1)); - ui_set_next_pref_height(ui_px(code_area_dim.y, 1)); - ui_set_next_child_layout_axis(Axis2_Y); - container_box = ui_build_box_from_stringf(UI_BoxFlag_Clip| - UI_BoxFlag_Scroll| - UI_BoxFlag_DrawBorder| - UI_BoxFlag_AllowOverflowX| - UI_BoxFlag_AllowOverflowY, - "###code_area_%p", view); - } - - ////////////////////////////// - //- rjf: cancelled search query -> center cursor - // - if(!search_query_is_active && tv->drifted_for_search) - { - tv->drifted_for_search = 0; - tv->center_cursor = 1; - } - - ////////////////////////////// - //- rjf: do searching operations - // - if(txti_buffer_is_ready) - { - //- rjf: find text (forward) - if(tv->find_text_fwd.size != 0) - { - Temp scratch = scratch_begin(0, 0); - B32 found = 0; - B32 first = 1; - S64 line_num_start = tv->cursor.line; - S64 line_num_last = (S64)txti_buffer_info.total_line_count; - for(S64 line_num = line_num_start;; first = 0) - { - // rjf: pop scratch - temp_end(scratch); - - // rjf: gather line info - String8 line_string = txti_string_from_handle_line_num(scratch.arena, txti_handle, line_num); - U64 search_start = 0; - if(tv->cursor.line == line_num && first) - { - search_start = tv->cursor.column; - } - - // rjf: search string - U64 needle_pos = str8_find_needle(line_string, search_start, tv->find_text_fwd, StringMatchFlag_CaseInsensitive); - if(needle_pos < line_string.size) - { - tv->cursor.line = line_num; - tv->cursor.column = needle_pos+1; - tv->mark = tv->cursor; - found = 1; - break; - } - - // rjf: break if circled back around to cursor - else if(line_num == line_num_start && !first) - { - break; - } - - // rjf: increment - line_num += 1; - if(line_num > line_num_last) - { - line_num = 1; - } - } - tv->center_cursor = found; - if(found == 0) - { - DF_CmdParams params = df_cmd_params_from_view(ws, panel, view); - params.string = push_str8f(scratch.arena, "Could not find \"%S\"", tv->find_text_fwd); - df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_String); - df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_Error)); - } - scratch_end(scratch); - } - - //- rjf: find text (backward) - if(tv->find_text_bwd.size != 0) - { - Temp scratch = scratch_begin(0, 0); - B32 found = 0; - B32 first = 1; - S64 line_num_start = tv->cursor.line; - S64 line_num_last = (S64)txti_buffer_info.total_line_count; - for(S64 line_num = line_num_start;; first = 0) - { - // rjf: pop scratch - temp_end(scratch); - - // rjf: gather line info - String8 line_string = txti_string_from_handle_line_num(scratch.arena, txti_handle, line_num); - if(tv->cursor.line == line_num && first) - { - line_string = str8_prefix(line_string, tv->cursor.column-1); - } - - // rjf: search string - U64 next_needle_pos = line_string.size; - for(U64 needle_pos = 0; needle_pos < line_string.size;) - { - needle_pos = str8_find_needle(line_string, needle_pos, tv->find_text_bwd, StringMatchFlag_CaseInsensitive); - if(needle_pos < line_string.size) - { - next_needle_pos = needle_pos; - needle_pos += 1; - } - } - if(next_needle_pos < line_string.size) - { - tv->cursor.line = line_num; - tv->cursor.column = next_needle_pos+1; - tv->mark = tv->cursor; - found = 1; - break; - } - - // rjf: break if circled back around to cursor line - else if(line_num == line_num_start && !first) - { - break; - } - - // rjf: increment - line_num -= 1; - if(line_num == 0) - { - line_num = line_num_last; - } - } - tv->center_cursor = found; - if(found == 0) - { - DF_CmdParams params = df_cmd_params_from_view(ws, panel, view); - params.string = push_str8f(scratch.arena, "Could not find \"%S\"", tv->find_text_bwd); - df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_String); - df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_Error)); - } - scratch_end(scratch); - } - - MemoryZeroStruct(&tv->find_text_fwd); - MemoryZeroStruct(&tv->find_text_bwd); - arena_clear(tv->find_text_arena); - } - - ////////////////////////////// - //- rjf: do goto line - // - if(txti_buffer_is_ready) if(tv->goto_line_num != 0) - { - S64 line_num = tv->goto_line_num; - tv->goto_line_num = 0; - line_num = Clamp(1, line_num, txti_buffer_info.total_line_count); - tv->cursor = tv->mark = txt_pt(line_num, 1); - tv->center_cursor = !tv->contain_cursor || (line_num < target_visible_line_num_range.min+4 || target_visible_line_num_range.max-4 < line_num); - } - - ////////////////////////////// - //- rjf: do keyboard interaction - // - B32 snap[Axis2_COUNT] = {0}; - UI_Focus(UI_FocusKind_On) - { - if(txti_buffer_is_ready && visible_line_num_range.max >= visible_line_num_range.min && ui_is_focus_active()) - { - snap[Axis2_X] = snap[Axis2_Y] = df_do_txti_controls(txti_handle, ClampBot(num_possible_visible_lines, 10) - 10, &tv->cursor, &tv->mark, &tv->preferred_column); - } - } - - ////////////////////////////// - //- rjf: build container contents - // - if(txti_buffer_is_ready) UI_Parent(container_box) - { - //- rjf: build fractional space - container_box->view_off.x = container_box->view_off_target.x = view->scroll_pos.x.idx + view->scroll_pos.x.off; - container_box->view_off.y = container_box->view_off_target.y = code_line_height*mod_f32(view->scroll_pos.y.off, 1.f) + code_line_height*(view->scroll_pos.y.off < 0) - code_line_height*(view->scroll_pos.y.off == -1.f && view->scroll_pos.y.idx == 1); - - //- rjf: build code slice - DF_CodeSliceSignal sig = {0}; - UI_Focus(UI_FocusKind_On) - { - sig = df_code_slicef(ws, &ctrl_ctx, &parse_ctx, &code_slice_params, &tv->cursor, &tv->mark, &tv->preferred_column, "txt_view_%p", view); - } - - //- rjf: hover eval - if(!ui_dragging(sig.base) && sig.mouse_expr_rng.min.line != 0) - { - TxtRng expr_rng = sig.mouse_expr_rng; - String8 expr = txti_string_from_handle_txt_rng(scratch.arena, txti_handle, expr_rng); - if(expr.size != 0) - { - DF_Eval eval = df_eval_from_string(scratch.arena, scope, &ctrl_ctx, &parse_ctx, &eval_string2expr_map_nil, expr); - if(eval.mode != EVAL_EvalMode_NULL) - { - df_set_hover_eval(ws, sig.mouse_expr_baseline_pos, ctrl_ctx, entity, sig.mouse_pt, 0, expr); - } - } - } - - //- rjf: press code slice? -> focus panel - if(ui_pressed(sig.base)) - { - DF_CmdParams p = df_cmd_params_from_panel(ws, panel); - df_push_cmd__root(&p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_FocusPanel)); - } - - //- rjf: dragging & outside region? -> contain cursor - if(ui_dragging(sig.base) && !contains_2f32(sig.base.box->rect, ui_mouse()) && sig.base.event_flags == 0) - { - tv->contain_cursor = 1; - } - - //- rjf: copy text - if(!txt_pt_match(sig.copy_range.min, sig.copy_range.max)) - { - Temp temp = temp_begin(scratch.arena); - String8 text = txti_string_from_handle_txt_rng(temp.arena, txti_handle, sig.copy_range); - os_set_clipboard_text(text); - temp_end(temp); - } - } - - ////////////////////////////// - //- rjf: apply post-build view snapping rules - // - if(txti_buffer_is_ready) - { - // rjf: contain => snap - if(tv->contain_cursor) - { - tv->contain_cursor = 0; - snap[Axis2_X] = 1; - snap[Axis2_Y] = 1; - } - - // rjf: center cursor - if(tv->center_cursor) - { - tv->center_cursor = 0; - String8 cursor_line = txti_string_from_handle_line_num(scratch.arena, txti_handle, tv->cursor.line); - F32 cursor_advance = f_dim_from_tag_size_string(code_font, code_font_size, 0, code_tab_size, str8_prefix(cursor_line, tv->cursor.column-1)).x; - - // rjf: scroll x - { - S64 new_idx = (S64)(cursor_advance - code_area_dim.x/2); - new_idx = Clamp(scroll_idx_rng[Axis2_X].min, new_idx, scroll_idx_rng[Axis2_X].max); - ui_scroll_pt_target_idx(&view->scroll_pos.x, new_idx); - snap[Axis2_X] = 0; - } - - // rjf: scroll y - { - S64 new_idx = (tv->cursor.line-1) - num_possible_visible_lines/2 + 2; - new_idx = Clamp(scroll_idx_rng[Axis2_Y].min, new_idx, scroll_idx_rng[Axis2_Y].max); - ui_scroll_pt_target_idx(&view->scroll_pos.y, new_idx); - snap[Axis2_Y] = 0; - } - } - - // rjf: snap in X - if(snap[Axis2_X]) - { - String8 cursor_line = txti_string_from_handle_line_num(scratch.arena, txti_handle, tv->cursor.line); - S64 cursor_off = (S64)(f_dim_from_tag_size_string(code_font, code_font_size, 0, code_tab_size, str8_prefix(cursor_line, tv->cursor.column-1)).x + priority_margin_width_px + catchall_margin_width_px + line_num_width_px); - Rng1S64 visible_pixel_range = - { - view->scroll_pos.x.idx, - view->scroll_pos.x.idx + (S64)code_area_dim.x, - }; - Rng1S64 cursor_pixel_range = - { - cursor_off - (S64)(big_glyph_advance*4) - (S64)(priority_margin_width_px + catchall_margin_width_px + line_num_width_px), - cursor_off + (S64)(big_glyph_advance*4), - }; - S64 min_delta = Min(0, cursor_pixel_range.min - visible_pixel_range.min); - S64 max_delta = Max(0, cursor_pixel_range.max - visible_pixel_range.max); - S64 new_idx = view->scroll_pos.x.idx+min_delta+max_delta; - new_idx = Clamp(scroll_idx_rng[Axis2_X].min, new_idx, scroll_idx_rng[Axis2_X].max); - ui_scroll_pt_target_idx(&view->scroll_pos.x, new_idx); - } - - // rjf: snap in Y - if(snap[Axis2_Y]) - { - Rng1S64 cursor_visibility_range = r1s64(tv->cursor.line-4, tv->cursor.line+4); - cursor_visibility_range.min = ClampBot(0, cursor_visibility_range.min); - cursor_visibility_range.max = ClampBot(0, cursor_visibility_range.max); - S64 min_delta = Min(0, cursor_visibility_range.min-(target_visible_line_num_range.min)); - S64 max_delta = Max(0, cursor_visibility_range.max-(target_visible_line_num_range.min+num_possible_visible_lines)); - S64 new_idx = view->scroll_pos.y.idx+min_delta+max_delta; - new_idx = Clamp(0, new_idx, (S64)txti_buffer_info.total_line_count-1); - ui_scroll_pt_target_idx(&view->scroll_pos.y, new_idx); - } - } - - ////////////////////////////// - //- rjf: build horizontal scroll bar - // - if(txti_buffer_is_ready) - { - ui_set_next_fixed_x(0); - ui_set_next_fixed_y(code_area_dim.y); - ui_set_next_fixed_width(panel_box_dim.x - scroll_bar_dim); - ui_set_next_fixed_height(scroll_bar_dim); - { - view->scroll_pos.x = ui_scroll_bar(Axis2_X, - ui_px(scroll_bar_dim, 1.f), - view->scroll_pos.x, - scroll_idx_rng[Axis2_X], - (S64)code_area_dim.x); - } - } - - ////////////////////////////// - //- rjf: build vertical scroll bar - // - if(txti_buffer_is_ready) - { - ui_set_next_fixed_x(code_area_dim.x); - ui_set_next_fixed_y(0); - ui_set_next_fixed_width(scroll_bar_dim); - ui_set_next_fixed_height(panel_box_dim.y - bottom_bar_dim.y - scroll_bar_dim); - { - view->scroll_pos.y = ui_scroll_bar(Axis2_Y, - ui_px(scroll_bar_dim, 1.f), - view->scroll_pos.y, - scroll_idx_rng[Axis2_Y], - num_possible_visible_lines); - } - } - - ////////////////////////////// - //- rjf: top-level container interaction (scrolling) - // - if(txti_buffer_is_ready) - { - UI_Signal sig = ui_signal_from_box(container_box); - if(sig.scroll.x != 0) - { - S64 new_idx = view->scroll_pos.x.idx+sig.scroll.x*big_glyph_advance; - new_idx = clamp_1s64(scroll_idx_rng[Axis2_X], new_idx); - ui_scroll_pt_target_idx(&view->scroll_pos.x, new_idx); - } - if(sig.scroll.y != 0) - { - S64 new_idx = view->scroll_pos.y.idx + sig.scroll.y; - new_idx = clamp_1s64(scroll_idx_rng[Axis2_Y], new_idx); - ui_scroll_pt_target_idx(&view->scroll_pos.y, new_idx); - } - ui_scroll_pt_clamp_idx(&view->scroll_pos.x, scroll_idx_rng[Axis2_X]); - ui_scroll_pt_clamp_idx(&view->scroll_pos.y, scroll_idx_rng[Axis2_Y]); - } - - ////////////////////////////// - //- rjf: build bottom info bar - // - if(txti_buffer_is_ready) - { - ui_set_next_fixed_x(0); - ui_set_next_fixed_y(code_area_dim.y + scroll_bar_dim); - ui_set_next_pref_width(ui_px(bottom_bar_dim.x, 1)); - ui_set_next_pref_height(ui_px(bottom_bar_dim.y, 1)); - ui_set_next_flags(UI_BoxFlag_DrawBackground); - UI_Row - UI_TextAlignment(UI_TextAlign_Center) - UI_PrefWidth(ui_text_dim(10, 1)) - UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) - UI_Font(code_font) - { - ui_labelf("Line: %I64d, Column: %I64d", tv->cursor.line, tv->cursor.column); - ui_spacer(ui_pct(1, 0)); - ui_labelf("(read only)"); - } - } - - di_scope_close(scope); - scratch_end(scratch); - ProfEnd(); -} -#endif //////////////////////////////// //~ rjf: Memory @view_hook_impl From dbdf6e7c02b4d1f3c0ea62a9327c2ab4a45357a9 Mon Sep 17 00:00:00 2001 From: Ryan Fleury Date: Wed, 26 Jun 2024 10:44:24 -0700 Subject: [PATCH 36/47] eliminate old duplicative disasm path; use same code view path --- src/df/gfx/df_views.c | 876 ++++++++---------------------------------- src/df/gfx/df_views.h | 18 +- 2 files changed, 168 insertions(+), 726 deletions(-) diff --git a/src/df/gfx/df_views.c b/src/df/gfx/df_views.c index dd8107e0..a2ffd060 100644 --- a/src/df/gfx/df_views.c +++ b/src/df/gfx/df_views.c @@ -387,7 +387,7 @@ 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 data, TXT_TextInfo *info) +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) { for(DF_CmdNode *n = cmds->first; n != 0; n = n->next) { @@ -432,7 +432,7 @@ df_code_view_cmds(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewStat } internal void -df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewState *cv, Rng2F32 rect, String8 data, TXT_TextInfo *info) +df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewState *cv, Rng2F32 rect, String8 text_data, TXT_TextInfo *text_info, DASM_InstArray *dasm_insts, Rng1U64 dasm_vaddr_range) { ProfBeginFunction(); Temp scratch = scratch_begin(0, 0); @@ -473,12 +473,12 @@ df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewSta view->scroll_pos.y.idx + 1 + num_possible_visible_lines); U64 visible_line_count = 0; { - visible_line_num_range.min = Clamp(1, visible_line_num_range.min, (S64)info->lines_count); - visible_line_num_range.max = Clamp(1, visible_line_num_range.max, (S64)info->lines_count); + visible_line_num_range.min = Clamp(1, visible_line_num_range.min, (S64)text_info->lines_count); + visible_line_num_range.max = Clamp(1, visible_line_num_range.max, (S64)text_info->lines_count); visible_line_num_range.min = Max(1, visible_line_num_range.min); visible_line_num_range.max = Max(1, visible_line_num_range.max); - target_visible_line_num_range.min = Clamp(1, target_visible_line_num_range.min, (S64)info->lines_count); - target_visible_line_num_range.max = Clamp(1, target_visible_line_num_range.max, (S64)info->lines_count); + target_visible_line_num_range.min = Clamp(1, target_visible_line_num_range.min, (S64)text_info->lines_count); + target_visible_line_num_range.max = Clamp(1, target_visible_line_num_range.max, (S64)text_info->lines_count); target_visible_line_num_range.min = Max(1, target_visible_line_num_range.min); target_visible_line_num_range.max = Max(1, target_visible_line_num_range.max); visible_line_count = (U64)dim_1s64(visible_line_num_range)+1; @@ -490,11 +490,11 @@ df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewSta S64 line_size_x = 0; Rng1S64 scroll_idx_rng[Axis2_COUNT] = {0}; { - line_size_x = (info->lines_max_size*big_glyph_advance*3)/2; + line_size_x = (text_info->lines_max_size*big_glyph_advance*3)/2; line_size_x = ClampBot(line_size_x, (S64)big_glyph_advance*120); line_size_x = ClampBot(line_size_x, (S64)code_area_dim.x); scroll_idx_rng[Axis2_X] = r1s64(0, line_size_x-(S64)code_area_dim.x); - scroll_idx_rng[Axis2_Y] = r1s64(0, (S64)info->lines_count-1); + scroll_idx_rng[Axis2_Y] = r1s64(0, (S64)text_info->lines_count-1); } ////////////////////////////// @@ -503,7 +503,7 @@ df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewSta F32 priority_margin_width_px = big_glyph_advance*3.5f; F32 catchall_margin_width_px = big_glyph_advance*3.5f; F32 line_num_width_px = big_glyph_advance * (log10(visible_line_num_range.max) + 3); - TXT_LineTokensSlice slice = txt_line_tokens_slice_from_info_data_line_range(scratch.arena, info, data, visible_line_num_range); + TXT_LineTokensSlice slice = txt_line_tokens_slice_from_info_data_line_range(scratch.arena, text_info, text_data, visible_line_num_range); ////////////////////////////// //- rjf: get active search query @@ -555,13 +555,13 @@ df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewSta U64 line_idx = visible_line_num_range.min-1; for(U64 visible_line_idx = 0; visible_line_idx < visible_line_count; visible_line_idx += 1, line_idx += 1, line_num += 1) { - code_slice_params.line_text[visible_line_idx] = str8_substr(data, info->lines_ranges[line_idx]); - code_slice_params.line_ranges[visible_line_idx] = info->lines_ranges[line_idx]; + code_slice_params.line_text[visible_line_idx] = str8_substr(text_data, text_info->lines_ranges[line_idx]); + code_slice_params.line_ranges[visible_line_idx] = text_info->lines_ranges[line_idx]; code_slice_params.line_tokens[visible_line_idx] = slice.line_tokens[visible_line_idx]; } } - // rjf: find visible breakpoints + // rjf: find visible breakpoints for source code ProfScope("find visible breakpoints") { DF_Entity *file = df_entity_from_handle(df_interact_regs()->file); @@ -576,7 +576,7 @@ df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewSta } } - // rjf: find live threads mapping to this file + // rjf: find live threads mapping to source code ProfScope("find live threads mapping to this file") { DF_Entity *file = df_entity_from_handle(df_interact_regs()->file); @@ -605,7 +605,7 @@ df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewSta } } - // rjf: find visible watch pins + // rjf: find visible watch pins for source code ProfScope("find visible watch pins") { DF_Entity *file = df_entity_from_handle(df_interact_regs()->file); @@ -631,6 +631,86 @@ df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewSta } code_slice_params.relevant_dbgi_keys = lines_array.dbgi_keys; } + + // rjf: find live threads mapping to disasm + if(dasm_insts) ProfScope("find live threads mapping to this disassembly") + { + DF_Entity *selected_thread = df_entity_from_handle(ctrl_ctx.thread); + DF_EntityList threads = df_query_cached_entity_list_with_kind(DF_EntityKind_Thread); + for(DF_EntityNode *thread_n = threads.first; thread_n != 0; thread_n = thread_n->next) + { + DF_Entity *thread = thread_n->entity; + U64 unwind_count = (thread == selected_thread) ? ctrl_ctx.unwind_count : 0; + U64 rip_vaddr = df_query_cached_rip_from_thread_unwind(thread, unwind_count); + if(df_entity_ancestor_from_kind(thread, DF_EntityKind_Process) == process && contains_1u64(dasm_vaddr_range, rip_vaddr)) + { + U64 rip_off = rip_vaddr - dasm_vaddr_range.min; + S64 line_num = dasm_inst_array_idx_from_code_off__linear_scan(dasm_insts, rip_off)+1; + if(contains_1s64(visible_line_num_range, line_num)) + { + U64 slice_line_idx = (line_num-visible_line_num_range.min); + df_entity_list_push(scratch.arena, &code_slice_params.line_ips[slice_line_idx], thread); + } + } + } + } + + // rjf: find breakpoints mapping to this disasm + if(dasm_insts) ProfScope("find breakpoints mapping to this disassembly") + { + DF_EntityList bps = df_query_cached_entity_list_with_kind(DF_EntityKind_Breakpoint); + for(DF_EntityNode *n = bps.first; n != 0; n = n->next) + { + DF_Entity *bp = n->entity; + if(bp->flags & DF_EntityFlag_HasVAddr && contains_1u64(dasm_vaddr_range, bp->vaddr)) + { + U64 off = bp->vaddr-dasm_vaddr_range.min; + U64 idx = dasm_inst_array_idx_from_code_off__linear_scan(dasm_insts, off); + S64 line_num = (S64)(idx+1); + if(contains_1s64(visible_line_num_range, line_num)) + { + U64 slice_line_idx = (line_num-visible_line_num_range.min); + df_entity_list_push(scratch.arena, &code_slice_params.line_bps[slice_line_idx], bp); + } + } + } + } + + // rjf: find watch pins mapping to this disasm + if(dasm_insts) ProfScope("find watch pins mapping to this disassembly") + { + DF_EntityList pins = df_query_cached_entity_list_with_kind(DF_EntityKind_WatchPin); + for(DF_EntityNode *n = pins.first; n != 0; n = n->next) + { + DF_Entity *pin = n->entity; + if(pin->flags & DF_EntityFlag_HasVAddr && contains_1u64(dasm_vaddr_range, pin->vaddr)) + { + U64 off = pin->vaddr-dasm_vaddr_range.min; + U64 idx = dasm_inst_array_idx_from_code_off__linear_scan(dasm_insts, off); + S64 line_num = (S64)(idx+1); + if(contains_1s64(visible_line_num_range, line_num)) + { + U64 slice_line_idx = (line_num-visible_line_num_range.min); + df_entity_list_push(scratch.arena, &code_slice_params.line_pins[slice_line_idx], pin); + } + } + } + } + + // rjf: fill dasm -> src info + if(dasm_insts) + { + DF_Entity *module = df_module_from_process_vaddr(process, dasm_vaddr_range.min); + DI_Key dbgi_key = df_dbgi_key_from_module(module); + for(S64 line_num = visible_line_num_range.min; line_num < visible_line_num_range.max; line_num += 1) + { + U64 vaddr = dasm_vaddr_range.min + dasm_inst_array_code_off_from_idx(dasm_insts, line_num-1); + U64 voff = df_voff_from_vaddr(module, vaddr); + U64 slice_idx = line_num-visible_line_num_range.min; + code_slice_params.line_vaddrs[slice_idx] = vaddr; + code_slice_params.line_infos[slice_idx] = df_lines_from_dbgi_key_voff(scratch.arena, &dbgi_key, voff); + } + } } ////////////////////////////// @@ -668,14 +748,14 @@ df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewSta B32 found = 0; B32 first = 1; S64 line_num_start = view->cursor.line; - S64 line_num_last = (S64)info->lines_count; + S64 line_num_last = (S64)text_info->lines_count; for(S64 line_num = line_num_start;; first = 0) { // rjf: pop scratch temp_end(scratch); // rjf: gather line info - String8 line_string = str8_substr(data, info->lines_ranges[line_num-1]); + String8 line_string = str8_substr(text_data, text_info->lines_ranges[line_num-1]); U64 search_start = 0; if(view->cursor.line == line_num && first) { @@ -724,14 +804,14 @@ df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewSta B32 found = 0; B32 first = 1; S64 line_num_start = view->cursor.line; - S64 line_num_last = (S64)info->lines_count; + S64 line_num_last = (S64)text_info->lines_count; for(S64 line_num = line_num_start;; first = 0) { // rjf: pop scratch temp_end(scratch); // rjf: gather line info - String8 line_string = str8_substr(data, info->lines_ranges[line_num-1]); + String8 line_string = str8_substr(text_data, text_info->lines_ranges[line_num-1]); if(view->cursor.line == line_num && first) { line_string = str8_prefix(line_string, view->cursor.column-1); @@ -793,7 +873,7 @@ df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewSta { S64 line_num = cv->goto_line_num; cv->goto_line_num = 0; - line_num = Clamp(1, line_num, info->lines_count); + line_num = Clamp(1, line_num, text_info->lines_count); view->cursor = view->mark = txt_pt(line_num, 1); cv->center_cursor = !cv->contain_cursor || (line_num < target_visible_line_num_range.min+4 || target_visible_line_num_range.max-4 < line_num); } @@ -806,7 +886,7 @@ df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewSta { if(ui_is_focus_active() && visible_line_num_range.max >= visible_line_num_range.min) { - snap[Axis2_X] = snap[Axis2_Y] = df_do_txt_controls(info, data, ClampBot(num_possible_visible_lines, 10) - 10, &view->cursor, &view->mark, &cv->preferred_column); + snap[Axis2_X] = snap[Axis2_Y] = df_do_txt_controls(text_info, text_data, ClampBot(num_possible_visible_lines, 10) - 10, &view->cursor, &view->mark, &cv->preferred_column); } } @@ -851,7 +931,7 @@ df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewSta { ui_kill_action(); DF_CmdParams params = df_cmd_params_from_view(ws, panel, view); - params.string = txt_string_from_info_data_txt_rng(info, data, sig.mouse_expr_rng); + params.string = txt_string_from_info_data_txt_rng(text_info, text_data, sig.mouse_expr_rng); df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_String); df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_GoToName)); } @@ -859,7 +939,7 @@ df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewSta //- rjf: selected text on single line, no query? -> set search text if(!txt_pt_match(view->cursor, view->mark) && view->cursor.line == view->mark.line && search_query.size == 0) { - String8 text = txt_string_from_info_data_txt_rng(info, data, txt_rng(view->cursor, view->mark)); + String8 text = txt_string_from_info_data_txt_rng(text_info, text_data, txt_rng(view->cursor, view->mark)); df_set_search_string(text); } } @@ -880,7 +960,7 @@ df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewSta if(cv->center_cursor) { cv->center_cursor = 0; - String8 cursor_line = str8_substr(data, info->lines_ranges[view->cursor.line-1]); + String8 cursor_line = str8_substr(text_data, text_info->lines_ranges[view->cursor.line-1]); F32 cursor_advance = f_dim_from_tag_size_string(code_font, code_font_size, 0, code_tab_size, str8_prefix(cursor_line, view->cursor.column-1)).x; // rjf: scroll x @@ -903,7 +983,7 @@ df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewSta // rjf: snap in X if(snap[Axis2_X]) { - String8 cursor_line = str8_substr(data, info->lines_ranges[view->cursor.line-1]); + String8 cursor_line = str8_substr(text_data, text_info->lines_ranges[view->cursor.line-1]); S64 cursor_off = (S64)(f_dim_from_tag_size_string(code_font, code_font_size, 0, code_tab_size, str8_prefix(cursor_line, view->cursor.column-1)).x + priority_margin_width_px + catchall_margin_width_px + line_num_width_px); Rng1S64 visible_pixel_range = { @@ -931,7 +1011,7 @@ df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewSta S64 min_delta = Min(0, cursor_visibility_range.min-(target_visible_line_num_range.min)); S64 max_delta = Max(0, cursor_visibility_range.max-(target_visible_line_num_range.min+num_possible_visible_lines)); S64 new_idx = view->scroll_pos.y.idx+min_delta+max_delta; - new_idx = Clamp(0, new_idx, (S64)info->lines_count-1); + new_idx = Clamp(0, new_idx, (S64)text_info->lines_count-1); ui_scroll_pt_target_idx(&view->scroll_pos.y, new_idx); } } @@ -6214,7 +6294,7 @@ DF_VIEW_CMD_FUNCTION_DEF(Code) String8 data = hs_data_from_hash(hs_scope, hash); //- rjf: process general code-view commands - df_code_view_cmds(ws, panel, view, cv, cmds, data, &info); + df_code_view_cmds(ws, panel, view, cv, cmds, data, &info, 0, r1u64(0, 0)); //- rjf: process code-file commands for(DF_CmdNode *n = cmds->first; n != 0; n = n->next) @@ -6337,7 +6417,7 @@ DF_VIEW_UI_FUNCTION_DEF(Code) // if(!entity_is_missing && key_has_data) { - df_code_view_build(ws, panel, view, cv, code_area_rect, data, &info); + df_code_view_build(ws, panel, view, cv, code_area_rect, data, &info, 0, r1u64(0, 0)); } ////////////////////////////// @@ -6408,34 +6488,29 @@ DF_VIEW_SETUP_FUNCTION_DEF(Disassembly) if(dv->initialized == 0) { dv->initialized = 1; - dv->cursor = txt_pt(1, 1); - dv->mark = txt_pt(1, 1); - dv->preferred_column = 1; - dv->find_text_arena = df_view_push_arena_ext(view); dv->style_flags = DASM_StyleFlag_Addresses|DASM_StyleFlag_SourceFilesNames|DASM_StyleFlag_SourceLines|DASM_StyleFlag_SymbolNames; + df_code_view_init(&dv->cv, view); } } DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(Disassembly) { - return str8_lit(""); + return str8_zero(); } DF_VIEW_CMD_FUNCTION_DEF(Disassembly) { - Temp scratch = scratch_begin(0, 0); - HS_Scope *hs_scope = hs_scope_open(); - DASM_Scope *dasm_scope = dasm_scope_open(); - TXT_Scope *txt_scope = txt_scope_open(); DF_DisasmViewState *dv = df_view_user_state(view, DF_DisasmViewState); + Temp scratch = scratch_begin(0, 0); + DASM_Scope *dasm_scope = dasm_scope_open(); + HS_Scope *hs_scope = hs_scope_open(); + TXT_Scope *txt_scope = txt_scope_open(); - ////////////////////////////// - //- rjf: unpack disassembly info - // + //- rjf: unpack disasm info DF_Entity *process = df_entity_from_handle(dv->process); Architecture arch = df_architecture_from_entity(process); U64 dasm_base_vaddr = AlignDownPow2(dv->base_vaddr, KB(16)); - DF_Entity *dasm_module = df_module_from_process_vaddr(process, dasm_base_vaddr); + DF_Entity *dasm_module = df_module_from_process_vaddr(process, dasm_base_vaddr); DI_Key dasm_dbgi_key = df_dbgi_key_from_module(dasm_module); Rng1U64 dasm_vaddr_range = r1u64(dasm_base_vaddr, dasm_base_vaddr+KB(16)); U128 dasm_key = ctrl_hash_store_key_from_process_vaddr_range(process->ctrl_machine_id, process->ctrl_handle, dasm_vaddr_range, 0); @@ -6450,13 +6525,15 @@ DF_VIEW_CMD_FUNCTION_DEF(Disassembly) dasm_params.dbgi_key = dasm_dbgi_key; } DASM_Info dasm_info = dasm_info_from_key_params(dasm_scope, dasm_key, &dasm_params, &dasm_data_hash); + TXT_LangKind lang_kind = txt_lang_kind_from_architecture(arch); U128 dasm_text_hash = {0}; - TXT_TextInfo dasm_text_info = txt_text_info_from_key_lang(txt_scope, dasm_info.text_key, txt_lang_kind_from_architecture(arch), &dasm_text_hash); + TXT_TextInfo dasm_text_info = txt_text_info_from_key_lang(txt_scope, dasm_info.text_key, lang_kind, &dasm_text_hash); String8 dasm_text_data = hs_data_from_hash(hs_scope, dasm_text_hash); - ////////////////////////////// - //- rjf: process commands - // + //- rjf: process general code-view commands + df_code_view_cmds(ws, panel, view, &dv->cv, cmds, dasm_text_data, &dasm_text_info, &dasm_info.insts, dasm_vaddr_range); + + //- rjf: process disassembly-specific commands for(DF_CmdNode *n = cmds->first; n != 0; n = n->next) { DF_Cmd *cmd = &n->cmd; @@ -6476,210 +6553,61 @@ DF_VIEW_CMD_FUNCTION_DEF(Disassembly) default: break; case DF_CoreCmdKind_GoToAddress: { - DF_Entity *entity = df_entity_from_handle(params.entity); - if(!df_entity_is_nil(entity) && - (entity->kind == DF_EntityKind_Process || - entity->kind == DF_EntityKind_Thread || - entity->kind == DF_EntityKind_Module)) + DF_Entity *process = &df_g_nil_entity; { - DF_Entity *process = entity; - if(entity->kind == DF_EntityKind_Thread || - entity->kind == DF_EntityKind_Module) + DF_Entity *entity = df_entity_from_handle(params.entity); + if(!df_entity_is_nil(entity) && + (entity->kind == DF_EntityKind_Process || + entity->kind == DF_EntityKind_Thread || + entity->kind == DF_EntityKind_Module)) { - process = df_entity_ancestor_from_kind(process, DF_EntityKind_Process); + process = entity; + if(entity->kind == DF_EntityKind_Thread || + entity->kind == DF_EntityKind_Module) + { + process = df_entity_ancestor_from_kind(process, DF_EntityKind_Process); + } } - dv->process = df_handle_from_entity(process); } + dv->process = df_handle_from_entity(process); dv->base_vaddr = params.vaddr; dv->goto_vaddr = params.vaddr; - dv->cursor = dv->mark = txt_pt(1, 1); - }break; - case DF_CoreCmdKind_GoToLine: - { - dv->goto_line_num = cmd->params.text_point.line; - }break; - case DF_CoreCmdKind_CenterCursor: - { - dv->center_cursor = 1; - }break; - case DF_CoreCmdKind_ContainCursor: - { - dv->contain_cursor = 1; - }break; - case DF_CoreCmdKind_FindTextForward: - { - arena_clear(dv->find_text_arena); - dv->find_text_fwd = push_str8_copy(dv->find_text_arena, cmd->params.string); - }break; - case DF_CoreCmdKind_FindTextBackward: - { - arena_clear(dv->find_text_arena); - dv->find_text_bwd = push_str8_copy(dv->find_text_arena, cmd->params.string); - }break; - case DF_CoreCmdKind_ToggleBreakpointAtCursor: - { - if(1 <= dv->cursor.line && dv->cursor.line <= dasm_info.insts.count) - { - U64 off = dasm_inst_array_code_off_from_idx(&dasm_info.insts, dv->cursor.line-1); - U64 vaddr = dasm_vaddr_range.min+off; - DF_CmdParams params = df_cmd_params_from_view(ws, panel, view); - params.vaddr = vaddr; - df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_VirtualAddr); - df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_AddressBreakpoint)); - dv->contain_cursor = 1; - } - }break; - case DF_CoreCmdKind_ToggleWatchPinAtCursor: - { - if(1 <= dv->cursor.line && dv->cursor.line <= dasm_info.insts.count) - { - U64 off = dasm_inst_array_code_off_from_idx(&dasm_info.insts, dv->cursor.line-1); - U64 vaddr = dasm_vaddr_range.min+off; - DF_CmdParams p = df_cmd_params_from_view(ws, panel, view); - p.vaddr = vaddr; - p.string = params.string; - df_cmd_params_mark_slot(&p, DF_CmdParamSlot_VirtualAddr); - df_cmd_params_mark_slot(&p, DF_CmdParamSlot_String); - df_push_cmd__root(&p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_ToggleWatchPin)); - dv->contain_cursor = 1; - } - }break; - case DF_CoreCmdKind_RunToCursor: - { - if(1 <= dv->cursor.line && dv->cursor.line <= dasm_info.insts.count) - { - U64 off = dasm_inst_array_code_off_from_idx(&dasm_info.insts, dv->cursor.line-1); - U64 vaddr = dasm_vaddr_range.min+off; - DF_CmdParams params = df_cmd_params_from_view(ws, panel, view); - params.vaddr = vaddr; - df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_VirtualAddr); - df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_RunToAddress)); - } - }break; - case DF_CoreCmdKind_SetNextStatement: - { - S64 line_num = (cmd->params.text_point.line == 0 ? dv->cursor.line : cmd->params.text_point.line); - DF_Entity *thread = df_entity_from_handle(params.entity); - if(1 <= line_num && line_num <= dasm_info.insts.count) - { - U64 off = dasm_inst_array_code_off_from_idx(&dasm_info.insts, line_num-1); - U64 vaddr = dasm_vaddr_range.min+off; - DF_CmdParams params = df_cmd_params_from_view(ws, panel, view); - params.vaddr = vaddr; - params.entity = df_handle_from_entity(thread); - df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_VirtualAddr); - df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_Entity); - df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_SetThreadIP)); - } - }break; - case DF_CoreCmdKind_ToggleCodeBytesVisibility: - { - dv->style_flags ^= DASM_StyleFlag_CodeBytes; - }break; - case DF_CoreCmdKind_ToggleAddressVisibility: - { - dv->style_flags ^= DASM_StyleFlag_Addresses; - }break; - case DF_CoreCmdKind_GoToNameAtCursor: - { - // rjf: determine expression range - Rng1U64 expr_range = {0}; - { - TxtRng selection_range = txt_rng(dv->cursor, dv->mark); - if(txt_pt_match(selection_range.min, selection_range.max)) - { - expr_range = txt_expr_off_range_from_info_data_pt(&dasm_text_info, dasm_text_data, dv->cursor); - } - else - { - expr_range = r1u64(txt_off_from_info_pt(&dasm_text_info, selection_range.min), txt_off_from_info_pt(&dasm_text_info, selection_range.max)); - } - } - - // rjf: expression range -> text - String8 expr_text = str8_substr(dasm_text_data, expr_range); - - // rjf: go to name - DF_CmdParams params = df_cmd_params_from_view(ws, panel, view); - params.string = expr_text; - df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_String); - df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_GoToName)); - }break; - case DF_CoreCmdKind_ToggleWatchExpressionAtCursor: - { - // rjf: determine expression range - Rng1U64 expr_range = {0}; - { - TxtRng selection_range = txt_rng(dv->cursor, dv->mark); - if(txt_pt_match(selection_range.min, selection_range.max)) - { - expr_range = txt_expr_off_range_from_info_data_pt(&dasm_text_info, dasm_text_data, dv->cursor); - } - else - { - expr_range = r1u64(txt_off_from_info_pt(&dasm_text_info, selection_range.min), txt_off_from_info_pt(&dasm_text_info, selection_range.max)); - } - } - - // rjf: expression range -> text - String8 expr_text = str8_substr(dasm_text_data, expr_range); - - // rjf: toggle watch expr - DF_CmdParams params = df_cmd_params_from_view(ws, panel, view); - params.string = expr_text; - df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_String); - df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_ToggleWatchExpression)); }break; + case DF_CoreCmdKind_ToggleCodeBytesVisibility: {dv->style_flags ^= DASM_StyleFlag_CodeBytes;}break; + case DF_CoreCmdKind_ToggleAddressVisibility: {dv->style_flags ^= DASM_StyleFlag_Addresses;}break; } } + txt_scope_close(txt_scope); hs_scope_close(hs_scope); dasm_scope_close(dasm_scope); - txt_scope_close(txt_scope); scratch_end(scratch); } DF_VIEW_UI_FUNCTION_DEF(Disassembly) { - ProfBeginFunction(); + DF_DisasmViewState *dv = df_view_user_state(view, DF_DisasmViewState); + DF_CodeViewState *cv = &dv->cv; Temp scratch = scratch_begin(0, 0); HS_Scope *hs_scope = hs_scope_open(); DASM_Scope *dasm_scope = dasm_scope_open(); TXT_Scope *txt_scope = txt_scope_open(); - DI_Scope *di_scope = di_scope_open(); - DF_DisasmViewState *dv = df_view_user_state(view, DF_DisasmViewState); ////////////////////////////// - //- rjf: extract invariants + //- rjf: set up invariants // - DF_CtrlCtx ctrl_ctx = df_ctrl_ctx_from_view(ws, view); - F_Tag code_font = df_font_from_slot(DF_FontSlot_Code); - F32 code_font_size = df_font_size_from_slot(ws, DF_FontSlot_Code); - F32 code_tab_size = f_column_size_from_tag_size(code_font, code_font_size)*df_setting_val_from_code(DF_SettingCode_TabWidth).s32; - F_Metrics code_font_metrics = f_metrics_from_tag_size(code_font, code_font_size); - F32 code_line_height = ceil_f32(f_line_height_from_metrics(&code_font_metrics) * 1.5f); - F32 big_glyph_advance = f_dim_from_tag_size_string(code_font, code_font_size, 0, 0, str8_lit("H")).x; - Vec2F32 panel_box_dim = dim_2f32(rect); - Vec2F32 bottom_bar_dim = {panel_box_dim.x, ui_top_font_size()*1.8f}; - F32 scroll_bar_dim = floor_f32(ui_top_font_size()*1.5f); - Vec2F32 code_area_dim = v2f32(panel_box_dim.x - scroll_bar_dim, panel_box_dim.y - scroll_bar_dim - bottom_bar_dim.y); - S64 num_possible_visible_lines = (S64)(code_area_dim.y/code_line_height)+1; - - ////////////////////////////// - //- rjf: unpack ctrl ctx & make parse ctx - // - DF_Entity *selected_thread = df_entity_from_handle(ctrl_ctx.thread); - DF_Entity *selected_process = df_entity_ancestor_from_kind(selected_thread, DF_EntityKind_Process); - U64 unwind_count = ctrl_ctx.unwind_count; - U64 rip_vaddr = df_query_cached_rip_from_thread_unwind(selected_thread, unwind_count); - EVAL_ParseCtx parse_ctx = df_eval_parse_ctx_from_process_vaddr(di_scope, selected_process, rip_vaddr); + F32 bottom_bar_height = ui_top_font_size()*2.f; + Rng2F32 code_area_rect = r2f32p(rect.x0, rect.y0, rect.x1, rect.y1 - bottom_bar_height); + Rng2F32 bottom_bar_rect = r2f32p(rect.x0, rect.y1 - bottom_bar_height, rect.x1, rect.y1); ////////////////////////////// //- rjf: no disasm process open? -> snap to selected thread // if(df_entity_is_nil(df_entity_from_handle(dv->process))) { - dv->process = df_handle_from_entity(selected_process); + DF_Entity *thread = df_entity_from_handle(df_interact_regs()->thread); + U64 rip_vaddr = df_query_cached_rip_from_thread_unwind(thread, df_interact_regs()->unwind_count); + dv->process = df_handle_from_entity(df_entity_ancestor_from_kind(thread, DF_EntityKind_Process)); dv->base_vaddr = rip_vaddr; dv->goto_vaddr = rip_vaddr; } @@ -6712,12 +6640,6 @@ DF_VIEW_UI_FUNCTION_DEF(Disassembly) B32 has_disasm = (dasm_info.insts.count != 0 && dasm_text_info.lines_count != 0); B32 is_loading = (!has_disasm && !df_entity_is_nil(process) && dim_1u64(dasm_vaddr_range) != 0); - ////////////////////////////// - //- rjf: unpack module info for this region - // - DF_Entity *module = df_module_from_process_vaddr(process, dasm_vaddr_range.min); - DI_Key dbgi_key = df_dbgi_key_from_module(module); - ////////////////////////////// //- rjf: is loading -> equip view with loading information // @@ -6726,533 +6648,65 @@ DF_VIEW_UI_FUNCTION_DEF(Disassembly) df_view_equip_loading_info(view, is_loading, 0, 0); } - ////////////////////////////// - //- rjf: determine visible line range / count - // - Rng1S64 visible_line_num_range = r1s64(view->scroll_pos.y.idx + (S64)(view->scroll_pos.y.off) + 1 - !!(view->scroll_pos.y.off < 0), - view->scroll_pos.y.idx + (S64)(view->scroll_pos.y.off) + 1 + num_possible_visible_lines); - U64 visible_line_count = 0; - { - visible_line_num_range.min = Clamp(1, visible_line_num_range.min, (S64)dasm_info.insts.count); - visible_line_num_range.max = Clamp(1, visible_line_num_range.max, (S64)dasm_info.insts.count); - visible_line_count = (U64)dim_1s64(visible_line_num_range)+1; - } - - ////////////////////////////// - //- rjf: calculate line-range-dependent info - // - F32 priority_margin_width_px = big_glyph_advance*3.5f; - F32 catchall_margin_width_px = big_glyph_advance*3.5f; - F32 line_num_width_px = big_glyph_advance * (log10(visible_line_num_range.max) + 3); - TXT_LineTokensSlice slice = txt_line_tokens_slice_from_info_data_line_range(scratch.arena, &dasm_text_info, dasm_text_data, visible_line_num_range); - - ////////////////////////////// - //- rjf: calculate scroll bounds - // - S64 line_size_x = 0; - Rng1S64 scroll_idx_rng[Axis2_COUNT] = {0}; - { - line_size_x = (200*big_glyph_advance); - line_size_x = ClampBot(line_size_x, (S64)big_glyph_advance*120); - line_size_x = ClampBot(line_size_x, (S64)code_area_dim.x); - scroll_idx_rng[Axis2_X] = r1s64(0, line_size_x-(S64)code_area_dim.x); - scroll_idx_rng[Axis2_Y] = r1s64(0, (S64)dasm_info.insts.count-1); - } - - ////////////////////////////// - //- rjf: get active search query - // - String8 search_query = {0}; - Side search_query_side = Side_Invalid; - B32 search_query_is_active = 0; - { - DF_CoreCmdKind query_cmd_kind = df_core_cmd_kind_from_string(ws->query_cmd_spec->info.string); - if(query_cmd_kind == DF_CoreCmdKind_FindTextForward || - query_cmd_kind == DF_CoreCmdKind_FindTextBackward) - { - search_query = str8(ws->query_view_stack_top->query_buffer, ws->query_view_stack_top->query_string_size); - search_query_is_active = 1; - search_query_side = (query_cmd_kind == DF_CoreCmdKind_FindTextForward) ? Side_Max : Side_Min; - } - } - - ////////////////////////////// - //- rjf: prepare code slice info bundle, for the viewable region of text - // - DF_CodeSliceParams code_slice_params = {0}; - if(has_disasm) - { - // rjf: fill basics - code_slice_params.flags = DF_CodeSliceFlag_PriorityMargin|DF_CodeSliceFlag_CatchallMargin|DF_CodeSliceFlag_LineNums|DF_CodeSliceFlag_Clickable; - code_slice_params.line_num_range = visible_line_num_range; - code_slice_params.line_text = push_array(scratch.arena, String8, visible_line_count); - code_slice_params.line_ranges = push_array(scratch.arena, Rng1U64, visible_line_count); - code_slice_params.line_tokens = push_array(scratch.arena, TXT_TokenArray, visible_line_count); - code_slice_params.line_bps = push_array(scratch.arena, DF_EntityList, visible_line_count); - code_slice_params.line_ips = push_array(scratch.arena, DF_EntityList, visible_line_count); - code_slice_params.line_pins = push_array(scratch.arena, DF_EntityList, visible_line_count); - code_slice_params.line_vaddrs = push_array(scratch.arena, U64, visible_line_count); - code_slice_params.line_infos = push_array(scratch.arena, DF_LineList, visible_line_count); - code_slice_params.font = code_font; - code_slice_params.font_size = code_font_size; - code_slice_params.tab_size = code_tab_size; - code_slice_params.line_height_px = code_line_height; - code_slice_params.search_query = search_query; - code_slice_params.priority_margin_width_px = priority_margin_width_px; - code_slice_params.catchall_margin_width_px = catchall_margin_width_px; - code_slice_params.line_num_width_px = line_num_width_px; - code_slice_params.line_text_max_width_px = (F32)line_size_x; - code_slice_params.margin_float_off_px = view->scroll_pos.x.idx + view->scroll_pos.x.off; - di_key_list_push(scratch.arena, &code_slice_params.relevant_dbgi_keys, &dbgi_key); - - // rjf: fill text info - { - S64 line_num = visible_line_num_range.min; - U64 line_idx = visible_line_num_range.min-1; - for(U64 visible_line_idx = 0; visible_line_idx < visible_line_count; visible_line_idx += 1, line_idx += 1, line_num += 1) - { - code_slice_params.line_text[visible_line_idx] = str8_substr(dasm_text_data, dasm_text_info.lines_ranges[line_idx]); - code_slice_params.line_ranges[visible_line_idx] = dasm_text_info.lines_ranges[line_idx]; - code_slice_params.line_tokens[visible_line_idx] = slice.line_tokens[visible_line_idx]; - } - } - - // rjf: find live threads mapping to this disassembly - ProfScope("find live threads mapping to this disassembly") - { - DF_Entity *selected_thread = df_entity_from_handle(ctrl_ctx.thread); - DF_EntityList threads = df_query_cached_entity_list_with_kind(DF_EntityKind_Thread); - for(DF_EntityNode *thread_n = threads.first; thread_n != 0; thread_n = thread_n->next) - { - DF_Entity *thread = thread_n->entity; - U64 unwind_count = (thread == selected_thread) ? ctrl_ctx.unwind_count : 0; - U64 rip_vaddr = df_query_cached_rip_from_thread_unwind(thread, unwind_count); - if(df_entity_ancestor_from_kind(thread, DF_EntityKind_Process) == process && contains_1u64(dasm_vaddr_range, rip_vaddr)) - { - U64 rip_off = rip_vaddr - dasm_vaddr_range.min; - S64 line_num = dasm_inst_array_idx_from_code_off__linear_scan(&dasm_info.insts, rip_off)+1; - if(contains_1s64(visible_line_num_range, line_num)) - { - U64 slice_line_idx = (line_num-visible_line_num_range.min); - df_entity_list_push(scratch.arena, &code_slice_params.line_ips[slice_line_idx], thread); - } - } - } - } - - // rjf: find breakpoints mapping to this disassembly - ProfScope("find breakpoints mapping to this disassembly") - { - DF_EntityList bps = df_query_cached_entity_list_with_kind(DF_EntityKind_Breakpoint); - for(DF_EntityNode *n = bps.first; n != 0; n = n->next) - { - DF_Entity *bp = n->entity; - if(bp->flags & DF_EntityFlag_HasVAddr && contains_1u64(dasm_vaddr_range, bp->vaddr)) - { - U64 off = bp->vaddr-dasm_vaddr_range.min; - U64 idx = dasm_inst_array_idx_from_code_off__linear_scan(&dasm_info.insts, off); - S64 line_num = (S64)(idx+1); - if(contains_1s64(visible_line_num_range, line_num)) - { - U64 slice_line_idx = (line_num-visible_line_num_range.min); - df_entity_list_push(scratch.arena, &code_slice_params.line_bps[slice_line_idx], bp); - } - } - } - } - - // rjf: find watch pins mapping to this disassembly - ProfScope("find watch pins mapping to this disassembly") - { - DF_EntityList pins = df_query_cached_entity_list_with_kind(DF_EntityKind_WatchPin); - for(DF_EntityNode *n = pins.first; n != 0; n = n->next) - { - DF_Entity *pin = n->entity; - if(pin->flags & DF_EntityFlag_HasVAddr && contains_1u64(dasm_vaddr_range, pin->vaddr)) - { - U64 off = pin->vaddr-dasm_vaddr_range.min; - U64 idx = dasm_inst_array_idx_from_code_off__linear_scan(&dasm_info.insts, off); - S64 line_num = (S64)(idx+1); - if(contains_1s64(visible_line_num_range, line_num)) - { - U64 slice_line_idx = (line_num-visible_line_num_range.min); - df_entity_list_push(scratch.arena, &code_slice_params.line_pins[slice_line_idx], pin); - } - } - } - } - - // rjf: fill dasm -> src info - { - DF_Entity *module = df_module_from_process_vaddr(process, dasm_vaddr_range.min); - DI_Key dbgi_key = df_dbgi_key_from_module(module); - for(S64 line_num = visible_line_num_range.min; line_num < visible_line_num_range.max; line_num += 1) - { - U64 vaddr = dasm_vaddr_range.min + dasm_inst_array_code_off_from_idx(&dasm_info.insts, line_num-1); - U64 voff = df_voff_from_vaddr(module, vaddr); - U64 slice_idx = line_num-visible_line_num_range.min; - code_slice_params.line_vaddrs[slice_idx] = vaddr; - code_slice_params.line_infos[slice_idx] = df_lines_from_dbgi_key_voff(scratch.arena, &dbgi_key, voff); - } - } - } - - ////////////////////////////// - //- rjf: do keyboard interaction - // - B32 snap[Axis2_COUNT] = {0}; - UI_Focus(UI_FocusKind_On) - { - if(ui_is_focus_active() && !is_loading && visible_line_num_range.max >= visible_line_num_range.min) - { - snap[Axis2_X] = snap[Axis2_Y] = df_do_txt_controls(&dasm_text_info, dasm_text_data, ClampBot(visible_line_count, 10) - 10, &dv->cursor, &dv->mark, &dv->preferred_column); - } - } - ////////////////////////////// //- rjf: do goto vaddr // - if(!is_loading && dv->goto_vaddr != 0) + if(!is_loading && has_disasm && dv->goto_vaddr != 0) { U64 vaddr = dv->goto_vaddr; dv->goto_vaddr = 0; U64 line_idx = dasm_inst_array_idx_from_code_off__linear_scan(&dasm_info.insts, vaddr-dasm_vaddr_range.min); S64 line_num = (S64)(line_idx+1); - dv->cursor = dv->mark = txt_pt(line_num, 1); - dv->center_cursor = !dv->contain_cursor || (line_num < visible_line_num_range.min+8 || visible_line_num_range.max-8 < line_num); + cv->goto_line_num = line_num; } ////////////////////////////// - //- rjf: build container + //- rjf: build code contents // - UI_Box *container_box = &ui_g_nil_box; - if(has_disasm) + if(!is_loading && has_disasm) { - ui_set_next_pref_width(ui_px(code_area_dim.x, 1)); - ui_set_next_pref_height(ui_px(code_area_dim.y, 1)); - ui_set_next_child_layout_axis(Axis2_Y); - container_box = ui_build_box_from_stringf(UI_BoxFlag_Clip| - UI_BoxFlag_Scroll| - UI_BoxFlag_DrawBorder| - UI_BoxFlag_AllowOverflowX| - UI_BoxFlag_AllowOverflowY, - "###code_area_%p", view); + df_code_view_build(ws, panel, view, cv, code_area_rect, dasm_text_data, &dasm_text_info, &dasm_info.insts, dasm_vaddr_range); } ////////////////////////////// - //- rjf: build container contents + //- rjf: unpack cursor info // - if(has_disasm) UI_Parent(container_box) + if(!is_loading && has_disasm) { - //- rjf: build fractional space - container_box->view_off.x = container_box->view_off_target.x = view->scroll_pos.x.idx + view->scroll_pos.x.off; - container_box->view_off.y = container_box->view_off_target.y = code_line_height*mod_f32(view->scroll_pos.y.off, 1.f) + code_line_height*(view->scroll_pos.y.off < 0) - code_line_height*(view->scroll_pos.y.off == -1.f && view->scroll_pos.y.idx == 1); - - //- rjf: build code slice - DF_CodeSliceSignal sig = {0}; - UI_Focus(UI_FocusKind_On) - { - sig = df_code_slicef(ws, &ctrl_ctx, &parse_ctx, &code_slice_params, &dv->cursor, &dv->mark, &dv->preferred_column, "dasm_slice_%p", view); - } - - //- rjf: hover eval - if(!ui_dragging(sig.base) && sig.mouse_expr_rng.min.line != 0 && contains_1s64(visible_line_num_range, sig.mouse_expr_rng.min.line) && sig.mouse_expr_rng.max.line == sig.mouse_expr_rng.min.line && sig.base.event_flags == 0) - { - U64 line_idx = sig.mouse_expr_rng.min.line-visible_line_num_range.min; - String8 expr = str8_substr(code_slice_params.line_text[line_idx], r1u64(sig.mouse_expr_rng.min.column-1, sig.mouse_expr_rng.max.column-1)); - if(expr.size != 0) - { - DF_Eval eval = df_eval_from_string(scratch.arena, di_scope, &ctrl_ctx, &parse_ctx, &eval_string2expr_map_nil, expr); - if(eval.mode != EVAL_EvalMode_NULL) - { - U64 off = dasm_inst_array_code_off_from_idx(&dasm_info.insts, sig.mouse_expr_rng.min.line-1); - U64 vaddr = dasm_vaddr_range.min+off; - df_set_hover_eval(ws, sig.mouse_expr_baseline_pos, ctrl_ctx, process, sig.mouse_pt, vaddr, expr); - } - } - } - - //- rjf: press code slice? -> focus panel - if(ui_pressed(sig.base)) - { - DF_CmdParams p = df_cmd_params_from_panel(ws, panel); - df_push_cmd__root(&p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_FocusPanel)); - } - - //- rjf: dragging & outside region? -> contain cursor - if(ui_dragging(sig.base) && sig.base.event_flags == 0) - { - if(!contains_2f32(sig.base.box->rect, ui_mouse())) - { - dv->contain_cursor = 1; - } - else - { - snap[Axis2_X] = 1; - } - } - - //- rjf: clicked margin? -> place breakpoint - if(sig.clicked_margin_line_num != 0) - { - DF_CmdParams params = df_cmd_params_from_view(ws, panel, view); - params.vaddr = dasm_vaddr_range.min+dasm_inst_array_code_off_from_idx(&dasm_info.insts, sig.clicked_margin_line_num-1); - df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_VirtualAddr); - df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_AddressBreakpoint)); - } - - //- rjf: dropped entity onto line? -> do drop - if(sig.dropped_entity_line_num != 0 && !df_entity_is_nil(sig.dropped_entity)) - { - U64 drop_vaddr = dasm_vaddr_range.min+dasm_inst_array_code_off_from_idx(&dasm_info.insts, sig.dropped_entity_line_num-1); - DF_Entity *dropped_entity = sig.dropped_entity; - switch(dropped_entity->kind) - { - default:{}break; - case DF_EntityKind_Breakpoint: - case DF_EntityKind_WatchPin: - { - DF_StateDeltaHistory *hist = df_state_delta_history(); - df_state_delta_history_push_batch(hist, &dropped_entity->generation); - df_state_delta_history_push_struct_delta(hist, &dropped_entity->vaddr); - df_entity_change_parent(hist, dropped_entity, dropped_entity->parent, df_entity_root()); - df_entity_equip_vaddr(dropped_entity, drop_vaddr); - }break; - case DF_EntityKind_Thread: - if(contains_1s64(visible_line_num_range, sig.dropped_entity_line_num)) - { - DF_CmdParams params = df_cmd_params_from_window(ws); - params.entity = df_handle_from_entity(dropped_entity); - params.vaddr = drop_vaddr; - df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_Entity); - df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_VirtualAddr); - df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_SetThreadIP)); - }break; - } - } - - //- rjf: copy text - if(!txt_pt_match(sig.copy_range.min, sig.copy_range.max)) - { - Temp temp = temp_begin(scratch.arena); - String8 text = txt_string_from_info_data_txt_rng(&dasm_text_info, dasm_text_data, sig.copy_range); - os_set_clipboard_text(text); - temp_end(temp); - } - - //- rjf: toggle cursor watch - if(sig.toggle_cursor_watch) - { - DF_CmdParams params = df_cmd_params_from_view(ws, panel, view); - df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_ToggleWatchExpressionAtCursor)); - } - - //- rjf: set next statement - if(sig.set_next_statement_line_num != 0 && contains_1s64(visible_line_num_range, sig.set_next_statement_line_num)) - { - DF_CmdParams params = df_cmd_params_from_view(ws, panel, view); - params.text_point = txt_pt(sig.set_next_statement_line_num, 1); - df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_SetNextStatement)); - } - - //- rjf: run-to-line - if(sig.run_to_line_num != 0 && contains_1s64(visible_line_num_range, sig.run_to_line_num)) - { - DF_CmdParams params = df_cmd_params_from_window(ws); - params.vaddr = dasm_vaddr_range.min+dasm_inst_array_code_off_from_idx(&dasm_info.insts, sig.run_to_line_num-1); - df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_VirtualAddr); - df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_RunToAddress)); - } - - //- rjf: go to source - if(sig.goto_src_line_num != 0 && contains_1s64(visible_line_num_range, sig.goto_src_line_num)) - { - U64 vaddr = dasm_vaddr_range.min+dasm_inst_array_code_off_from_idx(&dasm_info.insts, sig.goto_src_line_num-1); - DF_Entity *module = df_module_from_process_vaddr(process, vaddr); - DI_Key dbgi_key = df_dbgi_key_from_module(module); - U64 voff = df_voff_from_vaddr(module, vaddr); - DF_LineList lines = df_lines_from_dbgi_key_voff(scratch.arena, &dbgi_key, voff); - if(lines.first != 0) - { - String8 file_path = df_full_path_from_entity(scratch.arena, df_entity_from_handle(lines.first->v.file)); - DF_CmdParams params = df_cmd_params_from_view(ws, panel, view); - params.text_point = lines.first->v.pt; - params.file_path = file_path; - df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_TextPoint); - df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_FilePath); - df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_FindCodeLocation)); - } - } + U64 off = dasm_inst_array_code_off_from_idx(&dasm_info.insts, df_interact_regs()->cursor.line-1); + df_interact_regs()->vaddr_range = r1u64(dv->base_vaddr+off, dv->base_vaddr+off); + df_interact_regs()->voff_range = df_voff_range_from_vaddr_range(dasm_module, df_interact_regs()->vaddr_range); + df_interact_regs()->lines = df_lines_from_dbgi_key_voff(df_frame_arena(), &dasm_dbgi_key, df_interact_regs()->voff_range.min); } ////////////////////////////// - //- rjf: apply post-build view snapping rules + //- rjf: build bottom bar // - if(!is_loading) + if(!is_loading && has_disasm) { - // rjf: contain => snap - if(dv->contain_cursor) - { - dv->contain_cursor = 0; - snap[Axis2_X] = 1; - snap[Axis2_Y] = 1; - } - - // rjf: center cursor - if(dv->center_cursor) - { - dv->center_cursor = 0; - - // rjf: scroll x -#if 0 - { - String8 cursor_line = txti_string_from_handle_line_num(scratch.arena, txti_handle, tv->cursor.line); - F32 cursor_advance = f_dim_from_tag_size_string(code_font, code_font_size, str8_prefix(cursor_line, tv->cursor.column-1)).x; - S64 new_idx = (S64)(cursor_advance - code_area_dim.x/2); - new_idx = Clamp(scroll_idx_rng[Axis2_X].min, new_idx, scroll_idx_rng[Axis2_X].max); - ui_scroll_pt_target_idx(&view->scroll_pos.x, new_idx); - snap[Axis2_X] = 0; - } -#endif - - // rjf: scroll y - { - S64 new_idx = (dv->cursor.line-1) - num_possible_visible_lines/2 + 2; - new_idx = Clamp(scroll_idx_rng[Axis2_Y].min, new_idx, scroll_idx_rng[Axis2_Y].max); - ui_scroll_pt_target_idx(&view->scroll_pos.y, new_idx); - snap[Axis2_Y] = 0; - } - } - - // rjf: snap in X - if(snap[Axis2_X]) - { -#if 0 - String8 cursor_line = txti_string_from_handle_line_num(scratch.arena, txti_handle, tv->cursor.line); - S64 cursor_off = (S64)(f_dim_from_tag_size_string(code_font, code_font_size, str8_prefix(cursor_line, tv->cursor.column-1)).x + margin_width_px + line_num_width_px); - Rng1S64 visible_pixel_range = - { - view->scroll_pos.x.idx, - view->scroll_pos.x.idx + (S64)code_area_dim.x, - }; - Rng1S64 cursor_pixel_range = - { - cursor_off - (S64)(big_glyph_advance*4) - (S64)(margin_width_px + line_num_width_px), - cursor_off + (S64)(big_glyph_advance*4), - }; - S64 min_delta = Min(0, cursor_pixel_range.min - visible_pixel_range.min); - S64 max_delta = Max(0, cursor_pixel_range.max - visible_pixel_range.max); - S64 new_idx = view->scroll_pos.x.idx+min_delta+max_delta; - new_idx = Clamp(scroll_idx_rng[Axis2_X].min, new_idx, scroll_idx_rng[Axis2_X].max); - ui_scroll_pt_target_idx(&view->scroll_pos.x, new_idx); -#endif - } - - // rjf: snap in Y - if(snap[Axis2_Y]) - { - Rng1S64 cursor_visibility_range = r1s64(dv->cursor.line-4, dv->cursor.line+4); - cursor_visibility_range.min = Clamp(0, cursor_visibility_range.min, (S64)dasm_info.insts.count); - cursor_visibility_range.max = Clamp(0, cursor_visibility_range.max, (S64)dasm_info.insts.count); - S64 min_delta = Min(0, cursor_visibility_range.min-visible_line_num_range.min); - S64 max_delta = Max(0, cursor_visibility_range.max-visible_line_num_range.max); - S64 new_idx = view->scroll_pos.y.idx+min_delta+max_delta; - new_idx = Clamp(0, new_idx, (S64)dasm_info.insts.count-1); - ui_scroll_pt_target_idx(&view->scroll_pos.y, new_idx); - } - } - - ////////////////////////////// - //- rjf: build horizontal scroll bar - // - if(has_disasm) - { - ui_set_next_fixed_x(0); - ui_set_next_fixed_y(code_area_dim.y); - ui_set_next_fixed_width(panel_box_dim.x - scroll_bar_dim); - ui_set_next_fixed_height(scroll_bar_dim); - { - view->scroll_pos.x = ui_scroll_bar(Axis2_X, - ui_px(scroll_bar_dim, 1.f), - view->scroll_pos.x, - scroll_idx_rng[Axis2_X], - (S64)code_area_dim.x); - } - } - - ////////////////////////////// - //- rjf: build vertical scroll bar - // - if(has_disasm) - { - ui_set_next_fixed_x(code_area_dim.x); - ui_set_next_fixed_y(0); - ui_set_next_fixed_width(scroll_bar_dim); - ui_set_next_fixed_height(panel_box_dim.y - bottom_bar_dim.y - scroll_bar_dim); - { - view->scroll_pos.y = ui_scroll_bar(Axis2_Y, - ui_px(scroll_bar_dim, 1.f), - view->scroll_pos.y, - scroll_idx_rng[Axis2_Y], - num_possible_visible_lines); - } - } - - ////////////////////////////// - //- rjf: top-level container interaction (scrolling) - // - if(!is_loading) - { - UI_Signal sig = ui_signal_from_box(container_box); - if(sig.scroll.x != 0) - { - S64 new_idx = view->scroll_pos.x.idx+sig.scroll.x*big_glyph_advance; - new_idx = clamp_1s64(scroll_idx_rng[Axis2_X], new_idx); - ui_scroll_pt_target_idx(&view->scroll_pos.x, new_idx); - } - if(sig.scroll.y != 0) - { - S64 new_idx = view->scroll_pos.y.idx + sig.scroll.y; - new_idx = clamp_1s64(scroll_idx_rng[Axis2_Y], new_idx); - ui_scroll_pt_target_idx(&view->scroll_pos.y, new_idx); - } - ui_scroll_pt_clamp_idx(&view->scroll_pos.x, scroll_idx_rng[Axis2_X]); - ui_scroll_pt_clamp_idx(&view->scroll_pos.y, scroll_idx_rng[Axis2_Y]); - } - - ////////////////////////////// - //- rjf: build bottom info bar - // - if(has_disasm) - { - ui_set_next_fixed_x(0); - ui_set_next_fixed_y(code_area_dim.y + scroll_bar_dim); - ui_set_next_pref_width(ui_px(bottom_bar_dim.x, 1)); - ui_set_next_pref_height(ui_px(bottom_bar_dim.y, 1)); + ui_set_next_rect(shift_2f32(bottom_bar_rect, scale_2f32(rect.p0, -1.f))); ui_set_next_flags(UI_BoxFlag_DrawBackground); UI_Row UI_TextAlignment(UI_TextAlign_Center) UI_PrefWidth(ui_text_dim(10, 1)) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) - UI_Font(code_font) + UI_Font(df_font_from_slot(DF_FontSlot_Code)) { DF_Entity *module = df_module_from_process_vaddr(process, dasm_vaddr_range.min); - U64 cursor_vaddr = (1 <= dv->cursor.line && dv->cursor.line <= dasm_info.insts.count) ? (dasm_vaddr_range.min+dasm_info.insts.v[dv->cursor.line-1].code_off) : 0; + U64 cursor_vaddr = (1 <= view->cursor.line && view->cursor.line <= dasm_info.insts.count) ? (dasm_vaddr_range.min+dasm_info.insts.v[view->cursor.line-1].code_off) : 0; ui_labelf("%S", path_normalized_from_string(scratch.arena, module->name)); ui_spacer(ui_em(1.5f, 1)); - ui_labelf("Address: 0x%I64x, Line: %I64d, Column: %I64d", cursor_vaddr, dv->cursor.line, dv->cursor.column); + ui_labelf("Address: 0x%I64x, Line: %I64d, Column: %I64d", cursor_vaddr, view->cursor.line, view->cursor.column); ui_spacer(ui_pct(1, 0)); ui_labelf("(read only)"); ui_labelf("bin"); } } - di_scope_close(di_scope); txt_scope_close(txt_scope); dasm_scope_close(dasm_scope); hs_scope_close(hs_scope); scratch_end(scratch); - ProfEnd(); } //////////////////////////////// @@ -7452,7 +6906,7 @@ DF_VIEW_CMD_FUNCTION_DEF(Output) U128 hash = {0}; TXT_TextInfo info = txt_text_info_from_key_lang(txt_scope, df_interact_regs()->text_key, df_interact_regs()->lang_kind, &hash); String8 data = hs_data_from_hash(hs_scope, hash); - df_code_view_cmds(ws, panel, view, cv, cmds, data, &info); + df_code_view_cmds(ws, panel, view, cv, cmds, data, &info, 0, r1u64(0, 0)); txt_scope_close(txt_scope); hs_scope_close(hs_scope); scratch_end(scratch); @@ -7491,7 +6945,7 @@ DF_VIEW_UI_FUNCTION_DEF(Output) //- rjf: build code contents // { - df_code_view_build(ws, panel, view, cv, code_area_rect, data, &info); + df_code_view_build(ws, panel, view, cv, code_area_rect, data, &info, 0, r1u64(0, 0)); } ////////////////////////////// diff --git a/src/df/gfx/df_views.h b/src/df/gfx/df_views.h index a3ad66ee..9c8c386f 100644 --- a/src/df/gfx/df_views.h +++ b/src/df/gfx/df_views.h @@ -385,24 +385,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; }; //////////////////////////////// @@ -469,8 +457,8 @@ internal void df_entity_lister_item_array_sort_by_strength__in_place(DF_EntityLi //~ 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 data, TXT_TextInfo *info); -internal void df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewState *cv, Rng2F32 rect, String8 data, TXT_TextInfo *info); +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); +internal void df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewState *cv, Rng2F32 rect, String8 text_data, TXT_TextInfo *text_info, DASM_InstArray *dasm_insts, Rng1U64 dasm_vaddr_range); //////////////////////////////// //~ rjf: Watch Views From 3d272a598b1cf8b14802210476222bd21b49a936 Mon Sep 17 00:00:00 2001 From: Ryan Fleury Date: Wed, 26 Jun 2024 10:57:49 -0700 Subject: [PATCH 37/47] complete convergence of new disasm view, which uses the core code view path --- src/dbgi/dbgi.c | 7 ++++++ src/dbgi/dbgi.h | 1 + src/df/gfx/df_gfx.c | 50 ++++++++++++++++++++++++------------------- src/df/gfx/df_views.c | 34 ++++++++++++++++++----------- src/df/gfx/df_views.h | 4 ++-- 5 files changed, 59 insertions(+), 37 deletions(-) diff --git a/src/dbgi/dbgi.c b/src/dbgi/dbgi.c index e29085ad..340d67fe 100644 --- a/src/dbgi/dbgi.c +++ b/src/dbgi/dbgi.c @@ -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) { diff --git a/src/dbgi/dbgi.h b/src/dbgi/dbgi.h index 80e84c73..72e166b2 100644 --- a/src/dbgi/dbgi.h +++ b/src/dbgi/dbgi.h @@ -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); diff --git a/src/df/gfx/df_gfx.c b/src/df/gfx/df_gfx.c index 0d3a1f04..a804bc40 100644 --- a/src/df/gfx/df_gfx.c +++ b/src/df/gfx/df_gfx.c @@ -6367,7 +6367,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_ToggleWatchExpression)); } } - if(!df_entity_is_nil(df_entity_from_handle(ws->hover_eval_file))) + if(!df_entity_is_nil(df_entity_from_handle(ws->hover_eval_file)) || ws->hover_eval_vaddr != 0) UI_TextAlignment(UI_TextAlign_Center) UI_PrefWidth(ui_em(3.f, 1.f)) UI_CornerRadius10(corner_radius) UI_CornerRadius11(corner_radius) @@ -11894,7 +11894,13 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ DF_Eval eval = df_eval_from_string(scratch.arena, di_scope, ctrl_ctx, parse_ctx, &eval_string2expr_map_nil, mouse_expr); if(eval.mode != EVAL_EvalMode_NULL) { - df_set_hover_eval(ws, mouse_expr_baseline_pos, *ctrl_ctx, df_entity_from_handle(df_interact_regs()->file), mouse_pt, 0, mouse_expr); + U64 line_vaddr = 0; + if(contains_1s64(params->line_num_range, mouse_pt.line)) + { + U64 line_idx = mouse_pt.line-params->line_num_range.min; + line_vaddr = params->line_vaddrs[line_idx]; + } + df_set_hover_eval(ws, mouse_expr_baseline_pos, *ctrl_ctx, df_entity_from_handle(df_interact_regs()->file), mouse_pt, line_vaddr, mouse_expr); } di_scope_close(di_scope); } @@ -12078,28 +12084,28 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ mix_t = selected_thread_module->alive_t; } } - if(!mapped_special) - { - U64 reg_num = eval_num_from_string(parse_ctx->regs_map, token_string); - if(reg_num != 0) - { - mapped_special = 1; - new_color_kind = DF_ThemeColor_CodeRegister; - mix_t = selected_thread_module->alive_t; - } - } - if(!mapped_special) - { - U64 alias_num = eval_num_from_string(parse_ctx->reg_alias_map, token_string); - if(alias_num != 0) - { - mapped_special = 1; - new_color_kind = DF_ThemeColor_CodeRegister; - mix_t = selected_thread_module->alive_t; - } - } break; } + if(!mapped_special) + { + U64 reg_num = eval_num_from_string(parse_ctx->regs_map, token_string); + if(reg_num != 0) + { + mapped_special = 1; + new_color_kind = DF_ThemeColor_CodeRegister; + mix_t = selected_thread_module->alive_t; + } + } + if(!mapped_special) + { + U64 alias_num = eval_num_from_string(parse_ctx->reg_alias_map, token_string); + if(alias_num != 0) + { + mapped_special = 1; + new_color_kind = DF_ThemeColor_CodeRegister; + mix_t = selected_thread_module->alive_t; + } + } } if(new_color_kind != DF_ThemeColor_Null) { diff --git a/src/df/gfx/df_views.c b/src/df/gfx/df_views.c index a2ffd060..0b17428a 100644 --- a/src/df/gfx/df_views.c +++ b/src/df/gfx/df_views.c @@ -387,7 +387,7 @@ 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) +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) { for(DF_CmdNode *n = cmds->first; n != 0; n = n->next) { @@ -432,7 +432,7 @@ df_code_view_cmds(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewStat } internal void -df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewState *cv, Rng2F32 rect, String8 text_data, TXT_TextInfo *text_info, DASM_InstArray *dasm_insts, Rng1U64 dasm_vaddr_range) +df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewState *cv, Rng2F32 rect, String8 text_data, TXT_TextInfo *text_info, DASM_InstArray *dasm_insts, Rng1U64 dasm_vaddr_range, DI_Key dasm_dbgi_key) { ProfBeginFunction(); Temp scratch = scratch_begin(0, 0); @@ -711,6 +711,12 @@ df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewSta code_slice_params.line_infos[slice_idx] = df_lines_from_dbgi_key_voff(scratch.arena, &dbgi_key, voff); } } + + // rjf: add dasm dbgi key to relevant dbgis + if(dasm_insts != 0) + { + di_key_list_push(scratch.arena, &code_slice_params.relevant_dbgi_keys, &dasm_dbgi_key); + } } ////////////////////////////// @@ -6294,7 +6300,7 @@ DF_VIEW_CMD_FUNCTION_DEF(Code) String8 data = hs_data_from_hash(hs_scope, hash); //- rjf: process general code-view commands - df_code_view_cmds(ws, panel, view, cv, cmds, data, &info, 0, r1u64(0, 0)); + df_code_view_cmds(ws, panel, view, cv, cmds, data, &info, 0, r1u64(0, 0), di_key_zero()); //- rjf: process code-file commands for(DF_CmdNode *n = cmds->first; n != 0; n = n->next) @@ -6417,7 +6423,7 @@ DF_VIEW_UI_FUNCTION_DEF(Code) // if(!entity_is_missing && key_has_data) { - df_code_view_build(ws, panel, view, cv, code_area_rect, data, &info, 0, r1u64(0, 0)); + df_code_view_build(ws, panel, view, cv, code_area_rect, data, &info, 0, r1u64(0, 0), di_key_zero()); } ////////////////////////////// @@ -6525,13 +6531,14 @@ DF_VIEW_CMD_FUNCTION_DEF(Disassembly) dasm_params.dbgi_key = dasm_dbgi_key; } DASM_Info dasm_info = dasm_info_from_key_params(dasm_scope, dasm_key, &dasm_params, &dasm_data_hash); - TXT_LangKind lang_kind = txt_lang_kind_from_architecture(arch); + df_interact_regs()->text_key = dasm_info.text_key; + df_interact_regs()->lang_kind = txt_lang_kind_from_architecture(arch); U128 dasm_text_hash = {0}; - TXT_TextInfo dasm_text_info = txt_text_info_from_key_lang(txt_scope, dasm_info.text_key, lang_kind, &dasm_text_hash); + TXT_TextInfo dasm_text_info = txt_text_info_from_key_lang(txt_scope, df_interact_regs()->text_key, df_interact_regs()->lang_kind, &dasm_text_hash); String8 dasm_text_data = hs_data_from_hash(hs_scope, dasm_text_hash); //- rjf: process general code-view commands - df_code_view_cmds(ws, panel, view, &dv->cv, cmds, dasm_text_data, &dasm_text_info, &dasm_info.insts, dasm_vaddr_range); + df_code_view_cmds(ws, panel, view, &dv->cv, cmds, dasm_text_data, &dasm_text_info, &dasm_info.insts, dasm_vaddr_range, dasm_dbgi_key); //- rjf: process disassembly-specific commands for(DF_CmdNode *n = cmds->first; n != 0; n = n->next) @@ -6633,9 +6640,10 @@ DF_VIEW_UI_FUNCTION_DEF(Disassembly) dasm_params.dbgi_key = dasm_dbgi_key; } DASM_Info dasm_info = dasm_info_from_key_params(dasm_scope, dasm_key, &dasm_params, &dasm_data_hash); - TXT_LangKind lang_kind = txt_lang_kind_from_architecture(arch); + df_interact_regs()->text_key = dasm_info.text_key; + df_interact_regs()->lang_kind = txt_lang_kind_from_architecture(arch); U128 dasm_text_hash = {0}; - TXT_TextInfo dasm_text_info = txt_text_info_from_key_lang(txt_scope, dasm_info.text_key, lang_kind, &dasm_text_hash); + TXT_TextInfo dasm_text_info = txt_text_info_from_key_lang(txt_scope, df_interact_regs()->text_key, df_interact_regs()->lang_kind, &dasm_text_hash); String8 dasm_text_data = hs_data_from_hash(hs_scope, dasm_text_hash); B32 has_disasm = (dasm_info.insts.count != 0 && dasm_text_info.lines_count != 0); B32 is_loading = (!has_disasm && !df_entity_is_nil(process) && dim_1u64(dasm_vaddr_range) != 0); @@ -6665,7 +6673,7 @@ DF_VIEW_UI_FUNCTION_DEF(Disassembly) // if(!is_loading && has_disasm) { - df_code_view_build(ws, panel, view, cv, code_area_rect, dasm_text_data, &dasm_text_info, &dasm_info.insts, dasm_vaddr_range); + df_code_view_build(ws, panel, view, cv, code_area_rect, dasm_text_data, &dasm_text_info, &dasm_info.insts, dasm_vaddr_range, dasm_dbgi_key); } ////////////////////////////// @@ -6674,7 +6682,7 @@ DF_VIEW_UI_FUNCTION_DEF(Disassembly) if(!is_loading && has_disasm) { U64 off = dasm_inst_array_code_off_from_idx(&dasm_info.insts, df_interact_regs()->cursor.line-1); - df_interact_regs()->vaddr_range = r1u64(dv->base_vaddr+off, dv->base_vaddr+off); + df_interact_regs()->vaddr_range = r1u64(dasm_base_vaddr+off, dasm_base_vaddr+off); df_interact_regs()->voff_range = df_voff_range_from_vaddr_range(dasm_module, df_interact_regs()->vaddr_range); df_interact_regs()->lines = df_lines_from_dbgi_key_voff(df_frame_arena(), &dasm_dbgi_key, df_interact_regs()->voff_range.min); } @@ -6906,7 +6914,7 @@ DF_VIEW_CMD_FUNCTION_DEF(Output) U128 hash = {0}; TXT_TextInfo info = txt_text_info_from_key_lang(txt_scope, df_interact_regs()->text_key, df_interact_regs()->lang_kind, &hash); String8 data = hs_data_from_hash(hs_scope, hash); - df_code_view_cmds(ws, panel, view, cv, cmds, data, &info, 0, r1u64(0, 0)); + df_code_view_cmds(ws, panel, view, cv, cmds, data, &info, 0, r1u64(0, 0), di_key_zero()); txt_scope_close(txt_scope); hs_scope_close(hs_scope); scratch_end(scratch); @@ -6945,7 +6953,7 @@ DF_VIEW_UI_FUNCTION_DEF(Output) //- rjf: build code contents // { - df_code_view_build(ws, panel, view, cv, code_area_rect, data, &info, 0, r1u64(0, 0)); + df_code_view_build(ws, panel, view, cv, code_area_rect, data, &info, 0, r1u64(0, 0), di_key_zero()); } ////////////////////////////// diff --git a/src/df/gfx/df_views.h b/src/df/gfx/df_views.h index 9c8c386f..258235b2 100644 --- a/src/df/gfx/df_views.h +++ b/src/df/gfx/df_views.h @@ -457,8 +457,8 @@ internal void df_entity_lister_item_array_sort_by_strength__in_place(DF_EntityLi //~ 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); -internal void df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewState *cv, Rng2F32 rect, String8 text_data, TXT_TextInfo *text_info, DASM_InstArray *dasm_insts, Rng1U64 dasm_vaddr_range); +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, 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 From 6e2353d302e2557e45b8553faa423c24b4770387 Mon Sep 17 00:00:00 2001 From: Ryan Fleury Date: Wed, 26 Jun 2024 11:01:51 -0700 Subject: [PATCH 38/47] eliminate margin from output --- src/df/gfx/df_views.c | 23 ++++++++++++++++------- src/df/gfx/df_views.h | 9 ++++++++- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/src/df/gfx/df_views.c b/src/df/gfx/df_views.c index 0b17428a..e026a2b0 100644 --- a/src/df/gfx/df_views.c +++ b/src/df/gfx/df_views.c @@ -432,7 +432,7 @@ df_code_view_cmds(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewStat } internal void -df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewState *cv, Rng2F32 rect, String8 text_data, TXT_TextInfo *text_info, DASM_InstArray *dasm_insts, Rng1U64 dasm_vaddr_range, DI_Key dasm_dbgi_key) +df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewState *cv, DF_CodeViewFlags flags, Rng2F32 rect, String8 text_data, TXT_TextInfo *text_info, DASM_InstArray *dasm_insts, Rng1U64 dasm_vaddr_range, DI_Key dasm_dbgi_key) { ProfBeginFunction(); Temp scratch = scratch_begin(0, 0); @@ -500,9 +500,14 @@ df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewSta ////////////////////////////// //- rjf: calculate line-range-dependent info // - F32 priority_margin_width_px = big_glyph_advance*3.5f; - F32 catchall_margin_width_px = big_glyph_advance*3.5f; F32 line_num_width_px = big_glyph_advance * (log10(visible_line_num_range.max) + 3); + F32 priority_margin_width_px = 0; + F32 catchall_margin_width_px = 0; + if(flags & DF_CodeViewFlag_Margins) + { + priority_margin_width_px = big_glyph_advance*3.5f; + catchall_margin_width_px = big_glyph_advance*3.5f; + } TXT_LineTokensSlice slice = txt_line_tokens_slice_from_info_data_line_range(scratch.arena, text_info, text_data, visible_line_num_range); ////////////////////////////// @@ -528,7 +533,11 @@ df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewSta DF_CodeSliceParams code_slice_params = {0}; { // rjf: fill basics - code_slice_params.flags = DF_CodeSliceFlag_PriorityMargin|DF_CodeSliceFlag_CatchallMargin|DF_CodeSliceFlag_LineNums|DF_CodeSliceFlag_Clickable; + code_slice_params.flags = DF_CodeSliceFlag_LineNums|DF_CodeSliceFlag_Clickable; + if(flags & DF_CodeViewFlag_Margins) + { + code_slice_params.flags |= DF_CodeSliceFlag_PriorityMargin|DF_CodeSliceFlag_CatchallMargin; + } code_slice_params.line_num_range = visible_line_num_range; code_slice_params.line_text = push_array(scratch.arena, String8, visible_line_count); code_slice_params.line_ranges = push_array(scratch.arena, Rng1U64, visible_line_count); @@ -6423,7 +6432,7 @@ DF_VIEW_UI_FUNCTION_DEF(Code) // if(!entity_is_missing && key_has_data) { - df_code_view_build(ws, panel, view, cv, code_area_rect, data, &info, 0, r1u64(0, 0), di_key_zero()); + df_code_view_build(ws, panel, view, cv, DF_CodeViewFlag_All, code_area_rect, data, &info, 0, r1u64(0, 0), di_key_zero()); } ////////////////////////////// @@ -6673,7 +6682,7 @@ DF_VIEW_UI_FUNCTION_DEF(Disassembly) // if(!is_loading && has_disasm) { - df_code_view_build(ws, panel, view, cv, code_area_rect, dasm_text_data, &dasm_text_info, &dasm_info.insts, dasm_vaddr_range, dasm_dbgi_key); + df_code_view_build(ws, panel, view, cv, DF_CodeViewFlag_All, code_area_rect, dasm_text_data, &dasm_text_info, &dasm_info.insts, dasm_vaddr_range, dasm_dbgi_key); } ////////////////////////////// @@ -6953,7 +6962,7 @@ DF_VIEW_UI_FUNCTION_DEF(Output) //- rjf: build code contents // { - df_code_view_build(ws, panel, view, cv, code_area_rect, data, &info, 0, r1u64(0, 0), di_key_zero()); + df_code_view_build(ws, panel, view, cv, 0, code_area_rect, data, &info, 0, r1u64(0, 0), di_key_zero()); } ////////////////////////////// diff --git a/src/df/gfx/df_views.h b/src/df/gfx/df_views.h index 258235b2..cc21af32 100644 --- a/src/df/gfx/df_views.h +++ b/src/df/gfx/df_views.h @@ -361,6 +361,13 @@ struct DF_WatchViewState //////////////////////////////// //~ rjf: Code, Output @view_types +typedef U32 DF_CodeViewFlags; +enum +{ + DF_CodeViewFlag_Margins = (1<<0), + DF_CodeViewFlag_All = 0xffffffff, +}; + typedef struct DF_CodeViewState DF_CodeViewState; struct DF_CodeViewState { @@ -458,7 +465,7 @@ internal void df_entity_lister_item_array_sort_by_strength__in_place(DF_EntityLi 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, Rng2F32 rect, 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_CodeViewFlags 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 From 1229a50c6877eec060be14355877d9238e12c067 Mon Sep 17 00:00:00 2001 From: Ryan Fleury Date: Wed, 26 Jun 2024 11:09:58 -0700 Subject: [PATCH 39/47] eliminate txti layer --- src/base/base_entry_point.c | 3 - src/df/core/df_core.c | 38 +- src/df/core/df_core.h | 3 - src/df/gfx/df_gfx.c | 182 ------- src/df/gfx/df_gfx.h | 1 - src/mutable_text/mutable_text.c | 2 +- src/raddbg/raddbg.c | 13 - src/raddbg/raddbg_main.c | 2 - src/txti/txti.c | 895 -------------------------------- src/txti/txti.h | 286 ---------- 10 files changed, 3 insertions(+), 1422 deletions(-) delete mode 100644 src/txti/txti.c delete mode 100644 src/txti/txti.h diff --git a/src/base/base_entry_point.c b/src/base/base_entry_point.c index 7a0e5db6..95378b57 100644 --- a/src/base/base_entry_point.c +++ b/src/base/base_entry_point.c @@ -45,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 diff --git a/src/df/core/df_core.c b/src/df/core/df_core.c index 4b3feae2..e1c30fb6 100644 --- a/src/df/core/df_core.c +++ b/src/df/core/df_core.c @@ -1398,19 +1398,6 @@ df_entity_fuzzy_item_array_from_entity_array_needle(Arena *arena, DF_EntityArray return result; } -//- rjf: entity -> text info - -internal TXTI_Handle -df_txti_handle_from_entity(DF_Entity *entity) -{ - TXTI_Handle handle = {0}; - Temp scratch = scratch_begin(0, 0); - String8 path = df_full_path_from_entity(scratch.arena, entity); - handle = txti_handle_from_path(path); - scratch_end(scratch); - return handle; -} - //- rjf: full path building, from file/folder entities internal String8 @@ -7123,10 +7110,8 @@ df_core_begin_frame(Arena *arena, DF_CmdList *cmds, F32 dt) DF_EntityList existing_processes = df_query_cached_entity_list_with_kind(DF_EntityKind_Process); if(existing_processes.count == 0) { - Temp scratch = scratch_begin(0, 0); - DF_Entity *session_log = df_log_from_entity(df_entity_root()); - TXTI_Handle session_log_handle = df_txti_handle_from_entity(session_log); - txti_reload(session_log_handle, df_full_path_from_entity(scratch.arena, session_log)); + MTX_Op op = {r1u64(0, 0xffffffffffffffffull), str8_lit("[new session]\n")}; + mtx_push_op(df_state->output_log_key, op); DF_EntityList bps = df_query_cached_entity_list_with_kind(DF_EntityKind_Breakpoint); for(DF_EntityNode *n = bps.first; n != 0; n = n->next) { @@ -7315,25 +7300,6 @@ df_core_begin_frame(Arena *arena, DF_CmdList *cmds, F32 dt) { MTX_Op op = {r1u64(max_U64, max_U64), event->string}; mtx_push_op(df_state->output_log_key, op); -#if 0 - String8 string = event->string; - DF_Entity *root = df_entity_root(); - DF_Entity *thread = df_entity_from_ctrl_handle(event->machine_id, event->entity); - DF_Entity *process = df_entity_ancestor_from_kind(thread, DF_EntityKind_Process); - DF_Entity *machine = df_entity_ancestor_from_kind(process, DF_EntityKind_Machine); - DF_Entity *root_log = df_log_from_entity(root); - DF_Entity *thread_log = df_log_from_entity(thread); - DF_Entity *process_log = df_log_from_entity(process); - DF_Entity *machine_log = df_log_from_entity(machine); - TXTI_Handle root_log_handle = df_txti_handle_from_entity(root_log); - TXTI_Handle thread_log_handle = df_txti_handle_from_entity(thread_log); - TXTI_Handle process_log_handle = df_txti_handle_from_entity(process_log); - TXTI_Handle machine_log_handle = df_txti_handle_from_entity(machine_log); - txti_append(root_log_handle, string); - txti_append(thread_log_handle, string); - txti_append(process_log_handle, string); - txti_append(machine_log_handle, string); -#endif }break; case CTRL_EventKind_ThreadName: diff --git a/src/df/core/df_core.h b/src/df/core/df_core.h index ead3bd9f..95825753 100644 --- a/src/df/core/df_core.h +++ b/src/df/core/df_core.h @@ -1536,9 +1536,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); diff --git a/src/df/gfx/df_gfx.c b/src/df/gfx/df_gfx.c index a804bc40..61853333 100644 --- a/src/df/gfx/df_gfx.c +++ b/src/df/gfx/df_gfx.c @@ -12479,188 +12479,6 @@ df_do_txt_controls(TXT_TextInfo *info, String8 data, U64 line_count_per_page, Tx return change; } -internal B32 -df_do_txti_controls(TXTI_Handle handle, U64 line_count_per_page, TxtPt *cursor, TxtPt *mark, S64 *preferred_column) -{ - Temp scratch = scratch_begin(0, 0); - B32 change = 0; - UI_EventList *events = ui_events(); - TXTI_BufferInfo buffer_info = txti_buffer_info_from_handle(scratch.arena, handle); - for(UI_EventNode *n = events->first, *next = 0; n != 0; n = next) - { - next = n->next; - B32 taken = 0; - if(n->v.kind != UI_EventKind_Navigate && n->v.kind != UI_EventKind_Edit) - { - continue; - } - String8 line = txti_string_from_handle_line_num(scratch.arena, handle, cursor->line); - UI_TxtOp single_line_op = ui_single_line_txt_op_from_event(scratch.arena, &n->v, line, *cursor, *mark); - - //- rjf: invalid single-line op or endpoint units => try multiline - if(n->v.delta_unit == UI_EventDeltaUnit_Whole || single_line_op.flags & UI_TxtOpFlag_Invalid) - { - U64 line_count = buffer_info.total_line_count; - String8 prev_line = txti_string_from_handle_line_num(scratch.arena, handle, cursor->line-1); - String8 next_line = txti_string_from_handle_line_num(scratch.arena, handle, cursor->line+1); - Vec2S32 delta = n->v.delta_2s32; - - //- rjf: wrap lines right - if(n->v.delta_unit != UI_EventDeltaUnit_Whole && delta.x > 0 && cursor->column == line.size+1 && cursor->line+1 <= line_count) - { - cursor->line += 1; - cursor->column = 1; - *preferred_column = 1; - change = 1; - taken = 1; - } - - //- rjf: wrap lines left - if(n->v.delta_unit != UI_EventDeltaUnit_Whole && delta.x < 0 && cursor->column == 1 && cursor->line-1 >= 1) - { - cursor->line -= 1; - cursor->column = prev_line.size+1; - *preferred_column = prev_line.size+1; - change = 1; - taken = 1; - } - - //- rjf: movement down (plain) - if(n->v.delta_unit == UI_EventDeltaUnit_Char && delta.y > 0 && cursor->line+1 <= line_count) - { - cursor->line += 1; - cursor->column = Min(*preferred_column, next_line.size+1); - change = 1; - taken = 1; - } - - //- rjf: movement up (plain) - if(n->v.delta_unit == UI_EventDeltaUnit_Char && delta.y < 0 && cursor->line-1 >= 1) - { - cursor->line -= 1; - cursor->column = Min(*preferred_column, prev_line.size+1); - change = 1; - taken = 1; - } - - //- rjf: movement down (chunk) - if(n->v.delta_unit == UI_EventDeltaUnit_Word && delta.y > 0 && cursor->line+1 <= line_count) - { - for(S64 line_num = cursor->line+1; line_num <= line_count; line_num += 1) - { - String8 line = txti_string_from_handle_line_num(scratch.arena, handle, line_num); - U64 line_size = line.size; - if(line_size == 0) - { - cursor->line = line_num; - cursor->column = 1; - break; - } - else if(line_num == line_count) - { - cursor->line = line_num; - cursor->column = line_size+1; - } - } - change = 1; - taken = 1; - } - - //- rjf: movement up (chunk) - if(n->v.delta_unit == UI_EventDeltaUnit_Word && delta.y < 0 && cursor->line-1 >= 1) - { - for(S64 line_num = cursor->line-1; line_num > 0; line_num -= 1) - { - String8 line = txti_string_from_handle_line_num(scratch.arena, handle, line_num); - U64 line_size = line.size; - if(line_size == 0) - { - cursor->line = line_num; - cursor->column = 1; - break; - } - else if(line_num == 1) - { - cursor->line = line_num; - cursor->column = 1; - } - } - change = 1; - taken = 1; - } - - //- rjf: movement down (page) - if(n->v.delta_unit == UI_EventDeltaUnit_Page && delta.y > 0) - { - cursor->line += line_count_per_page; - cursor->column = 1; - cursor->line = Clamp(1, cursor->line, line_count); - change = 1; - taken = 1; - } - - //- rjf: movement up (page) - if(n->v.delta_unit == UI_EventDeltaUnit_Page && delta.y < 0) - { - cursor->line -= line_count_per_page; - cursor->column = 1; - cursor->line = Clamp(1, cursor->line, line_count); - change = 1; - taken = 1; - } - - //- rjf: movement to endpoint (+) - if(n->v.delta_unit == UI_EventDeltaUnit_Whole && (delta.y > 0 || delta.x > 0)) - { - *cursor = txt_pt(line_count, buffer_info.last_line_size); - change = 1; - taken = 1; - } - - //- rjf: movement to endpoint (-) - if(n->v.delta_unit == UI_EventDeltaUnit_Whole && (delta.y < 0 || delta.x < 0)) - { - *cursor = txt_pt(1, 1); - change = 1; - taken = 1; - } - - //- rjf: stick mark to cursor, when we don't want to keep it in the same spot - if(!(n->v.flags & UI_EventFlag_KeepMark)) - { - *mark = *cursor; - } - } - - //- rjf: valid single-line op => do single-line op - else - { - *cursor = single_line_op.cursor; - *mark = single_line_op.mark; - *preferred_column = cursor->column; - change = 1; - taken = 1; - } - - //- rjf: copy - if(n->v.flags & UI_EventFlag_Copy) - { - String8 text = txti_string_from_handle_txt_rng(scratch.arena, handle, txt_rng(*cursor, *mark)); - os_set_clipboard_text(text); - taken = 1; - } - - //- rjf: consume - if(taken) - { - ui_eat_event(events, n); - } - } - - scratch_end(scratch); - return change; -} - //////////////////////////////// //~ rjf: UI Widgets: Fancy Labels diff --git a/src/df/gfx/df_gfx.h b/src/df/gfx/df_gfx.h index 9e8244c9..8b9f469c 100644 --- a/src/df/gfx/df_gfx.h +++ b/src/df/gfx/df_gfx.h @@ -1084,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 diff --git a/src/mutable_text/mutable_text.c b/src/mutable_text/mutable_text.c index 92f2c0ed..d1b8ff87 100644 --- a/src/mutable_text/mutable_text.c +++ b/src/mutable_text/mutable_text.c @@ -115,8 +115,8 @@ mtx_mut_thread__entry_point(void *p) //- rjf: construct new buffer if(op.range.max != op.range.min || op.replace.size != 0) { - Arena *arena = arena_alloc(); 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)); diff --git a/src/raddbg/raddbg.c b/src/raddbg/raddbg.c index f69d40ed..5d74a2ee 100644 --- a/src/raddbg/raddbg.c +++ b/src/raddbg/raddbg.c @@ -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 // diff --git a/src/raddbg/raddbg_main.c b/src/raddbg/raddbg_main.c index f68eb1b4..98b59d30 100644 --- a/src/raddbg/raddbg_main.c +++ b/src/raddbg/raddbg_main.c @@ -38,7 +38,6 @@ #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" @@ -79,7 +78,6 @@ #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" diff --git a/src/txti/txti.c b/src/txti/txti.c deleted file mode 100644 index 9fc4cf06..00000000 --- a/src/txti/txti.c +++ /dev/null @@ -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); - } -} diff --git a/src/txti/txti.h b/src/txti/txti.h deleted file mode 100644 index 48b1844b..00000000 --- a/src/txti/txti.h +++ /dev/null @@ -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 From e10bef9d2b20bc75048a7a85e4b596ff313cdba5 Mon Sep 17 00:00:00 2001 From: Ryan Fleury Date: Wed, 26 Jun 2024 12:05:56 -0700 Subject: [PATCH 40/47] fix function breakpoints using hit-count as voff; pass over entity ref buttons in various uis; go-to-location with address values in watch views --- src/df/core/df_core.c | 10 ++- src/df/gfx/df_gfx.c | 23 +++---- src/df/gfx/df_gfx.h | 2 +- src/df/gfx/df_views.c | 143 +++++++++++++++++++++++++++++++----------- src/df/gfx/df_views.h | 13 +++- src/raddbg/raddbg.h | 7 +-- 6 files changed, 142 insertions(+), 56 deletions(-) diff --git a/src/df/core/df_core.c b/src/df/core/df_core.c index e1c30fb6..53e88c8d 100644 --- a/src/df/core/df_core.c +++ b/src/df/core/df_core.c @@ -4054,7 +4054,6 @@ df_ctrl_run(DF_RunKind run, DF_Entity *run_thread, CTRL_RunFlags flags, CTRL_Tra { ctrl_user_bp_kind = CTRL_UserBreakpointKind_SymbolNameAndOffset; ctrl_user_bp_string = symb->name; - ctrl_user_bp_u64 = user_bp->u64; } } @@ -7056,6 +7055,7 @@ df_core_begin_frame(Arena *arena, DF_CmdList *cmds, F32 dt) for(DF_EntityNode *n = user_bps.first; n != 0; n = n->next) { DF_Entity *bp = n->entity; + DF_Entity *symb = df_entity_child_from_kind(bp, DF_EntityKind_EntryPointName); if(bp->flags & DF_EntityFlag_HasVAddr && bp->vaddr == stop_thread_vaddr) { bp->u64 += 1; @@ -7073,6 +7073,14 @@ df_core_begin_frame(Arena *arena, DF_CmdList *cmds, F32 dt) } } } + if(!df_entity_is_nil(symb)) + { + U64 symb_voff = df_voff_from_dbgi_key_symbol_name(&dbgi_key, symb->name); + if(symb_voff == stop_thread_voff) + { + bp->u64 += 1; + } + } } } diff --git a/src/df/gfx/df_gfx.c b/src/df/gfx/df_gfx.c index 61853333..77f68220 100644 --- a/src/df/gfx/df_gfx.c +++ b/src/df/gfx/df_gfx.c @@ -5417,7 +5417,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) } //- rjf: restart button - if(!can_play && processes.count != 0) UI_TextAlignment(UI_TextAlign_Center) + else UI_TextAlignment(UI_TextAlign_Center) UI_Palette(ui_build_palette(ui_top_palette(), .text = df_rgba_from_theme_color(DF_ThemeColor_TextPositive))) { UI_Signal sig = ui_button(df_g_icon_kind_text_table[DF_IconKind_Redo]); @@ -10457,8 +10457,8 @@ df_entity_tooltips(DF_Entity *entity) scratch_end(scratch); } -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) { ProfBeginFunction(); Temp scratch = scratch_begin(0, 0); @@ -10490,10 +10490,10 @@ df_entity_desc_button(DF_Window *ws, DF_Entity *entity, FuzzyMatchRangeList *nam { palette = df_palette_from_code(DF_PaletteCode_NeutralPopButton); } - ui_set_next_hover_cursor(OS_Cursor_HandPoint); ui_set_next_palette(palette); + ui_set_next_hover_cursor(OS_Cursor_HandPoint); UI_Box *box = ui_build_box_from_stringf(UI_BoxFlag_Clickable| - UI_BoxFlag_DrawBorder| + (!is_implicit*UI_BoxFlag_DrawBorder)| UI_BoxFlag_DrawBackground| UI_BoxFlag_DrawHotEffects| UI_BoxFlag_DrawActiveEffects, @@ -10609,9 +10609,9 @@ df_entity_desc_button(DF_Window *ws, DF_Entity *entity, FuzzyMatchRangeList *nam } //- rjf: do interaction on main box + UI_Signal sig = ui_signal_from_box(box); { - UI_Signal sig = ui_signal_from_box(box); - if(ui_key_match(box->key, ui_hot_key())) + if(ui_hovering(sig) && !df_drag_is_active()) { df_entity_tooltips(entity); } @@ -10644,6 +10644,7 @@ df_entity_desc_button(DF_Window *ws, DF_Entity *entity, FuzzyMatchRangeList *nam } scratch_end(scratch); ProfEnd(); + return sig; } internal void @@ -11032,7 +11033,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ } // rjf: hover tooltips - if(ui_hovering(thread_sig)) + if(ui_hovering(thread_sig) && !df_drag_is_active()) { df_entity_tooltips(thread); } @@ -11187,7 +11188,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ } // rjf: hover tooltips - if(ui_hovering(thread_sig)) + if(ui_hovering(thread_sig) && !df_drag_is_active()) { df_entity_tooltips(thread); } @@ -11274,7 +11275,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ UI_Signal bp_sig = ui_signal_from_box(bp_box); // rjf: bp hovering - if(ui_hovering(bp_sig)) + if(ui_hovering(bp_sig) && !df_drag_is_active()) { df_entity_tooltips(bp); } @@ -11334,7 +11335,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ UI_Signal pin_sig = ui_signal_from_box(pin_box); // rjf: watch hovering - if(ui_hovering(pin_sig)) + if(ui_hovering(pin_sig) && !df_drag_is_active()) { df_entity_tooltips(pin); } diff --git a/src/df/gfx/df_gfx.h b/src/df/gfx/df_gfx.h index 8b9f469c..94edcca0 100644 --- a/src/df/gfx/df_gfx.h +++ b/src/df/gfx/df_gfx.h @@ -1072,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); //////////////////////////////// diff --git a/src/df/gfx/df_views.c b/src/df/gfx/df_views.c index e026a2b0..8c36c7e8 100644 --- a/src/df/gfx/df_views.c +++ b/src/df/gfx/df_views.c @@ -432,7 +432,7 @@ df_code_view_cmds(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewStat } internal void -df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewState *cv, DF_CodeViewFlags flags, Rng2F32 rect, String8 text_data, TXT_TextInfo *text_info, DASM_InstArray *dasm_insts, Rng1U64 dasm_vaddr_range, DI_Key dasm_dbgi_key) +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) { ProfBeginFunction(); Temp scratch = scratch_begin(0, 0); @@ -503,7 +503,7 @@ df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewSta F32 line_num_width_px = big_glyph_advance * (log10(visible_line_num_range.max) + 3); F32 priority_margin_width_px = 0; F32 catchall_margin_width_px = 0; - if(flags & DF_CodeViewFlag_Margins) + if(flags & DF_CodeViewBuildFlag_Margins) { priority_margin_width_px = big_glyph_advance*3.5f; catchall_margin_width_px = big_glyph_advance*3.5f; @@ -534,7 +534,7 @@ df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewSta { // rjf: fill basics code_slice_params.flags = DF_CodeSliceFlag_LineNums|DF_CodeSliceFlag_Clickable; - if(flags & DF_CodeViewFlag_Margins) + if(flags & DF_CodeViewBuildFlag_Margins) { code_slice_params.flags |= DF_CodeSliceFlag_PriorityMargin|DF_CodeSliceFlag_CatchallMargin; } @@ -1867,6 +1867,40 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS } } + ////////////////////////// + //- rjf: [table] do cell-granularity go-to-locations + // + if(!ewv->text_editing && evt->slot == UI_EventActionSlot_Accept && + selection_tbl.min.x == selection_tbl.max.x && + selection_tbl.min.y == selection_tbl.max.y && + selection_tbl.min.x == 1) + { + taken = 1; + DF_EvalVizWindowedRowList rows = df_eval_viz_windowed_row_list_from_viz_block_list(scratch.arena, di_scope, &ctrl_ctx, &parse_ctx, ¯o_map, eval_view, default_radix, code_font, ui_top_font_size(), + r1s64(ui_scroll_list_row_from_item(&row_blocks, selection_tbl.min.y-1), + ui_scroll_list_row_from_item(&row_blocks, selection_tbl.max.y-1)+1), &blocks); + DF_EvalVizRow *row = rows.first; + if(!(row->flags & DF_EvalVizRowFlag_CanEditValue)) + { + U64 vaddr = 0; + if(vaddr == 0) { vaddr = row->eval.offset; } + if(vaddr == 0) { vaddr = row->eval.imm_u64; } + DF_Entity *module = df_module_from_process_vaddr(process, vaddr); + DI_Key dbgi_key = df_dbgi_key_from_module(module); + U64 voff = df_voff_from_vaddr(module, vaddr); + DF_LineList lines = df_lines_from_dbgi_key_voff(scratch.arena, &dbgi_key, voff); + DF_CmdParams p = df_cmd_params_from_view(ws, panel, view); + p.entity = df_handle_from_entity(process); + p.vaddr = vaddr; + if(lines.first != 0) + { + p.file_path = df_full_path_from_entity(scratch.arena, df_entity_from_handle(lines.first->v.file)); + p.text_point = lines.first->v.pt; + } + df_push_cmd__root(&p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_FindCodeLocation)); + } + } + ////////////////////////// //- rjf: [text] apply textual edits // @@ -2746,6 +2780,27 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS DF_CmdParams p = df_cmd_params_from_view(ws, panel, view); df_push_cmd__root(&p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_Edit)); } + + // rjf: double-click, not editable -> go-to-location + if(ui_double_clicked(sig) && !(row->flags & DF_EvalVizRowFlag_CanEditValue)) + { + U64 vaddr = 0; + if(vaddr == 0) { vaddr = row->eval.offset; } + if(vaddr == 0) { vaddr = row->eval.imm_u64; } + DF_Entity *module = df_module_from_process_vaddr(process, vaddr); + DI_Key dbgi_key = df_dbgi_key_from_module(module); + U64 voff = df_voff_from_vaddr(module, vaddr); + DF_LineList lines = df_lines_from_dbgi_key_voff(scratch.arena, &dbgi_key, voff); + DF_CmdParams p = df_cmd_params_from_view(ws, panel, view); + p.entity = df_handle_from_entity(process); + p.vaddr = vaddr; + if(lines.first != 0) + { + p.file_path = df_full_path_from_entity(scratch.arena, df_entity_from_handle(lines.first->v.file)); + p.text_point = lines.first->v.pt; + } + df_push_cmd__root(&p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_FindCodeLocation)); + } } //////////////////// @@ -4617,7 +4672,7 @@ DF_VIEW_UI_FUNCTION_DEF(Targets) // rjf: target name UI_WidthFill UI_FocusHot((row_selected && cursor.x == 1) ? UI_FocusKind_On : UI_FocusKind_Off) { - df_entity_desc_button(ws, target, &targets.v[row_idx-1].matches, query); + df_entity_desc_button(ws, target, &targets.v[row_idx-1].matches, query, 0); } // rjf: controls @@ -5473,7 +5528,7 @@ DF_VIEW_UI_FUNCTION_DEF(Scheduler) UI_TableCellSized(ui_pct(1, 0)) UI_FocusHot((row_is_selected && desc_col_rng.min <= cursor.x && cursor.x <= desc_col_rng.max) ? UI_FocusKind_On : UI_FocusKind_Off) { - df_entity_desc_button(ws, entity, &items.v[idx].matches, query); + df_entity_desc_button(ws, entity, &items.v[idx].matches, query, 0); } switch(entity->kind) { @@ -5627,16 +5682,22 @@ DF_VIEW_UI_FUNCTION_DEF(CallStack) { ui_set_next_flags(UI_BoxFlag_Disabled); } - F32 *col_pcts[] = { &cs->selection_col_pct, &cs->module_col_pct, &cs->function_name_col_pct, &cs->addr_col_pct }; + F32 *col_pcts[] = + { + &cs->selection_col_pct, + &cs->function_name_col_pct, + &cs->addr_col_pct, + &cs->module_col_pct, + }; UI_TableF(ArrayCount(col_pcts), col_pcts, "###tbl") { //- rjf: header if(visible_row_range.min == 0) UI_TableVector UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) { UI_TableCell {} - UI_TableCell ui_label(str8_lit("Module")); UI_TableCell ui_label(str8_lit("Function Name")); UI_TableCell ui_label(str8_lit("Address")); + UI_TableCell ui_label(str8_lit("Module")); } //- rjf: frame rows @@ -5711,29 +5772,9 @@ DF_VIEW_UI_FUNCTION_DEF(CallStack) } } - // rjf: build cell for module - UI_TableCell UI_FocusHot((row_selected && cs->cursor.x == 1) ? UI_FocusKind_On : UI_FocusKind_Off) - { - if(df_entity_is_nil(module)) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) - { - UI_Box *box = ui_build_box_from_stringf(UI_BoxFlag_DrawText|UI_BoxFlag_Clickable, "(No Module)###moduleless_frame_%I64x", frame_idx); - UI_Signal sig = ui_signal_from_box(box); - if(ui_pressed(sig)) - { - next_cursor = v2s64(1, (S64)frame_idx+1); - DF_CmdParams p = df_cmd_params_from_panel(ws, panel); - df_push_cmd__root(&p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_FocusPanel)); - } - } - else - { - df_entity_desc_button(ws, module, 0, str8_zero()); - } - } - // rjf: build cell for function header UI_TableCell UI_Font(df_font_from_slot(DF_FontSlot_Code)) - UI_FocusHot((row_selected && cs->cursor.x == 2) ? UI_FocusKind_On : UI_FocusKind_Off) + UI_FocusHot((row_selected && cs->cursor.x == 1) ? UI_FocusKind_On : UI_FocusKind_Off) { ui_set_next_child_layout_axis(Axis2_X); UI_Box *box = ui_build_box_from_stringf(UI_BoxFlag_Clickable|UI_BoxFlag_Clip, "frame_%I64x", frame_idx); @@ -5766,7 +5807,7 @@ DF_VIEW_UI_FUNCTION_DEF(CallStack) UI_Signal sig = ui_signal_from_box(box); if(ui_pressed(sig)) { - next_cursor = v2s64(2, (S64)frame_idx+1); + next_cursor = v2s64(1, (S64)frame_idx+1); DF_CmdParams p = df_cmd_params_from_panel(ws, panel); df_push_cmd__root(&p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_FocusPanel)); } @@ -5783,11 +5824,41 @@ DF_VIEW_UI_FUNCTION_DEF(CallStack) // rjf: build cell for rip UI_TableCell - UI_FocusHot((row_selected && cs->cursor.x == 3) ? UI_FocusKind_On : UI_FocusKind_Off) + UI_FocusHot((row_selected && cs->cursor.x == 2) ? UI_FocusKind_On : UI_FocusKind_Off) { UI_Box *box = ui_build_box_from_stringf(UI_BoxFlag_DrawText|UI_BoxFlag_Clickable, "0x%I64x", rip_vaddr); UI_Signal sig = ui_signal_from_box(box); if(ui_pressed(sig)) + { + next_cursor = v2s64(2, (S64)frame_idx+1); + DF_CmdParams p = df_cmd_params_from_panel(ws, panel); + df_push_cmd__root(&p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_FocusPanel)); + } + if(ui_double_clicked(sig) || sig.f&UI_SignalFlag_KeyboardPressed) + { + DF_CmdParams params = df_cmd_params_from_view(ws, panel, view); + df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_BaseUnwindIndex); + df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_InlineUnwindIndex); + params.base_unwind_index = frame->base_unwind_idx; + params.inline_unwind_index = frame->inline_unwind_idx; + df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_SelectUnwind)); + } + } + + // rjf: build cell for module + UI_TableCell UI_FocusHot((row_selected && cs->cursor.x == 3) ? UI_FocusKind_On : UI_FocusKind_Off) + { + UI_Signal sig = {0}; + if(df_entity_is_nil(module)) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) + { + UI_Box *box = ui_build_box_from_stringf(UI_BoxFlag_DrawText|UI_BoxFlag_Clickable, "(No Module)###moduleless_frame_%I64x", frame_idx); + sig = ui_signal_from_box(box); + } + else + { + sig = df_entity_desc_button(ws, module, 0, str8_zero(), 1); + } + if(ui_pressed(sig)) { next_cursor = v2s64(3, (S64)frame_idx+1); DF_CmdParams p = df_cmd_params_from_panel(ws, panel); @@ -6014,7 +6085,7 @@ DF_VIEW_UI_FUNCTION_DEF(Modules) { UI_TableCellSized(ui_pct(1, 0)) UI_FocusHot((row_is_selected) ? UI_FocusKind_On : UI_FocusKind_Off) { - df_entity_desc_button(ws, entity, &items.v[idx].matches, query); + df_entity_desc_button(ws, entity, &items.v[idx].matches, query, 0); } } idx_in_process = 0; @@ -6028,7 +6099,7 @@ DF_VIEW_UI_FUNCTION_DEF(Modules) } UI_TableCell UI_FocusHot((row_is_selected && cursor.x == 0) ? UI_FocusKind_On : UI_FocusKind_Off) { - df_entity_desc_button(ws, entity, &items.v[idx].matches, query); + df_entity_desc_button(ws, entity, &items.v[idx].matches, query, 1); } UI_TableCell UI_Font(df_font_from_slot(DF_FontSlot_Code)) UI_FocusHot((row_is_selected && cursor.x == 1) ? UI_FocusKind_On : UI_FocusKind_Off) { @@ -6432,7 +6503,7 @@ DF_VIEW_UI_FUNCTION_DEF(Code) // if(!entity_is_missing && key_has_data) { - df_code_view_build(ws, panel, view, cv, DF_CodeViewFlag_All, code_area_rect, data, &info, 0, r1u64(0, 0), di_key_zero()); + df_code_view_build(ws, panel, view, cv, DF_CodeViewBuildFlag_All, code_area_rect, data, &info, 0, r1u64(0, 0), di_key_zero()); } ////////////////////////////// @@ -6682,7 +6753,7 @@ DF_VIEW_UI_FUNCTION_DEF(Disassembly) // if(!is_loading && has_disasm) { - df_code_view_build(ws, panel, view, cv, DF_CodeViewFlag_All, code_area_rect, dasm_text_data, &dasm_text_info, &dasm_info.insts, dasm_vaddr_range, dasm_dbgi_key); + df_code_view_build(ws, panel, view, cv, DF_CodeViewBuildFlag_All, code_area_rect, dasm_text_data, &dasm_text_info, &dasm_info.insts, dasm_vaddr_range, dasm_dbgi_key); } ////////////////////////////// @@ -7951,7 +8022,7 @@ DF_VIEW_UI_FUNCTION_DEF(Breakpoints) } UI_TableCell UI_FocusHot((row_is_selected && cursor.x == 1) ? UI_FocusKind_On : UI_FocusKind_Off) { - df_entity_desc_button(ws, entity, &entities.v[idx-1].matches, query); + df_entity_desc_button(ws, entity, &entities.v[idx-1].matches, query, 1); } UI_TableCell UI_FocusHot((row_is_selected && cursor.x == 2) ? UI_FocusKind_On : UI_FocusKind_Off) { @@ -8117,7 +8188,7 @@ DF_VIEW_UI_FUNCTION_DEF(WatchPins) { UI_TableCell UI_FocusHot((row_is_selected && cursor.x == 0) ? UI_FocusKind_On : UI_FocusKind_Off) { - df_entity_desc_button(ws, entity, &entities.v[idx-1].matches, query); + df_entity_desc_button(ws, entity, &entities.v[idx-1].matches, query, 1); } UI_TableCell UI_FocusHot((row_is_selected && cursor.x == 1) ? UI_FocusKind_On : UI_FocusKind_Off) { diff --git a/src/df/gfx/df_views.h b/src/df/gfx/df_views.h index cc21af32..69f13aae 100644 --- a/src/df/gfx/df_views.h +++ b/src/df/gfx/df_views.h @@ -364,8 +364,14 @@ struct DF_WatchViewState typedef U32 DF_CodeViewFlags; enum { - DF_CodeViewFlag_Margins = (1<<0), - DF_CodeViewFlag_All = 0xffffffff, + 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; @@ -376,6 +382,7 @@ struct DF_CodeViewState 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; @@ -465,7 +472,7 @@ internal void df_entity_lister_item_array_sort_by_strength__in_place(DF_EntityLi 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_CodeViewFlags flags, Rng2F32 rect, 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 diff --git a/src/raddbg/raddbg.h b/src/raddbg/raddbg.h index 62209438..30597f35 100644 --- a/src/raddbg/raddbg.h +++ b/src/raddbg/raddbg.h @@ -35,10 +35,6 @@ // [ ] theme lister -> fonts & font sizes // [ ] "Browse..." buttons should adopt a more relevant starting search path, // if possible -// -// [x] highlighted text & ctrl+f -> auto-fill search query -// [ ] double click on procedure in procedures tab to jump to source -// [ ] double-click any part of frame in callstack view -> snap to function //////////////////////////////// //~ rjf: Frontend/UI Pass Tasks @@ -421,6 +417,9 @@ // 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 #ifndef RADDBG_H #define RADDBG_H From 4bbf64de7e80bb361f176bfb7c1bcf1f8bbf2d82 Mon Sep 17 00:00:00 2001 From: Ryan Fleury Date: Wed, 26 Jun 2024 15:00:45 -0700 Subject: [PATCH 41/47] first pass at new settings view --- src/df/core/df_core.mdesk | 2 +- src/df/core/generated/df_core.meta.c | 2 +- src/df/core/generated/df_core.meta.h | 2 +- src/df/gfx/df_gfx.c | 13 +- src/df/gfx/df_gfx.mdesk | 4 +- src/df/gfx/df_views.c | 460 ++++++++++++++++++++++++++- src/df/gfx/df_views.h | 46 +++ src/df/gfx/generated/df_gfx.meta.c | 4 +- src/df/gfx/generated/df_gfx.meta.h | 10 +- 9 files changed, 517 insertions(+), 26 deletions(-) diff --git a/src/df/core/df_core.mdesk b/src/df/core/df_core.mdesk index 28732b74..a062c6a0 100644 --- a/src/df/core/df_core.mdesk +++ b/src/df/core/df_core.mdesk @@ -396,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." "" } diff --git a/src/df/core/generated/df_core.meta.c b/src/df/core/generated/df_core.meta.c index 3fc0a521..7f6d400e 100644 --- a/src/df/core/generated/df_core.meta.c +++ b/src/df/core/generated/df_core.meta.c @@ -423,7 +423,7 @@ DF_CmdSpecInfo df_g_core_cmd_kind_spec_info_table[220] = { 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}, diff --git a/src/df/core/generated/df_core.meta.h b/src/df/core/generated/df_core.meta.h index 462a6852..c40cf0f1 100644 --- a/src/df/core/generated/df_core.meta.h +++ b/src/df/core/generated/df_core.meta.h @@ -259,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, diff --git a/src/df/gfx/df_gfx.c b/src/df/gfx/df_gfx.c index 77f68220..01708506 100644 --- a/src/df/gfx/df_gfx.c +++ b/src/df/gfx/df_gfx.c @@ -5064,7 +5064,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) DF_CoreCmdKind_Breakpoints, DF_CoreCmdKind_WatchPins, DF_CoreCmdKind_FilePathMap, - DF_CoreCmdKind_Theme, + DF_CoreCmdKind_Settings, DF_CoreCmdKind_ExceptionFilters, DF_CoreCmdKind_GettingStarted, }; @@ -7013,8 +7013,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) ui_spacer(ui_em(0.5f, 1.f)); UI_Font(view->spec->info.flags & DF_ViewSpecFlag_FilterIsCode ? df_font_from_slot(DF_FontSlot_Code) : df_font_from_slot(DF_FontSlot_Main)) UI_Focus(view->is_filtering ? UI_FocusKind_On : UI_FocusKind_Off) { - UI_Signal sig = df_line_edit(DF_LineEditFlag_Border| - DF_LineEditFlag_CodeContents*!!(view->spec->info.flags & DF_ViewSpecFlag_FilterIsCode), + UI_Signal sig = df_line_edit(DF_LineEditFlag_CodeContents*!!(view->spec->info.flags & DF_ViewSpecFlag_FilterIsCode), 0, 0, &view->query_cursor, @@ -7407,7 +7406,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) { D_FancyString query = { - df_font_from_slot(DF_FontSlot_Code), + view->spec->info.flags & DF_ViewSpecFlag_FilterIsCode ? df_font_from_slot(DF_FontSlot_Code) : df_font_from_slot(DF_FontSlot_Main), str8(view->query_buffer, view->query_string_size), ui_top_palette()->colors[UI_ColorCode_TextWeak], ui_top_font_size(), @@ -8196,7 +8195,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) { Vec4F32 color = df_rgba_from_theme_color(DF_ThemeColor_Focus); color.w *= b->focus_active_t; - R_Rect2DInst *inst = d_rect(pad_2f32(b->rect, 1.f), color, 0, 1.f, 1.f); + R_Rect2DInst *inst = d_rect(pad_2f32(b->rect, 0.f), color, 0, 1.f, 1.f); MemoryCopyArray(inst->corner_radii, b->corner_radii); } @@ -10989,7 +10988,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ ui_set_next_pref_height(ui_pct(1, 0)); ui_set_next_palette(ui_build_palette(ui_top_palette(), .text = color)); ui_set_next_text_alignment(UI_TextAlign_Center); - UI_Key thread_box_key = ui_key_from_stringf(top_container_box->key, "###ip_%p", thread); + UI_Key thread_box_key = ui_key_from_stringf(top_container_box->key, "###ip_%I64x_%p", line_num, thread); UI_Box *thread_box = ui_build_box_from_key(UI_BoxFlag_DisableTextTrunc| UI_BoxFlag_Clickable*!!(params->flags & DF_CodeSliceFlag_Clickable)| UI_BoxFlag_DrawText, @@ -11144,7 +11143,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ ui_set_next_pref_height(ui_pct(1, 0)); ui_set_next_palette(ui_build_palette(ui_top_palette(), .text = color)); ui_set_next_text_alignment(UI_TextAlign_Center); - UI_Key thread_box_key = ui_key_from_stringf(top_container_box->key, "###ip_%p", thread); + UI_Key thread_box_key = ui_key_from_stringf(top_container_box->key, "###ip_%I64x_catchall_%p", line_num, thread); UI_Box *thread_box = ui_build_box_from_key(UI_BoxFlag_DisableTextTrunc| UI_BoxFlag_Clickable*!!(params->flags & DF_CodeSliceFlag_Clickable)| UI_BoxFlag_DrawText, diff --git a/src/df/gfx/df_gfx.mdesk b/src/df/gfx/df_gfx.mdesk index 6c6814b5..e4c0f568 100644 --- a/src/df/gfx/df_gfx.mdesk +++ b/src/df/gfx/df_gfx.mdesk @@ -240,7 +240,7 @@ DF_GfxViewTable: { 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: @@ -630,7 +630,7 @@ DF_SettingTable: {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 0 32 } + {TabWidth tab_width "Tab Width" 4 1 32 } } @enum DF_SettingCode: diff --git a/src/df/gfx/df_views.c b/src/df/gfx/df_views.c index 8c36c7e8..0adf8139 100644 --- a/src/df/gfx/df_views.c +++ b/src/df/gfx/df_views.c @@ -153,6 +153,29 @@ df_qsort_compare_entity_lister__strength(DF_EntityListerItem *a, DF_EntityLister return result; } +internal int +df_qsort_compare_settings_item(DF_SettingsItem *a, DF_SettingsItem *b) +{ + int result = 0; + if(a->string_matches.count > b->string_matches.count) + { + result = -1; + } + else if(a->string_matches.count < b->string_matches.count) + { + result = +1; + } + else if(a->kind_string_matches.count > b->kind_string_matches.count) + { + result = -1; + } + else if(a->kind_string_matches.count < b->kind_string_matches.count) + { + result = +1; + } + return result; +} + //////////////////////////////// //~ rjf: Command Lister @@ -607,7 +630,7 @@ df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewSta { if(df_entity_from_handle(n->v.file) == file && visible_line_num_range.min <= n->v.pt.line && n->v.pt.line <= visible_line_num_range.max) { - U64 slice_line_idx = lines.first->v.pt.line-visible_line_num_range.min; + U64 slice_line_idx = n->v.pt.line-visible_line_num_range.min; df_entity_list_push(scratch.arena, &code_slice_params.line_ips[slice_line_idx], thread); } } @@ -8379,12 +8402,12 @@ DF_VIEW_UI_FUNCTION_DEF(ExceptionFilters) } //////////////////////////////// -//~ rjf: Theme @view_hook_impl +//~ rjf: Settings @view_hook_impl -DF_VIEW_SETUP_FUNCTION_DEF(Theme) {} -DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(Theme) {return str8_lit("");} +DF_VIEW_SETUP_FUNCTION_DEF(Settings) {} +DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(Settings) {return str8_zero();} -DF_VIEW_CMD_FUNCTION_DEF(Theme) +DF_VIEW_CMD_FUNCTION_DEF(Settings) { for(DF_CmdNode *n = cmds->first; n != 0; n = n->next) { @@ -8397,7 +8420,7 @@ DF_VIEW_CMD_FUNCTION_DEF(Theme) continue; } - //rjf: process + // rjf: process DF_CoreCmdKind core_cmd_kind = df_core_cmd_kind_from_string(cmd->spec->info.string); switch(core_cmd_kind) { @@ -8445,11 +8468,433 @@ DF_VIEW_CMD_FUNCTION_DEF(Theme) } } -DF_VIEW_UI_FUNCTION_DEF(Theme) +DF_VIEW_UI_FUNCTION_DEF(Settings) { ProfBeginFunction(); Temp scratch = scratch_begin(0, 0); F32 row_height_px = floor_f32(ui_top_font_size()*2.5f); + String8 query = str8(view->query_buffer, view->query_string_size); + + ////////////////////////////// + //- rjf: get state + // + typedef struct DF_SettingsViewState DF_SettingsViewState; + struct DF_SettingsViewState + { + Vec2S64 cursor; + TxtPt txt_cursor; + TxtPt txt_mark; + U8 txt_buffer[1024]; + U64 txt_size; + DF_ThemeColor color_ctx_menu_color; + Vec4F32 color_ctx_menu_color_hsva; + }; + DF_SettingsViewState *sv = df_view_user_state(view, DF_SettingsViewState); + + ////////////////////////////// + //- rjf: gather all filtered settings items + // + DF_SettingsItemArray items = {0}; + { + DF_SettingsItemList items_list = {0}; + + //- rjf: gather all settings + for(EachEnumVal(DF_SettingCode, code)) + { + String8 kind_string = str8_lit("Interface"); + String8 string = df_g_setting_code_display_string_table[code]; + FuzzyMatchRangeList kind_string_matches = fuzzy_match_find(scratch.arena, query, kind_string); + FuzzyMatchRangeList string_matches = fuzzy_match_find(scratch.arena, query, string); + if(string_matches.count == string_matches.needle_part_count || + kind_string_matches.count == kind_string_matches.needle_part_count) + { + DF_SettingsItemNode *n = push_array(scratch.arena, DF_SettingsItemNode, 1); + SLLQueuePush(items_list.first, items_list.last, n); + items_list.count += 1; + n->v.kind = DF_SettingsItemKind_Setting; + n->v.kind_string = kind_string; + n->v.string = string; + n->v.kind_string_matches = kind_string_matches; + n->v.string_matches = string_matches; + n->v.icon_kind = DF_IconKind_Window; + n->v.code = code; + } + } + + //- rjf: gather all theme colors + for(EachNonZeroEnumVal(DF_ThemeColor, color)) + { + String8 kind_string = str8_lit("Theme Color"); + String8 string = df_g_theme_color_display_string_table[color]; + FuzzyMatchRangeList kind_string_matches = fuzzy_match_find(scratch.arena, query, kind_string); + FuzzyMatchRangeList string_matches = fuzzy_match_find(scratch.arena, query, string); + if(string_matches.count == string_matches.needle_part_count || + kind_string_matches.count == kind_string_matches.needle_part_count) + { + DF_SettingsItemNode *n = push_array(scratch.arena, DF_SettingsItemNode, 1); + SLLQueuePush(items_list.first, items_list.last, n); + items_list.count += 1; + n->v.kind = DF_SettingsItemKind_ThemeColor; + n->v.kind_string = kind_string; + n->v.string = string; + n->v.kind_string_matches = kind_string_matches; + n->v.string_matches = string_matches; + n->v.icon_kind = DF_IconKind_Palette; + n->v.color = color; + } + } + + //- rjf: convert to array + items.count = items_list.count; + items.v = push_array(scratch.arena, DF_SettingsItem, items.count); + { + U64 idx = 0; + for(DF_SettingsItemNode *n = items_list.first; n != 0; n = n->next, idx += 1) + { + items.v[idx] = n->v; + } + } + } + + ////////////////////////////// + //- rjf: sort filtered settings item list + // + if(query.size != 0) + { + quick_sort(items.v, items.count, sizeof(items.v[0]), df_qsort_compare_settings_item); + } + + ////////////////////////////// + //- rjf: produce per-color context menu keys + // + UI_Key *color_ctx_menu_keys = push_array(scratch.arena, UI_Key, DF_ThemeColor_COUNT); + { + for(DF_ThemeColor color = (DF_ThemeColor)(DF_ThemeColor_Null+1); + color < DF_ThemeColor_COUNT; + color = (DF_ThemeColor)(color+1)) + { + color_ctx_menu_keys[color] = ui_key_from_stringf(ui_key_zero(), "###settings_color_ctx_menu_%I64x", (U64)color); + } + } + + ////////////////////////////// + //- rjf: build color context menus + // + for(DF_ThemeColor color = (DF_ThemeColor)(DF_ThemeColor_Null+1); + color < DF_ThemeColor_COUNT; + color = (DF_ThemeColor)(color+1)) + { + DF_Palette(DF_PaletteCode_Floating) + UI_CtxMenu(color_ctx_menu_keys[color]) + UI_Padding(ui_em(1.5f, 1.f)) + UI_PrefWidth(ui_em(28.5f, 1)) UI_PrefHeight(ui_children_sum(1.f)) + { + // rjf: build title + UI_Row + { + ui_spacer(ui_em(1.5f, 1.f)); + UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_label(df_g_theme_color_display_string_table[color]); + } + + ui_spacer(ui_em(1.5f, 1.f)); + + // rjf: build picker + { + ui_set_next_pref_height(ui_em(22.f, 1.f)); + UI_Row UI_Padding(ui_pct(1, 0)) + { + UI_PrefWidth(ui_em(22.f, 1.f)) UI_PrefHeight(ui_em(22.f, 1.f)) UI_Flags(UI_BoxFlag_FocusNavSkip) + { + ui_sat_val_pickerf(sv->color_ctx_menu_color_hsva.x, &sv->color_ctx_menu_color_hsva.y, &sv->color_ctx_menu_color_hsva.z, "###settings_satval_picker"); + } + + ui_spacer(ui_em(0.75f, 1.f)); + + UI_PrefWidth(ui_em(1.5f, 1.f)) UI_PrefHeight(ui_em(22.f, 1.f)) UI_Flags(UI_BoxFlag_FocusNavSkip) + ui_hue_pickerf(&sv->color_ctx_menu_color_hsva.x, sv->color_ctx_menu_color_hsva.y, sv->color_ctx_menu_color_hsva.z, "###settings_hue_picker"); + + UI_PrefWidth(ui_em(1.5f, 1.f)) UI_PrefHeight(ui_em(22.f, 1.f)) UI_Flags(UI_BoxFlag_FocusNavSkip) + ui_alpha_pickerf(&sv->color_ctx_menu_color_hsva.w, "###settings_alpha_picker"); + } + } + + ui_spacer(ui_em(1.5f, 1.f)); + + // rjf: build line edits + UI_Row + UI_WidthFill + UI_Padding(ui_em(1.5f, 1.f)) + UI_PrefHeight(ui_children_sum(1.f)) + UI_Column + UI_PrefHeight(ui_em(2.25f, 1.f)) + { + Vec4F32 hsva = sv->color_ctx_menu_color_hsva; + Vec3F32 hsv = v3f32(hsva.x, hsva.y, hsva.z); + Vec3F32 rgb = rgb_from_hsv(hsv); + Vec4F32 rgba = v4f32(rgb.x, rgb.y, rgb.z, sv->color_ctx_menu_color_hsva.w); + String8 hex_string = hex_string_from_rgba_4f32(scratch.arena, rgba); + hex_string = push_str8f(scratch.arena, "#%S", hex_string); + String8 r_string = push_str8f(scratch.arena, "%.2f", rgba.x); + String8 g_string = push_str8f(scratch.arena, "%.2f", rgba.y); + String8 b_string = push_str8f(scratch.arena, "%.2f", rgba.z); + String8 h_string = push_str8f(scratch.arena, "%.2f", hsva.x); + String8 s_string = push_str8f(scratch.arena, "%.2f", hsva.y); + String8 v_string = push_str8f(scratch.arena, "%.2f", hsva.z); + String8 a_string = push_str8f(scratch.arena, "%.2f", rgba.w); + UI_Row UI_Font(df_font_from_slot(DF_FontSlot_Code)) + { + UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_PrefWidth(ui_em(4.5f, 1.f)) ui_labelf("Hex"); + UI_Signal sig = df_line_editf(DF_LineEditFlag_Border, 0, 0, &sv->txt_cursor, &sv->txt_mark, sv->txt_buffer, sizeof(sv->txt_buffer), &sv->txt_size, 0, hex_string, "###hex_edit"); + if(ui_committed(sig)) + { + String8 string = str8(sv->txt_buffer, sv->txt_size); + Vec4F32 new_rgba = rgba_from_hex_string_4f32(string); + Vec4F32 new_hsva = hsva_from_rgba(new_rgba); + sv->color_ctx_menu_color_hsva = new_hsva; + } + } + ui_spacer(ui_em(0.75f, 1.f)); + UI_Row + { + UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_PrefWidth(ui_em(4.5f, 1.f)) ui_labelf("R"); + UI_Signal sig = df_line_editf(DF_LineEditFlag_Border, 0, 0, &sv->txt_cursor, &sv->txt_mark, sv->txt_buffer, sizeof(sv->txt_buffer), &sv->txt_size, 0, r_string, "###r_edit"); + if(ui_committed(sig)) + { + String8 string = str8(sv->txt_buffer, sv->txt_size); + Vec4F32 new_rgba = v4f32((F32)f64_from_str8(string), rgba.y, rgba.z, rgba.w); + Vec4F32 new_hsva = hsva_from_rgba(new_rgba); + sv->color_ctx_menu_color_hsva = new_hsva; + } + } + UI_Row + { + UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_PrefWidth(ui_em(4.5f, 1.f)) ui_labelf("G"); + UI_Signal sig = df_line_editf(DF_LineEditFlag_Border, 0, 0, &sv->txt_cursor, &sv->txt_mark, sv->txt_buffer, sizeof(sv->txt_buffer), &sv->txt_size, 0, g_string, "###g_edit"); + if(ui_committed(sig)) + { + String8 string = str8(sv->txt_buffer, sv->txt_size); + Vec4F32 new_rgba = v4f32(rgba.x, (F32)f64_from_str8(string), rgba.z, rgba.w); + Vec4F32 new_hsva = hsva_from_rgba(new_rgba); + sv->color_ctx_menu_color_hsva = new_hsva; + } + } + UI_Row + { + UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_PrefWidth(ui_em(4.5f, 1.f)) ui_labelf("B"); + UI_Signal sig = df_line_editf(DF_LineEditFlag_Border, 0, 0, &sv->txt_cursor, &sv->txt_mark, sv->txt_buffer, sizeof(sv->txt_buffer), &sv->txt_size, 0, b_string, "###b_edit"); + if(ui_committed(sig)) + { + String8 string = str8(sv->txt_buffer, sv->txt_size); + Vec4F32 new_rgba = v4f32(rgba.x, rgba.y, (F32)f64_from_str8(string), rgba.w); + Vec4F32 new_hsva = hsva_from_rgba(new_rgba); + sv->color_ctx_menu_color_hsva = new_hsva; + } + } + ui_spacer(ui_em(0.75f, 1.f)); + UI_Row + { + UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_PrefWidth(ui_em(4.5f, 1.f)) ui_labelf("H"); + UI_Signal sig = df_line_editf(DF_LineEditFlag_Border, 0, 0, &sv->txt_cursor, &sv->txt_mark, sv->txt_buffer, sizeof(sv->txt_buffer), &sv->txt_size, 0, h_string, "###h_edit"); + if(ui_committed(sig)) + { + String8 string = str8(sv->txt_buffer, sv->txt_size); + Vec4F32 new_hsva = v4f32((F32)f64_from_str8(string), hsva.y, hsva.z, hsva.w); + sv->color_ctx_menu_color_hsva = new_hsva; + } + } + UI_Row + { + UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_PrefWidth(ui_em(4.5f, 1.f)) ui_labelf("S"); + UI_Signal sig = df_line_editf(DF_LineEditFlag_Border, 0, 0, &sv->txt_cursor, &sv->txt_mark, sv->txt_buffer, sizeof(sv->txt_buffer), &sv->txt_size, 0, s_string, "###s_edit"); + if(ui_committed(sig)) + { + String8 string = str8(sv->txt_buffer, sv->txt_size); + Vec4F32 new_hsva = v4f32(hsva.x, (F32)f64_from_str8(string), hsva.z, hsva.w); + sv->color_ctx_menu_color_hsva = new_hsva; + } + } + UI_Row + { + UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_PrefWidth(ui_em(4.5f, 1.f)) ui_labelf("V"); + UI_Signal sig = df_line_editf(DF_LineEditFlag_Border, 0, 0, &sv->txt_cursor, &sv->txt_mark, sv->txt_buffer, sizeof(sv->txt_buffer), &sv->txt_size, 0, v_string, "###v_edit"); + if(ui_committed(sig)) + { + String8 string = str8(sv->txt_buffer, sv->txt_size); + Vec4F32 new_hsva = v4f32(hsva.x, hsva.y, (F32)f64_from_str8(string), hsva.w); + sv->color_ctx_menu_color_hsva = new_hsva; + } + } + ui_spacer(ui_em(0.75f, 1.f)); + UI_Row + { + UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_PrefWidth(ui_em(4.5f, 1.f)) ui_labelf("A"); + UI_Signal sig = df_line_editf(DF_LineEditFlag_Border, 0, 0, &sv->txt_cursor, &sv->txt_mark, sv->txt_buffer, sizeof(sv->txt_buffer), &sv->txt_size, 0, a_string, "###a_edit"); + if(ui_committed(sig)) + { + String8 string = str8(sv->txt_buffer, sv->txt_size); + Vec4F32 new_hsva = v4f32(hsva.x, hsva.y, hsva.z, (F32)f64_from_str8(string)); + sv->color_ctx_menu_color_hsva = new_hsva; + } + } + } + + // rjf: commit state to theme + Vec4F32 hsva = sv->color_ctx_menu_color_hsva; + Vec3F32 hsv = v3f32(hsva.x, hsva.y, hsva.z); + Vec3F32 rgb = rgb_from_hsv(hsv); + Vec4F32 rgba = v4f32(rgb.x, rgb.y, rgb.z, sv->color_ctx_menu_color_hsva.w); + df_gfx_state->cfg_theme_target.colors[sv->color_ctx_menu_color] = rgba; + } + } + + ////////////////////////////// + //- rjf: build items list + // + Rng1S64 visible_row_range = {0}; + UI_ScrollListParams scroll_list_params = {0}; + { + Vec2F32 rect_dim = dim_2f32(rect); + scroll_list_params.flags = UI_ScrollListFlag_All; + scroll_list_params.row_height_px = row_height_px; + scroll_list_params.dim_px = v2f32(rect_dim.x, rect_dim.y); + scroll_list_params.cursor_range = r2s64(v2s64(0, 0), v2s64(0, items.count)); + scroll_list_params.item_range = r1s64(0, items.count); + scroll_list_params.cursor_min_is_empty_selection[Axis2_Y] = 1; + } + UI_ScrollListSignal scroll_list_sig = {0}; + UI_Focus(UI_FocusKind_On) + UI_ScrollList(&scroll_list_params, &view->scroll_pos.y, &sv->cursor, 0, &visible_row_range, &scroll_list_sig) + UI_Focus(UI_FocusKind_Null) + { + for(S64 row_num = visible_row_range.min; row_num <= visible_row_range.max && row_num < items.count; row_num += 1) + { + //- rjf: unpack item + DF_SettingsItem *item = &items.v[row_num]; + Vec4F32 rgba = ui_top_palette()->text_weak; + OS_Cursor cursor = OS_Cursor_HandPoint; + Rng1S32 s32_range = {0}; + B32 is_toggler = 0; + B32 is_toggled = 0; + B32 is_slider = 0; + S32 slider_s32_val = 0; + F32 slider_pct = 0.f; + switch(item->kind) + { + case DF_SettingsItemKind_ThemeColor: + { + rgba = df_rgba_from_theme_color(item->color); + }break; + case DF_SettingsItemKind_Setting: + { + s32_range = df_g_setting_code_s32_range_table[item->code]; + if(s32_range.min != 0 || s32_range.max != 1) + { + cursor = OS_Cursor_LeftRight; + is_slider = 1; + slider_s32_val = df_setting_val_from_code(item->code).s32; + slider_pct = (F32)(slider_s32_val - s32_range.min) / dim_1s32(s32_range); + } + else + { + is_toggler = 1; + is_toggled = !!df_setting_val_from_code(item->code).s32; + } + }break; + } + + //- rjf: build item widget + UI_Box *item_box = &ui_g_nil_box; + UI_Focus(row_num+1 == sv->cursor.y ? UI_FocusKind_On : UI_FocusKind_Off) + { + ui_set_next_hover_cursor(cursor); + item_box = ui_build_box_from_stringf(UI_BoxFlag_Clickable| + UI_BoxFlag_DrawBackground| + UI_BoxFlag_DrawBorder| + UI_BoxFlag_DrawHotEffects| + UI_BoxFlag_DrawActiveEffects, + "###option_%S", item->string); + UI_Parent(item_box) + { + ui_spacer(ui_em(1.f, 1.f)); + UI_PrefWidth(ui_em(2.5f, 1.f)) + UI_Font(df_font_from_slot(DF_FontSlot_Icons)) + UI_RunFlags(F_RunFlag_Smooth) + UI_Palette(ui_build_palette(ui_top_palette(), .text = rgba)) + ui_label(df_g_icon_kind_text_table[item->icon_kind]); + UI_PrefWidth(ui_text_dim(10, 1)) + { + UI_Box *box = ui_build_box_from_stringf(UI_BoxFlag_DrawText|UI_BoxFlag_DrawTextWeak, "%S", item->kind_string); + ui_box_equip_fuzzy_match_ranges(box, &item->kind_string_matches); + } + UI_PrefWidth(ui_text_dim(10, 1)) + { + UI_Box *box = ui_build_box_from_stringf(UI_BoxFlag_DrawText, "%S", item->string); + ui_box_equip_fuzzy_match_ranges(box, &item->string_matches); + } + if(is_slider) UI_PrefWidth(ui_text_dim(10, 1)) + { + UI_Font(df_font_from_slot(DF_FontSlot_Code)) + UI_RunFlags(F_RunFlag_Smooth) + UI_Flags(UI_BoxFlag_DrawTextWeak) + ui_labelf("(%i)", slider_s32_val); + UI_PrefWidth(ui_pct(slider_pct, 1.f)) UI_HeightFill UI_FixedX(0) UI_FixedY(0) + UI_Palette(ui_build_palette(ui_top_palette(), .background = df_rgba_from_theme_color(DF_ThemeColor_HighlightOverlay))) + ui_build_box_from_key(UI_BoxFlag_DrawBackground, ui_key_zero()); + } + if(is_toggler) + { + ui_spacer(ui_pct(1, 0)); + UI_PrefWidth(ui_em(2.5f, 1.f)) + UI_Font(df_font_from_slot(DF_FontSlot_Icons)) + UI_RunFlags(F_RunFlag_Smooth) + UI_Flags(UI_BoxFlag_DrawTextWeak) + ui_label(df_g_icon_kind_text_table[is_toggled ? DF_IconKind_CheckFilled : DF_IconKind_CheckHollow]); + } + } + } + + //- rjf: interact + UI_Signal sig = ui_signal_from_box(item_box); + if(item->kind == DF_SettingsItemKind_ThemeColor && ui_clicked(sig)) + { + Vec3F32 rgb = v3f32(rgba.x, rgba.y, rgba.z); + Vec3F32 hsv = hsv_from_rgb(rgb); + Vec4F32 hsva = v4f32(hsv.x, hsv.y, hsv.z, rgba.w); + ui_ctx_menu_open(color_ctx_menu_keys[item->color], item_box->key, v2f32(0, dim_2f32(item_box->rect).y)); + sv->color_ctx_menu_color = item->color; + sv->color_ctx_menu_color_hsva = v4f32(hsv.x, hsv.y, hsv.z, rgba.w); + DF_CmdParams p = df_cmd_params_from_panel(ws, panel); + df_push_cmd__root(&p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_FocusPanel)); + } + if(item->kind == DF_SettingsItemKind_Setting && is_toggler && ui_clicked(sig)) + { + df_gfx_state->cfg_setting_vals[DF_CfgSrc_User][item->code].s32 ^= 1; + df_gfx_state->cfg_setting_vals[DF_CfgSrc_User][item->code].set = 1; + } + if(item->kind == DF_SettingsItemKind_Setting && is_slider && ui_dragging(sig)) + { + if(ui_pressed(sig)) + { + ui_store_drag_struct(&slider_s32_val); + } + S32 pre_drag_val = *ui_get_drag_struct(S32); + Vec2F32 delta = ui_drag_delta(); + S32 pst_drag_val = pre_drag_val + (S32)(delta.x/(ui_top_font_size()*2.f)); + pst_drag_val = clamp_1s32(s32_range, pst_drag_val); + df_gfx_state->cfg_setting_vals[DF_CfgSrc_User][item->code].s32 = pst_drag_val; + df_gfx_state->cfg_setting_vals[DF_CfgSrc_User][item->code].set = 1; + } + } + } + + scratch_end(scratch); + ProfEnd(); + + //~ TODO(rjf): OLD vvvvvvvvvvvvvvvvvvvvvvvvvv +#if 0 + ProfBeginFunction(); + Temp scratch = scratch_begin(0, 0); + F32 row_height_px = floor_f32(ui_top_font_size()*2.5f); //- rjf: get state typedef struct DF_ThemeViewState DF_ThemeViewState; @@ -8775,4 +9220,5 @@ DF_VIEW_UI_FUNCTION_DEF(Theme) scratch_end(scratch); ProfEnd(); +#endif } diff --git a/src/df/gfx/df_views.h b/src/df/gfx/df_views.h index 69f13aae..38db46d6 100644 --- a/src/df/gfx/df_views.h +++ b/src/df/gfx/df_views.h @@ -434,6 +434,51 @@ struct DF_MemoryViewState B32 contain_cursor; }; +//////////////////////////////// +//~ rjf: Settings @view_types + +typedef enum DF_SettingsItemKind +{ + DF_SettingsItemKind_Setting, + DF_SettingsItemKind_ThemeColor, +} +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; +}; + +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 +490,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 diff --git a/src/df/gfx/generated/df_gfx.meta.c b/src/df/gfx/generated/df_gfx.meta.c index de598c95..306ec7bc 100644 --- a/src/df/gfx/generated/df_gfx.meta.c +++ b/src/df/gfx/generated/df_gfx.meta.c @@ -163,7 +163,7 @@ DF_ViewSpecInfo df_g_gfx_view_kind_spec_info_table[31] = {(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_ProjectSpecific|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|1*DF_ViewSpecFlag_CanFilter|0*DF_ViewSpecFlag_FilterIsCode|1*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("breakpoints"), str8_lit_comp("Breakpoints"), DF_NameKind_Null, DF_IconKind_CircleFilled, DF_VIEW_SETUP_FUNCTION_NAME(Breakpoints), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(Breakpoints), DF_VIEW_CMD_FUNCTION_NAME(Breakpoints), DF_VIEW_UI_FUNCTION_NAME(Breakpoints)}, {(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_ProjectSpecific|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|1*DF_ViewSpecFlag_CanFilter|1*DF_ViewSpecFlag_FilterIsCode|1*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("watch_pins"), str8_lit_comp("Watch Pins"), DF_NameKind_Null, DF_IconKind_Pin, DF_VIEW_SETUP_FUNCTION_NAME(WatchPins), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(WatchPins), DF_VIEW_CMD_FUNCTION_NAME(WatchPins), DF_VIEW_UI_FUNCTION_NAME(WatchPins)}, {(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_ProjectSpecific|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|1*DF_ViewSpecFlag_CanFilter|0*DF_ViewSpecFlag_FilterIsCode|1*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("exception_filters"), str8_lit_comp("Exception Filters"), DF_NameKind_Null, DF_IconKind_Gear, DF_VIEW_SETUP_FUNCTION_NAME(ExceptionFilters), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(ExceptionFilters), DF_VIEW_CMD_FUNCTION_NAME(ExceptionFilters), DF_VIEW_UI_FUNCTION_NAME(ExceptionFilters)}, -{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_ProjectSpecific|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|0*DF_ViewSpecFlag_CanFilter|0*DF_ViewSpecFlag_FilterIsCode|0*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("theme"), str8_lit_comp("Theme"), DF_NameKind_Null, DF_IconKind_Palette, DF_VIEW_SETUP_FUNCTION_NAME(Theme), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(Theme), DF_VIEW_CMD_FUNCTION_NAME(Theme), DF_VIEW_UI_FUNCTION_NAME(Theme)}, +{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_ProjectSpecific|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|1*DF_ViewSpecFlag_CanFilter|0*DF_ViewSpecFlag_FilterIsCode|1*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("settings"), str8_lit_comp("Settings"), DF_NameKind_Null, DF_IconKind_Gear, DF_VIEW_SETUP_FUNCTION_NAME(Settings), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(Settings), DF_VIEW_CMD_FUNCTION_NAME(Settings), DF_VIEW_UI_FUNCTION_NAME(Settings)}, }; DF_CmdParamSlot df_g_cmd_param_slot_2_view_spec_src_map[7] = @@ -1266,7 +1266,7 @@ Rng1S32 df_g_setting_code_s32_range_table[13] = {0, 1}, {0, 1}, {0, 1}, -{0, 32}, +{1, 32}, }; C_LINKAGE_END diff --git a/src/df/gfx/generated/df_gfx.meta.h b/src/df/gfx/generated/df_gfx.meta.h index e9b4dd89..592a8b9d 100644 --- a/src/df/gfx/generated/df_gfx.meta.h +++ b/src/df/gfx/generated/df_gfx.meta.h @@ -38,7 +38,7 @@ DF_GfxViewKind_Memory, DF_GfxViewKind_Breakpoints, DF_GfxViewKind_WatchPins, DF_GfxViewKind_ExceptionFilters, -DF_GfxViewKind_Theme, +DF_GfxViewKind_Settings, DF_GfxViewKind_COUNT, } DF_GfxViewKind; @@ -184,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); @@ -215,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); @@ -246,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); @@ -277,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); From 7584890edd1cce47f2060a0a752270caff2b10e8 Mon Sep 17 00:00:00 2001 From: Ryan Fleury Date: Wed, 26 Jun 2024 15:16:41 -0700 Subject: [PATCH 42/47] theme presets in new settings view --- src/df/gfx/df_views.c | 80 ++++++++++++++++++++++++++++++++++++++++++- src/df/gfx/df_views.h | 2 ++ 2 files changed, 81 insertions(+), 1 deletion(-) diff --git a/src/df/gfx/df_views.c b/src/df/gfx/df_views.c index 0adf8139..5dff3213 100644 --- a/src/df/gfx/df_views.c +++ b/src/df/gfx/df_views.c @@ -8481,6 +8481,7 @@ DF_VIEW_UI_FUNCTION_DEF(Settings) typedef struct DF_SettingsViewState DF_SettingsViewState; struct DF_SettingsViewState { + B32 initialized; Vec2S64 cursor; TxtPt txt_cursor; TxtPt txt_mark; @@ -8488,8 +8489,14 @@ DF_VIEW_UI_FUNCTION_DEF(Settings) U64 txt_size; DF_ThemeColor color_ctx_menu_color; Vec4F32 color_ctx_menu_color_hsva; + DF_ThemePreset preset_apply_confirm; }; DF_SettingsViewState *sv = df_view_user_state(view, DF_SettingsViewState); + if(!sv->initialized) + { + sv->initialized = 1; + sv->preset_apply_confirm = DF_ThemePreset_COUNT; + } ////////////////////////////// //- rjf: gather all filtered settings items @@ -8521,6 +8528,29 @@ DF_VIEW_UI_FUNCTION_DEF(Settings) } } + //- rjf: gather theme presets + for(EachEnumVal(DF_ThemePreset, preset)) + { + String8 kind_string = str8_lit("Theme Preset"); + String8 string = df_g_theme_preset_display_string_table[preset]; + FuzzyMatchRangeList kind_string_matches = fuzzy_match_find(scratch.arena, query, kind_string); + FuzzyMatchRangeList string_matches = fuzzy_match_find(scratch.arena, query, string); + if(string_matches.count == string_matches.needle_part_count || + kind_string_matches.count == kind_string_matches.needle_part_count) + { + DF_SettingsItemNode *n = push_array(scratch.arena, DF_SettingsItemNode, 1); + SLLQueuePush(items_list.first, items_list.last, n); + items_list.count += 1; + n->v.kind = DF_SettingsItemKind_ThemePreset; + n->v.kind_string = kind_string; + n->v.string = string; + n->v.kind_string_matches = kind_string_matches; + n->v.string_matches = string_matches; + n->v.icon_kind = DF_IconKind_Palette; + n->v.preset = preset; + } + } + //- rjf: gather all theme colors for(EachNonZeroEnumVal(DF_ThemeColor, color)) { @@ -8747,6 +8777,14 @@ DF_VIEW_UI_FUNCTION_DEF(Settings) } } + ////////////////////////////// + //- rjf: cancels + // + UI_Focus(UI_FocusKind_On) if(ui_is_focus_active() && sv->preset_apply_confirm < DF_ThemePreset_COUNT && ui_slot_press(UI_EventActionSlot_Cancel)) + { + sv->preset_apply_confirm = DF_ThemePreset_COUNT; + } + ////////////////////////////// //- rjf: build items list // @@ -8770,6 +8808,7 @@ DF_VIEW_UI_FUNCTION_DEF(Settings) { //- rjf: unpack item DF_SettingsItem *item = &items.v[row_num]; + UI_Palette *palette = ui_top_palette(); Vec4F32 rgba = ui_top_palette()->text_weak; OS_Cursor cursor = OS_Cursor_HandPoint; Rng1S32 s32_range = {0}; @@ -8780,6 +8819,19 @@ DF_VIEW_UI_FUNCTION_DEF(Settings) F32 slider_pct = 0.f; switch(item->kind) { + case DF_SettingsItemKind_ThemePreset: + { + Vec4F32 *colors = df_g_theme_preset_colors_table[item->preset]; + Vec4F32 bg_color = colors[DF_ThemeColor_BaseBackground]; + Vec4F32 tx_color = colors[DF_ThemeColor_Text]; + Vec4F32 tw_color = colors[DF_ThemeColor_TextWeak]; + Vec4F32 bd_color = colors[DF_ThemeColor_BaseBorder]; + palette = ui_build_palette(ui_top_palette(), + .text = tx_color, + .text_weak = tw_color, + .border = bd_color, + .background = bg_color); + }break; case DF_SettingsItemKind_ThemeColor: { rgba = df_rgba_from_theme_color(item->color); @@ -8804,7 +8856,7 @@ DF_VIEW_UI_FUNCTION_DEF(Settings) //- rjf: build item widget UI_Box *item_box = &ui_g_nil_box; - UI_Focus(row_num+1 == sv->cursor.y ? UI_FocusKind_On : UI_FocusKind_Off) + UI_Focus(row_num+1 == sv->cursor.y ? UI_FocusKind_On : UI_FocusKind_Off) UI_Palette(palette) { ui_set_next_hover_cursor(cursor); item_box = ui_build_box_from_stringf(UI_BoxFlag_Clickable| @@ -8850,6 +8902,15 @@ DF_VIEW_UI_FUNCTION_DEF(Settings) UI_Flags(UI_BoxFlag_DrawTextWeak) ui_label(df_g_icon_kind_text_table[is_toggled ? DF_IconKind_CheckFilled : DF_IconKind_CheckHollow]); } + if(item->kind == DF_SettingsItemKind_ThemePreset && sv->preset_apply_confirm == item->preset) + { + ui_spacer(ui_pct(1, 0)); + UI_PrefWidth(ui_text_dim(10, 1)) + DF_Palette(DF_PaletteCode_NegativePopButton) + UI_CornerRadius(ui_top_font_size()*0.5f) + UI_FontSize(ui_top_font_size()*0.9f) + ui_build_box_from_stringf(UI_BoxFlag_DrawText|UI_BoxFlag_DrawBackground, "Click Again To Apply"); + } } } @@ -8884,6 +8945,23 @@ DF_VIEW_UI_FUNCTION_DEF(Settings) df_gfx_state->cfg_setting_vals[DF_CfgSrc_User][item->code].s32 = pst_drag_val; df_gfx_state->cfg_setting_vals[DF_CfgSrc_User][item->code].set = 1; } + if(item->kind == DF_SettingsItemKind_ThemePreset && ui_clicked(sig)) + { + if(sv->preset_apply_confirm == item->preset) + { + Vec4F32 *colors = df_g_theme_preset_colors_table[item->preset]; + MemoryCopy(df_gfx_state->cfg_theme_target.colors, colors, sizeof(df_gfx_state->cfg_theme_target.colors)); + sv->preset_apply_confirm = DF_ThemePreset_COUNT; + } + else + { + sv->preset_apply_confirm = item->preset; + } + } + if(item->kind != DF_SettingsItemKind_ThemePreset && ui_pressed(sig)) + { + sv->preset_apply_confirm = DF_ThemePreset_COUNT; + } } } diff --git a/src/df/gfx/df_views.h b/src/df/gfx/df_views.h index 38db46d6..cad2347c 100644 --- a/src/df/gfx/df_views.h +++ b/src/df/gfx/df_views.h @@ -441,6 +441,7 @@ typedef enum DF_SettingsItemKind { DF_SettingsItemKind_Setting, DF_SettingsItemKind_ThemeColor, + DF_SettingsItemKind_ThemePreset, } DF_SettingsItemKind; @@ -455,6 +456,7 @@ struct DF_SettingsItem DF_IconKind icon_kind; DF_SettingCode code; DF_ThemeColor color; + DF_ThemePreset preset; }; typedef struct DF_SettingsItemNode DF_SettingsItemNode; From 5e2c6b510797a03b11c752516954aa5747b433d6 Mon Sep 17 00:00:00 2001 From: Ryan Fleury Date: Wed, 26 Jun 2024 15:47:28 -0700 Subject: [PATCH 43/47] setting view categories --- src/df/gfx/df_views.c | 272 ++++++++++++++++++++++++++---------------- src/df/gfx/df_views.h | 3 + src/raddbg/raddbg.h | 18 +-- 3 files changed, 181 insertions(+), 112 deletions(-) diff --git a/src/df/gfx/df_views.c b/src/df/gfx/df_views.c index 5dff3213..1071476a 100644 --- a/src/df/gfx/df_views.c +++ b/src/df/gfx/df_views.c @@ -8490,6 +8490,7 @@ DF_VIEW_UI_FUNCTION_DEF(Settings) DF_ThemeColor color_ctx_menu_color; Vec4F32 color_ctx_menu_color_hsva; DF_ThemePreset preset_apply_confirm; + B32 category_collapsed[DF_SettingsItemKind_COUNT]; }; DF_SettingsViewState *sv = df_view_user_state(view, DF_SettingsViewState); if(!sv->initialized) @@ -8505,72 +8506,117 @@ DF_VIEW_UI_FUNCTION_DEF(Settings) { DF_SettingsItemList items_list = {0}; - //- rjf: gather all settings - for(EachEnumVal(DF_SettingCode, code)) + //- rjf: settings header + if(query.size == 0) { - String8 kind_string = str8_lit("Interface"); - String8 string = df_g_setting_code_display_string_table[code]; - FuzzyMatchRangeList kind_string_matches = fuzzy_match_find(scratch.arena, query, kind_string); - FuzzyMatchRangeList string_matches = fuzzy_match_find(scratch.arena, query, string); - if(string_matches.count == string_matches.needle_part_count || - kind_string_matches.count == kind_string_matches.needle_part_count) + DF_SettingsItemNode *n = push_array(scratch.arena, DF_SettingsItemNode, 1); + SLLQueuePush(items_list.first, items_list.last, n); + items_list.count += 1; + n->v.kind = DF_SettingsItemKind_CategoryHeader; + n->v.string = str8_lit("Interface Settings"); + n->v.icon_kind = sv->category_collapsed[DF_SettingsItemKind_Setting] ? DF_IconKind_RightCaret : DF_IconKind_DownCaret; + n->v.category = DF_SettingsItemKind_Setting; + } + + //- rjf: gather all settings + if(!sv->category_collapsed[DF_SettingsItemKind_Setting] || query.size != 0) + { + for(EachEnumVal(DF_SettingCode, code)) { - DF_SettingsItemNode *n = push_array(scratch.arena, DF_SettingsItemNode, 1); - SLLQueuePush(items_list.first, items_list.last, n); - items_list.count += 1; - n->v.kind = DF_SettingsItemKind_Setting; - n->v.kind_string = kind_string; - n->v.string = string; - n->v.kind_string_matches = kind_string_matches; - n->v.string_matches = string_matches; - n->v.icon_kind = DF_IconKind_Window; - n->v.code = code; + String8 kind_string = str8_lit("Interface"); + String8 string = df_g_setting_code_display_string_table[code]; + FuzzyMatchRangeList kind_string_matches = fuzzy_match_find(scratch.arena, query, kind_string); + FuzzyMatchRangeList string_matches = fuzzy_match_find(scratch.arena, query, string); + if(string_matches.count == string_matches.needle_part_count || + kind_string_matches.count == kind_string_matches.needle_part_count) + { + DF_SettingsItemNode *n = push_array(scratch.arena, DF_SettingsItemNode, 1); + SLLQueuePush(items_list.first, items_list.last, n); + items_list.count += 1; + n->v.kind = DF_SettingsItemKind_Setting; + n->v.kind_string = kind_string; + n->v.string = string; + n->v.kind_string_matches = kind_string_matches; + n->v.string_matches = string_matches; + n->v.icon_kind = DF_IconKind_Window; + n->v.code = code; + } } } + //- rjf: theme presets header + if(query.size == 0) + { + DF_SettingsItemNode *n = push_array(scratch.arena, DF_SettingsItemNode, 1); + SLLQueuePush(items_list.first, items_list.last, n); + items_list.count += 1; + n->v.kind = DF_SettingsItemKind_CategoryHeader; + n->v.string = str8_lit("Theme Presets"); + n->v.icon_kind = sv->category_collapsed[DF_SettingsItemKind_ThemePreset] ? DF_IconKind_RightCaret : DF_IconKind_DownCaret; + n->v.category = DF_SettingsItemKind_ThemePreset; + } + //- rjf: gather theme presets - for(EachEnumVal(DF_ThemePreset, preset)) + if(!sv->category_collapsed[DF_SettingsItemKind_ThemePreset] || query.size != 0) { - String8 kind_string = str8_lit("Theme Preset"); - String8 string = df_g_theme_preset_display_string_table[preset]; - FuzzyMatchRangeList kind_string_matches = fuzzy_match_find(scratch.arena, query, kind_string); - FuzzyMatchRangeList string_matches = fuzzy_match_find(scratch.arena, query, string); - if(string_matches.count == string_matches.needle_part_count || - kind_string_matches.count == kind_string_matches.needle_part_count) + for(EachEnumVal(DF_ThemePreset, preset)) { - DF_SettingsItemNode *n = push_array(scratch.arena, DF_SettingsItemNode, 1); - SLLQueuePush(items_list.first, items_list.last, n); - items_list.count += 1; - n->v.kind = DF_SettingsItemKind_ThemePreset; - n->v.kind_string = kind_string; - n->v.string = string; - n->v.kind_string_matches = kind_string_matches; - n->v.string_matches = string_matches; - n->v.icon_kind = DF_IconKind_Palette; - n->v.preset = preset; + String8 kind_string = str8_lit("Theme Preset"); + String8 string = df_g_theme_preset_display_string_table[preset]; + FuzzyMatchRangeList kind_string_matches = fuzzy_match_find(scratch.arena, query, kind_string); + FuzzyMatchRangeList string_matches = fuzzy_match_find(scratch.arena, query, string); + if(string_matches.count == string_matches.needle_part_count || + kind_string_matches.count == kind_string_matches.needle_part_count) + { + DF_SettingsItemNode *n = push_array(scratch.arena, DF_SettingsItemNode, 1); + SLLQueuePush(items_list.first, items_list.last, n); + items_list.count += 1; + n->v.kind = DF_SettingsItemKind_ThemePreset; + n->v.kind_string = kind_string; + n->v.string = string; + n->v.kind_string_matches = kind_string_matches; + n->v.string_matches = string_matches; + n->v.icon_kind = DF_IconKind_Palette; + n->v.preset = preset; + } } } - //- rjf: gather all theme colors - for(EachNonZeroEnumVal(DF_ThemeColor, color)) + //- rjf: theme colors header + if(query.size == 0) { - String8 kind_string = str8_lit("Theme Color"); - String8 string = df_g_theme_color_display_string_table[color]; - FuzzyMatchRangeList kind_string_matches = fuzzy_match_find(scratch.arena, query, kind_string); - FuzzyMatchRangeList string_matches = fuzzy_match_find(scratch.arena, query, string); - if(string_matches.count == string_matches.needle_part_count || - kind_string_matches.count == kind_string_matches.needle_part_count) + DF_SettingsItemNode *n = push_array(scratch.arena, DF_SettingsItemNode, 1); + SLLQueuePush(items_list.first, items_list.last, n); + items_list.count += 1; + n->v.kind = DF_SettingsItemKind_CategoryHeader; + n->v.string = str8_lit("Theme Colors"); + n->v.icon_kind = sv->category_collapsed[DF_SettingsItemKind_ThemeColor] ? DF_IconKind_RightCaret : DF_IconKind_DownCaret; + n->v.category = DF_SettingsItemKind_ThemeColor; + } + + //- rjf: gather all theme colors + if(!sv->category_collapsed[DF_SettingsItemKind_ThemeColor] || query.size != 0) + { + for(EachNonZeroEnumVal(DF_ThemeColor, color)) { - DF_SettingsItemNode *n = push_array(scratch.arena, DF_SettingsItemNode, 1); - SLLQueuePush(items_list.first, items_list.last, n); - items_list.count += 1; - n->v.kind = DF_SettingsItemKind_ThemeColor; - n->v.kind_string = kind_string; - n->v.string = string; - n->v.kind_string_matches = kind_string_matches; - n->v.string_matches = string_matches; - n->v.icon_kind = DF_IconKind_Palette; - n->v.color = color; + String8 kind_string = str8_lit("Theme Color"); + String8 string = df_g_theme_color_display_string_table[color]; + FuzzyMatchRangeList kind_string_matches = fuzzy_match_find(scratch.arena, query, kind_string); + FuzzyMatchRangeList string_matches = fuzzy_match_find(scratch.arena, query, string); + if(string_matches.count == string_matches.needle_part_count || + kind_string_matches.count == kind_string_matches.needle_part_count) + { + DF_SettingsItemNode *n = push_array(scratch.arena, DF_SettingsItemNode, 1); + SLLQueuePush(items_list.first, items_list.last, n); + items_list.count += 1; + n->v.kind = DF_SettingsItemKind_ThemeColor; + n->v.kind_string = kind_string; + n->v.string = string; + n->v.kind_string_matches = kind_string_matches; + n->v.string_matches = string_matches; + n->v.icon_kind = DF_IconKind_Palette; + n->v.color = color; + } } } @@ -8817,8 +8863,15 @@ DF_VIEW_UI_FUNCTION_DEF(Settings) B32 is_slider = 0; S32 slider_s32_val = 0; F32 slider_pct = 0.f; + UI_BoxFlags flags = UI_BoxFlag_DrawBackground|UI_BoxFlag_DrawBorder|UI_BoxFlag_DrawHotEffects|UI_BoxFlag_DrawActiveEffects; switch(item->kind) { + case DF_SettingsItemKind_COUNT:{}break; + case DF_SettingsItemKind_CategoryHeader: + { + cursor = OS_Cursor_HandPoint; + flags = UI_BoxFlag_DrawBorder|UI_BoxFlag_DrawHotEffects; + }break; case DF_SettingsItemKind_ThemePreset: { Vec4F32 *colors = df_g_theme_preset_colors_table[item->preset]; @@ -8856,60 +8909,65 @@ DF_VIEW_UI_FUNCTION_DEF(Settings) //- rjf: build item widget UI_Box *item_box = &ui_g_nil_box; - UI_Focus(row_num+1 == sv->cursor.y ? UI_FocusKind_On : UI_FocusKind_Off) UI_Palette(palette) + UI_Row { - ui_set_next_hover_cursor(cursor); - item_box = ui_build_box_from_stringf(UI_BoxFlag_Clickable| - UI_BoxFlag_DrawBackground| - UI_BoxFlag_DrawBorder| - UI_BoxFlag_DrawHotEffects| - UI_BoxFlag_DrawActiveEffects, - "###option_%S", item->string); - UI_Parent(item_box) + if(query.size == 0 && item->kind != DF_SettingsItemKind_CategoryHeader) { - ui_spacer(ui_em(1.f, 1.f)); - UI_PrefWidth(ui_em(2.5f, 1.f)) - UI_Font(df_font_from_slot(DF_FontSlot_Icons)) - UI_RunFlags(F_RunFlag_Smooth) - UI_Palette(ui_build_palette(ui_top_palette(), .text = rgba)) - ui_label(df_g_icon_kind_text_table[item->icon_kind]); - UI_PrefWidth(ui_text_dim(10, 1)) + ui_set_next_flags(UI_BoxFlag_DrawSideLeft); + ui_spacer(ui_em(2.f, 1.f)); + } + UI_Focus(row_num+1 == sv->cursor.y ? UI_FocusKind_On : UI_FocusKind_Off) UI_Palette(palette) + { + ui_set_next_hover_cursor(cursor); + item_box = ui_build_box_from_stringf(UI_BoxFlag_Clickable|flags, "###option_%S_%S", item->kind_string, item->string); + UI_Parent(item_box) { - UI_Box *box = ui_build_box_from_stringf(UI_BoxFlag_DrawText|UI_BoxFlag_DrawTextWeak, "%S", item->kind_string); - ui_box_equip_fuzzy_match_ranges(box, &item->kind_string_matches); - } - UI_PrefWidth(ui_text_dim(10, 1)) - { - UI_Box *box = ui_build_box_from_stringf(UI_BoxFlag_DrawText, "%S", item->string); - ui_box_equip_fuzzy_match_ranges(box, &item->string_matches); - } - if(is_slider) UI_PrefWidth(ui_text_dim(10, 1)) - { - UI_Font(df_font_from_slot(DF_FontSlot_Code)) - UI_RunFlags(F_RunFlag_Smooth) - UI_Flags(UI_BoxFlag_DrawTextWeak) - ui_labelf("(%i)", slider_s32_val); - UI_PrefWidth(ui_pct(slider_pct, 1.f)) UI_HeightFill UI_FixedX(0) UI_FixedY(0) - UI_Palette(ui_build_palette(ui_top_palette(), .background = df_rgba_from_theme_color(DF_ThemeColor_HighlightOverlay))) - ui_build_box_from_key(UI_BoxFlag_DrawBackground, ui_key_zero()); - } - if(is_toggler) - { - ui_spacer(ui_pct(1, 0)); - UI_PrefWidth(ui_em(2.5f, 1.f)) - UI_Font(df_font_from_slot(DF_FontSlot_Icons)) - UI_RunFlags(F_RunFlag_Smooth) - UI_Flags(UI_BoxFlag_DrawTextWeak) - ui_label(df_g_icon_kind_text_table[is_toggled ? DF_IconKind_CheckFilled : DF_IconKind_CheckHollow]); - } - if(item->kind == DF_SettingsItemKind_ThemePreset && sv->preset_apply_confirm == item->preset) - { - ui_spacer(ui_pct(1, 0)); + if(item->icon_kind != DF_IconKind_Null) + { + UI_PrefWidth(ui_em(2.f, 1.f)) + UI_Font(df_font_from_slot(DF_FontSlot_Icons)) + UI_RunFlags(F_RunFlag_Smooth) + UI_Palette(ui_build_palette(ui_top_palette(), .text = rgba)) + ui_label(df_g_icon_kind_text_table[item->icon_kind]); + } + if(item->kind_string.size != 0) UI_PrefWidth(ui_text_dim(10, 1)) + { + UI_Box *box = ui_build_box_from_stringf(UI_BoxFlag_DrawText|UI_BoxFlag_DrawTextWeak, "%S", item->kind_string); + ui_box_equip_fuzzy_match_ranges(box, &item->kind_string_matches); + } UI_PrefWidth(ui_text_dim(10, 1)) - DF_Palette(DF_PaletteCode_NegativePopButton) - UI_CornerRadius(ui_top_font_size()*0.5f) - UI_FontSize(ui_top_font_size()*0.9f) - ui_build_box_from_stringf(UI_BoxFlag_DrawText|UI_BoxFlag_DrawBackground, "Click Again To Apply"); + { + UI_Box *box = ui_build_box_from_stringf(UI_BoxFlag_DrawText, "%S", item->string); + ui_box_equip_fuzzy_match_ranges(box, &item->string_matches); + } + if(is_slider) UI_PrefWidth(ui_text_dim(10, 1)) + { + UI_Font(df_font_from_slot(DF_FontSlot_Code)) + UI_RunFlags(F_RunFlag_Smooth) + UI_Flags(UI_BoxFlag_DrawTextWeak) + ui_labelf("(%i)", slider_s32_val); + UI_PrefWidth(ui_pct(slider_pct, 1.f)) UI_HeightFill UI_FixedX(0) UI_FixedY(0) + UI_Palette(ui_build_palette(ui_top_palette(), .background = df_rgba_from_theme_color(DF_ThemeColor_HighlightOverlay))) + ui_build_box_from_key(UI_BoxFlag_DrawBackground, ui_key_zero()); + } + if(is_toggler) + { + ui_spacer(ui_pct(1, 0)); + UI_PrefWidth(ui_em(2.5f, 1.f)) + UI_Font(df_font_from_slot(DF_FontSlot_Icons)) + UI_RunFlags(F_RunFlag_Smooth) + UI_Flags(UI_BoxFlag_DrawTextWeak) + ui_label(df_g_icon_kind_text_table[is_toggled ? DF_IconKind_CheckFilled : DF_IconKind_CheckHollow]); + } + if(item->kind == DF_SettingsItemKind_ThemePreset && sv->preset_apply_confirm == item->preset) + { + ui_spacer(ui_pct(1, 0)); + UI_PrefWidth(ui_text_dim(10, 1)) + DF_Palette(DF_PaletteCode_NegativePopButton) + UI_CornerRadius(ui_top_font_size()*0.5f) + UI_FontSize(ui_top_font_size()*0.9f) + ui_build_box_from_stringf(UI_BoxFlag_DrawText|UI_BoxFlag_DrawBackground, "Click Again To Apply"); + } } } } @@ -8962,6 +9020,14 @@ DF_VIEW_UI_FUNCTION_DEF(Settings) { sv->preset_apply_confirm = DF_ThemePreset_COUNT; } + if(item->kind != DF_SettingsItemKind_ThemePreset && ui_pressed(sig)) + { + sv->preset_apply_confirm = DF_ThemePreset_COUNT; + } + if(item->kind == DF_SettingsItemKind_CategoryHeader && ui_pressed(sig)) + { + sv->category_collapsed[item->category] ^= 1; + } } } diff --git a/src/df/gfx/df_views.h b/src/df/gfx/df_views.h index cad2347c..88e7ed5e 100644 --- a/src/df/gfx/df_views.h +++ b/src/df/gfx/df_views.h @@ -439,9 +439,11 @@ struct DF_MemoryViewState typedef enum DF_SettingsItemKind { + DF_SettingsItemKind_CategoryHeader, DF_SettingsItemKind_Setting, DF_SettingsItemKind_ThemeColor, DF_SettingsItemKind_ThemePreset, + DF_SettingsItemKind_COUNT } DF_SettingsItemKind; @@ -457,6 +459,7 @@ struct DF_SettingsItem DF_SettingCode code; DF_ThemeColor color; DF_ThemePreset preset; + DF_SettingsItemKind category; }; typedef struct DF_SettingsItemNode DF_SettingsItemNode; diff --git a/src/raddbg/raddbg.h b/src/raddbg/raddbg.h index 30597f35..cc94f995 100644 --- a/src/raddbg/raddbg.h +++ b/src/raddbg/raddbg.h @@ -4,15 +4,15 @@ //////////////////////////////// //~ rjf: 0.9.11 TODO // -// [ ] user settings (ui & functionality - generally need a story for it) -// [ ] hover animations -// [ ] press animations -// [ ] focus animations -// [ ] tooltip animations -// [ ] context menu animations -// [ ] scrolling animations -// [ ] background blur -// [ ] tab width +// [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 // [ ] auto-scroll output window // // [ ] move breakpoints to being a global thing, not nested to particular files From 4ebc38d9f9f9232f2407f4f5045ca04ed58e10ce Mon Sep 17 00:00:00 2001 From: Ryan Fleury Date: Wed, 26 Jun 2024 17:39:40 -0700 Subject: [PATCH 44/47] fill theme presets for new theme color codes --- src/df/gfx/df_gfx.c | 2 +- src/df/gfx/df_gfx.mdesk | 102 ++++---- src/df/gfx/generated/df_gfx.meta.c | 406 ++++++++++++++--------------- src/ui/ui_core.h | 2 +- 4 files changed, 256 insertions(+), 256 deletions(-) diff --git a/src/df/gfx/df_gfx.c b/src/df/gfx/df_gfx.c index 01708506..49515ebd 100644 --- a/src/df/gfx/df_gfx.c +++ b/src/df/gfx/df_gfx.c @@ -11309,7 +11309,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ for(DF_EntityNode *n = line_pins.first; n != 0; n = n->next) { DF_Entity *pin = n->entity; - Vec4F32 color = v4f32(1, 1, 1, 1); + Vec4F32 color = df_rgba_from_theme_color(DF_ThemeColor_Text); if(pin->flags & DF_EntityFlag_HasColor) { color = df_rgba_from_entity(pin); diff --git a/src/df/gfx/df_gfx.mdesk b/src/df/gfx/df_gfx.mdesk index e4c0f568..a1e507bc 100644 --- a/src/df/gfx/df_gfx.mdesk +++ b/src/df/gfx/df_gfx.mdesk @@ -372,71 +372,71 @@ DF_ThemeColorTable: {Null "Null" null 0xff00ffff 0xff00ffff 0xff00ffff 0xff00ffff 0xff00ffff 0xff00ffff 0xff00ffff 0xff00ffff 0xff00ffff ""} //- rjf: global ui colors - {Text "Text" text 0xe5e5e5ff 0x4c4c4cff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff ""} + {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 0xc56452ff 0xc56452ff 0xc56452ff 0xc56452ff 0xc56452ff 0xc56452ff ""} + {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 0xa4a4a4fe 0xa4a4a4fe 0xa4a4a4fe 0xa4a4a4fe 0xa4a4a4fe 0xa4a4a4fe ""} - {Cursor "Cursor" cursor 0x8aff00ff 0x699830ff 0x8aff00ff 0x8aff00ff 0x8aff00ff 0x8aff00ff 0x8aff00ff 0x8aff00ff 0x8aff00ff ""} + {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 0xfda200ff 0xfda200ff 0xfda200ff 0xfda200ff 0xfda200ff 0xfda200ff ""} - {Hover "Hover" hover 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff ""} - {DropShadow "Drop Shadow" drop_shadow 0x0000007f 0x0000004c 0x0000007f 0x0000007f 0x0000007f 0x0000007f 0x0000007f 0x0000007f 0x0000007f ""} - {DisabledOverlay "Disabled Overlay" disabled_overlay 0x0000003f 0xa6a6a63f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f ""} - {DropSiteOverlay "Drop Site Overlay" drop_site_overlay 0xffffff0c 0x4848480c 0xffffff0c 0xffffff0c 0xffffff0c 0xffffff0c 0xffffff0c 0xffffff0c 0xffffff0c ""} - {InactivePanelOverlay "Inactive Panel Overlay" inactive_panel_overlay 0x0000003f 0xa4a4a43f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f 0x0000003f ""} - {SelectionOverlay "Selection Overlay" selection_overlay 0x99ccff4c 0x003d7a48 0x99ccff4c 0x99ccff4c 0x99ccff4c 0x99ccff4c 0x99ccff4c 0x99ccff4c 0x99ccff4c ""} - {HighlightOverlay "Highlight Overlay" highlight_overlay 0xffffff1e 0xffffff1e 0xffffff1e 0xffffff1e 0xffffff1e 0xffffff1e 0xffffff1e 0xffffff1e 0xffffff1e ""} + {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 0x1b1b1bfe 0x1b1b1bfe 0x1b1b1bfe 0x1b1b1bfe 0x1b1b1bfe 0x1b1b1bfe ""} - {BaseBackgroundAlt "Base Background (Alternate)" base_background_alt 0x2b2b2bfe 0x2b2b2bfe 0x2b2b2bfe 0x2b2b2bfe 0x2b2b2bfe 0x2b2b2bfe 0x2b2b2bfe 0x2b2b2bfe 0x2b2b2bfe ""} - {BaseBorder "Base Border" base_border 0x3f3f3ffe 0xa4a4a4fe 0x3f3f3ffe 0x3f3f3ffe 0x3f3f3ffe 0x3f3f3ffe 0x3f3f3ffe 0x3f3f3ffe 0x3f3f3ffe ""} + {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 0x3e4c577f 0x3e4c577f 0x3e4c577f 0x3e4c577f 0x3e4c577f 0x3e4c577f 0x3e4c577f ""} - {MenuBarBackgroundAlt "Menu Bar Background (Alternate)" menu_bar_background_alt 0x3e4c577f 0x3e4c577f 0x3e4c577f 0x3e4c577f 0x3e4c577f 0x3e4c577f 0x3e4c577f 0x3e4c577f 0x3e4c577f ""} - {MenuBarBorder "Menu Bar Border" menu_bar_border 0xffffff19 0xa4a4a4fe 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 ""} + {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 0x33333333 0x33333333 0x33333333 0x33333333 0x33333333 0x33333333 ""} + {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 0x3f3f3ffd 0x3f3f3ffd 0x3f3f3ffd 0x3f3f3ffd 0x3f3f3ffd 0x3f3f3ffd ""} + {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 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 0x3f3f3ffe 0x3f3f3ffe 0x3f3f3ffe 0x3f3f3ffe 0x3f3f3ffe 0x3f3f3ffe ""} - {PositivePopButtonBackground "Positive Pop Button Background" positive_pop_button_background 0x2c5b36ff 0x65f534ff 0x2c5b36ff 0x2c5b36ff 0x2c5b36ff 0x2c5b36ff 0x2c5b36ff 0x2c5b36ff 0x2c5b36ff ""} - {PositivePopButtonBorder "Positive Pop Button Border" positive_pop_button_border 0x3f3f3ffd 0x3f3f3ffd 0x3f3f3ffd 0x3f3f3ffd 0x3f3f3ffd 0x3f3f3ffd 0x3f3f3ffd 0x3f3f3ffd 0x3f3f3ffd ""} - {NegativePopButtonBackground "Negative Pop Button Background" negative_pop_button_background 0x803425ff 0xff694cff 0x803425ff 0x803425ff 0x803425ff 0x803425ff 0x803425ff 0x803425ff 0x803425ff ""} - {NegativePopButtonBorder "Negative Pop Button Border" negative_pop_button_border 0x3f3f3ffd 0x3f3f3ffd 0x3f3f3ffd 0x3f3f3ffd 0x3f3f3ffd 0x3f3f3ffd 0x3f3f3ffd 0x3f3f3ffd 0x3f3f3ffd ""} - {NeutralPopButtonBackground "Neutral Pop Button Background" neutral_pop_button_background 0x355b6eff 0xa6becaff 0x355b6eff 0x355b6eff 0x355b6eff 0x355b6eff 0x355b6eff 0x355b6eff 0x355b6eff ""} - {NeutralPopButtonBorder "Neutral Pop Button Border" neutral_pop_button_border 0x3f3f3ffd 0xa6a6a6fd 0x3f3f3ffd 0x3f3f3ffd 0x3f3f3ffd 0x3f3f3ffd 0x3f3f3ffd 0x3f3f3ffd 0x3f3f3ffd ""} - {ScrollBarButtonBackground "Scroll Bar Button Background" scroll_bar_button_background 0x2b2b2bfe 0xa9a9a9fe 0x2b2b2bfe 0x2b2b2bfe 0x2b2b2bfe 0x2b2b2bfe 0x2b2b2bfe 0x2b2b2bfe 0x2b2b2bfe ""} - {ScrollBarButtonBorder "Scroll Bar Button Border" scroll_bar_button_border 0x3f3f3ffe 0xc0c0c0fe 0x3f3f3ffe 0x3f3f3ffe 0x3f3f3ffe 0x3f3f3ffe 0x3f3f3ffe 0x3f3f3ffe 0x3f3f3ffe ""} - {TabBackground "Tab Background" tab_background 0x6f5135fe 0xa98b6fff 0x6f5135fe 0x6f5135fe 0x6f5135fe 0x6f5135fe 0x6f5135fe 0x6f5135fe 0x6f5135fe ""} - {TabBorder "Tab Border" tab_border 0xfefefe4d 0xffffff4d 0xfefefe4d 0xfefefe4d 0xfefefe4d 0xfefefe4d 0xfefefe4d 0xfefefe4d 0xfefefe4d ""} - {TabBackgroundInactive "Tab Background (Inactive)" tab_background_inactive 0x3e4c577f 0x8282827f 0x3e4c577f 0x3e4c577f 0x3e4c577f 0x3e4c577f 0x3e4c577f 0x3e4c577f 0x3e4c577f ""} - {TabBorderInactive "Tab Border (Inactive)" tab_border_inactive 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 ""} + {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 0xcbcbcbff 0xcbcbcbff 0xcbcbcbff 0xcbcbcbff 0xcbcbcbff 0xcbcbcbff ""} - {CodeSymbol "Code (Symbol)" code_symbol 0x42a2cffe 0x205670fe 0x42a2cffe 0x42a2cffe 0x42a2cffe 0x42a2cffe 0x42a2cffe 0x42a2cffe 0x42a2cffe ""} - {CodeType "Code (Type)" code_type 0xfec746ff 0x996b00ff 0xfec746ff 0xfec746ff 0xfec746ff 0xfec746ff 0xfec746ff 0xfec746ff 0xfec746ff ""} - {CodeLocal "Code (Local)" code_local 0x98bc80ff 0x446a2bff 0x98bc80ff 0x98bc80ff 0x98bc80ff 0x98bc80ff 0x98bc80ff 0x98bc80ff 0x98bc80ff ""} - {CodeRegister "Code (Register)" code_register 0xb7afd5ff 0x4c35a1ff 0xb7afd5ff 0xb7afd5ff 0xb7afd5ff 0xb7afd5ff 0xb7afd5ff 0xb7afd5ff 0xb7afd5ff ""} - {CodeKeyword "Code (Keyword)" code_keyword 0xb38d4cff 0x573700ff 0xb38d4cff 0xb38d4cff 0xb38d4cff 0xb38d4cff 0xb38d4cff 0xb38d4cff 0xb38d4cff ""} - {CodeDelimiterOperator "Code (Delimiters/Operators)" code_delimiter_operator 0x767676ff 0x767676ff 0x767676ff 0x767676ff 0x767676ff 0x767676ff 0x767676ff 0x767676ff 0x767676ff ""} - {CodeNumeric "Code (Numeric)" code_numeric 0x98abb1ff 0x3f6e7dff 0x98abb1ff 0x98abb1ff 0x98abb1ff 0x98abb1ff 0x98abb1ff 0x98abb1ff 0x98abb1ff ""} - {CodeNumericAltDigitGroup "Code (Numeric, Alt. Digit Group)" code_numeric_alt_digit_group 0x738287ff 0x1f4450ff 0x738287ff 0x738287ff 0x738287ff 0x738287ff 0x738287ff 0x738287ff 0x738287ff ""} - {CodeString "Code (String)" code_string 0x98abb1ff 0x3c606bff 0x98abb1ff 0x98abb1ff 0x98abb1ff 0x98abb1ff 0x98abb1ff 0x98abb1ff 0x98abb1ff ""} - {CodeMeta "Code (Meta)" code_meta 0xd96759ff 0xad3627ff 0xd96759ff 0xd96759ff 0xd96759ff 0xd96759ff 0xd96759ff 0xd96759ff 0xd96759ff ""} - {CodeComment "Code (Comment)" code_comment 0x717171ff 0x4b4b4bff 0x717171ff 0x717171ff 0x717171ff 0x717171ff 0x717171ff 0x717171ff 0x717171ff ""} - {CodeLineNumbers "Code Line Numbers" code_line_numbers 0x7f7f7fff 0x4b4b4bff 0x7f7f7fff 0x7f7f7fff 0x7f7f7fff 0x7f7f7fff 0x7f7f7fff 0x7f7f7fff 0x7f7f7fff ""} - {CodeLineNumbersSelected "Code Line Numbers (Selected)" code_line_numbers_selected 0xbebebeff 0x000000ff 0xbebebeff 0xbebebeff 0xbebebeff 0xbebebeff 0xbebebeff 0xbebebeff 0xbebebeff ""} + {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 ""} @@ -447,7 +447,7 @@ DF_ThemeColorTable: {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 0xd07c00ff 0xffcb7fff 0xffcb7fff 0xffcb7fff 0xffcb7fff 0xffcb7fff 0xffcb7fff 0xffcb7fff ""} + {Thread0 "Thread 0" thread_0 0xffcb7fff 0xd07c00ff 0xffcb7fff 0xffcb7fff 0xffcb7fff 0xd29233ff 0xffcb7fff 0xffcb7fff 0xffcb7fff ""} {Thread1 "Thread 1" thread_1 0xb2ff65ff 0xb2ff65ff 0xb2ff65ff 0xb2ff65ff 0xb2ff65ff 0xb2ff65ff 0xb2ff65ff 0xb2ff65ff 0xb2ff65ff ""} {Thread2 "Thread 2" thread_2 0xff99e5ff 0xff99e5ff 0xff99e5ff 0xff99e5ff 0xff99e5ff 0xff99e5ff 0xff99e5ff 0xff99e5ff 0xff99e5ff ""} {Thread3 "Thread 3" thread_3 0x6598ffff 0x6598ffff 0x6598ffff 0x6598ffff 0x6598ffff 0x6598ffff 0x6598ffff 0x6598ffff 0x6598ffff ""} @@ -456,8 +456,8 @@ DF_ThemeColorTable: {Thread6 "Thread 6" thread_6 0x9932ffff 0x9932ffff 0x9932ffff 0x9932ffff 0x9932ffff 0x9932ffff 0x9932ffff 0x9932ffff 0x9932ffff ""} {Thread7 "Thread 7" thread_7 0x65ff4cff 0x65ff4cff 0x65ff4cff 0x65ff4cff 0x65ff4cff 0x65ff4cff 0x65ff4cff 0x65ff4cff 0x65ff4cff ""} {ThreadUnwound "Thread (Unwound)" thread_unwound 0xb2ccd8ff 0xb2ccd8ff 0xb2ccd8ff 0xb2ccd8ff 0xb2ccd8ff 0xb2ccd8ff 0xb2ccd8ff 0xb2ccd8ff 0xb2ccd8ff ""} - {ThreadError "Thread (Error)" thread_error 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff ""} - {Breakpoint "Breakpoint" breakpoint 0xa72911ff 0xff2800ff 0xa72911ff 0xa72911ff 0xa72911ff 0xa72911ff 0xa72911ff 0xa72911ff 0xa72911ff ""} + {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 ""} } @table(old_name new_name) diff --git a/src/df/gfx/generated/df_gfx.meta.c b/src/df/gfx/generated/df_gfx.meta.c index 306ec7bc..ac28cae7 100644 --- a/src/df/gfx/generated/df_gfx.meta.c +++ b/src/df/gfx/generated/df_gfx.meta.c @@ -497,11 +497,11 @@ rgba_from_u32_lit_comp(0x99ccff4c), rgba_from_u32_lit_comp(0xffffff1e), rgba_from_u32_lit_comp(0x5f12005f), rgba_from_u32_lit_comp(0x1b1b1bfe), -rgba_from_u32_lit_comp(0x2b2b2bfe), +rgba_from_u32_lit_comp(0x1b1b1bfe), +rgba_from_u32_lit_comp(0x3f3f3ffe), +rgba_from_u32_lit_comp(0x1b1b1bfd), +rgba_from_u32_lit_comp(0x1b1b1bfd), rgba_from_u32_lit_comp(0x3f3f3ffe), -rgba_from_u32_lit_comp(0x3e4c577f), -rgba_from_u32_lit_comp(0x3e4c577f), -rgba_from_u32_lit_comp(0xffffff19), rgba_from_u32_lit_comp(0x33333333), rgba_from_u32_lit_comp(0x33333333), rgba_from_u32_lit_comp(0x3f3f3ffd), @@ -517,24 +517,24 @@ rgba_from_u32_lit_comp(0x355b6eff), rgba_from_u32_lit_comp(0x3f3f3ffd), rgba_from_u32_lit_comp(0x2b2b2bfe), rgba_from_u32_lit_comp(0x3f3f3ffe), -rgba_from_u32_lit_comp(0x6f5135fe), +rgba_from_u32_lit_comp(0x0079ccff), rgba_from_u32_lit_comp(0xfefefe4d), -rgba_from_u32_lit_comp(0x3e4c577f), -rgba_from_u32_lit_comp(0xffffff19), +rgba_from_u32_lit_comp(0xfefefe14), +rgba_from_u32_lit_comp(0xffffff00), rgba_from_u32_lit_comp(0xcbcbcbff), -rgba_from_u32_lit_comp(0x42a2cffe), -rgba_from_u32_lit_comp(0xfec746ff), -rgba_from_u32_lit_comp(0x98bc80ff), +rgba_from_u32_lit_comp(0xdcdcaaff), +rgba_from_u32_lit_comp(0x4ec9afff), +rgba_from_u32_lit_comp(0x9cdbfeff), rgba_from_u32_lit_comp(0xb7afd5ff), -rgba_from_u32_lit_comp(0xb38d4cff), +rgba_from_u32_lit_comp(0x569cd6ff), rgba_from_u32_lit_comp(0x767676ff), -rgba_from_u32_lit_comp(0x98abb1ff), -rgba_from_u32_lit_comp(0x738287ff), -rgba_from_u32_lit_comp(0x98abb1ff), -rgba_from_u32_lit_comp(0xd96759ff), -rgba_from_u32_lit_comp(0x717171ff), -rgba_from_u32_lit_comp(0x7f7f7fff), -rgba_from_u32_lit_comp(0xbebebeff), +rgba_from_u32_lit_comp(0xb5cea8ff), +rgba_from_u32_lit_comp(0x729360ff), +rgba_from_u32_lit_comp(0xd59b85ff), +rgba_from_u32_lit_comp(0xd59c85ff), +rgba_from_u32_lit_comp(0x57a54aff), +rgba_from_u32_lit_comp(0x2a91afff), +rgba_from_u32_lit_comp(0x9ddaecff), rgba_from_u32_lit_comp(0x99503d3f), rgba_from_u32_lit_comp(0xfe82493f), rgba_from_u32_lit_comp(0xffba173f), @@ -559,61 +559,61 @@ rgba_from_u32_lit_comp(0xa72911ff), Vec4F32 df_g_theme_preset_colors__vs_light[75] = { rgba_from_u32_lit_comp(0xff00ffff), -rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0x000000ff), rgba_from_u32_lit_comp(0x4dc221ff), -rgba_from_u32_lit_comp(0xc56452ff), +rgba_from_u32_lit_comp(0xc46451ff), rgba_from_u32_lit_comp(0x307eb2ff), -rgba_from_u32_lit_comp(0xa4a4a4fe), -rgba_from_u32_lit_comp(0x8aff00ff), -rgba_from_u32_lit_comp(0xb23217ff), -rgba_from_u32_lit_comp(0xfda200ff), -rgba_from_u32_lit_comp(0xffffffff), rgba_from_u32_lit_comp(0x0000007f), +rgba_from_u32_lit_comp(0x000000ff), +rgba_from_u32_lit_comp(0xb23217ff), +rgba_from_u32_lit_comp(0x002affff), +rgba_from_u32_lit_comp(0x000000ff), +rgba_from_u32_lit_comp(0xa3a3a37e), rgba_from_u32_lit_comp(0x0000003f), -rgba_from_u32_lit_comp(0xffffff0c), -rgba_from_u32_lit_comp(0x0000003f), -rgba_from_u32_lit_comp(0x99ccff4c), -rgba_from_u32_lit_comp(0xffffff1e), +rgba_from_u32_lit_comp(0x0000000c), +rgba_from_u32_lit_comp(0xfefefe53), +rgba_from_u32_lit_comp(0x3d74ab4b), +rgba_from_u32_lit_comp(0x0000001e), rgba_from_u32_lit_comp(0x5f12005f), -rgba_from_u32_lit_comp(0x1b1b1bfe), -rgba_from_u32_lit_comp(0x2b2b2bfe), -rgba_from_u32_lit_comp(0x3f3f3ffe), -rgba_from_u32_lit_comp(0x3e4c577f), -rgba_from_u32_lit_comp(0x3e4c577f), -rgba_from_u32_lit_comp(0xffffff19), +rgba_from_u32_lit_comp(0xfefefefe), +rgba_from_u32_lit_comp(0xe7e7e7fe), +rgba_from_u32_lit_comp(0xb6b6b6ff), +rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0xffffff7f), +rgba_from_u32_lit_comp(0xb6b6b6ff), +rgba_from_u32_lit_comp(0xfefefec7), rgba_from_u32_lit_comp(0x33333333), -rgba_from_u32_lit_comp(0x33333333), -rgba_from_u32_lit_comp(0x3f3f3ffd), +rgba_from_u32_lit_comp(0xb6b6b6ff), rgba_from_u32_lit_comp(0x00000000), rgba_from_u32_lit_comp(0x00000000), rgba_from_u32_lit_comp(0x1b1b1bfe), -rgba_from_u32_lit_comp(0x3f3f3ffe), -rgba_from_u32_lit_comp(0x2c5b36ff), -rgba_from_u32_lit_comp(0x3f3f3ffd), -rgba_from_u32_lit_comp(0x803425ff), -rgba_from_u32_lit_comp(0x3f3f3ffd), -rgba_from_u32_lit_comp(0x355b6eff), -rgba_from_u32_lit_comp(0x3f3f3ffd), -rgba_from_u32_lit_comp(0x2b2b2bfe), -rgba_from_u32_lit_comp(0x3f3f3ffe), -rgba_from_u32_lit_comp(0x6f5135fe), -rgba_from_u32_lit_comp(0xfefefe4d), -rgba_from_u32_lit_comp(0x3e4c577f), -rgba_from_u32_lit_comp(0xffffff19), -rgba_from_u32_lit_comp(0xcbcbcbff), -rgba_from_u32_lit_comp(0x42a2cffe), -rgba_from_u32_lit_comp(0xfec746ff), -rgba_from_u32_lit_comp(0x98bc80ff), +rgba_from_u32_lit_comp(0xb6b6b6ff), +rgba_from_u32_lit_comp(0x84ce93ff), +rgba_from_u32_lit_comp(0xb6b6b6ff), +rgba_from_u32_lit_comp(0xbd3e24ff), +rgba_from_u32_lit_comp(0xb6b6b6ff), +rgba_from_u32_lit_comp(0x6e9db5ff), +rgba_from_u32_lit_comp(0xb6b6b6ff), +rgba_from_u32_lit_comp(0xe8e8e8fe), +rgba_from_u32_lit_comp(0xb6b6b6ff), +rgba_from_u32_lit_comp(0xfffffffe), +rgba_from_u32_lit_comp(0xb6b6b6ff), +rgba_from_u32_lit_comp(0xcdd4dc7f), +rgba_from_u32_lit_comp(0xb6b6b6ff), +rgba_from_u32_lit_comp(0x000000ff), +rgba_from_u32_lit_comp(0x000000ff), +rgba_from_u32_lit_comp(0xa33700ff), +rgba_from_u32_lit_comp(0x007666ff), rgba_from_u32_lit_comp(0xb7afd5ff), -rgba_from_u32_lit_comp(0xb38d4cff), +rgba_from_u32_lit_comp(0x0000ffff), rgba_from_u32_lit_comp(0x767676ff), -rgba_from_u32_lit_comp(0x98abb1ff), -rgba_from_u32_lit_comp(0x738287ff), -rgba_from_u32_lit_comp(0x98abb1ff), -rgba_from_u32_lit_comp(0xd96759ff), -rgba_from_u32_lit_comp(0x717171ff), -rgba_from_u32_lit_comp(0x7f7f7fff), -rgba_from_u32_lit_comp(0xbebebeff), +rgba_from_u32_lit_comp(0x088658ff), +rgba_from_u32_lit_comp(0x0c3828ff), +rgba_from_u32_lit_comp(0xa31414ff), +rgba_from_u32_lit_comp(0x0000ffff), +rgba_from_u32_lit_comp(0x008000ff), +rgba_from_u32_lit_comp(0x227893ff), +rgba_from_u32_lit_comp(0x123d4bfe), rgba_from_u32_lit_comp(0x99503d3f), rgba_from_u32_lit_comp(0xfe82493f), rgba_from_u32_lit_comp(0xffba173f), @@ -638,11 +638,11 @@ rgba_from_u32_lit_comp(0xa72911ff), Vec4F32 df_g_theme_preset_colors__solarized_dark[75] = { rgba_from_u32_lit_comp(0xff00ffff), -rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0x999999ff), rgba_from_u32_lit_comp(0x4dc221ff), rgba_from_u32_lit_comp(0xc56452ff), rgba_from_u32_lit_comp(0x307eb2ff), -rgba_from_u32_lit_comp(0xa4a4a4fe), +rgba_from_u32_lit_comp(0x9999998a), rgba_from_u32_lit_comp(0x8aff00ff), rgba_from_u32_lit_comp(0xb23217ff), rgba_from_u32_lit_comp(0xfda200ff), @@ -654,45 +654,45 @@ rgba_from_u32_lit_comp(0x0000003f), rgba_from_u32_lit_comp(0x99ccff4c), rgba_from_u32_lit_comp(0xffffff1e), rgba_from_u32_lit_comp(0x5f12005f), -rgba_from_u32_lit_comp(0x1b1b1bfe), +rgba_from_u32_lit_comp(0x002a35fe), rgba_from_u32_lit_comp(0x2b2b2bfe), -rgba_from_u32_lit_comp(0x3f3f3ffe), -rgba_from_u32_lit_comp(0x3e4c577f), +rgba_from_u32_lit_comp(0xfefefe3a), +rgba_from_u32_lit_comp(0x00202bff), rgba_from_u32_lit_comp(0x3e4c577f), rgba_from_u32_lit_comp(0xffffff19), +rgba_from_u32_lit_comp(0x007fa14e), rgba_from_u32_lit_comp(0x33333333), -rgba_from_u32_lit_comp(0x33333333), -rgba_from_u32_lit_comp(0x3f3f3ffd), +rgba_from_u32_lit_comp(0xfdfdfd3a), rgba_from_u32_lit_comp(0x00000000), rgba_from_u32_lit_comp(0x00000000), rgba_from_u32_lit_comp(0x1b1b1bfe), -rgba_from_u32_lit_comp(0x3f3f3ffe), +rgba_from_u32_lit_comp(0xfefefe3a), rgba_from_u32_lit_comp(0x2c5b36ff), -rgba_from_u32_lit_comp(0x3f3f3ffd), +rgba_from_u32_lit_comp(0xfefefe3a), rgba_from_u32_lit_comp(0x803425ff), -rgba_from_u32_lit_comp(0x3f3f3ffd), +rgba_from_u32_lit_comp(0xfefefe3a), rgba_from_u32_lit_comp(0x355b6eff), -rgba_from_u32_lit_comp(0x3f3f3ffd), -rgba_from_u32_lit_comp(0x2b2b2bfe), -rgba_from_u32_lit_comp(0x3f3f3ffe), -rgba_from_u32_lit_comp(0x6f5135fe), +rgba_from_u32_lit_comp(0xfefefe3a), +rgba_from_u32_lit_comp(0x005e77fe), +rgba_from_u32_lit_comp(0xfefefe3a), +rgba_from_u32_lit_comp(0x005e77fe), rgba_from_u32_lit_comp(0xfefefe4d), rgba_from_u32_lit_comp(0x3e4c577f), rgba_from_u32_lit_comp(0xffffff19), rgba_from_u32_lit_comp(0xcbcbcbff), -rgba_from_u32_lit_comp(0x42a2cffe), -rgba_from_u32_lit_comp(0xfec746ff), +rgba_from_u32_lit_comp(0xcb4a15ff), +rgba_from_u32_lit_comp(0xcb4a15ff), rgba_from_u32_lit_comp(0x98bc80ff), rgba_from_u32_lit_comp(0xb7afd5ff), -rgba_from_u32_lit_comp(0xb38d4cff), +rgba_from_u32_lit_comp(0x849803ff), rgba_from_u32_lit_comp(0x767676ff), -rgba_from_u32_lit_comp(0x98abb1ff), -rgba_from_u32_lit_comp(0x738287ff), -rgba_from_u32_lit_comp(0x98abb1ff), -rgba_from_u32_lit_comp(0xd96759ff), -rgba_from_u32_lit_comp(0x717171ff), -rgba_from_u32_lit_comp(0x7f7f7fff), -rgba_from_u32_lit_comp(0xbebebeff), +rgba_from_u32_lit_comp(0xd33582ff), +rgba_from_u32_lit_comp(0x902559ff), +rgba_from_u32_lit_comp(0x1f9d91ff), +rgba_from_u32_lit_comp(0x839802ff), +rgba_from_u32_lit_comp(0x556a6fff), +rgba_from_u32_lit_comp(0x566c73ff), +rgba_from_u32_lit_comp(0xa2aaacff), rgba_from_u32_lit_comp(0x99503d3f), rgba_from_u32_lit_comp(0xfe82493f), rgba_from_u32_lit_comp(0xffba173f), @@ -717,61 +717,61 @@ rgba_from_u32_lit_comp(0xa72911ff), Vec4F32 df_g_theme_preset_colors__solarized_light[75] = { rgba_from_u32_lit_comp(0xff00ffff), -rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0x333333ff), rgba_from_u32_lit_comp(0x4dc221ff), rgba_from_u32_lit_comp(0xc56452ff), rgba_from_u32_lit_comp(0x307eb2ff), -rgba_from_u32_lit_comp(0xa4a4a4fe), -rgba_from_u32_lit_comp(0x8aff00ff), +rgba_from_u32_lit_comp(0x818181ff), +rgba_from_u32_lit_comp(0x586e75ff), rgba_from_u32_lit_comp(0xb23217ff), -rgba_from_u32_lit_comp(0xfda200ff), -rgba_from_u32_lit_comp(0xffffffff), -rgba_from_u32_lit_comp(0x0000007f), -rgba_from_u32_lit_comp(0x0000003f), +rgba_from_u32_lit_comp(0x92743dff), +rgba_from_u32_lit_comp(0x747474ff), +rgba_from_u32_lit_comp(0xc9bfa394), +rgba_from_u32_lit_comp(0xe4dac090), rgba_from_u32_lit_comp(0xffffff0c), -rgba_from_u32_lit_comp(0x0000003f), -rgba_from_u32_lit_comp(0x99ccff4c), +rgba_from_u32_lit_comp(0x0000001c), +rgba_from_u32_lit_comp(0x678cb24c), rgba_from_u32_lit_comp(0xffffff1e), rgba_from_u32_lit_comp(0x5f12005f), -rgba_from_u32_lit_comp(0x1b1b1bfe), +rgba_from_u32_lit_comp(0xfcf5e2fe), rgba_from_u32_lit_comp(0x2b2b2bfe), -rgba_from_u32_lit_comp(0x3f3f3ffe), +rgba_from_u32_lit_comp(0xbebaabfe), +rgba_from_u32_lit_comp(0xeee8d5ff), rgba_from_u32_lit_comp(0x3e4c577f), -rgba_from_u32_lit_comp(0x3e4c577f), -rgba_from_u32_lit_comp(0xffffff19), +rgba_from_u32_lit_comp(0xbebaabfe), +rgba_from_u32_lit_comp(0xffffff7c), rgba_from_u32_lit_comp(0x33333333), -rgba_from_u32_lit_comp(0x33333333), -rgba_from_u32_lit_comp(0x3f3f3ffd), -rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0xbebaabfe), rgba_from_u32_lit_comp(0x00000000), +rgba_from_u32_lit_comp(0xbdb9aa00), rgba_from_u32_lit_comp(0x1b1b1bfe), -rgba_from_u32_lit_comp(0x3f3f3ffe), -rgba_from_u32_lit_comp(0x2c5b36ff), -rgba_from_u32_lit_comp(0x3f3f3ffd), -rgba_from_u32_lit_comp(0x803425ff), -rgba_from_u32_lit_comp(0x3f3f3ffd), -rgba_from_u32_lit_comp(0x355b6eff), -rgba_from_u32_lit_comp(0x3f3f3ffd), -rgba_from_u32_lit_comp(0x2b2b2bfe), -rgba_from_u32_lit_comp(0x3f3f3ffe), -rgba_from_u32_lit_comp(0x6f5135fe), -rgba_from_u32_lit_comp(0xfefefe4d), -rgba_from_u32_lit_comp(0x3e4c577f), -rgba_from_u32_lit_comp(0xffffff19), -rgba_from_u32_lit_comp(0xcbcbcbff), -rgba_from_u32_lit_comp(0x42a2cffe), -rgba_from_u32_lit_comp(0xfec746ff), -rgba_from_u32_lit_comp(0x98bc80ff), -rgba_from_u32_lit_comp(0xb7afd5ff), -rgba_from_u32_lit_comp(0xb38d4cff), +rgba_from_u32_lit_comp(0xbebaabfe), +rgba_from_u32_lit_comp(0xb6ddbeff), +rgba_from_u32_lit_comp(0xbebaabfe), +rgba_from_u32_lit_comp(0xf8b0a1ff), +rgba_from_u32_lit_comp(0xbebaabfe), +rgba_from_u32_lit_comp(0xb2d3e3ff), +rgba_from_u32_lit_comp(0xbebaabfe), +rgba_from_u32_lit_comp(0xe3dbc7fe), +rgba_from_u32_lit_comp(0xbebaabfe), +rgba_from_u32_lit_comp(0xfdf6e3ff), +rgba_from_u32_lit_comp(0xbebaabfe), +rgba_from_u32_lit_comp(0xd4cfc0fe), +rgba_from_u32_lit_comp(0xbebaabfe), +rgba_from_u32_lit_comp(0x657b83ff), +rgba_from_u32_lit_comp(0xcb4a15ff), +rgba_from_u32_lit_comp(0xcb4a15ff), +rgba_from_u32_lit_comp(0x258ad2ff), +rgba_from_u32_lit_comp(0x373345ff), +rgba_from_u32_lit_comp(0x586e75ff), rgba_from_u32_lit_comp(0x767676ff), -rgba_from_u32_lit_comp(0x98abb1ff), -rgba_from_u32_lit_comp(0x738287ff), -rgba_from_u32_lit_comp(0x98abb1ff), +rgba_from_u32_lit_comp(0xd33482ef), +rgba_from_u32_lit_comp(0x8e2659ff), +rgba_from_u32_lit_comp(0x29a198ff), rgba_from_u32_lit_comp(0xd96759ff), -rgba_from_u32_lit_comp(0x717171ff), -rgba_from_u32_lit_comp(0x7f7f7fff), -rgba_from_u32_lit_comp(0xbebebeff), +rgba_from_u32_lit_comp(0x93a1a1ff), +rgba_from_u32_lit_comp(0x227893ef), +rgba_from_u32_lit_comp(0x111e22ef), rgba_from_u32_lit_comp(0x99503d3f), rgba_from_u32_lit_comp(0xfe82493f), rgba_from_u32_lit_comp(0xffba173f), @@ -780,7 +780,7 @@ rgba_from_u32_lit_comp(0x99503d3f), rgba_from_u32_lit_comp(0xfe82493f), rgba_from_u32_lit_comp(0xffba173f), rgba_from_u32_lit_comp(0xcefd693f), -rgba_from_u32_lit_comp(0xffcb7fff), +rgba_from_u32_lit_comp(0xd29233ff), rgba_from_u32_lit_comp(0xb2ff65ff), rgba_from_u32_lit_comp(0xff99e5ff), rgba_from_u32_lit_comp(0x6598ffff), @@ -789,18 +789,18 @@ rgba_from_u32_lit_comp(0xff9819ff), rgba_from_u32_lit_comp(0x9932ffff), rgba_from_u32_lit_comp(0x65ff4cff), rgba_from_u32_lit_comp(0xb2ccd8ff), -rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xa72911ff), +rgba_from_u32_lit_comp(0xb23218ff), +rgba_from_u32_lit_comp(0xff684bff), }; Vec4F32 df_g_theme_preset_colors__handmade_hero[75] = { rgba_from_u32_lit_comp(0xff00ffff), -rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0xa08462ff), rgba_from_u32_lit_comp(0x4dc221ff), rgba_from_u32_lit_comp(0xc56452ff), rgba_from_u32_lit_comp(0x307eb2ff), -rgba_from_u32_lit_comp(0xa4a4a4fe), +rgba_from_u32_lit_comp(0x6e512eff), rgba_from_u32_lit_comp(0x8aff00ff), rgba_from_u32_lit_comp(0xb23217ff), rgba_from_u32_lit_comp(0xfda200ff), @@ -812,45 +812,45 @@ rgba_from_u32_lit_comp(0x0000003f), rgba_from_u32_lit_comp(0x99ccff4c), rgba_from_u32_lit_comp(0xffffff1e), rgba_from_u32_lit_comp(0x5f12005f), -rgba_from_u32_lit_comp(0x1b1b1bfe), +rgba_from_u32_lit_comp(0x0c0c0cfe), rgba_from_u32_lit_comp(0x2b2b2bfe), -rgba_from_u32_lit_comp(0x3f3f3ffe), -rgba_from_u32_lit_comp(0x3e4c577f), +rgba_from_u32_lit_comp(0x423525fe), +rgba_from_u32_lit_comp(0x0c0c0cfe), rgba_from_u32_lit_comp(0x3e4c577f), rgba_from_u32_lit_comp(0xffffff19), +rgba_from_u32_lit_comp(0x0c0c0c32), rgba_from_u32_lit_comp(0x33333333), -rgba_from_u32_lit_comp(0x33333333), -rgba_from_u32_lit_comp(0x3f3f3ffd), +rgba_from_u32_lit_comp(0x423425fe), rgba_from_u32_lit_comp(0x00000000), rgba_from_u32_lit_comp(0x00000000), rgba_from_u32_lit_comp(0x1b1b1bfe), rgba_from_u32_lit_comp(0x3f3f3ffe), -rgba_from_u32_lit_comp(0x2c5b36ff), +rgba_from_u32_lit_comp(0x132e19ff), rgba_from_u32_lit_comp(0x3f3f3ffd), rgba_from_u32_lit_comp(0x803425ff), rgba_from_u32_lit_comp(0x3f3f3ffd), -rgba_from_u32_lit_comp(0x355b6eff), +rgba_from_u32_lit_comp(0x15445cff), rgba_from_u32_lit_comp(0x3f3f3ffd), -rgba_from_u32_lit_comp(0x2b2b2bfe), -rgba_from_u32_lit_comp(0x3f3f3ffe), -rgba_from_u32_lit_comp(0x6f5135fe), +rgba_from_u32_lit_comp(0x1f1f27fe), rgba_from_u32_lit_comp(0xfefefe4d), -rgba_from_u32_lit_comp(0x3e4c577f), +rgba_from_u32_lit_comp(0x1f1f27fe), +rgba_from_u32_lit_comp(0xfefefe4d), +rgba_from_u32_lit_comp(0x131315ee), rgba_from_u32_lit_comp(0xffffff19), -rgba_from_u32_lit_comp(0xcbcbcbff), -rgba_from_u32_lit_comp(0x42a2cffe), -rgba_from_u32_lit_comp(0xfec746ff), -rgba_from_u32_lit_comp(0x98bc80ff), +rgba_from_u32_lit_comp(0xa08462ff), +rgba_from_u32_lit_comp(0xcc5634ff), +rgba_from_u32_lit_comp(0xd8a51bff), +rgba_from_u32_lit_comp(0xc04047ff), rgba_from_u32_lit_comp(0xb7afd5ff), -rgba_from_u32_lit_comp(0xb38d4cff), -rgba_from_u32_lit_comp(0x767676ff), -rgba_from_u32_lit_comp(0x98abb1ff), -rgba_from_u32_lit_comp(0x738287ff), -rgba_from_u32_lit_comp(0x98abb1ff), -rgba_from_u32_lit_comp(0xd96759ff), -rgba_from_u32_lit_comp(0x717171ff), -rgba_from_u32_lit_comp(0x7f7f7fff), -rgba_from_u32_lit_comp(0xbebebeff), +rgba_from_u32_lit_comp(0xac7a09ff), +rgba_from_u32_lit_comp(0xa08462ff), +rgba_from_u32_lit_comp(0x698e21ff), +rgba_from_u32_lit_comp(0x3a4e11ff), +rgba_from_u32_lit_comp(0x6a8e22ff), +rgba_from_u32_lit_comp(0xdab98fff), +rgba_from_u32_lit_comp(0x686868ff), +rgba_from_u32_lit_comp(0xa08462ff), +rgba_from_u32_lit_comp(0xc8b399ff), rgba_from_u32_lit_comp(0x99503d3f), rgba_from_u32_lit_comp(0xfe82493f), rgba_from_u32_lit_comp(0xffba173f), @@ -875,11 +875,11 @@ rgba_from_u32_lit_comp(0xa72911ff), Vec4F32 df_g_theme_preset_colors__four_coder[75] = { rgba_from_u32_lit_comp(0xff00ffff), -rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0x90b080ff), rgba_from_u32_lit_comp(0x4dc221ff), rgba_from_u32_lit_comp(0xc56452ff), rgba_from_u32_lit_comp(0x307eb2ff), -rgba_from_u32_lit_comp(0xa4a4a4fe), +rgba_from_u32_lit_comp(0x566e4bff), rgba_from_u32_lit_comp(0x8aff00ff), rgba_from_u32_lit_comp(0xb23217ff), rgba_from_u32_lit_comp(0xfda200ff), @@ -891,44 +891,44 @@ rgba_from_u32_lit_comp(0x0000003f), rgba_from_u32_lit_comp(0x99ccff4c), rgba_from_u32_lit_comp(0xffffff1e), rgba_from_u32_lit_comp(0x5f12005f), -rgba_from_u32_lit_comp(0x1b1b1bfe), +rgba_from_u32_lit_comp(0x0c0c0cfe), rgba_from_u32_lit_comp(0x2b2b2bfe), rgba_from_u32_lit_comp(0x3f3f3ffe), -rgba_from_u32_lit_comp(0x3e4c577f), +rgba_from_u32_lit_comp(0x0c0c0cfe), rgba_from_u32_lit_comp(0x3e4c577f), rgba_from_u32_lit_comp(0xffffff19), -rgba_from_u32_lit_comp(0x33333333), +rgba_from_u32_lit_comp(0x0c0c0c3e), rgba_from_u32_lit_comp(0x33333333), rgba_from_u32_lit_comp(0x3f3f3ffd), rgba_from_u32_lit_comp(0x00000000), rgba_from_u32_lit_comp(0x00000000), rgba_from_u32_lit_comp(0x1b1b1bfe), rgba_from_u32_lit_comp(0x3f3f3ffe), -rgba_from_u32_lit_comp(0x2c5b36ff), +rgba_from_u32_lit_comp(0x152f1bff), rgba_from_u32_lit_comp(0x3f3f3ffd), -rgba_from_u32_lit_comp(0x803425ff), +rgba_from_u32_lit_comp(0x43150cff), rgba_from_u32_lit_comp(0x3f3f3ffd), -rgba_from_u32_lit_comp(0x355b6eff), +rgba_from_u32_lit_comp(0x1b323eff), rgba_from_u32_lit_comp(0x3f3f3ffd), -rgba_from_u32_lit_comp(0x2b2b2bfe), +rgba_from_u32_lit_comp(0x212721fe), rgba_from_u32_lit_comp(0x3f3f3ffe), -rgba_from_u32_lit_comp(0x6f5135fe), +rgba_from_u32_lit_comp(0x212721fe), rgba_from_u32_lit_comp(0xfefefe4d), -rgba_from_u32_lit_comp(0x3e4c577f), -rgba_from_u32_lit_comp(0xffffff19), -rgba_from_u32_lit_comp(0xcbcbcbff), +rgba_from_u32_lit_comp(0x3a3a3a7f), +rgba_from_u32_lit_comp(0x00000019), +rgba_from_u32_lit_comp(0x90b080ff), rgba_from_u32_lit_comp(0x42a2cffe), -rgba_from_u32_lit_comp(0xfec746ff), +rgba_from_u32_lit_comp(0xfd7c52ff), rgba_from_u32_lit_comp(0x98bc80ff), rgba_from_u32_lit_comp(0xb7afd5ff), -rgba_from_u32_lit_comp(0xb38d4cff), -rgba_from_u32_lit_comp(0x767676ff), -rgba_from_u32_lit_comp(0x98abb1ff), -rgba_from_u32_lit_comp(0x738287ff), -rgba_from_u32_lit_comp(0x98abb1ff), -rgba_from_u32_lit_comp(0xd96759ff), -rgba_from_u32_lit_comp(0x717171ff), -rgba_from_u32_lit_comp(0x7f7f7fff), +rgba_from_u32_lit_comp(0xd08f1eff), +rgba_from_u32_lit_comp(0x90b080ff), +rgba_from_u32_lit_comp(0x4fff2eff), +rgba_from_u32_lit_comp(0x3ccd21ff), +rgba_from_u32_lit_comp(0x4fff2eff), +rgba_from_u32_lit_comp(0xa0b8a0ff), +rgba_from_u32_lit_comp(0x1e8fefff), +rgba_from_u32_lit_comp(0x7e7e7ffe), rgba_from_u32_lit_comp(0xbebebeff), rgba_from_u32_lit_comp(0x99503d3f), rgba_from_u32_lit_comp(0xfe82493f), @@ -954,14 +954,14 @@ rgba_from_u32_lit_comp(0xa72911ff), Vec4F32 df_g_theme_preset_colors__far_manager[75] = { rgba_from_u32_lit_comp(0xff00ffff), -rgba_from_u32_lit_comp(0xe5e5e5ff), +rgba_from_u32_lit_comp(0x00fefeff), rgba_from_u32_lit_comp(0x4dc221ff), rgba_from_u32_lit_comp(0xc56452ff), rgba_from_u32_lit_comp(0x307eb2ff), -rgba_from_u32_lit_comp(0xa4a4a4fe), +rgba_from_u32_lit_comp(0x00a9a9ff), rgba_from_u32_lit_comp(0x8aff00ff), rgba_from_u32_lit_comp(0xb23217ff), -rgba_from_u32_lit_comp(0xfda200ff), +rgba_from_u32_lit_comp(0x00fefeff), rgba_from_u32_lit_comp(0xffffffff), rgba_from_u32_lit_comp(0x0000007f), rgba_from_u32_lit_comp(0x0000003f), @@ -970,15 +970,15 @@ rgba_from_u32_lit_comp(0x0000003f), rgba_from_u32_lit_comp(0x99ccff4c), rgba_from_u32_lit_comp(0xffffff1e), rgba_from_u32_lit_comp(0x5f12005f), -rgba_from_u32_lit_comp(0x1b1b1bfe), +rgba_from_u32_lit_comp(0x000081fe), rgba_from_u32_lit_comp(0x2b2b2bfe), -rgba_from_u32_lit_comp(0x3f3f3ffe), -rgba_from_u32_lit_comp(0x3e4c577f), -rgba_from_u32_lit_comp(0x3e4c577f), -rgba_from_u32_lit_comp(0xffffff19), +rgba_from_u32_lit_comp(0x0000fffe), +rgba_from_u32_lit_comp(0x007d7dff), +rgba_from_u32_lit_comp(0x007d7dff), +rgba_from_u32_lit_comp(0xfefefe00), +rgba_from_u32_lit_comp(0x007c7c55), rgba_from_u32_lit_comp(0x33333333), -rgba_from_u32_lit_comp(0x33333333), -rgba_from_u32_lit_comp(0x3f3f3ffd), +rgba_from_u32_lit_comp(0x00ffff55), rgba_from_u32_lit_comp(0x00000000), rgba_from_u32_lit_comp(0x00000000), rgba_from_u32_lit_comp(0x1b1b1bfe), @@ -987,28 +987,28 @@ rgba_from_u32_lit_comp(0x2c5b36ff), rgba_from_u32_lit_comp(0x3f3f3ffd), rgba_from_u32_lit_comp(0x803425ff), rgba_from_u32_lit_comp(0x3f3f3ffd), -rgba_from_u32_lit_comp(0x355b6eff), +rgba_from_u32_lit_comp(0x933100ff), rgba_from_u32_lit_comp(0x3f3f3ffd), -rgba_from_u32_lit_comp(0x2b2b2bfe), +rgba_from_u32_lit_comp(0x007d7dff), rgba_from_u32_lit_comp(0x3f3f3ffe), -rgba_from_u32_lit_comp(0x6f5135fe), +rgba_from_u32_lit_comp(0x007d7dff), rgba_from_u32_lit_comp(0xfefefe4d), rgba_from_u32_lit_comp(0x3e4c577f), -rgba_from_u32_lit_comp(0xffffff19), -rgba_from_u32_lit_comp(0xcbcbcbff), -rgba_from_u32_lit_comp(0x42a2cffe), +rgba_from_u32_lit_comp(0xfefefe19), +rgba_from_u32_lit_comp(0x00fefeff), +rgba_from_u32_lit_comp(0x65b1ffff), rgba_from_u32_lit_comp(0xfec746ff), -rgba_from_u32_lit_comp(0x98bc80ff), +rgba_from_u32_lit_comp(0x00ff00ff), rgba_from_u32_lit_comp(0xb7afd5ff), -rgba_from_u32_lit_comp(0xb38d4cff), -rgba_from_u32_lit_comp(0x767676ff), -rgba_from_u32_lit_comp(0x98abb1ff), +rgba_from_u32_lit_comp(0x00ffffff), +rgba_from_u32_lit_comp(0xffffffff), +rgba_from_u32_lit_comp(0x00ff00ff), rgba_from_u32_lit_comp(0x738287ff), rgba_from_u32_lit_comp(0x98abb1ff), -rgba_from_u32_lit_comp(0xd96759ff), -rgba_from_u32_lit_comp(0x717171ff), -rgba_from_u32_lit_comp(0x7f7f7fff), -rgba_from_u32_lit_comp(0xbebebeff), +rgba_from_u32_lit_comp(0xff0000ff), +rgba_from_u32_lit_comp(0xffffffff), +rgba_from_u32_lit_comp(0x007d7dff), +rgba_from_u32_lit_comp(0x00fefeff), rgba_from_u32_lit_comp(0x99503d3f), rgba_from_u32_lit_comp(0xfe82493f), rgba_from_u32_lit_comp(0xffba173f), @@ -1027,7 +1027,7 @@ rgba_from_u32_lit_comp(0x9932ffff), rgba_from_u32_lit_comp(0x65ff4cff), rgba_from_u32_lit_comp(0xb2ccd8ff), rgba_from_u32_lit_comp(0xb23219ff), -rgba_from_u32_lit_comp(0xa72911ff), +rgba_from_u32_lit_comp(0xff2800ff), }; Vec4F32* df_g_theme_preset_colors_table[9] = diff --git a/src/ui/ui_core.h b/src/ui/ui_core.h index f1bfa4e6..26c4659c 100644 --- a/src/ui/ui_core.h +++ b/src/ui/ui_core.h @@ -802,7 +802,7 @@ 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(1, 1, 1, 1), __VA_ARGS__}) +#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); From 08bc2b0a79778b50ed6c181521f9658d0c2d0c9b Mon Sep 17 00:00:00 2001 From: Ryan Fleury Date: Wed, 26 Jun 2024 17:48:28 -0700 Subject: [PATCH 45/47] fix up color config remapping table --- src/df/gfx/df_gfx.mdesk | 111 ++++++----------------------- src/df/gfx/generated/df_gfx.meta.c | 98 +++++++++++-------------- src/df/gfx/generated/df_gfx.meta.h | 4 +- 3 files changed, 64 insertions(+), 149 deletions(-) diff --git a/src/df/gfx/df_gfx.mdesk b/src/df/gfx/df_gfx.mdesk index a1e507bc..382806a2 100644 --- a/src/df/gfx/df_gfx.mdesk +++ b/src/df/gfx/df_gfx.mdesk @@ -447,15 +447,15 @@ DF_ThemeColorTable: {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 0xd07c00ff 0xffcb7fff 0xffcb7fff 0xffcb7fff 0xd29233ff 0xffcb7fff 0xffcb7fff 0xffcb7fff ""} - {Thread1 "Thread 1" thread_1 0xb2ff65ff 0xb2ff65ff 0xb2ff65ff 0xb2ff65ff 0xb2ff65ff 0xb2ff65ff 0xb2ff65ff 0xb2ff65ff 0xb2ff65ff ""} - {Thread2 "Thread 2" thread_2 0xff99e5ff 0xff99e5ff 0xff99e5ff 0xff99e5ff 0xff99e5ff 0xff99e5ff 0xff99e5ff 0xff99e5ff 0xff99e5ff ""} - {Thread3 "Thread 3" thread_3 0x6598ffff 0x6598ffff 0x6598ffff 0x6598ffff 0x6598ffff 0x6598ffff 0x6598ffff 0x6598ffff 0x6598ffff ""} - {Thread4 "Thread 4" thread_4 0x65ffcbff 0x65ffcbff 0x65ffcbff 0x65ffcbff 0x65ffcbff 0x65ffcbff 0x65ffcbff 0x65ffcbff 0x65ffcbff ""} - {Thread5 "Thread 5" thread_5 0xff9819ff 0xff9819ff 0xff9819ff 0xff9819ff 0xff9819ff 0xff9819ff 0xff9819ff 0xff9819ff 0xff9819ff ""} - {Thread6 "Thread 6" thread_6 0x9932ffff 0x9932ffff 0x9932ffff 0x9932ffff 0x9932ffff 0x9932ffff 0x9932ffff 0x9932ffff 0x9932ffff ""} - {Thread7 "Thread 7" thread_7 0x65ff4cff 0x65ff4cff 0x65ff4cff 0x65ff4cff 0x65ff4cff 0x65ff4cff 0x65ff4cff 0x65ff4cff 0x65ff4cff ""} - {ThreadUnwound "Thread (Unwound)" thread_unwound 0xb2ccd8ff 0xb2ccd8ff 0xb2ccd8ff 0xb2ccd8ff 0xb2ccd8ff 0xb2ccd8ff 0xb2ccd8ff 0xb2ccd8ff 0xb2ccd8ff ""} + {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 ""} } @@ -463,36 +463,28 @@ DF_ThemeColorTable: @table(old_name new_name) DF_ThemeColorVersionRemapTable: { - {plain_text default_text} - {plain_background default_background} - {plain_border default_border} + {plain_text text} + {plain_background base_background} + {plain_border base_border} {plain_overlay drop_site_overlay} - {code_function code_procedure} + {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_text menu_bar_text} {alt_background menu_bar_background} {alt_border menu_bar_border} - {alt_overlay drop_site_overlay} - {tab_inactive tab_inactive_background} - {tab_active tab_active_background} - {weak_text default_text_weak} + {tab_inactive tab_background_inactive} + {tab_active tab_background} + {weak_text text_weak} {text_selection selection} - {cursor cursor_active} - {highlight_0 focus_active} - {success_text special_positive_text} - {success_background special_positive_background} - {success_border special_positive_border} - {failure_text special_negative_text} - {failure_background special_negative_background} - {failure_border special_negative_border} - {action_text special_neutral_text} - {action_background special_neutral_background} - {action_border special_neutral_border} + {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: @@ -541,67 +533,6 @@ DF_ThemeColorVersionRemapTable: @expand(DF_ThemePresetTable a) `df_g_theme_preset_colors__$(a.name_lower)`, } - -// TODO(rjf): OLD vvvvvvvvv -@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 ) -} - @data(String8) df_g_theme_color_display_string_table: { @expand(DF_ThemeColorTable a) `str8_lit_comp("$(a.display_name)")` diff --git a/src/df/gfx/generated/df_gfx.meta.c b/src/df/gfx/generated/df_gfx.meta.c index ac28cae7..6f0fc162 100644 --- a/src/df/gfx/generated/df_gfx.meta.c +++ b/src/df/gfx/generated/df_gfx.meta.c @@ -251,7 +251,7 @@ str8_lit_comp("four_coder"), str8_lit_comp("far_manager"), }; -String8 df_g_theme_color_version_remap_old_name_table[30] = +String8 df_g_theme_color_version_remap_old_name_table[22] = { str8_lit_comp("plain_text"), str8_lit_comp("plain_background"), @@ -264,59 +264,43 @@ str8_lit_comp("line_info_0"), str8_lit_comp("line_info_1"), str8_lit_comp("line_info_2"), str8_lit_comp("line_info_3"), -str8_lit_comp("alt_text"), str8_lit_comp("alt_background"), str8_lit_comp("alt_border"), -str8_lit_comp("alt_overlay"), str8_lit_comp("tab_inactive"), str8_lit_comp("tab_active"), str8_lit_comp("weak_text"), str8_lit_comp("text_selection"), str8_lit_comp("cursor"), str8_lit_comp("highlight_0"), -str8_lit_comp("success_text"), str8_lit_comp("success_background"), -str8_lit_comp("success_border"), -str8_lit_comp("failure_text"), str8_lit_comp("failure_background"), -str8_lit_comp("failure_border"), -str8_lit_comp("action_text"), str8_lit_comp("action_background"), -str8_lit_comp("action_border"), }; -String8 df_g_theme_color_version_remap_new_name_table[30] = +String8 df_g_theme_color_version_remap_new_name_table[22] = { -str8_lit_comp("default_text"), -str8_lit_comp("default_background"), -str8_lit_comp("default_border"), +str8_lit_comp("text"), +str8_lit_comp("base_background"), +str8_lit_comp("base_border"), str8_lit_comp("drop_site_overlay"), -str8_lit_comp("code_procedure"), +str8_lit_comp("code_symbol"), str8_lit_comp("code_delimiter_operator"), str8_lit_comp("code_numeric_alt_digit_group"), str8_lit_comp("line_info_background_0"), str8_lit_comp("line_info_background_1"), str8_lit_comp("line_info_background_2"), str8_lit_comp("line_info_background_3"), -str8_lit_comp("menu_bar_text"), str8_lit_comp("menu_bar_background"), str8_lit_comp("menu_bar_border"), -str8_lit_comp("drop_site_overlay"), -str8_lit_comp("tab_inactive_background"), -str8_lit_comp("tab_active_background"), -str8_lit_comp("default_text_weak"), +str8_lit_comp("tab_background_inactive"), +str8_lit_comp("tab_background"), +str8_lit_comp("text_weak"), str8_lit_comp("selection"), -str8_lit_comp("cursor_active"), -str8_lit_comp("focus_active"), -str8_lit_comp("special_positive_text"), -str8_lit_comp("special_positive_background"), -str8_lit_comp("special_positive_border"), -str8_lit_comp("special_negative_text"), -str8_lit_comp("special_negative_background"), -str8_lit_comp("special_negative_border"), -str8_lit_comp("special_neutral_text"), -str8_lit_comp("special_neutral_background"), -str8_lit_comp("special_neutral_border"), +str8_lit_comp("cursor"), +str8_lit_comp("focus"), +str8_lit_comp("positive_pop_button_background"), +str8_lit_comp("negative_pop_button_background"), +str8_lit_comp("neutral_pop_button_background"), }; Vec4F32 df_g_theme_preset_colors__default_dark[75] = @@ -464,15 +448,15 @@ rgba_from_u32_lit_comp(0x99503d3f), rgba_from_u32_lit_comp(0xfe82493f), rgba_from_u32_lit_comp(0xffba173f), rgba_from_u32_lit_comp(0xcefd693f), -rgba_from_u32_lit_comp(0xd07c00ff), -rgba_from_u32_lit_comp(0xb2ff65ff), -rgba_from_u32_lit_comp(0xff99e5ff), -rgba_from_u32_lit_comp(0x6598ffff), -rgba_from_u32_lit_comp(0x65ffcbff), -rgba_from_u32_lit_comp(0xff9819ff), -rgba_from_u32_lit_comp(0x9932ffff), -rgba_from_u32_lit_comp(0x65ff4cff), -rgba_from_u32_lit_comp(0xb2ccd8ff), +rgba_from_u32_lit_comp(0x945800ff), +rgba_from_u32_lit_comp(0x3f5b23ff), +rgba_from_u32_lit_comp(0x642a55ff), +rgba_from_u32_lit_comp(0x30456fff), +rgba_from_u32_lit_comp(0x264f41ff), +rgba_from_u32_lit_comp(0x736a5fff), +rgba_from_u32_lit_comp(0x472f5eff), +rgba_from_u32_lit_comp(0x405d3bff), +rgba_from_u32_lit_comp(0x49606aff), rgba_from_u32_lit_comp(0xb23219ff), rgba_from_u32_lit_comp(0xff2800ff), }; @@ -622,15 +606,15 @@ rgba_from_u32_lit_comp(0x99503d3f), rgba_from_u32_lit_comp(0xfe82493f), rgba_from_u32_lit_comp(0xffba173f), rgba_from_u32_lit_comp(0xcefd693f), -rgba_from_u32_lit_comp(0xffcb7fff), -rgba_from_u32_lit_comp(0xb2ff65ff), -rgba_from_u32_lit_comp(0xff99e5ff), -rgba_from_u32_lit_comp(0x6598ffff), -rgba_from_u32_lit_comp(0x65ffcbff), -rgba_from_u32_lit_comp(0xff9819ff), -rgba_from_u32_lit_comp(0x9932ffff), -rgba_from_u32_lit_comp(0x65ff4cff), -rgba_from_u32_lit_comp(0xb2ccd8ff), +rgba_from_u32_lit_comp(0x945800ff), +rgba_from_u32_lit_comp(0x3f5b23ff), +rgba_from_u32_lit_comp(0x642a55ff), +rgba_from_u32_lit_comp(0x30456fff), +rgba_from_u32_lit_comp(0x264f41ff), +rgba_from_u32_lit_comp(0x736a5fff), +rgba_from_u32_lit_comp(0x472f5eff), +rgba_from_u32_lit_comp(0x405d3bff), +rgba_from_u32_lit_comp(0x49606aff), rgba_from_u32_lit_comp(0xb23219ff), rgba_from_u32_lit_comp(0xa72911ff), }; @@ -780,15 +764,15 @@ rgba_from_u32_lit_comp(0x99503d3f), rgba_from_u32_lit_comp(0xfe82493f), rgba_from_u32_lit_comp(0xffba173f), rgba_from_u32_lit_comp(0xcefd693f), -rgba_from_u32_lit_comp(0xd29233ff), -rgba_from_u32_lit_comp(0xb2ff65ff), -rgba_from_u32_lit_comp(0xff99e5ff), -rgba_from_u32_lit_comp(0x6598ffff), -rgba_from_u32_lit_comp(0x65ffcbff), -rgba_from_u32_lit_comp(0xff9819ff), -rgba_from_u32_lit_comp(0x9932ffff), -rgba_from_u32_lit_comp(0x65ff4cff), -rgba_from_u32_lit_comp(0xb2ccd8ff), +rgba_from_u32_lit_comp(0x945800ff), +rgba_from_u32_lit_comp(0x3f5b23ff), +rgba_from_u32_lit_comp(0x642a55ff), +rgba_from_u32_lit_comp(0x30456fff), +rgba_from_u32_lit_comp(0x264f41ff), +rgba_from_u32_lit_comp(0x736a5fff), +rgba_from_u32_lit_comp(0x472f5eff), +rgba_from_u32_lit_comp(0x405d3bff), +rgba_from_u32_lit_comp(0x49606aff), rgba_from_u32_lit_comp(0xb23218ff), rgba_from_u32_lit_comp(0xff684bff), }; diff --git a/src/df/gfx/generated/df_gfx.meta.h b/src/df/gfx/generated/df_gfx.meta.h index 592a8b9d..7710a112 100644 --- a/src/df/gfx/generated/df_gfx.meta.h +++ b/src/df/gfx/generated/df_gfx.meta.h @@ -323,8 +323,8 @@ 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[30]; -extern String8 df_g_theme_color_version_remap_new_name_table[30]; +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]; From 5e093a9b4c2bd69179ad2b444a9d0ced88d901e8 Mon Sep 17 00:00:00 2001 From: Ryan Fleury Date: Wed, 26 Jun 2024 17:54:54 -0700 Subject: [PATCH 46/47] notes --- src/raddbg/raddbg.h | 77 ++++++++++++++++++++++----------------------- 1 file changed, 37 insertions(+), 40 deletions(-) diff --git a/src/raddbg/raddbg.h b/src/raddbg/raddbg.h index cc94f995..ea8d9f09 100644 --- a/src/raddbg/raddbg.h +++ b/src/raddbg/raddbg.h @@ -4,26 +4,7 @@ //////////////////////////////// //~ rjf: 0.9.11 TODO // -// [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 -// [ ] auto-scroll output window -// -// [ ] 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. +// [ ] auto-scroll output window // // [ ] inline breakpoint hit_count // [ ] to count hit counts, resolve all bps to addresses, check addresses @@ -39,6 +20,15 @@ //////////////////////////////// //~ rjf: Frontend/UI Pass Tasks // +// [ ] 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 // @@ -139,10 +129,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. // -// [ ] 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. @@ -159,19 +145,6 @@ //////////////////////////////// //~ 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 @@ -193,9 +166,6 @@ // [ ] 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 @@ -420,6 +390,33 @@ // [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. #ifndef RADDBG_H #define RADDBG_H From c05ceedfcb3dceca7dc60503afebd1739415a1a0 Mon Sep 17 00:00:00 2001 From: Ryan Fleury Date: Wed, 26 Jun 2024 18:12:27 -0700 Subject: [PATCH 47/47] fix clang build --- build.bat | 2 +- src/df/core/df_core.h | 1 - src/raddbg/raddbg.h | 11 ++--------- src/ui/ui_core.h | 2 +- 4 files changed, 4 insertions(+), 12 deletions(-) diff --git a/build.bat b/build.bat index 6f21ceef..234a4f1c 100644 --- a/build.bat +++ b/build.bat @@ -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% diff --git a/src/df/core/df_core.h b/src/df/core/df_core.h index 95825753..f4cb69d1 100644 --- a/src/df/core/df_core.h +++ b/src/df/core/df_core.h @@ -1365,7 +1365,6 @@ read_only global DF_Entity df_g_nil_entity = 0, 0, 0, - 0, // rjf: allocationless, simple equipment {0}, diff --git a/src/raddbg/raddbg.h b/src/raddbg/raddbg.h index ea8d9f09..7cf9d53b 100644 --- a/src/raddbg/raddbg.h +++ b/src/raddbg/raddbg.h @@ -2,24 +2,16 @@ // Licensed under the MIT license (https://opensource.org/license/mit/) //////////////////////////////// -//~ rjf: 0.9.11 TODO +//~ rjf: Frontend/UI Pass Tasks // // [ ] auto-scroll output window -// // [ ] inline breakpoint hit_count // [ ] to count hit counts, resolve all bps to addresses, check addresses // against stopper thread's -// -// [ ] colors: fill out rest of theme presets for new theme setup -// // [ ] editing multiple bindings for commands // [ ] theme lister -> fonts & font sizes // [ ] "Browse..." buttons should adopt a more relevant starting search path, // if possible - -//////////////////////////////// -//~ rjf: Frontend/UI Pass Tasks -// // [ ] 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 @@ -417,6 +409,7 @@ // [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 diff --git a/src/ui/ui_core.h b/src/ui/ui_core.h index 26c4659c..2dc8c391 100644 --- a/src/ui/ui_core.h +++ b/src/ui/ui_core.h @@ -1023,7 +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()) +#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())