Blender  V2.59
Defines | Functions | Variables
IDProp.c File Reference
#include <Python.h>
#include "IDProp.h"
#include "MEM_guardedalloc.h"
#include "BLI_string.h"
#include "BLI_utildefines.h"
#include "BKE_idprop.h"
#include "py_capi_utils.h"

Go to the source code of this file.

Defines

#define USE_STRING_COERCE

Functions

static long BPy_IDGroup_hash (BPy_IDProperty *self)
static PyObject * BPy_IDGroup_repr (BPy_IDProperty *self)
PyObject * BPy_IDGroup_WrapData (ID *id, IDProperty *prop)
static PyObject * BPy_IDGroup_GetName (BPy_IDProperty *self, void *UNUSED(closure))
static int BPy_IDGroup_SetName (BPy_IDProperty *self, PyObject *value, void *UNUSED(closure))
static Py_ssize_t BPy_IDGroup_Map_Len (BPy_IDProperty *self)
static PyObject * BPy_IDGroup_Map_GetItem (BPy_IDProperty *self, PyObject *item)
static int idp_sequence_type (PyObject *seq)
const char * BPy_IDProperty_Map_ValidateAndCreate (const char *name, IDProperty *group, PyObject *ob)
int BPy_Wrap_SetMapItem (IDProperty *prop, PyObject *key, PyObject *val)
static int BPy_IDGroup_Map_SetItem (BPy_IDProperty *self, PyObject *key, PyObject *val)
static PyObject * BPy_IDGroup_iter (BPy_IDProperty *self)
static PyObject * BPy_IDGroup_MapDataToPy (IDProperty *prop)
static PyObject * BPy_IDGroup_Pop (BPy_IDProperty *self, PyObject *value)
static PyObject * BPy_IDGroup_IterItems (BPy_IDProperty *self)
static void BPy_IDGroup_CorrectListLen (IDProperty *prop, PyObject *seq, int len)
PyObject * BPy_Wrap_GetKeys (IDProperty *prop)
PyObject * BPy_Wrap_GetValues (ID *id, IDProperty *prop)
PyObject * BPy_Wrap_GetItems (ID *id, IDProperty *prop)
static PyObject * BPy_IDGroup_GetKeys (BPy_IDProperty *self)
static PyObject * BPy_IDGroup_GetValues (BPy_IDProperty *self)
static PyObject * BPy_IDGroup_GetItems (BPy_IDProperty *self)
static int BPy_IDGroup_Contains (BPy_IDProperty *self, PyObject *value)
static PyObject * BPy_IDGroup_Update (BPy_IDProperty *self, PyObject *value)
static PyObject * BPy_IDGroup_to_dict (BPy_IDProperty *self)
static PyObject * BPy_IDGroup_Get (BPy_IDProperty *self, PyObject *args)
PyObject * BPy_Wrap_IDProperty (ID *id, IDProperty *prop, IDProperty *parent)
static PyTypeObject * idp_array_py_type (BPy_IDArray *self, short *is_double)
static PyObject * BPy_IDArray_repr (BPy_IDArray *self)
static PyObject * BPy_IDArray_GetType (BPy_IDArray *self)
static PyObject * BPy_IDArray_to_list (BPy_IDArray *self)
static int BPy_IDArray_Len (BPy_IDArray *self)
static PyObject * BPy_IDArray_GetItem (BPy_IDArray *self, int index)
static int BPy_IDArray_SetItem (BPy_IDArray *self, int index, PyObject *value)
static PyObject * BPy_IDArray_slice (BPy_IDArray *self, int begin, int end)
static int BPy_IDArray_ass_slice (BPy_IDArray *self, int begin, int end, PyObject *seq)
static PyObject * BPy_IDArray_subscript (BPy_IDArray *self, PyObject *item)
static int BPy_IDArray_ass_subscript (BPy_IDArray *self, PyObject *item, PyObject *value)
static PyObject * IDGroup_Iter_iterself (PyObject *self)
static PyObject * IDGroup_Iter_repr (BPy_IDGroup_Iter *self)
static PyObject * BPy_Group_Iter_Next (BPy_IDGroup_Iter *self)
void IDProp_Init_Types (void)

Variables

PyTypeObject BPy_IDArray_Type
PyTypeObject BPy_IDGroup_Iter_Type
PyTypeObject BPy_IDGroup_Type
static PyGetSetDef BPy_IDGroup_getseters []
static struct PyMethodDef BPy_IDGroup_methods []
static PySequenceMethods BPy_IDGroup_Seq
static PyMappingMethods BPy_IDGroup_Mapping
static PyGetSetDef BPy_IDArray_getseters []
static PyMethodDef BPy_IDArray_methods []
static PySequenceMethods BPy_IDArray_Seq
static PyMappingMethods BPy_IDArray_AsMapping

Detailed Description

Definition in file IDProp.c.


Define Documentation

#define USE_STRING_COERCE

Definition at line 42 of file IDProp.c.


Function Documentation

static PyObject* BPy_Group_Iter_Next ( BPy_IDGroup_Iter self) [static]
static int BPy_IDArray_ass_slice ( BPy_IDArray self,
int  begin,
int  end,
PyObject *  seq 
) [static]
static int BPy_IDArray_ass_subscript ( BPy_IDArray self,
PyObject *  item,
PyObject *  value 
) [static]

Definition at line 1142 of file IDProp.c.

References BPy_IDArray_ass_slice(), BPy_IDArray_SetItem(), and i.

static PyObject* BPy_IDArray_GetItem ( BPy_IDArray self,
int  index 
) [static]

Definition at line 958 of file IDProp.c.

References IDP_Array, IDP_DOUBLE, IDP_FLOAT, IDP_INT, and NULL.

Referenced by BPy_IDArray_subscript().

static PyObject* BPy_IDArray_GetType ( BPy_IDArray self) [static]

Definition at line 921 of file IDProp.c.

References IDP_DOUBLE, IDP_FLOAT, IDP_INT, and NULL.

static int BPy_IDArray_Len ( BPy_IDArray self) [static]

Definition at line 953 of file IDProp.c.

static PyObject* BPy_IDArray_repr ( BPy_IDArray self) [static]

Definition at line 916 of file IDProp.c.

static int BPy_IDArray_SetItem ( BPy_IDArray self,
int  index,
PyObject *  value 
) [static]

Definition at line 978 of file IDProp.c.

References simple_enum_gen::d, i, IDP_Array, IDP_DOUBLE, IDP_FLOAT, and IDP_INT.

Referenced by BPy_IDArray_ass_subscript().

static PyObject* BPy_IDArray_slice ( BPy_IDArray self,
int  begin,
int  end 
) [static]

Definition at line 1036 of file IDProp.c.

References CLAMP(), IDP_Array, IDP_DOUBLE, IDP_FLOAT, IDP_INT, IDProperty::len, MIN2, and IDProperty::subtype.

Referenced by BPy_IDArray_subscript().

static PyObject* BPy_IDArray_subscript ( BPy_IDArray self,
PyObject *  item 
) [static]

Definition at line 1108 of file IDProp.c.

References BPy_IDArray_GetItem(), BPy_IDArray_slice(), i, and NULL.

static PyObject* BPy_IDArray_to_list ( BPy_IDArray self) [static]

Definition at line 942 of file IDProp.c.

References BPy_IDGroup_MapDataToPy().

static int BPy_IDGroup_Contains ( BPy_IDProperty self,
PyObject *  value 
) [static]

Definition at line 727 of file IDProp.c.

References IDP_GetPropertyFromGroup().

static void BPy_IDGroup_CorrectListLen ( IDProperty prop,
PyObject *  seq,
int  len 
) [static]

Definition at line 630 of file IDProp.c.

References IDProperty::len.

Referenced by BPy_Wrap_GetItems(), BPy_Wrap_GetKeys(), and BPy_Wrap_GetValues().

static PyObject* BPy_IDGroup_Get ( BPy_IDProperty self,
PyObject *  args 
) [static]

Definition at line 764 of file IDProp.c.

References BPy_IDGroup_WrapData(), IDP_GetPropertyFromGroup(), and NULL.

static PyObject* BPy_IDGroup_GetItems ( BPy_IDProperty self) [static]

Definition at line 722 of file IDProp.c.

References BPy_Wrap_GetItems().

static PyObject* BPy_IDGroup_GetKeys ( BPy_IDProperty self) [static]

Definition at line 712 of file IDProp.c.

References BPy_Wrap_GetKeys().

static PyObject* BPy_IDGroup_GetName ( BPy_IDProperty self,
void *  UNUSEDclosure 
) [static]

Definition at line 193 of file IDProp.c.

static PyObject* BPy_IDGroup_GetValues ( BPy_IDProperty self) [static]

Definition at line 717 of file IDProp.c.

References BPy_Wrap_GetValues().

static long BPy_IDGroup_hash ( BPy_IDProperty self) [static]

Definition at line 55 of file IDProp.c.

static PyObject* BPy_IDGroup_iter ( BPy_IDProperty self) [static]
static PyObject* BPy_IDGroup_IterItems ( BPy_IDProperty self) [static]
static PyObject* BPy_IDGroup_Map_GetItem ( BPy_IDProperty self,
PyObject *  item 
) [static]

Definition at line 238 of file IDProp.c.

References BPy_IDGroup_WrapData(), IDP_GetPropertyFromGroup(), IDP_GROUP, and NULL.

static Py_ssize_t BPy_IDGroup_Map_Len ( BPy_IDProperty self) [static]

Definition at line 228 of file IDProp.c.

References IDP_GROUP.

static int BPy_IDGroup_Map_SetItem ( BPy_IDProperty self,
PyObject *  key,
PyObject *  val 
) [static]

Definition at line 468 of file IDProp.c.

References BPy_Wrap_SetMapItem().

Referenced by BPy_IDGroup_Update().

static PyObject* BPy_IDGroup_MapDataToPy ( IDProperty prop) [static]
static PyObject* BPy_IDGroup_Pop ( BPy_IDProperty self,
PyObject *  value 
) [static]
static PyObject* BPy_IDGroup_repr ( BPy_IDProperty self) [static]

Definition at line 60 of file IDProp.c.

static int BPy_IDGroup_SetName ( BPy_IDProperty self,
PyObject *  value,
void *  UNUSEDclosure 
) [static]

Definition at line 198 of file IDProp.c.

References BLI_strncpy(), BLI_strnlen(), and MAX_IDPROP_NAME.

static PyObject* BPy_IDGroup_to_dict ( BPy_IDProperty self) [static]

Definition at line 757 of file IDProp.c.

References BPy_IDGroup_MapDataToPy().

static PyObject* BPy_IDGroup_Update ( BPy_IDProperty self,
PyObject *  value 
) [static]

Definition at line 739 of file IDProp.c.

References BPy_IDGroup_Map_SetItem(), i, and NULL.

PyObject* BPy_IDGroup_WrapData ( ID id,
IDProperty prop 
)
const char* BPy_IDProperty_Map_ValidateAndCreate ( const char *  name,
IDProperty group,
PyObject *  ob 
)
PyObject* BPy_Wrap_GetItems ( ID id,
IDProperty prop 
)
PyObject* BPy_Wrap_GetKeys ( IDProperty prop)
PyObject* BPy_Wrap_GetValues ( ID id,
IDProperty prop 
)
PyObject* BPy_Wrap_IDProperty ( ID id,
IDProperty prop,
IDProperty parent 
)

Definition at line 885 of file IDProp.c.

References BPy_IDProperty::id, BPy_IDProperty::parent, and BPy_IDProperty::prop.

int BPy_Wrap_SetMapItem ( IDProperty prop,
PyObject *  key,
PyObject *  val 
)
static PyObject* IDGroup_Iter_iterself ( PyObject *  self) [static]

Definition at line 1261 of file IDProp.c.

static PyObject* IDGroup_Iter_repr ( BPy_IDGroup_Iter self) [static]

Definition at line 1267 of file IDProp.c.

static PyTypeObject* idp_array_py_type ( BPy_IDArray self,
short *  is_double 
) [static]

Definition at line 898 of file IDProp.c.

References IDP_DOUBLE, IDP_FLOAT, IDP_INT, and NULL.

Referenced by BPy_IDArray_ass_slice().

static int idp_sequence_type ( PyObject *  seq) [static]

Definition at line 267 of file IDProp.c.

References i, IDP_DOUBLE, IDP_IDPARRAY, and IDP_INT.

Referenced by BPy_IDProperty_Map_ValidateAndCreate().

void IDProp_Init_Types ( void  )

Definition at line 1353 of file IDProp.c.

Referenced by BPy_init_modules().


Variable Documentation

PyMappingMethods BPy_IDArray_AsMapping [static]
Initial value:
 {
        (lenfunc)BPy_IDArray_Len,
        (binaryfunc)BPy_IDArray_subscript,
        (objobjargproc)BPy_IDArray_ass_subscript
}

Definition at line 1171 of file IDProp.c.

PyGetSetDef BPy_IDArray_getseters[] [static]
Initial value:
 {
    
        {(char *)"typecode", (getter)BPy_IDArray_GetType, (setter)NULL, (char *)"The type of the data in the array, is an int.", NULL},
        {NULL, NULL, NULL, NULL, NULL},
}

Definition at line 936 of file IDProp.c.

PyMethodDef BPy_IDArray_methods[] [static]
Initial value:
 {
        {"to_list", (PyCFunction)BPy_IDArray_to_list, METH_NOARGS,
                "return the array as a list"},
        {NULL, NULL, 0, NULL}
}

Definition at line 947 of file IDProp.c.

PySequenceMethods BPy_IDArray_Seq [static]
Initial value:
 {
        (lenfunc) BPy_IDArray_Len,                      
        NULL,                                                           
        NULL,                                                           
        (ssizeargfunc)BPy_IDArray_GetItem,      
        NULL,                                                           
        (ssizeobjargproc)BPy_IDArray_SetItem,
        NULL,                                                           
        NULL,                                                           
                                
        NULL,                                                           
        NULL,                                                           
}

Definition at line 1019 of file IDProp.c.

PyTypeObject BPy_IDArray_Type

Definition at line 1178 of file IDProp.c.

Referenced by BPy_IDGroup_WrapData().

PyGetSetDef BPy_IDGroup_getseters[] [static]
Initial value:
 {
        {(char *)"name", (getter)BPy_IDGroup_GetName, (setter)BPy_IDGroup_SetName, (char *)"The name of this Group.", NULL},
         {NULL, NULL, NULL, NULL, NULL}
}

Definition at line 223 of file IDProp.c.

PyTypeObject BPy_IDGroup_Iter_Type

Definition at line 1296 of file IDProp.c.

Referenced by BPy_IDGroup_iter(), and BPy_IDGroup_IterItems().

PyMappingMethods BPy_IDGroup_Mapping [static]
Initial value:
 {
        (lenfunc)BPy_IDGroup_Map_Len,           
        (binaryfunc)BPy_IDGroup_Map_GetItem,
        (objobjargproc)BPy_IDGroup_Map_SetItem, 
}

Definition at line 817 of file IDProp.c.

struct PyMethodDef BPy_IDGroup_methods[] [static]
Initial value:
 {
        {"pop", (PyCFunction)BPy_IDGroup_Pop, METH_O,
                "pop an item from the group; raises KeyError if the item doesn't exist"},
        {"iteritems", (PyCFunction)BPy_IDGroup_IterItems, METH_NOARGS,
                "iterate through the items in the dict; behaves like dictionary method iteritems"},
        {"keys", (PyCFunction)BPy_IDGroup_GetKeys, METH_NOARGS,
                "get the keys associated with this group as a list of strings"},
        {"values", (PyCFunction)BPy_IDGroup_GetValues, METH_NOARGS,
                "get the values associated with this group"},
        {"items", (PyCFunction)BPy_IDGroup_GetItems, METH_NOARGS,
                "get the items associated with this group"},
        {"update", (PyCFunction)BPy_IDGroup_Update, METH_O,
                "updates the values in the group with the values of another or a dict"},
        {"get", (PyCFunction)BPy_IDGroup_Get, METH_VARARGS,
                "idprop.get(k[,d]) -> idprop[k] if k in idprop, else d.  d defaults to None"},
        {"to_dict", (PyCFunction)BPy_IDGroup_to_dict, METH_NOARGS,
                "return a purely python version of the group"},
        {NULL, NULL, 0, NULL}
}

Definition at line 784 of file IDProp.c.

PySequenceMethods BPy_IDGroup_Seq [static]
Initial value:
 {
        (lenfunc) BPy_IDGroup_Map_Len,          
        NULL,                                                           
        NULL,                                                           
        NULL,                                                            
        NULL,                                                           
        NULL,                                                           
        NULL,                                                           
        (objobjproc) BPy_IDGroup_Contains,      
        NULL,                                                           
        NULL,                                                           
}

Definition at line 804 of file IDProp.c.

PyTypeObject BPy_IDGroup_Type

Definition at line 823 of file IDProp.c.

Referenced by BPy_IDGroup_WrapData().