Part 4 of the event refactor branch: all changes in existing files,

Makefiles especially, and of course the windowmanager DNA!
This commit is contained in:
2007-12-24 18:53:37 +00:00
parent c79966be52
commit 463cf8e332
20 changed files with 509 additions and 115 deletions

View File

@@ -36,7 +36,7 @@ DIR = $(OCGDIR)/blender/$(LIBNAME)
include nan_compile.mk include nan_compile.mk
# CPPFLAGS += $(LEVEL_2_CPP_WARNINGS) CFLAGS += $(LEVEL_1_C_WARNINGS)
# path to SDNA types # path to SDNA types
CPPFLAGS += -I../../makesdna CPPFLAGS += -I../../makesdna
@@ -49,7 +49,7 @@ CPPFLAGS += -I$(NAN_FREETYPE)/include
CPPFLAGS += -I$(NAN_FREETYPE)/include/freetype2 CPPFLAGS += -I$(NAN_FREETYPE)/include/freetype2
# path to blenkernel # path to blenkernel
CPPFLAGS += -I$(SRCHOME)/blender/blenkernel CPPFLAGS += -I$(SRCHOME)/blender/blenkernel
CPPFLAGS += -I../../include/ CPPFLAGS += -I../../editors/include/
# path to zlib # path to zlib
CPPFLAGS += -I$(NAN_ZLIB)/include CPPFLAGS += -I$(NAN_ZLIB)/include

View File

@@ -55,6 +55,7 @@
#include "BIF_toolbox.h" #include "BIF_toolbox.h"
#include "BKE_global.h" #include "BKE_global.h"
#include "BKE_font.h"
#include "BKE_utildefines.h" #include "BKE_utildefines.h"
#include "DNA_vfont_types.h" #include "DNA_vfont_types.h"
@@ -283,13 +284,7 @@ int objchr_to_ftvfontdata(VFont *vfont, FT_ULong charcode)
struct TmpFont *tf; struct TmpFont *tf;
// Find the correct FreeType font // Find the correct FreeType font
tf= G.ttfdata.first; tf= vfont_find_tmpfont(vfont);
while(tf)
{
if(tf->vfont == vfont)
break;
tf= tf->next;
}
// What, no font found. Something strange here // What, no font found. Something strange here
if(!tf) return FALSE; if(!tf) return FALSE;

View File

@@ -87,7 +87,7 @@ typedef struct BlendFileData {
int fileflags; int fileflags;
int displaymode; int displaymode;
int globalf; int globalf;
struct bScreen* curscreen; struct bScreen* curscreen;
struct Scene* curscene; struct Scene* curscene;
@@ -236,8 +236,10 @@ BLO_blendhandle_close(
char *BLO_gethome(void); char *BLO_gethome(void);
int BLO_has_bfile_extension(char *str); int BLO_has_bfile_extension(char *str);
void BLO_library_append(struct SpaceFile *sfile, char *dir, int idcode);
void BLO_library_append_(BlendHandle **libfiledata, struct direntry* filelist, int totfile, char *dir, char* file, short flag, int idcode); void BLO_library_append(struct SpaceFile *sfile, char *dir, int idcode, struct Scene *scene);
void BLO_library_append_(BlendHandle **libfiledata, struct direntry* filelist, int totfile,
char *dir, char* file, short flag, int idcode, struct Scene *scene);
void BLO_script_library_append(BlendHandle *bh, char *dir, char *name, int idcode, short flag, struct Scene *scene); void BLO_script_library_append(BlendHandle *bh, char *dir, char *name, int idcode, short flag, struct Scene *scene);
BlendFileData* blo_read_blendafterruntime(int file, int actualsize, BlendReadError *error_r); BlendFileData* blo_read_blendafterruntime(int file, int actualsize, BlendReadError *error_r);

View File

@@ -35,10 +35,12 @@
#define BLO_WRITEFILE_H #define BLO_WRITEFILE_H
struct MemFile; struct MemFile;
struct bContext;
extern int BLO_write_file(char *dir, int write_flags, char **error_r); extern int BLO_write_file(struct bContext *C, char *dir, int write_flags, char **error_r);
extern int BLO_write_file_mem(struct MemFile *compare, struct MemFile *current, int write_flags, char **error_r); extern int BLO_write_file_mem(struct bContext *C, struct MemFile *compare, struct MemFile *current,
extern void BLO_write_runtime(char *file, char *exename); int write_flags, char **error_r);
extern void BLO_write_runtime(struct bContext *C, char *file, char *exename);
#endif #endif

View File

@@ -20,9 +20,8 @@
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved. * All rights reserved.
* *
* The Original Code is: all of this file.
* *
* Contributor(s): none yet. * Contributor(s): Blender Foundation
* *
* ***** END GPL LICENSE BLOCK ***** * ***** END GPL LICENSE BLOCK *****
* *
@@ -101,6 +100,7 @@
#include "DNA_userdef_types.h" #include "DNA_userdef_types.h"
#include "DNA_vfont_types.h" #include "DNA_vfont_types.h"
#include "DNA_world_types.h" #include "DNA_world_types.h"
#include "DNA_windowmanager_types.h"
#include "MEM_guardedalloc.h" #include "MEM_guardedalloc.h"
#include "BLI_blenlib.h" #include "BLI_blenlib.h"
@@ -109,8 +109,6 @@
#include "BDR_sculptmode.h" #include "BDR_sculptmode.h"
#include "BKE_bad_level_calls.h" // for reopen_text build_seqar (from WHILE_SEQ) set_rects_butspace check_imasel_copy
#include "BKE_action.h" #include "BKE_action.h"
#include "BKE_armature.h" #include "BKE_armature.h"
#include "BKE_colortools.h" #include "BKE_colortools.h"
@@ -3492,6 +3490,42 @@ static void lib_link_screen_sequence_ipos(Main *main)
} }
} }
/* ************ READ WM ***************** */
static void direct_link_windowmanager(FileData *fd, wmWindowManager *wm)
{
wmWindow *win;
wm->id.us= 1;
link_list(fd, &(wm->windows));
for(win= wm->windows.first; win; win= win->next) {
win->ghostwin= NULL;
win->eventstate= NULL;
win->queue.first= win->queue.last= NULL;
win->handlers.first= win->handlers.last= NULL;
}
wm->operators.first= wm->operators.last= NULL;
wm->windowkeymap.first= wm->windowkeymap.last= NULL;
wm->screenkeymap.first= wm->screenkeymap.last= NULL;
wm->initialized= 0;
}
static void lib_link_windowmanager(FileData *fd, Main *main)
{
wmWindowManager *wm;
for(wm= main->wm.first; wm; wm= wm->id.next) {
wmWindow *win;
for(win= wm->windows.first; win; win= win->next) {
win->screen= newlibadr(fd, NULL, win->screen);
}
}
}
/* ************ READ SCREEN ***************** */ /* ************ READ SCREEN ***************** */
/* note: file read without screens option G_FILE_NO_UI; /* note: file read without screens option G_FILE_NO_UI;
@@ -3811,7 +3845,9 @@ static void direct_link_screen(FileData *fd, bScreen *sc)
link_list(fd, &(sc->edgebase)); link_list(fd, &(sc->edgebase));
link_list(fd, &(sc->areabase)); link_list(fd, &(sc->areabase));
sc->winakt= 0; sc->winakt= 0;
sc->handlers.first= sc->handlers.last= NULL;
/* hacky patch... but people have been saving files with the verse-blender, /* hacky patch... but people have been saving files with the verse-blender,
causing the handler to keep running for ever, with no means to disable it */ causing the handler to keep running for ever, with no means to disable it */
for(a=0; a<SCREEN_MAXHANDLER; a+=2) { for(a=0; a<SCREEN_MAXHANDLER; a+=2) {
@@ -3848,6 +3884,9 @@ static void direct_link_screen(FileData *fd, bScreen *sc)
link_list(fd, &(sa->spacedata)); link_list(fd, &(sa->spacedata));
link_list(fd, &(sa->panels)); link_list(fd, &(sa->panels));
sa->handlers.first= sa->handlers.last= NULL;
sa->regionbase.first= sa->regionbase.last= NULL;
/* accident can happen when read/save new file with older version */ /* accident can happen when read/save new file with older version */
if(sa->spacedata.first==NULL && sa->spacetype>SPACE_NLA) if(sa->spacedata.first==NULL && sa->spacetype>SPACE_NLA)
sa->spacetype= SPACE_EMPTY; sa->spacetype= SPACE_EMPTY;
@@ -4129,6 +4168,9 @@ static BHead *read_libblock(FileData *fd, Main *main, BHead *bhead, int flag, ID
/* init pointers direct data */ /* init pointers direct data */
switch( GS(id->name) ) { switch( GS(id->name) ) {
case ID_WM:
direct_link_windowmanager(fd, (wmWindowManager *)id);
break;
case ID_SCR: case ID_SCR:
direct_link_screen(fd, (bScreen *)id); direct_link_screen(fd, (bScreen *)id);
break; break;
@@ -4218,16 +4260,36 @@ static BHead *read_libblock(FileData *fd, Main *main, BHead *bhead, int flag, ID
return (bhead); return (bhead);
} }
static void link_global(FileData *fd, BlendFileData *bfd, FileGlobal *fg) /* note, this has to be kept for reading older files... */
/* also version info is written here */
static BHead *read_global(BlendFileData *bfd, FileData *fd, BHead *bhead)
{ {
// this is nonsense... make it struct once (ton) FileGlobal *fg= read_struct(fd, bhead, "Global");
/* copy to bfd handle */
bfd->main->subversionfile= fg->subversion;
bfd->main->minversionfile= fg->minversion;
bfd->main->minsubversionfile= fg->minsubversion;
bfd->winpos= fg->winpos; bfd->winpos= fg->winpos;
bfd->fileflags= fg->fileflags; bfd->fileflags= fg->fileflags;
bfd->displaymode= fg->displaymode; bfd->displaymode= fg->displaymode;
bfd->globalf= fg->globalf; bfd->globalf= fg->globalf;
bfd->curscreen= newlibadr(fd, 0, fg->curscreen); bfd->curscreen= fg->curscreen;
bfd->curscene= newlibadr(fd, 0, fg->curscene); bfd->curscene= fg->curscene;
MEM_freeN(fg);
return blo_nextbhead(fd, bhead);
}
/* note, this has to be kept for reading older files... */
static void link_global(FileData *fd, BlendFileData *bfd)
{
bfd->curscreen= newlibadr(fd, 0, bfd->curscreen);
bfd->curscene= newlibadr(fd, 0, bfd->curscene);
// this happens in files older than 2.35 // this happens in files older than 2.35
if(bfd->curscene==NULL) { if(bfd->curscene==NULL) {
if(bfd->curscreen) bfd->curscene= bfd->curscreen->scene; if(bfd->curscreen) bfd->curscene= bfd->curscreen->scene;
@@ -7269,6 +7331,7 @@ static void lib_link_all(FileData *fd, Main *main)
{ {
oldnewmap_sort(fd); oldnewmap_sort(fd);
lib_link_windowmanager(fd, main);
lib_link_screen(fd, main); lib_link_screen(fd, main);
lib_link_scene(fd, main); lib_link_scene(fd, main);
lib_link_object(fd, main); lib_link_object(fd, main);
@@ -7299,6 +7362,7 @@ static void lib_link_all(FileData *fd, Main *main)
lib_link_library(fd, main); /* only init users */ lib_link_library(fd, main); /* only init users */
} }
static BHead *read_userdef(BlendFileData *bfd, FileData *fd, BHead *bhead) static BHead *read_userdef(BlendFileData *bfd, FileData *fd, BHead *bhead)
{ {
Link *link; Link *link;
@@ -7332,20 +7396,15 @@ BlendFileData *blo_read_file_internal(FileData *fd, BlendReadError *error_r)
while(bhead) { while(bhead) {
switch(bhead->code) { switch(bhead->code) {
case GLOB:
case DATA: case DATA:
case DNA1: case DNA1:
case TEST: case TEST:
case REND: case REND:
if (bhead->code==GLOB) {
fg= read_struct(fd, bhead, "Global");
/* set right away */
bfd->main->subversionfile= fg->subversion;
bfd->main->minversionfile= fg->minversion;
bfd->main->minsubversionfile= fg->minsubversion;
}
bhead = blo_nextbhead(fd, bhead); bhead = blo_nextbhead(fd, bhead);
break; break;
case GLOB:
bhead= read_global(bfd, fd, bhead);
break;
case USER: case USER:
bhead= read_userdef(bfd, fd, bhead); bhead= read_userdef(bfd, fd, bhead);
break; break;
@@ -7380,11 +7439,7 @@ BlendFileData *blo_read_file_internal(FileData *fd, BlendReadError *error_r)
lib_link_all(fd, bfd->main); lib_link_all(fd, bfd->main);
lib_verify_nodetree(bfd->main); lib_verify_nodetree(bfd->main);
if(fg) link_global(fd, bfd); /* as last */
link_global(fd, bfd, fg); /* as last */
/* removed here: check for existance of curscreen/scene, moved to kernel setup_app */
MEM_freeN(fg);
return bfd; return bfd;
} }
@@ -8165,10 +8220,9 @@ static void append_named_part(FileData *fd, Main *mainvar, Scene *scene, char *n
if(id==NULL) ob= mainvar->object.last; if(id==NULL) ob= mainvar->object.last;
else ob= (Object *)id; else ob= (Object *)id;
/* this is bad code... G.vd nor G.scene should be used on this level... */ /* XXX use context to find view3d->lay */
if((flag & FILE_ACTIVELAY)) { if((flag & FILE_ACTIVELAY)) {
if(G.vd) ob->lay= G.vd->layact; scene->lay;
else ob->lay = G.scene->lay;
} }
base->lay= ob->lay; base->lay= ob->lay;
base->object= ob; base->object= ob;
@@ -8210,7 +8264,7 @@ static void append_id_part(FileData *fd, Main *mainvar, ID *id, ID **id_r)
/* common routine to append/link something from a library */ /* common routine to append/link something from a library */
static Library* library_append( Scene *scene, char* file, char *dir, int idcode, static Library* library_append(Scene *scene, char* file, char *dir, int idcode,
int totsel, FileData *fd, struct direntry* filelist, int totfile, short flag) int totsel, FileData *fd, struct direntry* filelist, int totfile, short flag)
{ {
Main *mainl; Main *mainl;
@@ -8279,27 +8333,29 @@ static Library* library_append( Scene *scene, char* file, char *dir, int idcode,
/* this is a version of BLO_library_append needed by the BPython API, so /* this is a version of BLO_library_append needed by the BPython API, so
* scripts can load data from .blend files -- see Blender.Library module.*/ * scripts can load data from .blend files -- see Blender.Library module.*/
/* append to G.scene */ /* append to scene */
/* this should probably be moved into the Python code anyway */ /* this should probably be moved into the Python code anyway */
void BLO_script_library_append(BlendHandle *bh, char *dir, char *name, void BLO_script_library_append(BlendHandle *bh, char *dir, char *name,
int idcode, short flag, Scene *scene ) int idcode, short flag, Scene *scene )
{ {
/* try to append the requested object */ /* try to append the requested object */
library_append( scene, name, dir, idcode, 0, (FileData *)bh, NULL, 0, flag ); library_append(scene, name, dir, idcode, 0, (FileData *)bh, NULL, 0, flag );
/* do we need to do this? */ /* do we need to do this? */
DAG_scene_sort(G.scene); DAG_scene_sort(scene);
} }
/* append to G.scene */ /* append to scene */
/* dir is a full path */ /* dir is a full path */
void BLO_library_append(SpaceFile *sfile, char *dir, int idcode) void BLO_library_append(SpaceFile *sfile, char *dir, int idcode, Scene *scene)
{ {
BLO_library_append_(&sfile->libfiledata, sfile->filelist, sfile->totfile, dir, sfile->file, sfile->flag, idcode); BLO_library_append_(&sfile->libfiledata, sfile->filelist, sfile->totfile,
dir, sfile->file, sfile->flag, idcode, scene);
} }
void BLO_library_append_(BlendHandle** libfiledata, struct direntry* filelist, int totfile, char *dir, char* file, short flag, int idcode) void BLO_library_append_(BlendHandle** libfiledata, struct direntry* filelist, int totfile,
char *dir, char* file, short flag, int idcode, Scene *scene)
{ {
FileData *fd= (FileData*) (*libfiledata); FileData *fd= (FileData*) (*libfiledata);
Library *curlib; Library *curlib;
@@ -8332,9 +8388,9 @@ void BLO_library_append_(BlendHandle** libfiledata, struct direntry* filelist, i
} }
/* now we have or selected, or an indicated file */ /* now we have or selected, or an indicated file */
if(flag & FILE_AUTOSELECT) scene_deselect_all(G.scene); if(flag & FILE_AUTOSELECT) scene_deselect_all(scene);
curlib = library_append( G.scene, file, dir, idcode, totsel, fd, filelist, totfile,flag ); curlib = library_append(scene, file, dir, idcode, totsel, fd, filelist, totfile,flag );
/* patch to prevent switch_endian happens twice */ /* patch to prevent switch_endian happens twice */
if(fd->flags & FD_FLAGS_SWITCH_ENDIAN) { if(fd->flags & FD_FLAGS_SWITCH_ENDIAN) {
@@ -8349,7 +8405,7 @@ void BLO_library_append_(BlendHandle** libfiledata, struct direntry* filelist, i
INIT_MINMAX(min, max); INIT_MINMAX(min, max);
centerbase= (G.scene->base.first); centerbase= (scene->base.first);
while(centerbase) { while(centerbase) {
if(centerbase->object->id.lib==curlib && centerbase->object->parent==NULL) { if(centerbase->object->id.lib==curlib && centerbase->object->parent==NULL) {
VECCOPY(vec, centerbase->object->loc); VECCOPY(vec, centerbase->object->loc);
@@ -8362,10 +8418,10 @@ void BLO_library_append_(BlendHandle** libfiledata, struct direntry* filelist, i
centerloc[0]= (min[0]+max[0])/2; centerloc[0]= (min[0]+max[0])/2;
centerloc[1]= (min[1]+max[1])/2; centerloc[1]= (min[1]+max[1])/2;
centerloc[2]= (min[2]+max[2])/2; centerloc[2]= (min[2]+max[2])/2;
curs = G.scene->cursor; curs = scene->cursor;
VECSUB(centerloc,curs,centerloc); VECSUB(centerloc,curs,centerloc);
centerbase= (G.scene->base.first); centerbase= (scene->base.first);
while(centerbase) { while(centerbase) {
if(centerbase->object->id.lib==curlib && centerbase->object->parent==NULL) { if(centerbase->object->id.lib==curlib && centerbase->object->parent==NULL) {
ob= centerbase->object; ob= centerbase->object;

View File

@@ -4,15 +4,12 @@
* *
* $Id$ * $Id$
* *
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** * ***** BEGIN GPL LICENSE BLOCK *****
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2 * as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. The Blender * of the License, or (at your option) any later version.
* Foundation also sells licenses for use in proprietary software under
* the Blender License. See http://www.blender.org/BL/ for information
* about this.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -26,9 +23,8 @@
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved. * All rights reserved.
* *
* The Original Code is: all of this file.
* *
* Contributor(s): none yet. * Contributor(s): Blender Foundation
* *
* ***** END GPL/BL DUAL LICENSE BLOCK ***** * ***** END GPL/BL DUAL LICENSE BLOCK *****
*/ */
@@ -74,10 +70,6 @@ Any case: direct data is ALWAYS after the lib block
- write USER if filename is ~/.B.blend - write USER if filename is ~/.B.blend
*/ */
/* for version 2.2+
Important to know is that 'streaming' has been added to files, for Blender Publisher
*/
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include <config.h> #include <config.h>
@@ -100,8 +92,6 @@ Important to know is that 'streaming' has been added to files, for Blender Publi
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
#include "nla.h" // __NLA is defined
#include "DNA_armature_types.h" #include "DNA_armature_types.h"
#include "DNA_action_types.h" #include "DNA_action_types.h"
#include "DNA_actuator_types.h" #include "DNA_actuator_types.h"
@@ -147,13 +137,13 @@ Important to know is that 'streaming' has been added to files, for Blender Publi
#include "DNA_vfont_types.h" #include "DNA_vfont_types.h"
#include "DNA_userdef_types.h" #include "DNA_userdef_types.h"
#include "DNA_world_types.h" #include "DNA_world_types.h"
#include "DNA_windowmanager_types.h"
#include "MEM_guardedalloc.h" // MEM_freeN #include "MEM_guardedalloc.h" // MEM_freeN
#include "BLI_blenlib.h" #include "BLI_blenlib.h"
#include "BLI_linklist.h" #include "BLI_linklist.h"
#include "BKE_action.h" #include "BKE_action.h"
#include "BKE_bad_level_calls.h" // build_seqar (from WHILE_SEQ) free_oops error
#include "BKE_blender.h" #include "BKE_blender.h"
#include "BKE_curve.h" #include "BKE_curve.h"
#include "BKE_customdata.h" #include "BKE_customdata.h"
@@ -475,14 +465,14 @@ static void write_scriptlink(WriteData *wd, ScriptLink *slink)
writedata(wd, DATA, sizeof(short)*slink->totscript, slink->flag); writedata(wd, DATA, sizeof(short)*slink->totscript, slink->flag);
} }
static void write_renderinfo(WriteData *wd) /* for renderdeamon */ static void write_renderinfo(bContext *C, WriteData *wd) /* for renderdeamon */
{ {
Scene *sce; Scene *sce;
int data[8]; int data[8];
sce= G.main->scene.first; sce= G.main->scene.first;
while(sce) { while(sce) {
if(sce->id.lib==0 && ( sce==G.scene || (sce->r.scemode & R_BG_RENDER)) ) { if(sce->id.lib==0 && ( sce==C->scene || (sce->r.scemode & R_BG_RENDER)) ) {
data[0]= sce->r.sfra; data[0]= sce->r.sfra;
data[1]= sce->r.efra; data[1]= sce->r.efra;
@@ -1511,6 +1501,19 @@ static void write_scenes(WriteData *wd, ListBase *scebase)
mywrite(wd, MYWRITE_FLUSH, 0); mywrite(wd, MYWRITE_FLUSH, 0);
} }
static void write_windowmanagers(WriteData *wd, ListBase *lb)
{
wmWindowManager *wm;
wmWindow *win;
for(wm= lb->first; wm; wm= wm->id.next) {
writestruct(wd, ID_WM, "wmWindowManager", 1, wm);
for(win= wm->windows.first; win; win= win->next)
writestruct(wd, DATA, "wmWindow", 1, win);
}
}
static void write_screens(WriteData *wd, ListBase *scrbase) static void write_screens(WriteData *wd, ListBase *scrbase)
{ {
bScreen *sc; bScreen *sc;
@@ -1878,13 +1881,17 @@ static void write_brushes(WriteData *wd, ListBase *idbase)
} }
} }
static void write_global(WriteData *wd) /* context is usually defined by WM, two cases where no WM is available:
/* - for forward compatibility, curscreen has to be saved */
/* - for undofile, curscene needs to be saved */
/* XXX still remap G */
static void write_global(bContext *C, WriteData *wd)
{ {
FileGlobal fg; FileGlobal fg;
char subvstr[8]; char subvstr[8];
fg.curscreen= G.curscreen; fg.curscreen= C->screen;
fg.curscene= G.scene; fg.curscene= C->scene;
fg.displaymode= G.displaymode; fg.displaymode= G.displaymode;
fg.winpos= G.winpos; fg.winpos= G.winpos;
fg.fileflags= (G.fileflags & ~G_FILE_NO_UI); // prevent to save this, is not good convention, and feature with concerns... fg.fileflags= (G.fileflags & ~G_FILE_NO_UI); // prevent to save this, is not good convention, and feature with concerns...
@@ -1901,7 +1908,8 @@ static void write_global(WriteData *wd)
} }
/* if MemFile * there's filesave to memory */ /* if MemFile * there's filesave to memory */
static int write_file_handle(int handle, MemFile *compare, MemFile *current, int write_user_block, int write_flags) static int write_file_handle(bContext *C, int handle, MemFile *compare, MemFile *current,
int write_user_block, int write_flags)
{ {
BHead bhead; BHead bhead;
ListBase mainlist; ListBase mainlist;
@@ -1915,11 +1923,14 @@ static int write_file_handle(int handle, MemFile *compare, MemFile *current, int
sprintf(buf, "BLENDER%c%c%.3d", (sizeof(void*)==8)?'-':'_', (G.order==B_ENDIAN)?'V':'v', G.version); sprintf(buf, "BLENDER%c%c%.3d", (sizeof(void*)==8)?'-':'_', (G.order==B_ENDIAN)?'V':'v', G.version);
mywrite(wd, buf, 12); mywrite(wd, buf, 12);
write_renderinfo(wd); write_renderinfo(C, wd);
write_global(wd); write_global(C, wd);
if(current==NULL) /* no UI save in undo */
write_screens (wd, &G.main->screen); /* no UI save in undo */ if(current==NULL) {
write_windowmanagers(wd, &G.main->wm);
write_screens (wd, &G.main->screen);
}
write_scenes (wd, &G.main->scene); write_scenes (wd, &G.main->scene);
write_curves (wd, &G.main->curve); write_curves (wd, &G.main->curve);
write_mballs (wd, &G.main->mball); write_mballs (wd, &G.main->mball);
@@ -1949,7 +1960,7 @@ static int write_file_handle(int handle, MemFile *compare, MemFile *current, int
if (write_user_block) { if (write_user_block) {
write_userdef(wd); write_userdef(wd);
} }
/* dna as last, because (to be implemented) test for which structs are written */ /* dna as last, because (to be implemented) test for which structs are written */
writedata(wd, DNA1, wd->sdna->datalen, wd->sdna->data); writedata(wd, DNA1, wd->sdna->datalen, wd->sdna->data);
@@ -1965,7 +1976,7 @@ static int write_file_handle(int handle, MemFile *compare, MemFile *current, int
} }
/* return: success (1) */ /* return: success (1) */
int BLO_write_file(char *dir, int write_flags, char **error_r) int BLO_write_file(bContext *C, char *dir, int write_flags, char **error_r)
{ {
char userfilename[FILE_MAXDIR+FILE_MAXFILE]; char userfilename[FILE_MAXDIR+FILE_MAXFILE];
char tempname[FILE_MAXDIR+FILE_MAXFILE]; char tempname[FILE_MAXDIR+FILE_MAXFILE];
@@ -1983,7 +1994,7 @@ int BLO_write_file(char *dir, int write_flags, char **error_r)
write_user_block= BLI_streq(dir, userfilename); write_user_block= BLI_streq(dir, userfilename);
err= write_file_handle(file, NULL,NULL, write_user_block, write_flags); err= write_file_handle(C, file, NULL,NULL, write_user_block, write_flags);
close(file); close(file);
if(!err) { if(!err) {
@@ -2020,11 +2031,11 @@ int BLO_write_file(char *dir, int write_flags, char **error_r)
} }
/* return: success (1) */ /* return: success (1) */
int BLO_write_file_mem(MemFile *compare, MemFile *current, int write_flags, char **error_r) int BLO_write_file_mem(bContext *C, MemFile *compare, MemFile *current, int write_flags, char **error_r)
{ {
int err; int err;
err= write_file_handle(0, compare, current, 0, write_flags); err= write_file_handle(C, 0, compare, current, 0, write_flags);
if(err==0) return 1; if(err==0) return 1;
return 0; return 0;
@@ -2122,7 +2133,8 @@ cleanup:
return 1; return 1;
} }
void BLO_write_runtime(char *file, char *exename) { void BLO_write_runtime(bContext *C, char *file, char *exename)
{
char gamename[FILE_MAXDIR+FILE_MAXFILE]; char gamename[FILE_MAXDIR+FILE_MAXFILE];
int outfd = -1; int outfd = -1;
char *cause= NULL; char *cause= NULL;
@@ -2140,7 +2152,7 @@ void BLO_write_runtime(char *file, char *exename) {
outfd= open(gamename, O_BINARY|O_WRONLY|O_CREAT|O_TRUNC, 0777); outfd= open(gamename, O_BINARY|O_WRONLY|O_CREAT|O_TRUNC, 0777);
if (outfd != -1) { if (outfd != -1) {
write_file_handle(outfd, NULL,NULL, 0, G.fileflags); write_file_handle(C, outfd, NULL,NULL, 0, G.fileflags);
if (write(outfd, " ", 1) != 1) { if (write(outfd, " ", 1) != 1) {
cause= "Unable to write to output file"; cause= "Unable to write to output file";
@@ -2160,7 +2172,8 @@ cleanup:
#else /* !__APPLE__ */ #else /* !__APPLE__ */
static int handle_append_runtime(int handle, char *exename, char **cause_r) { static int handle_append_runtime(int handle, char *exename, char **cause_r)
{
char *cause= NULL, *runtime= get_runtime_path(exename); char *cause= NULL, *runtime= get_runtime_path(exename);
unsigned char buf[1024]; unsigned char buf[1024];
int count, progfd= -1; int count, progfd= -1;
@@ -2196,7 +2209,8 @@ cleanup:
return 1; return 1;
} }
static int handle_write_msb_int(int handle, int i) { static int handle_write_msb_int(int handle, int i)
{
unsigned char buf[4]; unsigned char buf[4];
buf[0]= (i>>24)&0xFF; buf[0]= (i>>24)&0xFF;
buf[1]= (i>>16)&0xFF; buf[1]= (i>>16)&0xFF;
@@ -2206,7 +2220,8 @@ static int handle_write_msb_int(int handle, int i) {
return (write(handle, buf, 4)==4); return (write(handle, buf, 4)==4);
} }
void BLO_write_runtime(char *file, char *exename) { void BLO_write_runtime(bContext *C, char *file, char *exename)
{
int outfd= open(file, O_BINARY|O_WRONLY|O_CREAT|O_TRUNC, 0777); int outfd= open(file, O_BINARY|O_WRONLY|O_CREAT|O_TRUNC, 0777);
char *cause= NULL; char *cause= NULL;
int datastart; int datastart;
@@ -2220,7 +2235,7 @@ void BLO_write_runtime(char *file, char *exename) {
datastart= lseek(outfd, 0, SEEK_CUR); datastart= lseek(outfd, 0, SEEK_CUR);
write_file_handle(outfd, NULL,NULL, 0, G.fileflags); write_file_handle(C, outfd, NULL,NULL, 0, G.fileflags);
if (!handle_write_msb_int(outfd, datastart) || (write(outfd, "BRUNTIME", 8)!=8)) { if (!handle_write_msb_int(outfd, datastart) || (write(outfd, "BRUNTIME", 8)!=8)) {
cause= "Unable to write to output file"; cause= "Unable to write to output file";

View File

@@ -42,12 +42,11 @@ CFLAGS += $(LEVEL_1_C_WARNINGS)
CPPFLAGS += -I../../makesdna CPPFLAGS += -I../../makesdna
CPPFLAGS += -I../../blenkernel CPPFLAGS += -I../../blenkernel
CPPFLAGS += -I../../blenlib CPPFLAGS += -I../../blenlib
CPPFLAGS += -I../../include CPPFLAGS += -I../../editors/include
CPPFLAGS += -I$(NAN_FTGL)/include CPPFLAGS += -I$(NAN_FTGL)/include
CPPFLAGS += -I$(NAN_FTGL)/include/FTGL CPPFLAGS += -I$(NAN_FTGL)/include/FTGL
CPPFLAGS += -I$(NAN_GETTEXT)/include CPPFLAGS += -I$(NAN_GETTEXT)/include
CPPFLAGS += -I$(NAN_FREETYPE)/include CPPFLAGS += -I$(NAN_FREETYPE)/include
CPPFLAGS += -I$(OPENGL_HEADERS)
ifeq ($(OS), windows) ifeq ($(OS), windows)
CPPFLAGS += -I$(NAN_ICONV)/include CPPFLAGS += -I$(NAN_ICONV)/include
ifeq ($(FREE_WINDOWS), true) ifeq ($(FREE_WINDOWS), true)

View File

@@ -27,6 +27,8 @@
* ***** END GPL LICENSE BLOCK ***** * ***** END GPL LICENSE BLOCK *****
*/ */
#include <stdio.h>
#include "BKE_global.h" #include "BKE_global.h"
#include "BKE_utildefines.h" #include "BKE_utildefines.h"
#include "BLI_blenlib.h" #include "BLI_blenlib.h"

View File

@@ -36,6 +36,8 @@
#include <io.h> #include <io.h>
#endif #endif
#include <stdio.h>
#include "BKE_global.h" #include "BKE_global.h"
#include "BLI_blenlib.h" #include "BLI_blenlib.h"

View File

@@ -77,11 +77,11 @@ typedef struct IDProperty {
#define IDP_FLOAT 2 #define IDP_FLOAT 2
#define IDP_ARRAY 5 #define IDP_ARRAY 5
#define IDP_GROUP 6 #define IDP_GROUP 6
/*the ID link property type hasn't been implemented yet, this will require /* the ID link property type hasn't been implemented yet, this will require
some cleanup of blenkernel, most likely.*/ some cleanup of blenkernel, most likely.*/
#define IDP_ID 7 #define IDP_ID 7
/*add any future new id property types here.*/ /* add any future new id property types here.*/
/* watch it: Sequence has identical beginning. */ /* watch it: Sequence has identical beginning. */
/** /**
@@ -89,6 +89,8 @@ typedef struct IDProperty {
* provides a common handle to place all data in double-linked lists. * provides a common handle to place all data in double-linked lists.
* */ * */
#define MAX_ID_NAME 24
/* There's a nasty circular dependency here.... void* to the rescue! I /* There's a nasty circular dependency here.... void* to the rescue! I
* really wonder why this is needed. */ * really wonder why this is needed. */
typedef struct ID { typedef struct ID {
@@ -184,6 +186,7 @@ typedef struct PreviewImage {
#define ID_NT MAKE_ID2('N', 'T') #define ID_NT MAKE_ID2('N', 'T')
#define ID_BR MAKE_ID2('B', 'R') #define ID_BR MAKE_ID2('B', 'R')
#define ID_PA MAKE_ID2('P', 'A') #define ID_PA MAKE_ID2('P', 'A')
#define ID_WM MAKE_ID2('W', 'M')
/* NOTE! Fake IDs, needed for g.sipo->blocktype or outliner */ /* NOTE! Fake IDs, needed for g.sipo->blocktype or outliner */
#define ID_SEQ MAKE_ID2('S', 'Q') #define ID_SEQ MAKE_ID2('S', 'Q')

View File

@@ -3,15 +3,12 @@
* *
* $Id$ * $Id$
* *
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** * ***** BEGIN GPL LICENSE BLOCK *****
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2 * as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. The Blender * of the License, or (at your option) any later version.
* Foundation also sells licenses for use in proprietary software under
* the Blender License. See http://www.blender.org/BL/ for information
* about this.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -25,11 +22,10 @@
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved. * All rights reserved.
* *
* The Original Code is: all of this file. *
* Contributor(s): Blender Foundation
* *
* Contributor(s): none yet. * ***** END GPL LICENSE BLOCK *****
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/ */
#ifndef DNA_SCREEN_TYPES_H #ifndef DNA_SCREEN_TYPES_H
#define DNA_SCREEN_TYPES_H #define DNA_SCREEN_TYPES_H
@@ -44,14 +40,17 @@ struct Scene;
typedef struct bScreen { typedef struct bScreen {
ID id; ID id;
ListBase vertbase, edgebase, areabase; ListBase vertbase, edgebase, areabase;
struct Scene *scene; struct Scene *scene;
short startx, endx, starty, endy; /* framebuffer coords */ short startx, endx, starty, endy; /* framebuffer coords */
short sizex, sizey; short sizex, sizey;
short scenenr, screennr; /* only for pupmenu */ short scenenr, screennr; /* only for pupmenu */
short full, pad; short full, winid; /* win id from WM, starts with 1 */
short mainwin, winakt; short mainwin, winakt;
short handler[8]; /* similar to space handler now */ short handler[8]; /* similar to space handler now */
ListBase handlers;
} bScreen; } bScreen;
typedef struct ScrVert { typedef struct ScrVert {
@@ -82,6 +81,7 @@ typedef unsigned short dna_ushort_fix;
typedef struct Panel { /* the part from uiBlock that needs saved in file */ typedef struct Panel { /* the part from uiBlock that needs saved in file */
struct Panel *next, *prev; struct Panel *next, *prev;
char panelname[64], tabname[64]; /* defined as UI_MAX_NAME_STR */ char panelname[64], tabname[64]; /* defined as UI_MAX_NAME_STR */
char drawname[64]; /* panelname is identifier for restoring location */ char drawname[64]; /* panelname is identifier for restoring location */
short ofsx, ofsy, sizex, sizey; short ofsx, ofsy, sizex, sizey;
@@ -95,6 +95,7 @@ typedef struct Panel { /* the part from uiBlock that needs saved in file */
typedef struct ScrArea { typedef struct ScrArea {
struct ScrArea *next, *prev; struct ScrArea *next, *prev;
ScrVert *v1, *v2, *v3, *v4; ScrVert *v1, *v2, *v3, *v4;
bScreen *full; /* if area==full, this is the parent */ bScreen *full; /* if area==full, this is the parent */
float winmat[4][4]; float winmat[4][4];
@@ -115,8 +116,19 @@ typedef struct ScrArea {
ListBase spacedata; ListBase spacedata;
ListBase uiblocks; ListBase uiblocks;
ListBase panels; ListBase panels;
ListBase regionbase;
ListBase handlers;
} ScrArea; } ScrArea;
typedef struct ARegion {
struct ARegion *next, *prev;
rcti winrct;
ListBase handlers;
} ARegion;
#define MAXWIN 128 #define MAXWIN 128
/* area->flag */ /* area->flag */

View File

@@ -0,0 +1,159 @@
/**
* $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 *****
*/
#ifndef DNA_WINDOWMANAGER_TYPES_H
#define DNA_WINDOWMANAGER_TYPES_H
#include "DNA_listBase.h"
#include "DNA_vec_types.h"
#include "DNA_ID.h"
/* defined here: */
struct wmWindowManager;
struct wmWindow;
struct wmEvent;
struct wmOperatorType;
struct wmOperator;
/* forwards */
struct bContext;
struct wmLocal;
struct bScreen;
struct uiBlock;
/* windowmanager is saved, tag WMAN */
typedef struct wmWindowManager {
ID id;
struct wmWindow *windrawable, *winactive; /* separate active from drawable */
ListBase windows;
int initialized; /* set on file read */
int pad;
ListBase operators; /* operator registry */
/* custom keymaps */
ListBase windowkeymap;
ListBase screenkeymap;
} wmWindowManager;
/* the savable part, rest of data is local in ghostwinlay */
typedef struct wmWindow {
struct wmWindow *next, *prev;
void *ghostwin; /* dont want to include ghost.h stuff */
void *timer;
int timer_event;
int winid; /* winid also in screens, is for retrieving this window after read */
struct bScreen *screen; /* active screen */
char screenname[32]; /* MAX_ID_NAME for matching window with active screen after file read */
short posx, posy, sizex, sizey; /* window coords */
short windowstate; /* borderless, full */
short monitor; /* multiscreen... no idea how to store yet */
short active; /* set to 1 if an active window, for quick rejects */
short cursor; /* mouse cursor */
struct wmEvent *eventstate; /* storage for event system */
ListBase queue; /* events */
ListBase handlers;
} wmWindow;
#
#
typedef struct wmOperatorType {
struct wmOperatorType *next, *prev;
char *name; /* text for ui, undo */
char *idname; /* unique identifier */
/* this callback alters UI, adds handlers, uses cb's below */
int (*interactive)(struct bContext *, struct wmOperator *, struct wmEvent *event);
void (*init)(struct bContext *, struct wmOperator *);
int (*exec)(struct bContext *, struct wmOperator *);
void (*exit)(struct bContext *, struct wmOperator *);
int (*poll)(struct bContext *);
void *(*uiBlock)(struct wmOperator *); /* panel for redo or repeat */
char *customname; /* dna name */
void *customdata; /* defaults */
short flag;
} wmOperatorType;
#define OP_MAX_TYPENAME 64
/* partial copy of the event, for matching by eventhandler */
typedef struct wmKeymapItem {
struct wmKeymapItem *next, *prev;
char idname[64]; /* used to retrieve operator type pointer */
short type; /* event code itself */
short val; /* 0=any, 1=click, 2=release, or wheelvalue, or... */
short shift, ctrl, alt, oskey; /* oskey is apple or windowskey, value denotes order of pressed */
short keymodifier; /* rawkey modifier */
short pad;
} wmKeymapItem;
/* this one is the operator itself, stored in files for macros etc */
/* operator + operatortype should be able to redo entirely, but for different contextes */
typedef struct wmOperator {
struct wmOperator *next, *prev;
wmOperatorType *type;
char idname[64]; /* used to retrieve type pointer */
/* default storage (lazy?) */
void *argv1, *argv2;
float argf1, argf2;
int arg1, arg2;
/* custom storage, dna pointer */
void *customdata; /* XXX dynamic properties! */
} wmOperator;
#endif /* DNA_WINDOWMANAGER_TYPES_H */

View File

@@ -130,6 +130,7 @@ char *includefiles[] = {
"DNA_particle_types.h", "DNA_particle_types.h",
// if you add files here, please add them at the end // if you add files here, please add them at the end
// of makesdna.c (this file) as well // of makesdna.c (this file) as well
"DNA_windowmanager_types.h",
// empty string to indicate end of includefiles // empty string to indicate end of includefiles
"" ""
@@ -517,7 +518,7 @@ int convert_include(char *filename)
overslaan= 0; overslaan= 0;
while(count<filelen) { while(count<filelen) {
/* code for skipping a struct: two hashes. (preprocess added a space) */ /* code for skipping a struct: two hashes on 2 lines. (preprocess added a space) */
if(md[0]=='#' && md[1]==' ' && md[2]=='#') { if(md[0]=='#' && md[1]==' ' && md[2]=='#') {
overslaan= 1; overslaan= 1;
} }
@@ -1148,4 +1149,6 @@ int main(int argc, char ** argv)
#include "DNA_brush_types.h" #include "DNA_brush_types.h"
#include "DNA_customdata_types.h" #include "DNA_customdata_types.h"
#include "DNA_particle_types.h" #include "DNA_particle_types.h"
#include "DNA_windowmanager_types.h"
/* end of list */ /* end of list */

View File

@@ -29,9 +29,19 @@
# #
# ***** END GPL/BL DUAL LICENSE BLOCK ***** # ***** END GPL/BL DUAL LICENSE BLOCK *****
# #
# Bounces make to subdirectories. #
SOURCEDIR = source/blender/nodes LIBNAME = nodes
DIRS = intern intern/CMP_nodes intern/SHD_nodes DIR = $(OCGDIR)/blender/$(LIBNAME)
include nan_subdirs.mk include nan_compile.mk
CFLAGS += $(LEVEL_1_C_WARNINGS)
CPPFLAGS += -I../../blenkernel
CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
CPPFLAGS += -I../../makesdna
CPPFLAGS += -I../../blenlib
CPPFLAGS += -I../../editors/include
CPPFLAGS += -I../../imbuf
CPPFLAGS += -I../../render/extern/include

View File

@@ -42,7 +42,6 @@ CPPFLAGS += -I../../../blenkernel
CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
CPPFLAGS += -I../../../makesdna CPPFLAGS += -I../../../makesdna
CPPFLAGS += -I../../../blenlib CPPFLAGS += -I../../../blenlib
CPPFLAGS += -I../../../include CPPFLAGS += -I../../../editors/include
CPPFLAGS += -I../../../imbuf CPPFLAGS += -I../../../imbuf
CPPFLAGS += -I../../../render/extern/include CPPFLAGS += -I../../../render/extern/include
CPPFLAGS += -I$(OPENGL_HEADERS)

View File

@@ -42,7 +42,6 @@ CPPFLAGS += -I../../../blenkernel
CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
CPPFLAGS += -I../../../makesdna CPPFLAGS += -I../../../makesdna
CPPFLAGS += -I../../../blenlib CPPFLAGS += -I../../../blenlib
CPPFLAGS += -I../../../include CPPFLAGS += -I../../../editors/include
CPPFLAGS += -I../../../imbuf CPPFLAGS += -I../../../imbuf
CPPFLAGS += -I../../../render/extern/include CPPFLAGS += -I../../../render/extern/include
CPPFLAGS += -I$(OPENGL_HEADERS)

View File

@@ -0,0 +1,136 @@
/*
* $Id: BPY_extern.h 12334 2007-10-21 23:00:29Z aligorith $
*
* ***** BEGIN GPL/BL DUAL 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. The Blender
* Foundation also sells licenses for use in proprietary software under
* the Blender License. See http://www.blender.org/BL/ for information
* about this.
*
* 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) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code was in: source/blender/bpython/include/BPY_extern.h
*
* Contributor(s): Michel Selten, Willian P. Germano, Chris Keith
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
#ifndef BPY_EXTERN_H
#define BPY_EXTERN_H
extern char bprogname[]; /* holds a copy of argv[0], from creator.c */
struct Text; /* defined in DNA_text_types.h */
struct ID; /* DNA_ID.h */
struct Object; /* DNA_object_types.h */
struct IpoDriver; /* DNA_curve_types.h */
struct ScriptLink; /* DNA_scriptlink_types.h */
struct ListBase; /* DNA_listBase.h */
struct SpaceText; /* DNA_space_types.h */
struct SpaceScript; /* DNA_space_types.h */
struct Script; /* BPI_script.h */
struct ScrArea; /* DNA_screen_types.h */
struct bScreen; /* DNA_screen_types.h */
struct bConstraint; /* DNA_constraint_types.h */
struct bPythonConstraint; /* DNA_constraint_types.h */
struct bConstraintOb; /* DNA_constraint_types.h */
struct bConstraintTarget; /* DNA_constraint_types.h*/
#ifdef __cplusplus
extern "C" {
#endif
/*These two next functions are important for making sure the Draw module
works correctly. Before calling any gui callback using the Draw module,
the following code must be executed:
if (some_drawspace_pylist) {
BPy_Set_DrawButtonsList(some_drawspace_pylist->but_refs);
BPy_Free_DrawButtonsList();
}
some_drawspace_pylist = PyList_New(0);
BPy_Set_DrawButtonsList(some_drawspace_pylist);
Also, BPy_Free_DrawButtonsList() must be called as necassary when a drawspace
with python callbacks is destroyed.
This is necassary to avoid blender buttons storing invalid pointers to freed
python data.*/
void BPy_Set_DrawButtonsList(void *list);
void BPy_Free_DrawButtonsList(void);
void BPY_pyconstraint_eval(struct bPythonConstraint *con, struct bConstraintOb *cob, struct ListBase *targets);
void BPY_pyconstraint_settings(void *arg1, void *arg2);
void BPY_pyconstraint_target(struct bPythonConstraint *con, struct bConstraintTarget *ct);
void BPY_pyconstraint_update(struct Object *owner, struct bConstraint *con);
int BPY_is_pyconstraint(struct Text *text);
void BPY_start_python( int argc, char **argv );
void BPY_end_python( void );
void BPY_post_start_python( void );
void init_syspath( int first_time );
void syspath_append( char *dir );
int BPY_Err_getLinenumber( void );
const char *BPY_Err_getFilename( void );
int BPY_txt_do_python_Text( struct Text *text );
int BPY_menu_do_python( short menutype, int event );
void BPY_run_python_script( char *filename );
void BPY_free_compiled_text( struct Text *text );
void BPY_clear_bad_scriptlinks( struct Text *byebye );
int BPY_has_onload_script( void );
void BPY_do_all_scripts( short event );
int BPY_check_all_scriptlinks( struct Text *text );
void BPY_do_pyscript( struct ID *id, short event );
void BPY_free_scriptlink( struct ScriptLink *slink );
void BPY_copy_scriptlink( struct ScriptLink *scriptlink );
int BPY_is_spacehandler(struct Text *text, char spacetype);
int BPY_del_spacehandler(struct Text *text, struct ScrArea *sa);
int BPY_add_spacehandler(struct Text *txt, struct ScrArea *sa,char spacetype);
int BPY_has_spacehandler(struct Text *text, struct ScrArea *sa);
void BPY_screen_free_spacehandlers(struct bScreen *sc);
int BPY_do_spacehandlers(struct ScrArea *sa, unsigned short event,
unsigned short space_event);
void BPY_pydriver_update(void);
float BPY_pydriver_eval(struct IpoDriver *driver);
struct Object **BPY_pydriver_get_objects(struct IpoDriver *driver);
int BPY_button_eval(char *expr, double *value);
/* format importer hook */
int BPY_call_importloader( char *name );
void BPY_spacescript_do_pywin_draw( struct SpaceScript *sc );
void BPY_spacescript_do_pywin_event( struct SpaceScript *sc,
unsigned short event, short val, char ascii );
void BPY_clear_script( struct Script *script );
void BPY_free_finished_script( struct Script *script );
/* void BPY_Err_Handle(struct Text *text); */
/* void BPY_clear_bad_scriptlink(struct ID *id, struct Text *byebye); */
/* void BPY_clear_bad_scriptlist(struct ListBase *, struct Text *byebye); */
/* int BPY_spacetext_is_pywin(struct SpaceText *st); */
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* BPY_EXTERN_H */

View File

@@ -54,7 +54,7 @@ CPPFLAGS += -I..
# stuff needed by quicktime_[import|export].c # stuff needed by quicktime_[import|export].c
CPPFLAGS += -I../../blenloader -I../../imbuf/intern -I../../imbuf CPPFLAGS += -I../../blenloader -I../../imbuf/intern -I../../imbuf
CPPFLAGS += -I../../blenlib -I../../makesdna -I../../include -I../../avi CPPFLAGS += -I../../blenlib -I../../makesdna -I../../editors/include -I../../avi
CPPFLAGS += -I../../blenkernel -I../../render/extern/include CPPFLAGS += -I../../blenkernel -I../../render/extern/include

View File

@@ -51,6 +51,6 @@ CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
# first /include is my own includes, second are the external includes # first /include is my own includes, second are the external includes
# third is the external interface. there should be a nicer way to say this # third is the external interface. there should be a nicer way to say this
CPPFLAGS += -I../include -I../../../include -I../../extern/include CPPFLAGS += -I../include -I../../../editors/include -I../../extern/include
CPPFLAGS += -I../../../render/extern/include CPPFLAGS += -I../../../render/extern/include
CPPFLAGS += -I../../../render/intern/include CPPFLAGS += -I../../../render/intern/include

View File

@@ -52,7 +52,7 @@ CPPFLAGS += -I../../../yafray
CPPFLAGS += -I../../../../kernel/gen_messaging CPPFLAGS += -I../../../../kernel/gen_messaging
CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
# not very neat: the rest of blender.. # not very neat: the rest of blender..
CPPFLAGS += -I../../../include CPPFLAGS += -I../../../editors/include
CPPFLAGS += $(NAN_SDLCFLAGS) CPPFLAGS += $(NAN_SDLCFLAGS)
ifeq ($(WITH_QUICKTIME), true) ifeq ($(WITH_QUICKTIME), true)