Blender  V2.93
rna_ui_api.c
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2009 Blender Foundation.
17  * All rights reserved.
18  */
19 
24 #include <stdio.h>
25 #include <stdlib.h>
26 
27 #include "BLI_utildefines.h"
28 
29 #include "BLT_translation.h"
30 
31 #include "RNA_define.h"
32 #include "RNA_enum_types.h"
33 
34 #include "DNA_screen_types.h"
35 
36 #include "UI_interface.h"
37 #include "UI_interface_icons.h"
38 #include "UI_resources.h"
39 
40 #include "rna_internal.h"
41 
42 #define DEF_ICON(name) {ICON_##name, (#name), 0, (#name), ""},
43 #define DEF_ICON_VECTOR(name) {ICON_##name, (#name), 0, (#name), ""},
44 #define DEF_ICON_COLOR(name) {ICON_##name, (#name), 0, (#name), ""},
45 #define DEF_ICON_BLANK(name)
47 #include "UI_icons.h"
48  {0, NULL, 0, NULL, NULL},
49 };
50 
51 #ifdef RNA_RUNTIME
52 
53 const char *rna_translate_ui_text(
54  const char *text, const char *text_ctxt, StructRNA *type, PropertyRNA *prop, bool translate)
55 {
56  /* Also return text if UI labels translation is disabled. */
57  if (!text || !text[0] || !translate || !BLT_translate_iface()) {
58  return text;
59  }
60 
61  /* If a text_ctxt is specified, use it! */
62  if (text_ctxt && text_ctxt[0]) {
63  return BLT_pgettext(text_ctxt, text);
64  }
65 
66  /* Else, if an RNA type or property is specified, use its context. */
67 # if 0
68  /* XXX Disabled for now. Unfortunately, their is absolutely no way from py code to get the RNA
69  * struct corresponding to the 'data' (in functions like prop() & co),
70  * as this is pure runtime data. Hence, messages extraction script can't determine the
71  * correct context it should use for such 'text' messages...
72  * So for now, one have to explicitly specify the 'text_ctxt' when using prop() etc.
73  * functions, if default context is not suitable.
74  */
75  if (prop) {
77  }
78 # else
79  (void)prop;
80 # endif
81  if (type) {
83  }
84 
85  /* Else, default context! */
87 }
88 
89 static void rna_uiItemR(uiLayout *layout,
90  PointerRNA *ptr,
91  const char *propname,
92  const char *name,
93  const char *text_ctxt,
94  bool translate,
95  int icon,
96  bool expand,
97  bool slider,
98  int toggle,
99  bool icon_only,
100  bool event,
101  bool full_event,
102  bool emboss,
103  int index,
104  int icon_value,
105  bool invert_checkbox)
106 {
107  PropertyRNA *prop = RNA_struct_find_property(ptr, propname);
108  int flag = 0;
109 
110  if (!prop) {
111  RNA_warning("property not found: %s.%s", RNA_struct_identifier(ptr->type), propname);
112  return;
113  }
114 
115  if (icon_value && !icon) {
116  icon = icon_value;
117  }
118 
119  /* Get translated name (label). */
120  name = rna_translate_ui_text(name, text_ctxt, NULL, prop, translate);
121 
122  flag |= (slider) ? UI_ITEM_R_SLIDER : 0;
123  flag |= (expand) ? UI_ITEM_R_EXPAND : 0;
124  if (toggle == 1) {
125  flag |= UI_ITEM_R_TOGGLE;
126  }
127  else if (toggle == 0) {
128  flag |= UI_ITEM_R_ICON_NEVER;
129  }
130  flag |= (icon_only) ? UI_ITEM_R_ICON_ONLY : 0;
131  flag |= (event) ? UI_ITEM_R_EVENT : 0;
132  flag |= (full_event) ? UI_ITEM_R_FULL_EVENT : 0;
133  flag |= (emboss) ? 0 : UI_ITEM_R_NO_BG;
134  flag |= (invert_checkbox) ? UI_ITEM_R_CHECKBOX_INVERT : 0;
135 
136  uiItemFullR(layout, ptr, prop, index, 0, flag, name, icon);
137 }
138 
139 static void rna_uiItemR_with_popover(uiLayout *layout,
140  struct PointerRNA *ptr,
141  const char *propname,
142  const char *name,
143  const char *text_ctxt,
144  bool translate,
145  int icon,
146  bool icon_only,
147  const char *panel_type)
148 {
149  PropertyRNA *prop = RNA_struct_find_property(ptr, propname);
150 
151  if (!prop) {
152  RNA_warning("property not found: %s.%s", RNA_struct_identifier(ptr->type), propname);
153  return;
154  }
155  if ((RNA_property_type(prop) != PROP_ENUM) &&
157  RNA_warning(
158  "property is not an enum or color: %s.%s", RNA_struct_identifier(ptr->type), propname);
159  return;
160  }
161  int flag = 0;
162 
163  flag |= (icon_only) ? UI_ITEM_R_ICON_ONLY : 0;
164 
165  /* Get translated name (label). */
166  name = rna_translate_ui_text(name, text_ctxt, NULL, prop, translate);
167  uiItemFullR_with_popover(layout, ptr, prop, -1, 0, flag, name, icon, panel_type);
168 }
169 
170 static void rna_uiItemR_with_menu(uiLayout *layout,
171  struct PointerRNA *ptr,
172  const char *propname,
173  const char *name,
174  const char *text_ctxt,
175  bool translate,
176  int icon,
177  bool icon_only,
178  const char *menu_type)
179 {
180  PropertyRNA *prop = RNA_struct_find_property(ptr, propname);
181 
182  if (!prop) {
183  RNA_warning("property not found: %s.%s", RNA_struct_identifier(ptr->type), propname);
184  return;
185  }
186  if (RNA_property_type(prop) != PROP_ENUM) {
187  RNA_warning("property is not an enum: %s.%s", RNA_struct_identifier(ptr->type), propname);
188  return;
189  }
190  int flag = 0;
191 
192  flag |= (icon_only) ? UI_ITEM_R_ICON_ONLY : 0;
193 
194  /* Get translated name (label). */
195  name = rna_translate_ui_text(name, text_ctxt, NULL, prop, translate);
196  uiItemFullR_with_menu(layout, ptr, prop, -1, 0, flag, name, icon, menu_type);
197 }
198 
199 static void rna_uiItemMenuEnumR(uiLayout *layout,
200  struct PointerRNA *ptr,
201  const char *propname,
202  const char *name,
203  const char *text_ctxt,
204  bool translate,
205  int icon)
206 {
207  PropertyRNA *prop = RNA_struct_find_property(ptr, propname);
208 
209  if (!prop) {
210  RNA_warning("property not found: %s.%s", RNA_struct_identifier(ptr->type), propname);
211  return;
212  }
213 
214  /* Get translated name (label). */
215  name = rna_translate_ui_text(name, text_ctxt, NULL, prop, translate);
216  uiItemMenuEnumR_prop(layout, ptr, prop, name, icon);
217 }
218 
219 static void rna_uiItemTabsEnumR(uiLayout *layout,
220  bContext *C,
221  struct PointerRNA *ptr,
222  const char *propname,
223  struct PointerRNA *ptr_highlight,
224  const char *propname_highlight,
225  bool icon_only)
226 {
227  PropertyRNA *prop = RNA_struct_find_property(ptr, propname);
228 
229  if (!prop) {
230  RNA_warning("property not found: %s.%s", RNA_struct_identifier(ptr->type), propname);
231  return;
232  }
233  if (RNA_property_type(prop) != PROP_ENUM) {
234  RNA_warning("property is not an enum: %s.%s", RNA_struct_identifier(ptr->type), propname);
235  return;
236  }
237 
238  /* Get the highlight property used to gray out some of the tabs. */
239  PropertyRNA *prop_highlight = NULL;
240  if (!RNA_pointer_is_null(ptr_highlight)) {
241  prop_highlight = RNA_struct_find_property(ptr_highlight, propname_highlight);
242  if (!prop_highlight) {
243  RNA_warning("property not found: %s.%s",
244  RNA_struct_identifier(ptr_highlight->type),
245  propname_highlight);
246  return;
247  }
248  if (RNA_property_type(prop_highlight) != PROP_BOOLEAN) {
249  RNA_warning("property is not a boolean: %s.%s",
250  RNA_struct_identifier(ptr_highlight->type),
251  propname_highlight);
252  return;
253  }
254  if (!RNA_property_array_check(prop_highlight)) {
255  RNA_warning("property is not an array: %s.%s",
256  RNA_struct_identifier(ptr_highlight->type),
257  propname_highlight);
258  return;
259  }
260  }
261 
262  uiItemTabsEnumR_prop(layout, C, ptr, prop, ptr_highlight, prop_highlight, icon_only);
263 }
264 
265 static void rna_uiItemEnumR_string(uiLayout *layout,
266  struct PointerRNA *ptr,
267  const char *propname,
268  const char *value,
269  const char *name,
270  const char *text_ctxt,
271  bool translate,
272  int icon)
273 {
274  PropertyRNA *prop = RNA_struct_find_property(ptr, propname);
275 
276  if (!prop) {
277  RNA_warning("property not found: %s.%s", RNA_struct_identifier(ptr->type), propname);
278  return;
279  }
280 
281  /* Get translated name (label). */
282  name = rna_translate_ui_text(name, text_ctxt, NULL, prop, translate);
283 
284  uiItemEnumR_string_prop(layout, ptr, prop, value, name, icon);
285 }
286 
287 static void rna_uiItemPointerR(uiLayout *layout,
288  struct PointerRNA *ptr,
289  const char *propname,
290  struct PointerRNA *searchptr,
291  const char *searchpropname,
292  const char *name,
293  const char *text_ctxt,
294  bool translate,
295  int icon)
296 {
297  PropertyRNA *prop = RNA_struct_find_property(ptr, propname);
298  if (!prop) {
299  RNA_warning("property not found: %s.%s", RNA_struct_identifier(ptr->type), propname);
300  return;
301  }
302  PropertyRNA *searchprop = RNA_struct_find_property(searchptr, searchpropname);
303  if (!searchprop) {
304  RNA_warning(
305  "property not found: %s.%s", RNA_struct_identifier(searchptr->type), searchpropname);
306  return;
307  }
308 
309  /* Get translated name (label). */
310  name = rna_translate_ui_text(name, text_ctxt, NULL, prop, translate);
311 
312  uiItemPointerR_prop(layout, ptr, prop, searchptr, searchprop, name, icon);
313 }
314 
315 static PointerRNA rna_uiItemO(uiLayout *layout,
316  const char *opname,
317  const char *name,
318  const char *text_ctxt,
319  bool translate,
320  int icon,
321  bool emboss,
322  bool depress,
323  int icon_value)
324 {
326 
327  ot = WM_operatortype_find(opname, 0); /* print error next */
328  if (!ot || !ot->srna) {
329  RNA_warning("%s '%s'", ot ? "unknown operator" : "operator missing srna", opname);
330  return PointerRNA_NULL;
331  }
332 
333  /* Get translated name (label). */
334  name = rna_translate_ui_text(name, text_ctxt, ot->srna, NULL, translate);
335 
336  if (icon_value && !icon) {
337  icon = icon_value;
338  }
339  int flag = (emboss) ? 0 : UI_ITEM_R_NO_BG;
340  flag |= (depress) ? UI_ITEM_O_DEPRESS : 0;
341 
342  PointerRNA opptr;
343  uiItemFullO_ptr(layout, ot, name, icon, NULL, uiLayoutGetOperatorContext(layout), flag, &opptr);
344  return opptr;
345 }
346 
347 static PointerRNA rna_uiItemOMenuHold(uiLayout *layout,
348  const char *opname,
349  const char *name,
350  const char *text_ctxt,
351  bool translate,
352  int icon,
353  bool emboss,
354  bool depress,
355  int icon_value,
356  const char *menu)
357 {
358  wmOperatorType *ot = WM_operatortype_find(opname, 0); /* print error next */
359  if (!ot || !ot->srna) {
360  RNA_warning("%s '%s'", ot ? "unknown operator" : "operator missing srna", opname);
361  return PointerRNA_NULL;
362  }
363 
364  /* Get translated name (label). */
365  name = rna_translate_ui_text(name, text_ctxt, ot->srna, NULL, translate);
366  if (icon_value && !icon) {
367  icon = icon_value;
368  }
369  int flag = (emboss) ? 0 : UI_ITEM_R_NO_BG;
370  flag |= (depress) ? UI_ITEM_O_DEPRESS : 0;
371 
372  PointerRNA opptr;
374  layout, ot, name, icon, NULL, uiLayoutGetOperatorContext(layout), flag, menu, &opptr);
375  return opptr;
376 }
377 
378 static void rna_uiItemsEnumO(uiLayout *layout,
379  const char *opname,
380  const char *propname,
381  const bool icon_only)
382 {
383  int flag = icon_only ? UI_ITEM_R_ICON_ONLY : 0;
384  uiItemsFullEnumO(layout, opname, propname, NULL, uiLayoutGetOperatorContext(layout), flag);
385 }
386 
387 static void rna_uiItemMenuEnumO(uiLayout *layout,
388  bContext *C,
389  const char *opname,
390  const char *propname,
391  const char *name,
392  const char *text_ctxt,
393  bool translate,
394  int icon)
395 {
396  wmOperatorType *ot = WM_operatortype_find(opname, 0); /* print error next */
397 
398  if (!ot || !ot->srna) {
399  RNA_warning("%s '%s'", ot ? "unknown operator" : "operator missing srna", opname);
400  return;
401  }
402 
403  /* Get translated name (label). */
404  name = rna_translate_ui_text(name, text_ctxt, ot->srna, NULL, translate);
405 
406  uiItemMenuEnumO_ptr(layout, C, ot, propname, name, icon);
407 }
408 
409 static void rna_uiItemL(uiLayout *layout,
410  const char *name,
411  const char *text_ctxt,
412  bool translate,
413  int icon,
414  int icon_value)
415 {
416  /* Get translated name (label). */
417  name = rna_translate_ui_text(name, text_ctxt, NULL, NULL, translate);
418 
419  if (icon_value && !icon) {
420  icon = icon_value;
421  }
422 
423  uiItemL(layout, name, icon);
424 }
425 
426 static void rna_uiItemM(uiLayout *layout,
427  const char *menuname,
428  const char *name,
429  const char *text_ctxt,
430  bool translate,
431  int icon,
432  int icon_value)
433 {
434  /* Get translated name (label). */
435  name = rna_translate_ui_text(name, text_ctxt, NULL, NULL, translate);
436 
437  if (icon_value && !icon) {
438  icon = icon_value;
439  }
440 
441  uiItemM(layout, menuname, name, icon);
442 }
443 
444 static void rna_uiItemM_contents(uiLayout *layout, const char *menuname)
445 {
446  uiItemMContents(layout, menuname);
447 }
448 
449 static void rna_uiItemPopoverPanel(uiLayout *layout,
450  bContext *C,
451  const char *panel_type,
452  const char *name,
453  const char *text_ctxt,
454  bool translate,
455  int icon,
456  int icon_value)
457 {
458  /* Get translated name (label). */
459  name = rna_translate_ui_text(name, text_ctxt, NULL, NULL, translate);
460 
461  if (icon_value && !icon) {
462  icon = icon_value;
463  }
464 
465  uiItemPopoverPanel(layout, C, panel_type, name, icon);
466 }
467 
468 static void rna_uiItemPopoverPanelFromGroup(uiLayout *layout,
469  bContext *C,
470  int space_id,
471  int region_id,
472  const char *context,
473  const char *category)
474 {
475  uiItemPopoverPanelFromGroup(layout, C, space_id, region_id, context, category);
476 }
477 
478 static void rna_uiTemplateID(uiLayout *layout,
479  bContext *C,
480  PointerRNA *ptr,
481  const char *propname,
482  const char *newop,
483  const char *openop,
484  const char *unlinkop,
485  int filter,
486  const bool live_icon,
487  const char *name,
488  const char *text_ctxt,
489  bool translate)
490 {
491  PropertyRNA *prop = RNA_struct_find_property(ptr, propname);
492 
493  if (!prop) {
494  RNA_warning("property not found: %s.%s", RNA_struct_identifier(ptr->type), propname);
495  return;
496  }
497 
498  /* Get translated name (label). */
499  name = rna_translate_ui_text(name, text_ctxt, NULL, prop, translate);
500 
501  uiTemplateID(layout, C, ptr, propname, newop, openop, unlinkop, filter, live_icon, name);
502 }
503 
504 static void rna_uiTemplateAnyID(uiLayout *layout,
505  PointerRNA *ptr,
506  const char *propname,
507  const char *proptypename,
508  const char *name,
509  const char *text_ctxt,
510  bool translate)
511 {
512  PropertyRNA *prop = RNA_struct_find_property(ptr, propname);
513 
514  if (!prop) {
515  RNA_warning("property not found: %s.%s", RNA_struct_identifier(ptr->type), propname);
516  return;
517  }
518 
519  /* Get translated name (label). */
520  name = rna_translate_ui_text(name, text_ctxt, NULL, prop, translate);
521 
522  /* XXX This will search property again :( */
523  uiTemplateAnyID(layout, ptr, propname, proptypename, name);
524 }
525 
526 static void rna_uiTemplateCacheFile(uiLayout *layout,
527  bContext *C,
528  PointerRNA *ptr,
529  const char *propname)
530 {
531  PropertyRNA *prop = RNA_struct_find_property(ptr, propname);
532 
533  if (!prop) {
534  RNA_warning("property not found: %s.%s", RNA_struct_identifier(ptr->type), propname);
535  return;
536  }
537 
538  uiTemplateCacheFile(layout, C, ptr, propname);
539 }
540 
541 static void rna_uiTemplatePathBuilder(uiLayout *layout,
542  PointerRNA *ptr,
543  const char *propname,
544  PointerRNA *root_ptr,
545  const char *name,
546  const char *text_ctxt,
547  bool translate)
548 {
549  PropertyRNA *prop = RNA_struct_find_property(ptr, propname);
550 
551  if (!prop) {
552  RNA_warning("property not found: %s.%s", RNA_struct_identifier(ptr->type), propname);
553  return;
554  }
555 
556  /* Get translated name (label). */
557  name = rna_translate_ui_text(name, text_ctxt, NULL, prop, translate);
558 
559  /* XXX This will search property again :( */
560  uiTemplatePathBuilder(layout, ptr, propname, root_ptr, name);
561 }
562 
563 static void rna_uiTemplateEventFromKeymapItem(
564  uiLayout *layout, wmKeyMapItem *kmi, const char *name, const char *text_ctxt, bool translate)
565 {
566  /* Get translated name (label). */
567  name = rna_translate_ui_text(name, text_ctxt, NULL, NULL, translate);
568  uiTemplateEventFromKeymapItem(layout, name, kmi, true);
569 }
570 
571 static uiLayout *rna_uiLayoutRowWithHeading(
572  uiLayout *layout, bool align, const char *heading, const char *heading_ctxt, bool translate)
573 {
574  /* Get translated heading. */
575  heading = rna_translate_ui_text(heading, heading_ctxt, NULL, NULL, translate);
576  return uiLayoutRowWithHeading(layout, align, heading);
577 }
578 
579 static uiLayout *rna_uiLayoutColumnWithHeading(
580  uiLayout *layout, bool align, const char *heading, const char *heading_ctxt, bool translate)
581 {
582  /* Get translated heading. */
583  heading = rna_translate_ui_text(heading, heading_ctxt, NULL, NULL, translate);
584  return uiLayoutColumnWithHeading(layout, align, heading);
585 }
586 
587 static int rna_ui_get_rnaptr_icon(bContext *C, PointerRNA *ptr_icon)
588 {
589  return UI_icon_from_rnaptr(C, ptr_icon, RNA_struct_ui_icon(ptr_icon->type), false);
590 }
591 
592 static const char *rna_ui_get_enum_name(bContext *C,
593  PointerRNA *ptr,
594  const char *propname,
595  const char *identifier)
596 {
597  PropertyRNA *prop = NULL;
598  const EnumPropertyItem *items = NULL;
599  bool free;
600  const char *name = "";
601 
602  prop = RNA_struct_find_property(ptr, propname);
603  if (!prop || (RNA_property_type(prop) != PROP_ENUM)) {
604  RNA_warning(
605  "Property not found or not an enum: %s.%s", RNA_struct_identifier(ptr->type), propname);
606  return name;
607  }
608 
609  RNA_property_enum_items_gettexted(C, ptr, prop, &items, NULL, &free);
610 
611  if (items) {
612  const int index = RNA_enum_from_identifier(items, identifier);
613  if (index != -1) {
614  name = items[index].name;
615  }
616  if (free) {
617  MEM_freeN((void *)items);
618  }
619  }
620 
621  return name;
622 }
623 
624 static const char *rna_ui_get_enum_description(bContext *C,
625  PointerRNA *ptr,
626  const char *propname,
627  const char *identifier)
628 {
629  PropertyRNA *prop = NULL;
630  const EnumPropertyItem *items = NULL;
631  bool free;
632  const char *desc = "";
633 
634  prop = RNA_struct_find_property(ptr, propname);
635  if (!prop || (RNA_property_type(prop) != PROP_ENUM)) {
636  RNA_warning(
637  "Property not found or not an enum: %s.%s", RNA_struct_identifier(ptr->type), propname);
638  return desc;
639  }
640 
641  RNA_property_enum_items_gettexted(C, ptr, prop, &items, NULL, &free);
642 
643  if (items) {
644  const int index = RNA_enum_from_identifier(items, identifier);
645  if (index != -1) {
646  desc = items[index].description;
647  }
648  if (free) {
649  MEM_freeN((void *)items);
650  }
651  }
652 
653  return desc;
654 }
655 
656 static int rna_ui_get_enum_icon(bContext *C,
657  PointerRNA *ptr,
658  const char *propname,
659  const char *identifier)
660 {
661  PropertyRNA *prop = NULL;
662  const EnumPropertyItem *items = NULL;
663  bool free;
664  int icon = ICON_NONE;
665 
666  prop = RNA_struct_find_property(ptr, propname);
667  if (!prop || (RNA_property_type(prop) != PROP_ENUM)) {
668  RNA_warning(
669  "Property not found or not an enum: %s.%s", RNA_struct_identifier(ptr->type), propname);
670  return icon;
671  }
672 
673  RNA_property_enum_items(C, ptr, prop, &items, NULL, &free);
674 
675  if (items) {
676  const int index = RNA_enum_from_identifier(items, identifier);
677  if (index != -1) {
678  icon = items[index].icon;
679  }
680  if (free) {
681  MEM_freeN((void *)items);
682  }
683  }
684 
685  return icon;
686 }
687 
688 #else
689 
691 {
692  RNA_def_string(func,
693  "heading",
694  NULL,
696  "Heading",
697  "Label to insert into the layout for this sub-layout");
698  RNA_def_string(func,
699  "heading_ctxt",
700  NULL,
701  0,
702  "",
703  "Override automatic translation context of the given heading");
705  func, "translate", true, "", "Translate the given heading, when UI translation is enabled");
706 }
707 
709 {
710  PropertyRNA *prop;
711 
712  prop = RNA_def_string(func, "text", NULL, 0, "", "Override automatic text of the item");
714  prop = RNA_def_string(
715  func, "text_ctxt", NULL, 0, "", "Override automatic translation context of the given text");
718  func, "translate", true, "", "Translate the given text, when UI translation is enabled");
719 }
720 
721 static void api_ui_item_common(FunctionRNA *func)
722 {
723  PropertyRNA *prop;
724 
726 
727  prop = RNA_def_property(func, "icon", PROP_ENUM, PROP_NONE);
729  RNA_def_property_ui_text(prop, "Icon", "Override automatic icon of the item");
730 }
731 
732 static void api_ui_item_op(FunctionRNA *func)
733 {
734  PropertyRNA *parm;
735  parm = RNA_def_string(func, "operator", NULL, 0, "", "Identifier of the operator");
737 }
738 
740 {
741  api_ui_item_op(func);
742  api_ui_item_common(func);
743 }
744 
746 {
747  PropertyRNA *parm;
748 
749  parm = RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take property");
751  parm = RNA_def_string(func, "property", NULL, 0, "", "Identifier of property in data");
753 }
754 
756 {
757  FunctionRNA *func;
758  PropertyRNA *parm;
759 
760  static const EnumPropertyItem curve_type_items[] = {
761  {0, "NONE", 0, "None", ""},
762  {'v', "VECTOR", 0, "Vector", ""},
763  {'c', "COLOR", 0, "Color", ""},
764  {'h', "HUE", 0, "Hue", ""},
765  {0, NULL, 0, NULL, NULL},
766  };
767 
768  static const EnumPropertyItem id_template_filter_items[] = {
769  {UI_TEMPLATE_ID_FILTER_ALL, "ALL", 0, "All", ""},
770  {UI_TEMPLATE_ID_FILTER_AVAILABLE, "AVAILABLE", 0, "Available", ""},
771  {0, NULL, 0, NULL, NULL},
772  };
773 
774  static float node_socket_color_default[] = {0.0f, 0.0f, 0.0f, 1.0f};
775 
776  /* simple layout specifiers */
777  func = RNA_def_function(srna, "row", "rna_uiLayoutRowWithHeading");
778  parm = RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in");
779  RNA_def_function_return(func, parm);
781  func,
782  "Sub-layout. Items placed in this sublayout are placed next to each other "
783  "in a row");
784  RNA_def_boolean(func, "align", false, "", "Align buttons to each other");
786 
787  func = RNA_def_function(srna, "column", "rna_uiLayoutColumnWithHeading");
788  parm = RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in");
789  RNA_def_function_return(func, parm);
791  func,
792  "Sub-layout. Items placed in this sublayout are placed under each other "
793  "in a column");
794  RNA_def_boolean(func, "align", false, "", "Align buttons to each other");
796 
797  func = RNA_def_function(srna, "column_flow", "uiLayoutColumnFlow");
798  RNA_def_int(func, "columns", 0, 0, INT_MAX, "", "Number of columns, 0 is automatic", 0, INT_MAX);
799  parm = RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in");
800  RNA_def_function_return(func, parm);
801  RNA_def_boolean(func, "align", false, "", "Align buttons to each other");
802 
803  func = RNA_def_function(srna, "grid_flow", "uiLayoutGridFlow");
804  RNA_def_boolean(func, "row_major", false, "", "Fill row by row, instead of column by column");
805  RNA_def_int(
806  func,
807  "columns",
808  0,
809  INT_MIN,
810  INT_MAX,
811  "",
812  "Number of columns, positive are absolute fixed numbers, 0 is automatic, negative are "
813  "automatic multiple numbers along major axis (e.g. -2 will only produce 2, 4, 6 etc. "
814  "columns for row major layout, and 2, 4, 6 etc. rows for column major layout)",
815  INT_MIN,
816  INT_MAX);
817  RNA_def_boolean(func, "even_columns", false, "", "All columns will have the same width");
818  RNA_def_boolean(func, "even_rows", false, "", "All rows will have the same height");
819  RNA_def_boolean(func, "align", false, "", "Align buttons to each other");
820  parm = RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in");
821  RNA_def_function_return(func, parm);
822 
823  /* box layout */
824  func = RNA_def_function(srna, "box", "uiLayoutBox");
825  parm = RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in");
826  RNA_def_function_return(func, parm);
828  "Sublayout (items placed in this sublayout are placed "
829  "under each other in a column and are surrounded by a box)");
830 
831  /* split layout */
832  func = RNA_def_function(srna, "split", "uiLayoutSplit");
833  parm = RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in");
834  RNA_def_function_return(func, parm);
835  RNA_def_float(func,
836  "factor",
837  0.0f,
838  0.0f,
839  1.0f,
840  "Percentage",
841  "Percentage of width to split at (leave unset for automatic calculation)",
842  0.0f,
843  1.0f);
844  RNA_def_boolean(func, "align", false, "", "Align buttons to each other");
845 
846  /* radial/pie layout */
847  func = RNA_def_function(srna, "menu_pie", "uiLayoutRadial");
848  parm = RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in");
849  RNA_def_function_return(func, parm);
851  "Sublayout. Items placed in this sublayout are placed "
852  "in a radial fashion around the menu center)");
853 
854  /* Icon of a rna pointer */
855  func = RNA_def_function(srna, "icon", "rna_ui_get_rnaptr_icon");
856  parm = RNA_def_int(func, "icon_value", ICON_NONE, 0, INT_MAX, "", "Icon identifier", 0, INT_MAX);
857  RNA_def_function_return(func, parm);
859  parm = RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take the icon");
862  "Return the custom icon for this data, "
863  "use it e.g. to get materials or texture icons");
864 
865  /* UI name, description and icon of an enum item */
866  func = RNA_def_function(srna, "enum_item_name", "rna_ui_get_enum_name");
867  parm = RNA_def_string(func, "name", NULL, 0, "", "UI name of the enum item");
868  RNA_def_function_return(func, parm);
871  parm = RNA_def_string(func, "identifier", NULL, 0, "", "Identifier of the enum item");
873  RNA_def_function_ui_description(func, "Return the UI name for this enum item");
874 
875  func = RNA_def_function(srna, "enum_item_description", "rna_ui_get_enum_description");
876  parm = RNA_def_string(func, "description", NULL, 0, "", "UI description of the enum item");
877  RNA_def_function_return(func, parm);
880  parm = RNA_def_string(func, "identifier", NULL, 0, "", "Identifier of the enum item");
882  RNA_def_function_ui_description(func, "Return the UI description for this enum item");
883 
884  func = RNA_def_function(srna, "enum_item_icon", "rna_ui_get_enum_icon");
885  parm = RNA_def_int(func, "icon_value", ICON_NONE, 0, INT_MAX, "", "Icon identifier", 0, INT_MAX);
886  RNA_def_function_return(func, parm);
889  parm = RNA_def_string(func, "identifier", NULL, 0, "", "Identifier of the enum item");
891  RNA_def_function_ui_description(func, "Return the icon for this enum item");
892 
893  /* items */
894  func = RNA_def_function(srna, "prop", "rna_uiItemR");
895  RNA_def_function_ui_description(func, "Item. Exposes an RNA item and places it into the layout");
897  api_ui_item_common(func);
898  RNA_def_boolean(func, "expand", false, "", "Expand button to show more detail");
899  RNA_def_boolean(func, "slider", false, "", "Use slider widget for numeric values");
900  RNA_def_int(func,
901  "toggle",
902  -1,
903  -1,
904  1,
905  "",
906  "Use toggle widget for boolean values, "
907  "or a checkbox when disabled "
908  "(the default is -1 which uses toggle only when an icon is displayed)",
909  -1,
910  1);
911  RNA_def_boolean(func, "icon_only", false, "", "Draw only icons in buttons, no text");
912  RNA_def_boolean(func, "event", false, "", "Use button to input key events");
914  func, "full_event", false, "", "Use button to input full events including modifiers");
915  RNA_def_boolean(func,
916  "emboss",
917  true,
918  "",
919  "Draw the button itself, not just the icon/text. When false, corresponds to the "
920  "'NONE_OR_STATUS' layout emboss type");
921  RNA_def_int(func,
922  "index",
923  /* RNA_NO_INDEX == -1 */
924  -1,
925  -2,
926  INT_MAX,
927  "",
928  "The index of this button, when set a single member of an array can be accessed, "
929  "when set to -1 all array members are used",
930  -2,
931  INT_MAX);
932  parm = RNA_def_property(func, "icon_value", PROP_INT, PROP_UNSIGNED);
933  RNA_def_property_ui_text(parm, "Icon Value", "Override automatic icon of the item");
934  RNA_def_boolean(func, "invert_checkbox", false, "", "Draw checkbox value inverted");
935 
936  func = RNA_def_function(srna, "props_enum", "uiItemsEnumR");
938 
939  func = RNA_def_function(srna, "prop_menu_enum", "rna_uiItemMenuEnumR");
941  api_ui_item_common(func);
942 
943  func = RNA_def_function(srna, "prop_with_popover", "rna_uiItemR_with_popover");
945  api_ui_item_common(func);
946  RNA_def_boolean(func, "icon_only", false, "", "Draw only icons in tabs, no text");
947  parm = RNA_def_string(func, "panel", NULL, 0, "", "Identifier of the panel");
949 
950  func = RNA_def_function(srna, "prop_with_menu", "rna_uiItemR_with_menu");
952  api_ui_item_common(func);
953  RNA_def_boolean(func, "icon_only", false, "", "Draw only icons in tabs, no text");
954  parm = RNA_def_string(func, "menu", NULL, 0, "", "Identifier of the menu");
956 
957  func = RNA_def_function(srna, "prop_tabs_enum", "rna_uiItemTabsEnumR");
960  parm = RNA_def_pointer(
961  func, "data_highlight", "AnyType", "", "Data from which to take highlight property");
963  parm = RNA_def_string(
964  func, "property_highlight", NULL, 0, "", "Identifier of highlight property in data");
965  RNA_def_boolean(func, "icon_only", false, "", "Draw only icons in tabs, no text");
966 
967  func = RNA_def_function(srna, "prop_enum", "rna_uiItemEnumR_string");
969  parm = RNA_def_string(func, "value", NULL, 0, "", "Enum property value");
971  api_ui_item_common(func);
972 
973  func = RNA_def_function(srna, "prop_search", "rna_uiItemPointerR");
975  parm = RNA_def_pointer(
976  func, "search_data", "AnyType", "", "Data from which to take collection to search in");
978  parm = RNA_def_string(
979  func, "search_property", NULL, 0, "", "Identifier of search collection property");
981  api_ui_item_common(func);
982 
983  func = RNA_def_function(srna, "prop_decorator", "uiItemDecoratorR");
985  RNA_def_int(func,
986  "index",
987  /* RNA_NO_INDEX == -1 */
988  -1,
989  -2,
990  INT_MAX,
991  "",
992  "The index of this button, when set a single member of an array can be accessed, "
993  "when set to -1 all array members are used",
994  -2,
995  INT_MAX);
996 
997  for (int is_menu_hold = 0; is_menu_hold < 2; is_menu_hold++) {
998  func = (is_menu_hold) ? RNA_def_function(srna, "operator_menu_hold", "rna_uiItemOMenuHold") :
999  RNA_def_function(srna, "operator", "rna_uiItemO");
1000  api_ui_item_op_common(func);
1001  RNA_def_boolean(func, "emboss", true, "", "Draw the button itself, not just the icon/text");
1002  RNA_def_boolean(func, "depress", false, "", "Draw pressed in");
1003  parm = RNA_def_property(func, "icon_value", PROP_INT, PROP_UNSIGNED);
1004  RNA_def_property_ui_text(parm, "Icon Value", "Override automatic icon of the item");
1005  if (is_menu_hold) {
1006  parm = RNA_def_string(func, "menu", NULL, 0, "", "Identifier of the menu");
1008  }
1009  parm = RNA_def_pointer(
1010  func, "properties", "OperatorProperties", "", "Operator properties to fill in");
1012  RNA_def_function_return(func, parm);
1014  "Item. Places a button into the layout to call an Operator");
1015  }
1016 
1017  func = RNA_def_function(srna, "operator_enum", "rna_uiItemsEnumO");
1018  parm = RNA_def_string(func, "operator", NULL, 0, "", "Identifier of the operator");
1020  parm = RNA_def_string(func, "property", NULL, 0, "", "Identifier of property in operator");
1022  RNA_def_boolean(func, "icon_only", false, "", "Draw only icons in buttons, no text");
1023 
1024  func = RNA_def_function(srna, "operator_menu_enum", "rna_uiItemMenuEnumO");
1026  api_ui_item_op(func); /* cant use api_ui_item_op_common because property must come right after */
1027  parm = RNA_def_string(func, "property", NULL, 0, "", "Identifier of property in operator");
1029  api_ui_item_common(func);
1030 
1031  /* useful in C but not in python */
1032 # if 0
1033 
1034  func = RNA_def_function(srna, "operator_enum_single", "uiItemEnumO_string");
1035  api_ui_item_op_common(func);
1036  parm = RNA_def_string(func, "property", NULL, 0, "", "Identifier of property in operator");
1038  parm = RNA_def_string(func, "value", NULL, 0, "", "Enum property value");
1040 
1041  func = RNA_def_function(srna, "operator_boolean", "uiItemBooleanO");
1042  api_ui_item_op_common(func);
1043  parm = RNA_def_string(func, "property", NULL, 0, "", "Identifier of property in operator");
1045  parm = RNA_def_boolean(
1046  func, "value", false, "", "Value of the property to call the operator with");
1048 
1049  func = RNA_def_function(srna, "operator_int", "uiItemIntO");
1050  api_ui_item_op_common(func);
1051  parm = RNA_def_string(func, "property", NULL, 0, "", "Identifier of property in operator");
1053  parm = RNA_def_int(func,
1054  "value",
1055  0,
1056  INT_MIN,
1057  INT_MAX,
1058  "",
1059  "Value of the property to call the operator with",
1060  INT_MIN,
1061  INT_MAX);
1063 
1064  func = RNA_def_function(srna, "operator_float", "uiItemFloatO");
1065  api_ui_item_op_common(func);
1066  parm = RNA_def_string(func, "property", NULL, 0, "", "Identifier of property in operator");
1068  parm = RNA_def_float(func,
1069  "value",
1070  0,
1071  -FLT_MAX,
1072  FLT_MAX,
1073  "",
1074  "Value of the property to call the operator with",
1075  -FLT_MAX,
1076  FLT_MAX);
1078 
1079  func = RNA_def_function(srna, "operator_string", "uiItemStringO");
1080  api_ui_item_op_common(func);
1081  parm = RNA_def_string(func, "property", NULL, 0, "", "Identifier of property in operator");
1083  parm = RNA_def_string(
1084  func, "value", NULL, 0, "", "Value of the property to call the operator with");
1086 # endif
1087 
1088  func = RNA_def_function(srna, "label", "rna_uiItemL");
1089  RNA_def_function_ui_description(func, "Item. Displays text and/or icon in the layout");
1090  api_ui_item_common(func);
1091  parm = RNA_def_property(func, "icon_value", PROP_INT, PROP_UNSIGNED);
1092  RNA_def_property_ui_text(parm, "Icon Value", "Override automatic icon of the item");
1093 
1094  func = RNA_def_function(srna, "menu", "rna_uiItemM");
1095  parm = RNA_def_string(func, "menu", NULL, 0, "", "Identifier of the menu");
1096  api_ui_item_common(func);
1098  parm = RNA_def_property(func, "icon_value", PROP_INT, PROP_UNSIGNED);
1099  RNA_def_property_ui_text(parm, "Icon Value", "Override automatic icon of the item");
1100 
1101  func = RNA_def_function(srna, "menu_contents", "rna_uiItemM_contents");
1102  parm = RNA_def_string(func, "menu", NULL, 0, "", "Identifier of the menu");
1104 
1105  func = RNA_def_function(srna, "popover", "rna_uiItemPopoverPanel");
1107  parm = RNA_def_string(func, "panel", NULL, 0, "", "Identifier of the panel");
1108  api_ui_item_common(func);
1110  parm = RNA_def_property(func, "icon_value", PROP_INT, PROP_UNSIGNED);
1111  RNA_def_property_ui_text(parm, "Icon Value", "Override automatic icon of the item");
1112 
1113  func = RNA_def_function(srna, "popover_group", "rna_uiItemPopoverPanelFromGroup");
1115  parm = RNA_def_enum(func, "space_type", rna_enum_space_type_items, 0, "Space Type", "");
1117  parm = RNA_def_enum(
1118  func, "region_type", rna_enum_region_type_items, RGN_TYPE_WINDOW, "Region Type", "");
1120  parm = RNA_def_string(func, "context", NULL, 0, "", "panel type context");
1122  parm = RNA_def_string(func, "category", NULL, 0, "", "panel type category");
1124 
1125  func = RNA_def_function(srna, "separator", "uiItemS_ex");
1126  RNA_def_function_ui_description(func, "Item. Inserts empty space into the layout between items");
1127  RNA_def_float(func,
1128  "factor",
1129  1.0f,
1130  0.0f,
1131  FLT_MAX,
1132  "Percentage",
1133  "Percentage of width to space (leave unset for default space)",
1134  0.0f,
1135  FLT_MAX);
1136 
1137  func = RNA_def_function(srna, "separator_spacer", "uiItemSpacer");
1139  func, "Item. Inserts horizontal spacing empty space into the layout between items");
1140 
1141  /* context */
1142  func = RNA_def_function(srna, "context_pointer_set", "uiLayoutSetContextPointer");
1143  parm = RNA_def_string(func, "name", NULL, 0, "Name", "Name of entry in the context");
1145  parm = RNA_def_pointer(func, "data", "AnyType", "", "Pointer to put in context");
1147 
1148  /* templates */
1149  func = RNA_def_function(srna, "template_header", "uiTemplateHeader");
1151  RNA_def_function_ui_description(func, "Inserts common Space header UI (editor type selector)");
1152 
1153  func = RNA_def_function(srna, "template_ID", "rna_uiTemplateID");
1155  api_ui_item_rna_common(func);
1156  RNA_def_string(func, "new", NULL, 0, "", "Operator identifier to create a new ID block");
1158  func, "open", NULL, 0, "", "Operator identifier to open a file for creating a new ID block");
1159  RNA_def_string(func, "unlink", NULL, 0, "", "Operator identifier to unlink the ID block");
1160  RNA_def_enum(func,
1161  "filter",
1162  id_template_filter_items,
1164  "",
1165  "Optionally limit the items which can be selected");
1166  RNA_def_boolean(func, "live_icon", false, "", "Show preview instead of fixed icon");
1168 
1169  func = RNA_def_function(srna, "template_ID_preview", "uiTemplateIDPreview");
1171  api_ui_item_rna_common(func);
1172  RNA_def_string(func, "new", NULL, 0, "", "Operator identifier to create a new ID block");
1174  func, "open", NULL, 0, "", "Operator identifier to open a file for creating a new ID block");
1175  RNA_def_string(func, "unlink", NULL, 0, "", "Operator identifier to unlink the ID block");
1176  RNA_def_int(
1177  func, "rows", 0, 0, INT_MAX, "Number of thumbnail preview rows to display", "", 0, INT_MAX);
1178  RNA_def_int(func,
1179  "cols",
1180  0,
1181  0,
1182  INT_MAX,
1183  "Number of thumbnail preview columns to display",
1184  "",
1185  0,
1186  INT_MAX);
1187  RNA_def_enum(func,
1188  "filter",
1189  id_template_filter_items,
1191  "",
1192  "Optionally limit the items which can be selected");
1193  RNA_def_boolean(func, "hide_buttons", false, "", "Show only list, no buttons");
1194 
1195  func = RNA_def_function(srna, "template_any_ID", "rna_uiTemplateAnyID");
1196  parm = RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take property");
1198  parm = RNA_def_string(func, "property", NULL, 0, "", "Identifier of property in data");
1200  parm = RNA_def_string(func,
1201  "type_property",
1202  NULL,
1203  0,
1204  "",
1205  "Identifier of property in data giving the type of the ID-blocks to use");
1208 
1209  func = RNA_def_function(srna, "template_ID_tabs", "uiTemplateIDTabs");
1211  api_ui_item_rna_common(func);
1212  RNA_def_string(func, "new", NULL, 0, "", "Operator identifier to create a new ID block");
1213  RNA_def_string(func, "menu", NULL, 0, "", "Context menu identifier");
1214  RNA_def_enum(func,
1215  "filter",
1216  id_template_filter_items,
1218  "",
1219  "Optionally limit the items which can be selected");
1220 
1221  func = RNA_def_function(srna, "template_search", "uiTemplateSearch");
1223  api_ui_item_rna_common(func);
1224  parm = RNA_def_pointer(
1225  func, "search_data", "AnyType", "", "Data from which to take collection to search in");
1227  parm = RNA_def_string(
1228  func, "search_property", NULL, 0, "", "Identifier of search collection property");
1231  func, "new", NULL, 0, "", "Operator identifier to create a new item for the collection");
1232  RNA_def_string(func,
1233  "unlink",
1234  NULL,
1235  0,
1236  "",
1237  "Operator identifier to unlink or delete the active "
1238  "item from the collection");
1239 
1240  func = RNA_def_function(srna, "template_search_preview", "uiTemplateSearchPreview");
1242  api_ui_item_rna_common(func);
1243  parm = RNA_def_pointer(
1244  func, "search_data", "AnyType", "", "Data from which to take collection to search in");
1246  parm = RNA_def_string(
1247  func, "search_property", NULL, 0, "", "Identifier of search collection property");
1250  func, "new", NULL, 0, "", "Operator identifier to create a new item for the collection");
1251  RNA_def_string(func,
1252  "unlink",
1253  NULL,
1254  0,
1255  "",
1256  "Operator identifier to unlink or delete the active "
1257  "item from the collection");
1258  RNA_def_int(
1259  func, "rows", 0, 0, INT_MAX, "Number of thumbnail preview rows to display", "", 0, INT_MAX);
1260  RNA_def_int(func,
1261  "cols",
1262  0,
1263  0,
1264  INT_MAX,
1265  "Number of thumbnail preview columns to display",
1266  "",
1267  0,
1268  INT_MAX);
1269 
1270  func = RNA_def_function(srna, "template_path_builder", "rna_uiTemplatePathBuilder");
1271  parm = RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take property");
1273  parm = RNA_def_string(func, "property", NULL, 0, "", "Identifier of property in data");
1275  parm = RNA_def_pointer(func, "root", "ID", "", "ID-block from which path is evaluated from");
1278 
1279  func = RNA_def_function(srna, "template_modifiers", "uiTemplateModifiers");
1281  RNA_def_function_ui_description(func, "Generates the UI layout for the modifier stack");
1282 
1283  func = RNA_def_function(srna, "template_constraints", "uiTemplateConstraints");
1285  RNA_def_function_ui_description(func, "Generates the panels for the constraint stack");
1286  RNA_def_boolean(func,
1287  "use_bone_constraints",
1288  true,
1289  "",
1290  "Add panels for bone constraints instead of object constraints");
1291 
1292  func = RNA_def_function(srna, "template_grease_pencil_modifiers", "uiTemplateGpencilModifiers");
1295  "Generates the panels for the grease pencil modifier stack");
1296 
1297  func = RNA_def_function(srna, "template_shaderfx", "uiTemplateShaderFx");
1299  RNA_def_function_ui_description(func, "Generates the panels for the shader effect stack");
1300 
1301  func = RNA_def_function(srna, "template_greasepencil_color", "uiTemplateGpencilColorPreview");
1303  api_ui_item_rna_common(func);
1304  RNA_def_int(
1305  func, "rows", 0, 0, INT_MAX, "Number of thumbnail preview rows to display", "", 0, INT_MAX);
1306  RNA_def_int(func,
1307  "cols",
1308  0,
1309  0,
1310  INT_MAX,
1311  "Number of thumbnail preview columns to display",
1312  "",
1313  0,
1314  INT_MAX);
1315  RNA_def_float(func, "scale", 1.0f, 0.1f, 1.5f, "Scale of the image thumbnails", "", 0.5f, 1.0f);
1316  RNA_def_enum(func,
1317  "filter",
1318  id_template_filter_items,
1320  "",
1321  "Optionally limit the items which can be selected");
1322 
1323  func = RNA_def_function(srna, "template_constraint_header", "uiTemplateConstraintHeader");
1324  RNA_def_function_ui_description(func, "Generates the header for constraint panels");
1325  parm = RNA_def_pointer(func, "data", "Constraint", "", "Constraint data");
1327 
1328  func = RNA_def_function(srna, "template_preview", "uiTemplatePreview");
1330  func, "Item. A preview window for materials, textures, lights or worlds");
1332  parm = RNA_def_pointer(func, "id", "ID", "", "ID data-block");
1334  RNA_def_boolean(func, "show_buttons", true, "", "Show preview buttons?");
1335  RNA_def_pointer(func, "parent", "ID", "", "ID data-block");
1336  RNA_def_pointer(func, "slot", "TextureSlot", "", "Texture slot");
1338  func,
1339  "preview_id",
1340  NULL,
1341  0,
1342  "",
1343  "Identifier of this preview widget, if not set the ID type will be used "
1344  "(i.e. all previews of materials without explicit ID will have the same size...)");
1345 
1346  func = RNA_def_function(srna, "template_curve_mapping", "uiTemplateCurveMapping");
1348  func, "Item. A curve mapping widget used for e.g falloff curves for lights");
1349  api_ui_item_rna_common(func);
1350  RNA_def_enum(func, "type", curve_type_items, 0, "Type", "Type of curves to display");
1351  RNA_def_boolean(func, "levels", false, "", "Show black/white levels");
1352  RNA_def_boolean(func, "brush", false, "", "Show brush options");
1353  RNA_def_boolean(func, "use_negative_slope", false, "", "Use a negative slope by default");
1354  RNA_def_boolean(func, "show_tone", false, "", "Show tone options");
1355 
1356  func = RNA_def_function(srna, "template_curveprofile", "uiTemplateCurveProfile");
1357  RNA_def_function_ui_description(func, "A profile path editor used for custom profiles");
1358  api_ui_item_rna_common(func);
1359 
1360  func = RNA_def_function(srna, "template_color_ramp", "uiTemplateColorRamp");
1361  RNA_def_function_ui_description(func, "Item. A color ramp widget");
1362  api_ui_item_rna_common(func);
1363  RNA_def_boolean(func, "expand", false, "", "Expand button to show more detail");
1364 
1365  func = RNA_def_function(srna, "template_icon", "uiTemplateIcon");
1366  RNA_def_function_ui_description(func, "Display a large icon");
1367  parm = RNA_def_int(func, "icon_value", 0, 0, INT_MAX, "Icon to display", "", 0, INT_MAX);
1369  RNA_def_float(func,
1370  "scale",
1371  1.0f,
1372  1.0f,
1373  100.0f,
1374  "Scale",
1375  "Scale the icon size (by the button size)",
1376  1.0f,
1377  100.0f);
1378 
1379  func = RNA_def_function(srna, "template_icon_view", "uiTemplateIconView");
1380  RNA_def_function_ui_description(func, "Enum. Large widget showing Icon previews");
1381  api_ui_item_rna_common(func);
1382  RNA_def_boolean(func, "show_labels", false, "", "Show enum label in preview buttons");
1383  RNA_def_float(func,
1384  "scale",
1385  6.0f,
1386  1.0f,
1387  100.0f,
1388  "UI Units",
1389  "Scale the button icon size (by the button size)",
1390  1.0f,
1391  100.0f);
1392  RNA_def_float(func,
1393  "scale_popup",
1394  5.0f,
1395  1.0f,
1396  100.0f,
1397  "Scale",
1398  "Scale the popup icon size (by the button size)",
1399  1.0f,
1400  100.0f);
1401 
1402  func = RNA_def_function(srna, "template_histogram", "uiTemplateHistogram");
1403  RNA_def_function_ui_description(func, "Item. A histogramm widget to analyze imaga data");
1404  api_ui_item_rna_common(func);
1405 
1406  func = RNA_def_function(srna, "template_waveform", "uiTemplateWaveform");
1407  RNA_def_function_ui_description(func, "Item. A waveform widget to analyze imaga data");
1408  api_ui_item_rna_common(func);
1409 
1410  func = RNA_def_function(srna, "template_vectorscope", "uiTemplateVectorscope");
1411  RNA_def_function_ui_description(func, "Item. A vectorscope widget to analyze imaga data");
1412  api_ui_item_rna_common(func);
1413 
1414  func = RNA_def_function(srna, "template_layers", "uiTemplateLayers");
1415  api_ui_item_rna_common(func);
1416  parm = RNA_def_pointer(
1417  func, "used_layers_data", "AnyType", "", "Data from which to take property");
1419  parm = RNA_def_string(
1420  func, "used_layers_property", NULL, 0, "", "Identifier of property in data");
1422  parm = RNA_def_int(func, "active_layer", 0, 0, INT_MAX, "Active Layer", "", 0, INT_MAX);
1424 
1425  func = RNA_def_function(srna, "template_color_picker", "uiTemplateColorPicker");
1426  RNA_def_function_ui_description(func, "Item. A color wheel widget to pick colors");
1427  api_ui_item_rna_common(func);
1429  func, "value_slider", false, "", "Display the value slider to the right of the color wheel");
1430  RNA_def_boolean(func,
1431  "lock",
1432  false,
1433  "",
1434  "Lock the color wheel display to value 1.0 regardless of actual color");
1436  func, "lock_luminosity", false, "", "Keep the color at its original vector length");
1437  RNA_def_boolean(func, "cubic", false, "", "Cubic saturation for picking values close to white");
1438 
1439  func = RNA_def_function(srna, "template_palette", "uiTemplatePalette");
1440  RNA_def_function_ui_description(func, "Item. A palette used to pick colors");
1441  api_ui_item_rna_common(func);
1442  RNA_def_boolean(func, "color", 0, "", "Display the colors as colors or values");
1443 
1444  func = RNA_def_function(srna, "template_image_layers", "uiTemplateImageLayers");
1446  parm = RNA_def_pointer(func, "image", "Image", "", "");
1448  parm = RNA_def_pointer(func, "image_user", "ImageUser", "", "");
1450 
1451  func = RNA_def_function(srna, "template_image", "uiTemplateImage");
1453  func, "Item(s). User interface for selecting images and their source paths");
1455  api_ui_item_rna_common(func);
1456  parm = RNA_def_pointer(func, "image_user", "ImageUser", "", "");
1458  RNA_def_boolean(func, "compact", false, "", "Use more compact layout");
1459  RNA_def_boolean(func, "multiview", false, "", "Expose Multi-View options");
1460 
1461  func = RNA_def_function(srna, "template_image_settings", "uiTemplateImageSettings");
1462  RNA_def_function_ui_description(func, "User interface for setting image format options");
1463  parm = RNA_def_pointer(func, "image_settings", "ImageFormatSettings", "", "");
1465  RNA_def_boolean(func, "color_management", false, "", "Show color management settings");
1466 
1467  func = RNA_def_function(srna, "template_image_stereo_3d", "uiTemplateImageStereo3d");
1468  RNA_def_function_ui_description(func, "User interface for setting image stereo 3d options");
1469  parm = RNA_def_pointer(func, "stereo_3d_format", "Stereo3dFormat", "", "");
1471 
1472  func = RNA_def_function(srna, "template_image_views", "uiTemplateImageViews");
1473  RNA_def_function_ui_description(func, "User interface for setting image views output options");
1474  parm = RNA_def_pointer(func, "image_settings", "ImageFormatSettings", "", "");
1476 
1477  func = RNA_def_function(srna, "template_movieclip", "uiTemplateMovieClip");
1479  func, "Item(s). User interface for selecting movie clips and their source paths");
1481  api_ui_item_rna_common(func);
1482  RNA_def_boolean(func, "compact", false, "", "Use more compact layout");
1483 
1484  func = RNA_def_function(srna, "template_track", "uiTemplateTrack");
1485  RNA_def_function_ui_description(func, "Item. A movie-track widget to preview tracking image.");
1486  api_ui_item_rna_common(func);
1487 
1488  func = RNA_def_function(srna, "template_marker", "uiTemplateMarker");
1489  RNA_def_function_ui_description(func, "Item. A widget to control single marker settings.");
1490  api_ui_item_rna_common(func);
1491  parm = RNA_def_pointer(func, "clip_user", "MovieClipUser", "", "");
1493  parm = RNA_def_pointer(func, "track", "MovieTrackingTrack", "", "");
1495  RNA_def_boolean(func, "compact", false, "", "Use more compact layout");
1496 
1497  func = RNA_def_function(
1498  srna, "template_movieclip_information", "uiTemplateMovieclipInformation");
1499  RNA_def_function_ui_description(func, "Item. Movie clip information data.");
1500  api_ui_item_rna_common(func);
1501  parm = RNA_def_pointer(func, "clip_user", "MovieClipUser", "", "");
1503 
1504  func = RNA_def_function(srna, "template_list", "uiTemplateList");
1505  RNA_def_function_ui_description(func, "Item. A list widget to display data, e.g. vertexgroups.");
1507  parm = RNA_def_string(func, "listtype_name", NULL, 0, "", "Identifier of the list type to use");
1509  parm = RNA_def_string(
1510  func,
1511  "list_id",
1512  NULL,
1513  0,
1514  "",
1515  "Identifier of this list widget (mandatory when using default \"" UI_UL_DEFAULT_CLASS_NAME
1516  "\" class). "
1517  "If this not an empty string, the uilist gets a custom ID, otherwise it takes the "
1518  "name of the class used to define the uilist (for example, if the "
1519  "class name is \"OBJECT_UL_vgroups\", and list_id is not set by the "
1520  "script, then bl_idname = \"OBJECT_UL_vgroups\")");
1522  parm = RNA_def_pointer(
1523  func, "dataptr", "AnyType", "", "Data from which to take the Collection property");
1525  parm = RNA_def_string(
1526  func, "propname", NULL, 0, "", "Identifier of the Collection property in data");
1528  parm = RNA_def_pointer(func,
1529  "active_dataptr",
1530  "AnyType",
1531  "",
1532  "Data from which to take the integer property, index of the active item");
1534  parm = RNA_def_string(
1535  func,
1536  "active_propname",
1537  NULL,
1538  0,
1539  "",
1540  "Identifier of the integer property in active_data, index of the active item");
1542  RNA_def_string(func,
1543  "item_dyntip_propname",
1544  NULL,
1545  0,
1546  "",
1547  "Identifier of a string property in items, to use as tooltip content");
1548  RNA_def_int(func,
1549  "rows",
1550  5,
1551  0,
1552  INT_MAX,
1553  "",
1554  "Default and minimum number of rows to display",
1555  0,
1556  INT_MAX);
1557  RNA_def_int(
1558  func, "maxrows", 5, 0, INT_MAX, "", "Default maximum number of rows to display", 0, INT_MAX);
1559  RNA_def_enum(func,
1560  "type",
1563  "Type",
1564  "Type of layout to use");
1565  RNA_def_int(func,
1566  "columns",
1567  9,
1568  0,
1569  INT_MAX,
1570  "",
1571  "Number of items to display per row, for GRID layout",
1572  0,
1573  INT_MAX);
1574  RNA_def_boolean(func, "sort_reverse", false, "", "Display items in reverse order by default");
1575  RNA_def_boolean(func, "sort_lock", false, "", "Lock display order to default value");
1576 
1577  func = RNA_def_function(srna, "template_running_jobs", "uiTemplateRunningJobs");
1579 
1580  RNA_def_function(srna, "template_operator_search", "uiTemplateOperatorSearch");
1581  RNA_def_function(srna, "template_menu_search", "uiTemplateMenuSearch");
1582 
1583  func = RNA_def_function(srna, "template_header_3D_mode", "uiTemplateHeader3D_mode");
1586 
1587  func = RNA_def_function(srna, "template_edit_mode_selection", "uiTemplateEditModeSelection");
1590  func, "Inserts common 3DView Edit modes header UI (selector for selection mode)");
1591 
1592  func = RNA_def_function(srna, "template_reports_banner", "uiTemplateReportsBanner");
1594 
1595  func = RNA_def_function(srna, "template_input_status", "uiTemplateInputStatus");
1597 
1598  func = RNA_def_function(srna, "template_node_link", "uiTemplateNodeLink");
1600  parm = RNA_def_pointer(func, "ntree", "NodeTree", "", "");
1602  parm = RNA_def_pointer(func, "node", "Node", "", "");
1604  parm = RNA_def_pointer(func, "socket", "NodeSocket", "", "");
1606 
1607  func = RNA_def_function(srna, "template_node_view", "uiTemplateNodeView");
1609  parm = RNA_def_pointer(func, "ntree", "NodeTree", "", "");
1611  parm = RNA_def_pointer(func, "node", "Node", "", "");
1613  parm = RNA_def_pointer(func, "socket", "NodeSocket", "", "");
1615 
1616  func = RNA_def_function(srna, "template_texture_user", "uiTemplateTextureUser");
1618 
1619  func = RNA_def_function(
1620  srna, "template_keymap_item_properties", "uiTemplateKeymapItemProperties");
1621  parm = RNA_def_pointer(func, "item", "KeyMapItem", "", "");
1623 
1624  func = RNA_def_function(srna, "template_component_menu", "uiTemplateComponentMenu");
1625  RNA_def_function_ui_description(func, "Item. Display expanded property in a popup menu");
1626  parm = RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take property");
1628  parm = RNA_def_string(func, "property", NULL, 0, "", "Identifier of property in data");
1630  RNA_def_string(func, "name", NULL, 0, "", "");
1631 
1632  /* color management templates */
1633  func = RNA_def_function(srna, "template_colorspace_settings", "uiTemplateColorspaceSettings");
1634  RNA_def_function_ui_description(func, "Item. A widget to control input color space settings.");
1635  api_ui_item_rna_common(func);
1636 
1637  func = RNA_def_function(
1638  srna, "template_colormanaged_view_settings", "uiTemplateColormanagedViewSettings");
1640  func, "Item. A widget to control color managed view settings settings.");
1642  api_ui_item_rna_common(func);
1643 # if 0
1644  RNA_def_boolean(func,
1645  "show_global_settings",
1646  false,
1647  "",
1648  "Show widgets to control global color management settings");
1649 # endif
1650 
1651  /* node socket icon */
1652  func = RNA_def_function(srna, "template_node_socket", "uiTemplateNodeSocket");
1653  RNA_def_function_ui_description(func, "Node Socket Icon");
1656  func, "color", 4, node_socket_color_default, 0.0f, 1.0f, "Color", "", 0.0f, 1.0f);
1657 
1658  func = RNA_def_function(srna, "template_cache_file", "rna_uiTemplateCacheFile");
1660  func, "Item(s). User interface for selecting cache files and their source paths");
1662  api_ui_item_rna_common(func);
1663 
1664  func = RNA_def_function(srna, "template_recent_files", "uiTemplateRecentFiles");
1665  RNA_def_function_ui_description(func, "Show list of recently saved .blend files");
1666  RNA_def_int(func, "rows", 5, 1, INT_MAX, "", "Maximum number of items to show", 1, INT_MAX);
1667  parm = RNA_def_int(func, "found", 0, 0, INT_MAX, "", "Number of items drawn", 0, INT_MAX);
1668  RNA_def_function_return(func, parm);
1669 
1670  func = RNA_def_function(srna, "template_file_select_path", "uiTemplateFileSelectPath");
1672  "Item. A text button to set the active file browser path.");
1673  parm = RNA_def_pointer(func, "params", "FileSelectParams", "", "");
1676 
1677  func = RNA_def_function(
1678  srna, "template_event_from_keymap_item", "rna_uiTemplateEventFromKeymapItem");
1679  RNA_def_function_ui_description(func, "Display keymap item as icons/text");
1680  parm = RNA_def_property(func, "item", PROP_POINTER, PROP_NONE);
1681  RNA_def_property_struct_type(parm, "KeyMapItem");
1682  RNA_def_property_ui_text(parm, "Item", "");
1685 }
1686 
1687 #endif
void BLI_kdtree_nd_() free(KDTree *tree)
Definition: kdtree_impl.h:116
#define ELEM(...)
bool BLT_translate_iface(void)
#define BLT_I18NCONTEXT_DEFAULT
const char * BLT_pgettext(const char *msgctxt, const char *msgid)
@ 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:1437
@ PARM_RNAPTR
Definition: RNA_types.h:339
@ PARM_REQUIRED
Definition: RNA_types.h:337
@ FUNC_NO_SELF
Definition: RNA_types.h:571
@ FUNC_USE_CONTEXT
Definition: RNA_types.h:577
@ PROP_BOOLEAN
Definition: RNA_types.h:73
@ PROP_ENUM
Definition: RNA_types.h:77
@ PROP_INT
Definition: RNA_types.h:74
@ PROP_POINTER
Definition: RNA_types.h:78
@ PROP_NEVER_NULL
Definition: RNA_types.h:225
@ PROP_COLOR
Definition: RNA_types.h:139
@ PROP_NONE
Definition: RNA_types.h:113
@ PROP_COLOR_GAMMA
Definition: RNA_types.h:151
@ PROP_UNSIGNED
Definition: RNA_types.h:129
#define C
Definition: RandGen.cpp:39
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)
@ 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
void uiItemPopoverPanelFromGroup(uiLayout *layout, struct bContext *C, int space_id, int region_id, const char *context, const char *category)
void uiItemsFullEnumO(uiLayout *layout, const char *opname, const char *propname, struct IDProperty *properties, int context, int flag)
void uiItemMenuEnumO_ptr(uiLayout *layout, struct bContext *C, struct wmOperatorType *ot, const char *propname, const char *name, int icon)
uiLayout * uiLayoutColumnWithHeading(uiLayout *layout, bool align, const char *heading)
void uiTemplatePathBuilder(uiLayout *layout, struct PointerRNA *ptr, const char *propname, struct PointerRNA *root_ptr, const char *text)
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 uiItemFullOMenuHold_ptr(uiLayout *layout, struct wmOperatorType *ot, const char *name, int icon, struct IDProperty *properties, int context, int flag, const char *menu_id, struct PointerRNA *r_opptr)
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, const bool live_icon, const char *text)
void uiItemFullO_ptr(uiLayout *layout, struct wmOperatorType *ot, const char *name, int icon, struct IDProperty *properties, int context, int flag, struct PointerRNA *r_opptr)
@ UI_TEMPLATE_ID_FILTER_AVAILABLE
@ UI_TEMPLATE_ID_FILTER_ALL
#define UI_UL_DEFAULT_CLASS_NAME
void uiItemPointerR_prop(uiLayout *layout, struct PointerRNA *ptr, struct PropertyRNA *prop, struct PointerRNA *searchptr, struct PropertyRNA *searchprop, const char *name, int icon)
void uiItemPopoverPanel(uiLayout *layout, struct bContext *C, const char *panel_type, const char *name, int icon)
void uiItemMContents(uiLayout *layout, const char *menuname)
int uiLayoutGetOperatorContext(uiLayout *layout)
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)
bool uiTemplateEventFromKeymapItem(struct uiLayout *layout, const char *text, const struct wmKeyMapItem *kmi, bool text_fallback)
void uiItemMenuEnumR_prop(uiLayout *layout, struct PointerRNA *ptr, struct PropertyRNA *prop, const char *name, int icon)
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:91
void uiItemM(uiLayout *layout, const char *menuname, const char *name, int icon)
int UI_icon_from_rnaptr(struct bContext *C, struct PointerRNA *ptr, int rnaicon, const bool big)
DO_INLINE void filter(lfVector *V, fmatrix3x3 *S)
void(* MEM_freeN)(void *vmemh)
Definition: mallocn.c:41
const char * RNA_struct_identifier(const StructRNA *type)
Definition: rna_access.c:723
bool RNA_property_array_check(PropertyRNA *prop)
Definition: rna_access.c:1223
int RNA_enum_from_identifier(const EnumPropertyItem *item, const char *identifier)
Definition: rna_access.c:1876
PropertyType RNA_property_type(PropertyRNA *prop)
Definition: rna_access.c:1155
const PointerRNA PointerRNA_NULL
Definition: rna_access.c:71
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
Definition: rna_access.c:866
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:1722
const char * RNA_property_translation_context(const PropertyRNA *prop)
Definition: rna_access.c:2063
int RNA_struct_ui_icon(const StructRNA *type)
Definition: rna_access.c:738
bool RNA_pointer_is_null(const PointerRNA *ptr)
Definition: rna_access.c:174
PropertySubType RNA_property_subtype(PropertyRNA *prop)
Definition: rna_access.c:1160
const char * RNA_struct_translation_context(const StructRNA *type)
Definition: rna_access.c:756
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:1657
static const EnumPropertyItem curve_type_items[]
Definition: rna_curve.c:141
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:3825
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, bool default_value, const char *ui_name, const char *ui_description)
Definition: rna_define.c:3481
PropertyRNA * RNA_def_pointer(StructOrFunctionRNA *cont_, const char *identifier, const char *type, const char *ui_name, const char *ui_description)
Definition: rna_define.c:4159
void RNA_def_function_return(FunctionRNA *func, PropertyRNA *ret)
Definition: rna_define.c:4302
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:4065
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
Definition: rna_define.c:1676
FunctionRNA * RNA_def_function(StructRNA *srna, const char *identifier, const char *call)
Definition: rna_define.c:4262
void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
Definition: rna_define.c:1892
void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
Definition: rna_define.c:1792
void RNA_def_function_ui_description(FunctionRNA *func, const char *description)
Definition: rna_define.c:4337
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier, int type, int subtype)
Definition: rna_define.c:1279
void RNA_def_function_flag(FunctionRNA *func, int flag)
Definition: rna_define.c:4332
void RNA_def_property_clear_flag(PropertyRNA *prop, PropertyFlag flag)
Definition: rna_define.c:1517
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:3675
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:3585
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:3771
void RNA_def_parameter_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
Definition: rna_define.c:1547
const char * rna_translate_ui_text(const char *text, const char *text_ctxt, struct StructRNA *type, struct PropertyRNA *prop, bool translate)
const EnumPropertyItem rna_enum_region_type_items[]
Definition: rna_screen.c:35
const EnumPropertyItem rna_enum_space_type_items[]
Definition: rna_space.c:72
const EnumPropertyItem rna_enum_uilist_layout_type_items[]
Definition: rna_ui.c:60
static void api_ui_item_common_text(FunctionRNA *func)
Definition: rna_ui_api.c:708
static void api_ui_item_common(FunctionRNA *func)
Definition: rna_ui_api.c:721
static void api_ui_item_rna_common(FunctionRNA *func)
Definition: rna_ui_api.c:745
static void api_ui_item_op(FunctionRNA *func)
Definition: rna_ui_api.c:732
static void api_ui_item_op_common(FunctionRNA *func)
Definition: rna_ui_api.c:739
static void api_ui_item_common_heading(FunctionRNA *func)
Definition: rna_ui_api.c:690
const EnumPropertyItem rna_enum_icon_items[]
Definition: rna_ui_api.c:46
void RNA_api_ui_layout(StructRNA *srna)
Definition: rna_ui_api.c:755
struct SELECTID_Context context
Definition: select_engine.c:47
const char * name
Definition: RNA_types.h:450
const char * description
Definition: RNA_types.h:452
struct StructRNA * type
Definition: RNA_types.h:51
struct StructRNA * srna
Definition: WM_types.h:802
PointerRNA * ptr
Definition: wm_files.c:3157
wmOperatorType * ot
Definition: wm_files.c:3156
wmOperatorType * WM_operatortype_find(const char *idname, bool quiet)