diff options
author | Jacques Lucke <jacques@blender.org> | 2021-03-08 18:23:21 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2021-03-08 18:25:08 +0300 |
commit | 9cb5f0a2282a7a84f7f8636b43a32bdc04b51cd5 (patch) | |
tree | 59e8cbfbc6035069507dc1085c425247af40772e /source/blender/makesrna/intern | |
parent | d230c9b96c516e718014fb50914fcada1a7ec98f (diff) |
Spreadsheet: add boilerplate code for new editor type
This adds the initial boilerplate code that is required to introduce
the new spreadsheet editor. The editor is still hidden from the ui.
It can be made visible by undoing the change in `rna_screen.c`.
This patch does not contain any business logic for the spreadsheet editor.
Differential Revision: https://developer.blender.org/D10645
Ref T86279.
Diffstat (limited to 'source/blender/makesrna/intern')
-rw-r--r-- | source/blender/makesrna/intern/rna_screen.c | 4 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_space.c | 16 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_userdef.c | 28 |
3 files changed, 48 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_screen.c b/source/blender/makesrna/intern/rna_screen.c index 6cf1d7a923b..58e446381ad 100644 --- a/source/blender/makesrna/intern/rna_screen.c +++ b/source/blender/makesrna/intern/rna_screen.c @@ -201,6 +201,10 @@ static const EnumPropertyItem *rna_Area_ui_type_itemf(bContext *C, if (ELEM(item_from->value, SPACE_TOPBAR, SPACE_STATUSBAR)) { continue; } + /* Hide spreadsheet editor until we want to expose it in the ui. */ + if (item_from->value == SPACE_SPREADSHEET) { + continue; + } SpaceType *st = item_from->identifier[0] ? BKE_spacetype_from_id(item_from->value) : NULL; int totitem_prev = totitem; diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 5312aea9295..d0f366d6a18 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -145,6 +145,11 @@ const EnumPropertyItem rna_enum_space_type_items[] = { "Properties", "Edit properties of active object and related data-blocks"}, {SPACE_FILE, "FILE_BROWSER", ICON_FILEBROWSER, "File Browser", "Browse for files and assets"}, + {SPACE_SPREADSHEET, + "SPREADSHEET", + ICON_SPREADSHEET, + "Spreadsheet", + "Explore geometry data in a table"}, {SPACE_USERPREF, "PREFERENCES", ICON_PREFERENCES, @@ -571,6 +576,8 @@ static StructRNA *rna_Space_refine(struct PointerRNA *ptr) return &RNA_SpacePreferences; case SPACE_CLIP: return &RNA_SpaceClipEditor; + case SPACE_SPREADSHEET: + return &RNA_SpaceSpreadsheet; /* Currently no type info. */ case SPACE_SCRIPT: @@ -7171,6 +7178,14 @@ static void rna_def_space_clip(BlenderRNA *brna) RNA_def_property_update(prop, NC_SPACE | ND_SPACE_CLIP, NULL); } +static void rna_def_space_spreadsheet(BlenderRNA *brna) +{ + StructRNA *srna; + + srna = RNA_def_struct(brna, "SpaceSpreadsheet", "Space"); + RNA_def_struct_ui_text(srna, "Space Spreadsheet", "Spreadsheet space data"); +} + void RNA_def_space(BlenderRNA *brna) { rna_def_space(brna); @@ -7196,6 +7211,7 @@ void RNA_def_space(BlenderRNA *brna) rna_def_node_tree_path(brna); rna_def_space_node(brna); rna_def_space_clip(brna); + rna_def_space_spreadsheet(brna); } #endif diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index b06ec674e81..4097e2dddea 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -3847,6 +3847,26 @@ static void rna_def_userdef_theme_space_statusbar(BlenderRNA *brna) rna_def_userdef_theme_spaces_main(srna); } +static void rna_def_userdef_theme_space_spreadsheet(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + /* space_spreadsheet */ + + srna = RNA_def_struct(brna, "ThemeSpreadsheet", NULL); + RNA_def_struct_sdna(srna, "ThemeSpace"); + RNA_def_struct_clear_flag(srna, STRUCT_UNDO); + RNA_def_struct_ui_text(srna, "Theme Spreadsheet", "Theme settings for the Spreadsheet"); + + prop = RNA_def_property(srna, "row_alternate", PROP_FLOAT, PROP_COLOR_GAMMA); + RNA_def_property_array(prop, 4); + RNA_def_property_ui_text(prop, "Alternate Rows", "Overlay color on every other row"); + RNA_def_property_update(prop, 0, "rna_userdef_theme_update"); + + rna_def_userdef_theme_spaces_main(srna); +} + static void rna_def_userdef_themes(BlenderRNA *brna) { StructRNA *srna; @@ -3873,6 +3893,7 @@ static void rna_def_userdef_themes(BlenderRNA *brna) {20, "CLIP_EDITOR", ICON_TRACKER, "Movie Clip Editor", ""}, {21, "TOPBAR", ICON_TOPBAR, "Top Bar", ""}, {22, "STATUSBAR", ICON_STATUSBAR, "Status Bar", ""}, + {23, "SPREADSHEET", ICON_SPREADSHEET, "Spreadsheet"}, {0, NULL, 0, NULL, NULL}, }; @@ -4001,6 +4022,12 @@ static void rna_def_userdef_themes(BlenderRNA *brna) RNA_def_property_pointer_sdna(prop, NULL, "space_statusbar"); RNA_def_property_struct_type(prop, "ThemeStatusBar"); RNA_def_property_ui_text(prop, "Status Bar", ""); + + prop = RNA_def_property(srna, "spreadsheet", PROP_POINTER, PROP_NONE); + RNA_def_property_flag(prop, PROP_NEVER_NULL); + RNA_def_property_pointer_sdna(prop, NULL, "space_spreadsheet"); + RNA_def_property_struct_type(prop, "ThemeSpreadsheet"); + RNA_def_property_ui_text(prop, "Spreadsheet", ""); /* end space types */ prop = RNA_def_property(srna, "bone_color_sets", PROP_COLLECTION, PROP_NONE); @@ -4254,6 +4281,7 @@ static void rna_def_userdef_dothemes(BlenderRNA *brna) rna_def_userdef_theme_space_clip(brna); rna_def_userdef_theme_space_topbar(brna); rna_def_userdef_theme_space_statusbar(brna); + rna_def_userdef_theme_space_spreadsheet(brna); rna_def_userdef_theme_colorset(brna); rna_def_userdef_theme_collection_color(brna); rna_def_userdef_themes(brna); |