Blender V4.3
rna_ui_api.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2009 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
9#include <cstdio>
10#include <cstdlib>
11
12#include "BLI_utildefines.h"
13
14#include "BLT_translation.hh"
15
16#include "RNA_define.hh"
17#include "RNA_enum_types.hh"
18
19#include "DNA_screen_types.h"
20
21#include "UI_interface.hh"
22#include "UI_interface_icons.hh"
23#include "UI_resources.hh"
24
25#include "rna_internal.hh"
26
27#define DEF_ICON(name) {ICON_##name, (#name), 0, (#name), ""},
28#define DEF_ICON_VECTOR(name) {ICON_##name, (#name), 0, (#name), ""},
29#define DEF_ICON_COLOR(name) {ICON_##name, (#name), 0, (#name), ""},
30#define DEF_ICON_BLANK(name)
32#include "UI_icons.hh"
33 {0, nullptr, 0, nullptr, nullptr},
34};
35
36#ifdef RNA_RUNTIME
37
38# include "DNA_asset_types.h"
39
40# include "ED_asset_filter.hh"
41# include "ED_geometry.hh"
42# include "ED_node.hh"
43# include "ED_object.hh"
44
45const char *rna_translate_ui_text(
46 const char *text, const char *text_ctxt, StructRNA *type, PropertyRNA *prop, bool translate)
47{
48 /* Also return text if UI labels translation is disabled. */
49 if (!text || !text[0] || !translate || !BLT_translate_iface()) {
50 return text;
51 }
52
53 /* If a text_ctxt is specified, use it! */
54 if (text_ctxt && text_ctxt[0]) {
55 return BLT_pgettext(text_ctxt, text);
56 }
57
58 /* Else, if an RNA type or property is specified, use its context. */
59# if 0
60 /* XXX Disabled for now. Unfortunately, their is absolutely no way from py code to get the RNA
61 * struct corresponding to the 'data' (in functions like prop() & co),
62 * as this is pure runtime data. Hence, messages extraction script can't determine the
63 * correct context it should use for such 'text' messages...
64 * So for now, one have to explicitly specify the 'text_ctxt' when using prop() etc.
65 * functions, if default context is not suitable.
66 */
67 if (prop) {
69 }
70# else
71 (void)prop;
72# endif
73 if (type) {
75 }
76
77 /* Else, default context! */
79}
80
81static void rna_uiItemR(uiLayout *layout,
83 const char *propname,
84 const char *name,
85 const char *text_ctxt,
86 bool translate,
87 int icon,
88 const char *placeholder,
89 bool expand,
90 bool slider,
91 int toggle,
92 bool icon_only,
93 bool event,
94 bool full_event,
95 bool emboss,
96 int index,
97 int icon_value,
98 bool invert_checkbox)
99{
100 PropertyRNA *prop = RNA_struct_find_property(ptr, propname);
102
103 if (!prop) {
104 RNA_warning("property not found: %s.%s", RNA_struct_identifier(ptr->type), propname);
105 return;
106 }
107
108 if (icon_value && !icon) {
109 icon = icon_value;
110 }
111
112 /* Get translated name (label). */
113 name = rna_translate_ui_text(name, text_ctxt, nullptr, prop, translate);
114 placeholder = rna_translate_ui_text(placeholder, text_ctxt, nullptr, prop, translate);
115
116 if (slider) {
118 }
119 if (expand) {
121 }
122
123 if (toggle == 1) {
125 }
126 else if (toggle == 0) {
128 }
129
130 if (icon_only) {
132 }
133 if (event) {
135 }
136 if (full_event) {
138 }
139 if (emboss == false) {
141 }
142 if (invert_checkbox) {
144 }
145
146 uiItemFullR(layout, ptr, prop, index, 0, flag, name, icon, placeholder);
147}
148
149static void rna_uiItemR_with_popover(uiLayout *layout,
151 const char *propname,
152 const char *name,
153 const char *text_ctxt,
154 bool translate,
155 int icon,
156 bool icon_only,
157 const char *panel_type)
158{
159 PropertyRNA *prop = RNA_struct_find_property(ptr, propname);
160
161 if (!prop) {
162 RNA_warning("property not found: %s.%s", RNA_struct_identifier(ptr->type), propname);
163 return;
164 }
165 if ((RNA_property_type(prop) != PROP_ENUM) &&
167 {
169 "property is not an enum or color: %s.%s", RNA_struct_identifier(ptr->type), propname);
170 return;
171 }
173 if (icon_only) {
175 }
176
177 /* Get translated name (label). */
178 name = rna_translate_ui_text(name, text_ctxt, nullptr, prop, translate);
179 uiItemFullR_with_popover(layout, ptr, prop, -1, 0, flag, name, icon, panel_type);
180}
181
182static void rna_uiItemR_with_menu(uiLayout *layout,
184 const char *propname,
185 const char *name,
186 const char *text_ctxt,
187 bool translate,
188 int icon,
189 bool icon_only,
190 const char *menu_type)
191{
192 PropertyRNA *prop = RNA_struct_find_property(ptr, propname);
193
194 if (!prop) {
195 RNA_warning("property not found: %s.%s", RNA_struct_identifier(ptr->type), propname);
196 return;
197 }
198 if (RNA_property_type(prop) != PROP_ENUM) {
199 RNA_warning("property is not an enum: %s.%s", RNA_struct_identifier(ptr->type), propname);
200 return;
201 }
203 if (icon_only) {
205 }
206
207 /* Get translated name (label). */
208 name = rna_translate_ui_text(name, text_ctxt, nullptr, prop, translate);
209 uiItemFullR_with_menu(layout, ptr, prop, -1, 0, flag, name, icon, menu_type);
210}
211
212static void rna_uiItemMenuEnumR(uiLayout *layout,
214 const char *propname,
215 const char *name,
216 const char *text_ctxt,
217 bool translate,
218 int icon)
219{
220 PropertyRNA *prop = RNA_struct_find_property(ptr, propname);
221
222 if (!prop) {
223 RNA_warning("property not found: %s.%s", RNA_struct_identifier(ptr->type), propname);
224 return;
225 }
226
227 /* Get translated name (label). */
228 name = rna_translate_ui_text(name, text_ctxt, nullptr, prop, translate);
229 uiItemMenuEnumR_prop(layout, ptr, prop, name, icon);
230}
231
232static void rna_uiItemTabsEnumR(uiLayout *layout,
233 bContext *C,
235 const char *propname,
236 PointerRNA *ptr_highlight,
237 const char *propname_highlight,
238 bool icon_only)
239{
240 PropertyRNA *prop = RNA_struct_find_property(ptr, propname);
241
242 if (!prop) {
243 RNA_warning("property not found: %s.%s", RNA_struct_identifier(ptr->type), propname);
244 return;
245 }
246 if (RNA_property_type(prop) != PROP_ENUM) {
247 RNA_warning("property is not an enum: %s.%s", RNA_struct_identifier(ptr->type), propname);
248 return;
249 }
250
251 /* Get the highlight property used to gray out some of the tabs. */
252 PropertyRNA *prop_highlight = nullptr;
253 if (!RNA_pointer_is_null(ptr_highlight)) {
254 prop_highlight = RNA_struct_find_property(ptr_highlight, propname_highlight);
255 if (!prop_highlight) {
256 RNA_warning("property not found: %s.%s",
257 RNA_struct_identifier(ptr_highlight->type),
258 propname_highlight);
259 return;
260 }
261 if (RNA_property_type(prop_highlight) != PROP_BOOLEAN) {
262 RNA_warning("property is not a boolean: %s.%s",
263 RNA_struct_identifier(ptr_highlight->type),
264 propname_highlight);
265 return;
266 }
267 if (!RNA_property_array_check(prop_highlight)) {
268 RNA_warning("property is not an array: %s.%s",
269 RNA_struct_identifier(ptr_highlight->type),
270 propname_highlight);
271 return;
272 }
273 }
274
275 uiItemTabsEnumR_prop(layout, C, ptr, prop, ptr_highlight, prop_highlight, icon_only);
276}
277
278static void rna_uiItemEnumR_string(uiLayout *layout,
280 const char *propname,
281 const char *value,
282 const char *name,
283 const char *text_ctxt,
284 bool translate,
285 int icon)
286{
287 PropertyRNA *prop = RNA_struct_find_property(ptr, propname);
288
289 if (!prop) {
290 RNA_warning("property not found: %s.%s", RNA_struct_identifier(ptr->type), propname);
291 return;
292 }
293
294 /* Get translated name (label). */
295 name = rna_translate_ui_text(name, text_ctxt, nullptr, prop, translate);
296
297 uiItemEnumR_string_prop(layout, ptr, prop, value, name, icon);
298}
299
300static void rna_uiItemPointerR(uiLayout *layout,
302 const char *propname,
303 PointerRNA *searchptr,
304 const char *searchpropname,
305 const char *name,
306 const char *text_ctxt,
307 bool translate,
308 int icon,
309 const bool results_are_suggestions)
310{
311 PropertyRNA *prop = RNA_struct_find_property(ptr, propname);
312 if (!prop) {
313 RNA_warning("property not found: %s.%s", RNA_struct_identifier(ptr->type), propname);
314 return;
315 }
316 PropertyRNA *searchprop = RNA_struct_find_property(searchptr, searchpropname);
317 if (!searchprop) {
319 "property not found: %s.%s", RNA_struct_identifier(searchptr->type), searchpropname);
320 return;
321 }
322
323 /* Get translated name (label). */
324 name = rna_translate_ui_text(name, text_ctxt, nullptr, prop, translate);
325
327 layout, ptr, prop, searchptr, searchprop, name, icon, results_are_suggestions);
328}
329
330static PointerRNA rna_uiItemO(uiLayout *layout,
331 const char *opname,
332 const char *name,
333 const char *text_ctxt,
334 bool translate,
335 int icon,
336 bool emboss,
337 bool depress,
338 int icon_value,
339 const float search_weight)
340{
342
343 ot = WM_operatortype_find(opname, false); /* print error next */
344 if (!ot || !ot->srna) {
345 RNA_warning("%s '%s'", ot ? "operator missing srna" : "unknown operator", opname);
346 return PointerRNA_NULL;
347 }
348
349 /* Get translated name (label). */
350 name = rna_translate_ui_text(name, text_ctxt, ot->srna, nullptr, translate);
351
352 if (icon_value && !icon) {
353 icon = icon_value;
354 }
356 if (emboss == false) {
358 }
359 if (depress) {
361 }
362
363 const float prev_weight = uiLayoutGetSearchWeight(layout);
364 uiLayoutSetSearchWeight(layout, search_weight);
365
366 PointerRNA opptr;
368 layout, ot, name, icon, nullptr, uiLayoutGetOperatorContext(layout), flag, &opptr);
369
370 uiLayoutSetSearchWeight(layout, prev_weight);
371 return opptr;
372}
373
374static PointerRNA rna_uiItemOMenuHold(uiLayout *layout,
375 const char *opname,
376 const char *name,
377 const char *text_ctxt,
378 bool translate,
379 int icon,
380 bool emboss,
381 bool depress,
382 int icon_value,
383 const char *menu)
384{
385 wmOperatorType *ot = WM_operatortype_find(opname, false); /* print error next */
386 if (!ot || !ot->srna) {
387 RNA_warning("%s '%s'", ot ? "operator missing srna" : "unknown operator", opname);
388 return PointerRNA_NULL;
389 }
390
391 /* Get translated name (label). */
392 name = rna_translate_ui_text(name, text_ctxt, ot->srna, nullptr, translate);
393 if (icon_value && !icon) {
394 icon = icon_value;
395 }
397 if (emboss == false) {
399 }
400 if (depress) {
402 }
403
404 PointerRNA opptr;
406 layout, ot, name, icon, nullptr, uiLayoutGetOperatorContext(layout), flag, menu, &opptr);
407 return opptr;
408}
409
410static void rna_uiItemsEnumO(uiLayout *layout,
411 const char *opname,
412 const char *propname,
413 const bool icon_only)
414{
416 uiItemsFullEnumO(layout, opname, propname, nullptr, uiLayoutGetOperatorContext(layout), flag);
417}
418
419static PointerRNA rna_uiItemMenuEnumO(uiLayout *layout,
420 bContext *C,
421 const char *opname,
422 const char *propname,
423 const char *name,
424 const char *text_ctxt,
425 bool translate,
426 int icon)
427{
428 wmOperatorType *ot = WM_operatortype_find(opname, false); /* print error next */
429
430 if (!ot || !ot->srna) {
431 RNA_warning("%s '%s'", ot ? "operator missing srna" : "unknown operator", opname);
432 return PointerRNA_NULL;
433 }
434
435 /* Get translated name (label). */
436 name = rna_translate_ui_text(name, text_ctxt, ot->srna, nullptr, translate);
437
438 PointerRNA opptr;
439 uiItemMenuEnumFullO_ptr(layout, C, ot, propname, name, icon, &opptr);
440 return opptr;
441}
442
443static void rna_uiItemL(uiLayout *layout,
444 const char *name,
445 const char *text_ctxt,
446 bool translate,
447 int icon,
448 int icon_value)
449{
450 /* Get translated name (label). */
451 name = rna_translate_ui_text(name, text_ctxt, nullptr, nullptr, translate);
452
453 if (icon_value && !icon) {
454 icon = icon_value;
455 }
456
457 uiItemL(layout, name, icon);
458}
459
460static void rna_uiItemM(uiLayout *layout,
461 const char *menuname,
462 const char *name,
463 const char *text_ctxt,
464 bool translate,
465 int icon,
466 int icon_value)
467{
468 /* Get translated name (label). */
469 name = rna_translate_ui_text(name, text_ctxt, nullptr, nullptr, translate);
470
471 if (icon_value && !icon) {
472 icon = icon_value;
473 }
474
475 uiItemM(layout, menuname, name, icon);
476}
477
478static void rna_uiItemM_contents(uiLayout *layout, const char *menuname)
479{
480 uiItemMContents(layout, menuname);
481}
482
483static void rna_uiItemPopoverPanel(uiLayout *layout,
484 bContext *C,
485 const char *panel_type,
486 const char *name,
487 const char *text_ctxt,
488 bool translate,
489 int icon,
490 int icon_value)
491{
492 /* Get translated name (label). */
493 name = rna_translate_ui_text(name, text_ctxt, nullptr, nullptr, translate);
494
495 if (icon_value && !icon) {
496 icon = icon_value;
497 }
498
499 uiItemPopoverPanel(layout, C, panel_type, name, icon);
500}
501
502static void rna_uiItemPopoverPanelFromGroup(uiLayout *layout,
503 bContext *C,
504 int space_id,
505 int region_id,
506 const char *context,
507 const char *category)
508{
509 uiItemPopoverPanelFromGroup(layout, C, space_id, region_id, context, category);
510}
511
512static void rna_uiItemProgress(uiLayout *layout,
513 const char *text,
514 const char *text_ctxt,
515 bool translate,
516 float factor,
517 int progress_type)
518{
519 if (translate && BLT_translate_iface()) {
520 text = BLT_pgettext((text_ctxt && text_ctxt[0]) ? text_ctxt : BLT_I18NCONTEXT_DEFAULT, text);
521 }
522
523 uiItemProgressIndicator(layout, text, factor, eButProgressType(progress_type));
524}
525
526static void rna_uiItemSeparator(uiLayout *layout, float factor, int type)
527{
528 uiItemS_ex(layout, factor, LayoutSeparatorType(type));
529}
530
531static void rna_uiTemplateID(uiLayout *layout,
532 bContext *C,
534 const char *propname,
535 const char *newop,
536 const char *openop,
537 const char *unlinkop,
538 int filter,
539 const bool live_icon,
540 const char *name,
541 const char *text_ctxt,
542 bool translate)
543{
544 PropertyRNA *prop = RNA_struct_find_property(ptr, propname);
545
546 if (!prop) {
547 RNA_warning("property not found: %s.%s", RNA_struct_identifier(ptr->type), propname);
548 return;
549 }
550
551 /* Get translated name (label). */
552 name = rna_translate_ui_text(name, text_ctxt, nullptr, prop, translate);
553
554 uiTemplateID(layout, C, ptr, propname, newop, openop, unlinkop, filter, live_icon, name);
555}
556
557static void rna_uiTemplateAnyID(uiLayout *layout,
559 const char *propname,
560 const char *proptypename,
561 const char *name,
562 const char *text_ctxt,
563 bool translate)
564{
565 PropertyRNA *prop = RNA_struct_find_property(ptr, propname);
566
567 if (!prop) {
568 RNA_warning("property not found: %s.%s", RNA_struct_identifier(ptr->type), propname);
569 return;
570 }
571
572 /* Get translated name (label). */
573 name = rna_translate_ui_text(name, text_ctxt, nullptr, prop, translate);
574
575 /* XXX This will search property again :( */
576 uiTemplateAnyID(layout, ptr, propname, proptypename, name);
577}
578
579static void rna_uiTemplateAction(uiLayout *layout,
580 bContext *C,
581 ID *id,
582 const char *newop,
583 const char *unlinkop,
584 const char *name,
585 const char *text_ctxt,
586 const bool translate)
587{
588 name = rna_translate_ui_text(name, text_ctxt, nullptr, nullptr, translate);
589 uiTemplateAction(layout, C, id, newop, unlinkop, name);
590}
591
592static void rna_uiTemplateSearch(uiLayout *layout,
593 const bContext *C,
595 const char *propname,
596 PointerRNA *searchptr,
597 const char *searchpropname,
598 const char *newop,
599 const char *unlinkop,
600 const char *name,
601 const char *text_ctxt,
602 bool translate)
603{
604 PropertyRNA *prop = RNA_struct_find_property(ptr, propname);
605
606 if (!prop) {
607 RNA_warning("property not found: %s.%s", RNA_struct_identifier(ptr->type), propname);
608 return;
609 }
610
611 /* Get translated name (label). */
612 name = rna_translate_ui_text(name, text_ctxt, nullptr, prop, translate);
613
614 uiTemplateSearch(layout, C, ptr, propname, searchptr, searchpropname, newop, unlinkop, name);
615}
616
617static void rna_uiTemplateSearchPreview(uiLayout *layout,
618 bContext *C,
620 const char *propname,
621 PointerRNA *searchptr,
622 const char *searchpropname,
623 const char *newop,
624 const char *unlinkop,
625 const char *name,
626 const char *text_ctxt,
627 bool translate,
628 const int rows,
629 const int cols)
630{
631 PropertyRNA *prop = RNA_struct_find_property(ptr, propname);
632
633 if (!prop) {
634 RNA_warning("property not found: %s.%s", RNA_struct_identifier(ptr->type), propname);
635 return;
636 }
637
638 /* Get translated name (label). */
639 name = rna_translate_ui_text(name, text_ctxt, nullptr, prop, translate);
640
642 layout, C, ptr, propname, searchptr, searchpropname, newop, unlinkop, rows, cols, name);
643}
644
645void rna_uiTemplateList(uiLayout *layout,
646 bContext *C,
647 const char *listtype_name,
648 const char *list_id,
649 PointerRNA *dataptr,
650 const char *propname,
651 PointerRNA *active_dataptr,
652 const char *active_propname,
653 const char *item_dyntip_propname,
654 const int rows,
655 const int maxrows,
656 const int layout_type,
657 const int columns,
658 const bool sort_reverse,
659 const bool sort_lock)
660{
662 if (sort_reverse) {
664 }
665 if (sort_lock) {
667 }
668
669 uiTemplateList(layout,
670 C,
671 listtype_name,
672 list_id,
673 dataptr,
674 propname,
675 active_dataptr,
676 active_propname,
677 item_dyntip_propname,
678 rows,
679 maxrows,
680 layout_type,
681 columns,
682 flags);
683}
684
685static void rna_uiTemplateCacheFile(uiLayout *layout,
686 bContext *C,
688 const char *propname)
689{
690 PropertyRNA *prop = RNA_struct_find_property(ptr, propname);
691
692 if (!prop) {
693 RNA_warning("property not found: %s.%s", RNA_struct_identifier(ptr->type), propname);
694 return;
695 }
696
697 uiTemplateCacheFile(layout, C, ptr, propname);
698}
699
700static void rna_uiTemplateCacheFileVelocity(uiLayout *layout,
702 const char *propname)
703{
704 PointerRNA fileptr;
705 if (!uiTemplateCacheFilePointer(ptr, propname, &fileptr)) {
706 return;
707 }
708
709 uiTemplateCacheFileVelocity(layout, &fileptr);
710}
711
712static void rna_uiTemplateCacheFileProcedural(uiLayout *layout,
713 bContext *C,
715 const char *propname)
716{
717 PointerRNA fileptr;
718 if (!uiTemplateCacheFilePointer(ptr, propname, &fileptr)) {
719 return;
720 }
721
722 uiTemplateCacheFileProcedural(layout, C, &fileptr);
723}
724
725static void rna_uiTemplateCacheFileTimeSettings(uiLayout *layout,
727 const char *propname)
728{
729 PointerRNA fileptr;
730 if (!uiTemplateCacheFilePointer(ptr, propname, &fileptr)) {
731 return;
732 }
733
734 uiTemplateCacheFileTimeSettings(layout, &fileptr);
735}
736
737static void rna_uiTemplateCacheFileLayers(uiLayout *layout,
738 bContext *C,
740 const char *propname)
741{
742 PointerRNA fileptr;
743 if (!uiTemplateCacheFilePointer(ptr, propname, &fileptr)) {
744 return;
745 }
746
747 uiTemplateCacheFileLayers(layout, C, &fileptr);
748}
749
750static void rna_uiTemplatePathBuilder(uiLayout *layout,
752 const char *propname,
753 PointerRNA *root_ptr,
754 const char *name,
755 const char *text_ctxt,
756 bool translate)
757{
758 PropertyRNA *prop = RNA_struct_find_property(ptr, propname);
759
760 if (!prop) {
761 RNA_warning("property not found: %s.%s", RNA_struct_identifier(ptr->type), propname);
762 return;
763 }
764
765 /* Get translated name (label). */
766 name = rna_translate_ui_text(name, text_ctxt, nullptr, prop, translate);
767
768 /* XXX This will search property again :( */
769 uiTemplatePathBuilder(layout, ptr, propname, root_ptr, name);
770}
771
772static void rna_uiTemplateEventFromKeymapItem(
773 uiLayout *layout, wmKeyMapItem *kmi, const char *name, const char *text_ctxt, bool translate)
774{
775 /* Get translated name (label). */
776 name = rna_translate_ui_text(name, text_ctxt, nullptr, nullptr, translate);
777 uiTemplateEventFromKeymapItem(layout, name, kmi, true);
778}
779
780static void rna_uiTemplateAssetView(uiLayout *layout,
781 bContext *C,
782 const char *list_id,
783 PointerRNA *asset_library_dataptr,
784 const char *asset_library_propname,
785 PointerRNA *assets_dataptr,
786 const char *assets_propname,
787 PointerRNA *active_dataptr,
788 const char *active_propname,
789 int filter_id_types,
790 int display_flags,
791 const char *activate_opname,
792 PointerRNA *r_activate_op_properties,
793 const char *drag_opname,
794 PointerRNA *r_drag_op_properties)
795{
797 filter_settings.id_types = filter_id_types ? filter_id_types : FILTER_ID_ALL;
798
799 uiTemplateAssetView(layout,
800 C,
801 list_id,
802 asset_library_dataptr,
803 asset_library_propname,
804 assets_dataptr,
805 assets_propname,
806 active_dataptr,
807 active_propname,
808 &filter_settings,
809 display_flags,
810 activate_opname,
811 r_activate_op_properties,
812 drag_opname,
813 r_drag_op_properties);
814}
815
820static const EnumPropertyItem *rna_uiTemplateAssetView_filter_id_types_itemf(
821 bContext * /*C*/, PointerRNA * /*ptr*/, PropertyRNA * /*prop*/, bool *r_free)
822{
823 EnumPropertyItem *items = nullptr;
824 int totitem = 0;
825
826 for (int i = 0; rna_enum_id_type_filter_items[i].identifier; i++) {
827 if (rna_enum_id_type_filter_items[i].flag > (1ULL << 31)) {
828 continue;
829 }
830
831 EnumPropertyItem tmp = {0, "", 0, "", ""};
837 RNA_enum_item_add(&items, &totitem, &tmp);
838 }
839 RNA_enum_item_end(&items, &totitem);
840
841 *r_free = true;
842 return items;
843}
844
845static uiLayout *rna_uiLayoutRowWithHeading(
846 uiLayout *layout, bool align, const char *heading, const char *heading_ctxt, bool translate)
847{
848 /* Get translated heading. */
849 heading = rna_translate_ui_text(heading, heading_ctxt, nullptr, nullptr, translate);
850 return uiLayoutRowWithHeading(layout, align, heading);
851}
852
853static uiLayout *rna_uiLayoutColumnWithHeading(
854 uiLayout *layout, bool align, const char *heading, const char *heading_ctxt, bool translate)
855{
856 /* Get translated heading. */
857 heading = rna_translate_ui_text(heading, heading_ctxt, nullptr, nullptr, translate);
858 return uiLayoutColumnWithHeading(layout, align, heading);
859}
860
861void rna_uiLayoutPanelProp(uiLayout *layout,
862 bContext *C,
863 ReportList *reports,
864 PointerRNA *data,
865 const char *property,
866 uiLayout **r_layout_header,
867 uiLayout **r_layout_body)
868{
869 Panel *panel = uiLayoutGetRootPanel(layout);
870 if (panel == nullptr) {
871 BKE_reportf(reports, RPT_ERROR, "Layout panels can not be used in this context");
872 *r_layout_header = nullptr;
873 *r_layout_body = nullptr;
874 return;
875 }
876
877 PanelLayout panel_layout = uiLayoutPanelProp(C, layout, data, property);
878 *r_layout_header = panel_layout.header;
879 *r_layout_body = panel_layout.body;
880}
881
882void rna_uiLayoutPanel(uiLayout *layout,
883 bContext *C,
884 ReportList *reports,
885 const char *idname,
886 const bool default_closed,
887 uiLayout **r_layout_header,
888 uiLayout **r_layout_body)
889{
890 Panel *panel = uiLayoutGetRootPanel(layout);
891 if (panel == nullptr) {
892 BKE_reportf(reports, RPT_ERROR, "Layout panels can not be used in this context");
893 *r_layout_header = nullptr;
894 *r_layout_body = nullptr;
895 return;
896 }
897 PanelLayout panel_layout = uiLayoutPanel(C, layout, idname, default_closed);
898 *r_layout_header = panel_layout.header;
899 *r_layout_body = panel_layout.body;
900}
901
902static void rna_uiLayout_template_node_asset_menu_items(uiLayout *layout,
903 bContext *C,
904 const char *catalog_path)
905{
906 using namespace blender;
907 ed::space_node::ui_template_node_asset_menu_items(*layout, *C, StringRef(catalog_path));
908}
909
910static void rna_uiLayout_template_node_operator_asset_menu_items(uiLayout *layout,
911 bContext *C,
912 const char *catalog_path)
913{
914 using namespace blender;
915 ed::geometry::ui_template_node_operator_asset_menu_items(*layout, *C, StringRef(catalog_path));
916}
917
918static void rna_uiLayout_template_modifier_asset_menu_items(uiLayout *layout,
919 const char *catalog_path)
920{
921 using namespace blender;
922 ed::object::ui_template_modifier_asset_menu_items(*layout, StringRef(catalog_path));
923}
924
925static void rna_uiLayout_template_node_operator_root_items(uiLayout *layout, bContext *C)
926{
928}
929
930static int rna_ui_get_rnaptr_icon(bContext *C, PointerRNA *ptr_icon)
931{
932 return UI_icon_from_rnaptr(C, ptr_icon, RNA_struct_ui_icon(ptr_icon->type), false);
933}
934
935static const char *rna_ui_get_enum_name(bContext *C,
937 const char *propname,
938 const char *identifier)
939{
940 PropertyRNA *prop = nullptr;
941 const EnumPropertyItem *items = nullptr;
942 bool free;
943 const char *name = "";
944
945 prop = RNA_struct_find_property(ptr, propname);
946 if (!prop || (RNA_property_type(prop) != PROP_ENUM)) {
948 "Property not found or not an enum: %s.%s", RNA_struct_identifier(ptr->type), propname);
949 return name;
950 }
951
952 RNA_property_enum_items_gettexted(C, ptr, prop, &items, nullptr, &free);
953
954 if (items) {
955 const int index = RNA_enum_from_identifier(items, identifier);
956 if (index != -1) {
957 name = items[index].name;
958 }
959 if (free) {
960 MEM_freeN((void *)items);
961 }
962 }
963
964 return name;
965}
966
967static const char *rna_ui_get_enum_description(bContext *C,
969 const char *propname,
970 const char *identifier)
971{
972 PropertyRNA *prop = nullptr;
973 const EnumPropertyItem *items = nullptr;
974 bool free;
975 const char *desc = "";
976
977 prop = RNA_struct_find_property(ptr, propname);
978 if (!prop || (RNA_property_type(prop) != PROP_ENUM)) {
980 "Property not found or not an enum: %s.%s", RNA_struct_identifier(ptr->type), propname);
981 return desc;
982 }
983
984 RNA_property_enum_items_gettexted(C, ptr, prop, &items, nullptr, &free);
985
986 if (items) {
987 const int index = RNA_enum_from_identifier(items, identifier);
988 if (index != -1) {
989 desc = items[index].description;
990 }
991 if (free) {
992 MEM_freeN((void *)items);
993 }
994 }
995
996 return desc;
997}
998
999static int rna_ui_get_enum_icon(bContext *C,
1000 PointerRNA *ptr,
1001 const char *propname,
1002 const char *identifier)
1003{
1004 PropertyRNA *prop = nullptr;
1005 const EnumPropertyItem *items = nullptr;
1006 bool free;
1007 int icon = ICON_NONE;
1008
1009 prop = RNA_struct_find_property(ptr, propname);
1010 if (!prop || (RNA_property_type(prop) != PROP_ENUM)) {
1012 "Property not found or not an enum: %s.%s", RNA_struct_identifier(ptr->type), propname);
1013 return icon;
1014 }
1015
1016 RNA_property_enum_items(C, ptr, prop, &items, nullptr, &free);
1017
1018 if (items) {
1019 const int index = RNA_enum_from_identifier(items, identifier);
1020 if (index != -1) {
1021 icon = items[index].icon;
1022 }
1023 if (free) {
1024 MEM_freeN((void *)items);
1025 }
1026 }
1027
1028 return icon;
1029}
1030
1031void rna_uiTemplateAssetShelfPopover(uiLayout *layout,
1032 bContext *C,
1033 const char *asset_shelf_id,
1034 const char *name,
1035 BIFIconID icon,
1036 int icon_value)
1037{
1038 if (icon_value && !icon) {
1039 icon = icon_value;
1040 }
1041
1042 blender::ui::template_asset_shelf_popover(*layout, *C, asset_shelf_id, name ? name : "", icon);
1043}
1044
1045PointerRNA rna_uiTemplatePopupConfirm(uiLayout *layout,
1046 ReportList *reports,
1047 const char *opname,
1048 const char *text,
1049 const char *text_ctxt,
1050 bool translate,
1051 int icon,
1052 const char *cancel_text,
1053 bool cancel_default)
1054{
1056
1057 /* This allows overriding buttons in `WM_operator_props_dialog_popup` and other popups. */
1058 wmOperatorType *ot = nullptr;
1059 if (opname[0]) {
1060 /* Confirming is optional. */
1061 ot = WM_operatortype_find(opname, false); /* print error next */
1062 }
1063 else {
1064 text = "";
1065 }
1066
1067 if (opname[0] ? (!ot || !ot->srna) : false) {
1068 RNA_warning("%s '%s'", ot ? "operator missing srna" : "unknown operator", opname);
1069 }
1071 BKE_reportf(reports, RPT_ERROR, "template_popup_confirm used outside of a popup");
1072 }
1073 else {
1074 text = rna_translate_ui_text(text, text_ctxt, nullptr, nullptr, translate);
1075 if (cancel_text && cancel_text[0]) {
1076 cancel_text = rna_translate_ui_text(cancel_text, text_ctxt, nullptr, nullptr, translate);
1077 }
1078
1080 layout, ot, text, cancel_text, icon, cancel_default, &opptr);
1081 }
1082 return opptr;
1083}
1084
1085#else
1086
1088{
1089 RNA_def_string(func,
1090 "heading",
1091 nullptr,
1093 "Heading",
1094 "Label to insert into the layout for this sub-layout");
1095 RNA_def_string(func,
1096 "heading_ctxt",
1097 nullptr,
1098 0,
1099 "",
1100 "Override automatic translation context of the given heading");
1102 func, "translate", true, "", "Translate the given heading, when UI translation is enabled");
1103}
1104
1106{
1107 PropertyRNA *prop = RNA_def_string(func,
1108 "text_ctxt",
1109 nullptr,
1110 0,
1111 "",
1112 "Override automatic translation context of the given text");
1115 func, "translate", true, "", "Translate the given text, when UI translation is enabled");
1116}
1117
1119{
1120 PropertyRNA *prop;
1121
1122 prop = RNA_def_string(func, "text", nullptr, 0, "", "Override automatic text of the item");
1125}
1126
1128{
1129 PropertyRNA *prop;
1130
1132
1133 prop = RNA_def_property(func, "icon", PROP_ENUM, PROP_NONE);
1135 RNA_def_property_ui_text(prop, "Icon", "Override automatic icon of the item");
1136}
1137
1138static void api_ui_item_op(FunctionRNA *func)
1139{
1140 PropertyRNA *parm;
1141 parm = RNA_def_string(func, "operator", nullptr, 0, "", "Identifier of the operator");
1143}
1144
1146{
1147 api_ui_item_op(func);
1148 api_ui_item_common(func);
1149}
1150
1152{
1153 PropertyRNA *parm;
1154
1155 parm = RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take property");
1157 parm = RNA_def_string(func, "property", nullptr, 0, "", "Identifier of property in data");
1159}
1160
1162{
1163 FunctionRNA *func;
1164 PropertyRNA *parm;
1165
1166 static const EnumPropertyItem curve_type_items[] = {
1167 {0, "NONE", 0, "None", ""},
1168 {'v', "VECTOR", 0, "Vector", ""},
1169 {'c', "COLOR", 0, "Color", ""},
1170 {'h', "HUE", 0, "Hue", ""},
1171 {0, nullptr, 0, nullptr, nullptr},
1172 };
1173
1174 static const EnumPropertyItem id_template_filter_items[] = {
1175 {UI_TEMPLATE_ID_FILTER_ALL, "ALL", 0, "All", ""},
1176 {UI_TEMPLATE_ID_FILTER_AVAILABLE, "AVAILABLE", 0, "Available", ""},
1177 {0, nullptr, 0, nullptr, nullptr},
1178 };
1179
1180 static const EnumPropertyItem progress_type_items[] = {
1181 {UI_BUT_PROGRESS_TYPE_BAR, "BAR", 0, "Bar", ""},
1182 {UI_BUT_PROGRESS_TYPE_RING, "RING", 0, "Ring", ""},
1183 {0, nullptr, 0, nullptr, nullptr},
1184 };
1185
1186 static const EnumPropertyItem asset_view_template_options[] = {
1188 "NO_NAMES",
1189 0,
1190 "",
1191 "Do not display the name of each asset underneath preview images"},
1193 "NO_FILTER",
1194 0,
1195 "",
1196 "Do not display buttons for filtering the available assets"},
1198 "NO_LIBRARY",
1199 0,
1200 "",
1201 "Do not display buttons to choose or refresh an asset library"},
1202 {0, nullptr, 0, nullptr, nullptr},
1203 };
1204
1205 static const EnumPropertyItem rna_enum_separator_type_items[] = {
1207 "AUTO",
1208 0,
1209 "Auto",
1210 "Best guess at what type of separator is needed."},
1212 "SPACE",
1213 0,
1214 "Empty space",
1215 "Horizontal or Vertical empty space, depending on layout direction."},
1217 "LINE",
1218 0,
1219 "Line",
1220 "Horizontal or Vertical line, depending on layout direction."},
1221 {0, nullptr, 0, nullptr, nullptr},
1222 };
1223
1224 static const float node_socket_color_default[] = {0.0f, 0.0f, 0.0f, 1.0f};
1225
1226 /* simple layout specifiers */
1227 func = RNA_def_function(srna, "row", "rna_uiLayoutRowWithHeading");
1228 parm = RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in");
1229 RNA_def_function_return(func, parm);
1231 func,
1232 "Sub-layout. Items placed in this sublayout are placed next to each other "
1233 "in a row.");
1234 RNA_def_boolean(func, "align", false, "", "Align buttons to each other");
1236
1237 func = RNA_def_function(srna, "column", "rna_uiLayoutColumnWithHeading");
1238 parm = RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in");
1239 RNA_def_function_return(func, parm);
1241 func,
1242 "Sub-layout. Items placed in this sublayout are placed under each other "
1243 "in a column.");
1244 RNA_def_boolean(func, "align", false, "", "Align buttons to each other");
1246
1247 func = RNA_def_function(srna, "panel", "rna_uiLayoutPanel");
1249 func,
1250 "Creates a collapsable panel. Whether it is open or closed is stored in the region using "
1251 "the given idname. This can only be used when the panel has the full width of the panel "
1252 "region available to it. So it can't be used in e.g. in a box or columns.");
1254 parm = RNA_def_string(func, "idname", nullptr, 0, "", "Identifier of the panel");
1256 RNA_def_boolean(func,
1257 "default_closed",
1258 false,
1259 "Open by Default",
1260 "When true, the panel will be open the first time it is shown");
1261 parm = RNA_def_pointer(func, "layout_header", "UILayout", "", "Sub-layout to put items in");
1262 RNA_def_function_output(func, parm);
1263 parm = RNA_def_pointer(func,
1264 "layout_body",
1265 "UILayout",
1266 "",
1267 "Sub-layout to put items in. Will be none if the panel is collapsed.");
1268 RNA_def_function_output(func, parm);
1269
1270 func = RNA_def_function(srna, "panel_prop", "rna_uiLayoutPanelProp");
1272 func,
1273 "Similar to `.panel(...)` but instead of storing whether it is open or closed in the "
1274 "region, it is stored in the provided boolean property. This should be used when multiple "
1275 "instances of the same panel can exist. For example one for every item in a collection "
1276 "property or list. This can only be used when the panel has the full width of the panel "
1277 "region available to it. So it can't be used in e.g. in a box or columns.");
1279 parm = RNA_def_pointer(
1280 func, "data", "AnyType", "", "Data from which to take the open-state property");
1282 parm = RNA_def_string(
1283 func,
1284 "property",
1285 nullptr,
1286 0,
1287 "",
1288 "Identifier of the boolean property that determines whether the panel is open or closed");
1290 parm = RNA_def_pointer(func, "layout_header", "UILayout", "", "Sub-layout to put items in");
1291 RNA_def_function_output(func, parm);
1292 parm = RNA_def_pointer(func,
1293 "layout_body",
1294 "UILayout",
1295 "",
1296 "Sub-layout to put items in. Will be none if the panel is collapsed.");
1297 RNA_def_function_output(func, parm);
1298
1299 func = RNA_def_function(srna, "column_flow", "uiLayoutColumnFlow");
1300 RNA_def_int(func, "columns", 0, 0, INT_MAX, "", "Number of columns, 0 is automatic", 0, INT_MAX);
1301 parm = RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in");
1302 RNA_def_function_return(func, parm);
1303 RNA_def_boolean(func, "align", false, "", "Align buttons to each other");
1304
1305 func = RNA_def_function(srna, "grid_flow", "uiLayoutGridFlow");
1306 RNA_def_boolean(func, "row_major", false, "", "Fill row by row, instead of column by column");
1308 func,
1309 "columns",
1310 0,
1311 INT_MIN,
1312 INT_MAX,
1313 "",
1314 "Number of columns, positive are absolute fixed numbers, 0 is automatic, negative are "
1315 "automatic multiple numbers along major axis (e.g. -2 will only produce 2, 4, 6 etc. "
1316 "columns for row major layout, and 2, 4, 6 etc. rows for column major layout).",
1317 INT_MIN,
1318 INT_MAX);
1319 RNA_def_boolean(func, "even_columns", false, "", "All columns will have the same width");
1320 RNA_def_boolean(func, "even_rows", false, "", "All rows will have the same height");
1321 RNA_def_boolean(func, "align", false, "", "Align buttons to each other");
1322 parm = RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in");
1323 RNA_def_function_return(func, parm);
1324
1325 /* box layout */
1326 func = RNA_def_function(srna, "box", "uiLayoutBox");
1327 parm = RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in");
1328 RNA_def_function_return(func, parm);
1330 "Sublayout (items placed in this sublayout are placed "
1331 "under each other in a column and are surrounded by a box)");
1332
1333 /* split layout */
1334 func = RNA_def_function(srna, "split", "uiLayoutSplit");
1335 parm = RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in");
1336 RNA_def_function_return(func, parm);
1337 RNA_def_float(func,
1338 "factor",
1339 0.0f,
1340 0.0f,
1341 1.0f,
1342 "Percentage",
1343 "Percentage of width to split at (leave unset for automatic calculation)",
1344 0.0f,
1345 1.0f);
1346 RNA_def_boolean(func, "align", false, "", "Align buttons to each other");
1347
1348 /* radial/pie layout */
1349 func = RNA_def_function(srna, "menu_pie", "uiLayoutRadial");
1350 parm = RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in");
1351 RNA_def_function_return(func, parm);
1353 "Sublayout. Items placed in this sublayout are placed "
1354 "in a radial fashion around the menu center).");
1355
1356 /* Icon of a rna pointer */
1357 func = RNA_def_function(srna, "icon", "rna_ui_get_rnaptr_icon");
1358 parm = RNA_def_int(func, "icon_value", ICON_NONE, 0, INT_MAX, "", "Icon identifier", 0, INT_MAX);
1359 RNA_def_function_return(func, parm);
1361 parm = RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take the icon");
1364 "Return the custom icon for this data, "
1365 "use it e.g. to get materials or texture icons.");
1366
1367 /* UI name, description and icon of an enum item */
1368 func = RNA_def_function(srna, "enum_item_name", "rna_ui_get_enum_name");
1369 parm = RNA_def_string(func, "name", nullptr, 0, "", "UI name of the enum item");
1370 RNA_def_function_return(func, parm);
1373 parm = RNA_def_string(func, "identifier", nullptr, 0, "", "Identifier of the enum item");
1375 RNA_def_function_ui_description(func, "Return the UI name for this enum item");
1376
1377 func = RNA_def_function(srna, "enum_item_description", "rna_ui_get_enum_description");
1378 parm = RNA_def_string(func, "description", nullptr, 0, "", "UI description of the enum item");
1379 RNA_def_function_return(func, parm);
1382 parm = RNA_def_string(func, "identifier", nullptr, 0, "", "Identifier of the enum item");
1384 RNA_def_function_ui_description(func, "Return the UI description for this enum item");
1385
1386 func = RNA_def_function(srna, "enum_item_icon", "rna_ui_get_enum_icon");
1387 parm = RNA_def_int(func, "icon_value", ICON_NONE, 0, INT_MAX, "", "Icon identifier", 0, INT_MAX);
1388 RNA_def_function_return(func, parm);
1391 parm = RNA_def_string(func, "identifier", nullptr, 0, "", "Identifier of the enum item");
1393 RNA_def_function_ui_description(func, "Return the icon for this enum item");
1394
1395 /* items */
1396 func = RNA_def_function(srna, "prop", "rna_uiItemR");
1398 "Item. Exposes an RNA item and places it into the layout.");
1400 api_ui_item_common(func);
1402 func, "placeholder", nullptr, 0, "", "Hint describing the expected value when empty");
1404 RNA_def_boolean(func, "expand", false, "", "Expand button to show more detail");
1405 RNA_def_boolean(func, "slider", false, "", "Use slider widget for numeric values");
1406 RNA_def_int(func,
1407 "toggle",
1408 -1,
1409 -1,
1410 1,
1411 "",
1412 "Use toggle widget for boolean values, "
1413 "or a checkbox when disabled "
1414 "(the default is -1 which uses toggle only when an icon is displayed)",
1415 -1,
1416 1);
1417 RNA_def_boolean(func, "icon_only", false, "", "Draw only icons in buttons, no text");
1418 RNA_def_boolean(func, "event", false, "", "Use button to input key events");
1420 func, "full_event", false, "", "Use button to input full events including modifiers");
1421 RNA_def_boolean(func,
1422 "emboss",
1423 true,
1424 "",
1425 "Draw the button itself, not just the icon/text. When false, corresponds to the "
1426 "'NONE_OR_STATUS' layout emboss type.");
1427 RNA_def_int(func,
1428 "index",
1429 /* RNA_NO_INDEX == -1 */
1430 -1,
1431 -2,
1432 INT_MAX,
1433 "",
1434 "The index of this button, when set a single member of an array can be accessed, "
1435 "when set to -1 all array members are used",
1436 -2,
1437 INT_MAX);
1438 parm = RNA_def_property(func, "icon_value", PROP_INT, PROP_UNSIGNED);
1439 RNA_def_property_ui_text(parm, "Icon Value", "Override automatic icon of the item");
1440 RNA_def_boolean(func, "invert_checkbox", false, "", "Draw checkbox value inverted");
1441
1442 func = RNA_def_function(srna, "props_enum", "uiItemsEnumR");
1444
1445 func = RNA_def_function(srna, "prop_menu_enum", "rna_uiItemMenuEnumR");
1447 api_ui_item_common(func);
1448
1449 func = RNA_def_function(srna, "prop_with_popover", "rna_uiItemR_with_popover");
1451 api_ui_item_common(func);
1452 RNA_def_boolean(func, "icon_only", false, "", "Draw only icons in tabs, no text");
1453 parm = RNA_def_string(func, "panel", nullptr, 0, "", "Identifier of the panel");
1455
1456 func = RNA_def_function(srna, "prop_with_menu", "rna_uiItemR_with_menu");
1458 api_ui_item_common(func);
1459 RNA_def_boolean(func, "icon_only", false, "", "Draw only icons in tabs, no text");
1460 parm = RNA_def_string(func, "menu", nullptr, 0, "", "Identifier of the menu");
1462
1463 func = RNA_def_function(srna, "prop_tabs_enum", "rna_uiItemTabsEnumR");
1466 parm = RNA_def_pointer(
1467 func, "data_highlight", "AnyType", "", "Data from which to take highlight property");
1469 parm = RNA_def_string(
1470 func, "property_highlight", nullptr, 0, "", "Identifier of highlight property in data");
1471 RNA_def_boolean(func, "icon_only", false, "", "Draw only icons in tabs, no text");
1472
1473 func = RNA_def_function(srna, "prop_enum", "rna_uiItemEnumR_string");
1475 parm = RNA_def_string(func, "value", nullptr, 0, "", "Enum property value");
1477 api_ui_item_common(func);
1478
1479 func = RNA_def_function(srna, "prop_search", "rna_uiItemPointerR");
1481 parm = RNA_def_pointer(
1482 func, "search_data", "AnyType", "", "Data from which to take collection to search in");
1484 parm = RNA_def_string(
1485 func, "search_property", nullptr, 0, "", "Identifier of search collection property");
1487 api_ui_item_common(func);
1489 func, "results_are_suggestions", false, "", "Accept inputs that do not match any item");
1490
1491 func = RNA_def_function(srna, "prop_decorator", "uiItemDecoratorR");
1493 RNA_def_int(func,
1494 "index",
1495 /* RNA_NO_INDEX == -1 */
1496 -1,
1497 -2,
1498 INT_MAX,
1499 "",
1500 "The index of this button, when set a single member of an array can be accessed, "
1501 "when set to -1 all array members are used",
1502 -2,
1503 INT_MAX);
1504
1505 for (int is_menu_hold = 0; is_menu_hold < 2; is_menu_hold++) {
1506 func = (is_menu_hold) ? RNA_def_function(srna, "operator_menu_hold", "rna_uiItemOMenuHold") :
1507 RNA_def_function(srna, "operator", "rna_uiItemO");
1509 RNA_def_boolean(func, "emboss", true, "", "Draw the button itself, not just the icon/text");
1510 RNA_def_boolean(func, "depress", false, "", "Draw pressed in");
1511 parm = RNA_def_property(func, "icon_value", PROP_INT, PROP_UNSIGNED);
1512 RNA_def_property_ui_text(parm, "Icon Value", "Override automatic icon of the item");
1513 if (is_menu_hold) {
1514 parm = RNA_def_string(func, "menu", nullptr, 0, "", "Identifier of the menu");
1516 }
1517 else {
1518 RNA_def_float(func,
1519 "search_weight",
1520 0.0f,
1521 -FLT_MAX,
1522 FLT_MAX,
1523 "Search Weight",
1524 "Influences the sorting when using menu-seach",
1525 -FLT_MAX,
1526 FLT_MAX);
1527 }
1528 parm = RNA_def_pointer(
1529 func, "properties", "OperatorProperties", "", "Operator properties to fill in");
1531 RNA_def_function_return(func, parm);
1533 "Item. Places a button into the layout to call an Operator.");
1534 }
1535
1536 func = RNA_def_function(srna, "operator_enum", "rna_uiItemsEnumO");
1537 parm = RNA_def_string(func, "operator", nullptr, 0, "", "Identifier of the operator");
1539 parm = RNA_def_string(func, "property", nullptr, 0, "", "Identifier of property in operator");
1541 RNA_def_boolean(func, "icon_only", false, "", "Draw only icons in buttons, no text");
1542
1543 func = RNA_def_function(srna, "operator_menu_enum", "rna_uiItemMenuEnumO");
1545 /* Can't use #api_ui_item_op_common because property must come right after. */
1546 api_ui_item_op(func);
1547 parm = RNA_def_string(func, "property", nullptr, 0, "", "Identifier of property in operator");
1549 api_ui_item_common(func);
1550 parm = RNA_def_pointer(
1551 func, "properties", "OperatorProperties", "", "Operator properties to fill in");
1553 RNA_def_function_return(func, parm);
1554
1555 /* useful in C but not in python */
1556# if 0
1557
1558 func = RNA_def_function(srna, "operator_enum_single", "uiItemEnumO_string");
1560 parm = RNA_def_string(func, "property", nullptr, 0, "", "Identifier of property in operator");
1562 parm = RNA_def_string(func, "value", nullptr, 0, "", "Enum property value");
1564
1565 func = RNA_def_function(srna, "operator_boolean", "uiItemBooleanO");
1567 parm = RNA_def_string(func, "property", nullptr, 0, "", "Identifier of property in operator");
1569 parm = RNA_def_boolean(
1570 func, "value", false, "", "Value of the property to call the operator with");
1572
1573 func = RNA_def_function(srna, "operator_int", "uiItemIntO");
1575 parm = RNA_def_string(func, "property", nullptr, 0, "", "Identifier of property in operator");
1577 parm = RNA_def_int(func,
1578 "value",
1579 0,
1580 INT_MIN,
1581 INT_MAX,
1582 "",
1583 "Value of the property to call the operator with",
1584 INT_MIN,
1585 INT_MAX);
1587
1588 func = RNA_def_function(srna, "operator_float", "uiItemFloatO");
1590 parm = RNA_def_string(func, "property", nullptr, 0, "", "Identifier of property in operator");
1592 parm = RNA_def_float(func,
1593 "value",
1594 0,
1595 -FLT_MAX,
1596 FLT_MAX,
1597 "",
1598 "Value of the property to call the operator with",
1599 -FLT_MAX,
1600 FLT_MAX);
1602
1603 func = RNA_def_function(srna, "operator_string", "uiItemStringO");
1605 parm = RNA_def_string(func, "property", nullptr, 0, "", "Identifier of property in operator");
1607 parm = RNA_def_string(
1608 func, "value", nullptr, 0, "", "Value of the property to call the operator with");
1610# endif
1611
1612 func = RNA_def_function(srna, "label", "rna_uiItemL");
1613 RNA_def_function_ui_description(func, "Item. Displays text and/or icon in the layout.");
1614 api_ui_item_common(func);
1615 parm = RNA_def_property(func, "icon_value", PROP_INT, PROP_UNSIGNED);
1616 RNA_def_property_ui_text(parm, "Icon Value", "Override automatic icon of the item");
1617
1618 func = RNA_def_function(srna, "menu", "rna_uiItemM");
1619 parm = RNA_def_string(func, "menu", nullptr, 0, "", "Identifier of the menu");
1620 api_ui_item_common(func);
1622 parm = RNA_def_property(func, "icon_value", PROP_INT, PROP_UNSIGNED);
1623 RNA_def_property_ui_text(parm, "Icon Value", "Override automatic icon of the item");
1624
1625 func = RNA_def_function(srna, "menu_contents", "rna_uiItemM_contents");
1626 parm = RNA_def_string(func, "menu", nullptr, 0, "", "Identifier of the menu");
1628
1629 func = RNA_def_function(srna, "popover", "rna_uiItemPopoverPanel");
1631 parm = RNA_def_string(func, "panel", nullptr, 0, "", "Identifier of the panel");
1632 api_ui_item_common(func);
1634 parm = RNA_def_property(func, "icon_value", PROP_INT, PROP_UNSIGNED);
1635 RNA_def_property_ui_text(parm, "Icon Value", "Override automatic icon of the item");
1636
1637 func = RNA_def_function(srna, "popover_group", "rna_uiItemPopoverPanelFromGroup");
1639 parm = RNA_def_enum(func, "space_type", rna_enum_space_type_items, 0, "Space Type", "");
1641 parm = RNA_def_enum(
1642 func, "region_type", rna_enum_region_type_items, RGN_TYPE_WINDOW, "Region Type", "");
1644 parm = RNA_def_string(func, "context", nullptr, 0, "", "panel type context");
1646 parm = RNA_def_string(func, "category", nullptr, 0, "", "panel type category");
1648
1649 func = RNA_def_function(srna, "separator", "rna_uiItemSeparator");
1651 "Item. Inserts empty space into the layout between items.");
1652 RNA_def_float(func,
1653 "factor",
1654 1.0f,
1655 0.0f,
1656 FLT_MAX,
1657 "Percentage",
1658 "Percentage of width to space (leave unset for default space)",
1659 0.0f,
1660 FLT_MAX);
1661 RNA_def_enum(func,
1662 "type",
1663 rna_enum_separator_type_items,
1665 "Type",
1666 "The type of the separator");
1667
1668 func = RNA_def_function(srna, "separator_spacer", "uiItemSpacer");
1670 func, "Item. Inserts horizontal spacing empty space into the layout between items.");
1671
1672 func = RNA_def_function(srna, "progress", "rna_uiItemProgress");
1673 RNA_def_function_ui_description(func, "Progress indicator");
1675 RNA_def_float(func,
1676 "factor",
1677 0.0f,
1678 0.0f,
1679 1.0f,
1680 "Factor",
1681 "Amount of progress from 0.0f to 1.0f",
1682 0.0f,
1683 1.0f);
1684 RNA_def_enum(func,
1685 "type",
1686 progress_type_items,
1688 "Type",
1689 "The type of progress indicator");
1690
1691 /* context */
1692 func = RNA_def_function(srna, "context_pointer_set", "uiLayoutSetContextPointer");
1693 parm = RNA_def_string(func, "name", nullptr, 0, "Name", "Name of entry in the context");
1695 parm = RNA_def_pointer(func, "data", "AnyType", "", "Pointer to put in context");
1697
1698 func = RNA_def_function(srna, "context_string_set", "uiLayoutSetContextString");
1699 parm = RNA_def_string(func, "name", nullptr, 0, "Name", "Name of entry in the context");
1701 parm = RNA_def_string(func, "value", nullptr, 0, "Value", "String to put in context");
1703
1704 /* templates */
1705 func = RNA_def_function(srna, "template_header", "uiTemplateHeader");
1707 RNA_def_function_ui_description(func, "Inserts common Space header UI (editor type selector)");
1708
1709 func = RNA_def_function(srna, "template_ID", "rna_uiTemplateID");
1712 RNA_def_string(func, "new", nullptr, 0, "", "Operator identifier to create a new ID block");
1713 RNA_def_string(func,
1714 "open",
1715 nullptr,
1716 0,
1717 "",
1718 "Operator identifier to open a file for creating a new ID block");
1719 RNA_def_string(func, "unlink", nullptr, 0, "", "Operator identifier to unlink the ID block");
1720 RNA_def_enum(func,
1721 "filter",
1722 id_template_filter_items,
1724 "",
1725 "Optionally limit the items which can be selected");
1726 RNA_def_boolean(func, "live_icon", false, "", "Show preview instead of fixed icon");
1728
1729 func = RNA_def_function(srna, "template_ID_preview", "uiTemplateIDPreview");
1732 RNA_def_string(func, "new", nullptr, 0, "", "Operator identifier to create a new ID block");
1733 RNA_def_string(func,
1734 "open",
1735 nullptr,
1736 0,
1737 "",
1738 "Operator identifier to open a file for creating a new ID block");
1739 RNA_def_string(func, "unlink", nullptr, 0, "", "Operator identifier to unlink the ID block");
1741 func, "rows", 0, 0, INT_MAX, "Number of thumbnail preview rows to display", "", 0, INT_MAX);
1742 RNA_def_int(func,
1743 "cols",
1744 0,
1745 0,
1746 INT_MAX,
1747 "Number of thumbnail preview columns to display",
1748 "",
1749 0,
1750 INT_MAX);
1751 RNA_def_enum(func,
1752 "filter",
1753 id_template_filter_items,
1755 "",
1756 "Optionally limit the items which can be selected");
1757 RNA_def_boolean(func, "hide_buttons", false, "", "Show only list, no buttons");
1758
1759 func = RNA_def_function(srna, "template_any_ID", "rna_uiTemplateAnyID");
1760 parm = RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take property");
1762 parm = RNA_def_string(func, "property", nullptr, 0, "", "Identifier of property in data");
1764 parm = RNA_def_string(func,
1765 "type_property",
1766 nullptr,
1767 0,
1768 "",
1769 "Identifier of property in data giving the type of the ID-blocks to use");
1772
1773 func = RNA_def_function(srna, "template_ID_tabs", "uiTemplateIDTabs");
1776 RNA_def_string(func, "new", nullptr, 0, "", "Operator identifier to create a new ID block");
1777 RNA_def_string(func, "menu", nullptr, 0, "", "Context menu identifier");
1778 RNA_def_enum(func,
1779 "filter",
1780 id_template_filter_items,
1782 "",
1783 "Optionally limit the items which can be selected");
1784
1785 func = RNA_def_function(srna, "template_action", "rna_uiTemplateAction");
1787 parm = RNA_def_pointer(func, "id", "ID", "", "The data-block for which to select an Action");
1789 RNA_def_string(func, "new", nullptr, 0, "", "Operator identifier to create a new ID block");
1790 RNA_def_string(func, "unlink", nullptr, 0, "", "Operator identifier to unlink the ID block");
1792
1793 func = RNA_def_function(srna, "template_search", "rna_uiTemplateSearch");
1796 parm = RNA_def_pointer(
1797 func, "search_data", "AnyType", "", "Data from which to take collection to search in");
1799 parm = RNA_def_string(
1800 func, "search_property", nullptr, 0, "", "Identifier of search collection property");
1803 func, "new", nullptr, 0, "", "Operator identifier to create a new item for the collection");
1804 RNA_def_string(func,
1805 "unlink",
1806 nullptr,
1807 0,
1808 "",
1809 "Operator identifier to unlink or delete the active "
1810 "item from the collection");
1812
1813 func = RNA_def_function(srna, "template_search_preview", "rna_uiTemplateSearchPreview");
1816 parm = RNA_def_pointer(
1817 func, "search_data", "AnyType", "", "Data from which to take collection to search in");
1819 parm = RNA_def_string(
1820 func, "search_property", nullptr, 0, "", "Identifier of search collection property");
1823 func, "new", nullptr, 0, "", "Operator identifier to create a new item for the collection");
1824 RNA_def_string(func,
1825 "unlink",
1826 nullptr,
1827 0,
1828 "",
1829 "Operator identifier to unlink or delete the active "
1830 "item from the collection");
1833 func, "rows", 0, 0, INT_MAX, "Number of thumbnail preview rows to display", "", 0, INT_MAX);
1834 RNA_def_int(func,
1835 "cols",
1836 0,
1837 0,
1838 INT_MAX,
1839 "Number of thumbnail preview columns to display",
1840 "",
1841 0,
1842 INT_MAX);
1843
1844 func = RNA_def_function(srna, "template_path_builder", "rna_uiTemplatePathBuilder");
1845 parm = RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take property");
1847 parm = RNA_def_string(func, "property", nullptr, 0, "", "Identifier of property in data");
1849 parm = RNA_def_pointer(func, "root", "ID", "", "ID-block from which path is evaluated from");
1852
1853 func = RNA_def_function(srna, "template_modifiers", "uiTemplateModifiers");
1855 RNA_def_function_ui_description(func, "Generates the UI layout for the modifier stack");
1856
1857 func = RNA_def_function(srna, "template_collection_exporters", "uiTemplateCollectionExporters");
1859 RNA_def_function_ui_description(func, "Generates the UI layout for collection exporters");
1860
1861 func = RNA_def_function(srna, "template_constraints", "uiTemplateConstraints");
1863 RNA_def_function_ui_description(func, "Generates the panels for the constraint stack");
1864 RNA_def_boolean(func,
1865 "use_bone_constraints",
1866 true,
1867 "",
1868 "Add panels for bone constraints instead of object constraints");
1869
1870 func = RNA_def_function(srna, "template_shaderfx", "uiTemplateShaderFx");
1872 RNA_def_function_ui_description(func, "Generates the panels for the shader effect stack");
1873
1874 func = RNA_def_function(srna, "template_greasepencil_color", "uiTemplateGpencilColorPreview");
1878 func, "rows", 0, 0, INT_MAX, "Number of thumbnail preview rows to display", "", 0, INT_MAX);
1879 RNA_def_int(func,
1880 "cols",
1881 0,
1882 0,
1883 INT_MAX,
1884 "Number of thumbnail preview columns to display",
1885 "",
1886 0,
1887 INT_MAX);
1888 RNA_def_float(func, "scale", 1.0f, 0.1f, 1.5f, "Scale of the image thumbnails", "", 0.5f, 1.0f);
1889 RNA_def_enum(func,
1890 "filter",
1891 id_template_filter_items,
1893 "",
1894 "Optionally limit the items which can be selected");
1895
1896 func = RNA_def_function(srna, "template_constraint_header", "uiTemplateConstraintHeader");
1897 RNA_def_function_ui_description(func, "Generates the header for constraint panels");
1898 parm = RNA_def_pointer(func, "data", "Constraint", "", "Constraint data");
1900
1901 func = RNA_def_function(srna, "template_preview", "uiTemplatePreview");
1903 func, "Item. A preview window for materials, textures, lights or worlds.");
1905 parm = RNA_def_pointer(func, "id", "ID", "", "ID data-block");
1907 RNA_def_boolean(func, "show_buttons", true, "", "Show preview buttons?");
1908 RNA_def_pointer(func, "parent", "ID", "", "ID data-block");
1909 RNA_def_pointer(func, "slot", "TextureSlot", "", "Texture slot");
1911 func,
1912 "preview_id",
1913 nullptr,
1914 0,
1915 "",
1916 "Identifier of this preview widget, if not set the ID type will be used "
1917 "(i.e. all previews of materials without explicit ID will have the same size...).");
1918
1919 func = RNA_def_function(srna, "template_curve_mapping", "uiTemplateCurveMapping");
1921 func, "Item. A curve mapping widget used for e.g falloff curves for lights.");
1923 RNA_def_enum(func, "type", curve_type_items, 0, "Type", "Type of curves to display");
1924 RNA_def_boolean(func, "levels", false, "", "Show black/white levels");
1925 RNA_def_boolean(func, "brush", false, "", "Show brush options");
1926 RNA_def_boolean(func, "use_negative_slope", false, "", "Use a negative slope by default");
1927 RNA_def_boolean(func, "show_tone", false, "", "Show tone options");
1928
1929 func = RNA_def_function(srna, "template_curveprofile", "uiTemplateCurveProfile");
1930 RNA_def_function_ui_description(func, "A profile path editor used for custom profiles");
1932
1933 func = RNA_def_function(srna, "template_color_ramp", "uiTemplateColorRamp");
1934 RNA_def_function_ui_description(func, "Item. A color ramp widget.");
1936 RNA_def_boolean(func, "expand", false, "", "Expand button to show more detail");
1937
1938 func = RNA_def_function(srna, "template_icon", "uiTemplateIcon");
1939 RNA_def_function_ui_description(func, "Display a large icon");
1940 parm = RNA_def_int(func, "icon_value", 0, 0, INT_MAX, "Icon to display", "", 0, INT_MAX);
1942 RNA_def_float(func,
1943 "scale",
1944 1.0f,
1945 1.0f,
1946 100.0f,
1947 "Scale",
1948 "Scale the icon size (by the button size)",
1949 1.0f,
1950 100.0f);
1951
1952 func = RNA_def_function(srna, "template_icon_view", "uiTemplateIconView");
1953 RNA_def_function_ui_description(func, "Enum. Large widget showing Icon previews.");
1955 RNA_def_boolean(func, "show_labels", false, "", "Show enum label in preview buttons");
1956 RNA_def_float(func,
1957 "scale",
1958 6.0f,
1959 1.0f,
1960 100.0f,
1961 "UI Units",
1962 "Scale the button icon size (by the button size)",
1963 1.0f,
1964 100.0f);
1965 RNA_def_float(func,
1966 "scale_popup",
1967 5.0f,
1968 1.0f,
1969 100.0f,
1970 "Scale",
1971 "Scale the popup icon size (by the button size)",
1972 1.0f,
1973 100.0f);
1974
1975 func = RNA_def_function(srna, "template_histogram", "uiTemplateHistogram");
1976 RNA_def_function_ui_description(func, "Item. A histogramm widget to analyze imaga data.");
1978
1979 func = RNA_def_function(srna, "template_waveform", "uiTemplateWaveform");
1980 RNA_def_function_ui_description(func, "Item. A waveform widget to analyze imaga data.");
1982
1983 func = RNA_def_function(srna, "template_vectorscope", "uiTemplateVectorscope");
1984 RNA_def_function_ui_description(func, "Item. A vectorscope widget to analyze imaga data.");
1986
1987 func = RNA_def_function(srna, "template_layers", "uiTemplateLayers");
1989 parm = RNA_def_pointer(
1990 func, "used_layers_data", "AnyType", "", "Data from which to take property");
1992 parm = RNA_def_string(
1993 func, "used_layers_property", nullptr, 0, "", "Identifier of property in data");
1995 parm = RNA_def_int(func, "active_layer", 0, 0, INT_MAX, "Active Layer", "", 0, INT_MAX);
1997
1998 func = RNA_def_function(srna, "template_color_picker", "uiTemplateColorPicker");
1999 RNA_def_function_ui_description(func, "Item. A color wheel widget to pick colors.");
2002 func, "value_slider", false, "", "Display the value slider to the right of the color wheel");
2003 RNA_def_boolean(func,
2004 "lock",
2005 false,
2006 "",
2007 "Lock the color wheel display to value 1.0 regardless of actual color");
2009 func, "lock_luminosity", false, "", "Keep the color at its original vector length");
2010 RNA_def_boolean(func, "cubic", false, "", "Cubic saturation for picking values close to white");
2011
2012 func = RNA_def_function(srna, "template_palette", "uiTemplatePalette");
2013 RNA_def_function_ui_description(func, "Item. A palette used to pick colors.");
2015 RNA_def_boolean(func, "color", false, "", "Display the colors as colors or values");
2016
2017 func = RNA_def_function(srna, "template_image_layers", "uiTemplateImageLayers");
2019 parm = RNA_def_pointer(func, "image", "Image", "", "");
2021 parm = RNA_def_pointer(func, "image_user", "ImageUser", "", "");
2023
2024 func = RNA_def_function(srna, "template_image", "uiTemplateImage");
2026 func, "Item(s). User interface for selecting images and their source paths.");
2029 parm = RNA_def_pointer(func, "image_user", "ImageUser", "", "");
2031 RNA_def_boolean(func, "compact", false, "", "Use more compact layout");
2032 RNA_def_boolean(func, "multiview", false, "", "Expose Multi-View options");
2033
2034 func = RNA_def_function(srna, "template_image_settings", "uiTemplateImageSettings");
2035 RNA_def_function_ui_description(func, "User interface for setting image format options");
2036 parm = RNA_def_pointer(func, "image_settings", "ImageFormatSettings", "", "");
2038 RNA_def_boolean(func, "color_management", false, "", "Show color management settings");
2039
2040 func = RNA_def_function(srna, "template_image_stereo_3d", "uiTemplateImageStereo3d");
2041 RNA_def_function_ui_description(func, "User interface for setting image stereo 3d options");
2042 parm = RNA_def_pointer(func, "stereo_3d_format", "Stereo3dFormat", "", "");
2044
2045 func = RNA_def_function(srna, "template_image_views", "uiTemplateImageViews");
2046 RNA_def_function_ui_description(func, "User interface for setting image views output options");
2047 parm = RNA_def_pointer(func, "image_settings", "ImageFormatSettings", "", "");
2049
2050 func = RNA_def_function(srna, "template_movieclip", "uiTemplateMovieClip");
2052 func, "Item(s). User interface for selecting movie clips and their source paths.");
2055 RNA_def_boolean(func, "compact", false, "", "Use more compact layout");
2056
2057 func = RNA_def_function(srna, "template_track", "uiTemplateTrack");
2058 RNA_def_function_ui_description(func, "Item. A movie-track widget to preview tracking image.");
2060
2061 func = RNA_def_function(srna, "template_marker", "uiTemplateMarker");
2062 RNA_def_function_ui_description(func, "Item. A widget to control single marker settings.");
2064 parm = RNA_def_pointer(func, "clip_user", "MovieClipUser", "", "");
2066 parm = RNA_def_pointer(func, "track", "MovieTrackingTrack", "", "");
2068 RNA_def_boolean(func, "compact", false, "", "Use more compact layout");
2069
2070 func = RNA_def_function(
2071 srna, "template_movieclip_information", "uiTemplateMovieclipInformation");
2072 RNA_def_function_ui_description(func, "Item. Movie clip information data.");
2074 parm = RNA_def_pointer(func, "clip_user", "MovieClipUser", "", "");
2076
2077 func = RNA_def_function(srna, "template_list", "rna_uiTemplateList");
2078 RNA_def_function_ui_description(func, "Item. A list widget to display data, e.g. vertexgroups.");
2080 parm = RNA_def_string(
2081 func, "listtype_name", nullptr, 0, "", "Identifier of the list type to use");
2083 parm = RNA_def_string(
2084 func,
2085 "list_id",
2086 nullptr,
2087 0,
2088 "",
2089 "Identifier of this list widget. Necessary to tell apart different list widgets. Mandatory "
2090 "when using default \"" UI_UL_DEFAULT_CLASS_NAME
2091 "\" class. "
2092 "If this not an empty string, the uilist gets a custom ID, otherwise it takes the "
2093 "name of the class used to define the uilist (for example, if the "
2094 "class name is \"OBJECT_UL_vgroups\", and list_id is not set by the "
2095 "script, then bl_idname = \"OBJECT_UL_vgroups\")");
2097 parm = RNA_def_pointer(
2098 func, "dataptr", "AnyType", "", "Data from which to take the Collection property");
2100 parm = RNA_def_string(
2101 func, "propname", nullptr, 0, "", "Identifier of the Collection property in data");
2103 parm = RNA_def_pointer(func,
2104 "active_dataptr",
2105 "AnyType",
2106 "",
2107 "Data from which to take the integer property, index of the active item");
2109 parm = RNA_def_string(
2110 func,
2111 "active_propname",
2112 nullptr,
2113 0,
2114 "",
2115 "Identifier of the integer property in active_data, index of the active item");
2117 RNA_def_string(func,
2118 "item_dyntip_propname",
2119 nullptr,
2120 0,
2121 "",
2122 "Identifier of a string property in items, to use as tooltip content");
2123 RNA_def_int(func,
2124 "rows",
2125 5,
2126 0,
2127 INT_MAX,
2128 "",
2129 "Default and minimum number of rows to display",
2130 0,
2131 INT_MAX);
2133 func, "maxrows", 5, 0, INT_MAX, "", "Default maximum number of rows to display", 0, INT_MAX);
2134 RNA_def_enum(func,
2135 "type",
2138 "Type",
2139 "Type of layout to use");
2140 RNA_def_int(func,
2141 "columns",
2142 9,
2143 0,
2144 INT_MAX,
2145 "",
2146 "Number of items to display per row, for GRID layout",
2147 0,
2148 INT_MAX);
2149 RNA_def_boolean(func, "sort_reverse", false, "", "Display items in reverse order by default");
2150 RNA_def_boolean(func, "sort_lock", false, "", "Lock display order to default value");
2151
2152 func = RNA_def_function(srna, "template_running_jobs", "uiTemplateRunningJobs");
2154
2155 RNA_def_function(srna, "template_operator_search", "uiTemplateOperatorSearch");
2156 RNA_def_function(srna, "template_menu_search", "uiTemplateMenuSearch");
2157
2158 func = RNA_def_function(srna, "template_header_3D_mode", "uiTemplateHeader3D_mode");
2161
2162 func = RNA_def_function(srna, "template_edit_mode_selection", "uiTemplateEditModeSelection");
2165 func, "Inserts common 3DView Edit modes header UI (selector for selection mode)");
2166
2167 func = RNA_def_function(srna, "template_reports_banner", "uiTemplateReportsBanner");
2169
2170 func = RNA_def_function(srna, "template_input_status", "uiTemplateInputStatus");
2172
2173 func = RNA_def_function(srna, "template_status_info", "uiTemplateStatusInfo");
2175
2176 func = RNA_def_function(srna, "template_node_link", "uiTemplateNodeLink");
2178 parm = RNA_def_pointer(func, "ntree", "NodeTree", "", "");
2180 parm = RNA_def_pointer(func, "node", "Node", "", "");
2182 parm = RNA_def_pointer(func, "socket", "NodeSocket", "", "");
2184
2185 func = RNA_def_function(srna, "template_node_view", "uiTemplateNodeView");
2187 parm = RNA_def_pointer(func, "ntree", "NodeTree", "", "");
2189 parm = RNA_def_pointer(func, "node", "Node", "", "");
2191 parm = RNA_def_pointer(func, "socket", "NodeSocket", "", "");
2193
2194 func = RNA_def_function(
2195 srna, "template_node_asset_menu_items", "rna_uiLayout_template_node_asset_menu_items");
2197 parm = RNA_def_string(func, "catalog_path", nullptr, 0, "", "");
2198
2199 func = RNA_def_function(srna,
2200 "template_modifier_asset_menu_items",
2201 "rna_uiLayout_template_modifier_asset_menu_items");
2202 parm = RNA_def_string(func, "catalog_path", nullptr, 0, "", "");
2203
2204 func = RNA_def_function(srna,
2205 "template_node_operator_asset_menu_items",
2206 "rna_uiLayout_template_node_operator_asset_menu_items");
2208 parm = RNA_def_string(func, "catalog_path", nullptr, 0, "", "");
2209
2210 func = RNA_def_function(srna,
2211 "template_node_operator_asset_root_items",
2212 "rna_uiLayout_template_node_operator_root_items");
2214
2215 func = RNA_def_function(srna, "template_texture_user", "uiTemplateTextureUser");
2217
2218 func = RNA_def_function(
2219 srna, "template_keymap_item_properties", "uiTemplateKeymapItemProperties");
2220 parm = RNA_def_pointer(func, "item", "KeyMapItem", "", "");
2222
2223 func = RNA_def_function(srna, "template_component_menu", "uiTemplateComponentMenu");
2224 RNA_def_function_ui_description(func, "Item. Display expanded property in a popup menu");
2225 parm = RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take property");
2227 parm = RNA_def_string(func, "property", nullptr, 0, "", "Identifier of property in data");
2229 RNA_def_string(func, "name", nullptr, 0, "", "");
2230
2231 /* color management templates */
2232 func = RNA_def_function(srna, "template_colorspace_settings", "uiTemplateColorspaceSettings");
2233 RNA_def_function_ui_description(func, "Item. A widget to control input color space settings.");
2235
2236 func = RNA_def_function(
2237 srna, "template_colormanaged_view_settings", "uiTemplateColormanagedViewSettings");
2238 RNA_def_function_ui_description(func, "Item. A widget to control color managed view settings.");
2241# if 0
2242 RNA_def_boolean(func,
2243 "show_global_settings",
2244 false,
2245 "",
2246 "Show widgets to control global color management settings");
2247# endif
2248
2249 /* node socket icon */
2250 func = RNA_def_function(srna, "template_node_socket", "uiTemplateNodeSocket");
2251 RNA_def_function_ui_description(func, "Node Socket Icon");
2254 func, "color", 4, node_socket_color_default, 0.0f, 1.0f, "Color", "", 0.0f, 1.0f);
2255
2256 func = RNA_def_function(srna, "template_cache_file", "rna_uiTemplateCacheFile");
2258 func, "Item(s). User interface for selecting cache files and their source paths");
2261
2262 func = RNA_def_function(srna, "template_cache_file_velocity", "rna_uiTemplateCacheFileVelocity");
2263 RNA_def_function_ui_description(func, "Show cache files velocity properties");
2265
2266 func = RNA_def_function(
2267 srna, "template_cache_file_procedural", "rna_uiTemplateCacheFileProcedural");
2268 RNA_def_function_ui_description(func, "Show cache files render procedural properties");
2271
2272 func = RNA_def_function(
2273 srna, "template_cache_file_time_settings", "rna_uiTemplateCacheFileTimeSettings");
2274 RNA_def_function_ui_description(func, "Show cache files time settings");
2276
2277 func = RNA_def_function(srna, "template_cache_file_layers", "rna_uiTemplateCacheFileLayers");
2278 RNA_def_function_ui_description(func, "Show cache files override layers properties");
2281
2282 func = RNA_def_function(srna, "template_recent_files", "uiTemplateRecentFiles");
2283 RNA_def_function_ui_description(func, "Show list of recently saved .blend files");
2284 RNA_def_int(func, "rows", 5, 1, INT_MAX, "", "Maximum number of items to show", 1, INT_MAX);
2285 parm = RNA_def_int(func, "found", 0, 0, INT_MAX, "", "Number of items drawn", 0, INT_MAX);
2286 RNA_def_function_return(func, parm);
2287
2288 func = RNA_def_function(srna, "template_file_select_path", "uiTemplateFileSelectPath");
2290 "Item. A text button to set the active file browser path.");
2291 parm = RNA_def_pointer(func, "params", "FileSelectParams", "", "");
2294
2295 func = RNA_def_function(
2296 srna, "template_event_from_keymap_item", "rna_uiTemplateEventFromKeymapItem");
2297 RNA_def_function_ui_description(func, "Display keymap item as icons/text");
2298 parm = RNA_def_property(func, "item", PROP_POINTER, PROP_NONE);
2299 RNA_def_property_struct_type(parm, "KeyMapItem");
2300 RNA_def_property_ui_text(parm, "Item", "");
2303
2304 func = RNA_def_function(srna, "template_asset_view", "rna_uiTemplateAssetView");
2305 RNA_def_function_ui_description(func, "Item. A scrollable list of assets in a grid view");
2307 parm = RNA_def_string(func,
2308 "list_id",
2309 nullptr,
2310 0,
2311 "",
2312 "Identifier of this asset view. Necessary to tell apart different asset "
2313 "views and to identify an asset view read from a .blend");
2315 parm = RNA_def_pointer(func,
2316 "asset_library_dataptr",
2317 "AnyType",
2318 "",
2319 "Data from which to take the active asset library property");
2321 parm = RNA_def_string(
2322 func, "asset_library_propname", nullptr, 0, "", "Identifier of the asset library property");
2324 parm = RNA_def_pointer(
2325 func, "assets_dataptr", "AnyType", "", "Data from which to take the asset list property");
2327 parm = RNA_def_string(
2328 func, "assets_propname", nullptr, 0, "", "Identifier of the asset list property");
2330 parm = RNA_def_pointer(func,
2331 "active_dataptr",
2332 "AnyType",
2333 "",
2334 "Data from which to take the integer property, index of the active item");
2336 parm = RNA_def_string(
2337 func,
2338 "active_propname",
2339 nullptr,
2340 0,
2341 "",
2342 "Identifier of the integer property in active_data, index of the active item");
2344 parm = RNA_def_property(func, "filter_id_types", PROP_ENUM, PROP_NONE);
2347 parm, nullptr, nullptr, "rna_uiTemplateAssetView_filter_id_types_itemf");
2349 RNA_def_enum_flag(func,
2350 "display_options",
2351 asset_view_template_options,
2352 0,
2353 "",
2354 "Displaying options for the asset view");
2355 RNA_def_string(func,
2356 "activate_operator",
2357 nullptr,
2358 0,
2359 "",
2360 "Name of a custom operator to invoke when activating an item");
2361 parm = RNA_def_pointer(
2362 func,
2363 "activate_operator_properties",
2364 "OperatorProperties",
2365 "",
2366 "Operator properties to fill in for the custom activate operator passed to the template");
2368 RNA_def_function_output(func, parm);
2369 RNA_def_string(func,
2370 "drag_operator",
2371 nullptr,
2372 0,
2373 "",
2374 "Name of a custom operator to invoke when starting to drag an item. Never "
2375 "invoked together with the ``active_operator`` (if set), it's either the drag or "
2376 "the activate one");
2377 parm = RNA_def_pointer(
2378 func,
2379 "drag_operator_properties",
2380 "OperatorProperties",
2381 "",
2382 "Operator properties to fill in for the custom drag operator passed to the template");
2384 RNA_def_function_output(func, parm);
2385
2386 func = RNA_def_function(
2387 srna, "template_light_linking_collection", "uiTemplateLightLinkingCollection");
2389 "Visualization of a content of a light linking collection");
2390 parm = RNA_def_pointer(func,
2391 "context_layout",
2392 "UILayout",
2393 "",
2394 "Layout to set active list element as context properties");
2397
2398 func = RNA_def_function(srna, "template_bone_collection_tree", "uiTemplateBoneCollectionTree");
2399 RNA_def_function_ui_description(func, "Show bone collections tree");
2401
2402 func = RNA_def_function(
2403 srna, "template_grease_pencil_layer_tree", "uiTemplateGreasePencilLayerTree");
2404 RNA_def_function_ui_description(func, "View of the active grease pencil layer tree");
2406
2407 func = RNA_def_function(srna, "template_node_tree_interface", "uiTemplateNodeTreeInterface");
2408 RNA_def_function_ui_description(func, "Show a node tree interface");
2409 parm = RNA_def_pointer(func,
2410 "interface",
2411 "NodeTreeInterface",
2412 "Node Tree Interface",
2413 "Interface of a node tree to display");
2415
2416 func = RNA_def_function(srna, "template_node_inputs", "uiTemplateNodeInputs");
2417 RNA_def_function_ui_description(func, "Show a node settings and input socket values");
2419 parm = RNA_def_pointer(func, "node", "Node", "Node", "Display inputs of this node");
2421
2422 func = RNA_def_function(srna, "template_asset_shelf_popover", "rna_uiTemplateAssetShelfPopover");
2423 RNA_def_function_ui_description(func, "Create a button to open an asset shelf in a popover");
2425 parm = RNA_def_string(func,
2426 "asset_shelf",
2427 nullptr,
2428 0,
2429 "",
2430 "Identifier of the asset shelf to display (``bl_idname``)");
2432 parm = RNA_def_string(
2433 func, "name", nullptr, 0, "", "Optional name to indicate the active asset");
2435 parm = RNA_def_property(func, "icon", PROP_ENUM, PROP_NONE);
2437 RNA_def_property_ui_text(parm, "Icon", "Override automatic icon of the item");
2438 parm = RNA_def_property(func, "icon_value", PROP_INT, PROP_UNSIGNED);
2439 RNA_def_property_ui_text(parm, "Icon Value", "Override automatic icon of the item");
2440
2441 /* A version of `operator` that defines a [Cancel, Confirm] pair of buttons. */
2442 func = RNA_def_function(srna, "template_popup_confirm", "rna_uiTemplatePopupConfirm");
2444 parm = RNA_def_string(func,
2445 "cancel_text",
2446 nullptr,
2447 0,
2448 "",
2449 "Optional text to use for the cancel, not shown when an empty string");
2450 RNA_def_boolean(func, "cancel_default", false, "", "Cancel button by default");
2452 func, "Add confirm & cancel buttons into a popup which will close the popup when pressed");
2454
2455 parm = RNA_def_pointer(
2456 func, "properties", "OperatorProperties", "", "Operator properties to fill in");
2458 RNA_def_function_return(func, parm);
2459}
2460
2461#endif
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
void BLI_kdtree_nd_ free(KDTree *tree)
#define ELEM(...)
bool BLT_translate_iface()
const char * BLT_pgettext(const char *msgctxt, const char *msgid)
#define BLT_I18NCONTEXT_DEFAULT
#define FILTER_ID_ALL
Definition DNA_ID.h:1206
@ UILST_LAYOUT_DEFAULT
@ RGN_TYPE_WINDOW
#define RNA_warning(format,...)
@ PARM_RNAPTR
Definition RNA_types.hh:399
@ PARM_REQUIRED
Definition RNA_types.hh:397
@ FUNC_USE_REPORTS
Definition RNA_types.hh:680
@ FUNC_NO_SELF
Definition RNA_types.hh:673
@ FUNC_USE_CONTEXT
Definition RNA_types.hh:679
@ PROP_BOOLEAN
Definition RNA_types.hh:65
@ PROP_ENUM
Definition RNA_types.hh:69
@ PROP_INT
Definition RNA_types.hh:66
@ PROP_POINTER
Definition RNA_types.hh:70
PropertyFlag
Definition RNA_types.hh:201
@ PROP_ENUM_FLAG
Definition RNA_types.hh:293
@ PROP_NEVER_NULL
Definition RNA_types.hh:266
@ PROP_COLOR
Definition RNA_types.hh:163
@ PROP_NONE
Definition RNA_types.hh:136
@ PROP_COLOR_GAMMA
Definition RNA_types.hh:175
@ PROP_UNSIGNED
Definition RNA_types.hh:152
constexpr PointerRNA PointerRNA_NULL
Definition RNA_types.hh:45
Panel * uiLayoutGetRootPanel(uiLayout *layout)
void uiItemsFullEnumO(uiLayout *layout, const char *opname, const char *propname, IDProperty *properties, wmOperatorCallContext context, eUI_Item_Flag flag, const int active=-1)
void uiTemplateSearch(uiLayout *layout, const bContext *C, PointerRNA *ptr, const char *propname, PointerRNA *searchptr, const char *searchpropname, const char *newop, const char *unlinkop, const char *text=nullptr)
void uiLayoutSetSearchWeight(uiLayout *layout, float weight)
void uiItemL(uiLayout *layout, const char *name, int icon)
void uiTemplateCacheFileProcedural(uiLayout *layout, const bContext *C, PointerRNA *fileptr)
void uiItemFullR_with_popover(uiLayout *layout, PointerRNA *ptr, PropertyRNA *prop, int index, int value, eUI_Item_Flag flag, const char *name, int icon, const char *panel_type)
void uiTemplateAssetView(uiLayout *layout, const bContext *C, const char *list_id, PointerRNA *asset_library_dataptr, const char *asset_library_propname, PointerRNA *assets_dataptr, const char *assets_propname, PointerRNA *active_dataptr, const char *active_propname, const blender::ed::asset::AssetFilterSettings *filter_settings, int display_flags, const char *activate_opname, PointerRNA *r_activate_op_properties, const char *drag_opname, PointerRNA *r_drag_op_properties)
void uiTemplateCacheFileLayers(uiLayout *layout, const bContext *C, PointerRNA *fileptr)
uiBlock * uiLayoutGetBlock(uiLayout *layout)
void UI_popup_block_template_confirm_op(uiLayout *layout, wmOperatorType *ot, const char *confirm_text, const char *cancel_text, const int icon, bool cancel_default, PointerRNA *r_ptr)
void uiItemFullR(uiLayout *layout, PointerRNA *ptr, PropertyRNA *prop, int index, int value, eUI_Item_Flag flag, const char *name, int icon, const char *placeholder=nullptr)
bool uiTemplateCacheFilePointer(PointerRNA *ptr, const char *propname, PointerRNA *r_file_ptr)
eButProgressType
@ UI_BUT_PROGRESS_TYPE_BAR
@ UI_BUT_PROGRESS_TYPE_RING
void uiTemplateAction(uiLayout *layout, const bContext *C, ID *id, const char *newop, const char *unlinkop, const char *text)
void uiTemplateAnyID(uiLayout *layout, PointerRNA *ptr, const char *propname, const char *proptypename, const char *text)
wmOperatorCallContext uiLayoutGetOperatorContext(uiLayout *layout)
void uiItemPopoverPanelFromGroup(uiLayout *layout, bContext *C, int space_id, int region_id, const char *context, const char *category)
uiLayout * uiLayoutRowWithHeading(uiLayout *layout, bool align, const char *heading)
void uiItemS_ex(uiLayout *layout, float factor, LayoutSeparatorType type=LayoutSeparatorType::Auto)
void uiItemFullO_ptr(uiLayout *layout, wmOperatorType *ot, const char *name, int icon, IDProperty *properties, wmOperatorCallContext context, eUI_Item_Flag flag, PointerRNA *r_opptr)
float uiLayoutGetSearchWeight(uiLayout *layout)
void uiItemMenuEnumR_prop(uiLayout *layout, PointerRNA *ptr, PropertyRNA *prop, const char *name, int icon)
void uiTemplateList(uiLayout *layout, const bContext *C, const char *listtype_name, const char *list_id, PointerRNA *dataptr, const char *propname, 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 uiItemProgressIndicator(uiLayout *layout, const char *text, float factor, enum eButProgressType progress_type)
#define UI_ITEM_NONE
#define UI_UL_DEFAULT_CLASS_NAME
LayoutSeparatorType
void uiTemplateCacheFileVelocity(uiLayout *layout, PointerRNA *fileptr)
PanelLayout uiLayoutPanel(const bContext *C, uiLayout *layout, const char *idname, bool default_closed)
void uiItemMContents(uiLayout *layout, const char *menuname)
void uiItemFullR_with_menu(uiLayout *layout, PointerRNA *ptr, PropertyRNA *prop, int index, int value, eUI_Item_Flag flag, const char *name, int icon, const char *menu_type)
void uiItemEnumR_string_prop(uiLayout *layout, PointerRNA *ptr, PropertyRNA *prop, const char *value, const char *name, int icon)
uiLayout * uiLayoutColumnWithHeading(uiLayout *layout, bool align, const char *heading)
bool uiTemplateEventFromKeymapItem(uiLayout *layout, const char *text, const wmKeyMapItem *kmi, bool text_fallback)
PanelLayout uiLayoutPanelProp(const bContext *C, uiLayout *layout, PointerRNA *open_prop_owner, const char *open_prop_name)
bool UI_popup_block_template_confirm_is_supported(const uiBlock *block)
void uiTemplateID(uiLayout *layout, const bContext *C, PointerRNA *ptr, const char *propname, const char *newop, const char *openop, const char *unlinkop, int filter=UI_TEMPLATE_ID_FILTER_ALL, bool live_icon=false, const char *text=nullptr)
void uiItemFullOMenuHold_ptr(uiLayout *layout, wmOperatorType *ot, const char *name, int icon, IDProperty *properties, wmOperatorCallContext context, eUI_Item_Flag flag, const char *menu_id, PointerRNA *r_opptr)
void uiItemPointerR_prop(uiLayout *layout, PointerRNA *ptr, PropertyRNA *prop, PointerRNA *searchptr, PropertyRNA *searchprop, const char *name, int icon, bool results_are_suggestions)
void uiTemplateSearchPreview(uiLayout *layout, bContext *C, PointerRNA *ptr, const char *propname, PointerRNA *searchptr, const char *searchpropname, const char *newop, const char *unlinkop, int rows, int cols, const char *text=nullptr)
@ UI_TEMPLATE_ID_FILTER_AVAILABLE
@ UI_TEMPLATE_ID_FILTER_ALL
#define UI_MAX_NAME_STR
void uiTemplateCacheFile(uiLayout *layout, const bContext *C, PointerRNA *ptr, const char *propname)
void uiTemplatePathBuilder(uiLayout *layout, PointerRNA *ptr, const char *propname, PointerRNA *root_ptr, const char *text)
@ UI_TEMPLATE_ASSET_DRAW_NO_NAMES
@ UI_TEMPLATE_ASSET_DRAW_NO_LIBRARY
@ UI_TEMPLATE_ASSET_DRAW_NO_FILTER
void uiItemMenuEnumFullO_ptr(uiLayout *layout, const bContext *C, wmOperatorType *ot, const char *propname, const char *name, int icon, PointerRNA *r_opptr)
void uiTemplateCacheFileTimeSettings(uiLayout *layout, PointerRNA *fileptr)
void uiItemTabsEnumR_prop(uiLayout *layout, bContext *C, PointerRNA *ptr, PropertyRNA *prop, PointerRNA *ptr_highlight, PropertyRNA *prop_highlight, bool icon_only)
void uiItemPopoverPanel(uiLayout *layout, const bContext *C, const char *panel_type, const char *name, int icon)
uiTemplateListFlags
@ UI_TEMPLATE_LIST_SORT_LOCK
@ UI_TEMPLATE_LIST_SORT_REVERSE
@ UI_TEMPLATE_LIST_FLAG_NONE
void uiItemM(uiLayout *layout, const char *menuname, const char *name, int icon)
eUI_Item_Flag
@ 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
int UI_icon_from_rnaptr(const bContext *C, PointerRNA *ptr, int rnaicon, bool big)
int BIFIconID
draw_view push_constant(Type::INT, "radiance_src") .push_constant(Type capture_info_buf storage_buf(1, Qualifier::READ, "ObjectBounds", "bounds_buf[]") .push_constant(Type draw_view int
void MEM_freeN(void *vmemh)
Definition mallocn.cc:105
void ui_template_node_operator_asset_root_items(uiLayout &layout, const bContext &C)
void template_asset_shelf_popover(uiLayout &layout, const bContext &C, StringRefNull asset_shelf_id, StringRefNull name, int icon)
const IDFilterEnumPropertyItem rna_enum_id_type_filter_items[]
Definition rna_ID.cc:122
bool RNA_property_array_check(PropertyRNA *prop)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
int RNA_enum_from_identifier(const EnumPropertyItem *item, const char *identifier)
PropertyType RNA_property_type(PropertyRNA *prop)
const char * RNA_struct_identifier(const StructRNA *type)
void RNA_property_enum_items_gettexted(bContext *C, PointerRNA *ptr, PropertyRNA *prop, const EnumPropertyItem **r_item, int *r_totitem, bool *r_free)
const char * RNA_property_translation_context(const PropertyRNA *prop)
int RNA_struct_ui_icon(const StructRNA *type)
bool RNA_pointer_is_null(const PointerRNA *ptr)
PropertySubType RNA_property_subtype(PropertyRNA *prop)
void RNA_property_enum_items(bContext *C, PointerRNA *ptr, PropertyRNA *prop, const EnumPropertyItem **r_item, int *r_totitem, bool *r_free)
const char * RNA_struct_translation_context(const StructRNA *type)
static const EnumPropertyItem curve_type_items[]
Definition rna_curve.cc:125
PropertyRNA * RNA_def_string(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, const int maxlen, const char *ui_name, const char *ui_description)
void RNA_def_function_return(FunctionRNA *func, PropertyRNA *ret)
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
PropertyRNA * RNA_def_float(StructOrFunctionRNA *cont_, const char *identifier, const float default_value, const float hardmin, const float hardmax, const char *ui_name, const char *ui_description, const float softmin, const float softmax)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, const int default_value, const char *ui_name, const char *ui_description)
void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
FunctionRNA * RNA_def_function(StructRNA *srna, const char *identifier, const char *call)
PropertyRNA * RNA_def_pointer(StructOrFunctionRNA *cont_, const char *identifier, const char *type, const char *ui_name, const char *ui_description)
void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
void RNA_def_function_ui_description(FunctionRNA *func, const char *description)
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier, int type, int subtype)
void RNA_def_property_enum_funcs(PropertyRNA *prop, const char *get, const char *set, const char *item)
PropertyRNA * RNA_def_enum_flag(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, const int default_value, const char *ui_name, const char *ui_description)
void RNA_enum_item_end(EnumPropertyItem **items, int *totitem)
void RNA_def_function_flag(FunctionRNA *func, int flag)
void RNA_def_property_clear_flag(PropertyRNA *prop, PropertyFlag flag)
PropertyRNA * RNA_def_float_array(StructOrFunctionRNA *cont_, const char *identifier, const int len, const float *default_value, const float hardmin, const float hardmax, const char *ui_name, const char *ui_description, const float softmin, const float softmax)
void RNA_enum_item_add(EnumPropertyItem **items, int *totitem, const EnumPropertyItem *item)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
void RNA_def_function_output(FunctionRNA *, PropertyRNA *ret)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
PropertyRNA * RNA_def_int(StructOrFunctionRNA *cont_, const char *identifier, const int default_value, const int hardmin, const int hardmax, const char *ui_name, const char *ui_description, const int softmin, const int softmax)
void RNA_def_parameter_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
const char * rna_translate_ui_text(const char *text, const char *text_ctxt, StructRNA *type, PropertyRNA *prop, bool translate)
const EnumPropertyItem rna_enum_dummy_NULL_items[]
Definition rna_rna.cc:29
const EnumPropertyItem rna_enum_region_type_items[]
Definition rna_screen.cc:24
const EnumPropertyItem rna_enum_space_type_items[]
Definition rna_space.cc:97
const EnumPropertyItem rna_enum_uilist_layout_type_items[]
Definition rna_ui.cc:49
static void api_ui_item_common_text(FunctionRNA *func)
static void api_ui_item_common(FunctionRNA *func)
static void api_ui_item_rna_common(FunctionRNA *func)
static void api_ui_item_op(FunctionRNA *func)
static void api_ui_item_op_common(FunctionRNA *func)
static void api_ui_item_common_heading(FunctionRNA *func)
const EnumPropertyItem rna_enum_icon_items[]
Definition rna_ui_api.cc:31
void RNA_api_ui_layout(StructRNA *srna)
void api_ui_item_common_translation(FunctionRNA *func)
#define FLT_MAX
Definition stdcycles.h:14
const char * identifier
Definition RNA_types.hh:506
const char * name
Definition RNA_types.hh:510
const char * description
Definition RNA_types.hh:512
Definition DNA_ID.h:413
uiLayout * header
uiLayout * body
StructRNA * type
Definition RNA_types.hh:41
StructRNA * srna
Definition WM_types.hh:1080
PointerRNA * ptr
Definition wm_files.cc:4126
wmOperatorType * ot
Definition wm_files.cc:4125
wmOperatorType * WM_operatortype_find(const char *idname, bool quiet)
uint8_t flag
Definition wm_window.cc:138