[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [17798] branches/blender2.5/blender/source : 2.5

Ton Roosendaal ton at blender.org
Fri Dec 12 11:18:28 CET 2008


Revision: 17798
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=17798
Author:   ton
Date:     2008-12-12 11:18:26 +0100 (Fri, 12 Dec 2008)

Log Message:
-----------
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

Modified Paths:
--------------
    branches/blender2.5/blender/source/Makefile
    branches/blender2.5/blender/source/blender/editors/Makefile
    branches/blender2.5/blender/source/blender/editors/SConscript
    branches/blender2.5/blender/source/blender/editors/screen/area.c
    branches/blender2.5/blender/source/blender/editors/space_time/time_header.c

Added Paths:
-----------
    branches/blender2.5/blender/source/blender/editors/space_api/
    branches/blender2.5/blender/source/blender/editors/space_api/Makefile
    branches/blender2.5/blender/source/blender/editors/space_api/SConscript
    branches/blender2.5/blender/source/blender/editors/space_api/space.c
    branches/blender2.5/blender/source/blender/editors/space_api/spacetypes.c

Removed Paths:
-------------
    branches/blender2.5/blender/source/blender/editors/screen/space.c
    branches/blender2.5/blender/source/blender/editors/screen/spacetypes.c

Modified: branches/blender2.5/blender/source/Makefile
===================================================================
--- branches/blender2.5/blender/source/Makefile	2008-12-12 05:46:07 UTC (rev 17797)
+++ branches/blender2.5/blender/source/Makefile	2008-12-12 10:18:26 UTC (rev 17798)
@@ -230,19 +230,19 @@
     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/ed_screen/libed_screen.a
 PULIB += $(OCGDIR)/blender/windowmanager/libwindowmanager.a
-PULIB += $(OCGDIR)/blender/ed_screen/libed_screen.a
 PULIB += $(OCGDIR)/blender/python/$(DEBUG_DIR)libpython.a
 PULIB += $(OCGDIR)/blender/makesrna/$(DEBUG_DIR)librna.a
 

Modified: branches/blender2.5/blender/source/blender/editors/Makefile
===================================================================
--- branches/blender2.5/blender/source/blender/editors/Makefile	2008-12-12 05:46:07 UTC (rev 17797)
+++ branches/blender2.5/blender/source/blender/editors/Makefile	2008-12-12 10:18:26 UTC (rev 17798)
@@ -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

Modified: branches/blender2.5/blender/source/blender/editors/SConscript
===================================================================
--- branches/blender2.5/blender/source/blender/editors/SConscript	2008-12-12 05:46:07 UTC (rev 17797)
+++ branches/blender2.5/blender/source/blender/editors/SConscript	2008-12-12 10:18:26 UTC (rev 17798)
@@ -3,6 +3,7 @@
 
 
 SConscript(['datafiles/SConscript',
+			'space_api/SConscript',
 			'util/SConscript',
 			'interface/SConscript',
 			'mesh/SConscript',

Modified: branches/blender2.5/blender/source/blender/editors/screen/area.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/screen/area.c	2008-12-12 05:46:07 UTC (rev 17797)
+++ branches/blender2.5/blender/source/blender/editors/screen/area.c	2008-12-12 10:18:26 UTC (rev 17798)
@@ -500,4 +500,53 @@
 #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;
+			}
+		}
+	}
+	
+}
 
+

Deleted: branches/blender2.5/blender/source/blender/editors/screen/space.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/screen/space.c	2008-12-12 05:46:07 UTC (rev 17797)
+++ branches/blender2.5/blender/source/blender/editors/screen/space.c	2008-12-12 10:18:26 UTC (rev 17798)
@@ -1,102 +0,0 @@
-/**
- * $Id:
- *
- * ***** 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.
- *
- * 
- * Contributor(s): Blender Foundation
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <string.h>
-#include <stdio.h>
-
-#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;
-			}
-		}
-	}
-	
-}
-
-
-

Deleted: branches/blender2.5/blender/source/blender/editors/screen/spacetypes.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/screen/spacetypes.c	2008-12-12 05:46:07 UTC (rev 17797)
+++ branches/blender2.5/blender/source/blender/editors/screen/spacetypes.c	2008-12-12 10:18:26 UTC (rev 17798)
@@ -1,166 +0,0 @@
-/**
- * $Id: spacetypes.c
- *
- * ***** 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) Blender Foundation, 2008
- *
- * ***** END GPL/BL DUAL LICENSE BLOCK *****
- */
-
-#include <stdlib.h>
-
-#include "MEM_guardedalloc.h"
-#include "BLI_blenlib.h"
-
-#include "BKE_global.h"
-#include "BKE_screen.h"
-
-#include "UI_interface.h"
-#include "UI_view2d.h"
-
-#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)
-{
-	ARegionType *art;
-	
-	for(art= st->regiontypes.first; art; art= art->next)
-		if(art->regionid==regionid)
-			return art;
-	
-	printf("Error, region type missing in %s\n", st->name);
-	return st->regiontypes.first;
-}
-
-
-/* only call once on startup, storage is global in BKE kernel listbase */
-void ED_spacetypes_init(void)
-{
-	const ListBase *spacetypes;
-	SpaceType *type;
-
-	/* create space types */
-	ED_spacetype_outliner();
-	ED_spacetype_time();
-	ED_spacetype_view3d();
-//	ED_spacetype_ipo();
-//	...
-	
-	/* register operator types for screen and all spaces */
-	ED_operatortypes_screen();
-	ui_view2d_operatortypes();
-	
-	spacetypes = BKE_spacetypes_list();
-	for(type=spacetypes->first; type; type=type->next)
-		type->operatortypes();
-}
-
-/* called in wm.c */
-/* keymap definitions are registered only once per WM initialize, usually on file read,
-   using the keymap the actual areas/regions add the handlers */
-void ED_spacetypes_keymap(wmWindowManager *wm)
-{
-	const ListBase *spacetypes;
-	SpaceType *stype;
-	ARegionType *atype;
-
-	ED_keymap_screen(wm);
-	UI_view2d_keymap(wm);
-
-	spacetypes = BKE_spacetypes_list();
-	for(stype=spacetypes->first; stype; stype=stype->next) {
-		if(stype->keymap)
-			stype->keymap(wm);
-		for(atype=stype->regiontypes.first; atype; atype=atype->next) {
-			if(atype->keymap)
-				atype->keymap(wm);
-		}
-	}
-}
-
-/* ****************************** space template *********************** */
-
-/* allocate and init some vars */
-static SpaceLink *xxx_new(void)
-{
-	return NULL;
-}
-
-/* not spacelink itself */
-static void xxx_free(SpaceLink *sl)
-{
-
-}
-
-/* spacetype; init callback for usage, should be redoable */
-static void xxx_init(wmWindowManager *wm, ScrArea *sa)
-{
-	
-	/* link area to SpaceXXX struct */
-	
-	/* define how many regions, the order and types */
-	
-	/* add types to regions */
-}
-
-static SpaceLink *xxx_duplicate(SpaceLink *sl)
-{
-	
-	return NULL;
-}
-
-static void xxx_operatortypes(void)
-{
-	/* register operator types for this space */
-}
-
-static void xxx_keymap(wmWindowManager *wm)
-{

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list