first pass at new theme color table, scheme-based ui color specification

This commit is contained in:
Ryan Fleury
2024-06-20 15:28:48 -07:00
parent ce1f54a931
commit 3b27abd5c7
18 changed files with 2754 additions and 2462 deletions
-9
View File
@@ -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:
-2
View File
@@ -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" }
+1 -3
View File
@@ -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},
-2
View File
@@ -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,
+558 -615
View File
File diff suppressed because it is too large Load Diff
+27 -4
View File
@@ -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
+275 -243
View File
@@ -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:
+10 -12
View File
@@ -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);
}
+532 -532
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+84 -51
View File
@@ -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,
+6 -36
View File
@@ -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) }
+11 -66
View File
@@ -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);
+26 -31
View File
@@ -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
+6 -39
View File
@@ -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(""));
}
-2
View File
@@ -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);
+42 -68
View File
@@ -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)
{
+78 -58
View File
@@ -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())