1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  */
16 
17 #pragma once
18 
19 /** \file
20  * \ingroup RNA
21  */
22 
23 #include "RNA_types.h"
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
29 struct ID;
30 struct bNodeSocketType;
31 struct bNodeTreeType;
32 struct bNodeType;
33 
34 /* Types */
35 
36 /* use in cases where only dynamic types are used */
37 extern const EnumPropertyItem DummyRNA_NULL_items[];
38 extern const EnumPropertyItem DummyRNA_DEFAULT_items[];
39 
40 /* all others should follow 'rna_enum_*_items' naming */
41 extern const EnumPropertyItem rna_enum_id_type_items[];
42 
43 extern const EnumPropertyItem rna_enum_object_mode_items[];
44 extern const EnumPropertyItem rna_enum_workspace_object_mode_items[];
45 extern const EnumPropertyItem rna_enum_object_empty_drawtype_items[];
46 extern const EnumPropertyItem rna_enum_object_gpencil_type_items[];
47 extern const EnumPropertyItem rna_enum_metaelem_type_items[];
48 
49 extern const EnumPropertyItem rna_enum_proportional_falloff_items[];
50 extern const EnumPropertyItem rna_enum_proportional_falloff_curve_only_items[];
51 extern const EnumPropertyItem rna_enum_snap_target_items[];
52 extern const EnumPropertyItem rna_enum_snap_element_items[];
53 extern const EnumPropertyItem rna_enum_snap_node_element_items[];
54 extern const EnumPropertyItem rna_enum_curve_fit_method_items[];
55 extern const EnumPropertyItem rna_enum_mesh_select_mode_items[];
56 extern const EnumPropertyItem rna_enum_mesh_select_mode_uv_items[];
57 extern const EnumPropertyItem rna_enum_mesh_delimit_mode_items[];
58 extern const EnumPropertyItem rna_enum_space_graph_mode_items[];
59 extern const EnumPropertyItem rna_enum_space_sequencer_view_type_items[];
60 extern const EnumPropertyItem rna_enum_space_type_items[];
61 extern const EnumPropertyItem rna_enum_space_image_mode_items[];
62 extern const EnumPropertyItem rna_enum_space_image_mode_all_items[];
63 extern const EnumPropertyItem rna_enum_space_action_mode_items[];
64 extern const EnumPropertyItem rna_enum_region_type_items[];
65 extern const EnumPropertyItem rna_enum_object_modifier_type_items[];
66 extern const EnumPropertyItem rna_enum_constraint_type_items[];
67 extern const EnumPropertyItem rna_enum_boidrule_type_items[];
68 extern const EnumPropertyItem rna_enum_sequence_modifier_type_items[];
69 extern const EnumPropertyItem rna_enum_object_greasepencil_modifier_type_items[];
70 extern const EnumPropertyItem rna_enum_object_shaderfx_type_items[];
71 
72 extern const EnumPropertyItem rna_enum_modifier_triangulate_quad_method_items[];
73 extern const EnumPropertyItem rna_enum_modifier_triangulate_ngon_method_items[];
74 extern const EnumPropertyItem rna_enum_modifier_shrinkwrap_mode_items[];
75 
76 extern const EnumPropertyItem rna_enum_image_type_items[];
77 extern const EnumPropertyItem rna_enum_image_color_mode_items[];
78 extern const EnumPropertyItem rna_enum_image_color_depth_items[];
79 extern const EnumPropertyItem rna_enum_image_generated_type_items[];
80 
81 extern const EnumPropertyItem rna_enum_normal_space_items[];
82 extern const EnumPropertyItem rna_enum_normal_swizzle_items[];
83 extern const EnumPropertyItem rna_enum_bake_save_mode_items[];
84 
85 extern const EnumPropertyItem rna_enum_views_format_items[];
86 extern const EnumPropertyItem rna_enum_views_format_multilayer_items[];
87 extern const EnumPropertyItem rna_enum_views_format_multiview_items[];
88 extern const EnumPropertyItem rna_enum_stereo3d_display_items[];
89 extern const EnumPropertyItem rna_enum_stereo3d_anaglyph_type_items[];
90 extern const EnumPropertyItem rna_enum_stereo3d_interlace_type_items[];
91 
92 extern const EnumPropertyItem rna_enum_exr_codec_items[];
93 extern const EnumPropertyItem rna_enum_color_sets_items[];
94 
95 extern const EnumPropertyItem rna_enum_beztriple_keyframe_type_items[];
96 extern const EnumPropertyItem rna_enum_beztriple_interpolation_mode_items[];
97 extern const EnumPropertyItem rna_enum_beztriple_interpolation_easing_items[];
98 extern const EnumPropertyItem rna_enum_fcurve_auto_smoothing_items[];
99 extern const EnumPropertyItem rna_enum_keyframe_handle_type_items[];
100 extern const EnumPropertyItem rna_enum_driver_target_rotation_mode_items[];
101 
102 extern const EnumPropertyItem rna_enum_keyblock_type_items[];
103 
104 extern const EnumPropertyItem rna_enum_keyingset_path_grouping_items[];
105 extern const EnumPropertyItem rna_enum_keying_flag_items[];
106 extern const EnumPropertyItem rna_enum_keying_flag_items_api[];
107 
108 extern const EnumPropertyItem rna_enum_keyframe_paste_offset_items[];
109 extern const EnumPropertyItem rna_enum_keyframe_paste_merge_items[];
110 
111 extern const EnumPropertyItem rna_enum_fmodifier_type_items[];
112 
113 extern const EnumPropertyItem rna_enum_nla_mode_extend_items[];
114 extern const EnumPropertyItem rna_enum_nla_mode_blend_items[];
115 
116 extern const EnumPropertyItem rna_enum_motionpath_bake_location_items[];
117 
118 extern const EnumPropertyItem rna_enum_event_value_items[];
119 extern const EnumPropertyItem rna_enum_event_type_items[];
120 extern const EnumPropertyItem rna_enum_event_type_mask_items[];
121 
122 extern const EnumPropertyItem rna_enum_operator_type_flag_items[];
123 extern const EnumPropertyItem rna_enum_operator_return_items[];
124 extern const EnumPropertyItem rna_enum_operator_property_tags[];
125 
126 extern const EnumPropertyItem rna_enum_brush_sculpt_tool_items[];
127 extern const EnumPropertyItem rna_enum_brush_uv_sculpt_tool_items[];
128 extern const EnumPropertyItem rna_enum_brush_vertex_tool_items[];
129 extern const EnumPropertyItem rna_enum_brush_weight_tool_items[];
130 extern const EnumPropertyItem rna_enum_brush_gpencil_types_items[];
131 extern const EnumPropertyItem rna_enum_brush_gpencil_vertex_types_items[];
132 extern const EnumPropertyItem rna_enum_brush_gpencil_sculpt_types_items[];
133 extern const EnumPropertyItem rna_enum_brush_gpencil_weight_types_items[];
134 extern const EnumPropertyItem rna_enum_brush_image_tool_items[];
135 
136 extern const EnumPropertyItem rna_enum_particle_edit_hair_brush_items[];
137 extern const EnumPropertyItem rna_enum_particle_edit_disconnected_hair_brush_items[];
138 
139 extern const EnumPropertyItem rna_enum_uv_sculpt_tool_items[];
140 
141 extern const EnumPropertyItem rna_enum_axis_xy_items[];
142 extern const EnumPropertyItem rna_enum_axis_xyz_items[];
143 
144 extern const EnumPropertyItem rna_enum_axis_flag_xyz_items[];
145 
146 extern const EnumPropertyItem rna_enum_symmetrize_direction_items[];
147 
148 extern const EnumPropertyItem rna_enum_texture_type_items[];
149 
150 extern const EnumPropertyItem rna_enum_light_type_items[];
151 
152 extern const EnumPropertyItem rna_enum_lightprobes_type_items[];
153 
154 extern const EnumPropertyItem rna_enum_unpack_method_items[];
155 
156 extern const EnumPropertyItem rna_enum_object_type_items[];
157 extern const EnumPropertyItem rna_enum_object_rotation_mode_items[];
158 
159 extern const EnumPropertyItem rna_enum_object_type_curve_items[];
160 
161 extern const EnumPropertyItem rna_enum_rigidbody_object_type_items[];
162 extern const EnumPropertyItem rna_enum_rigidbody_object_shape_items[];
163 extern const EnumPropertyItem rna_enum_rigidbody_constraint_type_items[];
164 
165 extern const EnumPropertyItem rna_enum_object_axis_items[];
166 
167 extern const EnumPropertyItem rna_enum_controller_type_items[];
168 
169 extern const EnumPropertyItem rna_enum_render_pass_type_items[];
170 extern const EnumPropertyItem rna_enum_render_pass_debug_type_items[];
171 
172 extern const EnumPropertyItem rna_enum_bake_pass_type_items[];
173 extern const EnumPropertyItem rna_enum_bake_pass_filter_type_items[];
174 
175 extern const EnumPropertyItem rna_enum_keymap_propvalue_items[];
176 
177 extern const EnumPropertyItem rna_enum_operator_context_items[];
178 
179 extern const EnumPropertyItem rna_enum_wm_report_items[];
180 
181 extern const EnumPropertyItem rna_enum_transform_pivot_items_full[];
182 extern const EnumPropertyItem rna_enum_transform_orientation_items[];
183 extern const EnumPropertyItem rna_enum_transform_mode_types[];
184 
185 extern const EnumPropertyItem rna_enum_property_type_items[];
186 extern const EnumPropertyItem rna_enum_property_subtype_items[];
187 extern const EnumPropertyItem rna_enum_property_unit_items[];
188 
189 extern const EnumPropertyItem rna_enum_shading_type_items[];
190 
191 extern const EnumPropertyItem rna_enum_navigation_mode_items[];
192 
193 extern const EnumPropertyItem rna_enum_file_sort_items[];
194 
195 extern const EnumPropertyItem rna_enum_node_socket_in_out_items[];
196 
197 extern const EnumPropertyItem rna_enum_node_math_items[];
198 extern const EnumPropertyItem rna_enum_mapping_type_items[];
199 extern const EnumPropertyItem rna_enum_node_vec_math_items[];
200 extern const EnumPropertyItem rna_enum_node_boolean_math_items[];
201 extern const EnumPropertyItem rna_enum_node_float_compare_items[];
202 extern const EnumPropertyItem rna_enum_node_filter_items[];
203 extern const EnumPropertyItem rna_enum_node_map_range_items[];
204 extern const EnumPropertyItem rna_enum_node_clamp_items[];
205 
206 extern const EnumPropertyItem rna_enum_ramp_blend_items[];
207 
208 extern const EnumPropertyItem rna_enum_prop_dynamicpaint_type_items[];
209 
210 extern const EnumPropertyItem rna_enum_clip_editor_mode_items[];
211 
212 extern const EnumPropertyItem rna_enum_icon_items[];
213 extern const EnumPropertyItem rna_enum_uilist_layout_type_items[];
214 
215 extern const EnumPropertyItem rna_enum_linestyle_color_modifier_type_items[];
216 extern const EnumPropertyItem rna_enum_linestyle_alpha_modifier_type_items[];
217 extern const EnumPropertyItem rna_enum_linestyle_thickness_modifier_type_items[];
218 extern const EnumPropertyItem rna_enum_linestyle_geometry_modifier_type_items[];
219 
220 extern const EnumPropertyItem rna_enum_window_cursor_items[];
221 
222 extern const EnumPropertyItem rna_enum_dt_method_vertex_items[];
223 extern const EnumPropertyItem rna_enum_dt_method_edge_items[];
224 extern const EnumPropertyItem rna_enum_dt_method_loop_items[];
225 extern const EnumPropertyItem rna_enum_dt_method_poly_items[];
226 extern const EnumPropertyItem rna_enum_dt_mix_mode_items[];
227 extern const EnumPropertyItem rna_enum_dt_layers_select_src_items[];
228 extern const EnumPropertyItem rna_enum_dt_layers_select_dst_items[];
229 
230 extern const EnumPropertyItem rna_enum_context_mode_items[];
231 
232 extern const EnumPropertyItem rna_enum_curveprofile_preset_items[];
233 extern const EnumPropertyItem rna_enum_preference_section_items[];
234 
235 extern const EnumPropertyItem rna_enum_attribute_type_items[];
236 extern const EnumPropertyItem rna_enum_attribute_domain_items[];
237 extern const EnumPropertyItem *rna_enum_attribute_domain_itemf(struct ID *id, bool *r_free);
238 
239 extern const EnumPropertyItem rna_enum_collection_color_items[];
240 
241 /* API calls */
242 int rna_node_tree_type_to_enum(struct bNodeTreeType *typeinfo);
243 int rna_node_tree_idname_to_enum(const char *idname);
244 struct bNodeTreeType *rna_node_tree_type_from_enum(int value);
245 const EnumPropertyItem *rna_node_tree_type_itemf(void *data,
246                                                  bool (*poll)(void *data, struct bNodeTreeType *),
247                                                  bool *r_free);
248 
249 int rna_node_type_to_enum(struct bNodeType *typeinfo);
250 int rna_node_idname_to_enum(const char *idname);
251 struct bNodeType *rna_node_type_from_enum(int value);
252 const EnumPropertyItem *rna_node_type_itemf(void *data,
253                                             bool (*poll)(void *data, struct bNodeType *),
254                                             bool *r_free);
255 
256 int rna_node_socket_type_to_enum(struct bNodeSocketType *typeinfo);
257 int rna_node_socket_idname_to_enum(const char *idname);
258 struct bNodeSocketType *rna_node_socket_type_from_enum(int value);
259 const EnumPropertyItem *rna_node_socket_type_itemf(
260     void *data, bool (*poll)(void *data, struct bNodeSocketType *), bool *r_free);
261 
262 struct PointerRNA;
263 struct PropertyRNA;
264 struct bContext;
265 
266 const EnumPropertyItem *rna_TransformOrientation_itemf(struct bContext *C,
267                                                        struct PointerRNA *ptr,
268                                                        struct PropertyRNA *prop,
269                                                        bool *r_free);
270 
271 /* Generic functions, return an enum from library data, index is the position
272  * in the linked list can add more for different types as needed */
273 const EnumPropertyItem *RNA_action_itemf(struct bContext *C,
274                                          struct PointerRNA *ptr,
275                                          struct PropertyRNA *prop,
276                                          bool *r_free);
277 #if 0
278 EnumPropertyItem *RNA_action_local_itemf(struct bContext *C,
279                                          struct PointerRNA *ptr,
280                                          struct PropertyRNA *prop,
281                                          bool *r_free);
282 #endif
283 const EnumPropertyItem *RNA_collection_itemf(struct bContext *C,
284                                              struct PointerRNA *ptr,
285                                              struct PropertyRNA *prop,
286                                              bool *r_free);
287 const EnumPropertyItem *RNA_collection_local_itemf(struct bContext *C,
288                                                    struct PointerRNA *ptr,
289                                                    struct PropertyRNA *prop,
290                                                    bool *r_free);
291 const EnumPropertyItem *RNA_image_itemf(struct bContext *C,
292                                         struct PointerRNA *ptr,
293                                         struct PropertyRNA *prop,
294                                         bool *r_free);
295 const EnumPropertyItem *RNA_image_local_itemf(struct bContext *C,
296                                               struct PointerRNA *ptr,
297                                               struct PropertyRNA *prop,
298                                               bool *r_free);
299 const EnumPropertyItem *RNA_scene_itemf(struct bContext *C,
300                                         struct PointerRNA *ptr,
301                                         struct PropertyRNA *prop,
302                                         bool *r_free);
303 const EnumPropertyItem *RNA_scene_without_active_itemf(struct bContext *C,
304                                                        struct PointerRNA *ptr,
305                                                        struct PropertyRNA *prop,
306                                                        bool *r_free);
307 const EnumPropertyItem *RNA_scene_local_itemf(struct bContext *C,
308                                               struct PointerRNA *ptr,
309                                               struct PropertyRNA *prop,
310                                               bool *r_free);
311 const EnumPropertyItem *RNA_movieclip_itemf(struct bContext *C,
312                                             struct PointerRNA *ptr,
313                                             struct PropertyRNA *prop,
314                                             bool *r_free);
315 const EnumPropertyItem *RNA_movieclip_local_itemf(struct bContext *C,
316                                                   struct PointerRNA *ptr,
317                                                   struct PropertyRNA *prop,
318                                                   bool *r_free);
319 const EnumPropertyItem *RNA_mask_itemf(struct bContext *C,
320                                        struct PointerRNA *ptr,
321                                        struct PropertyRNA *prop,
322                                        bool *r_free);
323 const EnumPropertyItem *RNA_mask_local_itemf(struct bContext *C,
324                                              struct PointerRNA *ptr,
325                                              struct PropertyRNA *prop,
326                                              bool *r_free);
327 
328 /* Non confirming, utility function. */
329 const EnumPropertyItem *RNA_enum_node_tree_types_itemf_impl(struct bContext *C, bool *r_free);
330 
331 #ifdef __cplusplus
332 }
333 #endif
334