2 * ***** BEGIN GPL LICENSE BLOCK *****
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software Foundation,
16 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 * The Original Code is Copyright (C) 2009 Blender Foundation.
19 * All rights reserved.
22 * Contributor(s): Blender Foundation
24 * ***** END GPL LICENSE BLOCK *****
27 /** \file blender/makesrna/intern/rna_ui_api.c
35 #include "RNA_define.h"
37 #include "UI_resources.h"
41 static void rna_uiItemR(uiLayout *layout, PointerRNA *ptr, const char *propname, const char *name, int icon, int expand, int slider, int toggle, int icon_only, int event, int full_event, int emboss, int index)
43 PropertyRNA *prop= RNA_struct_find_property(ptr, propname);
47 RNA_warning("property not found: %s.%s", RNA_struct_identifier(ptr->type), propname);
51 flag |= (slider)? UI_ITEM_R_SLIDER: 0;
52 flag |= (expand)? UI_ITEM_R_EXPAND: 0;
53 flag |= (toggle)? UI_ITEM_R_TOGGLE: 0;
54 flag |= (icon_only)? UI_ITEM_R_ICON_ONLY: 0;
55 flag |= (event)? UI_ITEM_R_EVENT: 0;
56 flag |= (full_event)? UI_ITEM_R_FULL_EVENT: 0;
57 flag |= (emboss)? 0: UI_ITEM_R_NO_BG;
59 uiItemFullR(layout, ptr, prop, index, 0, flag, name, icon);
62 static PointerRNA rna_uiItemO(uiLayout *layout, const char *opname, const char *name, int icon, int emboss)
64 int flag= UI_ITEM_O_RETURN_PROPS;
65 flag |= (emboss)? 0: UI_ITEM_R_NO_BG;
66 return uiItemFullO(layout, opname, name, icon, NULL, uiLayoutGetOperatorContext(layout), flag);
71 #define DEF_ICON_BLANK_SKIP
72 #define DEF_ICON(name) {ICON_##name, (#name), 0, (#name), ""},
73 #define DEF_VICO(name) {VICO_##name, (#name), 0, (#name), ""},
74 static EnumPropertyItem icon_items[] = {
76 {0, NULL, 0, NULL, NULL}};
77 #undef DEF_ICON_BLANK_SKIP
81 static void api_ui_item_common(FunctionRNA *func)
85 RNA_def_string_translate(func, "text", "", 0, "", "Override automatic text of the item");
87 prop= RNA_def_property(func, "icon", PROP_ENUM, PROP_NONE);
88 RNA_def_property_enum_items(prop, icon_items);
89 RNA_def_property_ui_text(prop, "Icon", "Override automatic icon of the item");
93 static void api_ui_item_op(FunctionRNA *func)
96 parm= RNA_def_string(func, "operator", "", 0, "", "Identifier of the operator");
97 RNA_def_property_flag(parm, PROP_REQUIRED);
100 static void api_ui_item_op_common(FunctionRNA *func)
102 api_ui_item_op(func);
103 api_ui_item_common(func);
106 static void api_ui_item_rna_common(FunctionRNA *func)
110 parm= RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take property");
111 RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL);
112 parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in data");
113 RNA_def_property_flag(parm, PROP_REQUIRED);
116 void RNA_api_ui_layout(StructRNA *srna)
121 static EnumPropertyItem curve_type_items[] = {
122 {0, "NONE", 0, "None", ""},
123 {'v', "VECTOR", 0, "Vector", ""},
124 {'c', "COLOR", 0, "Color", ""},
125 {0, NULL, 0, NULL, NULL}};
127 static EnumPropertyItem list_type_items[] = {
128 {0, "DEFAULT", 0, "None", ""},
129 {'c', "COMPACT", 0, "Compact", ""},
130 {'i', "ICONS", 0, "Icons", ""},
131 {0, NULL, 0, NULL, NULL}};
133 /* simple layout specifiers */
134 func= RNA_def_function(srna, "row", "uiLayoutRow");
135 parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in");
136 RNA_def_function_return(func, parm);
137 RNA_def_function_ui_description(func, "Sub-layout. Items placed in this sublayout are placed next to each other in a row");
138 RNA_def_boolean(func, "align", 0, "", "Align buttons to each other");
140 func= RNA_def_function(srna, "column", "uiLayoutColumn");
141 parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in");
142 RNA_def_function_return(func, parm);
143 RNA_def_function_ui_description(func, "Sub-layout. Items placed in this sublayout are placed under each other in a column");
144 RNA_def_boolean(func, "align", 0, "", "Align buttons to each other");
146 func= RNA_def_function(srna, "column_flow", "uiLayoutColumnFlow");
147 RNA_def_int(func, "columns", 0, 0, INT_MAX, "", "Number of columns, 0 is automatic", 0, INT_MAX);
148 parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in");
149 RNA_def_function_return(func, parm);
150 RNA_def_boolean(func, "align", 0, "", "Align buttons to each other");
153 func= RNA_def_function(srna, "box", "uiLayoutBox");
154 parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in");
155 RNA_def_function_return(func, parm);
156 RNA_def_function_ui_description(func, "Sublayout (items placed in this sublayout are placed "
157 "under each other in a column and are surrounded by a box)");
160 func= RNA_def_function(srna, "split", "uiLayoutSplit");
161 parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in");
162 RNA_def_function_return(func, parm);
163 RNA_def_float(func, "percentage", 0.0f, 0.0f, 1.0f, "Percentage", "Percentage of width to split at", 0.0f, 1.0f);
164 RNA_def_boolean(func, "align", 0, "", "Align buttons to each other");
167 func= RNA_def_function(srna, "prop", "rna_uiItemR");
168 RNA_def_function_ui_description(func, "Item. Exposes an RNA item and places it into the layout");
169 api_ui_item_rna_common(func);
170 api_ui_item_common(func);
171 RNA_def_boolean(func, "expand", 0, "", "Expand button to show more detail");
172 RNA_def_boolean(func, "slider", 0, "", "Use slider widget for numeric values");
173 RNA_def_boolean(func, "toggle", 0, "", "Use toggle widget for boolean values");
174 RNA_def_boolean(func, "icon_only", 0, "", "Draw only icons in buttons, no text");
175 RNA_def_boolean(func, "event", 0, "", "Use button to input key events");
176 RNA_def_boolean(func, "full_event", 0, "", "Use button to input full events including modifiers");
177 RNA_def_boolean(func, "emboss", 1, "", "Draw the button itself, just the icon/text");
178 RNA_def_int(func, "index", -1, -2, INT_MAX, "",
179 "The index of this button, when set a single member of an array can be accessed, "
180 "when set to -1 all array members are used", -2, INT_MAX); /* RNA_NO_INDEX == -1 */
182 func= RNA_def_function(srna, "props_enum", "uiItemsEnumR");
183 api_ui_item_rna_common(func);
185 func= RNA_def_function(srna, "prop_menu_enum", "uiItemMenuEnumR");
186 api_ui_item_rna_common(func);
187 api_ui_item_common(func);
189 func= RNA_def_function(srna, "prop_enum", "uiItemEnumR_string");
190 api_ui_item_rna_common(func);
191 parm= RNA_def_string(func, "value", "", 0, "", "Enum property value");
192 RNA_def_property_flag(parm, PROP_REQUIRED);
193 api_ui_item_common(func);
195 func= RNA_def_function(srna, "prop_search", "uiItemPointerR");
196 api_ui_item_rna_common(func);
197 parm= RNA_def_pointer(func, "search_data", "AnyType", "", "Data from which to take collection to search in");
198 RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL);
199 parm= RNA_def_string(func, "search_property", "", 0, "", "Identifier of search collection property");
200 RNA_def_property_flag(parm, PROP_REQUIRED);
201 api_ui_item_common(func);
203 func= RNA_def_function(srna, "operator", "rna_uiItemO");
204 api_ui_item_op_common(func);
205 RNA_def_boolean(func, "emboss", 1, "", "Draw the button itself, just the icon/text");
206 parm= RNA_def_pointer(func, "properties", "OperatorProperties", "",
207 "Operator properties to fill in, return when 'properties' is set to true");
208 RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR);
209 RNA_def_function_return(func, parm);
210 RNA_def_function_ui_description(func, "Item. Places a button into the layout to call an Operator");
212 /* func= RNA_def_function(srna, "operator_enum_single", "uiItemEnumO_string");
213 api_ui_item_op_common(func);
214 parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator");
215 RNA_def_property_flag(parm, PROP_REQUIRED);
216 parm= RNA_def_string(func, "value", "", 0, "", "Enum property value");
217 RNA_def_property_flag(parm, PROP_REQUIRED); */
219 func= RNA_def_function(srna, "operator_enum", "uiItemsEnumO");
220 parm= RNA_def_string(func, "operator", "", 0, "", "Identifier of the operator");
221 RNA_def_property_flag(parm, PROP_REQUIRED);
222 parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator");
223 RNA_def_property_flag(parm, PROP_REQUIRED);
225 func= RNA_def_function(srna, "operator_menu_enum", "uiItemMenuEnumO");
226 api_ui_item_op(func); /* cant use api_ui_item_op_common because property must come right after */
227 parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator");
228 RNA_def_property_flag(parm, PROP_REQUIRED);
229 api_ui_item_common(func);
231 /* func= RNA_def_function(srna, "operator_boolean", "uiItemBooleanO");
232 api_ui_item_op_common(func);
233 parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator");
234 RNA_def_property_flag(parm, PROP_REQUIRED);
235 parm= RNA_def_boolean(func, "value", 0, "", "Value of the property to call the operator with");
236 RNA_def_property_flag(parm, PROP_REQUIRED); */
238 /* func= RNA_def_function(srna, "operator_int", "uiItemIntO");
239 api_ui_item_op_common(func);
240 parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator");
241 RNA_def_property_flag(parm, PROP_REQUIRED);
242 parm= RNA_def_int(func, "value", 0, INT_MIN, INT_MAX, "",
243 "Value of the property to call the operator with", INT_MIN, INT_MAX);
244 RNA_def_property_flag(parm, PROP_REQUIRED); */
246 /* func= RNA_def_function(srna, "operator_float", "uiItemFloatO");
247 api_ui_item_op_common(func);
248 parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator");
249 RNA_def_property_flag(parm, PROP_REQUIRED);
250 parm= RNA_def_float(func, "value", 0, -FLT_MAX, FLT_MAX, "",
251 "Value of the property to call the operator with", -FLT_MAX, FLT_MAX);
252 RNA_def_property_flag(parm, PROP_REQUIRED); */
254 /* func= RNA_def_function(srna, "operator_string", "uiItemStringO");
255 api_ui_item_op_common(func);
256 parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator");
257 RNA_def_property_flag(parm, PROP_REQUIRED);
258 parm= RNA_def_string(func, "value", "", 0, "", "Value of the property to call the operator with");
259 RNA_def_property_flag(parm, PROP_REQUIRED); */
261 func= RNA_def_function(srna, "label", "uiItemL");
262 RNA_def_function_ui_description(func, "Item. Display text in the layout");
263 api_ui_item_common(func);
265 func= RNA_def_function(srna, "menu", "uiItemM");
266 RNA_def_function_flag(func, FUNC_USE_CONTEXT);
267 parm= RNA_def_string(func, "menu", "", 0, "", "Identifier of the menu");
268 api_ui_item_common(func);
269 RNA_def_property_flag(parm, PROP_REQUIRED);
271 func= RNA_def_function(srna, "separator", "uiItemS");
272 RNA_def_function_ui_description(func, "Item. Inserts empty space into the layout between items");
275 func= RNA_def_function(srna, "context_pointer_set", "uiLayoutSetContextPointer");
276 parm= RNA_def_string(func, "name", "", 0, "Name", "Name of entry in the context");
277 RNA_def_property_flag(parm, PROP_REQUIRED);
278 parm= RNA_def_pointer(func, "data", "AnyType", "", "Pointer to put in context");
279 RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR);
282 func= RNA_def_function(srna, "template_header", "uiTemplateHeader");
283 RNA_def_function_flag(func, FUNC_USE_CONTEXT);
284 RNA_def_boolean(func, "menus", 1, "", "The header has menus, and should show menu expander");
286 func= RNA_def_function(srna, "template_ID", "uiTemplateID");
287 RNA_def_function_flag(func, FUNC_USE_CONTEXT);
288 api_ui_item_rna_common(func);
289 RNA_def_string(func, "new", "", 0, "", "Operator identifier to create a new ID block");
290 RNA_def_string(func, "open", "", 0, "", "Operator identifier to open a file for creating a new ID block");
291 RNA_def_string(func, "unlink", "", 0, "", "Operator identifier to unlink the ID block");
293 func= RNA_def_function(srna, "template_ID_preview", "uiTemplateIDPreview");
294 RNA_def_function_flag(func, FUNC_USE_CONTEXT);
295 api_ui_item_rna_common(func);
296 RNA_def_string(func, "new", "", 0, "", "Operator identifier to create a new ID block");
297 RNA_def_string(func, "open", "", 0, "", "Operator identifier to open a file for creating a new ID block");
298 RNA_def_string(func, "unlink", "", 0, "", "Operator identifier to unlink the ID block");
299 RNA_def_int(func, "rows", 0, 0, INT_MAX, "Number of thumbnail preview rows to display", "", 0, INT_MAX);
300 RNA_def_int(func, "cols", 0, 0, INT_MAX, "Number of thumbnail preview columns to display", "", 0, INT_MAX);
302 func= RNA_def_function(srna, "template_any_ID", "uiTemplateAnyID");
303 parm= RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take property");
304 RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL);
305 parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in data");
306 RNA_def_property_flag(parm, PROP_REQUIRED);
307 parm= RNA_def_string(func, "type_property", "", 0, "",
308 "Identifier of property in data giving the type of the ID-blocks to use");
309 RNA_def_property_flag(parm, PROP_REQUIRED);
310 RNA_def_string_translate(func, "text", "", 0, "", "Custom label to display in UI");
312 func= RNA_def_function(srna, "template_path_builder", "uiTemplatePathBuilder");
313 parm= RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take property");
314 RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL);
315 parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in data");
316 RNA_def_property_flag(parm, PROP_REQUIRED);
317 parm= RNA_def_pointer(func, "root", "ID", "", "ID-block from which path is evaluated from");
318 RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR);
319 RNA_def_string_translate(func, "text", "", 0, "", "Custom label to display in UI");
321 func= RNA_def_function(srna, "template_modifier", "uiTemplateModifier");
322 RNA_def_function_flag(func, FUNC_USE_CONTEXT);
323 RNA_def_function_ui_description(func, "Layout . Generates the UI layout for modifiers");
324 parm= RNA_def_pointer(func, "data", "Modifier", "", "Modifier data");
325 RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL);
326 parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in");
327 RNA_def_function_return(func, parm);
329 func= RNA_def_function(srna, "template_constraint", "uiTemplateConstraint");
330 RNA_def_function_ui_description(func, "Layout . Generates the UI layout for constraints");
331 parm= RNA_def_pointer(func, "data", "Constraint", "", "Constraint data");
332 RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL);
333 parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in");
334 RNA_def_function_return(func, parm);
336 func= RNA_def_function(srna, "template_preview", "uiTemplatePreview");
337 RNA_def_function_ui_description(func, "Item. A preview window for materials, textures, lamps, etc");
338 parm= RNA_def_pointer(func, "id", "ID", "", "ID datablock");
339 RNA_def_property_flag(parm, PROP_REQUIRED);
340 RNA_def_boolean(func, "show_buttons", 1, "", "Show preview buttons?");
341 RNA_def_pointer(func, "parent", "ID", "", "ID datablock");
342 RNA_def_pointer(func, "slot", "TextureSlot", "", "Texture slot");
344 func= RNA_def_function(srna, "template_curve_mapping", "uiTemplateCurveMapping");
345 RNA_def_function_ui_description(func, "Item. A curve mapping widget used for e.g falloff curves for lamps");
346 api_ui_item_rna_common(func);
347 RNA_def_enum(func, "type", curve_type_items, 0, "Type", "Type of curves to display");
348 RNA_def_boolean(func, "levels", 0, "", "Show black/white levels");
349 RNA_def_boolean(func, "brush", 0, "", "Show brush options");
351 func= RNA_def_function(srna, "template_color_ramp", "uiTemplateColorRamp");
352 RNA_def_function_ui_description(func, "Item. A color ramp widget");
353 api_ui_item_rna_common(func);
354 RNA_def_boolean(func, "expand", 0, "", "Expand button to show more detail");
356 func= RNA_def_function(srna, "template_histogram", "uiTemplateHistogram");
357 RNA_def_function_ui_description(func, "Item. A histogramm widget to analyze imaga data");
358 api_ui_item_rna_common(func);
360 func= RNA_def_function(srna, "template_waveform", "uiTemplateWaveform");
361 RNA_def_function_ui_description(func, "Item. A waveform widget to analyze imaga data");
362 api_ui_item_rna_common(func);
364 func= RNA_def_function(srna, "template_vectorscope", "uiTemplateVectorscope");
365 RNA_def_function_ui_description(func, "Item. A vectorscope widget to analyze imaga data");
366 api_ui_item_rna_common(func);
368 func= RNA_def_function(srna, "template_layers", "uiTemplateLayers");
369 api_ui_item_rna_common(func);
370 parm= RNA_def_pointer(func, "used_layers_data", "AnyType", "", "Data from which to take property");
371 RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR);
372 parm= RNA_def_string(func, "used_layers_property", "", 0, "", "Identifier of property in data");
373 RNA_def_property_flag(parm, PROP_REQUIRED);
374 parm= RNA_def_int(func, "active_layer", 0, 0, INT_MAX, "Active Layer", "", 0, INT_MAX);
375 RNA_def_property_flag(parm, PROP_REQUIRED);
377 func= RNA_def_function(srna, "template_color_wheel", "uiTemplateColorWheel");
378 RNA_def_function_ui_description(func, "Item. A color wheel widget to pick colors");
379 api_ui_item_rna_common(func);
380 RNA_def_boolean(func, "value_slider", 0, "", "Display the value slider to the right of the color wheel");
381 RNA_def_boolean(func, "lock", 0, "", "Lock the color wheel display to value 1.0 regardless of actual color");
382 RNA_def_boolean(func, "lock_luminosity", 0, "", "Keep the color at its original vector length");
383 RNA_def_boolean(func, "cubic", 1, "", "Cubic saturation for picking values close to white");
385 func= RNA_def_function(srna, "template_image_layers", "uiTemplateImageLayers");
386 RNA_def_function_flag(func, FUNC_USE_CONTEXT);
387 parm= RNA_def_pointer(func, "image", "Image", "", "");
388 RNA_def_property_flag(parm, PROP_REQUIRED);
389 parm= RNA_def_pointer(func, "image_user", "ImageUser", "", "");
390 RNA_def_property_flag(parm, PROP_REQUIRED);
392 func= RNA_def_function(srna, "template_image", "uiTemplateImage");
393 RNA_def_function_ui_description(func, "Item(s). User interface for selecting images and their source paths");
394 RNA_def_function_flag(func, FUNC_USE_CONTEXT);
395 api_ui_item_rna_common(func);
396 parm= RNA_def_pointer(func, "image_user", "ImageUser", "", "");
397 RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL);
398 RNA_def_boolean(func, "compact", 0, "", "Use more compact layout");
400 func= RNA_def_function(srna, "template_image_settings", "uiTemplateImageSettings");
401 RNA_def_function_ui_description(func, "User interface for setting image format options");
402 parm= RNA_def_pointer(func, "image_settings", "ImageFormatSettings", "", "");
403 RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL);
405 func= RNA_def_function(srna, "template_movieclip", "uiTemplateMovieClip");
406 RNA_def_function_ui_description(func, "Item(s). User interface for selecting movie clips and their source paths");
407 RNA_def_function_flag(func, FUNC_USE_CONTEXT);
408 api_ui_item_rna_common(func);
409 RNA_def_boolean(func, "compact", 0, "", "Use more compact layout");
411 func= RNA_def_function(srna, "template_track", "uiTemplateTrack");
412 RNA_def_function_ui_description(func, "Item. A movie-track widget to preview tracking image.");
413 api_ui_item_rna_common(func);
415 func= RNA_def_function(srna, "template_marker", "uiTemplateMarker");
416 RNA_def_function_ui_description(func, "Item. A widget to control single marker settings.");
417 api_ui_item_rna_common(func);
418 parm= RNA_def_pointer(func, "clip_user", "MovieClipUser", "", "");
419 RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL);
420 parm= RNA_def_pointer(func, "track", "MovieTrackingTrack", "", "");
421 RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL);
422 RNA_def_boolean(func, "compact", 0, "", "Use more compact layout");
424 func= RNA_def_function(srna, "template_list", "uiTemplateList");
425 RNA_def_function_ui_description(func, "Item. A list widget to display data. e.g. vertexgroups");
426 RNA_def_function_flag(func, FUNC_USE_CONTEXT);
427 parm= RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take property");
428 RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR);
429 parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in data");
430 RNA_def_property_flag(parm, PROP_REQUIRED);
431 parm= RNA_def_pointer(func, "active_data", "AnyType", "", "Data from which to take property for the active element");
432 RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL);
433 parm= RNA_def_string(func, "active_property", "", 0, "", "Identifier of property in data, for the active element");
434 RNA_def_property_flag(parm, PROP_REQUIRED);
435 RNA_def_string(func, "prop_list", "", 0, "",
436 "Identifier of a string property in each data member, specifying which "
437 "of its properties should have a widget displayed in its row "
438 "(format: \"propname1:propname2:propname3:...\")");
439 RNA_def_int(func, "rows", 5, 0, INT_MAX, "", "Number of rows to display", 0, INT_MAX);
440 RNA_def_int(func, "maxrows", 5, 0, INT_MAX, "", "Maximum number of rows to display", 0, INT_MAX);
441 RNA_def_enum(func, "type", list_type_items, 0, "Type", "Type of list to use");
443 func= RNA_def_function(srna, "template_running_jobs", "uiTemplateRunningJobs");
444 RNA_def_function_flag(func, FUNC_USE_CONTEXT);
446 RNA_def_function(srna, "template_operator_search", "uiTemplateOperatorSearch");
448 func= RNA_def_function(srna, "template_header_3D", "uiTemplateHeader3D");
449 RNA_def_function_flag(func, FUNC_USE_CONTEXT);
451 func= RNA_def_function(srna, "template_edit_mode_selection", "uiTemplateEditModeSelection");
452 RNA_def_function_flag(func, FUNC_USE_CONTEXT);
454 func= RNA_def_function(srna, "template_reports_banner", "uiTemplateReportsBanner");
455 RNA_def_function_flag(func, FUNC_USE_CONTEXT);
457 func= RNA_def_function(srna, "template_node_link", "uiTemplateNodeLink");
458 parm= RNA_def_pointer(func, "ntree", "NodeTree", "", "");
459 RNA_def_property_flag(parm, PROP_REQUIRED);
460 parm= RNA_def_pointer(func, "node", "Node", "", "");
461 RNA_def_property_flag(parm, PROP_REQUIRED);
462 parm= RNA_def_pointer(func, "socket", "NodeSocket", "", "");
463 RNA_def_property_flag(parm, PROP_REQUIRED);
465 func= RNA_def_function(srna, "template_node_view", "uiTemplateNodeView");
466 RNA_def_function_flag(func, FUNC_USE_CONTEXT);
467 parm= RNA_def_pointer(func, "ntree", "NodeTree", "", "");
468 RNA_def_property_flag(parm, PROP_REQUIRED);
469 parm= RNA_def_pointer(func, "node", "Node", "", "");
470 RNA_def_property_flag(parm, PROP_REQUIRED);
471 parm= RNA_def_pointer(func, "socket", "NodeSocket", "", "");
472 RNA_def_property_flag(parm, PROP_REQUIRED);
474 func= RNA_def_function(srna, "template_texture_user", "uiTemplateTextureUser");
475 RNA_def_function_flag(func, FUNC_USE_CONTEXT);
477 func= RNA_def_function(srna, "template_keymap_item_properties", "uiTemplateKeymapItemProperties");
478 parm= RNA_def_pointer(func, "item", "KeyMapItem", "", "");
479 RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL);
481 func= RNA_def_function(srna, "introspect", "uiLayoutIntrospect");
482 parm= RNA_def_string(func, "string", "", 1024*1024, "Descr", "DESCR");
483 RNA_def_function_return(func, parm);