From 3b27abd5c7db3283892ec4f9bd2bd2101eb7334b Mon Sep 17 00:00:00 2001 From: Ryan Fleury Date: Thu, 20 Jun 2024 15:28:48 -0700 Subject: [PATCH] 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())