adjust metagen to support correctly-escaped multiline string generations; sketch out setting schemas; eliminate old settings hack, move to using cfg tree & settings schema

This commit is contained in:
Ryan Fleury
2025-01-23 11:39:55 -08:00
parent 45f02b7a41
commit 50000c0d6b
32 changed files with 2014 additions and 592 deletions
+5 -119
View File
@@ -73,11 +73,12 @@ RD_VocabularyInfo rd_vocabulary_info_table[41] =
{str8_lit_comp("label"), str8_lit_comp("labels"), str8_lit_comp("Label"), str8_lit_comp("Labels"), RD_IconKind_Null},
};
RD_CfgNameSchemaPair rd_cfg_name_schema_pair_table[5] =
RD_CfgNameSchemaPair rd_cfg_name_schema_pair_table[6] =
{
{str8_lit_comp("target"), str8_lit_comp("x:{'label':code_string, 'exe':path, 'args':string, 'working_directory':path, 'entry_point':code_string, 'stdout_path':path, 'stderr_path':path, 'stdin_path':path, 'debug_subprocesses':bool}")},
{str8_lit_comp("breakpoint"), str8_lit_comp("x:{'label':code_string, 'condition':code_string, 'location':location, 'hit_count':u64, 'enabled':bool}")},
{str8_lit_comp("watch_pin"), str8_lit_comp("x:{'expression':code_string, 'view_rule':code_string, 'location':location}")},
{str8_lit_comp("settings"), str8_lit_comp("x:\n{\n @default(1) 'hover_animations': bool,\n @default(1) 'press_animations': bool,\n @default(0) 'focus_animations': bool,\n @default(1) 'tooltip_animations': bool,\n @default(1) 'menu_animations': bool,\n @default(1) 'scrolling_animations': bool,\n @default(1) 'background_blur': bool,\n @default(1) 'thread_lines': bool,\n @default(1) 'breakpoint_lines': bool,\n @default(1) 'thread_glow': bool,\n @default(1) 'breakpoint_glow': bool,\n @default(0) 'opaque_backgrounds': bool,\n @default(1) 'smooth_main_text': bool,\n @default(0) 'smooth_code_text': bool,\n @default(1) 'hint_main_text': bool,\n @default(1) 'hint_code_text': bool,\n @default(2) 'tab_width': @range[1, 32] u64,\n @can_be_per_window 'main_font_size': @range[6, 72] u64,\n @can_be_per_window 'code_font_size': @range[1, 32] u64,\n}\n")},
{str8_lit_comp("target"), str8_lit_comp("x:\n{\n 'label': code_string,\n 'exe': path,\n 'args': string,\n 'working_directory': path,\n 'entry_point': code_string,\n 'stdout_path': path,\n 'stderr_path': path,\n 'stdin_path': path,\n 'debug_subprocesses': bool,\n}\n")},
{str8_lit_comp("breakpoint"), str8_lit_comp("x:\n{\n 'label': code_string,\n 'condition': code_string,\n 'location': location,\n 'hit_count': u64,\n 'disabled': bool,\n}\n")},
{str8_lit_comp("watch_pin"), str8_lit_comp("x:\n{\n 'expression':code_string,\n 'view_rule':code_string,\n 'location':location,\n}\n")},
{str8_lit_comp("file_path_map"), str8_lit_comp("x:{'source':path, 'dest':path}")},
{str8_lit_comp("auto_view_rule"), str8_lit_comp("x:{'source':code_string, 'dest':code_string}")},
};
@@ -1897,120 +1898,5 @@ str8_lit_comp("breakpoint"),
str8_lit_comp("cache_line_boundary"),
};
String8 rd_setting_code_display_string_table[19] =
{
str8_lit_comp("Hover Animations"),
str8_lit_comp("Press Animations"),
str8_lit_comp("Focus Animations"),
str8_lit_comp("Tooltip Animations"),
str8_lit_comp("Menu Animations"),
str8_lit_comp("Scrolling Animations"),
str8_lit_comp("Background Blur"),
str8_lit_comp("Thread Lines"),
str8_lit_comp("Breakpoint Lines"),
str8_lit_comp("Thread Glow"),
str8_lit_comp("Breakpoint Glow"),
str8_lit_comp("Opaque Backgrounds"),
str8_lit_comp("Tab Width"),
str8_lit_comp("Main Font Size"),
str8_lit_comp("Code Font Size"),
str8_lit_comp("Smooth UI Text"),
str8_lit_comp("Smooth Code Text"),
str8_lit_comp("Hint UI Text"),
str8_lit_comp("Hint Code Text"),
};
String8 rd_setting_code_lower_string_table[19] =
{
str8_lit_comp("hover_animations"),
str8_lit_comp("press_animations"),
str8_lit_comp("focus_animations"),
str8_lit_comp("tooltip_animations"),
str8_lit_comp("menu_animations"),
str8_lit_comp("scrolling_animations"),
str8_lit_comp("background_blur"),
str8_lit_comp("thread_lines"),
str8_lit_comp("breakpoint_lines"),
str8_lit_comp("thread_glow"),
str8_lit_comp("breakpoint_glow"),
str8_lit_comp("opaque_backgrounds"),
str8_lit_comp("tab_width"),
str8_lit_comp("main_font_size"),
str8_lit_comp("code_font_size"),
str8_lit_comp("smooth_ui_text"),
str8_lit_comp("smooth_code_text"),
str8_lit_comp("hint_ui_text"),
str8_lit_comp("hint_code_text"),
};
B8 rd_setting_code_default_is_per_window_table[19] =
{
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
1,
1,
1,
1,
1,
};
RD_SettingVal rd_setting_code_default_val_table[19] =
{
{1, 1},
{1, 1},
{1, 0},
{1, 1},
{1, 1},
{1, 1},
{1, 1},
{1, 1},
{1, 1},
{1, 1},
{1, 1},
{1, 0},
{1, 4},
{1, 11},
{1, 11},
{1, 1},
{1, 0},
{1, 1},
{1, 1},
};
Rng1S32 rd_setting_code_s32_range_table[19] =
{
{0, 1},
{0, 1},
{0, 1},
{0, 1},
{0, 1},
{0, 1},
{0, 1},
{0, 1},
{0, 1},
{0, 1},
{0, 1},
{0, 1},
{1, 32},
{6, 72},
{6, 72},
{0, 1},
{0, 1},
{0, 1},
{0, 1},
};
C_LINKAGE_END
+1 -30
View File
@@ -512,30 +512,6 @@ RD_ThemePreset_FarManager,
RD_ThemePreset_COUNT,
} RD_ThemePreset;
typedef enum RD_SettingCode
{
RD_SettingCode_HoverAnimations,
RD_SettingCode_PressAnimations,
RD_SettingCode_FocusAnimations,
RD_SettingCode_TooltipAnimations,
RD_SettingCode_MenuAnimations,
RD_SettingCode_ScrollingAnimations,
RD_SettingCode_BackgroundBlur,
RD_SettingCode_ThreadLines,
RD_SettingCode_BreakpointLines,
RD_SettingCode_ThreadGlow,
RD_SettingCode_BreakpointGlow,
RD_SettingCode_OpaqueBackgrounds,
RD_SettingCode_TabWidth,
RD_SettingCode_MainFontSize,
RD_SettingCode_CodeFontSize,
RD_SettingCode_SmoothUIText,
RD_SettingCode_SmoothCodeText,
RD_SettingCode_HintUIText,
RD_SettingCode_HintCodeText,
RD_SettingCode_COUNT,
} RD_SettingCode;
typedef struct RD_VocabularyInfo RD_VocabularyInfo;
struct RD_VocabularyInfo
{
@@ -781,7 +757,7 @@ extern String8 rd_cfg_src_string_table[4];
extern RD_CmdKind rd_cfg_src_load_cmd_kind_table[4];
extern RD_CmdKind rd_cfg_src_write_cmd_kind_table[4];
extern RD_VocabularyInfo rd_vocabulary_info_table[41];
extern RD_CfgNameSchemaPair rd_cfg_name_schema_pair_table[5];
extern RD_CfgNameSchemaPair rd_cfg_name_schema_pair_table[6];
extern String8 d_entity_kind_display_string_table[27];
extern String8 d_entity_kind_name_lower_table[27];
extern String8 d_entity_kind_name_lower_plural_table[27];
@@ -817,11 +793,6 @@ extern Vec4F32 rd_theme_preset_colors__far_manager[76];
extern Vec4F32* rd_theme_preset_colors_table[9];
extern String8 rd_theme_color_display_string_table[76];
extern String8 rd_theme_color_cfg_string_table[76];
extern String8 rd_setting_code_display_string_table[19];
extern String8 rd_setting_code_lower_string_table[19];
extern B8 rd_setting_code_default_is_per_window_table[19];
extern RD_SettingVal rd_setting_code_default_val_table[19];
extern Rng1S32 rd_setting_code_s32_range_table[19];
read_only global U8 rd_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,