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 *****
28 /* Functions used during preprocess and runtime, for defining the RNA. */
33 #include "DNA_listBase.h"
34 #include "RNA_types.h"
42 BlenderRNA *RNA_create(void);
43 void RNA_define_free(BlenderRNA *brna);
44 void RNA_free(BlenderRNA *brna);
49 StructRNA *RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from);
50 void RNA_def_struct_sdna(StructRNA *srna, const char *structname);
51 void RNA_def_struct_sdna_from(StructRNA *srna, const char *structname, const char *propname);
52 void RNA_def_struct_name_property(StructRNA *srna, PropertyRNA *prop);
53 void RNA_def_struct_nested(BlenderRNA *brna, StructRNA *srna, const char *structname);
54 void RNA_def_struct_flag(StructRNA *srna, int flag);
55 void RNA_def_struct_refine_func(StructRNA *srna, const char *refine);
56 void RNA_def_struct_path_func(StructRNA *srna, const char *path);
57 void RNA_def_struct_identifier(StructRNA *srna, const char *identifier);
58 void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description);
59 void RNA_struct_free(BlenderRNA *brna, StructRNA *srna);
61 /* Compact Property Definitions */
63 PropertyRNA *RNA_def_boolean(StructRNA *srna, const char *identifier, int default_value,
64 const char *ui_name, const char *ui_description);
65 PropertyRNA *RNA_def_boolean_array(StructRNA *srna, const char *identifier, int len, int *default_value,
66 const char *ui_name, const char *ui_description);
67 PropertyRNA *RNA_def_boolean_vector(StructRNA *srna, const char *identifier, int len, int *default_value,
68 const char *ui_name, const char *ui_description);
70 PropertyRNA *RNA_def_int(StructRNA *srna, const char *identifier, int default_value, int hardmin, int hardmax,
71 const char *ui_name, const char *ui_description, int softmin, int softmax);
72 PropertyRNA *RNA_def_int_vector(StructRNA *srna, const char *identifier, int len, const int *default_value, int hardmin, int hardmax,
73 const char *ui_name, const char *ui_description, int softmin, int softmax);
74 PropertyRNA *RNA_def_int_array(StructRNA *srna, const char *identifier, int len, const int *default_value, int hardmin, int hardmax,
75 const char *ui_name, const char *ui_description, int softmin, int softmax);
77 PropertyRNA *RNA_def_string(StructRNA *srna, const char *identifier, const char *default_value, int maxlen,
78 const char *ui_name, const char *ui_description);
79 PropertyRNA *RNA_def_string_file_path(StructRNA *srna, const char *identifier, const char *default_value, int maxlen,
80 const char *ui_name, const char *ui_description);
81 PropertyRNA *RNA_def_string_dir_path(StructRNA *srna, const char *identifier, const char *default_value, int maxlen,
82 const char *ui_name, const char *ui_description);
84 PropertyRNA *RNA_def_enum(StructRNA *srna, const char *identifier, EnumPropertyItem *items, int default_value,
85 const char *ui_name, const char *ui_description);
87 PropertyRNA *RNA_def_float(StructRNA *srna, const char *identifier, float default_value, float hardmin, float hardmax,
88 const char *ui_name, const char *ui_description, float softmin, float softmax);
89 PropertyRNA *RNA_def_float_vector(StructRNA *srna, const char *identifier, int len, const float *default_value,
90 float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax);
91 PropertyRNA *RNA_def_float_color(StructRNA *srna, const char *identifier, int len, const float *default_value,
92 float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax);
93 PropertyRNA *RNA_def_float_matrix(StructRNA *srna, const char *identifier, int len, const float *default_value,
94 float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax);
95 PropertyRNA *RNA_def_float_rotation(StructRNA *srna, const char *identifier, int len, const float *default_value,
96 float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax);
97 PropertyRNA *RNA_def_float_array(StructRNA *srna, const char *identifier, int len, const float *default_value,
98 float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax);
99 PropertyRNA *RNA_def_float_percentage(StructRNA *srna, const char *identifier, float default_value, float hardmin, float hardmax,
100 const char *ui_name, const char *ui_description, float softmin, float softmax);
102 PropertyRNA *RNA_def_pointer_runtime(StructRNA *srna, const char *identifier, StructRNA *type,
103 const char *ui_name, const char *ui_description);
105 PropertyRNA *RNA_def_collection_runtime(StructRNA *srna, const char *identifier, StructRNA *type,
106 const char *ui_name, const char *ui_description);
108 /* Extended Property Definitions */
110 PropertyRNA *RNA_def_property(StructRNA *srna, const char *identifier, int type, int subtype);
112 void RNA_def_property_boolean_sdna(PropertyRNA *prop, const char *structname, const char *propname, int bit);
113 void RNA_def_property_boolean_negative_sdna(PropertyRNA *prop, const char *structname, const char *propname, int bit);
114 void RNA_def_property_int_sdna(PropertyRNA *prop, const char *structname, const char *propname);
115 void RNA_def_property_float_sdna(PropertyRNA *prop, const char *structname, const char *propname);
116 void RNA_def_property_string_sdna(PropertyRNA *prop, const char *structname, const char *propname);
117 void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const char *propname);
118 void RNA_def_property_enum_bitflag_sdna(PropertyRNA *prop, const char *structname, const char *propname);
119 void RNA_def_property_pointer_sdna(PropertyRNA *prop, const char *structname, const char *propname);
120 void RNA_def_property_collection_sdna(PropertyRNA *prop, const char *structname, const char *propname, const char *lengthpropname);
122 void RNA_def_property_flag(PropertyRNA *prop, int flag);
123 void RNA_def_property_clear_flag(PropertyRNA *prop, int flag);
124 void RNA_def_property_array(PropertyRNA *prop, int arraylength);
125 void RNA_def_property_range(PropertyRNA *prop, double min, double max);
127 void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item);
128 void RNA_def_property_string_maxlength(PropertyRNA *prop, int maxlength);
129 void RNA_def_property_struct_type(PropertyRNA *prop, const char *type);
130 void RNA_def_property_struct_runtime(PropertyRNA *prop, StructRNA *type);
132 void RNA_def_property_boolean_default(PropertyRNA *prop, int value);
133 void RNA_def_property_boolean_array_default(PropertyRNA *prop, const int *array);
134 void RNA_def_property_int_default(PropertyRNA *prop, int value);
135 void RNA_def_property_int_array_default(PropertyRNA *prop, const int *array);
136 void RNA_def_property_float_default(PropertyRNA *prop, float value);
137 void RNA_def_property_float_array_default(PropertyRNA *prop, const float *array);
138 void RNA_def_property_enum_default(PropertyRNA *prop, int value);
139 void RNA_def_property_string_default(PropertyRNA *prop, const char *value);
141 void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description);
142 void RNA_def_property_ui_range(PropertyRNA *prop, double min, double max, double step, int precision);
144 void RNA_def_property_update(PropertyRNA *prop, int noteflag, const char *updatefunc);
145 void RNA_def_property_editable_func(PropertyRNA *prop, const char *editable);
147 void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const char *set);
148 void RNA_def_property_int_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range);
149 void RNA_def_property_float_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range);
150 void RNA_def_property_enum_funcs(PropertyRNA *prop, const char *get, const char *set);
151 void RNA_def_property_string_funcs(PropertyRNA *prop, const char *get, const char *length, const char *set);
152 void RNA_def_property_pointer_funcs(PropertyRNA *prop, const char *get, const char *set);
153 void RNA_def_property_collection_funcs(PropertyRNA *prop, const char *begin, const char *next, const char *end, const char *get, const char *length, const char *lookupint, const char *lookupstring);
159 #endif /* RNA_DEFINE_H */