Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/BKE_context.h1
-rw-r--r--source/blender/blenkernel/intern/context.c9
-rw-r--r--source/blender/blenkernel/intern/screen.c3
-rw-r--r--source/blender/blenloader/intern/versioning_userdef.c2
-rw-r--r--source/blender/editors/CMakeLists.txt1
-rw-r--r--source/blender/editors/include/ED_space_api.h1
-rw-r--r--source/blender/editors/interface/interface_template_search_menu.c1
-rw-r--r--source/blender/editors/interface/resources.c3
-rw-r--r--source/blender/editors/space_api/CMakeLists.txt1
-rw-r--r--source/blender/editors/space_api/spacetypes.c1
-rw-r--r--source/blender/editors/space_spreadsheet/CMakeLists.txt39
-rw-r--r--source/blender/editors/space_spreadsheet/space_spreadsheet.cc221
-rw-r--r--source/blender/editors/space_spreadsheet/spreadsheet_intern.hh19
-rw-r--r--source/blender/editors/space_spreadsheet/spreadsheet_ops.cc21
-rw-r--r--source/blender/makesdna/DNA_space_types.h19
-rw-r--r--source/blender/makesdna/DNA_userdef_types.h3
-rw-r--r--source/blender/makesrna/RNA_access.h1
-rw-r--r--source/blender/makesrna/intern/rna_screen.c4
-rw-r--r--source/blender/makesrna/intern/rna_space.c16
-rw-r--r--source/blender/makesrna/intern/rna_userdef.c28
-rw-r--r--source/blender/windowmanager/WM_types.h1
21 files changed, 393 insertions, 2 deletions
diff --git a/source/blender/blenkernel/BKE_context.h b/source/blender/blenkernel/BKE_context.h
index 94392dd78da..3d30188e517 100644
--- a/source/blender/blenkernel/BKE_context.h
+++ b/source/blender/blenkernel/BKE_context.h
@@ -197,6 +197,7 @@ struct SpaceInfo *CTX_wm_space_info(const bContext *C);
struct SpaceUserPref *CTX_wm_space_userpref(const bContext *C);
struct SpaceClip *CTX_wm_space_clip(const bContext *C);
struct SpaceTopBar *CTX_wm_space_topbar(const bContext *C);
+struct SpaceSpreadsheet *CTX_wm_space_spreadsheet(const bContext *C);
void CTX_wm_manager_set(bContext *C, struct wmWindowManager *wm);
void CTX_wm_window_set(bContext *C, struct wmWindow *win);
diff --git a/source/blender/blenkernel/intern/context.c b/source/blender/blenkernel/intern/context.c
index 6bc385ecd31..cbf7a4483c0 100644
--- a/source/blender/blenkernel/intern/context.c
+++ b/source/blender/blenkernel/intern/context.c
@@ -914,6 +914,15 @@ struct SpaceTopBar *CTX_wm_space_topbar(const bContext *C)
return NULL;
}
+struct SpaceSpreadsheet *CTX_wm_space_spreadsheet(const bContext *C)
+{
+ ScrArea *area = CTX_wm_area(C);
+ if (area && area->spacetype == SPACE_SPREADSHEET) {
+ return area->spacedata.first;
+ }
+ return NULL;
+}
+
void CTX_wm_manager_set(bContext *C, wmWindowManager *wm)
{
C->wm.manager = wm;
diff --git a/source/blender/blenkernel/intern/screen.c b/source/blender/blenkernel/intern/screen.c
index 623f3a349d8..aa1a9403908 100644
--- a/source/blender/blenkernel/intern/screen.c
+++ b/source/blender/blenkernel/intern/screen.c
@@ -1342,6 +1342,9 @@ static void write_area_regions(BlendWriter *writer, ScrArea *area)
else if (sl->spacetype == SPACE_INFO) {
BLO_write_struct(writer, SpaceInfo, sl);
}
+ else if (sl->spacetype == SPACE_SPREADSHEET) {
+ BLO_write_struct(writer, SpaceSpreadsheet, sl);
+ }
}
}
diff --git a/source/blender/blenloader/intern/versioning_userdef.c b/source/blender/blenloader/intern/versioning_userdef.c
index 3d39181cd32..ae22c5151cc 100644
--- a/source/blender/blenloader/intern/versioning_userdef.c
+++ b/source/blender/blenloader/intern/versioning_userdef.c
@@ -282,6 +282,8 @@ static void do_versions_theme(const UserDef *userdef, bTheme *btheme)
FROM_DEFAULT_V4_UCHAR(space_info.info_property);
FROM_DEFAULT_V4_UCHAR(space_info.info_error);
FROM_DEFAULT_V4_UCHAR(space_info.info_operator);
+
+ btheme->space_spreadsheet = btheme->space_outliner;
}
#undef FROM_DEFAULT_V4_UCHAR
diff --git a/source/blender/editors/CMakeLists.txt b/source/blender/editors/CMakeLists.txt
index a2ae350ce4b..092198cea86 100644
--- a/source/blender/editors/CMakeLists.txt
+++ b/source/blender/editors/CMakeLists.txt
@@ -53,6 +53,7 @@ if(WITH_BLENDER)
add_subdirectory(space_outliner)
add_subdirectory(space_script)
add_subdirectory(space_sequencer)
+ add_subdirectory(space_spreadsheet)
add_subdirectory(space_statusbar)
add_subdirectory(space_text)
add_subdirectory(space_topbar)
diff --git a/source/blender/editors/include/ED_space_api.h b/source/blender/editors/include/ED_space_api.h
index fc474ea464d..1a3aa7e5496 100644
--- a/source/blender/editors/include/ED_space_api.h
+++ b/source/blender/editors/include/ED_space_api.h
@@ -55,6 +55,7 @@ void ED_spacetype_userpref(void);
void ED_spacetype_clip(void);
void ED_spacetype_statusbar(void);
void ED_spacetype_topbar(void);
+void ED_spacetype_spreadsheet(void);
/* calls for instancing and freeing spacetype static data
* called in WM_init_exit */
diff --git a/source/blender/editors/interface/interface_template_search_menu.c b/source/blender/editors/interface/interface_template_search_menu.c
index e1f8f63dcbf..74668b2f3a3 100644
--- a/source/blender/editors/interface/interface_template_search_menu.c
+++ b/source/blender/editors/interface/interface_template_search_menu.c
@@ -642,6 +642,7 @@ static struct MenuSearch_Data *menu_items_from_ui_create(
SPACE_MENU_NOP(SPACE_SCRIPT);
SPACE_MENU_NOP(SPACE_STATUSBAR);
SPACE_MENU_NOP(SPACE_TOPBAR);
+ SPACE_MENU_NOP(SPACE_SPREADSHEET);
}
}
for (int i = 0; i < idname_array_len; i++) {
diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c
index 80e54f4f92f..afac254f542 100644
--- a/source/blender/editors/interface/resources.c
+++ b/source/blender/editors/interface/resources.c
@@ -160,6 +160,9 @@ const uchar *UI_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colorid)
case SPACE_STATUSBAR:
ts = &btheme->space_statusbar;
break;
+ case SPACE_SPREADSHEET:
+ ts = &btheme->space_spreadsheet;
+ break;
default:
ts = &btheme->space_view3d;
break;
diff --git a/source/blender/editors/space_api/CMakeLists.txt b/source/blender/editors/space_api/CMakeLists.txt
index 573afb76f0e..85c07223f2d 100644
--- a/source/blender/editors/space_api/CMakeLists.txt
+++ b/source/blender/editors/space_api/CMakeLists.txt
@@ -50,6 +50,7 @@ set(LIB
bf_editor_space_outliner
bf_editor_space_script
bf_editor_space_sequencer
+ bf_editor_space_spreadsheet
bf_editor_space_statusbar
bf_editor_space_text
bf_editor_space_topbar
diff --git a/source/blender/editors/space_api/spacetypes.c b/source/blender/editors/space_api/spacetypes.c
index ff05fb3bad6..adb824b8934 100644
--- a/source/blender/editors/space_api/spacetypes.c
+++ b/source/blender/editors/space_api/spacetypes.c
@@ -95,6 +95,7 @@ void ED_spacetypes_init(void)
ED_spacetype_clip();
ED_spacetype_statusbar();
ED_spacetype_topbar();
+ ED_spacetype_spreadsheet();
/* Register operator types for screen and all spaces. */
ED_operatortypes_userpref();
diff --git a/source/blender/editors/space_spreadsheet/CMakeLists.txt b/source/blender/editors/space_spreadsheet/CMakeLists.txt
new file mode 100644
index 00000000000..8be5f506dd7
--- /dev/null
+++ b/source/blender/editors/space_spreadsheet/CMakeLists.txt
@@ -0,0 +1,39 @@
+# ***** BEGIN GPL LICENSE BLOCK *****
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+# ***** END GPL LICENSE BLOCK *****
+
+set(INC
+ ../include
+ ../../blenkernel
+ ../../blenlib
+ ../../makesdna
+ ../../makesrna
+ ../../windowmanager
+ ../../../../intern/glew-mx
+ ../../../../intern/guardedalloc
+)
+
+set(SRC
+ space_spreadsheet.cc
+ spreadsheet_ops.cc
+
+ spreadsheet_intern.hh
+)
+
+set(LIB
+)
+
+blender_add_lib(bf_editor_space_spreadsheet "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")
diff --git a/source/blender/editors/space_spreadsheet/space_spreadsheet.cc b/source/blender/editors/space_spreadsheet/space_spreadsheet.cc
new file mode 100644
index 00000000000..27276b4bedc
--- /dev/null
+++ b/source/blender/editors/space_spreadsheet/space_spreadsheet.cc
@@ -0,0 +1,221 @@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#include <cstring>
+
+#include "BLI_listbase.h"
+
+#include "BKE_screen.h"
+
+#include "ED_screen.h"
+#include "ED_space_api.h"
+
+#include "DNA_scene_types.h"
+#include "DNA_screen_types.h"
+#include "DNA_space_types.h"
+
+#include "MEM_guardedalloc.h"
+
+#include "UI_resources.h"
+#include "UI_view2d.h"
+
+#include "RNA_access.h"
+
+#include "WM_api.h"
+#include "WM_types.h"
+
+#include "spreadsheet_intern.hh"
+
+static SpaceLink *spreadsheet_create(const ScrArea *UNUSED(area), const Scene *UNUSED(scene))
+{
+ SpaceSpreadsheet *spreadsheet_space = (SpaceSpreadsheet *)MEM_callocN(sizeof(SpaceSpreadsheet),
+ "spreadsheet space");
+ spreadsheet_space->spacetype = SPACE_SPREADSHEET;
+
+ {
+ /* header */
+ ARegion *region = (ARegion *)MEM_callocN(sizeof(ARegion), "spreadsheet header");
+ BLI_addtail(&spreadsheet_space->regionbase, region);
+ region->regiontype = RGN_TYPE_HEADER;
+ region->alignment = (U.uiflag & USER_HEADER_BOTTOM) ? RGN_ALIGN_BOTTOM : RGN_ALIGN_TOP;
+ }
+
+ {
+ /* main window */
+ ARegion *region = (ARegion *)MEM_callocN(sizeof(ARegion), "spreadsheet main region");
+ BLI_addtail(&spreadsheet_space->regionbase, region);
+ region->regiontype = RGN_TYPE_WINDOW;
+ }
+
+ return (SpaceLink *)spreadsheet_space;
+}
+
+static void spreadsheet_free(SpaceLink *UNUSED(sl))
+{
+}
+
+static void spreadsheet_init(wmWindowManager *UNUSED(wm), ScrArea *UNUSED(area))
+{
+}
+
+static SpaceLink *spreadsheet_duplicate(SpaceLink *sl)
+{
+ return (SpaceLink *)MEM_dupallocN(sl);
+}
+
+static void spreadsheet_keymap(wmKeyConfig *UNUSED(keyconf))
+{
+}
+
+static void spreadsheet_main_region_init(wmWindowManager *wm, ARegion *region)
+{
+ region->v2d.scroll = V2D_SCROLL_RIGHT | V2D_SCROLL_BOTTOM;
+ region->v2d.align = V2D_ALIGN_NO_NEG_X | V2D_ALIGN_NO_POS_Y;
+ region->v2d.keepzoom = V2D_LOCKZOOM_X | V2D_LOCKZOOM_Y | V2D_LIMITZOOM | V2D_KEEPASPECT;
+ region->v2d.keeptot = V2D_KEEPTOT_STRICT;
+ region->v2d.minzoom = region->v2d.maxzoom = 1.0f;
+
+ UI_view2d_region_reinit(&region->v2d, V2D_COMMONVIEW_LIST, region->winx, region->winy);
+
+ wmKeyMap *keymap = WM_keymap_ensure(wm->defaultconf, "View2D Buttons List", 0, 0);
+ WM_event_add_keymap_handler(&region->handlers, keymap);
+}
+
+static void spreadsheet_main_region_draw(const bContext *UNUSED(C), ARegion *UNUSED(region))
+{
+ UI_ThemeClearColor(TH_BACK);
+}
+
+static void spreadsheet_main_region_listener(const wmRegionListenerParams *params)
+{
+ ARegion *region = params->region;
+ wmNotifier *wmn = params->notifier;
+
+ switch (wmn->category) {
+ case NC_SCENE: {
+ switch (wmn->data) {
+ case ND_MODE:
+ case ND_OB_ACTIVE: {
+ ED_region_tag_redraw(region);
+ break;
+ }
+ }
+ break;
+ }
+ case NC_OBJECT: {
+ ED_region_tag_redraw(region);
+ break;
+ }
+ case NC_SPACE: {
+ if (wmn->data == ND_SPACE_SPREADSHEET) {
+ ED_region_tag_redraw(region);
+ }
+ break;
+ }
+ case NC_GEOM: {
+ ED_region_tag_redraw(region);
+ break;
+ }
+ }
+}
+
+static void spreadsheet_header_region_init(wmWindowManager *UNUSED(wm), ARegion *region)
+{
+ ED_region_header_init(region);
+}
+
+static void spreadsheet_header_region_draw(const bContext *C, ARegion *region)
+{
+ ED_region_header(C, region);
+}
+
+static void spreadsheet_header_region_free(ARegion *UNUSED(region))
+{
+}
+
+static void spreadsheet_header_region_listener(const wmRegionListenerParams *params)
+{
+ ARegion *region = params->region;
+ wmNotifier *wmn = params->notifier;
+
+ switch (wmn->category) {
+ case NC_SCENE: {
+ switch (wmn->data) {
+ case ND_MODE:
+ case ND_OB_ACTIVE: {
+ ED_region_tag_redraw(region);
+ break;
+ }
+ }
+ break;
+ }
+ case NC_OBJECT: {
+ ED_region_tag_redraw(region);
+ break;
+ }
+ case NC_SPACE: {
+ if (wmn->data == ND_SPACE_SPREADSHEET) {
+ ED_region_tag_redraw(region);
+ }
+ break;
+ }
+ case NC_GEOM: {
+ ED_region_tag_redraw(region);
+ break;
+ }
+ }
+}
+
+void ED_spacetype_spreadsheet(void)
+{
+ SpaceType *st = (SpaceType *)MEM_callocN(sizeof(SpaceType), "spacetype spreadsheet");
+ ARegionType *art;
+
+ st->spaceid = SPACE_SPREADSHEET;
+ strncpy(st->name, "Spreadsheet", BKE_ST_MAXNAME);
+
+ st->create = spreadsheet_create;
+ st->free = spreadsheet_free;
+ st->init = spreadsheet_init;
+ st->duplicate = spreadsheet_duplicate;
+ st->operatortypes = spreadsheet_operatortypes;
+ st->keymap = spreadsheet_keymap;
+
+ /* regions: main window */
+ art = (ARegionType *)MEM_callocN(sizeof(ARegionType), "spacetype spreadsheet region");
+ art->regionid = RGN_TYPE_WINDOW;
+ art->keymapflag = ED_KEYMAP_UI | ED_KEYMAP_VIEW2D;
+
+ art->init = spreadsheet_main_region_init;
+ art->draw = spreadsheet_main_region_draw;
+ art->listener = spreadsheet_main_region_listener;
+ BLI_addhead(&st->regiontypes, art);
+
+ /* regions: header */
+ art = (ARegionType *)MEM_callocN(sizeof(ARegionType), "spacetype spreadsheet header region");
+ art->regionid = RGN_TYPE_HEADER;
+ art->prefsizey = HEADERY;
+ art->keymapflag = 0;
+ art->keymapflag = ED_KEYMAP_UI | ED_KEYMAP_VIEW2D | ED_KEYMAP_HEADER;
+
+ art->init = spreadsheet_header_region_init;
+ art->draw = spreadsheet_header_region_draw;
+ art->free = spreadsheet_header_region_free;
+ art->listener = spreadsheet_header_region_listener;
+ BLI_addhead(&st->regiontypes, art);
+
+ BKE_spacetype_register(st);
+}
diff --git a/source/blender/editors/space_spreadsheet/spreadsheet_intern.hh b/source/blender/editors/space_spreadsheet/spreadsheet_intern.hh
new file mode 100644
index 00000000000..10a875e2c14
--- /dev/null
+++ b/source/blender/editors/space_spreadsheet/spreadsheet_intern.hh
@@ -0,0 +1,19 @@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#pragma once
+
+void spreadsheet_operatortypes(void);
diff --git a/source/blender/editors/space_spreadsheet/spreadsheet_ops.cc b/source/blender/editors/space_spreadsheet/spreadsheet_ops.cc
new file mode 100644
index 00000000000..770bd207e8d
--- /dev/null
+++ b/source/blender/editors/space_spreadsheet/spreadsheet_ops.cc
@@ -0,0 +1,21 @@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#include "spreadsheet_intern.hh"
+
+void spreadsheet_operatortypes()
+{
+}
diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h
index 856fa569645..81fd7c45baa 100644
--- a/source/blender/makesdna/DNA_space_types.h
+++ b/source/blender/makesdna/DNA_space_types.h
@@ -1840,6 +1840,22 @@ typedef struct SpaceStatusBar {
/** \} */
/* -------------------------------------------------------------------- */
+/** \name Spreadsheet
+ * \{ */
+
+typedef struct SpaceSpreadsheet {
+ SpaceLink *next, *prev;
+ /** Storage of regions for inactive spaces. */
+ ListBase regionbase;
+ char spacetype;
+ char link_flag;
+ char _pad0[6];
+ /* End 'SpaceLink' header. */
+} SpaceSpreadsheet;
+
+/** \} */
+
+/* -------------------------------------------------------------------- */
/** \name Space Defines (eSpace_Type)
* \{ */
@@ -1876,8 +1892,9 @@ typedef enum eSpace_Type {
SPACE_CLIP = 20,
SPACE_TOPBAR = 21,
SPACE_STATUSBAR = 22,
+ SPACE_SPREADSHEET = 23
-#define SPACE_TYPE_LAST SPACE_STATUSBAR
+#define SPACE_TYPE_LAST SPACE_SPREADSHEET
} eSpace_Type;
/* use for function args */
diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h
index d304641e112..bd8f3cd95a7 100644
--- a/source/blender/makesdna/DNA_userdef_types.h
+++ b/source/blender/makesdna/DNA_userdef_types.h
@@ -492,6 +492,7 @@ typedef struct bTheme {
ThemeSpace space_clip;
ThemeSpace space_topbar;
ThemeSpace space_statusbar;
+ ThemeSpace space_spreadsheet;
/* 20 sets of bone colors for this theme */
ThemeWireColor tarm[20];
@@ -507,7 +508,7 @@ typedef struct bTheme {
#define UI_THEMESPACE_START(btheme) \
(CHECK_TYPE_INLINE(btheme, bTheme *), &((btheme)->space_properties))
#define UI_THEMESPACE_END(btheme) \
- (CHECK_TYPE_INLINE(btheme, bTheme *), (&((btheme)->space_statusbar) + 1))
+ (CHECK_TYPE_INLINE(btheme, bTheme *), (&((btheme)->space_spreadsheet) + 1))
typedef struct bAddon {
struct bAddon *next, *prev;
diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h
index eecac8ca19e..74b8517f538 100644
--- a/source/blender/makesrna/RNA_access.h
+++ b/source/blender/makesrna/RNA_access.h
@@ -601,6 +601,7 @@ extern StructRNA RNA_SpaceOutliner;
extern StructRNA RNA_SpacePreferences;
extern StructRNA RNA_SpaceProperties;
extern StructRNA RNA_SpaceSequenceEditor;
+extern StructRNA RNA_SpaceSpreadsheet;
extern StructRNA RNA_SpaceTextEditor;
extern StructRNA RNA_SpaceUVEditor;
extern StructRNA RNA_SpaceView3D;
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);
diff --git a/source/blender/windowmanager/WM_types.h b/source/blender/windowmanager/WM_types.h
index 084ca2d2df5..b46a354c7ae 100644
--- a/source/blender/windowmanager/WM_types.h
+++ b/source/blender/windowmanager/WM_types.h
@@ -427,6 +427,7 @@ typedef struct wmNotifier {
#define ND_SPACE_CHANGED (19 << 16) /*sent to a new editor type after it's replaced an old one*/
#define ND_SPACE_CLIP (20 << 16)
#define ND_SPACE_FILE_PREVIEW (21 << 16)
+#define ND_SPACE_SPREADSHEET (22 << 16)
/* subtype, 256 entries too */
#define NOTE_SUBTYPE 0x0000FF00