Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_ui.c
| Show First 20 Lines • Show All 399 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| static StructRNA *rna_Panel_refine(PointerRNA *ptr) | static StructRNA *rna_Panel_refine(PointerRNA *ptr) | ||||
| { | { | ||||
| Panel *menu = (Panel *)ptr->data; | Panel *menu = (Panel *)ptr->data; | ||||
| return (menu->type && menu->type->rna_ext.srna) ? menu->type->rna_ext.srna : &RNA_Panel; | return (menu->type && menu->type->rna_ext.srna) ? menu->type->rna_ext.srna : &RNA_Panel; | ||||
| } | } | ||||
| static StructRNA *rna_Panel_custom_data_typef(PointerRNA *ptr) | |||||
| { | |||||
| Panel *panel = (Panel *)ptr->data; | |||||
| return UI_panel_custom_data_get(panel)->type; | |||||
| } | |||||
| static PointerRNA rna_Panel_custom_data_get(PointerRNA *ptr) | |||||
| { | |||||
| Panel *panel = (Panel *)ptr->data; | |||||
| /* Because the panel custom data is general we can't refine the pointer type here. */ | |||||
| return *UI_panel_custom_data_get(panel); | |||||
| } | |||||
| /* UIList */ | /* UIList */ | ||||
| static unsigned int rna_UIList_filter_const_FILTER_ITEM_get(PointerRNA *UNUSED(ptr)) | static unsigned int rna_UIList_filter_const_FILTER_ITEM_get(PointerRNA *UNUSED(ptr)) | ||||
| { | { | ||||
| return UILST_FLT_ITEM; | return UILST_FLT_ITEM; | ||||
| } | } | ||||
| static IDProperty *rna_UIList_idprops(PointerRNA *ptr, bool create) | static IDProperty *rna_UIList_idprops(PointerRNA *ptr, bool create) | ||||
| { | { | ||||
| ▲ Show 20 Lines • Show All 926 Lines • ▼ Show 20 Lines | static void rna_def_panel(BlenderRNA *brna) | ||||
| prop = RNA_def_property(srna, "layout", PROP_POINTER, PROP_NONE); | prop = RNA_def_property(srna, "layout", PROP_POINTER, PROP_NONE); | ||||
| RNA_def_property_struct_type(prop, "UILayout"); | RNA_def_property_struct_type(prop, "UILayout"); | ||||
| RNA_def_property_ui_text(prop, "Layout", "Defines the structure of the panel in the UI"); | RNA_def_property_ui_text(prop, "Layout", "Defines the structure of the panel in the UI"); | ||||
| prop = RNA_def_property(srna, "text", PROP_STRING, PROP_NONE); | prop = RNA_def_property(srna, "text", PROP_STRING, PROP_NONE); | ||||
| RNA_def_property_string_sdna(prop, NULL, "drawname"); | RNA_def_property_string_sdna(prop, NULL, "drawname"); | ||||
| RNA_def_property_ui_text(prop, "Text", "XXX todo"); | RNA_def_property_ui_text(prop, "Text", "XXX todo"); | ||||
| prop = RNA_def_int( | prop = RNA_def_property(srna, "custom_data", PROP_POINTER, PROP_NONE); | ||||
| srna, "list_panel_index", 0, 0, INT_MAX, "Instanced Panel Data Index", "", 0, INT_MAX); | RNA_def_property_struct_type(prop, "Constraint"); | ||||
| RNA_def_property_int_sdna(prop, NULL, "runtime.list_index"); | RNA_def_property_pointer_sdna(prop, NULL, "runtime.custom_data_ptr"); | ||||
| RNA_def_property_pointer_funcs( | |||||
| prop, "rna_Panel_custom_data_get", NULL, "rna_Panel_custom_data_typef", NULL); | |||||
| RNA_def_property_ui_text(prop, "Custom Data", "Panel Data"); | |||||
| RNA_def_property_clear_flag(prop, PROP_EDITABLE); | RNA_def_property_clear_flag(prop, PROP_EDITABLE); | ||||
| /* registration */ | /* registration */ | ||||
| prop = RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE); | prop = RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE); | ||||
| RNA_def_property_string_sdna(prop, NULL, "type->idname"); | RNA_def_property_string_sdna(prop, NULL, "type->idname"); | ||||
| RNA_def_property_flag(prop, PROP_REGISTER); | RNA_def_property_flag(prop, PROP_REGISTER); | ||||
| RNA_def_property_ui_text(prop, | RNA_def_property_ui_text(prop, | ||||
| "ID Name", | "ID Name", | ||||
| ▲ Show 20 Lines • Show All 388 Lines • Show Last 20 Lines | |||||