Blender  V3.3
rna_ui_api.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2009 Blender Foundation. All rights reserved. */
3 
8 #include <stdio.h>
9 #include <stdlib.h>
10 
11 #include "BLI_utildefines.h"
12 
13 #include "BLT_translation.h"
14 
15 #include "RNA_define.h"
16 #include "RNA_enum_types.h"
17 
18 #include "DNA_screen_types.h"
19 
20 #include "UI_interface.h"
21 #include "UI_interface_icons.h"
22 #include "UI_resources.h"
23 
24 #include "rna_internal.h"
25 
26 #define DEF_ICON(name) {ICON_##name, (#name), 0, (#name), ""},
27 #define DEF_ICON_VECTOR(name) {ICON_##name, (#name), 0, (#name), ""},
28 #define DEF_ICON_COLOR(name) {ICON_##name, (#name), 0, (#name), ""},
29 #define DEF_ICON_BLANK(name)
31 #include "UI_icons.h"
32  {0, NULL, 0, NULL, NULL},
33 };
34 
35 #ifdef RNA_RUNTIME
36 
37 # include "DNA_asset_types.h"
38 
39 const char *rna_translate_ui_text(
40  const char *text, const char *text_ctxt, StructRNA *type, PropertyRNA *prop, bool translate)
41 {
42  /* Also return text if UI labels translation is disabled. */
43  if (!text || !text[0] || !translate || !BLT_translate_iface()) {
44  return text;
45  }
46 
47  /* If a text_ctxt is specified, use it! */
48  if (text_ctxt && text_ctxt[0]) {
49  return BLT_pgettext(text_ctxt, text);
50  }
51 
52  /* Else, if an RNA type or property is specified, use its context. */
53 # if 0
54  /* XXX Disabled for now. Unfortunately, their is absolutely no way from py code to get the RNA
55  * struct corresponding to the 'data' (in functions like prop() & co),
56  * as this is pure runtime data. Hence, messages extraction script can't determine the
57  * correct context it should use for such 'text' messages...
58  * So for now, one have to explicitly specify the 'text_ctxt' when using prop() etc.
59  * functions, if default context is not suitable.
60  */
61  if (prop) {
63  }
64 # else
65  (void)prop;
66 # endif
67  if (type) {
69  }
70 
71  /* Else, default context! */
73 }
74 
75 static void rna_uiItemR(uiLayout *layout,
76  PointerRNA *ptr,
77  const char *propname,
78  const char *name,
79  const char *text_ctxt,
80  bool translate,
81  int icon,
82  bool expand,
83  bool slider,
84  int toggle,
85  bool icon_only,
86  bool event,
87  bool full_event,
88  bool emboss,
89  int index,
90  int icon_value,
91  bool invert_checkbox)
92 {
93  PropertyRNA *prop = RNA_struct_find_property(ptr, propname);
94  int flag = 0;
95 
96  if (!prop) {
97  RNA_warning("property not found: %s.%s", RNA_struct_identifier(ptr->type), propname);
98  return;
99  }
100 
101  if (icon_value && !icon) {
102  icon = icon_value;
103  }
104 
105  /* Get translated name (label). */
106  name = rna_translate_ui_text(name, text_ctxt, NULL, prop, translate);
107 
108  flag |= (slider) ? UI_ITEM_R_SLIDER : 0;
109  flag |= (expand) ? UI_ITEM_R_EXPAND : 0;
110  if (toggle == 1) {
111  flag |= UI_ITEM_R_TOGGLE;
112  }
113  else if (toggle == 0) {
114  flag |= UI_ITEM_R_ICON_NEVER;
115  }
116  flag |= (icon_only) ? UI_ITEM_R_ICON_ONLY : 0;
117  flag |= (event) ? UI_ITEM_R_EVENT : 0;
118  flag |= (full_event) ? UI_ITEM_R_FULL_EVENT : 0;
119  flag |= (emboss) ? 0 : UI_ITEM_R_NO_BG;
120  flag |= (invert_checkbox) ? UI_ITEM_R_CHECKBOX_INVERT : 0;
121 
122  uiItemFullR(layout, ptr, prop, index, 0, flag, name, icon);
123 }
124 
125 static void rna_uiItemR_with_popover(uiLayout *layout,
126  struct PointerRNA *ptr,
127  const char *propname,
128  const char *name,
129  const char *text_ctxt,
130  bool translate,
131  int icon,
132  bool icon_only,
133  const char *panel_type)
134 {
135  PropertyRNA *prop = RNA_struct_find_property(ptr, propname);
136 
137  if (!prop) {
138  RNA_warning("property not found: %s.%s", RNA_struct_identifier(ptr->type), propname);
139  return;
140  }
141  if ((RNA_property_type(prop) != PROP_ENUM) &&
143  RNA_warning(
144  "property is not an enum or color: %s.%s", RNA_struct_identifier(ptr->type), propname);
145  return;
146  }
147  int flag = 0;
148 
149  flag |= (icon_only) ? UI_ITEM_R_ICON_ONLY : 0;
150 
151  /* Get translated name (label). */
152  name = rna_translate_ui_text(name, text_ctxt, NULL, prop, translate);
153  uiItemFullR_with_popover(layout, ptr, prop, -1, 0, flag, name, icon, panel_type);
154 }
155 
156 static void rna_uiItemR_with_menu(uiLayout *layout,
157  struct PointerRNA *ptr,
158  const char *propname,
159  const char *name,
160  const char *text_ctxt,
161  bool translate,
162  int icon,
163  bool icon_only,
164  const char *menu_type)
165 {
166  PropertyRNA *prop = RNA_struct_find_property(ptr, propname);
167 
168  if (!prop) {
169  RNA_warning("property not found: %s.%s", RNA_struct_identifier(ptr->type), propname);
170  return;
171  }
172  if (RNA_property_type(prop) != PROP_ENUM) {
173  RNA_warning("property is not an enum: %s.%s", RNA_struct_identifier(ptr->type), propname);
174  return;
175  }
176  int flag = 0;
177 
178  flag |= (icon_only) ? UI_ITEM_R_ICON_ONLY : 0;
179 
180  /* Get translated name (label). */
181  name = rna_translate_ui_text(name, text_ctxt, NULL, prop, translate);
182  uiItemFullR_with_menu(layout, ptr, prop, -1, 0, flag, name, icon, menu_type);
183 }
184 
185 static void rna_uiItemMenuEnumR(uiLayout *layout,
186  struct PointerRNA *ptr,
187  const char *propname,
188  const char *name,
189  const char *text_ctxt,
190  bool translate,
191  int icon)
192 {
193  PropertyRNA *prop = RNA_struct_find_property(ptr, propname);
194 
195  if (!prop) {
196  RNA_warning("property not found: %s.%s", RNA_struct_identifier(ptr->type), propname);
197  return;
198  }
199 
200  /* Get translated name (label). */
201  name = rna_translate_ui_text(name, text_ctxt, NULL, prop, translate);
202  uiItemMenuEnumR_prop(layout, ptr, prop, name, icon);
203 }
204 
205 static void rna_uiItemTabsEnumR(uiLayout *layout,
206  bContext *C,
207  struct PointerRNA *ptr,
208  const char *propname,
209  struct PointerRNA *ptr_highlight,
210  const char *propname_highlight,
211  bool icon_only)
212 {
213  PropertyRNA *prop = RNA_struct_find_property(ptr, propname);
214 
215  if (!prop) {
216  RNA_warning("property not found: %s.%s", RNA_struct_identifier(ptr->type), propname);
217  return;
218  }
219  if (RNA_property_type(prop) != PROP_ENUM) {
220  RNA_warning("property is not an enum: %s.%s", RNA_struct_identifier(ptr->type), propname);
221  return;
222  }
223 
224  /* Get the highlight property used to gray out some of the tabs. */
225  PropertyRNA *prop_highlight = NULL;
226  if (!RNA_pointer_is_null(ptr_highlight)) {
227  prop_highlight = RNA_struct_find_property(ptr_highlight, propname_highlight);
228  if (!prop_highlight) {
229  RNA_warning("property not found: %s.%s",
230  RNA_struct_identifier(ptr_highlight->type),
231  propname_highlight);
232  return;
233  }
234  if (RNA_property_type(prop_highlight) != PROP_BOOLEAN) {
235  RNA_warning("property is not a boolean: %s.%s",
236  RNA_struct_identifier(ptr_highlight->type),
237  propname_highlight);
238  return;
239  }
240  if (!RNA_property_array_check(prop_highlight)) {
241  RNA_warning("property is not an array: %s.%s",
242  RNA_struct_identifier(ptr_highlight->type),
243  propname_highlight);
244  return;
245  }
246  }
247 
248  uiItemTabsEnumR_prop(layout, C, ptr, prop, ptr_highlight, prop_highlight, icon_only);
249 }
250 
251 static void rna_uiItemEnumR_string(uiLayout *layout,
252  struct PointerRNA *ptr,
253  const char *propname,
254  const char *value,
255  const char *name,
256  const char *text_ctxt,
257  bool translate,
258  int icon)
259 {
260  PropertyRNA *prop = RNA_struct_find_property(ptr, propname);
261 
262  if (!prop) {
263  RNA_warning("property not found: %s.%s", RNA_struct_identifier(ptr->type), propname);
264  return;
265  }
266 
267  /* Get translated name (label). */
268  name = rna_translate_ui_text(name, text_ctxt, NULL, prop, translate);
269 
270  uiItemEnumR_string_prop(layout, ptr, prop, value, name, icon);
271 }
272 
273 static void rna_uiItemPointerR(uiLayout *layout,
274  struct PointerRNA *ptr,
275  const char *propname,
276  struct PointerRNA *searchptr,
277  const char *searchpropname,
278  const char *name,
279  const char *text_ctxt,
280  bool translate,
281  int icon,
282  const bool results_are_suggestions)
283 {
284  PropertyRNA *prop = RNA_struct_find_property(ptr, propname);
285  if (!prop) {
286  RNA_warning("property not found: %s.%s", RNA_struct_identifier(ptr->type), propname);
287  return;
288  }
289  PropertyRNA *searchprop = RNA_struct_find_property(searchptr, searchpropname);
290  if (!searchprop) {
291  RNA_warning(
292  "property not found: %s.%s", RNA_struct_identifier(searchptr->type), searchpropname);
293  return;
294  }
295 
296  /* Get translated name (label). */
297  name = rna_translate_ui_text(name, text_ctxt, NULL, prop, translate);
298 
300  layout, ptr, prop, searchptr, searchprop, name, icon, results_are_suggestions);
301 }
302 
303 static PointerRNA rna_uiItemO(uiLayout *layout,
304  const char *opname,
305  const char *name,
306  const char *text_ctxt,
307  bool translate,
308  int icon,
309  bool emboss,
310  bool depress,
311  int icon_value)
312 {
314 
315  ot = WM_operatortype_find(opname, 0); /* print error next */
316  if (!ot || !ot->srna) {
317  RNA_warning("%s '%s'", ot ? "unknown operator" : "operator missing srna", opname);
318  return PointerRNA_NULL;
319  }
320 
321  /* Get translated name (label). */
322  name = rna_translate_ui_text(name, text_ctxt, ot->srna, NULL, translate);
323 
324  if (icon_value && !icon) {
325  icon = icon_value;
326  }
327  int flag = (emboss) ? 0 : UI_ITEM_R_NO_BG;
328  flag |= (depress) ? UI_ITEM_O_DEPRESS : 0;
329 
330  PointerRNA opptr;
331  uiItemFullO_ptr(layout, ot, name, icon, NULL, uiLayoutGetOperatorContext(layout), flag, &opptr);
332  return opptr;
333 }
334 
335 static PointerRNA rna_uiItemOMenuHold(uiLayout *layout,
336  const char *opname,
337  const char *name,
338  const char *text_ctxt,
339  bool translate,
340  int icon,
341  bool emboss,
342  bool depress,
343  int icon_value,
344  const char *menu)
345 {
346  wmOperatorType *ot = WM_operatortype_find(opname, 0); /* print error next */
347  if (!ot || !ot->srna) {
348  RNA_warning("%s '%s'", ot ? "unknown operator" : "operator missing srna", opname);
349  return PointerRNA_NULL;
350  }
351 
352  /* Get translated name (label). */
353  name = rna_translate_ui_text(name, text_ctxt, ot->srna, NULL, translate);
354  if (icon_value && !icon) {
355  icon = icon_value;
356  }
357  int flag = (emboss) ? 0 : UI_ITEM_R_NO_BG;
358  flag |= (depress) ? UI_ITEM_O_DEPRESS : 0;
359 
360  PointerRNA opptr;
362  layout, ot, name, icon, NULL, uiLayoutGetOperatorContext(layout), flag, menu, &opptr);
363  return opptr;
364 }
365 
366 static void rna_uiItemsEnumO(uiLayout *layout,
367  const char *opname,
368  const char *propname,
369  const bool icon_only)
370 {
371  int flag = icon_only ? UI_ITEM_R_ICON_ONLY : 0;
372  uiItemsFullEnumO(layout, opname, propname, NULL, uiLayoutGetOperatorContext(layout), flag);
373 }
374 
375 static PointerRNA rna_uiItemMenuEnumO(uiLayout *layout,
376  bContext *C,
377  const char *opname,
378  const char *propname,
379  const char *name,
380  const char *text_ctxt,
381  bool translate,
382  int icon)
383 {
384  wmOperatorType *ot = WM_operatortype_find(opname, 0); /* print error next */
385 
386  if (!ot || !ot->srna) {
387  RNA_warning("%s '%s'", ot ? "unknown operator" : "operator missing srna", opname);
388  return PointerRNA_NULL;
389  }
390 
391  /* Get translated name (label). */
392  name = rna_translate_ui_text(name, text_ctxt, ot->srna, NULL, translate);
393 
394  PointerRNA opptr;
395  uiItemMenuEnumFullO_ptr(layout, C, ot, propname, name, icon, &opptr);
396  return opptr;
397 }
398 
399 static void rna_uiItemL(uiLayout *layout,
400  const char *name,
401  const char *text_ctxt,
402  bool translate,
403  int icon,
404  int icon_value)
405 {
406  /* Get translated name (label). */
407  name = rna_translate_ui_text(name, text_ctxt, NULL, NULL, translate);
408 
409  if (icon_value && !icon) {
410  icon = icon_value;
411  }
412 
413  uiItemL(layout, name, icon);
414 }
415 
416 static void rna_uiItemM(uiLayout *layout,
417  const char *menuname,
418  const char *name,
419  const char *text_ctxt,
420  bool translate,
421  int icon,
422  int icon_value)
423 {
424  /* Get translated name (label). */
425  name = rna_translate_ui_text(name, text_ctxt, NULL, NULL, translate);
426 
427  if (icon_value && !icon) {
428  icon = icon_value;
429  }
430 
431  uiItemM(layout, menuname, name, icon);
432 }
433 
434 static void rna_uiItemM_contents(uiLayout *layout, const char *menuname)
435 {
436  uiItemMContents(layout, menuname);
437 }
438 
439 static void rna_uiItemPopoverPanel(uiLayout *layout,
440  bContext *C,
441  const char *panel_type,
442  const char *name,
443  const char *text_ctxt,
444  bool translate,
445  int icon,
446  int icon_value)
447 {
448  /* Get translated name (label). */
449  name = rna_translate_ui_text(name, text_ctxt, NULL, NULL, translate);
450 
451  if (icon_value && !icon) {
452  icon = icon_value;
453  }
454 
455  uiItemPopoverPanel(layout, C, panel_type, name, icon);
456 }
457 
458 static void rna_uiItemPopoverPanelFromGroup(uiLayout *layout,
459  bContext *C,
460  int space_id,
461  int region_id,
462  const char *context,
463  const char *category)
464 {
465  uiItemPopoverPanelFromGroup(layout, C, space_id, region_id, context, category);
466 }
467 
468 static void rna_uiTemplateID(uiLayout *layout,
469  bContext *C,
470  PointerRNA *ptr,
471  const char *propname,
472  const char *newop,
473  const char *openop,
474  const char *unlinkop,
475  int filter,
476  const bool live_icon,
477  const char *name,
478  const char *text_ctxt,
479  bool translate)
480 {
481  PropertyRNA *prop = RNA_struct_find_property(ptr, propname);
482 
483  if (!prop) {
484  RNA_warning("property not found: %s.%s", RNA_struct_identifier(ptr->type), propname);
485  return;
486  }
487 
488  /* Get translated name (label). */
489  name = rna_translate_ui_text(name, text_ctxt, NULL, prop, translate);
490 
491  uiTemplateID(layout, C, ptr, propname, newop, openop, unlinkop, filter, live_icon, name);
492 }
493 
494 static void rna_uiTemplateAnyID(uiLayout *layout,
495  PointerRNA *ptr,
496  const char *propname,
497  const char *proptypename,
498  const char *name,
499  const char *text_ctxt,
500  bool translate)
501 {
502  PropertyRNA *prop = RNA_struct_find_property(ptr, propname);
503 
504  if (!prop) {
505  RNA_warning("property not found: %s.%s", RNA_struct_identifier(ptr->type), propname);
506  return;
507  }
508 
509  /* Get translated name (label). */
510  name = rna_translate_ui_text(name, text_ctxt, NULL, prop, translate);
511 
512  /* XXX This will search property again :( */
513  uiTemplateAnyID(layout, ptr, propname, proptypename, name);
514 }
515 
516 void rna_uiTemplateList(uiLayout *layout,
517  struct bContext *C,
518  const char *listtype_name,
519  const char *list_id,
520  struct PointerRNA *dataptr,
521  const char *propname,
522  struct PointerRNA *active_dataptr,
523  const char *active_propname,
524  const char *item_dyntip_propname,
525  const int rows,
526  const int maxrows,
527  const int layout_type,
528  const int columns,
529  const bool sort_reverse,
530  const bool sort_lock)
531 {
532  int flags = UI_TEMPLATE_LIST_FLAG_NONE;
533  if (sort_reverse) {
535  }
536  if (sort_lock) {
538  }
539 
540  uiTemplateList(layout,
541  C,
542  listtype_name,
543  list_id,
544  dataptr,
545  propname,
546  active_dataptr,
547  active_propname,
548  item_dyntip_propname,
549  rows,
550  maxrows,
551  layout_type,
552  columns,
553  flags);
554 }
555 
556 static void rna_uiTemplateCacheFile(uiLayout *layout,
557  bContext *C,
558  PointerRNA *ptr,
559  const char *propname)
560 {
561  PropertyRNA *prop = RNA_struct_find_property(ptr, propname);
562 
563  if (!prop) {
564  RNA_warning("property not found: %s.%s", RNA_struct_identifier(ptr->type), propname);
565  return;
566  }
567 
568  uiTemplateCacheFile(layout, C, ptr, propname);
569 }
570 
571 static void rna_uiTemplateCacheFileVelocity(uiLayout *layout,
572  PointerRNA *ptr,
573  const char *propname)
574 {
575  PointerRNA fileptr;
576  if (!uiTemplateCacheFilePointer(ptr, propname, &fileptr)) {
577  return;
578  }
579 
580  uiTemplateCacheFileVelocity(layout, &fileptr);
581 }
582 
583 static void rna_uiTemplateCacheFileProcedural(uiLayout *layout,
584  bContext *C,
585  PointerRNA *ptr,
586  const char *propname)
587 {
588  PointerRNA fileptr;
589  if (!uiTemplateCacheFilePointer(ptr, propname, &fileptr)) {
590  return;
591  }
592 
593  uiTemplateCacheFileProcedural(layout, C, &fileptr);
594 }
595 
596 static void rna_uiTemplateCacheFileTimeSettings(uiLayout *layout,
597  PointerRNA *ptr,
598  const char *propname)
599 {
600  PointerRNA fileptr;
601  if (!uiTemplateCacheFilePointer(ptr, propname, &fileptr)) {
602  return;
603  }
604 
605  uiTemplateCacheFileTimeSettings(layout, &fileptr);
606 }
607 
608 static void rna_uiTemplateCacheFileLayers(uiLayout *layout,
609  bContext *C,
610  PointerRNA *ptr,
611  const char *propname)
612 {
613  PointerRNA fileptr;
614  if (!uiTemplateCacheFilePointer(ptr, propname, &fileptr)) {
615  return;
616  }
617 
618  uiTemplateCacheFileLayers(layout, C, &fileptr);
619 }
620 
621 static void rna_uiTemplatePathBuilder(uiLayout *layout,
622  PointerRNA *ptr,
623  const char *propname,
624  PointerRNA *root_ptr,
625  const char *name,
626  const char *text_ctxt,
627  bool translate)
628 {
629  PropertyRNA *prop = RNA_struct_find_property(ptr, propname);
630 
631  if (!prop) {
632  RNA_warning("property not found: %s.%s", RNA_struct_identifier(ptr->type), propname);
633  return;
634  }
635 
636  /* Get translated name (label). */
637  name = rna_translate_ui_text(name, text_ctxt, NULL, prop, translate);
638 
639  /* XXX This will search property again :( */
640  uiTemplatePathBuilder(layout, ptr, propname, root_ptr, name);
641 }
642 
643 static void rna_uiTemplateEventFromKeymapItem(
644  uiLayout *layout, wmKeyMapItem *kmi, const char *name, const char *text_ctxt, bool translate)
645 {
646  /* Get translated name (label). */
647  name = rna_translate_ui_text(name, text_ctxt, NULL, NULL, translate);
648  uiTemplateEventFromKeymapItem(layout, name, kmi, true);
649 }
650 
651 static void rna_uiTemplateAssetView(uiLayout *layout,
652  bContext *C,
653  const char *list_id,
654  PointerRNA *asset_library_dataptr,
655  const char *asset_library_propname,
656  PointerRNA *assets_dataptr,
657  const char *assets_propname,
658  PointerRNA *active_dataptr,
659  const char *active_propname,
660  int filter_id_types,
661  int display_flags,
662  const char *activate_opname,
663  PointerRNA *r_activate_op_properties,
664  const char *drag_opname,
665  PointerRNA *r_drag_op_properties)
666 {
667  AssetFilterSettings filter_settings = {
668  .id_types = filter_id_types ? filter_id_types : FILTER_ID_ALL,
669  };
670 
671  uiTemplateAssetView(layout,
672  C,
673  list_id,
674  asset_library_dataptr,
675  asset_library_propname,
676  assets_dataptr,
677  assets_propname,
678  active_dataptr,
679  active_propname,
680  &filter_settings,
681  display_flags,
682  activate_opname,
683  r_activate_op_properties,
684  drag_opname,
685  r_drag_op_properties);
686 }
687 
692 static const EnumPropertyItem *rna_uiTemplateAssetView_filter_id_types_itemf(
693  bContext *UNUSED(C), PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), bool *r_free)
694 {
695  EnumPropertyItem *items = NULL;
696  int totitem = 0;
697 
698  for (int i = 0; rna_enum_id_type_filter_items[i].identifier; i++) {
699  if (rna_enum_id_type_filter_items[i].flag > (1ULL << 31)) {
700  continue;
701  }
702 
703  EnumPropertyItem tmp = {0, "", 0, "", ""};
709  RNA_enum_item_add(&items, &totitem, &tmp);
710  }
711  RNA_enum_item_end(&items, &totitem);
712 
713  *r_free = true;
714  return items;
715 }
716 
717 static uiLayout *rna_uiLayoutRowWithHeading(
718  uiLayout *layout, bool align, const char *heading, const char *heading_ctxt, bool translate)
719 {
720  /* Get translated heading. */
721  heading = rna_translate_ui_text(heading, heading_ctxt, NULL, NULL, translate);
722  return uiLayoutRowWithHeading(layout, align, heading);
723 }
724 
725 static uiLayout *rna_uiLayoutColumnWithHeading(
726  uiLayout *layout, bool align, const char *heading, const char *heading_ctxt, bool translate)
727 {
728  /* Get translated heading. */
729  heading = rna_translate_ui_text(heading, heading_ctxt, NULL, NULL, translate);
730  return uiLayoutColumnWithHeading(layout, align, heading);
731 }
732 
733 static int rna_ui_get_rnaptr_icon(bContext *C, PointerRNA *ptr_icon)
734 {
735  return UI_icon_from_rnaptr(C, ptr_icon, RNA_struct_ui_icon(ptr_icon->type), false);
736 }
737 
738 static const char *rna_ui_get_enum_name(bContext *C,
739  PointerRNA *ptr,
740  const char *propname,
741  const char *identifier)
742 {
743  PropertyRNA *prop = NULL;
744  const EnumPropertyItem *items = NULL;
745  bool free;
746  const char *name = "";
747 
748  prop = RNA_struct_find_property(ptr, propname);
749  if (!prop || (RNA_property_type(prop) != PROP_ENUM)) {
750  RNA_warning(
751  "Property not found or not an enum: %s.%s", RNA_struct_identifier(ptr->type), propname);
752  return name;
753  }
754 
755  RNA_property_enum_items_gettexted(C, ptr, prop, &items, NULL, &free);
756 
757  if (items) {
758  const int index = RNA_enum_from_identifier(items, identifier);
759  if (index != -1) {
760  name = items[index].name;
761  }
762  if (free) {
763  MEM_freeN((void *)items);
764  }
765  }
766 
767  return name;
768 }
769 
770 static const char *rna_ui_get_enum_description(bContext *C,
771  PointerRNA *ptr,
772  const char *propname,
773  const char *identifier)
774 {
775  PropertyRNA *prop = NULL;
776  const EnumPropertyItem *items = NULL;
777  bool free;
778  const char *desc = "";
779 
780  prop = RNA_struct_find_property(ptr, propname);
781  if (!prop || (RNA_property_type(prop) != PROP_ENUM)) {
782  RNA_warning(
783  "Property not found or not an enum: %s.%s", RNA_struct_identifier(ptr->type), propname);
784  return desc;
785  }
786 
787  RNA_property_enum_items_gettexted(C, ptr, prop, &items, NULL, &free);
788 
789  if (items) {
790  const int index = RNA_enum_from_identifier(items, identifier);
791  if (index != -1) {
792  desc = items[index].description;
793  }
794  if (free) {
795  MEM_freeN((void *)items);
796  }
797  }
798 
799  return desc;
800 }
801 
802 static int rna_ui_get_enum_icon(bContext *C,
803  PointerRNA *ptr,
804  const char *propname,
805  const char *identifier)
806 {
807  PropertyRNA *prop = NULL;
808  const EnumPropertyItem *items = NULL;
809  bool free;
810  int icon = ICON_NONE;
811 
812  prop = RNA_struct_find_property(ptr, propname);
813  if (!prop || (RNA_property_type(prop) != PROP_ENUM)) {
814  RNA_warning(
815  "Property not found or not an enum: %s.%s", RNA_struct_identifier(ptr->type), propname);
816  return icon;
817  }
818 
819  RNA_property_enum_items(C, ptr, prop, &items, NULL, &free);
820 
821  if (items) {
822  const int index = RNA_enum_from_identifier(items, identifier);
823  if (index != -1) {
824  icon = items[index].icon;
825  }
826  if (free) {
827  MEM_freeN((void *)items);
828  }
829  }
830 
831  return icon;
832 }
833 
834 #else
835 
837 {
838  RNA_def_string(func,
839  "heading",
840  NULL,
842  "Heading",
843  "Label to insert into the layout for this sub-layout");
844  RNA_def_string(func,
845  "heading_ctxt",
846  NULL,
847  0,
848  "",
849  "Override automatic translation context of the given heading");
851  func, "translate", true, "", "Translate the given heading, when UI translation is enabled");
852 }
853 
855 {
856  PropertyRNA *prop;
857 
858  prop = RNA_def_string(func, "text", NULL, 0, "", "Override automatic text of the item");
860  prop = RNA_def_string(
861  func, "text_ctxt", NULL, 0, "", "Override automatic translation context of the given text");
864  func, "translate", true, "", "Translate the given text, when UI translation is enabled");
865 }
866 
867 static void api_ui_item_common(FunctionRNA *func)
868 {
869  PropertyRNA *prop;
870 
872 
873  prop = RNA_def_property(func, "icon", PROP_ENUM, PROP_NONE);
875  RNA_def_property_ui_text(prop, "Icon", "Override automatic icon of the item");
876 }
877 
878 static void api_ui_item_op(FunctionRNA *func)
879 {
880  PropertyRNA *parm;
881  parm = RNA_def_string(func, "operator", NULL, 0, "", "Identifier of the operator");
883 }
884 
886 {
887  api_ui_item_op(func);
888  api_ui_item_common(func);
889 }
890 
892 {
893  PropertyRNA *parm;
894 
895  parm = RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take property");
897  parm = RNA_def_string(func, "property", NULL, 0, "", "Identifier of property in data");
899 }
900 
902 {
903  FunctionRNA *func;
904  PropertyRNA *parm;
905 
906  static const EnumPropertyItem curve_type_items[] = {
907  {0, "NONE", 0, "None", ""},
908  {'v', "VECTOR", 0, "Vector", ""},
909  {'c', "COLOR", 0, "Color", ""},
910  {'h', "HUE", 0, "Hue", ""},
911  {0, NULL, 0, NULL, NULL},
912  };
913 
914  static const EnumPropertyItem id_template_filter_items[] = {
915  {UI_TEMPLATE_ID_FILTER_ALL, "ALL", 0, "All", ""},
916  {UI_TEMPLATE_ID_FILTER_AVAILABLE, "AVAILABLE", 0, "Available", ""},
917  {0, NULL, 0, NULL, NULL},
918  };
919 
920  static const EnumPropertyItem asset_view_template_options[] = {
922  "NO_NAMES",
923  0,
924  "",
925  "Do not display the name of each asset underneath preview images"},
927  "NO_FILTER",
928  0,
929  "",
930  "Do not display buttons for filtering the available assets"},
932  "NO_LIBRARY",
933  0,
934  "",
935  "Do not display buttons to choose or refresh an asset library"},
936  {0, NULL, 0, NULL, NULL},
937  };
938 
939  static float node_socket_color_default[] = {0.0f, 0.0f, 0.0f, 1.0f};
940 
941  /* simple layout specifiers */
942  func = RNA_def_function(srna, "row", "rna_uiLayoutRowWithHeading");
943  parm = RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in");
944  RNA_def_function_return(func, parm);
946  func,
947  "Sub-layout. Items placed in this sublayout are placed next to each other "
948  "in a row");
949  RNA_def_boolean(func, "align", false, "", "Align buttons to each other");
951 
952  func = RNA_def_function(srna, "column", "rna_uiLayoutColumnWithHeading");
953  parm = RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in");
954  RNA_def_function_return(func, parm);
956  func,
957  "Sub-layout. Items placed in this sublayout are placed under each other "
958  "in a column");
959  RNA_def_boolean(func, "align", false, "", "Align buttons to each other");
961 
962  func = RNA_def_function(srna, "column_flow", "uiLayoutColumnFlow");
963  RNA_def_int(func, "columns", 0, 0, INT_MAX, "", "Number of columns, 0 is automatic", 0, INT_MAX);
964  parm = RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in");
965  RNA_def_function_return(func, parm);
966  RNA_def_boolean(func, "align", false, "", "Align buttons to each other");
967 
968  func = RNA_def_function(srna, "grid_flow", "uiLayoutGridFlow");
969  RNA_def_boolean(func, "row_major", false, "", "Fill row by row, instead of column by column");
970  RNA_def_int(
971  func,
972  "columns",
973  0,
974  INT_MIN,
975  INT_MAX,
976  "",
977  "Number of columns, positive are absolute fixed numbers, 0 is automatic, negative are "
978  "automatic multiple numbers along major axis (e.g. -2 will only produce 2, 4, 6 etc. "
979  "columns for row major layout, and 2, 4, 6 etc. rows for column major layout)",
980  INT_MIN,
981  INT_MAX);
982  RNA_def_boolean(func, "even_columns", false, "", "All columns will have the same width");
983  RNA_def_boolean(func, "even_rows", false, "", "All rows will have the same height");
984  RNA_def_boolean(func, "align", false, "", "Align buttons to each other");
985  parm = RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in");
986  RNA_def_function_return(func, parm);
987 
988  /* box layout */
989  func = RNA_def_function(srna, "box", "uiLayoutBox");
990  parm = RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in");
991  RNA_def_function_return(func, parm);
993  "Sublayout (items placed in this sublayout are placed "
994  "under each other in a column and are surrounded by a box)");
995 
996  /* split layout */
997  func = RNA_def_function(srna, "split", "uiLayoutSplit");
998  parm = RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in");
999  RNA_def_function_return(func, parm);
1000  RNA_def_float(func,
1001  "factor",
1002  0.0f,
1003  0.0f,
1004  1.0f,
1005  "Percentage",
1006  "Percentage of width to split at (leave unset for automatic calculation)",
1007  0.0f,
1008  1.0f);
1009  RNA_def_boolean(func, "align", false, "", "Align buttons to each other");
1010 
1011  /* radial/pie layout */
1012  func = RNA_def_function(srna, "menu_pie", "uiLayoutRadial");
1013  parm = RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in");
1014  RNA_def_function_return(func, parm);
1016  "Sublayout. Items placed in this sublayout are placed "
1017  "in a radial fashion around the menu center)");
1018 
1019  /* Icon of a rna pointer */
1020  func = RNA_def_function(srna, "icon", "rna_ui_get_rnaptr_icon");
1021  parm = RNA_def_int(func, "icon_value", ICON_NONE, 0, INT_MAX, "", "Icon identifier", 0, INT_MAX);
1022  RNA_def_function_return(func, parm);
1024  parm = RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take the icon");
1027  "Return the custom icon for this data, "
1028  "use it e.g. to get materials or texture icons");
1029 
1030  /* UI name, description and icon of an enum item */
1031  func = RNA_def_function(srna, "enum_item_name", "rna_ui_get_enum_name");
1032  parm = RNA_def_string(func, "name", NULL, 0, "", "UI name of the enum item");
1033  RNA_def_function_return(func, parm);
1035  api_ui_item_rna_common(func);
1036  parm = RNA_def_string(func, "identifier", NULL, 0, "", "Identifier of the enum item");
1038  RNA_def_function_ui_description(func, "Return the UI name for this enum item");
1039 
1040  func = RNA_def_function(srna, "enum_item_description", "rna_ui_get_enum_description");
1041  parm = RNA_def_string(func, "description", NULL, 0, "", "UI description of the enum item");
1042  RNA_def_function_return(func, parm);
1044  api_ui_item_rna_common(func);
1045  parm = RNA_def_string(func, "identifier", NULL, 0, "", "Identifier of the enum item");
1047  RNA_def_function_ui_description(func, "Return the UI description for this enum item");
1048 
1049  func = RNA_def_function(srna, "enum_item_icon", "rna_ui_get_enum_icon");
1050  parm = RNA_def_int(func, "icon_value", ICON_NONE, 0, INT_MAX, "", "Icon identifier", 0, INT_MAX);
1051  RNA_def_function_return(func, parm);
1053  api_ui_item_rna_common(func);
1054  parm = RNA_def_string(func, "identifier", NULL, 0, "", "Identifier of the enum item");
1056  RNA_def_function_ui_description(func, "Return the icon for this enum item");
1057 
1058  /* items */
1059  func = RNA_def_function(srna, "prop", "rna_uiItemR");
1060  RNA_def_function_ui_description(func, "Item. Exposes an RNA item and places it into the layout");
1061  api_ui_item_rna_common(func);
1062  api_ui_item_common(func);
1063  RNA_def_boolean(func, "expand", false, "", "Expand button to show more detail");
1064  RNA_def_boolean(func, "slider", false, "", "Use slider widget for numeric values");
1065  RNA_def_int(func,
1066  "toggle",
1067  -1,
1068  -1,
1069  1,
1070  "",
1071  "Use toggle widget for boolean values, "
1072  "or a checkbox when disabled "
1073  "(the default is -1 which uses toggle only when an icon is displayed)",
1074  -1,
1075  1);
1076  RNA_def_boolean(func, "icon_only", false, "", "Draw only icons in buttons, no text");
1077  RNA_def_boolean(func, "event", false, "", "Use button to input key events");
1079  func, "full_event", false, "", "Use button to input full events including modifiers");
1080  RNA_def_boolean(func,
1081  "emboss",
1082  true,
1083  "",
1084  "Draw the button itself, not just the icon/text. When false, corresponds to the "
1085  "'NONE_OR_STATUS' layout emboss type");
1086  RNA_def_int(func,
1087  "index",
1088  /* RNA_NO_INDEX == -1 */
1089  -1,
1090  -2,
1091  INT_MAX,
1092  "",
1093  "The index of this button, when set a single member of an array can be accessed, "
1094  "when set to -1 all array members are used",
1095  -2,
1096  INT_MAX);
1097  parm = RNA_def_property(func, "icon_value", PROP_INT, PROP_UNSIGNED);
1098  RNA_def_property_ui_text(parm, "Icon Value", "Override automatic icon of the item");
1099  RNA_def_boolean(func, "invert_checkbox", false, "", "Draw checkbox value inverted");
1100 
1101  func = RNA_def_function(srna, "props_enum", "uiItemsEnumR");
1102  api_ui_item_rna_common(func);
1103 
1104  func = RNA_def_function(srna, "prop_menu_enum", "rna_uiItemMenuEnumR");
1105  api_ui_item_rna_common(func);
1106  api_ui_item_common(func);
1107 
1108  func = RNA_def_function(srna, "prop_with_popover", "rna_uiItemR_with_popover");
1109  api_ui_item_rna_common(func);
1110  api_ui_item_common(func);
1111  RNA_def_boolean(func, "icon_only", false, "", "Draw only icons in tabs, no text");
1112  parm = RNA_def_string(func, "panel", NULL, 0, "", "Identifier of the panel");
1114 
1115  func = RNA_def_function(srna, "prop_with_menu", "rna_uiItemR_with_menu");
1116  api_ui_item_rna_common(func);
1117  api_ui_item_common(func);
1118  RNA_def_boolean(func, "icon_only", false, "", "Draw only icons in tabs, no text");
1119  parm = RNA_def_string(func, "menu", NULL, 0, "", "Identifier of the menu");
1121 
1122  func = RNA_def_function(srna, "prop_tabs_enum", "rna_uiItemTabsEnumR");
1124  api_ui_item_rna_common(func);
1125  parm = RNA_def_pointer(
1126  func, "data_highlight", "AnyType", "", "Data from which to take highlight property");
1128  parm = RNA_def_string(
1129  func, "property_highlight", NULL, 0, "", "Identifier of highlight property in data");
1130  RNA_def_boolean(func, "icon_only", false, "", "Draw only icons in tabs, no text");
1131 
1132  func = RNA_def_function(srna, "prop_enum", "rna_uiItemEnumR_string");
1133  api_ui_item_rna_common(func);
1134  parm = RNA_def_string(func, "value", NULL, 0, "", "Enum property value");
1136  api_ui_item_common(func);
1137 
1138  func = RNA_def_function(srna, "prop_search", "rna_uiItemPointerR");
1139  api_ui_item_rna_common(func);
1140  parm = RNA_def_pointer(
1141  func, "search_data", "AnyType", "", "Data from which to take collection to search in");
1143  parm = RNA_def_string(
1144  func, "search_property", NULL, 0, "", "Identifier of search collection property");
1146  api_ui_item_common(func);
1148  func, "results_are_suggestions", false, "", "Accept inputs that do not match any item");
1149 
1150  func = RNA_def_function(srna, "prop_decorator", "uiItemDecoratorR");
1151  api_ui_item_rna_common(func);
1152  RNA_def_int(func,
1153  "index",
1154  /* RNA_NO_INDEX == -1 */
1155  -1,
1156  -2,
1157  INT_MAX,
1158  "",
1159  "The index of this button, when set a single member of an array can be accessed, "
1160  "when set to -1 all array members are used",
1161  -2,
1162  INT_MAX);
1163 
1164  for (int is_menu_hold = 0; is_menu_hold < 2; is_menu_hold++) {
1165  func = (is_menu_hold) ? RNA_def_function(srna, "operator_menu_hold", "rna_uiItemOMenuHold") :
1166  RNA_def_function(srna, "operator", "rna_uiItemO");
1167  api_ui_item_op_common(func);
1168  RNA_def_boolean(func, "emboss", true, "", "Draw the button itself, not just the icon/text");
1169  RNA_def_boolean(func, "depress", false, "", "Draw pressed in");
1170  parm = RNA_def_property(func, "icon_value", PROP_INT, PROP_UNSIGNED);
1171  RNA_def_property_ui_text(parm, "Icon Value", "Override automatic icon of the item");
1172  if (is_menu_hold) {
1173  parm = RNA_def_string(func, "menu", NULL, 0, "", "Identifier of the menu");
1175  }
1176  parm = RNA_def_pointer(
1177  func, "properties", "OperatorProperties", "", "Operator properties to fill in");
1179  RNA_def_function_return(func, parm);
1181  "Item. Places a button into the layout to call an Operator");
1182  }
1183 
1184  func = RNA_def_function(srna, "operator_enum", "rna_uiItemsEnumO");
1185  parm = RNA_def_string(func, "operator", NULL, 0, "", "Identifier of the operator");
1187  parm = RNA_def_string(func, "property", NULL, 0, "", "Identifier of property in operator");
1189  RNA_def_boolean(func, "icon_only", false, "", "Draw only icons in buttons, no text");
1190 
1191  func = RNA_def_function(srna, "operator_menu_enum", "rna_uiItemMenuEnumO");
1193  /* Can't use #api_ui_item_op_common because property must come right after. */
1194  api_ui_item_op(func);
1195  parm = RNA_def_string(func, "property", NULL, 0, "", "Identifier of property in operator");
1197  api_ui_item_common(func);
1198  parm = RNA_def_pointer(
1199  func, "properties", "OperatorProperties", "", "Operator properties to fill in");
1201  RNA_def_function_return(func, parm);
1202 
1203  /* useful in C but not in python */
1204 # if 0
1205 
1206  func = RNA_def_function(srna, "operator_enum_single", "uiItemEnumO_string");
1207  api_ui_item_op_common(func);
1208  parm = RNA_def_string(func, "property", NULL, 0, "", "Identifier of property in operator");
1210  parm = RNA_def_string(func, "value", NULL, 0, "", "Enum property value");
1212 
1213  func = RNA_def_function(srna, "operator_boolean", "uiItemBooleanO");
1214  api_ui_item_op_common(func);
1215  parm = RNA_def_string(func, "property", NULL, 0, "", "Identifier of property in operator");
1217  parm = RNA_def_boolean(
1218  func, "value", false, "", "Value of the property to call the operator with");
1220 
1221  func = RNA_def_function(srna, "operator_int", "uiItemIntO");
1222  api_ui_item_op_common(func);
1223  parm = RNA_def_string(func, "property", NULL, 0, "", "Identifier of property in operator");
1225  parm = RNA_def_int(func,
1226  "value",
1227  0,
1228  INT_MIN,
1229  INT_MAX,
1230  "",
1231  "Value of the property to call the operator with",
1232  INT_MIN,
1233  INT_MAX);
1235 
1236  func = RNA_def_function(srna, "operator_float", "uiItemFloatO");
1237  api_ui_item_op_common(func);
1238  parm = RNA_def_string(func, "property", NULL, 0, "", "Identifier of property in operator");
1240  parm = RNA_def_float(func,
1241  "value",
1242  0,
1243  -FLT_MAX,
1244  FLT_MAX,
1245  "",
1246  "Value of the property to call the operator with",
1247  -FLT_MAX,
1248  FLT_MAX);
1250 
1251  func = RNA_def_function(srna, "operator_string", "uiItemStringO");
1252  api_ui_item_op_common(func);
1253  parm = RNA_def_string(func, "property", NULL, 0, "", "Identifier of property in operator");
1255  parm = RNA_def_string(
1256  func, "value", NULL, 0, "", "Value of the property to call the operator with");
1258 # endif
1259 
1260  func = RNA_def_function(srna, "label", "rna_uiItemL");
1261  RNA_def_function_ui_description(func, "Item. Displays text and/or icon in the layout");
1262  api_ui_item_common(func);
1263  parm = RNA_def_property(func, "icon_value", PROP_INT, PROP_UNSIGNED);
1264  RNA_def_property_ui_text(parm, "Icon Value", "Override automatic icon of the item");
1265 
1266  func = RNA_def_function(srna, "menu", "rna_uiItemM");
1267  parm = RNA_def_string(func, "menu", NULL, 0, "", "Identifier of the menu");
1268  api_ui_item_common(func);
1270  parm = RNA_def_property(func, "icon_value", PROP_INT, PROP_UNSIGNED);
1271  RNA_def_property_ui_text(parm, "Icon Value", "Override automatic icon of the item");
1272 
1273  func = RNA_def_function(srna, "menu_contents", "rna_uiItemM_contents");
1274  parm = RNA_def_string(func, "menu", NULL, 0, "", "Identifier of the menu");
1276 
1277  func = RNA_def_function(srna, "popover", "rna_uiItemPopoverPanel");
1279  parm = RNA_def_string(func, "panel", NULL, 0, "", "Identifier of the panel");
1280  api_ui_item_common(func);
1282  parm = RNA_def_property(func, "icon_value", PROP_INT, PROP_UNSIGNED);
1283  RNA_def_property_ui_text(parm, "Icon Value", "Override automatic icon of the item");
1284 
1285  func = RNA_def_function(srna, "popover_group", "rna_uiItemPopoverPanelFromGroup");
1287  parm = RNA_def_enum(func, "space_type", rna_enum_space_type_items, 0, "Space Type", "");
1289  parm = RNA_def_enum(
1290  func, "region_type", rna_enum_region_type_items, RGN_TYPE_WINDOW, "Region Type", "");
1292  parm = RNA_def_string(func, "context", NULL, 0, "", "panel type context");
1294  parm = RNA_def_string(func, "category", NULL, 0, "", "panel type category");
1296 
1297  func = RNA_def_function(srna, "separator", "uiItemS_ex");
1298  RNA_def_function_ui_description(func, "Item. Inserts empty space into the layout between items");
1299  RNA_def_float(func,
1300  "factor",
1301  1.0f,
1302  0.0f,
1303  FLT_MAX,
1304  "Percentage",
1305  "Percentage of width to space (leave unset for default space)",
1306  0.0f,
1307  FLT_MAX);
1308 
1309  func = RNA_def_function(srna, "separator_spacer", "uiItemSpacer");
1311  func, "Item. Inserts horizontal spacing empty space into the layout between items");
1312 
1313  /* context */
1314  func = RNA_def_function(srna, "context_pointer_set", "uiLayoutSetContextPointer");
1315  parm = RNA_def_string(func, "name", NULL, 0, "Name", "Name of entry in the context");
1317  parm = RNA_def_pointer(func, "data", "AnyType", "", "Pointer to put in context");
1319 
1320  /* templates */
1321  func = RNA_def_function(srna, "template_header", "uiTemplateHeader");
1323  RNA_def_function_ui_description(func, "Inserts common Space header UI (editor type selector)");
1324 
1325  func = RNA_def_function(srna, "template_ID", "rna_uiTemplateID");
1327  api_ui_item_rna_common(func);
1328  RNA_def_string(func, "new", NULL, 0, "", "Operator identifier to create a new ID block");
1330  func, "open", NULL, 0, "", "Operator identifier to open a file for creating a new ID block");
1331  RNA_def_string(func, "unlink", NULL, 0, "", "Operator identifier to unlink the ID block");
1332  RNA_def_enum(func,
1333  "filter",
1334  id_template_filter_items,
1336  "",
1337  "Optionally limit the items which can be selected");
1338  RNA_def_boolean(func, "live_icon", false, "", "Show preview instead of fixed icon");
1340 
1341  func = RNA_def_function(srna, "template_ID_preview", "uiTemplateIDPreview");
1343  api_ui_item_rna_common(func);
1344  RNA_def_string(func, "new", NULL, 0, "", "Operator identifier to create a new ID block");
1346  func, "open", NULL, 0, "", "Operator identifier to open a file for creating a new ID block");
1347  RNA_def_string(func, "unlink", NULL, 0, "", "Operator identifier to unlink the ID block");
1348  RNA_def_int(
1349  func, "rows", 0, 0, INT_MAX, "Number of thumbnail preview rows to display", "", 0, INT_MAX);
1350  RNA_def_int(func,
1351  "cols",
1352  0,
1353  0,
1354  INT_MAX,
1355  "Number of thumbnail preview columns to display",
1356  "",
1357  0,
1358  INT_MAX);
1359  RNA_def_enum(func,
1360  "filter",
1361  id_template_filter_items,
1363  "",
1364  "Optionally limit the items which can be selected");
1365  RNA_def_boolean(func, "hide_buttons", false, "", "Show only list, no buttons");
1366 
1367  func = RNA_def_function(srna, "template_any_ID", "rna_uiTemplateAnyID");
1368  parm = RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take property");
1370  parm = RNA_def_string(func, "property", NULL, 0, "", "Identifier of property in data");
1372  parm = RNA_def_string(func,
1373  "type_property",
1374  NULL,
1375  0,
1376  "",
1377  "Identifier of property in data giving the type of the ID-blocks to use");
1380 
1381  func = RNA_def_function(srna, "template_ID_tabs", "uiTemplateIDTabs");
1383  api_ui_item_rna_common(func);
1384  RNA_def_string(func, "new", NULL, 0, "", "Operator identifier to create a new ID block");
1385  RNA_def_string(func, "menu", NULL, 0, "", "Context menu identifier");
1386  RNA_def_enum(func,
1387  "filter",
1388  id_template_filter_items,
1390  "",
1391  "Optionally limit the items which can be selected");
1392 
1393  func = RNA_def_function(srna, "template_search", "uiTemplateSearch");
1395  api_ui_item_rna_common(func);
1396  parm = RNA_def_pointer(
1397  func, "search_data", "AnyType", "", "Data from which to take collection to search in");
1399  parm = RNA_def_string(
1400  func, "search_property", NULL, 0, "", "Identifier of search collection property");
1403  func, "new", NULL, 0, "", "Operator identifier to create a new item for the collection");
1404  RNA_def_string(func,
1405  "unlink",
1406  NULL,
1407  0,
1408  "",
1409  "Operator identifier to unlink or delete the active "
1410  "item from the collection");
1411 
1412  func = RNA_def_function(srna, "template_search_preview", "uiTemplateSearchPreview");
1414  api_ui_item_rna_common(func);
1415  parm = RNA_def_pointer(
1416  func, "search_data", "AnyType", "", "Data from which to take collection to search in");
1418  parm = RNA_def_string(
1419  func, "search_property", NULL, 0, "", "Identifier of search collection property");
1422  func, "new", NULL, 0, "", "Operator identifier to create a new item for the collection");
1423  RNA_def_string(func,
1424  "unlink",
1425  NULL,
1426  0,
1427  "",
1428  "Operator identifier to unlink or delete the active "
1429  "item from the collection");
1430  RNA_def_int(
1431  func, "rows", 0, 0, INT_MAX, "Number of thumbnail preview rows to display", "", 0, INT_MAX);
1432  RNA_def_int(func,
1433  "cols",
1434  0,
1435  0,
1436  INT_MAX,
1437  "Number of thumbnail preview columns to display",
1438  "",
1439  0,
1440  INT_MAX);
1441 
1442  func = RNA_def_function(srna, "template_path_builder", "rna_uiTemplatePathBuilder");
1443  parm = RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take property");
1445  parm = RNA_def_string(func, "property", NULL, 0, "", "Identifier of property in data");
1447  parm = RNA_def_pointer(func, "root", "ID", "", "ID-block from which path is evaluated from");
1450 
1451  func = RNA_def_function(srna, "template_modifiers", "uiTemplateModifiers");
1453  RNA_def_function_ui_description(func, "Generates the UI layout for the modifier stack");
1454 
1455  func = RNA_def_function(srna, "template_constraints", "uiTemplateConstraints");
1457  RNA_def_function_ui_description(func, "Generates the panels for the constraint stack");
1458  RNA_def_boolean(func,
1459  "use_bone_constraints",
1460  true,
1461  "",
1462  "Add panels for bone constraints instead of object constraints");
1463 
1464  func = RNA_def_function(srna, "template_grease_pencil_modifiers", "uiTemplateGpencilModifiers");
1467  "Generates the panels for the grease pencil modifier stack");
1468 
1469  func = RNA_def_function(srna, "template_shaderfx", "uiTemplateShaderFx");
1471  RNA_def_function_ui_description(func, "Generates the panels for the shader effect stack");
1472 
1473  func = RNA_def_function(srna, "template_greasepencil_color", "uiTemplateGpencilColorPreview");
1475  api_ui_item_rna_common(func);
1476  RNA_def_int(
1477  func, "rows", 0, 0, INT_MAX, "Number of thumbnail preview rows to display", "", 0, INT_MAX);
1478  RNA_def_int(func,
1479  "cols",
1480  0,
1481  0,
1482  INT_MAX,
1483  "Number of thumbnail preview columns to display",
1484  "",
1485  0,
1486  INT_MAX);
1487  RNA_def_float(func, "scale", 1.0f, 0.1f, 1.5f, "Scale of the image thumbnails", "", 0.5f, 1.0f);
1488  RNA_def_enum(func,
1489  "filter",
1490  id_template_filter_items,
1492  "",
1493  "Optionally limit the items which can be selected");
1494 
1495  func = RNA_def_function(srna, "template_constraint_header", "uiTemplateConstraintHeader");
1496  RNA_def_function_ui_description(func, "Generates the header for constraint panels");
1497  parm = RNA_def_pointer(func, "data", "Constraint", "", "Constraint data");
1499 
1500  func = RNA_def_function(srna, "template_preview", "uiTemplatePreview");
1502  func, "Item. A preview window for materials, textures, lights or worlds");
1504  parm = RNA_def_pointer(func, "id", "ID", "", "ID data-block");
1506  RNA_def_boolean(func, "show_buttons", true, "", "Show preview buttons?");
1507  RNA_def_pointer(func, "parent", "ID", "", "ID data-block");
1508  RNA_def_pointer(func, "slot", "TextureSlot", "", "Texture slot");
1510  func,
1511  "preview_id",
1512  NULL,
1513  0,
1514  "",
1515  "Identifier of this preview widget, if not set the ID type will be used "
1516  "(i.e. all previews of materials without explicit ID will have the same size...)");
1517 
1518  func = RNA_def_function(srna, "template_curve_mapping", "uiTemplateCurveMapping");
1520  func, "Item. A curve mapping widget used for e.g falloff curves for lights");
1521  api_ui_item_rna_common(func);
1522  RNA_def_enum(func, "type", curve_type_items, 0, "Type", "Type of curves to display");
1523  RNA_def_boolean(func, "levels", false, "", "Show black/white levels");
1524  RNA_def_boolean(func, "brush", false, "", "Show brush options");
1525  RNA_def_boolean(func, "use_negative_slope", false, "", "Use a negative slope by default");
1526  RNA_def_boolean(func, "show_tone", false, "", "Show tone options");
1527 
1528  func = RNA_def_function(srna, "template_curveprofile", "uiTemplateCurveProfile");
1529  RNA_def_function_ui_description(func, "A profile path editor used for custom profiles");
1530  api_ui_item_rna_common(func);
1531 
1532  func = RNA_def_function(srna, "template_color_ramp", "uiTemplateColorRamp");
1533  RNA_def_function_ui_description(func, "Item. A color ramp widget");
1534  api_ui_item_rna_common(func);
1535  RNA_def_boolean(func, "expand", false, "", "Expand button to show more detail");
1536 
1537  func = RNA_def_function(srna, "template_icon", "uiTemplateIcon");
1538  RNA_def_function_ui_description(func, "Display a large icon");
1539  parm = RNA_def_int(func, "icon_value", 0, 0, INT_MAX, "Icon to display", "", 0, INT_MAX);
1541  RNA_def_float(func,
1542  "scale",
1543  1.0f,
1544  1.0f,
1545  100.0f,
1546  "Scale",
1547  "Scale the icon size (by the button size)",
1548  1.0f,
1549  100.0f);
1550 
1551  func = RNA_def_function(srna, "template_icon_view", "uiTemplateIconView");
1552  RNA_def_function_ui_description(func, "Enum. Large widget showing Icon previews");
1553  api_ui_item_rna_common(func);
1554  RNA_def_boolean(func, "show_labels", false, "", "Show enum label in preview buttons");
1555  RNA_def_float(func,
1556  "scale",
1557  6.0f,
1558  1.0f,
1559  100.0f,
1560  "UI Units",
1561  "Scale the button icon size (by the button size)",
1562  1.0f,
1563  100.0f);
1564  RNA_def_float(func,
1565  "scale_popup",
1566  5.0f,
1567  1.0f,
1568  100.0f,
1569  "Scale",
1570  "Scale the popup icon size (by the button size)",
1571  1.0f,
1572  100.0f);
1573 
1574  func = RNA_def_function(srna, "template_histogram", "uiTemplateHistogram");
1575  RNA_def_function_ui_description(func, "Item. A histogramm widget to analyze imaga data");
1576  api_ui_item_rna_common(func);
1577 
1578  func = RNA_def_function(srna, "template_waveform", "uiTemplateWaveform");
1579  RNA_def_function_ui_description(func, "Item. A waveform widget to analyze imaga data");
1580  api_ui_item_rna_common(func);
1581 
1582  func = RNA_def_function(srna, "template_vectorscope", "uiTemplateVectorscope");
1583  RNA_def_function_ui_description(func, "Item. A vectorscope widget to analyze imaga data");
1584  api_ui_item_rna_common(func);
1585 
1586  func = RNA_def_function(srna, "template_layers", "uiTemplateLayers");
1587  api_ui_item_rna_common(func);
1588  parm = RNA_def_pointer(
1589  func, "used_layers_data", "AnyType", "", "Data from which to take property");
1591  parm = RNA_def_string(
1592  func, "used_layers_property", NULL, 0, "", "Identifier of property in data");
1594  parm = RNA_def_int(func, "active_layer", 0, 0, INT_MAX, "Active Layer", "", 0, INT_MAX);
1596 
1597  func = RNA_def_function(srna, "template_color_picker", "uiTemplateColorPicker");
1598  RNA_def_function_ui_description(func, "Item. A color wheel widget to pick colors");
1599  api_ui_item_rna_common(func);
1601  func, "value_slider", false, "", "Display the value slider to the right of the color wheel");
1602  RNA_def_boolean(func,
1603  "lock",
1604  false,
1605  "",
1606  "Lock the color wheel display to value 1.0 regardless of actual color");
1608  func, "lock_luminosity", false, "", "Keep the color at its original vector length");
1609  RNA_def_boolean(func, "cubic", false, "", "Cubic saturation for picking values close to white");
1610 
1611  func = RNA_def_function(srna, "template_palette", "uiTemplatePalette");
1612  RNA_def_function_ui_description(func, "Item. A palette used to pick colors");
1613  api_ui_item_rna_common(func);
1614  RNA_def_boolean(func, "color", 0, "", "Display the colors as colors or values");
1615 
1616  func = RNA_def_function(srna, "template_image_layers", "uiTemplateImageLayers");
1618  parm = RNA_def_pointer(func, "image", "Image", "", "");
1620  parm = RNA_def_pointer(func, "image_user", "ImageUser", "", "");
1622 
1623  func = RNA_def_function(srna, "template_image", "uiTemplateImage");
1625  func, "Item(s). User interface for selecting images and their source paths");
1627  api_ui_item_rna_common(func);
1628  parm = RNA_def_pointer(func, "image_user", "ImageUser", "", "");
1630  RNA_def_boolean(func, "compact", false, "", "Use more compact layout");
1631  RNA_def_boolean(func, "multiview", false, "", "Expose Multi-View options");
1632 
1633  func = RNA_def_function(srna, "template_image_settings", "uiTemplateImageSettings");
1634  RNA_def_function_ui_description(func, "User interface for setting image format options");
1635  parm = RNA_def_pointer(func, "image_settings", "ImageFormatSettings", "", "");
1637  RNA_def_boolean(func, "color_management", false, "", "Show color management settings");
1638 
1639  func = RNA_def_function(srna, "template_image_stereo_3d", "uiTemplateImageStereo3d");
1640  RNA_def_function_ui_description(func, "User interface for setting image stereo 3d options");
1641  parm = RNA_def_pointer(func, "stereo_3d_format", "Stereo3dFormat", "", "");
1643 
1644  func = RNA_def_function(srna, "template_image_views", "uiTemplateImageViews");
1645  RNA_def_function_ui_description(func, "User interface for setting image views output options");
1646  parm = RNA_def_pointer(func, "image_settings", "ImageFormatSettings", "", "");
1648 
1649  func = RNA_def_function(srna, "template_movieclip", "uiTemplateMovieClip");
1651  func, "Item(s). User interface for selecting movie clips and their source paths");
1653  api_ui_item_rna_common(func);
1654  RNA_def_boolean(func, "compact", false, "", "Use more compact layout");
1655 
1656  func = RNA_def_function(srna, "template_track", "uiTemplateTrack");
1657  RNA_def_function_ui_description(func, "Item. A movie-track widget to preview tracking image.");
1658  api_ui_item_rna_common(func);
1659 
1660  func = RNA_def_function(srna, "template_marker", "uiTemplateMarker");
1661  RNA_def_function_ui_description(func, "Item. A widget to control single marker settings.");
1662  api_ui_item_rna_common(func);
1663  parm = RNA_def_pointer(func, "clip_user", "MovieClipUser", "", "");
1665  parm = RNA_def_pointer(func, "track", "MovieTrackingTrack", "", "");
1667  RNA_def_boolean(func, "compact", false, "", "Use more compact layout");
1668 
1669  func = RNA_def_function(
1670  srna, "template_movieclip_information", "uiTemplateMovieclipInformation");
1671  RNA_def_function_ui_description(func, "Item. Movie clip information data.");
1672  api_ui_item_rna_common(func);
1673  parm = RNA_def_pointer(func, "clip_user", "MovieClipUser", "", "");
1675 
1676  func = RNA_def_function(srna, "template_list", "rna_uiTemplateList");
1677  RNA_def_function_ui_description(func, "Item. A list widget to display data, e.g. vertexgroups.");
1679  parm = RNA_def_string(func, "listtype_name", NULL, 0, "", "Identifier of the list type to use");
1681  parm = RNA_def_string(
1682  func,
1683  "list_id",
1684  NULL,
1685  0,
1686  "",
1687  "Identifier of this list widget (mandatory when using default \"" UI_UL_DEFAULT_CLASS_NAME
1688  "\" class). "
1689  "If this not an empty string, the uilist gets a custom ID, otherwise it takes the "
1690  "name of the class used to define the uilist (for example, if the "
1691  "class name is \"OBJECT_UL_vgroups\", and list_id is not set by the "
1692  "script, then bl_idname = \"OBJECT_UL_vgroups\")");
1694  parm = RNA_def_pointer(
1695  func, "dataptr", "AnyType", "", "Data from which to take the Collection property");
1697  parm = RNA_def_string(
1698  func, "propname", NULL, 0, "", "Identifier of the Collection property in data");
1700  parm = RNA_def_pointer(func,
1701  "active_dataptr",
1702  "AnyType",
1703  "",
1704  "Data from which to take the integer property, index of the active item");
1706  parm = RNA_def_string(
1707  func,
1708  "active_propname",
1709  NULL,
1710  0,
1711  "",
1712  "Identifier of the integer property in active_data, index of the active item");
1714  RNA_def_string(func,
1715  "item_dyntip_propname",
1716  NULL,
1717  0,
1718  "",
1719  "Identifier of a string property in items, to use as tooltip content");
1720  RNA_def_int(func,
1721  "rows",
1722  5,
1723  0,
1724  INT_MAX,
1725  "",
1726  "Default and minimum number of rows to display",
1727  0,
1728  INT_MAX);
1729  RNA_def_int(
1730  func, "maxrows", 5, 0, INT_MAX, "", "Default maximum number of rows to display", 0, INT_MAX);
1731  RNA_def_enum(func,
1732  "type",
1735  "Type",
1736  "Type of layout to use");
1737  RNA_def_int(func,
1738  "columns",
1739  9,
1740  0,
1741  INT_MAX,
1742  "",
1743  "Number of items to display per row, for GRID layout",
1744  0,
1745  INT_MAX);
1746  RNA_def_boolean(func, "sort_reverse", false, "", "Display items in reverse order by default");
1747  RNA_def_boolean(func, "sort_lock", false, "", "Lock display order to default value");
1748 
1749  func = RNA_def_function(srna, "template_running_jobs", "uiTemplateRunningJobs");
1751 
1752  RNA_def_function(srna, "template_operator_search", "uiTemplateOperatorSearch");
1753  RNA_def_function(srna, "template_menu_search", "uiTemplateMenuSearch");
1754 
1755  func = RNA_def_function(srna, "template_header_3D_mode", "uiTemplateHeader3D_mode");
1758 
1759  func = RNA_def_function(srna, "template_edit_mode_selection", "uiTemplateEditModeSelection");
1762  func, "Inserts common 3DView Edit modes header UI (selector for selection mode)");
1763 
1764  func = RNA_def_function(srna, "template_reports_banner", "uiTemplateReportsBanner");
1766 
1767  func = RNA_def_function(srna, "template_input_status", "uiTemplateInputStatus");
1769 
1770  func = RNA_def_function(srna, "template_status_info", "uiTemplateStatusInfo");
1772 
1773  func = RNA_def_function(srna, "template_node_link", "uiTemplateNodeLink");
1775  parm = RNA_def_pointer(func, "ntree", "NodeTree", "", "");
1777  parm = RNA_def_pointer(func, "node", "Node", "", "");
1779  parm = RNA_def_pointer(func, "socket", "NodeSocket", "", "");
1781 
1782  func = RNA_def_function(srna, "template_node_view", "uiTemplateNodeView");
1784  parm = RNA_def_pointer(func, "ntree", "NodeTree", "", "");
1786  parm = RNA_def_pointer(func, "node", "Node", "", "");
1788  parm = RNA_def_pointer(func, "socket", "NodeSocket", "", "");
1790 
1791  func = RNA_def_function(srna, "template_texture_user", "uiTemplateTextureUser");
1793 
1794  func = RNA_def_function(
1795  srna, "template_keymap_item_properties", "uiTemplateKeymapItemProperties");
1796  parm = RNA_def_pointer(func, "item", "KeyMapItem", "", "");
1798 
1799  func = RNA_def_function(srna, "template_component_menu", "uiTemplateComponentMenu");
1800  RNA_def_function_ui_description(func, "Item. Display expanded property in a popup menu");
1801  parm = RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take property");
1803  parm = RNA_def_string(func, "property", NULL, 0, "", "Identifier of property in data");
1805  RNA_def_string(func, "name", NULL, 0, "", "");
1806 
1807  /* color management templates */
1808  func = RNA_def_function(srna, "template_colorspace_settings", "uiTemplateColorspaceSettings");
1809  RNA_def_function_ui_description(func, "Item. A widget to control input color space settings.");
1810  api_ui_item_rna_common(func);
1811 
1812  func = RNA_def_function(
1813  srna, "template_colormanaged_view_settings", "uiTemplateColormanagedViewSettings");
1815  func, "Item. A widget to control color managed view settings settings.");
1817  api_ui_item_rna_common(func);
1818 # if 0
1819  RNA_def_boolean(func,
1820  "show_global_settings",
1821  false,
1822  "",
1823  "Show widgets to control global color management settings");
1824 # endif
1825 
1826  /* node socket icon */
1827  func = RNA_def_function(srna, "template_node_socket", "uiTemplateNodeSocket");
1828  RNA_def_function_ui_description(func, "Node Socket Icon");
1831  func, "color", 4, node_socket_color_default, 0.0f, 1.0f, "Color", "", 0.0f, 1.0f);
1832 
1833  func = RNA_def_function(srna, "template_cache_file", "rna_uiTemplateCacheFile");
1835  func, "Item(s). User interface for selecting cache files and their source paths");
1837  api_ui_item_rna_common(func);
1838 
1839  func = RNA_def_function(srna, "template_cache_file_velocity", "rna_uiTemplateCacheFileVelocity");
1840  RNA_def_function_ui_description(func, "Show cache files velocity properties");
1841  api_ui_item_rna_common(func);
1842 
1843  func = RNA_def_function(
1844  srna, "template_cache_file_procedural", "rna_uiTemplateCacheFileProcedural");
1845  RNA_def_function_ui_description(func, "Show cache files render procedural properties");
1847  api_ui_item_rna_common(func);
1848 
1849  func = RNA_def_function(
1850  srna, "template_cache_file_time_settings", "rna_uiTemplateCacheFileTimeSettings");
1851  RNA_def_function_ui_description(func, "Show cache files time settings");
1852  api_ui_item_rna_common(func);
1853 
1854  func = RNA_def_function(srna, "template_cache_file_layers", "rna_uiTemplateCacheFileLayers");
1855  RNA_def_function_ui_description(func, "Show cache files override layers properties");
1857  api_ui_item_rna_common(func);
1858 
1859  func = RNA_def_function(srna, "template_recent_files", "uiTemplateRecentFiles");
1860  RNA_def_function_ui_description(func, "Show list of recently saved .blend files");
1861  RNA_def_int(func, "rows", 5, 1, INT_MAX, "", "Maximum number of items to show", 1, INT_MAX);
1862  parm = RNA_def_int(func, "found", 0, 0, INT_MAX, "", "Number of items drawn", 0, INT_MAX);
1863  RNA_def_function_return(func, parm);
1864 
1865  func = RNA_def_function(srna, "template_file_select_path", "uiTemplateFileSelectPath");
1867  "Item. A text button to set the active file browser path.");
1868  parm = RNA_def_pointer(func, "params", "FileSelectParams", "", "");
1871 
1872  func = RNA_def_function(
1873  srna, "template_event_from_keymap_item", "rna_uiTemplateEventFromKeymapItem");
1874  RNA_def_function_ui_description(func, "Display keymap item as icons/text");
1875  parm = RNA_def_property(func, "item", PROP_POINTER, PROP_NONE);
1876  RNA_def_property_struct_type(parm, "KeyMapItem");
1877  RNA_def_property_ui_text(parm, "Item", "");
1880 
1881  func = RNA_def_function(srna, "template_asset_view", "rna_uiTemplateAssetView");
1882  RNA_def_function_ui_description(func, "Item. A scrollable list of assets in a grid view");
1884  parm = RNA_def_string(func,
1885  "list_id",
1886  NULL,
1887  0,
1888  "",
1889  "Identifier of this asset view. Necessary to tell apart different asset "
1890  "views and to idenify an asset view read from a .blend");
1892  parm = RNA_def_pointer(func,
1893  "asset_library_dataptr",
1894  "AnyType",
1895  "",
1896  "Data from which to take the active asset library property");
1898  parm = RNA_def_string(
1899  func, "asset_library_propname", NULL, 0, "", "Identifier of the asset library property");
1901  parm = RNA_def_pointer(
1902  func, "assets_dataptr", "AnyType", "", "Data from which to take the asset list property");
1904  parm = RNA_def_string(
1905  func, "assets_propname", NULL, 0, "", "Identifier of the asset list property");
1907  parm = RNA_def_pointer(func,
1908  "active_dataptr",
1909  "AnyType",
1910  "",
1911  "Data from which to take the integer property, index of the active item");
1913  parm = RNA_def_string(
1914  func,
1915  "active_propname",
1916  NULL,
1917  0,
1918  "",
1919  "Identifier of the integer property in active_data, index of the active item");
1921  parm = RNA_def_property(func, "filter_id_types", PROP_ENUM, PROP_NONE);
1923  RNA_def_property_enum_funcs(parm, NULL, NULL, "rna_uiTemplateAssetView_filter_id_types_itemf");
1925  RNA_def_enum_flag(func,
1926  "display_options",
1927  asset_view_template_options,
1928  0,
1929  "",
1930  "Displaying options for the asset view");
1931  RNA_def_string(func,
1932  "activate_operator",
1933  NULL,
1934  0,
1935  "",
1936  "Name of a custom operator to invoke when activating an item");
1937  parm = RNA_def_pointer(
1938  func,
1939  "activate_operator_properties",
1940  "OperatorProperties",
1941  "",
1942  "Operator properties to fill in for the custom activate operator passed to the template");
1944  RNA_def_function_output(func, parm);
1945  RNA_def_string(func,
1946  "drag_operator",
1947  NULL,
1948  0,
1949  "",
1950  "Name of a custom operator to invoke when starting to drag an item. Never "
1951  "invoked together with the `active_operator` (if set), it's either the drag or "
1952  "the activate one");
1953  parm = RNA_def_pointer(
1954  func,
1955  "drag_operator_properties",
1956  "OperatorProperties",
1957  "",
1958  "Operator properties to fill in for the custom drag operator passed to the template");
1960  RNA_def_function_output(func, parm);
1961 }
1962 
1963 #endif
void BLI_kdtree_nd_() free(KDTree *tree)
Definition: kdtree_impl.h:102
#define UNUSED(x)
#define ELEM(...)
bool BLT_translate_iface(void)
#define BLT_I18NCONTEXT_DEFAULT
const char * BLT_pgettext(const char *msgctxt, const char *msgid)
#define FILTER_ID_ALL
Definition: DNA_ID.h:939
@ UILST_LAYOUT_DEFAULT
@ RGN_TYPE_WINDOW
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
#define RNA_warning(format,...)
Definition: RNA_access.h:756
@ PARM_RNAPTR
Definition: RNA_types.h:354
@ PARM_REQUIRED
Definition: RNA_types.h:352
@ FUNC_NO_SELF
Definition: RNA_types.h:656
@ FUNC_USE_CONTEXT
Definition: RNA_types.h:662
@ PROP_BOOLEAN
Definition: RNA_types.h:59
@ PROP_ENUM
Definition: RNA_types.h:63
@ PROP_INT
Definition: RNA_types.h:60
@ PROP_POINTER
Definition: RNA_types.h:64
@ PROP_ENUM_FLAG
Definition: RNA_types.h:266
@ PROP_NEVER_NULL
Definition: RNA_types.h:239
@ PROP_COLOR
Definition: RNA_types.h:153
@ PROP_NONE
Definition: RNA_types.h:126
@ PROP_COLOR_GAMMA
Definition: RNA_types.h:165
@ PROP_UNSIGNED
Definition: RNA_types.h:142
#define C
Definition: RandGen.cpp:25
uiLayout * uiLayoutRowWithHeading(uiLayout *layout, bool align, const char *heading)
void uiItemEnumR_string_prop(uiLayout *layout, struct PointerRNA *ptr, struct PropertyRNA *prop, const char *value, const char *name, int icon)
void uiItemFullR_with_popover(uiLayout *layout, struct PointerRNA *ptr, struct PropertyRNA *prop, int index, int value, int flag, const char *name, int icon, const char *panel_type)
void uiItemPopoverPanelFromGroup(uiLayout *layout, struct bContext *C, int space_id, int region_id, const char *context, const char *category)
uiLayout * uiLayoutColumnWithHeading(uiLayout *layout, bool align, const char *heading)
void uiTemplateCacheFileLayers(uiLayout *layout, const struct bContext *C, struct PointerRNA *fileptr)
void uiTemplatePathBuilder(uiLayout *layout, struct PointerRNA *ptr, const char *propname, struct PointerRNA *root_ptr, const char *text)
void uiTemplateCacheFileVelocity(uiLayout *layout, struct PointerRNA *fileptr)
void uiItemL(uiLayout *layout, const char *name, int icon)
void uiItemFullR_with_menu(uiLayout *layout, struct PointerRNA *ptr, struct PropertyRNA *prop, int index, int value, int flag, const char *name, int icon, const char *menu_type)
void uiItemMenuEnumFullO_ptr(uiLayout *layout, struct bContext *C, struct wmOperatorType *ot, const char *propname, const char *name, int icon, struct PointerRNA *r_opptr)
void uiTemplateCacheFileProcedural(uiLayout *layout, const struct bContext *C, struct PointerRNA *fileptr)
void uiItemFullOMenuHold_ptr(uiLayout *layout, struct wmOperatorType *ot, const char *name, int icon, struct IDProperty *properties, wmOperatorCallContext context, int flag, const char *menu_id, struct PointerRNA *r_opptr)
void uiItemPopoverPanel(uiLayout *layout, const struct bContext *C, const char *panel_type, const char *name, int icon)
void uiItemFullO_ptr(uiLayout *layout, struct wmOperatorType *ot, const char *name, int icon, struct IDProperty *properties, wmOperatorCallContext context, int flag, struct PointerRNA *r_opptr)
#define UI_UL_DEFAULT_CLASS_NAME
@ UI_ITEM_R_EVENT
@ UI_ITEM_R_TOGGLE
@ UI_ITEM_O_DEPRESS
@ UI_ITEM_R_ICON_NEVER
@ UI_ITEM_R_EXPAND
@ UI_ITEM_R_NO_BG
@ UI_ITEM_R_CHECKBOX_INVERT
@ UI_ITEM_R_ICON_ONLY
@ UI_ITEM_R_FULL_EVENT
@ UI_ITEM_R_SLIDER
@ UI_TEMPLATE_ASSET_DRAW_NO_NAMES
@ UI_TEMPLATE_ASSET_DRAW_NO_LIBRARY
@ UI_TEMPLATE_ASSET_DRAW_NO_FILTER
void uiItemMContents(uiLayout *layout, const char *menuname)
int uiLayoutGetOperatorContext(uiLayout *layout)
bool uiTemplateCacheFilePointer(struct PointerRNA *ptr, const char *propname, struct PointerRNA *r_file_ptr)
void uiItemPointerR_prop(uiLayout *layout, struct PointerRNA *ptr, struct PropertyRNA *prop, struct PointerRNA *searchptr, struct PropertyRNA *searchprop, const char *name, int icon, bool results_are_suggestions)
void uiItemTabsEnumR_prop(uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, struct PropertyRNA *prop, struct PointerRNA *ptr_highlight, struct PropertyRNA *prop_highlight, bool icon_only)
void uiTemplateAssetView(struct uiLayout *layout, struct bContext *C, const char *list_id, struct PointerRNA *asset_library_dataptr, const char *asset_library_propname, struct PointerRNA *assets_dataptr, const char *assets_propname, struct PointerRNA *active_dataptr, const char *active_propname, const struct AssetFilterSettings *filter_settings, int display_flags, const char *activate_opname, struct PointerRNA *r_activate_op_properties, const char *drag_opname, struct PointerRNA *r_drag_op_properties)
void uiTemplateCacheFileTimeSettings(uiLayout *layout, struct PointerRNA *fileptr)
bool uiTemplateEventFromKeymapItem(struct uiLayout *layout, const char *text, const struct wmKeyMapItem *kmi, bool text_fallback)
void uiTemplateList(uiLayout *layout, struct bContext *C, const char *listtype_name, const char *list_id, struct PointerRNA *dataptr, const char *propname, struct PointerRNA *active_dataptr, const char *active_propname, const char *item_dyntip_propname, int rows, int maxrows, int layout_type, int columns, enum uiTemplateListFlags flags)
void uiItemMenuEnumR_prop(uiLayout *layout, struct PointerRNA *ptr, struct PropertyRNA *prop, const char *name, int icon)
void uiTemplateID(uiLayout *layout, const struct bContext *C, struct PointerRNA *ptr, const char *propname, const char *newop, const char *openop, const char *unlinkop, int filter, bool live_icon, const char *text)
void uiTemplateAnyID(uiLayout *layout, struct PointerRNA *ptr, const char *propname, const char *proptypename, const char *text)
void uiItemFullR(uiLayout *layout, struct PointerRNA *ptr, struct PropertyRNA *prop, int index, int value, int flag, const char *name, int icon)
void uiTemplateCacheFile(uiLayout *layout, const struct bContext *C, struct PointerRNA *ptr, const char *propname)
#define UI_MAX_NAME_STR
Definition: UI_interface.h:92
@ UI_TEMPLATE_ID_FILTER_AVAILABLE
@ UI_TEMPLATE_ID_FILTER_ALL
@ UI_TEMPLATE_LIST_SORT_LOCK
@ UI_TEMPLATE_LIST_SORT_REVERSE
@ UI_TEMPLATE_LIST_FLAG_NONE
void uiItemsFullEnumO(uiLayout *layout, const char *opname, const char *propname, struct IDProperty *properties, wmOperatorCallContext context, int flag)
void uiItemM(uiLayout *layout, const char *menuname, const char *name, int icon)
int UI_icon_from_rnaptr(const struct bContext *C, struct PointerRNA *ptr, int rnaicon, bool big)
SyclQueue void void size_t num_bytes void
DO_INLINE void filter(lfVector *V, fmatrix3x3 *S)
void(* MEM_freeN)(void *vmemh)
Definition: mallocn.c:27
const struct IDFilterEnumPropertyItem rna_enum_id_type_filter_items[]
Definition: rna_ID.c:119
const char * RNA_struct_identifier(const StructRNA *type)
Definition: rna_access.c:586
bool RNA_property_array_check(PropertyRNA *prop)
Definition: rna_access.c:1080
int RNA_enum_from_identifier(const EnumPropertyItem *item, const char *identifier)
Definition: rna_access.c:1714
PropertyType RNA_property_type(PropertyRNA *prop)
Definition: rna_access.c:1010
const PointerRNA PointerRNA_NULL
Definition: rna_access.c:61
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
Definition: rna_access.c:717
void RNA_property_enum_items_gettexted(bContext *C, PointerRNA *ptr, PropertyRNA *prop, const EnumPropertyItem **r_item, int *r_totitem, bool *r_free)
Definition: rna_access.c:1560
const char * RNA_property_translation_context(const PropertyRNA *prop)
Definition: rna_access.c:1895
int RNA_struct_ui_icon(const StructRNA *type)
Definition: rna_access.c:601
bool RNA_pointer_is_null(const PointerRNA *ptr)
Definition: rna_access.c:164
PropertySubType RNA_property_subtype(PropertyRNA *prop)
Definition: rna_access.c:1015
const char * RNA_struct_translation_context(const StructRNA *type)
Definition: rna_access.c:619
void RNA_property_enum_items(bContext *C, PointerRNA *ptr, PropertyRNA *prop, const EnumPropertyItem **r_item, int *r_totitem, bool *r_free)
Definition: rna_access.c:1495
static const EnumPropertyItem curve_type_items[]
Definition: rna_curve.c:126
PropertyRNA * RNA_def_float(StructOrFunctionRNA *cont_, const char *identifier, float default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax)
Definition: rna_define.c:3836
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, bool default_value, const char *ui_name, const char *ui_description)
Definition: rna_define.c:3493
PropertyRNA * RNA_def_enum_flag(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description)
Definition: rna_define.c:3806
PropertyRNA * RNA_def_pointer(StructOrFunctionRNA *cont_, const char *identifier, const char *type, const char *ui_name, const char *ui_description)
Definition: rna_define.c:4170
void RNA_def_function_return(FunctionRNA *func, PropertyRNA *ret)
Definition: rna_define.c:4312
PropertyRNA * RNA_def_float_array(StructOrFunctionRNA *cont_, const char *identifier, int len, const float *default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax)
Definition: rna_define.c:4076
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
Definition: rna_define.c:1645
FunctionRNA * RNA_def_function(StructRNA *srna, const char *identifier, const char *call)
Definition: rna_define.c:4273
void RNA_def_function_output(FunctionRNA *UNUSED(func), PropertyRNA *ret)
Definition: rna_define.c:4337
void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
Definition: rna_define.c:1872
void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
Definition: rna_define.c:1772
void RNA_def_function_ui_description(FunctionRNA *func, const char *description)
Definition: rna_define.c:4347
void RNA_def_property_enum_funcs(PropertyRNA *prop, const char *get, const char *set, const char *item)
Definition: rna_define.c:3224
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier, int type, int subtype)
Definition: rna_define.c:1257
void RNA_enum_item_end(EnumPropertyItem **items, int *totitem)
Definition: rna_define.c:4487
void RNA_def_function_flag(FunctionRNA *func, int flag)
Definition: rna_define.c:4342
void RNA_def_property_clear_flag(PropertyRNA *prop, PropertyFlag flag)
Definition: rna_define.c:1495
void RNA_enum_item_add(EnumPropertyItem **items, int *totitem, const EnumPropertyItem *item)
Definition: rna_define.c:4436
PropertyRNA * RNA_def_string(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, int maxlen, const char *ui_name, const char *ui_description)
Definition: rna_define.c:3687
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
Definition: rna_define.c:1490
PropertyRNA * RNA_def_int(StructOrFunctionRNA *cont_, const char *identifier, int default_value, int hardmin, int hardmax, const char *ui_name, const char *ui_description, int softmin, int softmax)
Definition: rna_define.c:3597
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description)
Definition: rna_define.c:3783
void RNA_def_parameter_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
Definition: rna_define.c:1518
const char * rna_translate_ui_text(const char *text, const char *text_ctxt, struct StructRNA *type, struct PropertyRNA *prop, bool translate)
const EnumPropertyItem DummyRNA_NULL_items[]
Definition: rna_rna.c:26
const EnumPropertyItem rna_enum_region_type_items[]
Definition: rna_screen.c:21
const EnumPropertyItem rna_enum_space_type_items[]
Definition: rna_space.c:86
const EnumPropertyItem rna_enum_uilist_layout_type_items[]
Definition: rna_ui.c:46
static void api_ui_item_common_text(FunctionRNA *func)
Definition: rna_ui_api.c:854
static void api_ui_item_common(FunctionRNA *func)
Definition: rna_ui_api.c:867
static void api_ui_item_rna_common(FunctionRNA *func)
Definition: rna_ui_api.c:891
static void api_ui_item_op(FunctionRNA *func)
Definition: rna_ui_api.c:878
static void api_ui_item_op_common(FunctionRNA *func)
Definition: rna_ui_api.c:885
static void api_ui_item_common_heading(FunctionRNA *func)
Definition: rna_ui_api.c:836
const EnumPropertyItem rna_enum_icon_items[]
Definition: rna_ui_api.c:30
void RNA_api_ui_layout(StructRNA *srna)
Definition: rna_ui_api.c:901
const char * identifier
Definition: RNA_types.h:461
const char * name
Definition: RNA_types.h:465
const char * description
Definition: RNA_types.h:467
struct StructRNA * type
Definition: RNA_types.h:37
struct StructRNA * srna
Definition: WM_types.h:969
PointerRNA * ptr
Definition: wm_files.c:3480
wmOperatorType * ot
Definition: wm_files.c:3479
wmOperatorType * WM_operatortype_find(const char *idname, bool quiet)