Some notes for those who try to follow this :)
authorTon Roosendaal <ton@blender.org>
Tue, 1 Jan 2008 18:29:19 +0000 (18:29 +0000)
committerTon Roosendaal <ton@blender.org>
Tue, 1 Jan 2008 18:29:19 +0000 (18:29 +0000)
- first work on getting area/screen handling back
- added structure for where to put stuff, is still under
  review, wait a bit for docs?

Campbell is working on removing every bad level include from
sources, so we can safely rebuild the src/ directory.

31 files changed:
source/Makefile
source/blender/blenkernel/BKE_blender.h
source/blender/blenkernel/intern/action.c
source/blender/blenkernel/intern/armature.c
source/blender/blenkernel/intern/blender.c
source/blender/blenkernel/intern/constraint.c
source/blender/blenkernel/intern/ipo.c
source/blender/blenkernel/intern/key.c
source/blender/blenkernel/intern/mball.c
source/blender/blenkernel/intern/nla.c
source/blender/blenkernel/intern/node.c
source/blender/blenlib/BLI_blenlib.h
source/blender/blenlib/intern/util.c
source/blender/editors/area/Makefile
source/blender/editors/area/space.c [new file with mode: 0644]
source/blender/editors/include/ED_area.h [new file with mode: 0644]
source/blender/editors/include/ED_interface.h [new file with mode: 0644]
source/blender/editors/include/ED_mesh.h [new file with mode: 0644]
source/blender/editors/include/ED_object.h [new file with mode: 0644]
source/blender/editors/include/ED_screen.h [new file with mode: 0644]
source/blender/editors/include/ED_transform.h [new file with mode: 0644]
source/blender/editors/interface/Makefile [new file with mode: 0644]
source/blender/editors/mesh/Makefile [new file with mode: 0644]
source/blender/editors/object/Makefile [new file with mode: 0644]
source/blender/editors/screen/Makefile
source/blender/editors/screen/ed_screen.c
source/blender/editors/transform/Makefile [new file with mode: 0644]
source/blender/quicktime/apple/quicktime_export.c
source/blender/windowmanager/WM_api.h
source/blender/windowmanager/intern/wm_cursors.c
source/creator/creator.c

index 8910b558e0458349de605c61557aa4da319464b0..352bcf44dcd265fed4d723621073c8f94e069ffe 100644 (file)
@@ -230,6 +230,7 @@ PULIB += $(OCGDIR)/blender/readblenfile/$(DEBUG_DIR)libreadblenfile.a
 PULIB += $(OCGDIR)/blender/windowmanager/$(DEBUG_DIR)libwindowmanager.a
 PULIB += $(OCGDIR)/blender/ed_datafiles/libed_datafiles.a
 PULIB += $(OCGDIR)/blender/ed_screen/libed_screen.a
+PULIB += $(OCGDIR)/blender/ed_area/libed_area.a
 
 ifeq ($(NAN_NO_KETSJI),true)
     PULIB += $(NAN_MOTO)/lib/libmoto.a
index 472aa4eb83454233f995e48dfe7c64c37edd19a3..b8898c14292fb7fd84c4a77d0cac7ec90df3cb59 100644 (file)
@@ -54,7 +54,6 @@ int   BKE_read_file(struct bContext *C, char *dir, void *type_r);
 int BKE_read_file_from_memory(struct bContext *C, char* filebuf, int filelength, void *type_r);
 int BKE_read_file_from_memfile(struct bContext *C, struct MemFile *memfile);
 
-void duplicatelist(struct ListBase *list1, struct ListBase *list2);
 void free_blender(void);
 void initglobals(void);
 
index 162ee582d744843590c70f9f62b2de55058c59d8..129e9cd3f4ffb13804bc5fffac73ce5b613849b5 100644 (file)
@@ -187,7 +187,7 @@ bAction *copy_action (bAction *src)
        if (!src) return NULL;
        
        dst= copy_libblock(src);
-       duplicatelist(&(dst->chanbase), &(src->chanbase));
+       BLI_duplicatelist(&(dst->chanbase), &(src->chanbase));
        
        for (dchan=dst->chanbase.first, schan=src->chanbase.first; dchan; dchan=dchan->next, schan=schan->next){
                dchan->ipo = copy_ipo(dchan->ipo);
@@ -268,7 +268,7 @@ void copy_pose(bPose **dst, bPose *src, int copycon)
        
        outPose= MEM_callocN(sizeof(bPose), "pose");
        
-       duplicatelist (&outPose->chanbase, &src->chanbase);
+       BLI_duplicatelist (&outPose->chanbase, &src->chanbase);
        
        if (copycon) {
                for (pchan=outPose->chanbase.first; pchan; pchan=pchan->next) {
index 78e8253625d66166248e9b875576b6fa08c1b40e..dc5ea96b58a9207e2929980f154d3b9b95554236 100644 (file)
@@ -178,7 +178,7 @@ static void copy_bonechildren (Bone* newBone, Bone* oldBone)
        Bone    *curBone, *newChildBone;
        
        /*      Copy this bone's list*/
-       duplicatelist (&newBone->childbase, &oldBone->childbase);
+       BLI_duplicatelist (&newBone->childbase, &oldBone->childbase);
        
        /*      For each child in the list, update it's children*/
        newChildBone=newBone->childbase.first;
@@ -195,7 +195,7 @@ bArmature *copy_armature(bArmature *arm)
        Bone            *oldBone, *newBone;
        
        newArm= copy_libblock (arm);
-       duplicatelist(&newArm->bonebase, &arm->bonebase);
+       BLI_duplicatelist(&newArm->bonebase, &arm->bonebase);
        
        /*      Duplicate the childrens' lists*/
        newBone=newArm->bonebase.first;
index 63aa861093e1e38073a49d5086308691916caabc..011261dc4be301ba975543b7513c30b6327c5916 100644 (file)
@@ -177,22 +177,6 @@ void free_blender(void)
        free_nodesystem();      
 }
 
-void duplicatelist(ListBase *list1, ListBase *list2)  /* copy from 2 to 1 */
-{
-       struct Link *link1, *link2;
-       
-       list1->first= list1->last= 0;
-       
-       link2= list2->first;
-       while(link2) {
-
-               link1= MEM_dupallocN(link2);
-               BLI_addtail(list1, link1);
-               
-               link2= link2->next;
-       }       
-}
-
 static EditMesh theEditMesh;
 
 void initglobals(void)
index 66c8f1531d164c2cd50d8464db97340b62a59f49..69cd82fced70cc12fa8de2bd836d457f114f0a46 100644 (file)
@@ -111,7 +111,7 @@ void copy_constraint_channels (ListBase *dst, ListBase *src)
        bConstraintChannel *dchan, *schan;
        
        dst->first = dst->last = NULL;
-       duplicatelist(dst, src);
+       BLI_duplicatelist(dst, src);
        
        for (dchan=dst->first, schan=src->first; dchan; dchan=dchan->next, schan=schan->next) {
                dchan->ipo = copy_ipo(schan->ipo);
@@ -126,7 +126,7 @@ void clone_constraint_channels (ListBase *dst, ListBase *src)
        bConstraintChannel *dchan, *schan;
        
        dst->first = dst->last = NULL;
-       duplicatelist(dst, src);
+       BLI_duplicatelist(dst, src);
        
        for (dchan=dst->first, schan=src->first; dchan; dchan=dchan->next, schan=schan->next) {
                id_us_plus((ID *)dchan->ipo);
@@ -1854,7 +1854,7 @@ static void pycon_copy (bConstraint *con, bConstraint *srccon)
        bPythonConstraint *opycon = (bPythonConstraint *)srccon->data;
        
        pycon->prop = IDP_CopyProperty(opycon->prop);
-       duplicatelist(&pycon->targets, &opycon->targets);
+       BLI_duplicatelist(&pycon->targets, &opycon->targets);
 }
 
 static void pycon_new_data (void *cdata)
@@ -3230,7 +3230,7 @@ void copy_constraints (ListBase *dst, ListBase *src)
        bConstraint *con, *srccon;
        
        dst->first= dst->last= NULL;
-       duplicatelist(dst, src);
+       BLI_duplicatelist(dst, src);
        
        for (con=dst->first, srccon=src->first; con; srccon=srccon->next, con=con->next) {
                bConstraintTypeInfo *cti= constraint_get_typeinfo(con);
index 2b68d26994ffc75e55daaf6f7d10fd010436bef2..cd0478d8808f5a6fbffd279dd22e54b6e26b2657 100644 (file)
@@ -283,7 +283,7 @@ Ipo *copy_ipo(Ipo *ipo)
        
        ipon= copy_libblock(ipo);
        
-       duplicatelist(&(ipon->curve), &(ipo->curve));
+       BLI_duplicatelist(&(ipon->curve), &(ipo->curve));
 
        for(icu= ipo->curve.first; icu; icu= icu->next) {
                icu->bezt= MEM_dupallocN(icu->bezt);
index 4a62c64f48ad9104552763a0db0b689761a7bc2e..20096831806b043ce8ac0e6f2bd52058988c48d7 100644 (file)
@@ -154,7 +154,7 @@ Key *copy_key(Key *key)
        
        keyn->ipo= copy_ipo(key->ipo);
 
-       duplicatelist(&keyn->block, &key->block);
+       BLI_duplicatelist(&keyn->block, &key->block);
        
        kb= key->block.first;
        kbn= keyn->block.first;
index 3933e2bfaa0a66073eb3815bb3637c0361dc7df4..a7de6f2f39e644a03de963ff97ea9b6f73b3e501 100644 (file)
@@ -122,7 +122,7 @@ MetaBall *copy_mball(MetaBall *mb)
        
        mbn= copy_libblock(mb);
 
-       duplicatelist(&mbn->elems, &mb->elems);
+       BLI_duplicatelist(&mbn->elems, &mb->elems);
        
        mbn->mat= MEM_dupallocN(mb->mat);
        for(a=0; a<mbn->totcol; a++) {
index 961ea21d08848d1b37e79559f5aa27486bdc56c6..fb3ad2910b2fca4533c6b162651395a6bf7ffd52 100644 (file)
@@ -76,7 +76,7 @@ void copy_actionstrip (bActionStrip **dst, bActionStrip **src){
                dstrip->ipo->id.us++;
        
        if (dstrip->modifiers.first) {
-               duplicatelist (&dstrip->modifiers, &sstrip->modifiers);
+               BLI_duplicatelist (&dstrip->modifiers, &sstrip->modifiers);
        }
        
 }
@@ -87,7 +87,7 @@ void copy_nlastrips (ListBase *dst, ListBase *src)
 
        dst->first=dst->last=NULL;
 
-       duplicatelist (dst, src);
+       BLI_duplicatelist (dst, src);
 
        /* Update specific data */
        if (!dst->first)
@@ -100,7 +100,7 @@ void copy_nlastrips (ListBase *dst, ListBase *src)
                        strip->ipo->id.us++;
                if (strip->modifiers.first) {
                        ListBase listb;
-                       duplicatelist (&listb, &strip->modifiers);
+                       BLI_duplicatelist (&listb, &strip->modifiers);
                        strip->modifiers= listb;
                }
        }
index 651115b7180bda22f078b7a70a411f04b452ef83..5c9b609bbafd1ee5d3c153c0137ff6cb884b57d3 100644 (file)
@@ -806,11 +806,11 @@ bNode *nodeCopyNode(struct bNodeTree *ntree, struct bNode *node)
        *nnode= *node;
        BLI_addtail(&ntree->nodes, nnode);
        
-       duplicatelist(&nnode->inputs, &node->inputs);
+       BLI_duplicatelist(&nnode->inputs, &node->inputs);
        for(sock= nnode->inputs.first; sock; sock= sock->next)
                sock->own_index= 0;
        
-       duplicatelist(&nnode->outputs, &node->outputs);
+       BLI_duplicatelist(&nnode->outputs, &node->outputs);
        for(sock= nnode->outputs.first; sock; sock= sock->next) {
                sock->own_index= 0;
                sock->stack_index= 0;
index bcb51fa1393de0445a04631dda641aa858fcddc5..371e73379c5d0a20bebe0e6080bc7f4b250d541e 100644 (file)
@@ -117,6 +117,9 @@ void BLI_sortlist(struct ListBase *listbase, int (*cmp)(void *, void *));
 void BLI_freelist(struct ListBase *listbase);
 int BLI_countlist(struct ListBase *listbase);
 void BLI_freelinkN(ListBase *listbase, void *vlink);
+void BLI_duplicatelist(ListBase *list1, ListBase *list2);  /* copy from 2 to 1 */
+
+
 void BLI_splitdirstring(char *di,char *fi);
 
 struct DynamicList *BLI_dlist_from_listbase(struct ListBase *lb);
index 7c94cc80847284b426281cdfe5627fcb8948a25c..1888da6fbd6a126162f83a27c2ac339bfbca978b 100644 (file)
@@ -498,6 +498,23 @@ int BLI_findindex(ListBase *listbase, void *vlink)
        return -1;
 }
 
+void BLI_duplicatelist(ListBase *list1, ListBase *list2)  /* copy from 2 to 1 */
+{
+       struct Link *link1, *link2;
+       
+       list1->first= list1->last= 0;
+       
+       link2= list2->first;
+       while(link2) {
+               
+               link1= MEM_dupallocN(link2);
+               BLI_addtail(list1, link1);
+               
+               link2= link2->next;
+       }       
+}
+
+
 /*=====================================================================================*/
 /* Methods for access array (realloc) */
 /*=====================================================================================*/
index 8e41651294a1a40e9420b296f04ecc776b32acd4..c7b6d39bcca86bda0ab3336a095e555f5daf83eb 100644 (file)
@@ -38,10 +38,12 @@ CFLAGS += $(LEVEL_1_C_WARNINGS)
 CPPFLAGS += -I$(OPENGL_HEADERS)
 
 # not very neat....
-CPPFLAGS += -I../../../blenkernel
-CPPFLAGS += -I../../../blenlib
-CPPFLAGS += -I../../../makesdna
-CPPFLAGS += -I../../../imbuf
+CPPFLAGS += -I../../windowmanager
+CPPFLAGS += -I../../blenloader
+CPPFLAGS += -I../../blenkernel
+CPPFLAGS += -I../../blenlib
+CPPFLAGS += -I../../makesdna
+CPPFLAGS += -I../../imbuf
 CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
 
 # own include 
diff --git a/source/blender/editors/area/space.c b/source/blender/editors/area/space.c
new file mode 100644 (file)
index 0000000..2ade78f
--- /dev/null
@@ -0,0 +1,246 @@
+/**
+ * $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_colortools.h"
+
+#include "BLO_readfile.h"
+
+#include "WM_api.h"
+
+#include "ED_area.h"
+#include "ED_screen.h"
+
+void freespacelist(ScrArea *sa)
+{
+       SpaceLink *sl;
+       
+       for (sl= sa->spacedata.first; sl; sl= sl->next) {
+               if(sl->spacetype==SPACE_FILE) {
+                       SpaceFile *sfile= (SpaceFile*) sl;
+                       if(sfile->libfiledata)  
+                               BLO_blendhandle_close(sfile->libfiledata);
+                       if(sfile->filelist)
+                               ; // XXX freefilelist(sfile);
+                       if(sfile->pupmenu)
+                               MEM_freeN(sfile->pupmenu);
+               }
+               else if(sl->spacetype==SPACE_BUTS) {
+                       SpaceButs *buts= (SpaceButs*) sl;
+//                     if(buts->ri) { 
+//                             if (buts->ri->rect) MEM_freeN(buts->ri->rect);
+//                             MEM_freeN(buts->ri);
+// XXX                 }
+                       if(G.buts==buts) G.buts= NULL;
+               }
+               else if(sl->spacetype==SPACE_IPO) {
+                       SpaceIpo *si= (SpaceIpo*) sl;
+                       if(si->editipo) MEM_freeN(si->editipo);
+// XXX                 free_ipokey(&si->ipokey);
+                       if(G.sipo==si) G.sipo= NULL;
+               }
+               else if(sl->spacetype==SPACE_VIEW3D) {
+                       View3D *vd= (View3D*) sl;
+                       if(vd->bgpic) {
+                               if(vd->bgpic->ima) vd->bgpic->ima->id.us--;
+                               MEM_freeN(vd->bgpic);
+                       }
+                       if(vd->localvd) MEM_freeN(vd->localvd);
+                       if(vd->clipbb) MEM_freeN(vd->clipbb);
+                       if(vd->depths) {
+// XXX                         if(vd->depths->depths) MEM_freeN(vd->depths->depths);
+                               MEM_freeN(vd->depths);
+                               vd->depths= NULL;
+                       }
+// XXX                 retopo_free_view_data(vd);
+                       if(vd->properties_storage) MEM_freeN(vd->properties_storage);
+                       if(G.vd==vd) G.vd= NULL;
+                       if(vd->ri) { 
+// XXX                         BIF_view3d_previewrender_free(vd);
+                       }
+               }
+               else if(sl->spacetype==SPACE_OOPS) {
+// XXX                 SpaceOops *so= (SpaceOops *) sl;
+// XXX                 free_oopspace(so);
+               }
+               else if(sl->spacetype==SPACE_IMASEL) {
+// XXX                 SpaceImaSel *simasel= (SpaceImaSel*) sl;
+// XXX                 free_imasel(simasel);
+               }
+               else if(sl->spacetype==SPACE_ACTION) {
+// XXX                 free_actionspace((SpaceAction*)sl);
+               }
+               else if(sl->spacetype==SPACE_NLA){
+                       /*                      free_nlaspace((SpaceNla*)sl);   */
+               }
+               else if(sl->spacetype==SPACE_TEXT) {
+// XXX                 free_textspace((SpaceText *)sl);
+               }
+               else if(sl->spacetype==SPACE_SCRIPT) {
+// XXX                 free_scriptspace((SpaceScript *)sl);
+               }
+               else if(sl->spacetype==SPACE_SOUND) {
+// XXX                 free_soundspace((SpaceSound *)sl);
+               }
+               else if(sl->spacetype==SPACE_IMAGE) {
+                       SpaceImage *sima= (SpaceImage *)sl;
+                       if(sima->cumap)
+                               curvemapping_free(sima->cumap);
+                       if(sima->info_str)
+                               MEM_freeN(sima->info_str);
+                       if(sima->info_spare)
+                               MEM_freeN(sima->info_spare);
+                       if(sima->spare)
+                               IMB_freeImBuf(sima->spare);
+               }
+               else if(sl->spacetype==SPACE_NODE) {
+                       /*                      SpaceNode *snode= (SpaceNode *)sl; */
+               }
+       }
+       
+       BLI_freelistN(&sa->spacedata);
+}
+
+/* can be called for area-full, so it should keep interesting stuff */
+void duplicatespacelist(ScrArea *newarea, ListBase *lb1, ListBase *lb2)
+{
+       SpaceLink *sl;
+       
+       BLI_duplicatelist(lb1, lb2);
+       
+       /* lb1 is copy from lb2, from lb2 we free stuff, rely on event system to properly re-alloc */
+       
+       sl= lb2->first;
+       while(sl) {
+               if(sl->spacetype==SPACE_FILE) {
+                       SpaceFile *sfile= (SpaceFile*) sl;
+                       sfile->libfiledata= NULL;
+                       sfile->filelist= NULL;
+                       sfile->pupmenu= NULL;
+                       sfile->menup= NULL;
+               }
+               else if(sl->spacetype==SPACE_VIEW3D) {
+                       View3D *v3d= (View3D*)sl;
+// XXX                 BIF_view3d_previewrender_free(v3d);
+                       v3d->depths= NULL;
+                       v3d->retopo_view_data= NULL;
+               }
+               else if(sl->spacetype==SPACE_OOPS) {
+                       SpaceOops *so= (SpaceOops *)sl;
+                       so->oops.first= so->oops.last= NULL;
+                       so->tree.first= so->tree.last= NULL;
+                       so->treestore= NULL;
+               }
+               else if(sl->spacetype==SPACE_IMASEL) {
+                       SpaceImaSel *simasel= (SpaceImaSel*) sl;
+                       simasel->pupmenu= NULL;
+                       simasel->menup= NULL;
+// XXX                 simasel->files = BIF_filelist_new();    
+// XXX                 BIF_filelist_setdir(simasel->files, simasel->dir);
+// XXX                 BIF_filelist_settype(simasel->files, simasel->type);
+                       /* see SPACE_FILE - elubie */
+               }
+               else if(sl->spacetype==SPACE_NODE) {
+                       SpaceNode *snode= (SpaceNode *)sl;
+                       snode->nodetree= NULL;
+               }
+               
+               sl= sl->next;
+       }
+       
+       /* but some things we copy */
+       
+       sl= lb1->first;
+       while(sl) {
+               sl->area= newarea;
+               
+               if(sl->spacetype==SPACE_BUTS) {
+                       SpaceButs *buts= (SpaceButs *)sl;
+                       buts->ri= NULL;
+               }
+               else if(sl->spacetype==SPACE_FILE) {
+                       SpaceFile *sfile= (SpaceFile*) sl;
+                       sfile->menup= NULL;
+               }
+               else if(sl->spacetype==SPACE_IPO) {
+                       SpaceIpo *si= (SpaceIpo *)sl;
+                       si->editipo= NULL;
+                       si->ipokey.first= si->ipokey.last= NULL;
+               }
+               else if(sl->spacetype==SPACE_VIEW3D) {
+                       View3D *vd= (View3D *)sl;
+                       if(vd->bgpic) {
+                               vd->bgpic= MEM_dupallocN(vd->bgpic);
+                               if(vd->bgpic->ima) vd->bgpic->ima->id.us++;
+                       }
+                       vd->clipbb= MEM_dupallocN(vd->clipbb);
+                       vd->ri= NULL;
+                       vd->properties_storage= NULL;
+               }
+               else if(sl->spacetype==SPACE_IMAGE) {
+                       SpaceImage *sima= (SpaceImage *)sl;
+                       if(sima->cumap)
+                               sima->cumap= curvemapping_copy(sima->cumap);
+                       if(sima->info_str)
+                               sima->info_str= MEM_dupallocN(sima->info_str);
+                       if(sima->info_spare)
+                               sima->info_spare= MEM_dupallocN(sima->info_spare);
+               }
+               sl= sl->next;
+       }
+       
+       /* again: from old View3D restore localview (because full) */
+       sl= lb2->first;
+       while(sl) {
+               if(sl->spacetype==SPACE_VIEW3D) {
+                       View3D *v3d= (View3D*) sl;
+                       if(v3d->localvd) {
+// XXX                         restore_localviewdata(v3d);
+                               v3d->localvd= NULL;
+                               v3d->properties_storage= NULL;
+                               v3d->localview= 0;
+                               v3d->lay &= 0xFFFFFF;
+                       }
+               }
+               sl= sl->next;
+       }
+}
+
+
+
diff --git a/source/blender/editors/include/ED_area.h b/source/blender/editors/include/ED_area.h
new file mode 100644 (file)
index 0000000..cc11ca9
--- /dev/null
@@ -0,0 +1,43 @@
+/**
+ * $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) 2008 Blender Foundation.
+ * All rights reserved.
+ *
+ * 
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+#ifndef ED_AREA_H
+#define ED_AREA_H
+
+
+#include "DNA_screen_types.h"
+#include "DNA_space_types.h"
+#include "DNA_view2d_types.h"
+#include "DNA_view3d_types.h"
+
+void freespacelist(ScrArea *sa);
+void duplicatespacelist(ScrArea *newarea, struct ListBase *lb1, struct ListBase *lb2);
+
+
+
+#endif /* ED_AREA_H */
+
diff --git a/source/blender/editors/include/ED_interface.h b/source/blender/editors/include/ED_interface.h
new file mode 100644 (file)
index 0000000..d0f3078
--- /dev/null
@@ -0,0 +1,33 @@
+/**
+ * $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) 2008 Blender Foundation.
+ * All rights reserved.
+ *
+ * 
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+#ifndef ED_INTERFACE_H
+#define ED_INTERFACE_H
+
+
+#endif /* ED_INTERFACE_H */
+
diff --git a/source/blender/editors/include/ED_mesh.h b/source/blender/editors/include/ED_mesh.h
new file mode 100644 (file)
index 0000000..be47fb6
--- /dev/null
@@ -0,0 +1,33 @@
+/**
+ * $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) 2008 Blender Foundation.
+ * All rights reserved.
+ *
+ * 
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+#ifndef ED_AREA_H
+#define ED_AREA_H
+
+
+#endif /* ED_AREA_H */
+
diff --git a/source/blender/editors/include/ED_object.h b/source/blender/editors/include/ED_object.h
new file mode 100644 (file)
index 0000000..ad55a69
--- /dev/null
@@ -0,0 +1,33 @@
+/**
+ * $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) 2008 Blender Foundation.
+ * All rights reserved.
+ *
+ * 
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+#ifndef ED_OBJECT_H
+#define ED_OBJECT_H
+
+
+#endif /* ED_OBJECT_H */
+
diff --git a/source/blender/editors/include/ED_screen.h b/source/blender/editors/include/ED_screen.h
new file mode 100644 (file)
index 0000000..c194632
--- /dev/null
@@ -0,0 +1,34 @@
+/**
+ * $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) 2008 Blender Foundation.
+ * All rights reserved.
+ *
+ * 
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+#ifndef ED_SCREEN_H
+#define ED_SCREEN_H
+
+#include "DNA_screen_types.h"
+
+#endif /* ED_SCREEN_H */
+
diff --git a/source/blender/editors/include/ED_transform.h b/source/blender/editors/include/ED_transform.h
new file mode 100644 (file)
index 0000000..1d47d8a
--- /dev/null
@@ -0,0 +1,33 @@
+/**
+ * $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) 2008 Blender Foundation.
+ * All rights reserved.
+ *
+ * 
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+#ifndef ED_TRANSFORM_H
+#define ED_TRANSFORM_H
+
+
+#endif /* ED_TRANSFORM_H */
+
diff --git a/source/blender/editors/interface/Makefile b/source/blender/editors/interface/Makefile
new file mode 100644 (file)
index 0000000..b2aeaa1
--- /dev/null
@@ -0,0 +1,52 @@
+#
+# $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_screen
+DIR = $(OCGDIR)/blender/$(LIBNAME)
+
+include nan_compile.mk
+
+CFLAGS += $(LEVEL_1_C_WARNINGS)
+
+CPPFLAGS += -I$(OPENGL_HEADERS)
+
+CPPFLAGS += -I$(NAN_BMFONT)/include
+CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
+
+CPPFLAGS += -I../../windowmanager
+CPPFLAGS += -I../../blenkernel
+CPPFLAGS += -I../../blenloader
+CPPFLAGS += -I../../blenlib
+CPPFLAGS += -I../../makesdna
+CPPFLAGS += -I../../imbuf
+
+# own include 
+
+CPPFLAGS += -I../include 
diff --git a/source/blender/editors/mesh/Makefile b/source/blender/editors/mesh/Makefile
new file mode 100644 (file)
index 0000000..b2aeaa1
--- /dev/null
@@ -0,0 +1,52 @@
+#
+# $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_screen
+DIR = $(OCGDIR)/blender/$(LIBNAME)
+
+include nan_compile.mk
+
+CFLAGS += $(LEVEL_1_C_WARNINGS)
+
+CPPFLAGS += -I$(OPENGL_HEADERS)
+
+CPPFLAGS += -I$(NAN_BMFONT)/include
+CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
+
+CPPFLAGS += -I../../windowmanager
+CPPFLAGS += -I../../blenkernel
+CPPFLAGS += -I../../blenloader
+CPPFLAGS += -I../../blenlib
+CPPFLAGS += -I../../makesdna
+CPPFLAGS += -I../../imbuf
+
+# own include 
+
+CPPFLAGS += -I../include 
diff --git a/source/blender/editors/object/Makefile b/source/blender/editors/object/Makefile
new file mode 100644 (file)
index 0000000..b2aeaa1
--- /dev/null
@@ -0,0 +1,52 @@
+#
+# $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_screen
+DIR = $(OCGDIR)/blender/$(LIBNAME)
+
+include nan_compile.mk
+
+CFLAGS += $(LEVEL_1_C_WARNINGS)
+
+CPPFLAGS += -I$(OPENGL_HEADERS)
+
+CPPFLAGS += -I$(NAN_BMFONT)/include
+CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
+
+CPPFLAGS += -I../../windowmanager
+CPPFLAGS += -I../../blenkernel
+CPPFLAGS += -I../../blenloader
+CPPFLAGS += -I../../blenlib
+CPPFLAGS += -I../../makesdna
+CPPFLAGS += -I../../imbuf
+
+# own include 
+
+CPPFLAGS += -I../include 
index bd6319cc7a0f57dde08f2011f6ba8103319b0f86..b2aeaa145f7efd0668106c0b1c515cef34f55f05 100644 (file)
@@ -37,13 +37,16 @@ CFLAGS += $(LEVEL_1_C_WARNINGS)
 
 CPPFLAGS += -I$(OPENGL_HEADERS)
 
-# not very neat....
-CPPFLAGS += -I../../../blenkernel
-CPPFLAGS += -I../../../blenlib
-CPPFLAGS += -I../../../makesdna
-CPPFLAGS += -I../../../imbuf
+CPPFLAGS += -I$(NAN_BMFONT)/include
 CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
 
+CPPFLAGS += -I../../windowmanager
+CPPFLAGS += -I../../blenkernel
+CPPFLAGS += -I../../blenloader
+CPPFLAGS += -I../../blenlib
+CPPFLAGS += -I../../makesdna
+CPPFLAGS += -I../../imbuf
+
 # own include 
 
 CPPFLAGS += -I../include 
index ca3e11d1d641146d8a41bab07e5d596179549863..5da65166c951044fe2a7b0ed5ba9587c07f59611 100644 (file)
  * ***** END GPL LICENSE BLOCK *****
  */
 
-void unlink_screen() 
+#include "WM_api.h"
+
+#include "MEM_guardedalloc.h"
+
+#include "ED_area.h"
+#include "ED_screen.h"
+
+
+static void del_area(ScrArea *sa)
+{
+       
+       freespacelist(sa);
+       
+//     uiFreeBlocks(&sa->uiblocks);
+//     uiFreePanels(&sa->panels);
+       
+//     BPY_free_scriptlink(&sa->scriptlink);
+       
+}
+
+
+/* bad level to blenkernel, solve */
+void unlink_screen(bScreen *sc) 
 {
-       /* bad level to blenkernel, solve */
+       ScrArea *sa;
+       
+       for (sa= sc->areabase.first; sa; sa= sa->next)  
+               del_area(sa);
 }
\ No newline at end of file
diff --git a/source/blender/editors/transform/Makefile b/source/blender/editors/transform/Makefile
new file mode 100644 (file)
index 0000000..b2aeaa1
--- /dev/null
@@ -0,0 +1,52 @@
+#
+# $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_screen
+DIR = $(OCGDIR)/blender/$(LIBNAME)
+
+include nan_compile.mk
+
+CFLAGS += $(LEVEL_1_C_WARNINGS)
+
+CPPFLAGS += -I$(OPENGL_HEADERS)
+
+CPPFLAGS += -I$(NAN_BMFONT)/include
+CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
+
+CPPFLAGS += -I../../windowmanager
+CPPFLAGS += -I../../blenkernel
+CPPFLAGS += -I../../blenloader
+CPPFLAGS += -I../../blenlib
+CPPFLAGS += -I../../makesdna
+CPPFLAGS += -I../../imbuf
+
+# own include 
+
+CPPFLAGS += -I../include 
index d6c4d33a82f5e203b4ce7df7a24ee7b9392edf9a..d9f5d7da7bde7d43c683bbbf82a6298d19987820 100644 (file)
@@ -40,7 +40,6 @@
 #include "BKE_scene.h"
 
 #include "BLI_blenlib.h"
-#include "BIF_toolbox.h"       /* error() */
 
 #include "BLO_sys_types.h"
 
@@ -501,7 +500,7 @@ void start_qt(struct RenderData *rd, int rectx, int recty) {
 
                if(err != noErr) {
                        G.afbreek = 1;
-                       error("Unable to create Quicktime movie: %s", name);
+// XXX                 error("Unable to create Quicktime movie: %s", name);
                } else {
                        printf("Created QuickTime movie: %s\n", name);
 
index 044661fb5214cb5f9dd6d912758802ab14c80297..2aad763336ed3a9f783a160167b0a03120322ad6 100644 (file)
@@ -53,6 +53,8 @@ void          WM_write_autosave       (struct bContext *C);
                        /* mouse cursors */
 void           WM_init_cursor_data     (void);
 void           WM_set_cursor           (struct bContext *C, int curs);
+void           WM_waitcursor           (struct bContext *C, int val);
+void           WM_timecursor           (struct bContext *C, int nr);
 
                        /* keymap and handlers */
 void           WM_keymap_set_item      (ListBase *lb, char *idname, short type, 
index 8c86070ca6177ef7de12e540a6de247eefefe9b8..e4299b8949b306da63c36d64dc02a726f4ebb87c 100644 (file)
@@ -28,6 +28,7 @@
 */
 
 #include <stdio.h>
+#include <string.h>
 
 #include "GHOST_C-api.h"
 
@@ -100,32 +101,80 @@ void WM_set_cursor(bContext *C, int curs)
        }
 
        GHOST_SetCursorVisibility(win->ghostwin, 1);
-               
+       
+       LastCursor=CurrentCursor;
+       CurrentCursor=curs;
+       
+       /* previous cursor? */
+       if (curs==LASTCURSOR) curs=LastCursor;
+       
        /* detect if we use system cursor or Blender cursor */
        if(curs>=BC_GHOST_CURSORS) {
                GHOST_SetCursorShape(win->ghostwin, convert_cursor(curs));
-               return;
        }
-
-       if ((curs<LASTCURSOR)||(curs>=BC_NUMCURSORS)) return;
-
-
-       LastCursor=CurrentCursor;
-       CurrentCursor=curs;
-
-       if (curs==LASTCURSOR) curs=LastCursor;
-
-       if (curs==SYSCURSOR) {  /* System default Cursor */
-               GHOST_SetCursorShape(win->ghostwin, convert_cursor(CURSOR_STD));
+       else {
+               if ((curs<LASTCURSOR)||(curs>=BC_NUMCURSORS)) return;   
+
+               if (curs==SYSCURSOR) {  /* System default Cursor */
+                       GHOST_SetCursorShape(win->ghostwin, convert_cursor(CURSOR_STD));
+               }
+               else if ( (U.curssize==0) || (BlenderCursor[curs]->big_bm == NULL) ) {
+                       window_set_custom_cursor_ex(win, BlenderCursor[curs], 0);
+               }
+               else {
+                       window_set_custom_cursor_ex(win, BlenderCursor[curs], 1);
+               }
        }
-       else if ( (U.curssize==0) || (BlenderCursor[curs]->big_bm == NULL) ) {
-               window_set_custom_cursor_ex(win, BlenderCursor[curs], 0);
+}
+
+void WM_waitcursor(bContext *C, int val)
+{
+       if(C->window) {
+               if(val) {
+                       WM_set_cursor(C, CURSOR_WAIT);
+               } else {
+                       WM_set_cursor(C, LASTCURSOR);
+               }
        }
-       else {
-               window_set_custom_cursor_ex(win, BlenderCursor[curs], 1);
+}
+
+void WM_timecursor(bContext *C, int nr)
+{
+       /* 10 8x8 digits */
+       static char number_bitmaps[10][8]= {
+       {0,  56,  68,  68,  68,  68,  68,  56}, 
+       {0,  24,  16,  16,  16,  16,  16,  56}, 
+       {0,  60,  66,  32,  16,   8,   4, 126}, 
+       {0, 124,  32,  16,  56,  64,  66,  60}, 
+       {0,  32,  48,  40,  36, 126,  32,  32}, 
+       {0, 124,   4,  60,  64,  64,  68,  56}, 
+       {0,  56,   4,   4,  60,  68,  68,  56}, 
+       {0, 124,  64,  32,  16,   8,   8,   8}, 
+       {0,  60,  66,  66,  60,  66,  66,  60}, 
+       {0,  56,  68,  68, 120,  64,  68,  56} 
+       };
+       unsigned char mask[16][2];
+       unsigned char bitmap[16][2];
+       int i, idx;
+       
+       memset(&bitmap, 0x00, sizeof(bitmap));
+       memset(&mask, 0xFF, sizeof(mask));
+       
+       /* print number bottom right justified */
+       for (idx= 3; nr && idx>=0; idx--) {
+               char *digit= number_bitmaps[nr%10];
+               int x = idx%2;
+               int y = idx/2;
+               
+               for (i=0; i<8; i++)
+                       bitmap[i + y*8][x]= digit[i];
+               nr/= 10;
        }
+       
+       window_set_custom_cursor(C->window, mask, bitmap, 7, 7);
 }
 
+
 /* ****************************************************************** 
 Custom Cursor Description:
 
index 89f79d8b843fd8ae121d66c31d9d4cabdfdd3312..721da902798780b5c855de45e747bb792ed26376 100644 (file)
@@ -378,12 +378,10 @@ int main(int argc, char **argv)
                                        break;
             
                                case 'w':
-                                       /* with borders */
-                                       G.windowstate = G_WINDOWSTATE_BORDER;
+                                       /* with borders XXX OLD CRUFT!*/
                                        break;
                                case 'W':
-                                       /* borderless, win + linux */
-                                       G.windowstate = G_WINDOWSTATE_FULLSCREEN;
+                                       /* borderless, win + linux XXX OLD CRUFT */
                                        break;
                                case 'R':
                                        /* Registering filetypes only makes sense on windows...      */