moved python functions that deal with blender libdata into gen_library.c from gen_utils and BPY_interface
small cleanup, removed unused functions and explicetly cast pointers..
This commit is contained in:
@@ -43,7 +43,11 @@
|
||||
#include "BKE_library.h"
|
||||
#include "BKE_object.h" /* during_scriptlink() */
|
||||
#include "BKE_text.h"
|
||||
|
||||
#include "DNA_curve_types.h" /* for struct IpoDriver */
|
||||
#include "DNA_ID.h" /* ipo driver */
|
||||
#include "DNA_object_types.h" /* ipo driver */
|
||||
|
||||
#include "DNA_screen_types.h"
|
||||
#include "DNA_userdef_types.h" /* for U.pythondir */
|
||||
#include "MEM_guardedalloc.h"
|
||||
@@ -55,6 +59,7 @@
|
||||
#include "api2_2x/EXPP_interface.h"
|
||||
#include "api2_2x/constant.h"
|
||||
#include "api2_2x/gen_utils.h"
|
||||
#include "api2_2x/gen_library.h" /* GetPyObjectFromID */
|
||||
#include "api2_2x/BGL.h"
|
||||
#include "api2_2x/Blender.h"
|
||||
#include "api2_2x/Camera.h"
|
||||
@@ -62,29 +67,12 @@
|
||||
#include "api2_2x/Registry.h"
|
||||
#include "api2_2x/Main.h" /* for the "bpy" default module */
|
||||
|
||||
/* ID_asPyObject */
|
||||
#include "api2_2x/Object.h"
|
||||
#include "api2_2x/Camera.h"
|
||||
#include "api2_2x/Armature.h"
|
||||
#include "api2_2x/Lamp.h"
|
||||
/*#include "api2_2x/ CurNurb.h" do we need this ? */
|
||||
#include "api2_2x/Curve.h"
|
||||
#include "api2_2x/NMesh.h"
|
||||
#include "api2_2x/Mesh.h"
|
||||
#include "api2_2x/Lattice.h"
|
||||
#include "api2_2x/Metaball.h"
|
||||
#include "api2_2x/Text3d.h"
|
||||
#include "api2_2x/Font.h"
|
||||
#include "api2_2x/Group.h"
|
||||
#include "api2_2x/World.h"
|
||||
#include "api2_2x/Texture.h"
|
||||
#include "api2_2x/Ipo.h"
|
||||
#include "api2_2x/Text.h"
|
||||
#include "api2_2x/Sound.h"
|
||||
#include "api2_2x/NLA.h"
|
||||
#include "api2_2x/Main.h"
|
||||
#include "api2_2x/Scene.h"
|
||||
|
||||
/* for scriptlinks */
|
||||
#include "DNA_lamp_types.h"
|
||||
#include "DNA_camera_types.h"
|
||||
#include "DNA_world_types.h"
|
||||
#include "DNA_scene_types.h"
|
||||
#include "DNA_material_types.h"
|
||||
|
||||
/* bpy_registryDict is declared in api2_2x/Registry.h and defined
|
||||
* in api2_2x/Registry.c
|
||||
@@ -1354,70 +1342,6 @@ static ScriptLink *ID_getScriptlink( ID * id )
|
||||
}
|
||||
}
|
||||
|
||||
PyObject *ID_asPyObject( ID * id )
|
||||
{
|
||||
switch ( MAKE_ID2( id->name[0], id->name[1] ) ) {
|
||||
case ID_SCE:
|
||||
return Scene_CreatePyObject( ( Scene *) id );
|
||||
break;
|
||||
case ID_OB:
|
||||
return Object_CreatePyObject( (Object *) id );
|
||||
break;
|
||||
case ID_ME:
|
||||
return Mesh_CreatePyObject( (Mesh *)id, NULL );
|
||||
break;
|
||||
case ID_CU: /*todo, support curnurbs?*/
|
||||
return Curve_CreatePyObject((Curve *)id);
|
||||
break;
|
||||
case ID_MB:
|
||||
return Metaball_CreatePyObject((MetaBall *)id);
|
||||
break;
|
||||
case ID_MA:
|
||||
return Material_CreatePyObject((Material *)id);
|
||||
break;
|
||||
case ID_TE:
|
||||
return Texture_CreatePyObject((Tex *)id);
|
||||
break;
|
||||
case ID_IM:
|
||||
return Image_CreatePyObject((Image *)id);
|
||||
break;
|
||||
case ID_LT:
|
||||
return Lattice_CreatePyObject((Lattice *)id);
|
||||
break;
|
||||
case ID_LA:
|
||||
return Lamp_CreatePyObject((Lamp *)id);
|
||||
break;
|
||||
case ID_CA:
|
||||
return Camera_CreatePyObject((Camera *)id);
|
||||
break;
|
||||
case ID_IP:
|
||||
return Ipo_CreatePyObject((Ipo *)id);
|
||||
break;
|
||||
case ID_WO:
|
||||
return World_CreatePyObject((World *)id);
|
||||
break;
|
||||
case ID_VF:
|
||||
return Font_CreatePyObject((VFont *)id);
|
||||
break;
|
||||
case ID_TXT:
|
||||
return Text_CreatePyObject((Text *)id);
|
||||
break;
|
||||
case ID_SO:
|
||||
return Sound_CreatePyObject((bSound *)id);
|
||||
break;
|
||||
case ID_GR:
|
||||
return Group_CreatePyObject((Group *)id);
|
||||
break;
|
||||
case ID_AR:
|
||||
return Armature_CreatePyObject((bArmature *)id);
|
||||
break;
|
||||
case ID_AC:
|
||||
return Action_CreatePyObject((bAction *)id);
|
||||
break;
|
||||
}
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
int BPY_has_onload_script( void )
|
||||
{
|
||||
ScriptLink *slink = &G.scene->scriptlink;
|
||||
@@ -1461,7 +1385,7 @@ void BPY_do_pyscript( ID * id, short event )
|
||||
/* set globals in Blender module to identify scriptlink */
|
||||
EXPP_dict_set_item_str( g_blenderdict, "bylink", EXPP_incr_ret_True() );
|
||||
EXPP_dict_set_item_str( g_blenderdict, "link",
|
||||
ID_asPyObject( id ) );
|
||||
GetPyObjectFromID( id ) );
|
||||
EXPP_dict_set_item_str( g_blenderdict, "event",
|
||||
PyString_FromString( event_to_name
|
||||
( event ) ) );
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
#include "Bone.h"
|
||||
#include "NLA.h"
|
||||
#include "gen_utils.h"
|
||||
#include "gen_library.h"
|
||||
|
||||
#include "DNA_object_types.h" //This must come before BIF_editarmature.h...
|
||||
#include "BIF_editarmature.h"
|
||||
|
||||
@@ -41,6 +41,7 @@
|
||||
#include "BIF_space.h"
|
||||
#include "mydevice.h"
|
||||
#include "gen_utils.h"
|
||||
#include "gen_library.h"
|
||||
#include "Ipo.h"
|
||||
|
||||
|
||||
@@ -369,16 +370,6 @@ Camera *Camera_FromPyObject( PyObject * pyobj )
|
||||
/* Python BPy_Camera methods: */
|
||||
/*****************************************************************************/
|
||||
|
||||
static PyObject *Camera_oldgetIpo( BPy_Camera * self )
|
||||
{
|
||||
struct Ipo *ipo = self->camera->ipo;
|
||||
|
||||
if( !ipo )
|
||||
Py_RETURN_NONE;
|
||||
|
||||
return Ipo_CreatePyObject( ipo );
|
||||
}
|
||||
|
||||
static PyObject *Camera_oldgetType( BPy_Camera * self )
|
||||
{
|
||||
PyObject *attr = PyInt_FromLong( self->camera->type );
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
#include "Object.h"
|
||||
#include "Key.h"
|
||||
#include "gen_utils.h"
|
||||
#include "gen_library.h"
|
||||
#include "mydevice.h"
|
||||
|
||||
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
#include "BKE_library.h" /* for rename_id() */
|
||||
#include "BLI_blenlib.h"
|
||||
#include "gen_utils.h"
|
||||
#include "gen_library.h"
|
||||
|
||||
#include "BKE_main.h" /* so we can access G.main->vfont.first */
|
||||
#include "DNA_space_types.h" /* for FILE_MAXDIR only */
|
||||
|
||||
@@ -47,6 +47,7 @@
|
||||
#include "blendef.h"
|
||||
#include "Object.h"
|
||||
#include "gen_utils.h"
|
||||
#include "gen_library.h"
|
||||
|
||||
/* checks for the group being removed */
|
||||
#define GROUP_DEL_CHECK_PY(bpy_group) if (!(bpy_group->group)) return ( EXPP_ReturnPyObjError( PyExc_RuntimeError, "Group has been removed" ) )
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
#include "IMB_imbuf_types.h" /* for the IB_rect define */
|
||||
#include "BIF_gl.h"
|
||||
#include "gen_utils.h"
|
||||
#include "gen_library.h"
|
||||
#include "BKE_packedFile.h"
|
||||
#include "DNA_packedFile_types.h"
|
||||
#include "BKE_icons.h"
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
#include "mydevice.h"
|
||||
#include "Ipocurve.h"
|
||||
#include "gen_utils.h"
|
||||
#include "gen_library.h"
|
||||
|
||||
extern int ob_ar[];
|
||||
extern int la_ar[];
|
||||
|
||||
@@ -52,6 +52,7 @@
|
||||
#include "blendef.h"
|
||||
#include "constant.h"
|
||||
#include "gen_utils.h"
|
||||
#include "gen_library.h"
|
||||
|
||||
#define KEY_TYPE_MESH 0
|
||||
#define KEY_TYPE_CURVE 1
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
#include "Ipo.h"
|
||||
#include "constant.h"
|
||||
#include "gen_utils.h"
|
||||
#include "gen_library.h"
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Python BPy_Lamp defaults: */
|
||||
|
||||
@@ -49,6 +49,7 @@
|
||||
#include "BIF_space.h"
|
||||
#include "blendef.h"
|
||||
#include "gen_utils.h"
|
||||
#include "gen_library.h"
|
||||
|
||||
#include "Key.h"
|
||||
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
#include "Texture.h"
|
||||
#include "Object.h"
|
||||
#include "gen_utils.h"
|
||||
#include "gen_library.h"
|
||||
|
||||
#include <DNA_material_types.h>
|
||||
|
||||
|
||||
@@ -76,9 +76,10 @@
|
||||
#include "BIF_editsound.h" /* sound_new_sound */
|
||||
|
||||
/* python types */
|
||||
#include "../BPY_extern.h" /* clearing scriptlinks and ID_asPyObject */
|
||||
#include "../BPY_extern.h" /* clearing scriptlinks */
|
||||
|
||||
#include "gen_utils.h"
|
||||
#include "gen_library.h" /* generic ID functions */
|
||||
|
||||
#include "Object.h"
|
||||
#include "Camera.h"
|
||||
@@ -167,7 +168,7 @@ static PyObject * MainSeq_subscript(BPy_MainSeq * self, PyObject *key)
|
||||
(lib && use_lib && id->lib && (!strcmp( id->lib->name, lib))) /* only external lib */
|
||||
)
|
||||
{
|
||||
return ID_asPyObject(id);
|
||||
return GetPyObjectFromID(id);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -226,7 +227,7 @@ static PyObject *MainSeq_nextIter( BPy_MainSeq * self )
|
||||
"iterator at end" );
|
||||
}
|
||||
|
||||
object = ID_asPyObject((ID *)self->iter);
|
||||
object = GetPyObjectFromID((ID *)self->iter);
|
||||
|
||||
link= self->iter->next;
|
||||
self->iter= link;
|
||||
@@ -564,7 +565,7 @@ PyObject *MainSeq_new(BPy_MainSeq *self, PyObject * args)
|
||||
break;
|
||||
}
|
||||
|
||||
if (id) return ID_asPyObject(id);
|
||||
if (id) return GetPyObjectFromID(id);
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
|
||||
@@ -38,9 +38,6 @@
|
||||
/* The Main PyType Object defined in Main.c */
|
||||
extern PyTypeObject MainSeq_Type;
|
||||
|
||||
/* BPY_interface.c */
|
||||
extern PyObject *ID_asPyObject( ID * id );
|
||||
|
||||
#define BPy_MainSeq_Check(v) \
|
||||
((v)->ob_type == &MainSeq_Type)
|
||||
|
||||
|
||||
@@ -53,6 +53,7 @@
|
||||
#include "Ipo.h"
|
||||
#include "Group.h"
|
||||
#include "gen_utils.h"
|
||||
#include "gen_library.h"
|
||||
#include "IDProp.h"
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
@@ -87,6 +87,7 @@
|
||||
#include "meshPrimitive.h"
|
||||
#include "constant.h"
|
||||
#include "gen_utils.h"
|
||||
#include "gen_library.h"
|
||||
#include "multires.h"
|
||||
|
||||
/* EXPP Mesh defines */
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
#include "Mathutils.h"
|
||||
#include "Material.h"
|
||||
#include "gen_utils.h"
|
||||
#include "gen_library.h"
|
||||
|
||||
/* for dealing with materials */
|
||||
#include "MEM_guardedalloc.h"
|
||||
|
||||
@@ -51,6 +51,7 @@
|
||||
#include "Texture.h"
|
||||
#include "Mathutils.h"
|
||||
#include "gen_utils.h"
|
||||
#include "gen_library.h"
|
||||
|
||||
/* checks for the scene being removed */
|
||||
#define MODIFIER_DEL_CHECK_PY(bpy_modifier) if (!(bpy_modifier->md)) return ( EXPP_ReturnPyObjError( PyExc_RuntimeError, "Modifier has been removed" ) )
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
#include "Object.h"
|
||||
#include "Ipo.h"
|
||||
#include "gen_utils.h"
|
||||
#include "gen_library.h"
|
||||
#include "blendef.h"
|
||||
#include "MEM_guardedalloc.h"
|
||||
|
||||
|
||||
@@ -113,6 +113,7 @@ struct rctf;
|
||||
#include "Modifier.h"
|
||||
#include "Constraint.h"
|
||||
#include "gen_utils.h"
|
||||
#include "gen_library.h"
|
||||
#include "EXPP_interface.h"
|
||||
#include "BIF_editkey.h"
|
||||
#include "IDProp.h"
|
||||
|
||||
@@ -53,6 +53,7 @@
|
||||
#include "Constraint.h"
|
||||
#include "NLA.h"
|
||||
#include "gen_utils.h"
|
||||
#include "gen_library.h"
|
||||
|
||||
#include "DNA_armature_types.h" /*used for pose bone select*/
|
||||
|
||||
@@ -352,15 +353,15 @@ static char BPy_Pose_doc[] = "This object wraps a Blender Pose object.";
|
||||
PyTypeObject Pose_Type = {
|
||||
PyObject_HEAD_INIT(NULL) //tp_head
|
||||
0, //tp_internal
|
||||
"Pose", //tp_name
|
||||
sizeof(BPy_Pose), //tp_basicsize
|
||||
"Pose", //tp_name
|
||||
sizeof(BPy_Pose), //tp_basicsize
|
||||
0, //tp_itemsize
|
||||
(destructor)Pose_dealloc, //tp_dealloc
|
||||
(destructor)Pose_dealloc, //tp_dealloc
|
||||
0, //tp_print
|
||||
0, //tp_getattr
|
||||
0, //tp_setattr
|
||||
0, //tp_compare
|
||||
(reprfunc)Pose_repr, //tp_repr
|
||||
(cmpfunc)Pose_compare, //tp_compare
|
||||
(reprfunc)Pose_repr, //tp_repr
|
||||
0, //tp_as_number
|
||||
0, //tp_as_sequence
|
||||
0, //tp_as_mapping
|
||||
@@ -370,17 +371,17 @@ PyTypeObject Pose_Type = {
|
||||
0, //tp_getattro
|
||||
0, //tp_setattro
|
||||
0, //tp_as_buffer
|
||||
Py_TPFLAGS_DEFAULT, //tp_flags
|
||||
BPy_Pose_doc, //tp_doc
|
||||
Py_TPFLAGS_DEFAULT, //tp_flags
|
||||
BPy_Pose_doc, //tp_doc
|
||||
0, //tp_traverse
|
||||
0, //tp_clear
|
||||
0, //tp_richcompare
|
||||
0, //tp_weaklistoffset
|
||||
0, //tp_iter
|
||||
0, //tp_iternext
|
||||
BPy_Pose_methods, //tp_methods
|
||||
BPy_Pose_methods, //tp_methods
|
||||
0, //tp_members
|
||||
BPy_Pose_getset, //tp_getset
|
||||
BPy_Pose_getset, //tp_getset
|
||||
0, //tp_base
|
||||
0, //tp_dict
|
||||
0, //tp_descr_get
|
||||
|
||||
@@ -74,6 +74,7 @@ struct View3D;
|
||||
#include "Text3d.h"
|
||||
|
||||
#include "gen_utils.h"
|
||||
#include "gen_library.h"
|
||||
#include "sceneRender.h"
|
||||
#include "sceneRadio.h"
|
||||
#include "sceneTimeLine.h"
|
||||
|
||||
@@ -41,6 +41,7 @@
|
||||
#include "BKE_packedFile.h"
|
||||
#include "mydevice.h" /* redraw defines */
|
||||
#include "gen_utils.h"
|
||||
#include "gen_library.h"
|
||||
#include "DNA_space_types.h" /* for FILE_MAXDIR only */
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
#include "BDR_editcurve.h" /* for convertspline */
|
||||
#include "MEM_guardedalloc.h"
|
||||
#include "gen_utils.h"
|
||||
#include "gen_library.h"
|
||||
#include "BezTriple.h"
|
||||
|
||||
/*
|
||||
|
||||
@@ -41,6 +41,7 @@
|
||||
#include "BLI_blenlib.h"
|
||||
#include "DNA_space_types.h"
|
||||
#include "gen_utils.h"
|
||||
#include "gen_library.h"
|
||||
#include "../BPY_extern.h"
|
||||
|
||||
/* used only for makeCurrent, this may be deprecated when Blender.Base is implimented */
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
#include "constant.h"
|
||||
#include "Font.h"
|
||||
#include "gen_utils.h"
|
||||
#include "gen_library.h"
|
||||
|
||||
|
||||
enum t3d_consts {
|
||||
|
||||
@@ -52,6 +52,7 @@
|
||||
#include "constant.h"
|
||||
#include "blendef.h"
|
||||
#include "gen_utils.h"
|
||||
#include "gen_library.h"
|
||||
|
||||
#include "vector.h" /* for Texture_evaluate(vec) */
|
||||
#include "Material.h" /* for EXPP_Colorband_fromPyList and EXPP_PyList_fromColorband */
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
#include "mydevice.h"
|
||||
#include "Ipo.h"
|
||||
#include "gen_utils.h"
|
||||
|
||||
#include "gen_library.h"
|
||||
|
||||
#define IPOKEY_ZENITH 0
|
||||
#define IPOKEY_HORIZON 1
|
||||
@@ -406,7 +406,6 @@ static PyObject *M_World_Get( PyObject * self, PyObject * args )
|
||||
char *name = NULL;
|
||||
World *world_iter;
|
||||
PyObject *worldlist;
|
||||
BPy_World *wanted_world = NULL;
|
||||
char error_msg[64];
|
||||
|
||||
if( !PyArg_ParseTuple( args, "|s", &name ) )
|
||||
|
||||
308
source/blender/python/api2_2x/gen_library.c
Normal file
308
source/blender/python/api2_2x/gen_library.c
Normal file
@@ -0,0 +1,308 @@
|
||||
#include "gen_library.h"
|
||||
#include "gen_utils.h" /*This must come first*/
|
||||
|
||||
/* use for GenericLib_getProperties */
|
||||
#include "BKE_idprop.h"
|
||||
#include "IDProp.h"
|
||||
|
||||
#include "BKE_global.h"
|
||||
#include "BKE_main.h"
|
||||
#include "BKE_library.h"
|
||||
|
||||
/* GenericLib */
|
||||
#include "World.h"
|
||||
#include "Font.h"
|
||||
#include "Metaball.h"
|
||||
#include "Curve.h"
|
||||
#include "Camera.h"
|
||||
#include "NLA.h"
|
||||
#include "Lattice.h"
|
||||
#include "Armature.h"
|
||||
#include "Lamp.h"
|
||||
#include "Text.h"
|
||||
#include "Sound.h"
|
||||
#include "Scene.h"
|
||||
#include "Mesh.h"
|
||||
#include "Group.h"
|
||||
#include "Object.h"
|
||||
#include "Texture.h"
|
||||
#include "Ipo.h"
|
||||
#include "DNA_object_types.h"
|
||||
#include "DNA_ipo_types.h"
|
||||
|
||||
|
||||
|
||||
/* Generic get/set attrs */
|
||||
PyObject *GenericLib_getName( void *self )
|
||||
{
|
||||
ID *id = ((BPy_GenericLib *)self)->id;
|
||||
if (!id) return ( EXPP_ReturnPyObjError( PyExc_RuntimeError, "data has been removed" ) );
|
||||
return PyString_FromString( id->name + 2 );
|
||||
}
|
||||
|
||||
int GenericLib_setName( void *self, PyObject *value )
|
||||
{
|
||||
ID *id = ((BPy_GenericLib *)self)->id;
|
||||
char *name = NULL;
|
||||
if (!id) return ( EXPP_ReturnIntError( PyExc_RuntimeError, "data has been removed" ) );
|
||||
|
||||
name = PyString_AsString ( value );
|
||||
if( !name )
|
||||
return EXPP_ReturnIntError( PyExc_TypeError,
|
||||
"expected string argument" );
|
||||
|
||||
rename_id( id, name );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
PyObject *GenericLib_getFakeUser( void *self )
|
||||
{
|
||||
ID *id = ((BPy_GenericLib *)self)->id;
|
||||
if (!id) return ( EXPP_ReturnPyObjError( PyExc_RuntimeError, "data has been removed" ) );
|
||||
if (id->flag & LIB_FAKEUSER)
|
||||
Py_RETURN_TRUE;
|
||||
else
|
||||
Py_RETURN_FALSE;
|
||||
}
|
||||
|
||||
int GenericLib_setFakeUser( void *self, PyObject *value )
|
||||
{
|
||||
int param;
|
||||
ID *id = ((BPy_GenericLib *)self)->id;
|
||||
if (!id) return ( EXPP_ReturnIntError( PyExc_RuntimeError, "data has been removed" ) );
|
||||
|
||||
param = PyObject_IsTrue( value );
|
||||
if( param == -1 )
|
||||
return EXPP_ReturnIntError( PyExc_TypeError,
|
||||
"expected int argument in range [0,1]" );
|
||||
|
||||
if (param) {
|
||||
if (!(id->flag & LIB_FAKEUSER)) {
|
||||
id->flag |= LIB_FAKEUSER;
|
||||
id_us_plus(id);
|
||||
}
|
||||
} else {
|
||||
if (id->flag & LIB_FAKEUSER) {
|
||||
id->flag &= ~LIB_FAKEUSER;
|
||||
id->us--;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* read only */
|
||||
PyObject *GenericLib_getLib( void *self )
|
||||
{
|
||||
ID *id = ((BPy_GenericLib *)self)->id;
|
||||
if (!id) return ( EXPP_ReturnPyObjError( PyExc_RuntimeError, "data has been removed" ) );
|
||||
|
||||
if (id->lib)
|
||||
return PyString_FromString(id->lib->name);
|
||||
else
|
||||
return EXPP_incr_ret( Py_None );
|
||||
}
|
||||
|
||||
PyObject *GenericLib_getUsers( void *self )
|
||||
{
|
||||
ID *id = ((BPy_GenericLib *)self)->id;
|
||||
if (!id) return ( EXPP_ReturnPyObjError( PyExc_RuntimeError, "data has been removed" ) );
|
||||
return PyInt_FromLong(id->us);
|
||||
}
|
||||
|
||||
PyObject *GenericLib_getProperties( void *self )
|
||||
{
|
||||
ID *id = ((BPy_GenericLib *)self)->id;
|
||||
if (!id) return ( EXPP_ReturnPyObjError( PyExc_RuntimeError, "data has been removed" ) );
|
||||
return BPy_Wrap_IDProperty( id, IDP_GetProperties(id, 1), NULL );
|
||||
}
|
||||
|
||||
/* use for any.setName("name")*/
|
||||
PyObject * GenericLib_setName_with_method( void *self, PyObject *args )
|
||||
{
|
||||
return EXPP_setterWrapper( (void *)self, args, (setter)GenericLib_setName );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* returns the Blender lib type code from a PyObject
|
||||
* -1 for no match, only give this function libdata
|
||||
*
|
||||
* At the moment this is only used by GenericLib_assignData
|
||||
* so not all types are needed.
|
||||
*/
|
||||
short GenericLib_getType(PyObject * pydata)
|
||||
{
|
||||
//~ if (BPy_Scene_Check(pydata)) return ID_SCE;
|
||||
if (BPy_Object_Check(pydata)) return ID_OB;
|
||||
if (BPy_Mesh_Check(pydata)) return ID_ME;
|
||||
//~ if (BPy_Curve_Check(pydata)) return ID_CU;
|
||||
//~ if (BPy_Metaball_Check(pydata)) return ID_MB;
|
||||
//~ if (BPy_Material_Check(pydata)) return ID_MA;
|
||||
if (BPy_Texture_Check(pydata)) return ID_TE;
|
||||
//~ if (BPy_Image_Check(pydata)) return ID_IM;
|
||||
//~ //if (BPy_Lattice_Check(pydata)) return ID_LT;
|
||||
//~ if (BPy_Lamp_Check(pydata)) return ID_LA;
|
||||
//~ if (BPy_Camera_Check(pydata)) return ID_CA;
|
||||
if (BPy_Ipo_Check(pydata)) return ID_IP;
|
||||
if (BPy_World_Check(pydata)) return ID_WO;
|
||||
//~ //if (BPy_Font_Check(pydata)) return ID_VF;
|
||||
//~ if (BPy_Text_Check(pydata)) return ID_TXT;
|
||||
//~ if (BPy_Sound_Check(pydata)) return ID_SO;
|
||||
if (BPy_Group_Check(pydata)) return ID_GR;
|
||||
//~ if (BPy_Armature_Check(pydata)) return ID_AR;
|
||||
//~ if (BPy_Action_Check(pydata)) return ID_AC;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* This function is used to assign a PyObject representing
|
||||
* blender libdata to a pointer.
|
||||
*
|
||||
* Python examples of this are...
|
||||
* ob.DupGroup = dupliGroup
|
||||
* mesh.texMesh = texme
|
||||
* ob.ipo = None
|
||||
*
|
||||
* This function deals with type checking, data usercounts,
|
||||
* and raising errors.
|
||||
*
|
||||
* value - python value
|
||||
* data - Blender pointer to assign value to
|
||||
* ndata - Use this if there is a value data cannot be.
|
||||
* for instance, a curve's curve modifier cant point to its self.
|
||||
* refcount - non zero values will modify blenders user count.
|
||||
* type - ID type.
|
||||
* subtype - used only for objects and IPO's to stop the wrong types of obs/ipos
|
||||
* being assigned.
|
||||
*
|
||||
*/
|
||||
int GenericLib_assignData(PyObject *value, void **data, void **ndata, short refcount, short type, short subtype)
|
||||
{
|
||||
ID *id=NULL;
|
||||
|
||||
if (*data && ndata && *data == *ndata) {
|
||||
return EXPP_ReturnIntError( PyExc_TypeError,
|
||||
"Cannot set this data to its self" );
|
||||
|
||||
id = ((ID*)*data);
|
||||
}
|
||||
if (value == Py_None) {
|
||||
*data = NULL;
|
||||
if (refcount && id) id->us--;
|
||||
} else if (GenericLib_getType(value) == type) {
|
||||
|
||||
/* object subtypes */
|
||||
if (subtype != 0) {
|
||||
if (type == ID_OB) {
|
||||
Object *ob= (Object *)(((BPy_GenericLib *)value)->id);
|
||||
if (ob->type != subtype)
|
||||
return EXPP_ReturnIntError( PyExc_TypeError,
|
||||
"Object type not supported" );
|
||||
}
|
||||
|
||||
if (type == ID_IP) {
|
||||
Ipo *ipo = (Ipo *)(((BPy_GenericLib *)value)->id);
|
||||
if (ipo->blocktype != subtype)
|
||||
return EXPP_ReturnIntError( PyExc_TypeError,
|
||||
"Ipo type does is not compatible" );
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
if (refcount && id) id->us--;
|
||||
id = ((BPy_GenericLib *)value)->id;
|
||||
id->us++;
|
||||
*data = id;
|
||||
} else {
|
||||
return EXPP_ReturnIntError( PyExc_TypeError,
|
||||
"Could not assign Python Type - None or Library Object" );
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* returns the ID of the object with given name
|
||||
* from a given list.
|
||||
*/
|
||||
ID *GetIdFromList( ListBase * list, char *name )
|
||||
{
|
||||
ID *id = list->first;
|
||||
|
||||
while( id ) {
|
||||
if( strcmp( name, id->name + 2 ) == 0 )
|
||||
break;
|
||||
id = id->next;
|
||||
}
|
||||
|
||||
return id;
|
||||
}
|
||||
|
||||
|
||||
PyObject *GetPyObjectFromID( ID * id )
|
||||
{
|
||||
switch ( MAKE_ID2( id->name[0], id->name[1] ) ) {
|
||||
case ID_SCE:
|
||||
return Scene_CreatePyObject( ( Scene *) id );
|
||||
break;
|
||||
case ID_OB:
|
||||
return Object_CreatePyObject( (Object *) id );
|
||||
break;
|
||||
case ID_ME:
|
||||
return Mesh_CreatePyObject( (Mesh *)id, NULL );
|
||||
break;
|
||||
case ID_CU: /*todo, support curnurbs?*/
|
||||
return Curve_CreatePyObject((Curve *)id);
|
||||
break;
|
||||
case ID_MB:
|
||||
return Metaball_CreatePyObject((MetaBall *)id);
|
||||
break;
|
||||
case ID_MA:
|
||||
return Material_CreatePyObject((Material *)id);
|
||||
break;
|
||||
case ID_TE:
|
||||
return Texture_CreatePyObject((Tex *)id);
|
||||
break;
|
||||
case ID_IM:
|
||||
return Image_CreatePyObject((Image *)id);
|
||||
break;
|
||||
case ID_LT:
|
||||
return Lattice_CreatePyObject((Lattice *)id);
|
||||
break;
|
||||
case ID_LA:
|
||||
return Lamp_CreatePyObject((Lamp *)id);
|
||||
break;
|
||||
case ID_CA:
|
||||
return Camera_CreatePyObject((Camera *)id);
|
||||
break;
|
||||
case ID_IP:
|
||||
return Ipo_CreatePyObject((Ipo *)id);
|
||||
break;
|
||||
case ID_WO:
|
||||
return World_CreatePyObject((World *)id);
|
||||
break;
|
||||
case ID_VF:
|
||||
return Font_CreatePyObject((VFont *)id);
|
||||
break;
|
||||
case ID_TXT:
|
||||
return Text_CreatePyObject((Text *)id);
|
||||
break;
|
||||
case ID_SO:
|
||||
return Sound_CreatePyObject((bSound *)id);
|
||||
break;
|
||||
case ID_GR:
|
||||
return Group_CreatePyObject((Group *)id);
|
||||
break;
|
||||
case ID_AR:
|
||||
return Armature_CreatePyObject((bArmature *)id);
|
||||
break;
|
||||
case ID_AC:
|
||||
return Action_CreatePyObject((bAction *)id);
|
||||
break;
|
||||
}
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
89
source/blender/python/api2_2x/gen_library.h
Normal file
89
source/blender/python/api2_2x/gen_library.h
Normal file
@@ -0,0 +1,89 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* ***** 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.
|
||||
*
|
||||
* This is a new part of Blender.
|
||||
*
|
||||
* Contributor(s): Michel Selten, Willian P. Germano, Alex Mole, Joseph Gilbert
|
||||
*
|
||||
* ***** END GPL/BL DUAL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#ifndef EXPP_gen_library_h
|
||||
#define EXPP_gen_library_h
|
||||
|
||||
#include <Python.h>
|
||||
|
||||
#include "DNA_ID.h"
|
||||
#include "DNA_listBase.h"
|
||||
|
||||
/* ID functions for all libdata */
|
||||
#define GENERIC_LIB_GETSETATTR \
|
||||
{"name",\
|
||||
(getter)GenericLib_getName, (setter)GenericLib_setName,\
|
||||
"name",\
|
||||
NULL},\
|
||||
{"lib",\
|
||||
(getter)GenericLib_getLib, (setter)NULL,\
|
||||
"external library path",\
|
||||
NULL},\
|
||||
{"users",\
|
||||
(getter)GenericLib_getUsers, (setter)NULL,\
|
||||
"user count",\
|
||||
NULL},\
|
||||
{"fakeUser",\
|
||||
(getter)GenericLib_getFakeUser, (setter)GenericLib_setFakeUser,\
|
||||
"fake user state",\
|
||||
NULL},\
|
||||
{"properties",\
|
||||
(getter)GenericLib_getProperties, (setter)NULL,\
|
||||
"properties",\
|
||||
NULL}
|
||||
|
||||
|
||||
/* Dummy struct for getting the ID from a libdata BPyObject */
|
||||
typedef struct {
|
||||
PyObject_HEAD /* required python macro */
|
||||
ID *id;
|
||||
} BPy_GenericLib;
|
||||
|
||||
int GenericLib_setName( void *self, PyObject *value );
|
||||
PyObject *GenericLib_getName( void *self );
|
||||
PyObject *GenericLib_getFakeUser( void *self );
|
||||
int GenericLib_setFakeUser( void *self, PyObject *value );
|
||||
PyObject *GenericLib_getLib( void *self );
|
||||
PyObject *GenericLib_getUsers( void *self );
|
||||
PyObject *GenericLib_getProperties( void *self );
|
||||
|
||||
/* use this for oldstyle somedata.getName("name") */
|
||||
PyObject * GenericLib_setName_with_method( void *self, PyObject *value );
|
||||
|
||||
int GenericLib_assignData(PyObject *value, void **data, void **ndata, short refcount, short type, short subtype);
|
||||
short GenericLib_getType(PyObject * pydata);
|
||||
|
||||
/* Other ID functions */
|
||||
ID *GetIdFromList( ListBase * list, char *name );
|
||||
PyObject *GetPyObjectFromID( ID * id );
|
||||
|
||||
#endif /* EXPP_gen_library_h */
|
||||
@@ -41,24 +41,10 @@
|
||||
#include "BKE_main.h"
|
||||
#include "BKE_library.h"
|
||||
|
||||
/* use for GenericLib_getProperties */
|
||||
#include "BKE_idprop.h"
|
||||
#include "IDProp.h"
|
||||
|
||||
#include "Mathutils.h"
|
||||
|
||||
#include "constant.h"
|
||||
|
||||
/* GenericLib */
|
||||
#include "World.h"
|
||||
#include "Mesh.h"
|
||||
#include "Group.h"
|
||||
#include "Object.h"
|
||||
#include "Texture.h"
|
||||
#include "Ipo.h"
|
||||
#include "DNA_object_types.h"
|
||||
#include "DNA_ipo_types.h"
|
||||
|
||||
/*---------------------- EXPP_FloatsAreEqual -------------------------
|
||||
Floating point comparisons
|
||||
floatStep = number of representable floats allowable in between
|
||||
@@ -148,31 +134,6 @@ int StringEqual( const char *string1, const char *string2 )
|
||||
return ( strcmp( string1, string2 ) == 0 );
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Description: This function returns the name of the given ID struct */
|
||||
/* without the Object type identifying characters prepended. */
|
||||
/*****************************************************************************/
|
||||
char *GetIdName( ID * id )
|
||||
{
|
||||
return ( ( id->name ) + 2 );
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Description: This function returns the ID of the object with given name */
|
||||
/* from a given list. */
|
||||
/*****************************************************************************/
|
||||
ID *GetIdFromList( ListBase * list, char *name )
|
||||
{
|
||||
ID *id = list->first;
|
||||
|
||||
while( id ) {
|
||||
if( strcmp( name, id->name + 2 ) == 0 )
|
||||
break;
|
||||
id = id->next;
|
||||
}
|
||||
|
||||
return id;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Description: These functions set an internal string with the given type */
|
||||
@@ -191,7 +152,6 @@ int EXPP_ReturnIntError( PyObject * type, char *error_msg )
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
int EXPP_intError(PyObject *type, const char *format, ...)
|
||||
{
|
||||
PyObject *error;
|
||||
@@ -951,176 +911,3 @@ int EXPP_dict_set_item_str( PyObject *dict, char *key, PyObject *value)
|
||||
Py_DECREF( value ); /* delete original */
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* Generic get/set attrs */
|
||||
PyObject *GenericLib_getName( void *self )
|
||||
{
|
||||
ID *id = ((BPy_GenericLib *)self)->id;
|
||||
if (!id) return ( EXPP_ReturnPyObjError( PyExc_RuntimeError, "data has been removed" ) );
|
||||
return PyString_FromString( id->name + 2 );
|
||||
}
|
||||
|
||||
int GenericLib_setName( void *self, PyObject *value )
|
||||
{
|
||||
ID *id = ((BPy_GenericLib *)self)->id;
|
||||
char *name = NULL;
|
||||
if (!id) return ( EXPP_ReturnIntError( PyExc_RuntimeError, "data has been removed" ) );
|
||||
|
||||
name = PyString_AsString ( value );
|
||||
if( !name )
|
||||
return EXPP_ReturnIntError( PyExc_TypeError,
|
||||
"expected string argument" );
|
||||
|
||||
rename_id( id, name );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
PyObject *GenericLib_getFakeUser( void *self )
|
||||
{
|
||||
ID *id = ((BPy_GenericLib *)self)->id;
|
||||
if (!id) return ( EXPP_ReturnPyObjError( PyExc_RuntimeError, "data has been removed" ) );
|
||||
if (id->flag & LIB_FAKEUSER)
|
||||
Py_RETURN_TRUE;
|
||||
else
|
||||
Py_RETURN_FALSE;
|
||||
}
|
||||
|
||||
int GenericLib_setFakeUser( void *self, PyObject *value )
|
||||
{
|
||||
int param;
|
||||
ID *id = ((BPy_GenericLib *)self)->id;
|
||||
if (!id) return ( EXPP_ReturnIntError( PyExc_RuntimeError, "data has been removed" ) );
|
||||
|
||||
param = PyObject_IsTrue( value );
|
||||
if( param == -1 )
|
||||
return EXPP_ReturnIntError( PyExc_TypeError,
|
||||
"expected int argument in range [0,1]" );
|
||||
|
||||
if (param) {
|
||||
if (!(id->flag & LIB_FAKEUSER)) {
|
||||
id->flag |= LIB_FAKEUSER;
|
||||
id_us_plus(id);
|
||||
}
|
||||
} else {
|
||||
if (id->flag & LIB_FAKEUSER) {
|
||||
id->flag &= ~LIB_FAKEUSER;
|
||||
id->us--;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* read only */
|
||||
PyObject *GenericLib_getLib( void *self )
|
||||
{
|
||||
ID *id = ((BPy_GenericLib *)self)->id;
|
||||
if (!id) return ( EXPP_ReturnPyObjError( PyExc_RuntimeError, "data has been removed" ) );
|
||||
|
||||
if (id->lib)
|
||||
return PyString_FromString(id->lib->name);
|
||||
else
|
||||
return EXPP_incr_ret( Py_None );
|
||||
}
|
||||
|
||||
PyObject *GenericLib_getUsers( void *self )
|
||||
{
|
||||
ID *id = ((BPy_GenericLib *)self)->id;
|
||||
if (!id) return ( EXPP_ReturnPyObjError( PyExc_RuntimeError, "data has been removed" ) );
|
||||
return PyInt_FromLong(id->us);
|
||||
}
|
||||
|
||||
PyObject *GenericLib_getProperties( void *self )
|
||||
{
|
||||
ID *id = ((BPy_GenericLib *)self)->id;
|
||||
if (!id) return ( EXPP_ReturnPyObjError( PyExc_RuntimeError, "data has been removed" ) );
|
||||
return BPy_Wrap_IDProperty( id, IDP_GetProperties(id, 1), NULL );
|
||||
}
|
||||
|
||||
/* use for any.setName("name")*/
|
||||
PyObject * GenericLib_setName_with_method( void *self, PyObject *args )
|
||||
{
|
||||
return EXPP_setterWrapper( (void *)self, args, (setter)GenericLib_setName );
|
||||
}
|
||||
|
||||
|
||||
/* returns the Blender lib type code from a PyObject
|
||||
-1 for no match, only give this function libdata */
|
||||
short GenericLib_getType(PyObject * pydata)
|
||||
{
|
||||
//~ if (BPy_Scene_Check(pydata)) return ID_SCE;
|
||||
if (BPy_Object_Check(pydata)) return ID_OB;
|
||||
if (BPy_Mesh_Check(pydata)) return ID_ME;
|
||||
//~ if (BPy_Curve_Check(pydata)) return ID_CU;
|
||||
//~ if (BPy_Metaball_Check(pydata)) return ID_MB;
|
||||
//~ if (BPy_Material_Check(pydata)) return ID_MA;
|
||||
if (BPy_Texture_Check(pydata)) return ID_TE;
|
||||
//~ if (BPy_Image_Check(pydata)) return ID_IM;
|
||||
//~ //if (BPy_Lattice_Check(pydata)) return ID_LT;
|
||||
//~ if (BPy_Lamp_Check(pydata)) return ID_LA;
|
||||
//~ if (BPy_Camera_Check(pydata)) return ID_CA;
|
||||
if (BPy_Ipo_Check(pydata)) return ID_IP;
|
||||
if (BPy_World_Check(pydata)) return ID_WO;
|
||||
//~ //if (BPy_Font_Check(pydata)) return ID_VF;
|
||||
//~ if (BPy_Text_Check(pydata)) return ID_TXT;
|
||||
//~ if (BPy_Sound_Check(pydata)) return ID_SO;
|
||||
if (BPy_Group_Check(pydata)) return ID_GR;
|
||||
//~ if (BPy_Armature_Check(pydata)) return ID_AR;
|
||||
//~ if (BPy_Action_Check(pydata)) return ID_AC;
|
||||
|
||||
|
||||
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
int GenericLib_assignData(PyObject *value, void **data, void **ndata, short refcount, short type, short subtype)
|
||||
{
|
||||
ID *id=NULL;
|
||||
|
||||
if (*data && ndata && *data == *ndata) {
|
||||
return EXPP_ReturnIntError( PyExc_TypeError,
|
||||
"Cannot set this data to its self" );
|
||||
|
||||
id = ((ID*)*data);
|
||||
}
|
||||
if (value == Py_None) {
|
||||
*data = NULL;
|
||||
if (refcount && id) id->us--;
|
||||
} else if (GenericLib_getType(value) == type) {
|
||||
|
||||
/* object subtypes */
|
||||
if (subtype != 0) {
|
||||
if (type == ID_OB) {
|
||||
Object *ob= ((BPy_GenericLib *)value)->id;
|
||||
if (ob->type != subtype)
|
||||
return EXPP_ReturnIntError( PyExc_TypeError,
|
||||
"Object type not supported" );
|
||||
}
|
||||
|
||||
if (type == ID_IP) {
|
||||
Ipo *ipo = ((BPy_GenericLib *)value)->id;
|
||||
if (ipo->blocktype != subtype)
|
||||
return EXPP_ReturnIntError( PyExc_TypeError,
|
||||
"Ipo type does is not compatible" );
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
if (refcount && id) id->us--;
|
||||
id = ((BPy_GenericLib *)value)->id;
|
||||
id->us++;
|
||||
*data = id;
|
||||
} else {
|
||||
return EXPP_ReturnIntError( PyExc_TypeError,
|
||||
"Could not assign Python Type - None or Library Object" );
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -68,10 +68,6 @@ int EXPP_VectorsAreEqual(float *vecA, float *vecB, int size, int floatSteps);
|
||||
PyObject *EXPP_GetModuleConstant(char *module, char *constant);
|
||||
|
||||
int StringEqual( const char *string1, const char *string2 );
|
||||
char *GetIdName( ID * id );
|
||||
int SetIdFakeUser( ID * id, PyObject *value);
|
||||
|
||||
ID *GetIdFromList( ListBase * list, char *name );
|
||||
|
||||
PyObject *PythonReturnErrorObject( PyObject * type, char *error_msg );
|
||||
PyObject *PythonIncRef( PyObject * object );
|
||||
@@ -158,53 +154,5 @@ void EXPP_allqueue(unsigned short event, short val);
|
||||
/* helper to keep dictionaries from causing memory leaks */
|
||||
int EXPP_dict_set_item_str( PyObject *dict, char *key, PyObject *value);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* Dummy struct for getting the ID from a libdata BPyObject */
|
||||
typedef struct {
|
||||
PyObject_HEAD /* required python macro */
|
||||
ID *id;
|
||||
} BPy_GenericLib;
|
||||
|
||||
|
||||
/* ID functions for all libdata */
|
||||
#define GENERIC_LIB_GETSETATTR \
|
||||
{"name",\
|
||||
(getter)GenericLib_getName, (setter)GenericLib_setName,\
|
||||
"name",\
|
||||
NULL},\
|
||||
{"lib",\
|
||||
(getter)GenericLib_getLib, (setter)NULL,\
|
||||
"external library path",\
|
||||
NULL},\
|
||||
{"users",\
|
||||
(getter)GenericLib_getUsers, (setter)NULL,\
|
||||
"user count",\
|
||||
NULL},\
|
||||
{"fakeUser",\
|
||||
(getter)GenericLib_getFakeUser, (setter)GenericLib_setFakeUser,\
|
||||
"fake user state",\
|
||||
NULL},\
|
||||
{"properties",\
|
||||
(getter)GenericLib_getProperties, (setter)NULL,\
|
||||
"properties",\
|
||||
NULL}
|
||||
|
||||
|
||||
int GenericLib_setName( void *self, PyObject *value );
|
||||
PyObject *GenericLib_getName( void *self );
|
||||
PyObject *GenericLib_getFakeUser( void *self );
|
||||
int GenericLib_setFakeUser( void *self, PyObject *value );
|
||||
PyObject *GenericLib_getLib( void *self );
|
||||
PyObject *GenericLib_getUsers( void *self );
|
||||
PyObject *GenericLib_getProperties( void *self );
|
||||
|
||||
/* use this for oldstyle somedata.getName("name") */
|
||||
PyObject * GenericLib_setName_with_method( void *self, PyObject *value );
|
||||
|
||||
int GenericLib_assignData(PyObject *value, void **data, void **ndata, short refcount, short type, short subtype);
|
||||
short GenericLib_getType(PyObject * pydata);
|
||||
|
||||
#endif /* EXPP_gen_utils_h */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user