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
diff options
context:
space:
mode:
authorTon Roosendaal <ton@blender.org>2008-12-12 13:18:26 +0300
committerTon Roosendaal <ton@blender.org>2008-12-12 13:18:26 +0300
commit7f3a34d16c9eeda100a6b84d8374d848074702a2 (patch)
tree65d585aeae7cbc3868ae4e829cf6e4d88dd7e2d9
parent6f6eee09238a751c42aad9df84d7f8b2f131841c (diff)
2.5
Resolved cyclic calls for editors. Now there's a space_api/ module, here you can use functions calling other editor modules. The functions in the module are only used by the WindowManager module to initialize space types. Note for sconzers and MSVC and cmake: the proper linking order for editors is: - space_api - space_xxx - object / mesh / transform / etc - interface - util / datafiles - screen
-rw-r--r--source/Makefile6
-rw-r--r--source/blender/editors/Makefile2
-rw-r--r--source/blender/editors/SConscript1
-rw-r--r--source/blender/editors/screen/area.c49
-rw-r--r--source/blender/editors/space_api/Makefile50
-rw-r--r--source/blender/editors/space_api/SConscript15
-rw-r--r--source/blender/editors/space_api/space.c (renamed from source/blender/editors/screen/space.c)56
-rw-r--r--source/blender/editors/space_api/spacetypes.c (renamed from source/blender/editors/screen/spacetypes.c)6
-rw-r--r--source/blender/editors/space_time/time_header.c2
9 files changed, 122 insertions, 65 deletions
diff --git a/source/Makefile b/source/Makefile
index b975d9bae32..5c78c27bbc6 100644
--- a/source/Makefile
+++ b/source/Makefile
@@ -230,19 +230,19 @@ ifeq ($(WITH_OPENEXR), true)
COMLIB += $(NAN_OPENEXR_LIBS)
endif
-# silly: libed_screen.a twice :(
+# note: space_api.a in begin of editors, screen.a in end
PULIB = $(NAN_MOTO)/lib/libmoto.a
PULIB += $(NAN_ELBEEM)/lib/$(DEBUG_DIR)libelbeem.a
PULIB += $(OCGDIR)/blender/readblenfile/$(DEBUG_DIR)libreadblenfile.a
-PULIB += $(OCGDIR)/blender/ed_screen/libed_screen.a
+PULIB += $(OCGDIR)/blender/ed_space/libed_space.a
PULIB += $(OCGDIR)/blender/ed_outliner/libed_outliner.a
PULIB += $(OCGDIR)/blender/ed_time/libed_time.a
PULIB += $(OCGDIR)/blender/ed_view3d/libed_view3d.a
PULIB += $(OCGDIR)/blender/ed_interface/libed_interface.a
PULIB += $(OCGDIR)/blender/ed_util/libed_util.a
PULIB += $(OCGDIR)/blender/ed_datafiles/libed_datafiles.a
-PULIB += $(OCGDIR)/blender/windowmanager/libwindowmanager.a
PULIB += $(OCGDIR)/blender/ed_screen/libed_screen.a
+PULIB += $(OCGDIR)/blender/windowmanager/libwindowmanager.a
PULIB += $(OCGDIR)/blender/python/$(DEBUG_DIR)libpython.a
PULIB += $(OCGDIR)/blender/makesrna/$(DEBUG_DIR)librna.a
diff --git a/source/blender/editors/Makefile b/source/blender/editors/Makefile
index 297255e3469..a3cfd02cad4 100644
--- a/source/blender/editors/Makefile
+++ b/source/blender/editors/Makefile
@@ -29,6 +29,6 @@
# Bounces make to subdirectories.
SOURCEDIR = source/blender/editors
-DIRS = datafiles screen space_outliner space_time space_view3d interface util
+DIRS = datafiles screen space_outliner space_time space_view3d interface util space_api
include nan_subdirs.mk
diff --git a/source/blender/editors/SConscript b/source/blender/editors/SConscript
index 1b24eeb5471..771815193a5 100644
--- a/source/blender/editors/SConscript
+++ b/source/blender/editors/SConscript
@@ -3,6 +3,7 @@ Import ('env')
SConscript(['datafiles/SConscript',
+ 'space_api/SConscript',
'util/SConscript',
'interface/SConscript',
'mesh/SConscript',
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c
index 6fd0e9d6c03..14a7b51c03d 100644
--- a/source/blender/editors/screen/area.c
+++ b/source/blender/editors/screen/area.c
@@ -500,4 +500,53 @@ void area_copy_data(ScrArea *sa1, ScrArea *sa2, int swap_space)
#endif
}
+void ED_newspace(ScrArea *sa, int type)
+{
+ if(sa->spacetype != type) {
+ SpaceType *st= BKE_spacetype_from_id(type);
+ SpaceLink *slold= sa->spacedata.first;
+ SpaceLink *sl;
+
+ sa->spacetype= type;
+ sa->butspacetype= type;
+
+ /* check previously stored space */
+ for (sl= sa->spacedata.first; sl; sl= sl->next)
+ if(sl->spacetype==type)
+ break;
+
+ /* old spacedata... happened during work on 2.50, remove */
+ if(sl && sl->regionbase.first==NULL) {
+ st->free(sl);
+ MEM_freeN(sl);
+ sl= NULL;
+ }
+
+ if (sl) {
+
+ /* swap regions */
+ slold->regionbase= sa->regionbase;
+ sa->regionbase= sl->regionbase;
+ sl->regionbase.first= sl->regionbase.last= NULL;
+
+ /* put in front of list */
+ BLI_remlink(&sa->spacedata, sl);
+ BLI_addhead(&sa->spacedata, sl);
+ }
+ else {
+ /* new space */
+ if(st) {
+ sl= st->new();
+ BLI_addhead(&sa->spacedata, sl);
+
+ /* swap regions */
+ slold->regionbase= sa->regionbase;
+ sa->regionbase= sl->regionbase;
+ sl->regionbase.first= sl->regionbase.last= NULL;
+ }
+ }
+ }
+
+}
+
diff --git a/source/blender/editors/space_api/Makefile b/source/blender/editors/space_api/Makefile
new file mode 100644
index 00000000000..46f926afbc9
--- /dev/null
+++ b/source/blender/editors/space_api/Makefile
@@ -0,0 +1,50 @@
+#
+# $Id: Makefile 14 2002-10-13 15:57:19Z hans $
+#
+# ***** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# The Original Code is Copyright (C) 2007 Blender Foundation
+# All rights reserved.
+#
+# The Original Code is: all of this file.
+#
+# Contributor(s): none yet.
+#
+# ***** END GPL LICENSE BLOCK *****
+#
+# Makes module object directory and bounces make to subdirectories.
+
+LIBNAME = ed_space
+DIR = $(OCGDIR)/blender/$(LIBNAME)
+
+include nan_compile.mk
+
+CFLAGS += $(LEVEL_1_C_WARNINGS)
+
+CPPFLAGS += -I$(NAN_GLEW)/include
+CPPFLAGS += -I$(OPENGL_HEADERS)
+
+# not very neat....
+CPPFLAGS += -I../../blenkernel
+CPPFLAGS += -I../../blenlib
+CPPFLAGS += -I../../makesdna
+CPPFLAGS += -I../../makesrna
+CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
+
+# own include
+
+CPPFLAGS += -I../include
diff --git a/source/blender/editors/space_api/SConscript b/source/blender/editors/space_api/SConscript
new file mode 100644
index 00000000000..533c3d8b4d3
--- /dev/null
+++ b/source/blender/editors/space_api/SConscript
@@ -0,0 +1,15 @@
+#!/usr/bin/python
+Import ('env')
+
+sources = env.Glob('*.c')
+
+incs = '../include ../../blenlib ../../blenkernel ../../makesdna'
+incs += ' ../../windowmanager ../../python ../../makesrna'
+incs += ' #/intern/guardedalloc #/extern/glew/include'
+
+defs = ''
+
+if not env['WITH_BF_PYTHON']:
+ defs += 'DISABLE_PYTHON'
+
+env.BlenderLib ( 'bf_editors_space_api', sources, Split(incs), Split(defs), libtype=['core','intern'], priority=[30, 35] )
diff --git a/source/blender/editors/screen/space.c b/source/blender/editors/space_api/space.c
index e9287c9976f..df844dc527d 100644
--- a/source/blender/editors/screen/space.c
+++ b/source/blender/editors/space_api/space.c
@@ -31,72 +31,16 @@
#include "MEM_guardedalloc.h"
-#include "IMB_imbuf_types.h"
-#include "IMB_imbuf.h"
-
#include "BLI_blenlib.h"
#include "BLI_arithb.h"
#include "BKE_global.h"
#include "BKE_screen.h"
-#include "BLO_readfile.h"
-
-#include "WM_api.h"
-
#include "ED_area.h"
#include "ED_screen.h"
/* */
-void ED_newspace(ScrArea *sa, int type)
-{
- if(sa->spacetype != type) {
- SpaceType *st= BKE_spacetype_from_id(type);
- SpaceLink *slold= sa->spacedata.first;
- SpaceLink *sl;
-
- sa->spacetype= type;
- sa->butspacetype= type;
-
- /* check previously stored space */
- for (sl= sa->spacedata.first; sl; sl= sl->next)
- if(sl->spacetype==type)
- break;
-
- /* old spacedata... happened during work on 2.50, remove */
- if(sl && sl->regionbase.first==NULL) {
- st->free(sl);
- MEM_freeN(sl);
- sl= NULL;
- }
-
- if (sl) {
-
- /* swap regions */
- slold->regionbase= sa->regionbase;
- sa->regionbase= sl->regionbase;
- sl->regionbase.first= sl->regionbase.last= NULL;
-
- /* put in front of list */
- BLI_remlink(&sa->spacedata, sl);
- BLI_addhead(&sa->spacedata, sl);
- }
- else {
- /* new space */
- if(st) {
- sl= st->new();
- BLI_addhead(&sa->spacedata, sl);
-
- /* swap regions */
- slold->regionbase= sa->regionbase;
- sa->regionbase= sl->regionbase;
- sl->regionbase.first= sl->regionbase.last= NULL;
- }
- }
- }
-
-}
-
diff --git a/source/blender/editors/screen/spacetypes.c b/source/blender/editors/space_api/spacetypes.c
index d3d0bfe38d8..8997daf3a7f 100644
--- a/source/blender/editors/screen/spacetypes.c
+++ b/source/blender/editors/space_api/spacetypes.c
@@ -27,6 +27,8 @@
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
+#include "DNA_windowmanager_types.h"
+
#include "BKE_global.h"
#include "BKE_screen.h"
@@ -35,13 +37,9 @@
#include "BIF_gl.h"
-#include "WM_api.h"
-#include "WM_types.h"
-
#include "ED_screen.h"
#include "ED_area.h"
-#include "screen_intern.h" /* own module include */
ARegionType *ED_regiontype_from_id(SpaceType *st, int regionid)
{
diff --git a/source/blender/editors/space_time/time_header.c b/source/blender/editors/space_time/time_header.c
index fc3bb73e021..308e49377ad 100644
--- a/source/blender/editors/space_time/time_header.c
+++ b/source/blender/editors/space_time/time_header.c
@@ -386,7 +386,7 @@ void do_time_buttons(bContext *C, void *arg, int event)
switch(event) {
case B_NEWSPACE:
- //ED_newspace(C->area, C->area->butspacetype); // XXX for ton (breaks compiling, so disabled for now) - Aligorith
+ ED_newspace(C->area, C->area->butspacetype);
WM_event_add_notifier(C, WM_NOTE_SCREEN_CHANGED, 0, NULL);
break;
case B_REDRAWALL: