diff options
Diffstat (limited to 'source/blender/makesrna/intern/rna_ui.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_ui.c | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/source/blender/makesrna/intern/rna_ui.c b/source/blender/makesrna/intern/rna_ui.c index ce1f9efcf63..e02421b9270 100644 --- a/source/blender/makesrna/intern/rna_ui.c +++ b/source/blender/makesrna/intern/rna_ui.c @@ -93,7 +93,7 @@ static ARegionType *region_type_find(ReportList *reports, int space_type, int re if (art->regionid == region_type) break; } - + /* region type not found? abort */ if (art == NULL) { BKE_report(reports, RPT_ERROR, "Region not found in space type"); @@ -175,7 +175,7 @@ static void rna_Panel_unregister(Main *UNUSED(bmain), StructRNA *type) return; if (!(art = region_type_find(NULL, pt->space_type, pt->region_type))) return; - + RNA_struct_free_extension(type, &pt->ext); RNA_struct_free(&BLENDER_RNA, type); @@ -211,7 +211,7 @@ static StructRNA *rna_Panel_register( /* validate the python class */ if (validate(&dummyptr, data, have_function) != 0) return NULL; - + if (strlen(identifier) >= sizeof(dummypt.idname)) { BKE_reportf(reports, RPT_ERROR, "Registering panel class: '%s' is too long, maximum length is %d", identifier, (int)sizeof(dummypt.idname)); @@ -251,7 +251,7 @@ static StructRNA *rna_Panel_register( dummypt.parent_id, dummypt.idname); return NULL; } - + /* create a new panel type */ pt = MEM_callocN(sizeof(PanelType), "python buttons panel"); memcpy(pt, &dummypt, sizeof(dummypt)); @@ -296,7 +296,7 @@ static StructRNA *rna_Panel_register( /* update while blender is running */ WM_main_add_notifier(NC_WINDOW, NULL); - + return pt->ext.srna; } @@ -590,7 +590,7 @@ static void rna_Header_unregister(Main *UNUSED(bmain), StructRNA *type) return; if (!(art = region_type_find(NULL, ht->space_type, ht->region_type))) return; - + RNA_struct_free_extension(type, &ht->ext); RNA_struct_free(&BLENDER_RNA, type); @@ -642,7 +642,7 @@ static StructRNA *rna_Header_register( if (!RNA_struct_bl_idname_ok_or_report(reports, dummyht.idname, "_HT_")) { return NULL; } - + /* create a new header type */ ht = MEM_callocN(sizeof(HeaderType), "python buttons header"); memcpy(ht, &dummyht, sizeof(dummyht)); @@ -659,7 +659,7 @@ static StructRNA *rna_Header_register( /* update while blender is running */ WM_main_add_notifier(NC_WINDOW, NULL); - + return ht->ext.srna; } @@ -720,7 +720,7 @@ static void rna_Menu_unregister(Main *UNUSED(bmain), StructRNA *type) if (!mt) return; - + RNA_struct_free_extension(type, &mt->ext); RNA_struct_free(&BLENDER_RNA, type); @@ -754,7 +754,7 @@ static StructRNA *rna_Menu_register( /* validate the python class */ if (validate(&dummymtr, data, have_function) != 0) return NULL; - + if (strlen(identifier) >= sizeof(dummymt.idname)) { BKE_reportf(reports, RPT_ERROR, "Registering menu class: '%s' is too long, maximum length is %d", identifier, (int)sizeof(dummymt.idname)); @@ -772,7 +772,7 @@ static StructRNA *rna_Menu_register( if (!RNA_struct_bl_idname_ok_or_report(reports, dummymt.idname, "_MT_")) { return NULL; } - + /* create a new menu type */ if (_menu_descr[0]) { description_size = strlen(_menu_descr) + 1; @@ -812,7 +812,7 @@ static StructRNA *rna_Menu_register( /* update while blender is running */ WM_main_add_notifier(NC_WINDOW, NULL); - + return mt->ext.srna; } @@ -958,7 +958,7 @@ static void rna_def_ui_layout(BlenderRNA *brna) {UI_LAYOUT_ALIGN_RIGHT, "RIGHT", 0, "Right", ""}, {0, NULL, 0, NULL, NULL} }; - + static const EnumPropertyItem emboss_items[] = { {UI_EMBOSS, "NORMAL", 0, "Normal", "Draw standard button emboss style"}, {UI_EMBOSS_NONE, "NONE", 0, "None", "Draw only text and icons"}, @@ -975,15 +975,15 @@ static void rna_def_ui_layout(BlenderRNA *brna) prop = RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs(prop, "rna_UILayout_active_get", "rna_UILayout_active_set"); - + prop = RNA_def_property(srna, "operator_context", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, rna_enum_operator_context_items); RNA_def_property_enum_funcs(prop, "rna_UILayout_op_context_get", "rna_UILayout_op_context_set", NULL); - + prop = RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs(prop, "rna_UILayout_enabled_get", "rna_UILayout_enabled_set"); RNA_def_property_ui_text(prop, "Enabled", "When false, this (sub)layout is grayed out"); - + prop = RNA_def_property(srna, "alert", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs(prop, "rna_UILayout_alert_get", "rna_UILayout_alert_set"); @@ -999,7 +999,7 @@ static void rna_def_ui_layout(BlenderRNA *brna) prop = RNA_def_property(srna, "scale_x", PROP_FLOAT, PROP_UNSIGNED); RNA_def_property_float_funcs(prop, "rna_UILayout_scale_x_get", "rna_UILayout_scale_x_set", NULL); RNA_def_property_ui_text(prop, "Scale X", "Scale factor along the X for items in this (sub)layout"); - + prop = RNA_def_property(srna, "scale_y", PROP_FLOAT, PROP_UNSIGNED); RNA_def_property_float_funcs(prop, "rna_UILayout_scale_y_get", "rna_UILayout_scale_y_set", NULL); RNA_def_property_ui_text(prop, "Scale Y", "Scale factor along the Y for items in this (sub)layout"); @@ -1008,7 +1008,7 @@ static void rna_def_ui_layout(BlenderRNA *brna) prop = RNA_def_property(srna, "emboss", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, emboss_items); RNA_def_property_enum_funcs(prop, "rna_UILayout_emboss_get", "rna_UILayout_emboss_set", NULL); - + prop = RNA_def_property(srna, "use_property_split", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs(prop, "rna_UILayout_property_split_get", "rna_UILayout_property_split_set"); } @@ -1019,7 +1019,7 @@ static void rna_def_panel(BlenderRNA *brna) PropertyRNA *prop; PropertyRNA *parm; FunctionRNA *func; - + static const EnumPropertyItem panel_flag_items[] = { {PNL_DEFAULT_CLOSED, "DEFAULT_CLOSED", 0, "Default Closed", "Defines if the panel has to be open or collapsed at the time of its creation"}, @@ -1028,7 +1028,7 @@ static void rna_def_panel(BlenderRNA *brna) "arrow to collapse the panel and the label (see bl_label)"}, {0, NULL, 0, NULL, NULL} }; - + srna = RNA_def_struct(brna, "Panel", NULL); RNA_def_struct_ui_text(srna, "Panel", "Panel containing UI elements"); RNA_def_struct_sdna(srna, "Panel"); @@ -1061,11 +1061,11 @@ static void rna_def_panel(BlenderRNA *brna) prop = RNA_def_property(srna, "layout", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "UILayout"); 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); RNA_def_property_string_sdna(prop, NULL, "drawname"); RNA_def_property_ui_text(prop, "Text", "XXX todo"); - + /* registration */ prop = RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "type->idname"); @@ -1102,7 +1102,7 @@ static void rna_def_panel(BlenderRNA *brna) RNA_def_property_enum_items(prop, rna_enum_space_type_items); RNA_def_property_flag(prop, PROP_REGISTER); RNA_def_property_ui_text(prop, "Space type", "The space where the panel is going to be used in"); - + prop = RNA_def_property(srna, "bl_region_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "type->region_type"); RNA_def_property_enum_items(prop, rna_enum_region_type_items); @@ -1115,7 +1115,7 @@ static void rna_def_panel(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Context", "The context in which the panel belongs to. (TODO: explain the " "possible combinations bl_context/bl_region_type/bl_space_type)"); - + prop = RNA_def_property(srna, "bl_options", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "type->flag"); RNA_def_property_enum_items(prop, panel_flag_items); @@ -1263,7 +1263,7 @@ static void rna_def_header(BlenderRNA *brna) PropertyRNA *prop; PropertyRNA *parm; FunctionRNA *func; - + srna = RNA_def_struct(brna, "Header", NULL); RNA_def_struct_ui_text(srna, "Header", "Editor header containing UI elements"); RNA_def_struct_sdna(srna, "Header"); @@ -1318,7 +1318,7 @@ static void rna_def_menu(BlenderRNA *brna) PropertyRNA *prop; PropertyRNA *parm; FunctionRNA *func; - + srna = RNA_def_struct(brna, "Menu", NULL); RNA_def_struct_ui_text(srna, "Menu", "Editor menu containing buttons"); RNA_def_struct_sdna(srna, "Menu"); |