From 372ee054c0deb4ca07e1a70c7b905d24043723be Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Tue, 1 Jan 2008 18:29:19 +0000 Subject: Some notes for those who try to follow this :) - 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. --- source/blender/blenkernel/BKE_blender.h | 1 - source/blender/blenkernel/intern/action.c | 4 +- source/blender/blenkernel/intern/armature.c | 4 +- source/blender/blenkernel/intern/blender.c | 16 -- source/blender/blenkernel/intern/constraint.c | 8 +- source/blender/blenkernel/intern/ipo.c | 2 +- source/blender/blenkernel/intern/key.c | 2 +- source/blender/blenkernel/intern/mball.c | 2 +- source/blender/blenkernel/intern/nla.c | 6 +- source/blender/blenkernel/intern/node.c | 4 +- source/blender/blenlib/BLI_blenlib.h | 3 + source/blender/blenlib/intern/util.c | 17 ++ source/blender/editors/area/Makefile | 10 +- source/blender/editors/area/space.c | 246 ++++++++++++++++++++++ source/blender/editors/include/ED_area.h | 43 ++++ source/blender/editors/include/ED_interface.h | 33 +++ source/blender/editors/include/ED_mesh.h | 33 +++ source/blender/editors/include/ED_object.h | 33 +++ source/blender/editors/include/ED_screen.h | 34 +++ source/blender/editors/include/ED_transform.h | 33 +++ source/blender/editors/interface/Makefile | 52 +++++ source/blender/editors/mesh/Makefile | 52 +++++ source/blender/editors/object/Makefile | 52 +++++ source/blender/editors/screen/Makefile | 13 +- source/blender/editors/screen/ed_screen.c | 29 ++- source/blender/editors/transform/Makefile | 52 +++++ source/blender/quicktime/apple/quicktime_export.c | 3 +- source/blender/windowmanager/WM_api.h | 2 + source/blender/windowmanager/intern/wm_cursors.c | 83 ++++++-- 29 files changed, 809 insertions(+), 63 deletions(-) create mode 100644 source/blender/editors/area/space.c create mode 100644 source/blender/editors/include/ED_area.h create mode 100644 source/blender/editors/include/ED_interface.h create mode 100644 source/blender/editors/include/ED_mesh.h create mode 100644 source/blender/editors/include/ED_object.h create mode 100644 source/blender/editors/include/ED_screen.h create mode 100644 source/blender/editors/include/ED_transform.h create mode 100644 source/blender/editors/interface/Makefile create mode 100644 source/blender/editors/mesh/Makefile create mode 100644 source/blender/editors/object/Makefile create mode 100644 source/blender/editors/transform/Makefile (limited to 'source/blender') diff --git a/source/blender/blenkernel/BKE_blender.h b/source/blender/blenkernel/BKE_blender.h index 472aa4eb834..b8898c14292 100644 --- a/source/blender/blenkernel/BKE_blender.h +++ b/source/blender/blenkernel/BKE_blender.h @@ -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); diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c index 162ee582d74..129e9cd3f4f 100644 --- a/source/blender/blenkernel/intern/action.c +++ b/source/blender/blenkernel/intern/action.c @@ -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) { diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c index 78e8253625d..dc5ea96b58a 100644 --- a/source/blender/blenkernel/intern/armature.c +++ b/source/blender/blenkernel/intern/armature.c @@ -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; diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c index 63aa861093e..011261dc4be 100644 --- a/source/blender/blenkernel/intern/blender.c +++ b/source/blender/blenkernel/intern/blender.c @@ -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) diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c index 66c8f1531d1..69cd82fced7 100644 --- a/source/blender/blenkernel/intern/constraint.c +++ b/source/blender/blenkernel/intern/constraint.c @@ -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); diff --git a/source/blender/blenkernel/intern/ipo.c b/source/blender/blenkernel/intern/ipo.c index 2b68d26994f..cd0478d8808 100644 --- a/source/blender/blenkernel/intern/ipo.c +++ b/source/blender/blenkernel/intern/ipo.c @@ -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); diff --git a/source/blender/blenkernel/intern/key.c b/source/blender/blenkernel/intern/key.c index 4a62c64f48a..20096831806 100644 --- a/source/blender/blenkernel/intern/key.c +++ b/source/blender/blenkernel/intern/key.c @@ -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; diff --git a/source/blender/blenkernel/intern/mball.c b/source/blender/blenkernel/intern/mball.c index 3933e2bfaa0..a7de6f2f39e 100644 --- a/source/blender/blenkernel/intern/mball.c +++ b/source/blender/blenkernel/intern/mball.c @@ -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; atotcol; a++) { diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c index 961ea21d088..fb3ad2910b2 100644 --- a/source/blender/blenkernel/intern/nla.c +++ b/source/blender/blenkernel/intern/nla.c @@ -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; } } diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c index 651115b7180..5c9b609bbaf 100644 --- a/source/blender/blenkernel/intern/node.c +++ b/source/blender/blenkernel/intern/node.c @@ -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; diff --git a/source/blender/blenlib/BLI_blenlib.h b/source/blender/blenlib/BLI_blenlib.h index bcb51fa1393..371e73379c5 100644 --- a/source/blender/blenlib/BLI_blenlib.h +++ b/source/blender/blenlib/BLI_blenlib.h @@ -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); diff --git a/source/blender/blenlib/intern/util.c b/source/blender/blenlib/intern/util.c index 7c94cc80847..1888da6fbd6 100644 --- a/source/blender/blenlib/intern/util.c +++ b/source/blender/blenlib/intern/util.c @@ -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) */ /*=====================================================================================*/ diff --git a/source/blender/editors/area/Makefile b/source/blender/editors/area/Makefile index 8e41651294a..c7b6d39bcca 100644 --- a/source/blender/editors/area/Makefile +++ b/source/blender/editors/area/Makefile @@ -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 index 00000000000..2ade78f93e4 --- /dev/null +++ b/source/blender/editors/area/space.c @@ -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 +#include + +#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 index 00000000000..cc11ca9a2f6 --- /dev/null +++ b/source/blender/editors/include/ED_area.h @@ -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 index 00000000000..d0f3078ce62 --- /dev/null +++ b/source/blender/editors/include/ED_interface.h @@ -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 index 00000000000..be47fb6f2d0 --- /dev/null +++ b/source/blender/editors/include/ED_mesh.h @@ -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 index 00000000000..ad55a691d6d --- /dev/null +++ b/source/blender/editors/include/ED_object.h @@ -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 index 00000000000..c194632b46f --- /dev/null +++ b/source/blender/editors/include/ED_screen.h @@ -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 index 00000000000..1d47d8ad190 --- /dev/null +++ b/source/blender/editors/include/ED_transform.h @@ -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 index 00000000000..b2aeaa145f7 --- /dev/null +++ b/source/blender/editors/interface/Makefile @@ -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 index 00000000000..b2aeaa145f7 --- /dev/null +++ b/source/blender/editors/mesh/Makefile @@ -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 index 00000000000..b2aeaa145f7 --- /dev/null +++ b/source/blender/editors/object/Makefile @@ -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/screen/Makefile b/source/blender/editors/screen/Makefile index bd6319cc7a0..b2aeaa145f7 100644 --- a/source/blender/editors/screen/Makefile +++ b/source/blender/editors/screen/Makefile @@ -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 diff --git a/source/blender/editors/screen/ed_screen.c b/source/blender/editors/screen/ed_screen.c index ca3e11d1d64..5da65166c95 100644 --- a/source/blender/editors/screen/ed_screen.c +++ b/source/blender/editors/screen/ed_screen.c @@ -26,7 +26,32 @@ * ***** 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 index 00000000000..b2aeaa145f7 --- /dev/null +++ b/source/blender/editors/transform/Makefile @@ -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/quicktime/apple/quicktime_export.c b/source/blender/quicktime/apple/quicktime_export.c index d6c4d33a82f..d9f5d7da7bd 100644 --- a/source/blender/quicktime/apple/quicktime_export.c +++ b/source/blender/quicktime/apple/quicktime_export.c @@ -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); diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h index 044661fb521..2aad763336e 100644 --- a/source/blender/windowmanager/WM_api.h +++ b/source/blender/windowmanager/WM_api.h @@ -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, diff --git a/source/blender/windowmanager/intern/wm_cursors.c b/source/blender/windowmanager/intern/wm_cursors.c index 8c86070ca61..e4299b8949b 100644 --- a/source/blender/windowmanager/intern/wm_cursors.c +++ b/source/blender/windowmanager/intern/wm_cursors.c @@ -28,6 +28,7 @@ */ #include +#include #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=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=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: -- cgit v1.2.3