Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWillian Padovani Germano <wpgermano@gmail.com>2003-12-15 21:18:09 +0300
committerWillian Padovani Germano <wpgermano@gmail.com>2003-12-15 21:18:09 +0300
commit050dc02134d71ba984fd1dd900ffccf45cbd6865 (patch)
treec439c24bbc22034b3ac0b7419cacc41865a1c62d
parent436bb963f128b96f871d1ae7fa651cf7c9d810d1 (diff)
Chris reported build errors w/ traditional makefiles.
This commit moves the 2 undefined references to BPY_interface.c and changes things a little, hopefully fixing the problem. I had to add a new dir, source/blender/include/ to auto*'s Makefile.am in source/blender/python/. Thanks Chris for the report, and Jiri, for adding a missing declaration.
-rw-r--r--source/blender/blenkernel/intern/script.c3
-rw-r--r--source/blender/include/BIF_drawscript.h3
-rw-r--r--source/blender/python/BPY_interface.c70
-rw-r--r--source/blender/python/api2_2x/EXPP_interface.c41
-rw-r--r--source/blender/python/api2_2x/EXPP_interface.h1
-rw-r--r--source/blender/src/drawscript.c25
6 files changed, 68 insertions, 75 deletions
diff --git a/source/blender/blenkernel/intern/script.c b/source/blender/blenkernel/intern/script.c
index 13b7473b9d8..78a9b511538 100644
--- a/source/blender/blenkernel/intern/script.c
+++ b/source/blender/blenkernel/intern/script.c
@@ -37,7 +37,6 @@
#include "DNA_script_types.h"
#include "BKE_script.h"
-#include "BIF_drawscript.h" /* for unlink_script */
/*
#include "BLI_blenlib.h"
@@ -64,7 +63,5 @@ void free_script (Script *script)
BPY_clear_script(script);
}
- unlink_script (script); /* unlink from all visible SPACE_SCRIPTS */
-
return;
}
diff --git a/source/blender/include/BIF_drawscript.h b/source/blender/include/BIF_drawscript.h
index d288333cf0c..3435ffd1be1 100644
--- a/source/blender/include/BIF_drawscript.h
+++ b/source/blender/include/BIF_drawscript.h
@@ -35,9 +35,6 @@
struct ScrArea;
struct SpaceScript;
-struct Script;
-
-void unlink_script(struct Script *script);
void init_scriptspace(struct ScrArea *sa);
void free_scriptspace(struct SpaceScript *sc);
diff --git a/source/blender/python/BPY_interface.c b/source/blender/python/BPY_interface.c
index 6ca1b415d48..8f6e813a9e2 100644
--- a/source/blender/python/BPY_interface.c
+++ b/source/blender/python/BPY_interface.c
@@ -41,6 +41,8 @@
#include <MEM_guardedalloc.h>
#include <BLI_blenlib.h> /* for BLI_last_slash() */
+#include <BIF_space.h>
+#include <BIF_screen.h>
#include <BKE_global.h>
#include <BKE_library.h>
#include <BKE_main.h>
@@ -384,8 +386,11 @@ int BPY_txt_do_python(struct SpaceText* st)
/* check if this text is already running */
while (script) {
if (!strcmp(script->id.name+2, st->text->id.name+2)) {
- /* if this text is already a running script, just move to it: */
- EXPP_move_to_spacescript (script);
+ /* if this text is already a running script, just move to it: */
+ SpaceScript *sc;
+ newspace(curarea, SPACE_SCRIPT);
+ sc = curarea->spacedata.first;
+ sc->script = script;
return 1;
}
script = script->id.next;
@@ -458,6 +463,67 @@ void BPY_free_compiled_text(struct Text* text)
return;
}
+
+/*****************************************************************************/
+/* Description: This function frees a finished (flags == 0) script. */
+/*****************************************************************************/
+void BPY_free_finished_script(Script *script)
+{
+ if (!script) return;
+
+ if (script->lastspace != SPACE_SCRIPT)
+ newspace (curarea, script->lastspace);
+
+ free_libblock(&G.main->script, script);
+ return;
+}
+
+void unlink_script(Script *script)
+{ /* copied from unlink_text in drawtext.c */
+ bScreen *scr;
+ ScrArea *area;
+ SpaceLink *sl;
+
+ for (scr= G.main->screen.first; scr; scr= scr->id.next) {
+ for (area= scr->areabase.first; area; area= area->next) {
+ for (sl= area->spacedata.first; sl; sl= sl->next) {
+ if (sl->spacetype==SPACE_SCRIPT) {
+ SpaceScript *sc= (SpaceScript*) sl;
+
+ if (sc->script==script) {
+ sc->script= NULL;
+
+ if (sc==area->spacedata.first) {
+ scrarea_queue_redraw(area);
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+void BPY_clear_script (Script *script)
+{
+ PyObject *dict;
+
+ if (!script) return;
+
+ Py_XDECREF((PyObject *)script->py_draw);
+ Py_XDECREF((PyObject *)script->py_event);
+ Py_XDECREF((PyObject *)script->py_button);
+
+ dict = script->py_globaldict;
+
+ if (dict) {
+ PyDict_Clear (dict);
+ Py_DECREF (dict); /* Release dictionary. */
+ script->py_globaldict = NULL;
+ }
+
+ unlink_script (script);
+}
+
/*****************************************************************************/
/* ScriptLinks */
/*****************************************************************************/
diff --git a/source/blender/python/api2_2x/EXPP_interface.c b/source/blender/python/api2_2x/EXPP_interface.c
index 54076e0fce5..351ff3e5ec4 100644
--- a/source/blender/python/api2_2x/EXPP_interface.c
+++ b/source/blender/python/api2_2x/EXPP_interface.c
@@ -33,8 +33,6 @@
#include <Python.h>
-#include <BIF_space.h>
-#include <BIF_screen.h>
#include <BKE_global.h>
#include <BKE_library.h>
#include <BKE_main.h>
@@ -183,42 +181,3 @@ TODO: Check this */
return (scriptlink);
}
-
-void BPY_clear_script (Script *script)
-{
- if (!script) return;
-
- Py_XDECREF((PyObject *)script->py_globaldict);
- Py_XDECREF((PyObject *)script->py_button);
- Py_XDECREF((PyObject *)script->py_event);
- Py_XDECREF((PyObject *)script->py_draw);
-}
-
-void EXPP_move_to_spacescript (Script *script)
-{ /* used by BPY_txt_do_python when a text is already being executed */
- SpaceScript *sc;
- newspace(curarea, SPACE_SCRIPT);
- sc = curarea->spacedata.first;
- sc->script = script;
- return;
-}
-
-/*****************************************************************************/
-/* Description: This function frees a finished (flags == 0) script. */
-/*****************************************************************************/
-void BPY_free_finished_script(Script *script)
-{
- PyObject *d = script->py_globaldict;
-
- if (d) {
- PyDict_Clear (d);
- Py_DECREF (d); /* Release dictionary. */
- script->py_globaldict = NULL;
- }
-
- if (script->lastspace != SPACE_SCRIPT)
- newspace (curarea, script->lastspace);
-
- free_libblock(&G.main->script, script);
- return;
-}
diff --git a/source/blender/python/api2_2x/EXPP_interface.h b/source/blender/python/api2_2x/EXPP_interface.h
index 10c1a7c17f3..87e5d3dd1ea 100644
--- a/source/blender/python/api2_2x/EXPP_interface.h
+++ b/source/blender/python/api2_2x/EXPP_interface.h
@@ -37,4 +37,3 @@ void initBlenderApi2_2x (void);
void clearScriptLinks (void);
ScriptLink * setScriptLinks(ID *id, short event);
void discardFromBDict (char *key);
-void EXPP_move_to_spacescript (struct Script *script);
diff --git a/source/blender/src/drawscript.c b/source/blender/src/drawscript.c
index c633d0528eb..950bd4f2989 100644
--- a/source/blender/src/drawscript.c
+++ b/source/blender/src/drawscript.c
@@ -128,28 +128,3 @@ void free_scriptspace (SpaceScript *sc)
sc->script = NULL;
}
-
-void unlink_script(Script *script)
-{ /* copied from unlink_text in drawtext.c */
- bScreen *scr;
- ScrArea *area;
- SpaceLink *sl;
-
- for (scr= G.main->screen.first; scr; scr= scr->id.next) {
- for (area= scr->areabase.first; area; area= area->next) {
- for (sl= area->spacedata.first; sl; sl= sl->next) {
- if (sl->spacetype==SPACE_SCRIPT) {
- SpaceScript *sc= (SpaceScript*) sl;
-
- if (sc->script==script) {
- sc->script= NULL;
-
- if (sc==area->spacedata.first) {
- scrarea_queue_redraw(area);
- }
- }
- }
- }
- }
- }
-}