4 * ***** BEGIN GPL LICENSE BLOCK *****
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software Foundation,
18 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 * Contributor(s): Blender Foundation (2009)
22 * ***** END GPL LICENSE BLOCK *****
27 #include "DNA_screen_types.h"
29 #include "RNA_define.h"
30 #include "RNA_types.h"
32 #include "rna_internal.h"
33 #include "RNA_enum_types.h"
35 #include "UI_interface.h"
41 #include "MEM_guardedalloc.h"
43 #include "RNA_access.h"
45 #include "BLI_dynstr.h"
47 #include "BKE_context.h"
48 #include "BKE_report.h"
49 #include "BKE_screen.h"
53 static ARegionType *region_type_find(ReportList *reports, int space_type, int region_type)
58 st= BKE_spacetype_from_id(space_type);
60 for(art= (st)? st->regiontypes.first: NULL; art; art= art->next) {
61 if (art->regionid==region_type)
65 /* region type not found? abort */
67 BKE_report(reports, RPT_ERROR, "Region not found in spacetype.");
76 static int panel_poll(const bContext *C, PanelType *pt)
84 RNA_pointer_create(NULL, pt->ext.srna, NULL, &ptr); /* dummy */
85 func= RNA_struct_find_function(&ptr, "poll");
87 RNA_parameter_list_create(&list, &ptr, func);
88 RNA_parameter_set_lookup(&list, "context", &C);
89 pt->ext.call(&ptr, func, &list);
91 RNA_parameter_get_lookup(&list, "visible", &ret);
94 RNA_parameter_list_free(&list);
99 static void panel_draw(const bContext *C, Panel *pnl)
105 RNA_pointer_create(&CTX_wm_screen(C)->id, pnl->type->ext.srna, pnl, &ptr);
106 func= RNA_struct_find_function(&ptr, "draw");
108 RNA_parameter_list_create(&list, &ptr, func);
109 RNA_parameter_set_lookup(&list, "context", &C);
110 pnl->type->ext.call(&ptr, func, &list);
112 RNA_parameter_list_free(&list);
115 static void panel_draw_header(const bContext *C, Panel *pnl)
121 RNA_pointer_create(&CTX_wm_screen(C)->id, pnl->type->ext.srna, pnl, &ptr);
122 func= RNA_struct_find_function(&ptr, "draw_header");
124 RNA_parameter_list_create(&list, &ptr, func);
125 RNA_parameter_set_lookup(&list, "context", &C);
126 pnl->type->ext.call(&ptr, func, &list);
128 RNA_parameter_list_free(&list);
131 static void rna_Panel_unregister(const bContext *C, StructRNA *type)
134 PanelType *pt= RNA_struct_blender_type_get(type);
138 if(!(art=region_type_find(NULL, pt->space_type, pt->region_type)))
141 RNA_struct_free_extension(type, &pt->ext);
143 BLI_freelinkN(&art->paneltypes, pt);
144 RNA_struct_free(&BLENDER_RNA, type);
146 /* update while blender is running */
148 WM_event_add_notifier(C, NC_SCREEN|NA_EDITED, NULL);
151 static StructRNA *rna_Panel_register(const bContext *C, ReportList *reports, void *data, const char *identifier, StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free)
154 PanelType *pt, dummypt = {0};
155 Panel dummypanel= {0};
157 int have_function[3];
159 /* setup dummy panel & panel type to store static properties in */
160 dummypanel.type= &dummypt;
161 RNA_pointer_create(NULL, &RNA_Panel, &dummypanel, &dummyptr);
163 /* validate the python class */
164 if(validate(&dummyptr, data, have_function) != 0)
167 if(!(art=region_type_find(reports, dummypt.space_type, dummypt.region_type)))
170 /* check if we have registered this panel type before, and remove it */
171 for(pt=art->paneltypes.first; pt; pt=pt->next) {
172 if(strcmp(pt->idname, dummypt.idname) == 0) {
174 rna_Panel_unregister(C, pt->ext.srna);
176 BLI_freelinkN(&art->paneltypes, pt);
181 /* create a new panel type */
182 pt= MEM_callocN(sizeof(PanelType), "python buttons panel");
183 memcpy(pt, &dummypt, sizeof(dummypt));
185 pt->ext.srna= RNA_def_struct(&BLENDER_RNA, pt->idname, "Panel");
189 RNA_struct_blender_type_set(pt->ext.srna, pt);
191 pt->poll= (have_function[0])? panel_poll: NULL;
192 pt->draw= (have_function[1])? panel_draw: NULL;
193 pt->draw_header= (have_function[2])? panel_draw_header: NULL;
195 BLI_addtail(&art->paneltypes, pt);
197 /* update while blender is running */
199 WM_event_add_notifier(C, NC_SCREEN|NA_EDITED, NULL);
204 static StructRNA* rna_Panel_refine(PointerRNA *ptr)
206 Panel *hdr= (Panel*)ptr->data;
207 return (hdr->type && hdr->type->ext.srna)? hdr->type->ext.srna: &RNA_Panel;
212 static void header_draw(const bContext *C, Header *hdr)
218 RNA_pointer_create(&CTX_wm_screen(C)->id, hdr->type->ext.srna, hdr, &htr);
219 func= RNA_struct_find_function(&htr, "draw");
221 RNA_parameter_list_create(&list, &htr, func);
222 RNA_parameter_set_lookup(&list, "context", &C);
223 hdr->type->ext.call(&htr, func, &list);
225 RNA_parameter_list_free(&list);
228 static void rna_Header_unregister(const bContext *C, StructRNA *type)
231 HeaderType *ht= RNA_struct_blender_type_get(type);
235 if(!(art=region_type_find(NULL, ht->space_type, RGN_TYPE_HEADER)))
238 RNA_struct_free_extension(type, &ht->ext);
240 BLI_freelinkN(&art->headertypes, ht);
241 RNA_struct_free(&BLENDER_RNA, type);
243 /* update while blender is running */
245 WM_event_add_notifier(C, NC_SCREEN|NA_EDITED, NULL);
248 static StructRNA *rna_Header_register(const bContext *C, ReportList *reports, void *data, const char *identifier, StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free)
251 HeaderType *ht, dummyht = {0};
252 Header dummyheader= {0};
254 int have_function[1];
256 /* setup dummy header & header type to store static properties in */
257 dummyheader.type= &dummyht;
258 RNA_pointer_create(NULL, &RNA_Header, &dummyheader, &dummyhtr);
260 /* validate the python class */
261 if(validate(&dummyhtr, data, have_function) != 0)
264 if(!(art=region_type_find(reports, dummyht.space_type, RGN_TYPE_HEADER)))
267 /* check if we have registered this header type before, and remove it */
268 for(ht=art->headertypes.first; ht; ht=ht->next) {
269 if(strcmp(ht->idname, dummyht.idname) == 0) {
271 rna_Header_unregister(C, ht->ext.srna);
276 /* create a new header type */
277 ht= MEM_callocN(sizeof(HeaderType), "python buttons header");
278 memcpy(ht, &dummyht, sizeof(dummyht));
280 ht->ext.srna= RNA_def_struct(&BLENDER_RNA, ht->idname, "Header");
284 RNA_struct_blender_type_set(ht->ext.srna, ht);
286 ht->draw= (have_function[0])? header_draw: NULL;
288 BLI_addtail(&art->headertypes, ht);
290 /* update while blender is running */
292 WM_event_add_notifier(C, NC_SCREEN|NA_EDITED, NULL);
297 static StructRNA* rna_Header_refine(PointerRNA *htr)
299 Header *hdr= (Header*)htr->data;
300 return (hdr->type && hdr->type->ext.srna)? hdr->type->ext.srna: &RNA_Header;
305 static int menu_poll(const bContext *C, MenuType *pt)
313 RNA_pointer_create(NULL, pt->ext.srna, NULL, &ptr); /* dummy */
314 func= RNA_struct_find_function(&ptr, "poll");
316 RNA_parameter_list_create(&list, &ptr, func);
317 RNA_parameter_set_lookup(&list, "context", &C);
318 pt->ext.call(&ptr, func, &list);
320 RNA_parameter_get_lookup(&list, "visible", &ret);
323 RNA_parameter_list_free(&list);
328 static void menu_draw(const bContext *C, Menu *hdr)
334 RNA_pointer_create(&CTX_wm_screen(C)->id, hdr->type->ext.srna, hdr, &mtr);
335 func= RNA_struct_find_function(&mtr, "draw");
337 RNA_parameter_list_create(&list, &mtr, func);
338 RNA_parameter_set_lookup(&list, "context", &C);
339 hdr->type->ext.call(&mtr, func, &list);
341 RNA_parameter_list_free(&list);
344 static void rna_Menu_unregister(const bContext *C, StructRNA *type)
347 MenuType *mt= RNA_struct_blender_type_get(type);
352 RNA_struct_free_extension(type, &mt->ext);
354 WM_menutype_freelink(mt);
356 RNA_struct_free(&BLENDER_RNA, type);
358 /* update while blender is running */
360 WM_event_add_notifier(C, NC_SCREEN|NA_EDITED, NULL);
363 static StructRNA *rna_Menu_register(const bContext *C, ReportList *reports, void *data, const char *identifier, StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free)
366 MenuType *mt, dummymt = {0};
369 int have_function[2];
371 /* setup dummy menu & menu type to store static properties in */
372 dummymenu.type= &dummymt;
373 RNA_pointer_create(NULL, &RNA_Menu, &dummymenu, &dummymtr);
375 /* validate the python class */
376 if(validate(&dummymtr, data, have_function) != 0)
379 /* check if we have registered this menu type before, and remove it */
380 mt= WM_menutype_find(dummymt.idname, TRUE);
381 if(mt && mt->ext.srna)
382 rna_Menu_unregister(C, mt->ext.srna);
384 /* create a new menu type */
385 mt= MEM_callocN(sizeof(MenuType), "python buttons menu");
386 memcpy(mt, &dummymt, sizeof(dummymt));
388 mt->ext.srna= RNA_def_struct(&BLENDER_RNA, mt->idname, "Menu");
392 RNA_struct_blender_type_set(mt->ext.srna, mt);
394 mt->poll= (have_function[0])? menu_poll: NULL;
395 mt->draw= (have_function[1])? menu_draw: NULL;
399 /* update while blender is running */
401 WM_event_add_notifier(C, NC_SCREEN|NA_EDITED, NULL);
406 static StructRNA* rna_Menu_refine(PointerRNA *mtr)
408 Menu *hdr= (Menu*)mtr->data;
409 return (hdr->type && hdr->type->ext.srna)? hdr->type->ext.srna: &RNA_Menu;
412 static int rna_UILayout_active_get(PointerRNA *ptr)
414 return uiLayoutGetActive(ptr->data);
417 static void rna_UILayout_active_set(PointerRNA *ptr, int value)
419 uiLayoutSetActive(ptr->data, value);
422 static void rna_UILayout_op_context_set(PointerRNA *ptr, int value)
424 uiLayoutSetOperatorContext(ptr->data, value);
427 static int rna_UILayout_op_context_get(PointerRNA *ptr)
429 return uiLayoutGetOperatorContext(ptr->data);
432 static int rna_UILayout_enabled_get(PointerRNA *ptr)
434 return uiLayoutGetEnabled(ptr->data);
437 static void rna_UILayout_enabled_set(PointerRNA *ptr, int value)
439 uiLayoutSetEnabled(ptr->data, value);
443 static int rna_UILayout_red_alert_get(PointerRNA *ptr)
445 return uiLayoutGetRedAlert(ptr->data);
448 static void rna_UILayout_red_alert_set(PointerRNA *ptr, int value)
450 uiLayoutSetRedAlert(ptr->data, value);
453 static int rna_UILayout_keep_aspect_get(PointerRNA *ptr)
455 return uiLayoutGetKeepAspect(ptr->data);
458 static void rna_UILayout_keep_aspect_set(PointerRNA *ptr, int value)
460 uiLayoutSetKeepAspect(ptr->data, value);
464 static int rna_UILayout_alignment_get(PointerRNA *ptr)
466 return uiLayoutGetAlignment(ptr->data);
469 static void rna_UILayout_alignment_set(PointerRNA *ptr, int value)
471 uiLayoutSetAlignment(ptr->data, value);
474 static float rna_UILayout_scale_x_get(PointerRNA *ptr)
476 return uiLayoutGetScaleX(ptr->data);
479 static void rna_UILayout_scale_x_set(PointerRNA *ptr, float value)
481 uiLayoutSetScaleX(ptr->data, value);
484 static float rna_UILayout_scale_y_get(PointerRNA *ptr)
486 return uiLayoutGetScaleY(ptr->data);
489 static void rna_UILayout_scale_y_set(PointerRNA *ptr, float value)
491 uiLayoutSetScaleY(ptr->data, value);
494 static PointerRNA rna_UIListItem_layout_get(PointerRNA *ptr)
496 uiListItem *item= (uiListItem*)ptr->data;
498 RNA_pointer_create(NULL, &RNA_UILayout, item->layout, &newptr);
502 static PointerRNA rna_UIListItem_data_get(PointerRNA *ptr)
504 uiListItem *item= (uiListItem*)ptr->data;
510 static void rna_def_ui_layout(BlenderRNA *brna)
515 static EnumPropertyItem alignment_items[] = {
516 {UI_LAYOUT_ALIGN_EXPAND, "EXPAND", 0, "Expand", ""},
517 {UI_LAYOUT_ALIGN_LEFT, "LEFT", 0, "Left", ""},
518 {UI_LAYOUT_ALIGN_CENTER, "CENTER", 0, "Center", ""},
519 {UI_LAYOUT_ALIGN_RIGHT, "RIGHT", 0, "RIght", ""},
520 {0, NULL, 0, NULL, NULL}};
523 static EnumPropertyItem operator_context_items[] = {
524 {WM_OP_INVOKE_DEFAULT, "INVOKE_DEFAULT", 0, "Invoke Default", ""},
525 {WM_OP_INVOKE_REGION_WIN, "INVOKE_REGION_WIN", 0, "Invoke Region Window", ""},
526 {WM_OP_INVOKE_AREA, "INVOKE_AREA", 0, "Invoke Area", ""},
527 {WM_OP_INVOKE_SCREEN, "INVOKE_SCREEN", 0, "Invoke Screen", ""},
528 {WM_OP_EXEC_DEFAULT, "EXEC_DEFAULT", 0, "Exec Default", ""},
529 {WM_OP_EXEC_REGION_WIN, "EXEC_REGION_WIN", 0, "Exec Region Window", ""},
530 {WM_OP_EXEC_AREA, "EXEC_AREA", 0, "Exec Area", ""},
531 {WM_OP_EXEC_SCREEN, "EXEC_SCREEN", 0, "Exec Screen", ""},
532 {0, NULL, 0, NULL, NULL}};
536 srna= RNA_def_struct(brna, "UILayout", NULL);
537 RNA_def_struct_sdna(srna, "uiLayout");
538 RNA_def_struct_ui_text(srna, "UI Layout", "User interface layout in a panel or header.");
540 prop= RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE);
541 RNA_def_property_boolean_funcs(prop, "rna_UILayout_active_get", "rna_UILayout_active_set");
543 prop= RNA_def_property(srna, "operator_context", PROP_ENUM, PROP_NONE);
544 RNA_def_property_enum_items(prop, operator_context_items);
545 RNA_def_property_enum_funcs(prop, "rna_UILayout_op_context_get", "rna_UILayout_op_context_set", NULL);
547 prop= RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE);
548 RNA_def_property_boolean_funcs(prop, "rna_UILayout_enabled_get", "rna_UILayout_enabled_set");
551 prop= RNA_def_property(srna, "red_alert", PROP_BOOLEAN, PROP_NONE);
552 RNA_def_property_boolean_funcs(prop, "rna_UILayout_red_alert_get", "rna_UILayout_red_alert_set");
555 prop= RNA_def_property(srna, "alignment", PROP_ENUM, PROP_NONE);
556 RNA_def_property_enum_items(prop, alignment_items);
557 RNA_def_property_enum_funcs(prop, "rna_UILayout_alignment_get", "rna_UILayout_alignment_set", NULL);
560 prop= RNA_def_property(srna, "keep_aspect", PROP_BOOLEAN, PROP_NONE);
561 RNA_def_property_boolean_funcs(prop, "rna_UILayout_keep_aspect_get", "rna_UILayout_keep_aspect_set");
564 prop= RNA_def_property(srna, "scale_x", PROP_FLOAT, PROP_UNSIGNED);
565 RNA_def_property_float_funcs(prop, "rna_UILayout_scale_x_get", "rna_UILayout_scale_x_set", NULL);
567 prop= RNA_def_property(srna, "scale_y", PROP_FLOAT, PROP_UNSIGNED);
568 RNA_def_property_float_funcs(prop, "rna_UILayout_scale_y_get", "rna_UILayout_scale_y_set", NULL);
570 RNA_api_ui_layout(srna);
574 srna= RNA_def_struct(brna, "UIListItem", NULL);
575 RNA_def_struct_ui_text(srna, "UI List Item", "User interface list.");
577 prop= RNA_def_property(srna, "layout", PROP_POINTER, PROP_NONE);
578 RNA_def_property_struct_type(prop, "UILayout");
579 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
580 RNA_def_property_pointer_funcs(prop, "rna_UIListItem_layout_get", NULL, NULL);
582 prop= RNA_def_property(srna, "data", PROP_POINTER, PROP_NONE);
583 RNA_def_property_struct_type(prop, "AnyType");
584 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
585 RNA_def_property_pointer_funcs(prop, "rna_UIListItem_data_get", NULL, NULL);
588 static void rna_def_panel(BlenderRNA *brna)
594 srna= RNA_def_struct(brna, "Panel", NULL);
595 RNA_def_struct_ui_text(srna, "Panel", "Panel containing buttons.");
596 RNA_def_struct_sdna(srna, "Panel");
597 RNA_def_struct_refine_func(srna, "rna_Panel_refine");
598 RNA_def_struct_register_funcs(srna, "rna_Panel_register", "rna_Panel_unregister");
601 func= RNA_def_function(srna, "poll", NULL);
602 RNA_def_function_ui_description(func, "Test if the panel is visible or not.");
603 RNA_def_function_flag(func, FUNC_REGISTER|FUNC_REGISTER_OPTIONAL);
604 RNA_def_function_return(func, RNA_def_boolean(func, "visible", 1, "", ""));
605 RNA_def_pointer(func, "context", "Context", "", "");
608 func= RNA_def_function(srna, "draw", NULL);
609 RNA_def_function_ui_description(func, "Draw buttons into the panel UI layout.");
610 RNA_def_function_flag(func, FUNC_REGISTER);
611 RNA_def_pointer(func, "context", "Context", "", "");
613 func= RNA_def_function(srna, "draw_header", NULL);
614 RNA_def_function_ui_description(func, "Draw buttons into the panel header UI layout.");
615 RNA_def_function_flag(func, FUNC_REGISTER);
616 RNA_def_pointer(func, "context", "Context", "", "");
618 prop= RNA_def_property(srna, "layout", PROP_POINTER, PROP_NONE);
619 RNA_def_property_struct_type(prop, "UILayout");
621 prop= RNA_def_property(srna, "text", PROP_STRING, PROP_NONE);
622 RNA_def_property_string_sdna(prop, NULL, "drawname");
625 prop= RNA_def_property(srna, "idname", PROP_STRING, PROP_NONE);
626 RNA_def_property_string_sdna(prop, NULL, "type->idname");
627 RNA_def_property_flag(prop, PROP_REGISTER);
629 prop= RNA_def_property(srna, "label", PROP_STRING, PROP_NONE);
630 RNA_def_property_string_sdna(prop, NULL, "type->label");
631 RNA_def_property_flag(prop, PROP_REGISTER);
633 prop= RNA_def_property(srna, "space_type", PROP_ENUM, PROP_NONE);
634 RNA_def_property_enum_sdna(prop, NULL, "type->space_type");
635 RNA_def_property_enum_items(prop, space_type_items);
636 RNA_def_property_flag(prop, PROP_REGISTER);
638 prop= RNA_def_property(srna, "region_type", PROP_ENUM, PROP_NONE);
639 RNA_def_property_enum_sdna(prop, NULL, "type->region_type");
640 RNA_def_property_enum_items(prop, region_type_items);
641 RNA_def_property_flag(prop, PROP_REGISTER);
643 prop= RNA_def_property(srna, "context", PROP_STRING, PROP_NONE);
644 RNA_def_property_string_sdna(prop, NULL, "type->context");
645 RNA_def_property_flag(prop, PROP_REGISTER);
647 prop= RNA_def_property(srna, "default_closed", PROP_BOOLEAN, PROP_NONE);
648 RNA_def_property_boolean_sdna(prop, NULL, "type->flag", PNL_DEFAULT_CLOSED);
649 RNA_def_property_flag(prop, PROP_REGISTER);
651 prop= RNA_def_property(srna, "show_header", PROP_BOOLEAN, PROP_NONE);
652 RNA_def_property_boolean_negative_sdna(prop, NULL, "type->flag", PNL_NO_HEADER);
653 RNA_def_property_flag(prop, PROP_REGISTER);
656 static void rna_def_header(BlenderRNA *brna)
662 srna= RNA_def_struct(brna, "Header", NULL);
663 RNA_def_struct_ui_text(srna, "Header", "Editor header containing buttons.");
664 RNA_def_struct_sdna(srna, "Header");
665 RNA_def_struct_refine_func(srna, "rna_Header_refine");
666 RNA_def_struct_register_funcs(srna, "rna_Header_register", "rna_Header_unregister");
669 func= RNA_def_function(srna, "draw", NULL);
670 RNA_def_function_ui_description(func, "Draw buttons into the header UI layout.");
671 RNA_def_function_flag(func, FUNC_REGISTER);
672 RNA_def_pointer(func, "context", "Context", "", "");
674 RNA_define_verify_sdna(0); // not in sdna
676 prop= RNA_def_property(srna, "layout", PROP_POINTER, PROP_NONE);
677 RNA_def_property_pointer_sdna(prop, NULL, "layout");
678 RNA_def_property_struct_type(prop, "UILayout");
681 prop= RNA_def_property(srna, "idname", PROP_STRING, PROP_NONE);
682 RNA_def_property_string_sdna(prop, NULL, "type->idname");
683 RNA_def_property_flag(prop, PROP_REGISTER);
685 prop= RNA_def_property(srna, "space_type", PROP_ENUM, PROP_NONE);
686 RNA_def_property_enum_sdna(prop, NULL, "type->space_type");
687 RNA_def_property_enum_items(prop, space_type_items);
688 RNA_def_property_flag(prop, PROP_REGISTER);
690 RNA_define_verify_sdna(1);
693 static void rna_def_menu(BlenderRNA *brna)
699 srna= RNA_def_struct(brna, "Menu", NULL);
700 RNA_def_struct_ui_text(srna, "Menu", "Editor menu containing buttons.");
701 RNA_def_struct_sdna(srna, "Menu");
702 RNA_def_struct_refine_func(srna, "rna_Menu_refine");
703 RNA_def_struct_register_funcs(srna, "rna_Menu_register", "rna_Menu_unregister");
706 func= RNA_def_function(srna, "poll", NULL);
707 RNA_def_function_ui_description(func, "Test if the menu is visible or not.");
708 RNA_def_function_flag(func, FUNC_REGISTER|FUNC_REGISTER_OPTIONAL);
709 RNA_def_function_return(func, RNA_def_boolean(func, "visible", 1, "", ""));
710 RNA_def_pointer(func, "context", "Context", "", "");
713 func= RNA_def_function(srna, "draw", NULL);
714 RNA_def_function_ui_description(func, "Draw buttons into the menu UI layout.");
715 RNA_def_function_flag(func, FUNC_REGISTER);
716 RNA_def_pointer(func, "context", "Context", "", "");
718 RNA_define_verify_sdna(0); // not in sdna
720 prop= RNA_def_property(srna, "layout", PROP_POINTER, PROP_NONE);
721 RNA_def_property_pointer_sdna(prop, NULL, "layout");
722 RNA_def_property_struct_type(prop, "UILayout");
725 prop= RNA_def_property(srna, "idname", PROP_STRING, PROP_NONE);
726 RNA_def_property_string_sdna(prop, NULL, "type->idname");
727 RNA_def_property_flag(prop, PROP_REGISTER);
729 prop= RNA_def_property(srna, "label", PROP_STRING, PROP_NONE);
730 RNA_def_property_string_sdna(prop, NULL, "type->label");
731 RNA_def_property_flag(prop, PROP_REGISTER);
733 RNA_define_verify_sdna(1);
736 void RNA_def_ui(BlenderRNA *brna)
738 rna_def_ui_layout(brna);
740 rna_def_header(brna);
744 #endif // RNA_RUNTIME