Blender  V2.59
IDProp.h
Go to the documentation of this file.
00001 /*
00002  * $Id: IDProp.h 37579 2011-06-17 05:45:46Z campbellbarton $
00003  *
00004  * ***** BEGIN GPL LICENSE BLOCK *****
00005  *
00006  * This program is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU General Public License
00008  * as published by the Free Software Foundation; either version 2
00009  * of the License, or (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software Foundation,
00018  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00019  *
00020  * Contributor(s): Joseph Eagar, Campbell Barton
00021  *
00022  * ***** END GPL LICENSE BLOCK *****
00023  */
00024 
00030 #ifndef IDPROP_H
00031 #define IDPROP_H
00032 
00033 struct ID;
00034 struct IDProperty;
00035 struct BPy_IDGroup_Iter;
00036 
00037 typedef struct BPy_IDProperty {
00038         PyObject_VAR_HEAD
00039         struct ID *id;
00040         struct IDProperty *prop; /* must be second member */
00041         struct IDProperty *parent;
00042         PyObject *data_wrap;
00043 } BPy_IDProperty;
00044 
00045 typedef struct BPy_IDArray {
00046         PyObject_VAR_HEAD
00047         struct ID *id;
00048         struct IDProperty *prop;  /* must be second member */
00049 } BPy_IDArray;
00050 
00051 typedef struct BPy_IDGroup_Iter {
00052         PyObject_VAR_HEAD
00053         BPy_IDProperty *group;
00054         struct IDProperty *cur;
00055         int mode;
00056 } BPy_IDGroup_Iter;
00057 
00058 PyObject *BPy_Wrap_IDProperty(struct ID *id, struct IDProperty *prop, struct IDProperty *parent);
00059 PyObject *BPy_Wrap_GetKeys(struct IDProperty *prop);
00060 PyObject *BPy_Wrap_GetValues(struct ID *id, struct IDProperty *prop);
00061 PyObject *BPy_Wrap_GetItems(struct ID *id, struct IDProperty *prop);
00062 int BPy_Wrap_SetMapItem(struct IDProperty *prop, PyObject *key, PyObject *val);
00063 
00064 
00065 PyObject *BPy_IDGroup_WrapData(struct ID *id, struct IDProperty *prop );
00066 const char *BPy_IDProperty_Map_ValidateAndCreate(const char *name, struct IDProperty *group, PyObject *ob);
00067 
00068 void IDProp_Init_Types(void);
00069 
00070 #define IDPROP_ITER_KEYS        0
00071 #define IDPROP_ITER_ITEMS       1
00072 
00073 #endif /* IDPROP_H */