mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-08-05 05:18:40 +00:00
metagen: simplify data tables
This commit is contained in:
+44
-66
@@ -420,118 +420,100 @@ DF_ThemePresetColorTable:
|
||||
|
||||
//- rjf: theme preset color tables
|
||||
|
||||
@table_gen_data(type: String8, fallback: `{0}`)
|
||||
df_g_theme_preset_display_string_table:
|
||||
@data(String8) df_g_theme_preset_display_string_table:
|
||||
{
|
||||
@expand(DF_ThemePresetTable a) `str8_lit_comp("$(a.display_string)"),`;
|
||||
@expand(DF_ThemePresetTable a) `str8_lit_comp("$(a.display_string)")`,
|
||||
}
|
||||
|
||||
@table_gen_data(type: String8, fallback: `{0}`)
|
||||
df_g_theme_preset_code_string_table:
|
||||
@data(String8) df_g_theme_preset_code_string_table:
|
||||
{
|
||||
@expand(DF_ThemePresetTable a) `str8_lit_comp("$(a.name_lower)"),`;
|
||||
@expand(DF_ThemePresetTable a) `str8_lit_comp("$(a.name_lower)")`,
|
||||
}
|
||||
|
||||
@table_gen_data(type: Vec4F32, fallback: `{1, 0, 1, 1}`)
|
||||
df_g_theme_preset_colors__default_dark:
|
||||
@data(Vec4F32) df_g_theme_preset_colors__default_dark:
|
||||
{
|
||||
@expand(DF_ThemePresetColorTable a) `rgba_from_u32_lit_comp($(a.default_dark)),`;
|
||||
@expand(DF_ThemePresetColorTable a) `rgba_from_u32_lit_comp($(a.default_dark))`,
|
||||
}
|
||||
|
||||
@table_gen_data(type: Vec4F32, fallback: `{1, 0, 1, 1}`)
|
||||
df_g_theme_preset_colors__default_light:
|
||||
@data(Vec4F32) df_g_theme_preset_colors__default_light:
|
||||
{
|
||||
@expand(DF_ThemePresetColorTable a) `rgba_from_u32_lit_comp($(a.default_light)),`;
|
||||
@expand(DF_ThemePresetColorTable a) `rgba_from_u32_lit_comp($(a.default_light))`,
|
||||
}
|
||||
|
||||
@table_gen_data(type: Vec4F32, fallback: `{1, 0, 1, 1}`)
|
||||
df_g_theme_preset_colors__vs_dark:
|
||||
@data(Vec4F32) df_g_theme_preset_colors__vs_dark:
|
||||
{
|
||||
@expand(DF_ThemePresetColorTable a) `rgba_from_u32_lit_comp($(a.vs_dark)),`;
|
||||
@expand(DF_ThemePresetColorTable a) `rgba_from_u32_lit_comp($(a.vs_dark))`,
|
||||
}
|
||||
|
||||
@table_gen_data(type: Vec4F32, fallback: `{1, 0, 1, 1}`)
|
||||
df_g_theme_preset_colors__vs_light:
|
||||
@data(Vec4F32) df_g_theme_preset_colors__vs_light:
|
||||
{
|
||||
@expand(DF_ThemePresetColorTable a) `rgba_from_u32_lit_comp($(a.vs_light)),`;
|
||||
@expand(DF_ThemePresetColorTable a) `rgba_from_u32_lit_comp($(a.vs_light))`,
|
||||
}
|
||||
|
||||
@table_gen_data(type: Vec4F32, fallback: `{1, 0, 1, 1}`)
|
||||
df_g_theme_preset_colors__solarized_dark:
|
||||
@data(Vec4F32) df_g_theme_preset_colors__solarized_dark:
|
||||
{
|
||||
@expand(DF_ThemePresetColorTable a) `rgba_from_u32_lit_comp($(a.solarized_dark)),`;
|
||||
@expand(DF_ThemePresetColorTable a) `rgba_from_u32_lit_comp($(a.solarized_dark))`,
|
||||
}
|
||||
|
||||
@table_gen_data(type: Vec4F32, fallback: `{1, 0, 1, 1}`)
|
||||
df_g_theme_preset_colors__solarized_light:
|
||||
@data(Vec4F32) df_g_theme_preset_colors__solarized_light:
|
||||
{
|
||||
@expand(DF_ThemePresetColorTable a) `rgba_from_u32_lit_comp($(a.solarized_light)),`;
|
||||
@expand(DF_ThemePresetColorTable a) `rgba_from_u32_lit_comp($(a.solarized_light))`,
|
||||
}
|
||||
|
||||
@table_gen_data(type: Vec4F32, fallback: `{1, 0, 1, 1}`)
|
||||
df_g_theme_preset_colors__handmade_hero:
|
||||
@data(Vec4F32) df_g_theme_preset_colors__handmade_hero:
|
||||
{
|
||||
@expand(DF_ThemePresetColorTable a) `rgba_from_u32_lit_comp($(a.handmade_hero)),`;
|
||||
@expand(DF_ThemePresetColorTable a) `rgba_from_u32_lit_comp($(a.handmade_hero))`,
|
||||
}
|
||||
|
||||
@table_gen_data(type: Vec4F32, fallback: `{1, 0, 1, 1}`)
|
||||
df_g_theme_preset_colors__four_coder:
|
||||
@data(Vec4F32) df_g_theme_preset_colors__four_coder:
|
||||
{
|
||||
@expand(DF_ThemePresetColorTable a) `rgba_from_u32_lit_comp($(a.four_coder)),`;
|
||||
@expand(DF_ThemePresetColorTable a) `rgba_from_u32_lit_comp($(a.four_coder))`,
|
||||
}
|
||||
|
||||
@table_gen_data(type: Vec4F32, fallback: `{1, 0, 1, 1}`)
|
||||
df_g_theme_preset_colors__far_manager:
|
||||
@data(Vec4F32) df_g_theme_preset_colors__far_manager:
|
||||
{
|
||||
@expand(DF_ThemePresetColorTable a) `rgba_from_u32_lit_comp($(a.far_manager)),`;
|
||||
@expand(DF_ThemePresetColorTable a) `rgba_from_u32_lit_comp($(a.far_manager))`;
|
||||
}
|
||||
|
||||
@table_gen_data(type: `Vec4F32 *`, fallback: `0`)
|
||||
df_g_theme_preset_colors_table:
|
||||
@data(`Vec4F32*`) df_g_theme_preset_colors_table:
|
||||
{
|
||||
@expand(DF_ThemePresetTable a) `df_g_theme_preset_colors__$(a.name_lower),`;
|
||||
@expand(DF_ThemePresetTable a) `df_g_theme_preset_colors__$(a.name_lower)`,
|
||||
}
|
||||
|
||||
//- rjf: cmd param slot -> view spec tables
|
||||
|
||||
@table_gen_data(type: DF_CmdParamSlot, fallback:`DF_CmdParamSlot_Null`)
|
||||
df_g_cmd_param_slot_2_view_spec_src_map:
|
||||
@data(DF_CmdParamSlot) df_g_cmd_param_slot_2_view_spec_src_map:
|
||||
{
|
||||
@expand(DF_CmdParamSlot2ViewSpecMap a) `DF_CmdParamSlot_$(a.slot),`
|
||||
@expand(DF_CmdParamSlot2ViewSpecMap a) `DF_CmdParamSlot_$(a.slot)`
|
||||
}
|
||||
|
||||
@table_gen_data(type: String8, fallback:`{0}`)
|
||||
df_g_cmd_param_slot_2_view_spec_dst_map:
|
||||
@data(String8) df_g_cmd_param_slot_2_view_spec_dst_map:
|
||||
{
|
||||
@expand(DF_CmdParamSlot2ViewSpecMap a) `str8_lit_comp("$(a.view_spec)"),`
|
||||
@expand(DF_CmdParamSlot2ViewSpecMap a) `str8_lit_comp("$(a.view_spec)")`
|
||||
}
|
||||
|
||||
@table_gen_data(type: String8, fallback:`{0}`)
|
||||
df_g_cmd_param_slot_2_view_spec_cmd_map:
|
||||
@data(String8) df_g_cmd_param_slot_2_view_spec_cmd_map:
|
||||
{
|
||||
@expand(DF_CmdParamSlot2ViewSpecMap a) `str8_lit_comp("$(a.opt_cmd_spec)"),`
|
||||
@expand(DF_CmdParamSlot2ViewSpecMap a) `str8_lit_comp("$(a.opt_cmd_spec)")`
|
||||
}
|
||||
|
||||
//- rjf: default bindings table
|
||||
|
||||
@table_gen_data(type: DF_StringBindingPair, fallback: `{0}`)
|
||||
df_g_default_binding_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`)}},```;
|
||||
@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
|
||||
|
||||
@table_gen_data(type: String8, fallback: `{0}`)
|
||||
df_g_binding_version_remap_old_name_table:
|
||||
@data(String8) df_g_binding_version_remap_old_name_table:
|
||||
{
|
||||
@expand(DF_BindingVersionRemapTable a) `str8_lit_comp("$(a.old_name)"),`
|
||||
@expand(DF_BindingVersionRemapTable a) `str8_lit_comp("$(a.old_name)")`
|
||||
}
|
||||
|
||||
@table_gen_data(type: String8, fallback: `{0}`)
|
||||
df_g_binding_version_remap_new_name_table:
|
||||
@data(String8) df_g_binding_version_remap_new_name_table:
|
||||
{
|
||||
@expand(DF_BindingVersionRemapTable a) `str8_lit_comp("$(a.new_name)"),`
|
||||
@expand(DF_BindingVersionRemapTable a) `str8_lit_comp("$(a.new_name)")`
|
||||
}
|
||||
|
||||
//- rjf: view hook forward declares
|
||||
@@ -561,33 +543,29 @@ df_g_binding_version_remap_new_name_table:
|
||||
|
||||
//- rjf: gfx view rule tables
|
||||
|
||||
@table_gen_data(type: DF_GfxViewRuleSpecInfo, fallback: `{0}`) @c_file
|
||||
df_g_gfx_view_rule_spec_info_table:
|
||||
@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.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), }```;
|
||||
}
|
||||
|
||||
//- rjf: default view spec info table
|
||||
|
||||
@table_gen_data(type: DF_ViewSpecInfo, fallback: `{0}`)
|
||||
df_g_gfx_view_kind_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.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))},```;
|
||||
@expand(DF_GfxViewTable a) ```{(0|$(a.parameterized_by_entity)*DF_ViewSpecFlag_ParameterizedByEntity|$(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
|
||||
|
||||
@table_gen_data(type: String8, fallback: `str8_lit_comp("")`)
|
||||
df_g_theme_color_display_string_table:
|
||||
@data(String8) df_g_theme_color_display_string_table:
|
||||
{
|
||||
@expand(DF_ThemeTable a) `str8_lit_comp("$(a.display_name)"),`;
|
||||
@expand(DF_ThemeTable a) `str8_lit_comp("$(a.display_name)")`
|
||||
}
|
||||
|
||||
@table_gen_data(type: String8, fallback: `str8_lit_comp("")`)
|
||||
df_g_theme_color_cfg_string_table:
|
||||
@data(String8) df_g_theme_color_cfg_string_table:
|
||||
{
|
||||
@expand(DF_ThemeTable a) `str8_lit_comp("$(a.name_lower)"),`;
|
||||
@expand(DF_ThemeTable a) `str8_lit_comp("$(a.name_lower)")`
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
|
||||
@@ -786,7 +786,7 @@ rgba_from_u32_lit_comp(0x0000003f),
|
||||
rgba_from_u32_lit_comp(0x0000007f),
|
||||
};
|
||||
|
||||
Vec4F32 * df_g_theme_preset_colors_table[] =
|
||||
Vec4F32* df_g_theme_preset_colors_table[] =
|
||||
{
|
||||
df_g_theme_preset_colors__default_dark,
|
||||
df_g_theme_preset_colors__default_light,
|
||||
|
||||
Reference in New Issue
Block a user