[Bf-blender-cvs] [ea58786120f] temp-spreadsheet-editor: initial spreadsheet boilerplate code

Jacques Lucke noreply at git.blender.org
Mon Feb 22 13:12:49 CET 2021


Commit: ea58786120fc69d0437362bd817caa89224ad3f4
Author: Jacques Lucke
Date:   Mon Feb 22 11:12:23 2021 +0100
Branches: temp-spreadsheet-editor
https://developer.blender.org/rBea58786120fc69d0437362bd817caa89224ad3f4

initial spreadsheet boilerplate code

===================================================================

M	source/blender/editors/CMakeLists.txt
M	source/blender/editors/include/ED_space_api.h
M	source/blender/editors/interface/interface_template_search_menu.c
M	source/blender/editors/space_api/CMakeLists.txt
M	source/blender/editors/space_api/spacetypes.c
A	source/blender/editors/space_spreadsheet/CMakeLists.txt
A	source/blender/editors/space_spreadsheet/space_spreadsheet.cc
A	source/blender/editors/space_spreadsheet/spreadsheet_intern.hh
A	source/blender/editors/space_spreadsheet/spreadsheet_ops.cc
M	source/blender/makesdna/DNA_space_types.h
M	source/blender/makesrna/intern/rna_space.c

===================================================================

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 47c2d4f790c..2d57c4ae5f6 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 25cf2e12377..3f48c49ae17 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/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 817760615df..a64171389ef 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_api/CMakeLists.txt b/source/blender/editors/space_spreadsheet/CMakeLists.txt
similarity index 61%
copy from source/blender/editors/space_api/CMakeLists.txt
copy to source/blender/editors/space_spreadsheet/CMakeLists.txt
index 573afb76f0e..8be5f506dd7 100644
--- a/source/blender/editors/space_api/CMakeLists.txt
+++ b/source/blender/editors/space_spreadsheet/CMakeLists.txt
@@ -17,44 +17,23 @@
 
 set(INC
   ../include
-  ../io
   ../../blenkernel
   ../../blenlib
-  ../../gpu
   ../../makesdna
   ../../makesrna
   ../../windowmanager
+  ../../../../intern/glew-mx
   ../../../../intern/guardedalloc
 )
 
-set(INC_SYS
-
-)
-
 set(SRC
-  spacetypes.c
+  space_spreadsheet.cc
+  spreadsheet_ops.cc
+
+  spreadsheet_intern.hh
 )
 
 set(LIB
-  bf_editor_geometry
-  bf_editor_space_action
-  bf_editor_space_buttons
-  bf_editor_space_clip
-  bf_editor_space_console
-  bf_editor_space_file
-  bf_editor_space_graph
-  bf_editor_space_image
-  bf_editor_space_info
-  bf_editor_space_nla
-  bf_editor_space_node
-  bf_editor_space_outliner
-  bf_editor_space_script
-  bf_editor_space_sequencer
-  bf_editor_space_statusbar
-  bf_editor_space_text
-  bf_editor_space_topbar
-  bf_editor_space_userpref
-  bf_editor_space_view3d
 )
 
-blender_add_lib(bf_editor_space_api "${SRC}" "${INC}" "${INC_SYS}" "${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..8d0f9afac4a
--- /dev/null
+++ b/source/blender/editors/space_spreadsheet/space_spreadsheet.cc
@@ -0,0 +1,115 @@
+/*
+ * 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 "BLI_utildefines.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 "spreadsheet_intern.hh"
+
+static SpaceLink *spreadsheet_create(const ScrArea *UNUSED(area), const Scene *UNUSED(scene))
+{
+  return nullptr;
+}
+
+static void spreadsheet_free(SpaceLink *sl)
+{
+}
+
+static void spreadsheet_init(wmWindowManager *UNUSED(wm), ScrArea *UNUSED(area))
+{
+}
+
+static SpaceLink *spreadsheet_duplicate(SpaceLink *sl)
+{
+  return nullptr;
+}
+
+static void spreadsheet_keymap(wmKeyConfig *keyconf)
+{
+}
+
+static void spreadsheet_main_region_init(wmWindowManager *wm, ARegion *region)
+{
+}
+
+static void spreadsheet_main_region_draw(const bContext *C, ARegion *region)
+{
+}
+
+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))
+{
+}
+
+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 = 0;
+
+  art->init = spreadsheet_main_region_init;
+  art->draw = spreadsheet_main_region_draw;
+  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->init = spreadsheet_header_region_init;
+  art->draw = spreadsheet_header_region_draw;
+  art->free = spreadsheet_header_region_free;
+  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..2887091fc1a
--- /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(void)
+{
+}
diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h
index dc1775b09c6..a15aaef557f 100644
--- a/source/blender/makesdna/DNA_space_types.h
+++ b/source/blender/makesdna/DNA_space_types.h
@@ -1834,6 +1834,22 @@ typedef struct SpaceStatusBar {
 
 /** \} */
 
+/* -------------------------------------------------------------------- */
+/** \name Spreadsheet
+ * \{ */
+
+typedef struct SpaceSpreadsheet {
+  SpaceLink *n

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list