2008-10-31 23:50:02 +00:00
|
|
|
/**
|
|
|
|
|
* $Id$
|
|
|
|
|
*
|
|
|
|
|
* ***** BEGIN GPL 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.
|
|
|
|
|
*
|
|
|
|
|
* 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.
|
|
|
|
|
*
|
|
|
|
|
* Contributor(s): Blender Foundation (2008).
|
|
|
|
|
*
|
|
|
|
|
* ***** END GPL LICENSE BLOCK *****
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef RNA_INTERNAL_H
|
|
|
|
|
#define RNA_INTERNAL_H
|
|
|
|
|
|
2008-11-17 18:44:06 +00:00
|
|
|
#include "rna_internal_types.h"
|
|
|
|
|
|
|
|
|
|
#define RNA_MAGIC ((int)~0)
|
|
|
|
|
|
|
|
|
|
struct IDProperty;
|
2008-10-31 23:50:02 +00:00
|
|
|
struct SDNA;
|
|
|
|
|
|
|
|
|
|
/* Data structures used during define */
|
|
|
|
|
|
|
|
|
|
typedef struct PropertyDefRNA {
|
|
|
|
|
struct PropertyDefRNA *next, *prev;
|
|
|
|
|
|
2008-11-07 02:58:25 +00:00
|
|
|
struct StructRNA *srna;
|
2008-10-31 23:50:02 +00:00
|
|
|
struct PropertyRNA *prop;
|
|
|
|
|
|
2008-12-02 23:45:11 +00:00
|
|
|
/* struct */
|
2008-10-31 23:50:02 +00:00
|
|
|
const char *dnastructname;
|
2008-12-02 23:45:11 +00:00
|
|
|
const char *dnastructfromname;
|
|
|
|
|
const char *dnastructfromprop;
|
|
|
|
|
|
|
|
|
|
/* property */
|
2008-10-31 23:50:02 +00:00
|
|
|
const char *dnaname;
|
|
|
|
|
const char *dnatype;
|
|
|
|
|
int dnaarraylength;
|
2008-11-26 22:24:26 +00:00
|
|
|
int dnapointerlevel;
|
2008-10-31 23:50:02 +00:00
|
|
|
|
2008-12-02 23:45:11 +00:00
|
|
|
/* for finding length of array collections */
|
|
|
|
|
const char *dnalengthstructname;
|
|
|
|
|
const char *dnalengthname;
|
|
|
|
|
int dnalengthfixed;
|
|
|
|
|
|
2008-12-03 20:17:12 +00:00
|
|
|
int booleanbit, booleannegative;
|
2008-11-26 22:52:01 +00:00
|
|
|
int enumbitflags;
|
2008-10-31 23:50:02 +00:00
|
|
|
} PropertyDefRNA;
|
|
|
|
|
|
|
|
|
|
typedef struct StructDefRNA {
|
|
|
|
|
struct StructDefRNA *next, *prev;
|
|
|
|
|
|
2008-11-07 02:58:25 +00:00
|
|
|
struct StructRNA *srna;
|
2009-01-08 13:57:29 +00:00
|
|
|
const char *filename;
|
2008-10-31 23:50:02 +00:00
|
|
|
|
|
|
|
|
const char *dnaname;
|
2008-12-02 23:45:11 +00:00
|
|
|
|
|
|
|
|
/* for derived structs to find data in some property */
|
|
|
|
|
const char *dnafromname;
|
|
|
|
|
const char *dnafromprop;
|
|
|
|
|
|
2008-10-31 23:50:02 +00:00
|
|
|
ListBase properties;
|
|
|
|
|
} StructDefRNA;
|
|
|
|
|
|
|
|
|
|
typedef struct AllocDefRNA {
|
|
|
|
|
struct AllocDefRNA *next, *prev;
|
|
|
|
|
void *mem;
|
|
|
|
|
} AllocDefRNA;
|
|
|
|
|
|
|
|
|
|
typedef struct BlenderDefRNA {
|
|
|
|
|
struct SDNA *sdna;
|
|
|
|
|
ListBase structs;
|
|
|
|
|
ListBase allocs;
|
RNA
* More ID property support. What was already possible was showing
ID properties as RNA properties. Now it is possible to define
RNA properties and have an ID property automatically created the
first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
This is useful for python and plugins, and could also be used
for operators, not sure yet what is best there, they could be done
in preprocess for speed, but not sure how to do that while keeping
operator registration a single function.
* Added quick functions to get/set properties based on names, to be
used for operators.
* Added some simple support for inheritance, was already doing this
but having it as a feature simplifies things. Two things were added
for this: when defining a struct you can give a 'from' struct whose
properties will be copied, and structs like ID, operator, modifier,
can define a refine callback that will return the more specific type
of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
list, used for testing RNA for operators.
2008-11-21 02:23:46 +00:00
|
|
|
struct StructRNA *laststruct;
|
|
|
|
|
int error, silent, preprocess;
|
2008-10-31 23:50:02 +00:00
|
|
|
} BlenderDefRNA;
|
|
|
|
|
|
|
|
|
|
extern BlenderDefRNA DefRNA;
|
|
|
|
|
|
|
|
|
|
/* Define functions for all types */
|
|
|
|
|
|
RNA
* More ID property support. What was already possible was showing
ID properties as RNA properties. Now it is possible to define
RNA properties and have an ID property automatically created the
first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
This is useful for python and plugins, and could also be used
for operators, not sure yet what is best there, they could be done
in preprocess for speed, but not sure how to do that while keeping
operator registration a single function.
* Added quick functions to get/set properties based on names, to be
used for operators.
* Added some simple support for inheritance, was already doing this
but having it as a feature simplifies things. Two things were added
for this: when defining a struct you can give a 'from' struct whose
properties will be copied, and structs like ID, operator, modifier,
can define a refine callback that will return the more specific type
of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
list, used for testing RNA for operators.
2008-11-21 02:23:46 +00:00
|
|
|
extern BlenderRNA BLENDER_RNA;
|
2008-11-17 18:44:06 +00:00
|
|
|
|
RNA
* More ID property support. What was already possible was showing
ID properties as RNA properties. Now it is possible to define
RNA properties and have an ID property automatically created the
first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
This is useful for python and plugins, and could also be used
for operators, not sure yet what is best there, they could be done
in preprocess for speed, but not sure how to do that while keeping
operator registration a single function.
* Added quick functions to get/set properties based on names, to be
used for operators.
* Added some simple support for inheritance, was already doing this
but having it as a feature simplifies things. Two things were added
for this: when defining a struct you can give a 'from' struct whose
properties will be copied, and structs like ID, operator, modifier,
can define a refine callback that will return the more specific type
of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
list, used for testing RNA for operators.
2008-11-21 02:23:46 +00:00
|
|
|
void RNA_def_ID(struct BlenderRNA *brna);
|
2009-02-13 01:51:33 +00:00
|
|
|
void RNA_def_action(struct BlenderRNA *brna);
|
2009-02-02 11:51:10 +00:00
|
|
|
void RNA_def_animation(struct BlenderRNA *brna);
|
2008-12-09 11:29:40 +00:00
|
|
|
void RNA_def_armature(struct BlenderRNA *brna);
|
2008-11-30 19:52:21 +00:00
|
|
|
void RNA_def_actuator(struct BlenderRNA *brna);
|
2008-12-01 06:52:18 +00:00
|
|
|
void RNA_def_brush(struct BlenderRNA *brna);
|
|
|
|
|
void RNA_def_brushclone(struct BlenderRNA *brna);
|
2008-11-30 15:55:14 +00:00
|
|
|
void RNA_def_camera(struct BlenderRNA *brna);
|
2009-01-04 19:25:24 +00:00
|
|
|
void RNA_def_cloth(struct BlenderRNA *brna);
|
2008-11-29 14:35:50 +00:00
|
|
|
void RNA_def_color(struct BlenderRNA *brna);
|
2008-12-12 23:30:23 +00:00
|
|
|
void RNA_def_constraint(struct BlenderRNA *brna);
|
2009-03-19 19:03:38 +00:00
|
|
|
void RNA_def_context(struct BlenderRNA *brna);
|
2008-11-30 15:55:14 +00:00
|
|
|
void RNA_def_controller(struct BlenderRNA *brna);
|
2008-12-01 19:02:27 +00:00
|
|
|
void RNA_def_curve(struct BlenderRNA *brna);
|
2008-12-29 17:36:06 +00:00
|
|
|
void RNA_def_fluidsim(struct BlenderRNA *brna);
|
2008-11-30 19:52:21 +00:00
|
|
|
void RNA_def_gameproperty(struct BlenderRNA *brna);
|
2008-11-30 15:55:14 +00:00
|
|
|
void RNA_def_group(struct BlenderRNA *brna);
|
2008-11-30 18:39:49 +00:00
|
|
|
void RNA_def_image(struct BlenderRNA *brna);
|
2008-12-03 21:18:10 +00:00
|
|
|
void RNA_def_key(struct BlenderRNA *brna);
|
RNA
* More ID property support. What was already possible was showing
ID properties as RNA properties. Now it is possible to define
RNA properties and have an ID property automatically created the
first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
This is useful for python and plugins, and could also be used
for operators, not sure yet what is best there, they could be done
in preprocess for speed, but not sure how to do that while keeping
operator registration a single function.
* Added quick functions to get/set properties based on names, to be
used for operators.
* Added some simple support for inheritance, was already doing this
but having it as a feature simplifies things. Two things were added
for this: when defining a struct you can give a 'from' struct whose
properties will be copied, and structs like ID, operator, modifier,
can define a refine callback that will return the more specific type
of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
list, used for testing RNA for operators.
2008-11-21 02:23:46 +00:00
|
|
|
void RNA_def_lamp(struct BlenderRNA *brna);
|
2008-11-30 18:39:49 +00:00
|
|
|
void RNA_def_lattice(struct BlenderRNA *brna);
|
2008-11-07 02:58:25 +00:00
|
|
|
void RNA_def_main(struct BlenderRNA *brna);
|
2008-11-30 15:55:14 +00:00
|
|
|
void RNA_def_material(struct BlenderRNA *brna);
|
2008-11-07 02:58:25 +00:00
|
|
|
void RNA_def_mesh(struct BlenderRNA *brna);
|
2008-12-01 19:02:27 +00:00
|
|
|
void RNA_def_meta(struct BlenderRNA *brna);
|
2008-12-01 13:01:48 +00:00
|
|
|
void RNA_def_modifier(struct BlenderRNA *brna);
|
2008-11-27 00:23:22 +00:00
|
|
|
void RNA_def_nodetree(struct BlenderRNA *brna);
|
2008-11-30 15:55:14 +00:00
|
|
|
void RNA_def_object(struct BlenderRNA *brna);
|
2009-01-02 13:47:33 +00:00
|
|
|
void RNA_def_object_force(struct BlenderRNA *brna);
|
2008-12-01 21:23:58 +00:00
|
|
|
void RNA_def_packedfile(struct BlenderRNA *brna);
|
2009-01-02 13:47:33 +00:00
|
|
|
void RNA_def_particle(struct BlenderRNA *brna);
|
2009-01-07 04:06:52 +00:00
|
|
|
void RNA_def_pose(struct BlenderRNA *brna);
|
2008-11-30 15:55:14 +00:00
|
|
|
void RNA_def_radio(struct BlenderRNA *brna);
|
2008-11-14 14:34:19 +00:00
|
|
|
void RNA_def_rna(struct BlenderRNA *brna);
|
2008-10-31 23:50:02 +00:00
|
|
|
void RNA_def_scene(struct BlenderRNA *brna);
|
2008-11-29 01:04:15 +00:00
|
|
|
void RNA_def_screen(struct BlenderRNA *brna);
|
2009-01-02 16:58:09 +00:00
|
|
|
void RNA_def_scriptlink(struct BlenderRNA *brna);
|
2008-11-29 02:01:39 +00:00
|
|
|
void RNA_def_sensor(struct BlenderRNA *brna);
|
2008-12-15 10:48:04 +00:00
|
|
|
void RNA_def_sequence(struct BlenderRNA *brna);
|
2009-01-15 04:22:23 +00:00
|
|
|
void RNA_def_space(struct BlenderRNA *brna);
|
2008-12-31 15:02:40 +00:00
|
|
|
void RNA_def_text(struct BlenderRNA *brna);
|
2009-01-02 23:05:28 +00:00
|
|
|
void RNA_def_texture(struct BlenderRNA *brna);
|
2009-02-24 03:06:23 +00:00
|
|
|
void RNA_def_timeline_marker(struct BlenderRNA *brna);
|
2008-12-26 16:50:05 +00:00
|
|
|
void RNA_def_sound(struct BlenderRNA *brna);
|
2009-01-02 13:47:33 +00:00
|
|
|
void RNA_def_userdef(struct BlenderRNA *brna);
|
2008-12-01 19:02:27 +00:00
|
|
|
void RNA_def_vfont(struct BlenderRNA *brna);
|
2009-01-18 11:05:56 +00:00
|
|
|
void RNA_def_vpaint(struct BlenderRNA *brna);
|
2008-11-30 15:55:14 +00:00
|
|
|
void RNA_def_wm(struct BlenderRNA *brna);
|
2008-12-02 23:45:11 +00:00
|
|
|
void RNA_def_world(struct BlenderRNA *brna);
|
|
|
|
|
|
2009-02-02 11:51:10 +00:00
|
|
|
void rna_def_animdata_common(struct StructRNA *srna);
|
|
|
|
|
|
2008-12-02 23:45:11 +00:00
|
|
|
void rna_def_texmat_common(struct StructRNA *srna, const char *texspace_editable);
|
2009-01-10 22:57:33 +00:00
|
|
|
void rna_def_mtex_common(struct StructRNA *srna, const char *begin, const char *activeget, const char *structname);
|
2008-10-31 23:50:02 +00:00
|
|
|
|
2009-01-08 13:57:29 +00:00
|
|
|
void rna_ID_name_get(struct PointerRNA *ptr, char *value);
|
|
|
|
|
int rna_ID_name_length(struct PointerRNA *ptr);
|
|
|
|
|
void rna_ID_name_set(struct PointerRNA *ptr, const char *value);
|
|
|
|
|
struct StructRNA *rna_ID_refine(struct PointerRNA *ptr);
|
|
|
|
|
void rna_ID_fake_user_set(struct PointerRNA *ptr, int value);
|
|
|
|
|
|
2009-01-04 19:25:24 +00:00
|
|
|
void rna_object_vgroup_name_index_get(struct PointerRNA *ptr, char *value, int index);
|
|
|
|
|
int rna_object_vgroup_name_index_length(struct PointerRNA *ptr, int index);
|
|
|
|
|
void rna_object_vgroup_name_index_set(struct PointerRNA *ptr, const char *value, short *index);
|
|
|
|
|
void rna_object_vgroup_name_set(struct PointerRNA *ptr, const char *value, char *result, int maxlen);
|
|
|
|
|
void rna_object_uvlayer_name_set(struct PointerRNA *ptr, const char *value, char *result, int maxlen);
|
|
|
|
|
void rna_object_vcollayer_name_set(struct PointerRNA *ptr, const char *value, char *result, int maxlen);
|
|
|
|
|
|
RNA
* More ID property support. What was already possible was showing
ID properties as RNA properties. Now it is possible to define
RNA properties and have an ID property automatically created the
first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
This is useful for python and plugins, and could also be used
for operators, not sure yet what is best there, they could be done
in preprocess for speed, but not sure how to do that while keeping
operator registration a single function.
* Added quick functions to get/set properties based on names, to be
used for operators.
* Added some simple support for inheritance, was already doing this
but having it as a feature simplifies things. Two things were added
for this: when defining a struct you can give a 'from' struct whose
properties will be copied, and structs like ID, operator, modifier,
can define a refine callback that will return the more specific type
of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
list, used for testing RNA for operators.
2008-11-21 02:23:46 +00:00
|
|
|
/* ID Properties */
|
2008-11-17 18:44:06 +00:00
|
|
|
|
RNA
* More ID property support. What was already possible was showing
ID properties as RNA properties. Now it is possible to define
RNA properties and have an ID property automatically created the
first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
This is useful for python and plugins, and could also be used
for operators, not sure yet what is best there, they could be done
in preprocess for speed, but not sure how to do that while keeping
operator registration a single function.
* Added quick functions to get/set properties based on names, to be
used for operators.
* Added some simple support for inheritance, was already doing this
but having it as a feature simplifies things. Two things were added
for this: when defining a struct you can give a 'from' struct whose
properties will be copied, and structs like ID, operator, modifier,
can define a refine callback that will return the more specific type
of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
list, used for testing RNA for operators.
2008-11-21 02:23:46 +00:00
|
|
|
extern StringPropertyRNA rna_IDProperty_string;
|
|
|
|
|
extern IntPropertyRNA rna_IDProperty_int;
|
2009-01-10 22:57:33 +00:00
|
|
|
extern IntPropertyRNA rna_IDProperty_int_array;
|
RNA
* More ID property support. What was already possible was showing
ID properties as RNA properties. Now it is possible to define
RNA properties and have an ID property automatically created the
first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
This is useful for python and plugins, and could also be used
for operators, not sure yet what is best there, they could be done
in preprocess for speed, but not sure how to do that while keeping
operator registration a single function.
* Added quick functions to get/set properties based on names, to be
used for operators.
* Added some simple support for inheritance, was already doing this
but having it as a feature simplifies things. Two things were added
for this: when defining a struct you can give a 'from' struct whose
properties will be copied, and structs like ID, operator, modifier,
can define a refine callback that will return the more specific type
of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
list, used for testing RNA for operators.
2008-11-21 02:23:46 +00:00
|
|
|
extern FloatPropertyRNA rna_IDProperty_float;
|
2009-01-10 22:57:33 +00:00
|
|
|
extern FloatPropertyRNA rna_IDProperty_float_array;
|
RNA
* More ID property support. What was already possible was showing
ID properties as RNA properties. Now it is possible to define
RNA properties and have an ID property automatically created the
first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
This is useful for python and plugins, and could also be used
for operators, not sure yet what is best there, they could be done
in preprocess for speed, but not sure how to do that while keeping
operator registration a single function.
* Added quick functions to get/set properties based on names, to be
used for operators.
* Added some simple support for inheritance, was already doing this
but having it as a feature simplifies things. Two things were added
for this: when defining a struct you can give a 'from' struct whose
properties will be copied, and structs like ID, operator, modifier,
can define a refine callback that will return the more specific type
of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
list, used for testing RNA for operators.
2008-11-21 02:23:46 +00:00
|
|
|
extern PointerPropertyRNA rna_IDProperty_group;
|
RNA:
* Added support for using pointers + collections as operator properties,
but with the restriction that they must point to other type derived from
ID property groups. The "add" function for these properties will allocate
a new ID property group and point to that.
* Added support for arrays with type IDP_GROUP in ID properties.
* Fix bug getting/setting float array values.
Example code for collections, note the "OperatorMousePath" type is defined
in rna_wm.c and has a float[2] property named "loc".
Defining the operator property:
prop= RNA_def_property(ot->srna, "path", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_runtime(prop, &RNA_OperatorMousePath);
Adding values:
PointerRNA itemptr;
float loc[2] = {1, 1},
RNA_collection_add(op->ptr, "path", &itemptr);
RNA_float_set_array(&itemptr, "loc", loc);
Iterating:
RNA_BEGIN(op->ptr, itemptr, "path") {
float loc[2];
RNA_float_get_array(&itemptr, "loc", loc);
printf("Location: %f %f\n", loc[0], loc[1]);
}
RNA_END;
2008-12-26 20:38:52 +00:00
|
|
|
extern CollectionPropertyRNA rna_IDProperty_collection;
|
RNA
* More ID property support. What was already possible was showing
ID properties as RNA properties. Now it is possible to define
RNA properties and have an ID property automatically created the
first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
This is useful for python and plugins, and could also be used
for operators, not sure yet what is best there, they could be done
in preprocess for speed, but not sure how to do that while keeping
operator registration a single function.
* Added quick functions to get/set properties based on names, to be
used for operators.
* Added some simple support for inheritance, was already doing this
but having it as a feature simplifies things. Two things were added
for this: when defining a struct you can give a 'from' struct whose
properties will be copied, and structs like ID, operator, modifier,
can define a refine callback that will return the more specific type
of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
list, used for testing RNA for operators.
2008-11-21 02:23:46 +00:00
|
|
|
extern FloatPropertyRNA rna_IDProperty_double;
|
2009-01-10 22:57:33 +00:00
|
|
|
extern FloatPropertyRNA rna_IDProperty_double_array;
|
RNA
* More ID property support. What was already possible was showing
ID properties as RNA properties. Now it is possible to define
RNA properties and have an ID property automatically created the
first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
This is useful for python and plugins, and could also be used
for operators, not sure yet what is best there, they could be done
in preprocess for speed, but not sure how to do that while keeping
operator registration a single function.
* Added quick functions to get/set properties based on names, to be
used for operators.
* Added some simple support for inheritance, was already doing this
but having it as a feature simplifies things. Two things were added
for this: when defining a struct you can give a 'from' struct whose
properties will be copied, and structs like ID, operator, modifier,
can define a refine callback that will return the more specific type
of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
list, used for testing RNA for operators.
2008-11-21 02:23:46 +00:00
|
|
|
|
|
|
|
|
extern StructRNA RNA_IDProperty;
|
|
|
|
|
extern StructRNA RNA_IDPropertyGroup;
|
2008-11-14 14:34:19 +00:00
|
|
|
|
2009-01-01 20:44:40 +00:00
|
|
|
struct IDProperty *rna_idproperties_get(struct PointerRNA *ptr, int create);
|
2008-11-17 18:44:06 +00:00
|
|
|
struct IDProperty *rna_idproperty_check(struct PropertyRNA **prop, struct PointerRNA *ptr);
|
|
|
|
|
|
RNA
* More ID property support. What was already possible was showing
ID properties as RNA properties. Now it is possible to define
RNA properties and have an ID property automatically created the
first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
This is useful for python and plugins, and could also be used
for operators, not sure yet what is best there, they could be done
in preprocess for speed, but not sure how to do that while keeping
operator registration a single function.
* Added quick functions to get/set properties based on names, to be
used for operators.
* Added some simple support for inheritance, was already doing this
but having it as a feature simplifies things. Two things were added
for this: when defining a struct you can give a 'from' struct whose
properties will be copied, and structs like ID, operator, modifier,
can define a refine callback that will return the more specific type
of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
list, used for testing RNA for operators.
2008-11-21 02:23:46 +00:00
|
|
|
/* Builtin Property Callbacks */
|
|
|
|
|
|
|
|
|
|
void rna_builtin_properties_begin(struct CollectionPropertyIterator *iter, struct PointerRNA *ptr);
|
|
|
|
|
void rna_builtin_properties_next(struct CollectionPropertyIterator *iter);
|
2009-02-02 19:57:57 +00:00
|
|
|
PointerRNA rna_builtin_properties_get(struct CollectionPropertyIterator *iter);
|
|
|
|
|
PointerRNA rna_builtin_type_get(struct PointerRNA *ptr);
|
RNA
* More ID property support. What was already possible was showing
ID properties as RNA properties. Now it is possible to define
RNA properties and have an ID property automatically created the
first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
This is useful for python and plugins, and could also be used
for operators, not sure yet what is best there, they could be done
in preprocess for speed, but not sure how to do that while keeping
operator registration a single function.
* Added quick functions to get/set properties based on names, to be
used for operators.
* Added some simple support for inheritance, was already doing this
but having it as a feature simplifies things. Two things were added
for this: when defining a struct you can give a 'from' struct whose
properties will be copied, and structs like ID, operator, modifier,
can define a refine callback that will return the more specific type
of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
list, used for testing RNA for operators.
2008-11-21 02:23:46 +00:00
|
|
|
|
|
|
|
|
/* Iterators */
|
|
|
|
|
|
2008-11-24 12:12:24 +00:00
|
|
|
typedef int (*IteratorSkipFunc)(struct CollectionPropertyIterator *iter, void *data);
|
|
|
|
|
|
2008-11-17 18:44:06 +00:00
|
|
|
typedef struct ListBaseIterator {
|
|
|
|
|
Link *link;
|
|
|
|
|
int flag;
|
2008-11-24 12:12:24 +00:00
|
|
|
IteratorSkipFunc skip;
|
2008-11-17 18:44:06 +00:00
|
|
|
} ListBaseIterator;
|
2008-10-31 23:50:02 +00:00
|
|
|
|
2008-11-24 12:12:24 +00:00
|
|
|
void rna_iterator_listbase_begin(struct CollectionPropertyIterator *iter, struct ListBase *lb, IteratorSkipFunc skip);
|
2008-10-31 23:50:02 +00:00
|
|
|
void rna_iterator_listbase_next(struct CollectionPropertyIterator *iter);
|
|
|
|
|
void *rna_iterator_listbase_get(struct CollectionPropertyIterator *iter);
|
2008-11-17 18:44:06 +00:00
|
|
|
void rna_iterator_listbase_end(struct CollectionPropertyIterator *iter);
|
2008-10-31 23:50:02 +00:00
|
|
|
|
2008-11-07 02:58:25 +00:00
|
|
|
typedef struct ArrayIterator {
|
|
|
|
|
char *ptr;
|
|
|
|
|
char *endptr;
|
|
|
|
|
int itemsize;
|
2008-11-24 12:12:24 +00:00
|
|
|
IteratorSkipFunc skip;
|
2008-11-07 02:58:25 +00:00
|
|
|
} ArrayIterator;
|
|
|
|
|
|
2008-11-24 12:12:24 +00:00
|
|
|
void rna_iterator_array_begin(struct CollectionPropertyIterator *iter, void *ptr, int itemsize, int length, IteratorSkipFunc skip);
|
2008-10-31 23:50:02 +00:00
|
|
|
void rna_iterator_array_next(struct CollectionPropertyIterator *iter);
|
|
|
|
|
void *rna_iterator_array_get(struct CollectionPropertyIterator *iter);
|
2008-11-26 22:24:26 +00:00
|
|
|
void *rna_iterator_array_dereference_get(struct CollectionPropertyIterator *iter);
|
2008-10-31 23:50:02 +00:00
|
|
|
void rna_iterator_array_end(struct CollectionPropertyIterator *iter);
|
|
|
|
|
|
|
|
|
|
/* Duplicated code since we can't link in blenlib */
|
|
|
|
|
|
|
|
|
|
void rna_addtail(struct ListBase *listbase, void *vlink);
|
RNA
* More ID property support. What was already possible was showing
ID properties as RNA properties. Now it is possible to define
RNA properties and have an ID property automatically created the
first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
This is useful for python and plugins, and could also be used
for operators, not sure yet what is best there, they could be done
in preprocess for speed, but not sure how to do that while keeping
operator registration a single function.
* Added quick functions to get/set properties based on names, to be
used for operators.
* Added some simple support for inheritance, was already doing this
but having it as a feature simplifies things. Two things were added
for this: when defining a struct you can give a 'from' struct whose
properties will be copied, and structs like ID, operator, modifier,
can define a refine callback that will return the more specific type
of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
list, used for testing RNA for operators.
2008-11-21 02:23:46 +00:00
|
|
|
void rna_freelinkN(struct ListBase *listbase, void *vlink);
|
2008-10-31 23:50:02 +00:00
|
|
|
void rna_freelistN(struct ListBase *listbase);
|
|
|
|
|
|
2009-02-02 19:57:57 +00:00
|
|
|
/* Pointer Handling */
|
|
|
|
|
|
|
|
|
|
PointerRNA rna_pointer_inherit_refine(struct PointerRNA *ptr, struct StructRNA *type, void *data);
|
|
|
|
|
|
2008-10-31 23:50:02 +00:00
|
|
|
#endif /* RNA_INTERNAL_H */
|
|
|
|
|
|
2008-12-01 21:23:58 +00:00
|
|
|
|