4 * ***** BEGIN GPL LICENSE BLOCK *****
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software Foundation,
18 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 * Contributor(s): Blender Foundation (2008).
22 * ***** END GPL LICENSE BLOCK *****
43 * RNA pointers are not a single C pointer but include the type,
44 * and a pointer to the ID struct that owns the struct, since
45 * in some cases this information is needed to correctly get/set
46 * the properties and validate them. */
48 typedef struct PointerRNA {
53 struct StructRNA *type;
59 typedef enum PropertyType {
69 typedef enum PropertySubType {
82 typedef enum PropertyFlag {
83 /* editable means the property is editable in the user
84 * interface, properties are editable by default except
85 * for pointers and collections. */
88 /* animateable means the property can be driven by some
89 * other input, be it animation curves, expressions, ..
90 * properties are animateable by default except for pointers
95 PROP_ICONS_CONSECUTIVE = 4096,
97 /* function paramater flags */
104 PROP_REGISTER_OPTIONAL = 16|32,
107 PROP_ID_REFCOUNT = 64,
113 PROP_IDPROPERTY = 1024,
114 PROP_RAW_ACCESS = 8192,
115 PROP_RAW_ARRAY = 16384,
116 PROP_FREE_POINTERS = 32768
119 typedef struct CollectionPropertyIterator {
122 PointerRNA builtin_parent;
123 struct PropertyRNA *prop;
131 } CollectionPropertyIterator;
133 typedef struct CollectionPointerLink {
134 struct CollectionPointerLink *next, *prev;
136 } CollectionPointerLink;
138 typedef enum RawPropertyType {
146 typedef struct RawArray {
148 RawPropertyType type;
153 typedef struct EnumPropertyItem {
155 const char *identifier;
158 const char *description;
161 typedef EnumPropertyItem *(*EnumPropertyItemFunc)(struct bContext *C, PointerRNA *ptr, int *free);
163 typedef struct PropertyRNA PropertyRNA;
167 typedef struct ParameterList {
168 /* storage for parameters */
171 /* store the parameter count */
174 /* function passed at creation time */
175 struct FunctionRNA *func;
178 typedef struct ParameterIterator {
179 struct ParameterList *parms;
190 typedef enum FunctionFlag {
191 FUNC_NO_SELF = 1, /* for static functions */
192 FUNC_USE_CONTEXT = 2,
193 FUNC_USE_REPORTS = 4,
197 FUNC_REGISTER_OPTIONAL = 8|16,
203 FUNC_FREE_POINTERS = 1024
206 typedef void (*CallFunc)(struct bContext *C, struct ReportList *reports, PointerRNA *ptr, ParameterList *parms);
208 typedef struct FunctionRNA FunctionRNA;
212 typedef enum StructFlag {
213 /* indicates that this struct is an ID struct, and to use refcounting */
215 STRUCT_ID_REFCOUNT = 2,
219 STRUCT_GENERATED = 8,
220 STRUCT_FREE_POINTERS = 16
223 typedef int (*StructValidateFunc)(struct PointerRNA *ptr, void *data, int *have_function);
224 typedef int (*StructCallbackFunc)(struct PointerRNA *ptr, struct FunctionRNA *func, ParameterList *list);
225 typedef void (*StructFreeFunc)(void *data);
226 typedef struct StructRNA *(*StructRegisterFunc)(const struct bContext *C, struct ReportList *reports, void *data,
227 StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free);
228 typedef void (*StructUnregisterFunc)(const struct bContext *C, struct StructRNA *type);
230 typedef struct StructRNA StructRNA;
234 * Root RNA data structure that lists all struct types. */
236 typedef struct BlenderRNA BlenderRNA;
240 * This struct must be embedded in *Type structs in
241 * order to make then definable through RNA. */
243 typedef struct ExtensionRNA {
247 int (*call)(PointerRNA *, FunctionRNA *, ParameterList *);
248 void (*free)(void *data);
255 #endif /* RNA_TYPES */