From 9d09eda0a31027c83430718e5caed3797da51b51 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 16 Feb 2019 16:13:12 +1100 Subject: DNA: rename theme space types Follow enum naming convention, use "space_" prefix instead of "t". --- source/blender/blenloader/intern/readfile.c | 4 +- .../blender/blenloader/intern/versioning_userdef.c | 40 +++++++++--------- source/blender/editors/animation/anim_filter.c | 2 +- source/blender/editors/interface/resources.c | 36 ++++++++-------- source/blender/makesdna/DNA_userdef_types.h | 34 +++++++-------- source/blender/makesdna/intern/dna_rename_defs.h | 17 ++++++++ source/blender/makesrna/intern/rna_userdef.c | 49 ++++++++++++---------- 7 files changed, 101 insertions(+), 81 deletions(-) (limited to 'source/blender') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index f5c35d9228d..5a91dcf25a7 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -8780,8 +8780,8 @@ static void do_versions_userdef(FileData *fd, BlendFileData *bfd) /* themes for Node and Sequence editor were not using grid color, but back. we copy this over then */ for (btheme = user->themes.first; btheme; btheme = btheme->next) { - copy_v4_v4_char(btheme->tnode.grid, btheme->tnode.back); - copy_v4_v4_char(btheme->tseq.grid, btheme->tseq.back); + copy_v4_v4_char(btheme->space_node.grid, btheme->space_node.back); + copy_v4_v4_char(btheme->space_sequencer.grid, btheme->space_sequencer.back); } } diff --git a/source/blender/blenloader/intern/versioning_userdef.c b/source/blender/blenloader/intern/versioning_userdef.c index 38c8808f818..056e91e9882 100644 --- a/source/blender/blenloader/intern/versioning_userdef.c +++ b/source/blender/blenloader/intern/versioning_userdef.c @@ -54,9 +54,9 @@ static void do_versions_theme(UserDef *userdef, bTheme *btheme) copy_v4_v4_char(btheme->member, U_theme_default.member); if (!USER_VERSION_ATLEAST(280, 25)) { - copy_v4_v4_char(btheme->tact.anim_preview_range, btheme->tact.anim_active); - copy_v4_v4_char(btheme->tnla.anim_preview_range, btheme->tnla.anim_active); - copy_v4_v4_char(btheme->tipo.anim_preview_range, btheme->tact.anim_active); + copy_v4_v4_char(btheme->space_action.anim_preview_range, btheme->space_action.anim_active); + copy_v4_v4_char(btheme->space_nla.anim_preview_range, btheme->space_nla.anim_active); + copy_v4_v4_char(btheme->space_graph.anim_preview_range, btheme->space_action.anim_active); } if (!USER_VERSION_ATLEAST(280, 26)) { @@ -68,26 +68,26 @@ static void do_versions_theme(UserDef *userdef, bTheme *btheme) } if (!USER_VERSION_ATLEAST(280, 27)) { - FROM_DEFAULT_V4_UCHAR(tact.shade2); - FROM_DEFAULT_V4_UCHAR(tact.hilite); - FROM_DEFAULT_V4_UCHAR(tact.group); - FROM_DEFAULT_V4_UCHAR(tact.group_active); - FROM_DEFAULT_V4_UCHAR(tact.strip_select); - FROM_DEFAULT_V4_UCHAR(tact.ds_channel); - FROM_DEFAULT_V4_UCHAR(tact.ds_subchannel); - FROM_DEFAULT_V4_UCHAR(tact.keytype_movehold); - FROM_DEFAULT_V4_UCHAR(tact.keytype_movehold_select); + FROM_DEFAULT_V4_UCHAR(space_action.shade2); + FROM_DEFAULT_V4_UCHAR(space_action.hilite); + FROM_DEFAULT_V4_UCHAR(space_action.group); + FROM_DEFAULT_V4_UCHAR(space_action.group_active); + FROM_DEFAULT_V4_UCHAR(space_action.strip_select); + FROM_DEFAULT_V4_UCHAR(space_action.ds_channel); + FROM_DEFAULT_V4_UCHAR(space_action.ds_subchannel); + FROM_DEFAULT_V4_UCHAR(space_action.keytype_movehold); + FROM_DEFAULT_V4_UCHAR(space_action.keytype_movehold_select); } if (!USER_VERSION_ATLEAST(280, 28)) { - FROM_DEFAULT_V4_UCHAR(tact.ds_ipoline); + FROM_DEFAULT_V4_UCHAR(space_action.ds_ipoline); } if (!USER_VERSION_ATLEAST(280, 29)) { - FROM_DEFAULT_V4_UCHAR(tbuts.navigation_bar); + FROM_DEFAULT_V4_UCHAR(space_properties.navigation_bar); } if (!USER_VERSION_ATLEAST(280, 31)) { - FROM_DEFAULT_V4_UCHAR(tclip.list_text); + FROM_DEFAULT_V4_UCHAR(space_clip.list_text); } if (!USER_VERSION_ATLEAST(280, 36)) { @@ -96,17 +96,17 @@ static void do_versions_theme(UserDef *userdef, bTheme *btheme) } if (!USER_VERSION_ATLEAST(280, 39)) { - FROM_DEFAULT_V4_UCHAR(tclip.metadatabg); - FROM_DEFAULT_V4_UCHAR(tclip.metadatatext); + FROM_DEFAULT_V4_UCHAR(space_clip.metadatabg); + FROM_DEFAULT_V4_UCHAR(space_clip.metadatatext); } if (!USER_VERSION_ATLEAST(280, 40)) { - FROM_DEFAULT_V4_UCHAR(tuserpref.navigation_bar); - copy_v4_v4_char(btheme->tuserpref.execution_buts, btheme->tuserpref.navigation_bar); + FROM_DEFAULT_V4_UCHAR(space_preferences.navigation_bar); + copy_v4_v4_char(btheme->space_preferences.execution_buts, btheme->space_preferences.navigation_bar); } if (!USER_VERSION_ATLEAST(280, 41)) { - FROM_DEFAULT_V4_UCHAR(tv3d.back); + FROM_DEFAULT_V4_UCHAR(space_view3d.back); } #undef FROM_DEFAULT_V4_UCHAR diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c index ca9205cdd47..06f19b8e6ba 100644 --- a/source/blender/editors/animation/anim_filter.c +++ b/source/blender/editors/animation/anim_filter.c @@ -111,7 +111,7 @@ static void animedit_get_yscale_factor(bAnimContext *ac) * NOTE: This theme setting doesn't have an ID, as it cannot be accessed normally * since it is a float, and the theme settings methods can only handle chars. */ - ac->yscale_fac = btheme->tact.keyframe_scale_fac; + ac->yscale_fac = btheme->space_action.keyframe_scale_fac; /* clamp to avoid problems with uninitialised values... */ if (ac->yscale_fac < 0.1f) diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c index bea8f8aed2b..b13b8a8a8bc 100644 --- a/source/blender/editors/interface/resources.c +++ b/source/blender/editors/interface/resources.c @@ -109,58 +109,58 @@ const uchar *UI_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colorid) switch (spacetype) { case SPACE_PROPERTIES: - ts = &btheme->tbuts; + ts = &btheme->space_properties; break; case SPACE_VIEW3D: - ts = &btheme->tv3d; + ts = &btheme->space_view3d; break; case SPACE_IPO: - ts = &btheme->tipo; + ts = &btheme->space_graph; break; case SPACE_FILE: - ts = &btheme->tfile; + ts = &btheme->space_file; break; case SPACE_NLA: - ts = &btheme->tnla; + ts = &btheme->space_nla; break; case SPACE_ACTION: - ts = &btheme->tact; + ts = &btheme->space_action; break; case SPACE_SEQ: - ts = &btheme->tseq; + ts = &btheme->space_sequencer; break; case SPACE_IMAGE: - ts = &btheme->tima; + ts = &btheme->space_image; break; case SPACE_TEXT: - ts = &btheme->text; + ts = &btheme->space_text; break; case SPACE_OUTLINER: - ts = &btheme->toops; + ts = &btheme->space_outliner; break; case SPACE_INFO: - ts = &btheme->tinfo; + ts = &btheme->space_info; break; case SPACE_USERPREF: - ts = &btheme->tuserpref; + ts = &btheme->space_preferences; break; case SPACE_CONSOLE: - ts = &btheme->tconsole; + ts = &btheme->space_console; break; case SPACE_NODE: - ts = &btheme->tnode; + ts = &btheme->space_node; break; case SPACE_CLIP: - ts = &btheme->tclip; + ts = &btheme->space_clip; break; case SPACE_TOPBAR: - ts = &btheme->ttopbar; + ts = &btheme->space_topbar; break; case SPACE_STATUSBAR: - ts = &btheme->tstatusbar; + ts = &btheme->space_statusbar; break; default: - ts = &btheme->tv3d; + ts = &btheme->space_view3d; break; } diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index cfb52c8fa14..8beed28fe3d 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -423,23 +423,23 @@ typedef struct bTheme { /* Individual Spacetypes */ /* note: ensure UI_THEMESPACE_END is updated when adding */ - ThemeSpace tbuts; - ThemeSpace tv3d; - ThemeSpace tfile; - ThemeSpace tipo; - ThemeSpace tinfo; - ThemeSpace tact; - ThemeSpace tnla; - ThemeSpace tseq; - ThemeSpace tima; - ThemeSpace text; - ThemeSpace toops; - ThemeSpace tnode; - ThemeSpace tuserpref; - ThemeSpace tconsole; - ThemeSpace tclip; - ThemeSpace ttopbar; - ThemeSpace tstatusbar; + ThemeSpace space_properties; + ThemeSpace space_view3d; + ThemeSpace space_file; + ThemeSpace space_graph; + ThemeSpace space_info; + ThemeSpace space_action; + ThemeSpace space_nla; + ThemeSpace space_sequencer; + ThemeSpace space_image; + ThemeSpace space_text; + ThemeSpace space_outliner; + ThemeSpace space_node; + ThemeSpace space_preferences; + ThemeSpace space_console; + ThemeSpace space_clip; + ThemeSpace space_topbar; + ThemeSpace space_statusbar; /* 20 sets of bone colors for this theme */ ThemeWireColor tarm[20]; diff --git a/source/blender/makesdna/intern/dna_rename_defs.h b/source/blender/makesdna/intern/dna_rename_defs.h index 4107797c8a1..babb2bd79b6 100644 --- a/source/blender/makesdna/intern/dna_rename_defs.h +++ b/source/blender/makesdna/intern/dna_rename_defs.h @@ -51,6 +51,23 @@ DNA_STRUCT_RENAME_ELEM(Camera, clipend, clip_end) DNA_STRUCT_RENAME_ELEM(Camera, clipsta, clip_start) DNA_STRUCT_RENAME_ELEM(View3D, far, clip_end) DNA_STRUCT_RENAME_ELEM(View3D, near, clip_start) +DNA_STRUCT_RENAME_ELEM(bTheme, tact, space_action) +DNA_STRUCT_RENAME_ELEM(bTheme, tbuts, space_properties) +DNA_STRUCT_RENAME_ELEM(bTheme, tclip, space_clip) +DNA_STRUCT_RENAME_ELEM(bTheme, tconsole, space_console) +DNA_STRUCT_RENAME_ELEM(bTheme, text, space_text) +DNA_STRUCT_RENAME_ELEM(bTheme, tfile, space_file) +DNA_STRUCT_RENAME_ELEM(bTheme, tima, space_image) +DNA_STRUCT_RENAME_ELEM(bTheme, tinfo, space_info) +DNA_STRUCT_RENAME_ELEM(bTheme, tipo, space_graph) +DNA_STRUCT_RENAME_ELEM(bTheme, tnla, space_nla) +DNA_STRUCT_RENAME_ELEM(bTheme, tnode, space_node) +DNA_STRUCT_RENAME_ELEM(bTheme, toops, space_outliner) +DNA_STRUCT_RENAME_ELEM(bTheme, tseq, space_sequencer) +DNA_STRUCT_RENAME_ELEM(bTheme, tstatusbar, space_statusbar) +DNA_STRUCT_RENAME_ELEM(bTheme, ttopbar, space_topbar) +DNA_STRUCT_RENAME_ELEM(bTheme, tuserpref, space_preferences) +DNA_STRUCT_RENAME_ELEM(bTheme, tv3d, space_view3d) #if 0 DNA_STRUCT_RENAME(Lamp, Light) diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index 913d29510d8..2d3fd4e6f1d 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -3255,113 +3255,116 @@ static void rna_def_userdef_themes(BlenderRNA *brna) RNA_def_property_struct_type(prop, "ThemeUserInterface"); RNA_def_property_ui_text(prop, "User Interface", ""); + /* Space Types */ prop = RNA_def_property(srna, "view_3d", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); - RNA_def_property_pointer_sdna(prop, NULL, "tv3d"); + RNA_def_property_pointer_sdna(prop, NULL, "space_view3d"); RNA_def_property_struct_type(prop, "ThemeView3D"); RNA_def_property_ui_text(prop, "3D View", ""); prop = RNA_def_property(srna, "graph_editor", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); - RNA_def_property_pointer_sdna(prop, NULL, "tipo"); + RNA_def_property_pointer_sdna(prop, NULL, "space_graph"); RNA_def_property_struct_type(prop, "ThemeGraphEditor"); RNA_def_property_ui_text(prop, "Graph Editor", ""); prop = RNA_def_property(srna, "file_browser", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); - RNA_def_property_pointer_sdna(prop, NULL, "tfile"); + RNA_def_property_pointer_sdna(prop, NULL, "space_file"); RNA_def_property_struct_type(prop, "ThemeFileBrowser"); RNA_def_property_ui_text(prop, "File Browser", ""); prop = RNA_def_property(srna, "nla_editor", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); - RNA_def_property_pointer_sdna(prop, NULL, "tnla"); + RNA_def_property_pointer_sdna(prop, NULL, "space_nla"); RNA_def_property_struct_type(prop, "ThemeNLAEditor"); RNA_def_property_ui_text(prop, "Nonlinear Animation", ""); prop = RNA_def_property(srna, "dopesheet_editor", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); - RNA_def_property_pointer_sdna(prop, NULL, "tact"); + RNA_def_property_pointer_sdna(prop, NULL, "space_action"); RNA_def_property_struct_type(prop, "ThemeDopeSheet"); RNA_def_property_ui_text(prop, "Dope Sheet", ""); prop = RNA_def_property(srna, "image_editor", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); - RNA_def_property_pointer_sdna(prop, NULL, "tima"); + RNA_def_property_pointer_sdna(prop, NULL, "space_image"); RNA_def_property_struct_type(prop, "ThemeImageEditor"); RNA_def_property_ui_text(prop, "Image Editor", ""); prop = RNA_def_property(srna, "sequence_editor", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); - RNA_def_property_pointer_sdna(prop, NULL, "tseq"); + RNA_def_property_pointer_sdna(prop, NULL, "space_sequencer"); RNA_def_property_struct_type(prop, "ThemeSequenceEditor"); RNA_def_property_ui_text(prop, "Sequence Editor", ""); prop = RNA_def_property(srna, "properties", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); - RNA_def_property_pointer_sdna(prop, NULL, "tbuts"); + RNA_def_property_pointer_sdna(prop, NULL, "space_properties"); RNA_def_property_struct_type(prop, "ThemeProperties"); RNA_def_property_ui_text(prop, "Properties", ""); prop = RNA_def_property(srna, "text_editor", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); - RNA_def_property_pointer_sdna(prop, NULL, "text"); + RNA_def_property_pointer_sdna(prop, NULL, "space_text"); RNA_def_property_struct_type(prop, "ThemeTextEditor"); RNA_def_property_ui_text(prop, "Text Editor", ""); prop = RNA_def_property(srna, "node_editor", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); - RNA_def_property_pointer_sdna(prop, NULL, "tnode"); + RNA_def_property_pointer_sdna(prop, NULL, "space_node"); RNA_def_property_struct_type(prop, "ThemeNodeEditor"); RNA_def_property_ui_text(prop, "Node Editor", ""); prop = RNA_def_property(srna, "outliner", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); - RNA_def_property_pointer_sdna(prop, NULL, "toops"); + RNA_def_property_pointer_sdna(prop, NULL, "space_outliner"); RNA_def_property_struct_type(prop, "ThemeOutliner"); RNA_def_property_ui_text(prop, "Outliner", ""); prop = RNA_def_property(srna, "info", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); - RNA_def_property_pointer_sdna(prop, NULL, "tinfo"); + RNA_def_property_pointer_sdna(prop, NULL, "space_info"); RNA_def_property_struct_type(prop, "ThemeInfo"); RNA_def_property_ui_text(prop, "Info", ""); prop = RNA_def_property(srna, "preferences", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); - RNA_def_property_pointer_sdna(prop, NULL, "tuserpref"); + RNA_def_property_pointer_sdna(prop, NULL, "space_preferences"); RNA_def_property_struct_type(prop, "ThemePreferences"); RNA_def_property_ui_text(prop, "Preferences", ""); prop = RNA_def_property(srna, "console", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); - RNA_def_property_pointer_sdna(prop, NULL, "tconsole"); + RNA_def_property_pointer_sdna(prop, NULL, "space_console"); RNA_def_property_struct_type(prop, "ThemeConsole"); RNA_def_property_ui_text(prop, "Console", ""); - prop = RNA_def_property(srna, "bone_color_sets", PROP_COLLECTION, PROP_NONE); - RNA_def_property_flag(prop, PROP_NEVER_NULL); - RNA_def_property_collection_sdna(prop, NULL, "tarm", ""); - RNA_def_property_struct_type(prop, "ThemeBoneColorSet"); - RNA_def_property_ui_text(prop, "Bone Color Sets", ""); - prop = RNA_def_property(srna, "clip_editor", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); - RNA_def_property_pointer_sdna(prop, NULL, "tclip"); + RNA_def_property_pointer_sdna(prop, NULL, "space_clip"); RNA_def_property_struct_type(prop, "ThemeClipEditor"); RNA_def_property_ui_text(prop, "Clip Editor", ""); prop = RNA_def_property(srna, "topbar", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); - RNA_def_property_pointer_sdna(prop, NULL, "ttopbar"); + RNA_def_property_pointer_sdna(prop, NULL, "space_topbar"); RNA_def_property_struct_type(prop, "ThemeTopBar"); RNA_def_property_ui_text(prop, "Top Bar", ""); prop = RNA_def_property(srna, "statusbar", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); - RNA_def_property_pointer_sdna(prop, NULL, "tstatusbar"); + RNA_def_property_pointer_sdna(prop, NULL, "space_statusbar"); RNA_def_property_struct_type(prop, "ThemeStatusBar"); RNA_def_property_ui_text(prop, "Status Bar", ""); + /* end space types */ + + prop = RNA_def_property(srna, "bone_color_sets", PROP_COLLECTION, PROP_NONE); + RNA_def_property_flag(prop, PROP_NEVER_NULL); + RNA_def_property_collection_sdna(prop, NULL, "tarm", ""); + RNA_def_property_struct_type(prop, "ThemeBoneColorSet"); + RNA_def_property_ui_text(prop, "Bone Color Sets", ""); + } static void rna_def_userdef_addon(BlenderRNA *brna) -- cgit v1.2.3