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:
authorStephen Swaney <sswaney@centurytel.net>2006-04-16 19:28:50 +0400
committerStephen Swaney <sswaney@centurytel.net>2006-04-16 19:28:50 +0400
commit342bb99a19579531dcc4b5dbc1d4b3862ba91f04 (patch)
tree57db6ec8a4d079f3278d9792c90ec8177093ef34
parenta204ccd2877a4c8eddffdba71f5f9fa0c654935b (diff)
a little spring cleaning to remove some compiler warnings for
implicit declarations, redundant redeclarations, missing initializers, nested externs and other cruft. Cleaned up includes and moved extern _Type decls from Types.h into Types.c since that is the only place where they are needed now. Did not touch Ipo.[ch] since work is on-going there.
-rw-r--r--source/blender/python/api2_2x/Armature.c16
-rw-r--r--source/blender/python/api2_2x/BGL.c2
-rw-r--r--source/blender/python/api2_2x/Blender.c3
-rw-r--r--source/blender/python/api2_2x/Bone.c17
-rw-r--r--source/blender/python/api2_2x/CurNurb.c4
-rw-r--r--source/blender/python/api2_2x/Curve.c13
-rw-r--r--source/blender/python/api2_2x/Draw.c1
-rw-r--r--source/blender/python/api2_2x/Font.h2
-rwxr-xr-xsource/blender/python/api2_2x/Group.c2
-rw-r--r--source/blender/python/api2_2x/Image.c217
-rw-r--r--source/blender/python/api2_2x/Mathutils.h1
-rw-r--r--source/blender/python/api2_2x/NMesh.h2
-rw-r--r--source/blender/python/api2_2x/Object.c2
-rw-r--r--source/blender/python/api2_2x/Pose.c10
-rw-r--r--source/blender/python/api2_2x/Text3d.c1
-rw-r--r--source/blender/python/api2_2x/Types.c28
-rw-r--r--source/blender/python/api2_2x/Types.h23
-rw-r--r--source/blender/python/api2_2x/Window.c1
-rw-r--r--source/blender/python/api2_2x/World.c2
-rw-r--r--source/blender/python/api2_2x/euler.h2
-rw-r--r--source/blender/python/api2_2x/logic.h2
-rw-r--r--source/blender/python/api2_2x/matrix.h2
-rw-r--r--source/blender/python/api2_2x/point.h2
-rw-r--r--source/blender/python/api2_2x/quat.h2
-rw-r--r--source/blender/python/api2_2x/vector.h2
25 files changed, 174 insertions, 185 deletions
diff --git a/source/blender/python/api2_2x/Armature.c b/source/blender/python/api2_2x/Armature.c
index eb5aba7a5ae..0b3672ebb29 100644
--- a/source/blender/python/api2_2x/Armature.c
+++ b/source/blender/python/api2_2x/Armature.c
@@ -45,7 +45,6 @@
#include "BIF_editarmature.h"
//------------------EXTERNAL PROTOTYPES--------------------
-extern void free_editArmature(void);
extern void make_boneList(ListBase* list, ListBase *bones, EditBone *parent);
extern void editbones_to_armature (ListBase *list, Object *ob);
@@ -67,7 +66,7 @@ static const char sModuleBadArgs[] = "Blender.Armature - Bad Arguments: ";
//------------------METHOD IMPLEMENTATIONS-----------------------------
//------------------------Armature.bones.items()
//Returns a list of key:value pairs like dict.items()
-PyObject* BonesDict_items(BPy_BonesDict *self)
+static PyObject* BonesDict_items(BPy_BonesDict *self)
{
if (self->editmode_flag){
return PyDict_Items(self->editbonesMap);
@@ -77,7 +76,7 @@ PyObject* BonesDict_items(BPy_BonesDict *self)
}
//------------------------Armature.bones.keys()
//Returns a list of keys like dict.keys()
-PyObject* BonesDict_keys(BPy_BonesDict *self)
+static PyObject* BonesDict_keys(BPy_BonesDict *self)
{
if (self->editmode_flag){
return PyDict_Keys(self->editbonesMap);
@@ -87,7 +86,7 @@ PyObject* BonesDict_keys(BPy_BonesDict *self)
}
//------------------------Armature.bones.values()
//Returns a list of values like dict.values()
-PyObject* BonesDict_values(BPy_BonesDict *self)
+static PyObject* BonesDict_values(BPy_BonesDict *self)
{
if (self->editmode_flag){
return PyDict_Values(self->editbonesMap);
@@ -205,7 +204,7 @@ static void BonesDict_dealloc(BPy_BonesDict * self)
}
//------------------------mp_length
//This gets the size of the dictionary
-int BonesDict_len(BPy_BonesDict *self)
+static int BonesDict_len(BPy_BonesDict *self)
{
if (self->editmode_flag){
return BLI_countlist(&self->editbones);
@@ -215,7 +214,7 @@ int BonesDict_len(BPy_BonesDict *self)
}
//-----------------------mp_subscript
//This defines getting a bone from the dictionary - x = Bones['key']
-PyObject *BonesDict_GetItem(BPy_BonesDict *self, PyObject* key)
+static PyObject *BonesDict_GetItem(BPy_BonesDict *self, PyObject* key)
{
PyObject *value = NULL;
@@ -241,7 +240,7 @@ PyObject *BonesDict_GetItem(BPy_BonesDict *self, PyObject* key)
}
//-----------------------mp_ass_subscript
//This does dict assignment - Bones['key'] = value
-int BonesDict_SetItem(BPy_BonesDict *self, PyObject *key, PyObject *value)
+static int BonesDict_SetItem(BPy_BonesDict *self, PyObject *key, PyObject *value)
{
BPy_EditBone *editbone_for_deletion;
struct EditBone *editbone = NULL;
@@ -974,7 +973,7 @@ static PyGetSetDef BPy_Armature_getset[] = {
"Adds temporal IK chains while grabbing bones", NULL},
{"layers", (getter)Armature_getLayers, (setter)Armature_setLayers,
"List of layers for the armature", NULL},
- {NULL}
+ {NULL, NULL, NULL, NULL, NULL}
};
//------------------------tp_new
//This methods creates a new object (note it does not initialize it - only the building)
@@ -1222,7 +1221,6 @@ AttributeError:
}
//-------------------MODULE METHODS DEFINITION-----------------------------
-static PyObject *M_Armature_Get( PyObject * self, PyObject * args );
static char M_Armature_Get_doc[] = "(name) - return the armature with the name 'name', \
returns None if not found.\n If 'name' is not specified, it returns a list of all \
diff --git a/source/blender/python/api2_2x/BGL.c b/source/blender/python/api2_2x/BGL.c
index 81f188e040c..03d282151a7 100644
--- a/source/blender/python/api2_2x/BGL.c
+++ b/source/blender/python/api2_2x/BGL.c
@@ -42,8 +42,6 @@
static int type_size( int type );
static Buffer *make_buffer( int type, int ndimensions, int *dimensions );
-static int Buffer_ass_slice( PyObject * self, int begin, int end,
- PyObject * seq );
static char Method_Buffer_doc[] =
"(type, dimensions, [template]) - Create a new Buffer object\n\n\
diff --git a/source/blender/python/api2_2x/Blender.c b/source/blender/python/api2_2x/Blender.c
index 5609e83d457..06ff315f00a 100644
--- a/source/blender/python/api2_2x/Blender.c
+++ b/source/blender/python/api2_2x/Blender.c
@@ -86,13 +86,12 @@ struct ID; /*keep me up here */
#include "Texture.h"
#include "Window.h"
#include "World.h"
+#include "Types.h"
//for the removefakeuser hack
#include "NLA.h" /*This must come first*/
#include "BKE_action.h"
-extern PyObject *bpy_registryDict; /* defined in ../BPY_interface.c */
-
/**********************************************************/
/* Python API function prototypes for the Blender module. */
diff --git a/source/blender/python/api2_2x/Bone.c b/source/blender/python/api2_2x/Bone.c
index c7f65961c71..c63ad3d016a 100644
--- a/source/blender/python/api2_2x/Bone.c
+++ b/source/blender/python/api2_2x/Bone.c
@@ -29,6 +29,8 @@
*/
#include "Bone.h"
+#include "vector.h"
+#include "matrix.h"
#include "BLI_blenlib.h"
#include "BLI_arithb.h"
@@ -42,9 +44,6 @@
#include "DNA_object_types.h" //1
#include "BIF_editarmature.h" //2
-//------------------UNDECLARED EXTERNAL PROTOTYPES--------------------
-extern void mat3_to_vec_roll(float mat[][3], float *vec, float *roll);
-
//------------------------ERROR CODES---------------------------------
//This is here just to make me happy and to have more consistant error strings :)
static const char sEditBoneError[] = "EditBone - Error: ";
@@ -55,7 +54,7 @@ static const char sBoneError[] = "Bone - Error: ";
//----------------------(internal)
//gets the bone->roll (which is a localspace roll) and puts it in parentspace
//(which is the 'roll' value the user sees)
-double boneRoll_ToArmatureSpace(struct Bone *bone)
+static double boneRoll_ToArmatureSpace(struct Bone *bone)
{
float head[3], tail[3], delta[3];
float premat[3][3], postmat[3][3];
@@ -85,7 +84,7 @@ double boneRoll_ToArmatureSpace(struct Bone *bone)
//------------------METHOD IMPLEMENTATIONS-----------------------------
//-------------------------EditBone.hasParent()
-PyObject *EditBone_hasParent(BPy_EditBone *self)
+static PyObject *EditBone_hasParent(BPy_EditBone *self)
{
if (self->editbone){
if (self->editbone->parent)
@@ -101,7 +100,7 @@ AttributeError:
sEditBoneError, ".hasParent: ", "EditBone must be added to the armature first");
}
//-------------------------EditBone.clearParent()
-PyObject *EditBone_clearParent(BPy_EditBone *self)
+static PyObject *EditBone_clearParent(BPy_EditBone *self)
{
if (self->editbone){
if (self->editbone->parent)
@@ -819,7 +818,7 @@ RuntimeError:
sBoneError, "Internal error trying to wrap blender bones!");
}
//-------------------------Bone.hasParent()
-PyObject *Bone_hasParent(BPy_Bone *self)
+static PyObject *Bone_hasParent(BPy_Bone *self)
{
if (self->bone->parent)
return EXPP_incr_ret(Py_True);
@@ -827,7 +826,7 @@ PyObject *Bone_hasParent(BPy_Bone *self)
return EXPP_incr_ret(Py_False);
}
//-------------------------Bone.hasChildren()
-PyObject *Bone_hasChildren(BPy_Bone *self)
+static PyObject *Bone_hasChildren(BPy_Bone *self)
{
if (self->bone->childbase.first)
return EXPP_incr_ret(Py_True);
@@ -835,7 +834,7 @@ PyObject *Bone_hasChildren(BPy_Bone *self)
return EXPP_incr_ret(Py_False);
}
//-------------------------Bone.getAllChildren()
-PyObject *Bone_getAllChildren(BPy_Bone *self)
+static PyObject *Bone_getAllChildren(BPy_Bone *self)
{
PyObject *list = NULL;
diff --git a/source/blender/python/api2_2x/CurNurb.c b/source/blender/python/api2_2x/CurNurb.c
index 922178f7662..79e9a3249aa 100644
--- a/source/blender/python/api2_2x/CurNurb.c
+++ b/source/blender/python/api2_2x/CurNurb.c
@@ -44,7 +44,6 @@
static PyObject *M_CurNurb_New( PyObject * self, PyObject * args );
-PyObject *CurNurb_CreatePyObject( Nurb * blen_nurb );
static PyObject *CurNurb_setMatIndex( BPy_CurNurb * self, PyObject * args );
static PyObject *CurNurb_getMatIndex( BPy_CurNurb * self );
static PyObject *CurNurb_getFlagU( BPy_CurNurb * self );
@@ -54,13 +53,12 @@ static PyObject *CurNurb_setFlagV( BPy_CurNurb * self, PyObject * args );
static PyObject *CurNurb_getType( BPy_CurNurb * self );
static PyObject *CurNurb_setType( BPy_CurNurb * self, PyObject * args );
/* static PyObject* CurNurb_setXXX( BPy_CurNurb* self, PyObject* args ); */
-PyObject *CurNurb_getPoint( BPy_CurNurb * self, int index );
static int CurNurb_setPoint( BPy_CurNurb * self, int index, PyObject * ob );
static int CurNurb_length( PyInstanceObject * inst );
static PyObject *CurNurb_getIter( BPy_CurNurb * self );
static PyObject *CurNurb_iterNext( BPy_CurNurb * self );
PyObject *CurNurb_append( BPy_CurNurb * self, PyObject * args );
-PyObject *CurNurb_pointAtIndex( Nurb * nurb, int index );
+
static PyObject *CurNurb_isNurb( BPy_CurNurb * self );
static PyObject *CurNurb_isCyclic( BPy_CurNurb * self );
static PyObject *CurNurb_dump( BPy_CurNurb * self );
diff --git a/source/blender/python/api2_2x/Curve.c b/source/blender/python/api2_2x/Curve.c
index 2445e835dee..c17bbe5789a 100644
--- a/source/blender/python/api2_2x/Curve.c
+++ b/source/blender/python/api2_2x/Curve.c
@@ -73,16 +73,11 @@ static PyObject *M_Curve_Get( PyObject * self, PyObject * args );
/* Python BPy_Curve instance methods declarations: */
/*****************************************************************************/
-PyObject *Curve_getName( BPy_Curve * self );
-PyObject *Curve_setName( BPy_Curve * self, PyObject * args );
static PyObject *Curve_getPathLen( BPy_Curve * self );
static PyObject *Curve_setPathLen( BPy_Curve * self, PyObject * args );
static PyObject *Curve_getTotcol( BPy_Curve * self );
static PyObject *Curve_setTotcol( BPy_Curve * self, PyObject * args );
-PyObject *Curve_getMode( BPy_Curve * self );
-PyObject *Curve_setMode( BPy_Curve * self, PyObject * args );
-PyObject *Curve_getBevresol( BPy_Curve * self );
-PyObject *Curve_setBevresol( BPy_Curve * self, PyObject * args );
+#if 0
PyObject *Curve_getResolu( BPy_Curve * self );
PyObject *Curve_setResolu( BPy_Curve * self, PyObject * args );
PyObject *Curve_getResolv( BPy_Curve * self );
@@ -93,6 +88,7 @@ PyObject *Curve_getExt1( BPy_Curve * self );
PyObject *Curve_setExt1( BPy_Curve * self, PyObject * args );
PyObject *Curve_getExt2( BPy_Curve * self );
PyObject *Curve_setExt2( BPy_Curve * self, PyObject * args );
+#endif
static PyObject *Curve_getControlPoint( BPy_Curve * self, PyObject * args );
static PyObject *Curve_setControlPoint( BPy_Curve * self, PyObject * args );
static PyObject *Curve_getLoc( BPy_Curve * self );
@@ -106,7 +102,6 @@ static PyObject *Curve_getKey( BPy_Curve * self );
static PyObject *Curve_isNurb( BPy_Curve * self, PyObject * args );
static PyObject *Curve_isCyclic( BPy_Curve * self, PyObject * args);
static PyObject *Curve_getNumPoints( BPy_Curve * self, PyObject * args );
-static PyObject *Curve_getNumPoints( BPy_Curve * self, PyObject * args );
static PyObject *Curve_appendPoint( BPy_Curve * self, PyObject * args );
static PyObject *Curve_appendNurb( BPy_Curve * self, PyObject * args );
@@ -244,10 +239,6 @@ static int CurveSetAttr( BPy_Curve * msh, char *name, PyObject * v );
static PyObject *CurveGetAttr( BPy_Curve * msh, char *name );
static PyObject *CurveRepr( BPy_Curve * msh );
-PyObject *Curve_CreatePyObject( struct Curve *curve );
-int Curve_CheckPyObject( PyObject * py_obj );
-struct Curve *Curve_FromPyObject( PyObject * py_obj );
-
static PySequenceMethods Curve_as_sequence = {
( inquiry ) Curve_length, /* sq_length */
( binaryfunc ) 0, /* sq_concat */
diff --git a/source/blender/python/api2_2x/Draw.c b/source/blender/python/api2_2x/Draw.c
index 198f4dfbd65..282328c4a9e 100644
--- a/source/blender/python/api2_2x/Draw.c
+++ b/source/blender/python/api2_2x/Draw.c
@@ -57,6 +57,7 @@
#include "mydevice.h" /*@ for all the event constants */
#include "gen_utils.h"
#include "Window.h"
+#include "../BPY_extern.h"
/* these delimit the free range for button events */
#define EXPP_BUTTON_EVENTS_OFFSET 1001
diff --git a/source/blender/python/api2_2x/Font.h b/source/blender/python/api2_2x/Font.h
index 29218623fde..807d4cbe373 100644
--- a/source/blender/python/api2_2x/Font.h
+++ b/source/blender/python/api2_2x/Font.h
@@ -36,6 +36,8 @@
#include <Python.h>
#include "DNA_vfont_types.h"
+extern PyTypeObject Font_Type;
+
typedef struct {
PyObject_HEAD /* required py macro */
VFont * font;
diff --git a/source/blender/python/api2_2x/Group.c b/source/blender/python/api2_2x/Group.c
index 1b7a133823a..a4289571187 100755
--- a/source/blender/python/api2_2x/Group.c
+++ b/source/blender/python/api2_2x/Group.c
@@ -78,7 +78,7 @@ static PyObject *M_Group_getObjects( BPy_Group * self )
}
-void add_to_group_wraper(Group *group, Object *ob) {
+static void add_to_group_wraper(Group *group, Object *ob) {
Base *base;
add_to_group(group, ob);
diff --git a/source/blender/python/api2_2x/Image.c b/source/blender/python/api2_2x/Image.c
index 717e7f574f9..896bcd07433 100644
--- a/source/blender/python/api2_2x/Image.c
+++ b/source/blender/python/api2_2x/Image.c
@@ -46,13 +46,8 @@
#include "BKE_packedFile.h"
#include "DNA_packedFile_types.h"
#include "BKE_icons.h"
+#include "IMB_imbuf.h"
-/*
- fixme
- this belongs in a header
- sswaney 10-aug-2005
-*/
-short IMB_saveiff( struct ImBuf *ibuf, char *naam, int flags );
/*****************************************************************************/
/* Python BPy_Image defaults: */
@@ -74,6 +69,110 @@ static PyObject *M_Image_Get( PyObject * self, PyObject * args );
static PyObject *M_Image_GetCurrent( PyObject * self );
static PyObject *M_Image_Load( PyObject * self, PyObject * args );
+
+/*****************************************************************************/
+/* Python BPy_Image methods declarations: */
+/*****************************************************************************/
+static PyObject *Image_getName( BPy_Image * self );
+static PyObject *Image_getFilename( BPy_Image * self );
+static PyObject *Image_getSize( BPy_Image * self );
+static PyObject *Image_getDepth( BPy_Image * self );
+static PyObject *Image_getXRep( BPy_Image * self );
+static PyObject *Image_getYRep( BPy_Image * self );
+static PyObject *Image_getBindCode( BPy_Image * self );
+static PyObject *Image_getStart( BPy_Image * self );
+static PyObject *Image_getEnd( BPy_Image * self );
+static PyObject *Image_getSpeed( BPy_Image * self );
+static PyObject *Image_setName( BPy_Image * self, PyObject * args );
+static PyObject *Image_setFilename( BPy_Image * self, PyObject * args );
+static PyObject *Image_setXRep( BPy_Image * self, PyObject * args );
+static PyObject *Image_setYRep( BPy_Image * self, PyObject * args );
+static PyObject *Image_setStart( BPy_Image * self, PyObject * args );
+static PyObject *Image_setEnd( BPy_Image * self, PyObject * args );
+static PyObject *Image_setSpeed( BPy_Image * self, PyObject * args );
+static PyObject *Image_reload( BPy_Image * self );
+static PyObject *Image_glLoad( BPy_Image * self );
+static PyObject *Image_glFree( BPy_Image * self );
+static PyObject *Image_getPixelF( BPy_Image * self, PyObject * args );
+static PyObject *Image_getPixelI( BPy_Image * self, PyObject * args );
+static PyObject *Image_setPixelF( BPy_Image * self, PyObject * args );
+static PyObject *Image_setPixelI( BPy_Image * self, PyObject * args );
+static PyObject *Image_getMaxXY( BPy_Image * self );
+static PyObject *Image_getMinXY( BPy_Image * self );
+static PyObject *Image_save( BPy_Image * self );
+static PyObject *Image_unpack( BPy_Image * self, PyObject * args );
+static PyObject *Image_pack( BPy_Image * self );
+
+
+/*****************************************************************************/
+/* Python BPy_Image methods table: */
+/*****************************************************************************/
+static PyMethodDef BPy_Image_methods[] = {
+ /* name, method, flags, doc */
+ {"getPixelF", ( PyCFunction ) Image_getPixelF, METH_VARARGS,
+ "(int, int) - Get pixel color as floats 0.0-1.0 returns [r,g,b,a]"},
+ {"getPixelI", ( PyCFunction ) Image_getPixelI, METH_VARARGS,
+ "(int, int) - Get pixel color as ints 0-255 returns [r,g,b,a]"},
+ {"setPixelF", ( PyCFunction ) Image_setPixelF, METH_VARARGS,
+ "(int, int, [f r,f g,f b,f a]) - Set pixel color using floats 0.0-1.0"},
+ {"setPixelI", ( PyCFunction ) Image_setPixelI, METH_VARARGS,
+ "(int, int, [i r, i g, i b, i a]) - Set pixel color using ints 0-255"},
+ {"getMaxXY", ( PyCFunction ) Image_getMaxXY, METH_NOARGS,
+ "() - Get maximum x & y coordinates of current image as [x, y]"},
+ {"getMinXY", ( PyCFunction ) Image_getMinXY, METH_NOARGS,
+ "() - Get minimun x & y coordinates of image as [x, y]"},
+ {"getName", ( PyCFunction ) Image_getName, METH_NOARGS,
+ "() - Return Image object name"},
+ {"getFilename", ( PyCFunction ) Image_getFilename, METH_NOARGS,
+ "() - Return Image object filename"},
+ {"getSize", ( PyCFunction ) Image_getSize, METH_NOARGS,
+ "() - Return Image object [width, height] dimension in pixels"},
+ {"getDepth", ( PyCFunction ) Image_getDepth, METH_NOARGS,
+ "() - Return Image object pixel depth"},
+ {"getXRep", ( PyCFunction ) Image_getXRep, METH_NOARGS,
+ "() - Return Image object x repetition value"},
+ {"getYRep", ( PyCFunction ) Image_getYRep, METH_NOARGS,
+ "() - Return Image object y repetition value"},
+ {"getStart", ( PyCFunction ) Image_getStart, METH_NOARGS,
+ "() - Return Image object start frame."},
+ {"getEnd", ( PyCFunction ) Image_getEnd, METH_NOARGS,
+ "() - Return Image object end frame."},
+ {"getSpeed", ( PyCFunction ) Image_getSpeed, METH_NOARGS,
+ "() - Return Image object speed (fps)."},
+ {"getBindCode", ( PyCFunction ) Image_getBindCode, METH_NOARGS,
+ "() - Return Image object's bind code value"},
+ {"reload", ( PyCFunction ) Image_reload, METH_NOARGS,
+ "() - Reload the image from the filesystem"},
+ {"glLoad", ( PyCFunction ) Image_glLoad, METH_NOARGS,
+ "() - Load the image data in OpenGL texture memory.\n\
+ The bindcode (int) is returned."},
+ {"glFree", ( PyCFunction ) Image_glFree, METH_NOARGS,
+ "() - Free the image data from OpenGL texture memory only,\n\
+ see also image.glLoad()."},
+ {"setName", ( PyCFunction ) Image_setName, METH_VARARGS,
+ "(str) - Change Image object name"},
+ {"setFilename", ( PyCFunction ) Image_setFilename, METH_VARARGS,
+ "(str) - Change Image file name"},
+ {"setXRep", ( PyCFunction ) Image_setXRep, METH_VARARGS,
+ "(int) - Change Image object x repetition value"},
+ {"setYRep", ( PyCFunction ) Image_setYRep, METH_VARARGS,
+ "(int) - Change Image object y repetition value"},
+ {"setStart", ( PyCFunction ) Image_setStart, METH_VARARGS,
+ "(int) - Change Image object animation start value"},
+ {"setEnd", ( PyCFunction ) Image_setEnd, METH_VARARGS,
+ "(int) - Change Image object animation end value"},
+ {"setSpeed", ( PyCFunction ) Image_setSpeed, METH_VARARGS,
+ "(int) - Change Image object animation speed (fps)"},
+ {"save", ( PyCFunction ) Image_save, METH_NOARGS,
+ "() - Write image buffer to file"},
+ {"unpack", ( PyCFunction ) Image_unpack, METH_VARARGS,
+ "(int) - Unpack image. [0,1,2], Never overwrite, Overwrite if different, Overwrite all."},
+ {"pack", ( PyCFunction ) Image_pack, METH_NOARGS,
+ "() Pack the image"},
+ {NULL, NULL, 0, NULL}
+};
+
+
/*****************************************************************************/
/* The following string definitions are used for documentation strings. */
/* In Python these will be written to the console when doing a */
@@ -644,112 +743,6 @@ PyObject *Image_Init( void )
return ( submodule );
}
-/************************/
-/*** The Image PyType ***/
-/************************/
-
-/*****************************************************************************/
-/* Python BPy_Image methods declarations: */
-/*****************************************************************************/
-static PyObject *Image_getName( BPy_Image * self );
-static PyObject *Image_getFilename( BPy_Image * self );
-static PyObject *Image_getSize( BPy_Image * self );
-static PyObject *Image_getDepth( BPy_Image * self );
-static PyObject *Image_getXRep( BPy_Image * self );
-static PyObject *Image_getYRep( BPy_Image * self );
-static PyObject *Image_getBindCode( BPy_Image * self );
-static PyObject *Image_getStart( BPy_Image * self );
-static PyObject *Image_getEnd( BPy_Image * self );
-static PyObject *Image_getSpeed( BPy_Image * self );
-static PyObject *Image_setName( BPy_Image * self, PyObject * args );
-static PyObject *Image_setFilename( BPy_Image * self, PyObject * args );
-static PyObject *Image_setXRep( BPy_Image * self, PyObject * args );
-static PyObject *Image_setYRep( BPy_Image * self, PyObject * args );
-static PyObject *Image_setStart( BPy_Image * self, PyObject * args );
-static PyObject *Image_setEnd( BPy_Image * self, PyObject * args );
-static PyObject *Image_setSpeed( BPy_Image * self, PyObject * args );
-static PyObject *Image_reload( BPy_Image * self );
-static PyObject *Image_glLoad( BPy_Image * self );
-static PyObject *Image_glFree( BPy_Image * self );
-static PyObject *Image_getPixelF( BPy_Image * self, PyObject * args );
-static PyObject *Image_getPixelI( BPy_Image * self, PyObject * args );
-static PyObject *Image_setPixelF( BPy_Image * self, PyObject * args );
-static PyObject *Image_setPixelI( BPy_Image * self, PyObject * args );
-static PyObject *Image_getMaxXY( BPy_Image * self );
-static PyObject *Image_getMinXY( BPy_Image * self );
-static PyObject *Image_save( BPy_Image * self );
-static PyObject *Image_unpack( BPy_Image * self, PyObject * args );
-static PyObject *Image_pack( BPy_Image * self );
-
-
-/*****************************************************************************/
-/* Python BPy_Image methods table: */
-/*****************************************************************************/
-static PyMethodDef BPy_Image_methods[] = {
- /* name, method, flags, doc */
- {"getPixelF", ( PyCFunction ) Image_getPixelF, METH_VARARGS,
- "(int, int) - Get pixel color as floats 0.0-1.0 returns [r,g,b,a]"},
- {"getPixelI", ( PyCFunction ) Image_getPixelI, METH_VARARGS,
- "(int, int) - Get pixel color as ints 0-255 returns [r,g,b,a]"},
- {"setPixelF", ( PyCFunction ) Image_setPixelF, METH_VARARGS,
- "(int, int, [f r,f g,f b,f a]) - Set pixel color using floats 0.0-1.0"},
- {"setPixelI", ( PyCFunction ) Image_setPixelI, METH_VARARGS,
- "(int, int, [i r, i g, i b, i a]) - Set pixel color using ints 0-255"},
- {"getMaxXY", ( PyCFunction ) Image_getMaxXY, METH_NOARGS,
- "() - Get maximum x & y coordinates of current image as [x, y]"},
- {"getMinXY", ( PyCFunction ) Image_getMinXY, METH_NOARGS,
- "() - Get minimun x & y coordinates of image as [x, y]"},
- {"getName", ( PyCFunction ) Image_getName, METH_NOARGS,
- "() - Return Image object name"},
- {"getFilename", ( PyCFunction ) Image_getFilename, METH_NOARGS,
- "() - Return Image object filename"},
- {"getSize", ( PyCFunction ) Image_getSize, METH_NOARGS,
- "() - Return Image object [width, height] dimension in pixels"},
- {"getDepth", ( PyCFunction ) Image_getDepth, METH_NOARGS,
- "() - Return Image object pixel depth"},
- {"getXRep", ( PyCFunction ) Image_getXRep, METH_NOARGS,
- "() - Return Image object x repetition value"},
- {"getYRep", ( PyCFunction ) Image_getYRep, METH_NOARGS,
- "() - Return Image object y repetition value"},
- {"getStart", ( PyCFunction ) Image_getStart, METH_NOARGS,
- "() - Return Image object start frame."},
- {"getEnd", ( PyCFunction ) Image_getEnd, METH_NOARGS,
- "() - Return Image object end frame."},
- {"getSpeed", ( PyCFunction ) Image_getSpeed, METH_NOARGS,
- "() - Return Image object speed (fps)."},
- {"getBindCode", ( PyCFunction ) Image_getBindCode, METH_NOARGS,
- "() - Return Image object's bind code value"},
- {"reload", ( PyCFunction ) Image_reload, METH_NOARGS,
- "() - Reload the image from the filesystem"},
- {"glLoad", ( PyCFunction ) Image_glLoad, METH_NOARGS,
- "() - Load the image data in OpenGL texture memory.\n\
- The bindcode (int) is returned."},
- {"glFree", ( PyCFunction ) Image_glFree, METH_NOARGS,
- "() - Free the image data from OpenGL texture memory only,\n\
- see also image.glLoad()."},
- {"setName", ( PyCFunction ) Image_setName, METH_VARARGS,
- "(str) - Change Image object name"},
- {"setFilename", ( PyCFunction ) Image_setFilename, METH_VARARGS,
- "(str) - Change Image file name"},
- {"setXRep", ( PyCFunction ) Image_setXRep, METH_VARARGS,
- "(int) - Change Image object x repetition value"},
- {"setYRep", ( PyCFunction ) Image_setYRep, METH_VARARGS,
- "(int) - Change Image object y repetition value"},
- {"setStart", ( PyCFunction ) Image_setStart, METH_VARARGS,
- "(int) - Change Image object animation start value"},
- {"setEnd", ( PyCFunction ) Image_setEnd, METH_VARARGS,
- "(int) - Change Image object animation end value"},
- {"setSpeed", ( PyCFunction ) Image_setSpeed, METH_VARARGS,
- "(int) - Change Image object animation speed (fps)"},
- {"save", ( PyCFunction ) Image_save, METH_NOARGS,
- "() - Write image buffer to file"},
- {"unpack", ( PyCFunction ) Image_unpack, METH_VARARGS,
- "(int) - Unpack image. [0,1,2], Never overwrite, Overwrite if different, Overwrite all."},
- {"pack", ( PyCFunction ) Image_pack, METH_NOARGS,
- "() Pack the image"},
- {NULL, NULL, 0, NULL}
-};
-
/*****************************************************************************/
/* Python Image_Type callback function prototypes: */
/*****************************************************************************/
diff --git a/source/blender/python/api2_2x/Mathutils.h b/source/blender/python/api2_2x/Mathutils.h
index 56f2c4fdd09..84890267ed2 100644
--- a/source/blender/python/api2_2x/Mathutils.h
+++ b/source/blender/python/api2_2x/Mathutils.h
@@ -40,7 +40,6 @@
#include "quat.h"
#include "euler.h"
#include "point.h"
-#include "Types.h"
PyObject *Mathutils_Init( void );
PyObject *row_vector_multiplication(VectorObject* vec, MatrixObject * mat);
diff --git a/source/blender/python/api2_2x/NMesh.h b/source/blender/python/api2_2x/NMesh.h
index f1639d7d401..8d944dfdffe 100644
--- a/source/blender/python/api2_2x/NMesh.h
+++ b/source/blender/python/api2_2x/NMesh.h
@@ -60,7 +60,6 @@ struct BPy_Object;
/* These are from blender/src/editdeform.c, should be declared elsewhere,
* maybe in BIF_editdeform.h, after proper testing of vgrouping methods XXX */
-extern void create_dverts( Mesh * me );
extern void add_vert_defnr( Object * ob, int def_nr, int vertnum, float weight,
int assignmode );
extern void remove_vert_def_nr( Object * ob, int def_nr, int vertnum );
@@ -135,7 +134,6 @@ typedef struct {
} BPy_NMesh;
/* PROTOS */
-extern void test_object_materials( ID * id ); /* declared in BKE_material.h */
PyObject *NMesh_Init( void );
PyObject *NMesh_CreatePyObject( Mesh * me, Object * ob );
diff --git a/source/blender/python/api2_2x/Object.c b/source/blender/python/api2_2x/Object.c
index 6861d2198f9..b9f9f18d1e2 100644
--- a/source/blender/python/api2_2x/Object.c
+++ b/source/blender/python/api2_2x/Object.c
@@ -65,6 +65,7 @@ struct rctf;
#include "BKE_main.h"
#include "BKE_scene.h"
#include "BKE_nla.h"
+#include "BKE_material.h"
#include "BSE_editipo.h"
#include "BSE_edit.h"
@@ -953,7 +954,6 @@ PyObject *Object_Init( void )
static PyObject *Object_buildParts( BPy_Object * self )
{
- void build_particle_system( Object * ob );
struct Object *obj = self->object;
build_particle_system( obj );
diff --git a/source/blender/python/api2_2x/Pose.c b/source/blender/python/api2_2x/Pose.c
index 8ac2ad56aeb..1fef31ed796 100644
--- a/source/blender/python/api2_2x/Pose.c
+++ b/source/blender/python/api2_2x/Pose.c
@@ -72,19 +72,19 @@ static const char sPoseBonesDictError[] = "PoseBone - Error: ";
//------------------METHOD IMPLEMENTATIONS-----------------------------
//------------------------Pose.bones.items()
//Returns a list of key:value pairs like dict.items()
-PyObject* PoseBonesDict_items(BPy_PoseBonesDict *self)
+static PyObject* PoseBonesDict_items(BPy_PoseBonesDict *self)
{
return PyDict_Items(self->bonesMap);
}
//------------------------Pose.bones.keys()
//Returns a list of keys like dict.keys()
-PyObject* PoseBonesDict_keys(BPy_PoseBonesDict *self)
+static PyObject* PoseBonesDict_keys(BPy_PoseBonesDict *self)
{
return PyDict_Keys(self->bonesMap);
}
//------------------------Armature.bones.values()
//Returns a list of values like dict.values()
-PyObject* PoseBonesDict_values(BPy_PoseBonesDict *self)
+static PyObject* PoseBonesDict_values(BPy_PoseBonesDict *self)
{
return PyDict_Values(self->bonesMap);
}
@@ -165,13 +165,13 @@ static void PoseBonesDict_dealloc(BPy_PoseBonesDict * self)
}
//------------------------mp_length
//This gets the size of the dictionary
-int PoseBonesDict_len(BPy_PoseBonesDict *self)
+static int PoseBonesDict_len(BPy_PoseBonesDict *self)
{
return BLI_countlist(self->bones);
}
//-----------------------mp_subscript
//This defines getting a bone from the dictionary - x = Bones['key']
-PyObject *PoseBonesDict_GetItem(BPy_PoseBonesDict *self, PyObject* key)
+static PyObject *PoseBonesDict_GetItem(BPy_PoseBonesDict *self, PyObject* key)
{
PyObject *value = NULL;
diff --git a/source/blender/python/api2_2x/Text3d.c b/source/blender/python/api2_2x/Text3d.c
index 5fbaf552026..9991c09ccff 100644
--- a/source/blender/python/api2_2x/Text3d.c
+++ b/source/blender/python/api2_2x/Text3d.c
@@ -42,7 +42,6 @@
#include "BIF_editfont.h" /* do_textedit() */
#include "Curve.h"
#include "constant.h"
-#include "Types.h"
#include "Font.h"
#include "gen_utils.h"
diff --git a/source/blender/python/api2_2x/Types.c b/source/blender/python/api2_2x/Types.c
index 8eb2ed3c2cb..c7310dd56f1 100644
--- a/source/blender/python/api2_2x/Types.c
+++ b/source/blender/python/api2_2x/Types.c
@@ -31,6 +31,34 @@
#include "Types.h"
+/*
+ stuff pasted from the old Types.h
+ is only need here now
+*/
+
+extern PyTypeObject Action_Type, Armature_Type;
+extern PyTypeObject Pose_Type;
+extern PyTypeObject BezTriple_Type, Bone_Type, Button_Type;
+extern PyTypeObject Camera_Type;
+extern PyTypeObject CurNurb_Type;
+extern PyTypeObject Curve_Type;
+extern PyTypeObject Effect_Type, Font_Type;
+extern PyTypeObject Image_Type, Ipo_Type, IpoCurve_Type;
+extern PyTypeObject Lamp_Type, Lattice_Type;
+extern PyTypeObject Material_Type, Metaball_Type, MTex_Type;
+extern PyTypeObject NMFace_Type, NMVert_Type, NMCol_Type, NMesh_Type;
+extern PyTypeObject MFace_Type, MVert_Type, PVert_Type, MEdge_Type, MCol_Type,
+ Mesh_Type;
+extern PyTypeObject Object_Type;
+extern PyTypeObject Particle_Type;
+extern PyTypeObject Scene_Type, RenderData_Type;
+extern PyTypeObject Text_Type, Text3d_Type, Texture_Type;
+extern PyTypeObject World_Type;
+extern PyTypeObject property_Type;
+extern PyTypeObject buffer_Type, constant_Type, euler_Type;
+extern PyTypeObject matrix_Type, quaternion_Type, rgbTuple_Type, vector_Type;
+extern PyTypeObject point_Type;
+
char M_Types_doc[] = "The Blender Types module\n\n\
This module is a dictionary of all Blender Python types";
diff --git a/source/blender/python/api2_2x/Types.h b/source/blender/python/api2_2x/Types.h
index 349c4af545b..adaf59bbfbf 100644
--- a/source/blender/python/api2_2x/Types.h
+++ b/source/blender/python/api2_2x/Types.h
@@ -35,29 +35,6 @@
#include <Python.h>
-extern PyTypeObject Action_Type, Armature_Type;
-extern PyTypeObject Pose_Type;
-extern PyTypeObject BezTriple_Type, Bone_Type, Button_Type;
-extern PyTypeObject Camera_Type;
-extern PyTypeObject CurNurb_Type;
-extern PyTypeObject Curve_Type;
-extern PyTypeObject Effect_Type, Font_Type;
-extern PyTypeObject Image_Type, Ipo_Type, IpoCurve_Type;
-extern PyTypeObject Lamp_Type, Lattice_Type;
-extern PyTypeObject Material_Type, Metaball_Type, MTex_Type;
-extern PyTypeObject NMFace_Type, NMVert_Type, NMCol_Type, NMesh_Type;
-extern PyTypeObject MFace_Type, MVert_Type, PVert_Type, MEdge_Type, MCol_Type,
- Mesh_Type;
-extern PyTypeObject Object_Type;
-extern PyTypeObject Particle_Type;
-extern PyTypeObject Scene_Type, RenderData_Type;
-extern PyTypeObject Text_Type, Text3d_Type, Texture_Type;
-extern PyTypeObject World_Type;
-extern PyTypeObject property_Type;
-extern PyTypeObject buffer_Type, constant_Type, euler_Type;
-extern PyTypeObject matrix_Type, quaternion_Type, rgbTuple_Type, vector_Type;
-extern PyTypeObject point_Type;
-
PyObject *Types_Init( void );
void types_InitAll( void );
diff --git a/source/blender/python/api2_2x/Window.c b/source/blender/python/api2_2x/Window.c
index a7ad2581f45..9c40f9ffa29 100644
--- a/source/blender/python/api2_2x/Window.c
+++ b/source/blender/python/api2_2x/Window.c
@@ -989,7 +989,6 @@ static PyObject *M_Window_ViewLayers( PyObject * self, PyObject * args )
static PyObject *M_Window_CameraView( PyObject * self, PyObject * args )
{
short camtov3d = 0;
- void setcameratoview3d( void ); /* view.c, used in toets.c */
if( !PyArg_ParseTuple( args, "|i", &camtov3d ) )
return EXPP_ReturnPyObjError( PyExc_TypeError,
diff --git a/source/blender/python/api2_2x/World.c b/source/blender/python/api2_2x/World.c
index c91f2b1a2d8..2e3e6d2d136 100644
--- a/source/blender/python/api2_2x/World.c
+++ b/source/blender/python/api2_2x/World.c
@@ -274,8 +274,6 @@ PyTypeObject World_Type = {
static PyObject *M_World_New( PyObject * self, PyObject * args,
PyObject * kwords )
{
-
- World *add_world( char *name );
char *name = NULL;
BPy_World *pyworld;
World *blworld;
diff --git a/source/blender/python/api2_2x/euler.h b/source/blender/python/api2_2x/euler.h
index e556b76de76..70a4affb086 100644
--- a/source/blender/python/api2_2x/euler.h
+++ b/source/blender/python/api2_2x/euler.h
@@ -36,6 +36,8 @@
#include <Python.h>
+extern PyTypeObject euler_Type;
+
#define EulerObject_Check(v) ((v)->ob_type == &euler_Type)
typedef struct {
diff --git a/source/blender/python/api2_2x/logic.h b/source/blender/python/api2_2x/logic.h
index c2b37b16360..74478b44acf 100644
--- a/source/blender/python/api2_2x/logic.h
+++ b/source/blender/python/api2_2x/logic.h
@@ -36,6 +36,8 @@
#include <Python.h>
#include "DNA_property_types.h"
+extern PyTypeObject property_Type;
+
//--------------------------Python BPy_Property structure definition.----
typedef struct {
PyObject_HEAD
diff --git a/source/blender/python/api2_2x/matrix.h b/source/blender/python/api2_2x/matrix.h
index 77ac0c2b9f6..4d1b9e0a5c6 100644
--- a/source/blender/python/api2_2x/matrix.h
+++ b/source/blender/python/api2_2x/matrix.h
@@ -35,6 +35,8 @@
#include <Python.h>
+extern PyTypeObject matrix_Type;
+
#define MatrixObject_Check(v) ((v)->ob_type == &matrix_Type)
typedef float **ptRow;
diff --git a/source/blender/python/api2_2x/point.h b/source/blender/python/api2_2x/point.h
index ddfabdb42c9..0ea8cb1fe6e 100644
--- a/source/blender/python/api2_2x/point.h
+++ b/source/blender/python/api2_2x/point.h
@@ -35,6 +35,8 @@
#include <Python.h>
+extern PyTypeObject point_Type;
+
#define PointObject_Check(v) ((v)->ob_type == &point_Type)
typedef struct {
diff --git a/source/blender/python/api2_2x/quat.h b/source/blender/python/api2_2x/quat.h
index 257d2de8ef1..da7e053d99a 100644
--- a/source/blender/python/api2_2x/quat.h
+++ b/source/blender/python/api2_2x/quat.h
@@ -36,6 +36,8 @@
#include <Python.h>
+extern PyTypeObject quaternion_Type;
+
#define QuaternionObject_Check(v) ((v)->ob_type == &quaternion_Type)
typedef struct {
diff --git a/source/blender/python/api2_2x/vector.h b/source/blender/python/api2_2x/vector.h
index 5a99b5298a0..d060b78855b 100644
--- a/source/blender/python/api2_2x/vector.h
+++ b/source/blender/python/api2_2x/vector.h
@@ -35,6 +35,8 @@
#include <Python.h>
+extern PyTypeObject vector_Type;
+
#define VectorObject_Check(v) ((v)->ob_type == &vector_Type)
typedef struct {