Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_screen.c
| Show First 20 Lines • Show All 133 Lines • ▼ Show 20 Lines | static void rna_Area_type_set(PointerRNA *ptr, int value) | ||||
| /* Empty areas are locked. */ | /* Empty areas are locked. */ | ||||
| if ((value == SPACE_EMPTY) || (area->spacetype == SPACE_EMPTY)) { | if ((value == SPACE_EMPTY) || (area->spacetype == SPACE_EMPTY)) { | ||||
| return; | return; | ||||
| } | } | ||||
| area->butspacetype = value; | area->butspacetype = value; | ||||
| } | } | ||||
| static int rna_Area_type_editable(struct PointerRNA *ptr, const char **r_info) | |||||
Severin: `r_info` also needs to be marked as `UNUSED()`. | |||||
| { | |||||
| bScreen *screen = (bScreen *)ptr->owner_id; | |||||
| if (screen->state != SCREENNORMAL || screen->temp) { | |||||
| return false; | |||||
| } | |||||
| return true; | |||||
| } | |||||
| static void rna_Area_type_update(bContext *C, PointerRNA *ptr) | static void rna_Area_type_update(bContext *C, PointerRNA *ptr) | ||||
| { | { | ||||
| bScreen *screen = (bScreen *)ptr->owner_id; | bScreen *screen = (bScreen *)ptr->owner_id; | ||||
| ScrArea *area = (ScrArea *)ptr->data; | ScrArea *area = (ScrArea *)ptr->data; | ||||
| /* Running update without having called 'set', see: T64049 */ | /* Running update without having called 'set', see: T64049 */ | ||||
| if (area->butspacetype == SPACE_EMPTY) { | if (area->butspacetype == SPACE_EMPTY) { | ||||
| return; | return; | ||||
| ▲ Show 20 Lines • Show All 245 Lines • ▼ Show 20 Lines | static void rna_def_area(BlenderRNA *brna) | ||||
| prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); | prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); | ||||
| RNA_def_property_enum_sdna(prop, NULL, "spacetype"); | RNA_def_property_enum_sdna(prop, NULL, "spacetype"); | ||||
| RNA_def_property_enum_items(prop, rna_enum_space_type_items); | RNA_def_property_enum_items(prop, rna_enum_space_type_items); | ||||
| RNA_def_property_enum_default(prop, SPACE_VIEW3D); | RNA_def_property_enum_default(prop, SPACE_VIEW3D); | ||||
| RNA_def_property_enum_funcs(prop, "rna_Area_type_get", "rna_Area_type_set", NULL); | RNA_def_property_enum_funcs(prop, "rna_Area_type_get", "rna_Area_type_set", NULL); | ||||
| RNA_def_property_ui_text(prop, "Editor Type", "Current editor type for this area"); | RNA_def_property_ui_text(prop, "Editor Type", "Current editor type for this area"); | ||||
| RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | ||||
| RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); | RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); | ||||
| RNA_def_property_editable_func(prop, "rna_Area_type_editable"); | |||||
| RNA_def_property_update(prop, 0, "rna_Area_type_update"); | RNA_def_property_update(prop, 0, "rna_Area_type_update"); | ||||
| prop = RNA_def_property(srna, "ui_type", PROP_ENUM, PROP_NONE); | prop = RNA_def_property(srna, "ui_type", PROP_ENUM, PROP_NONE); | ||||
| RNA_def_property_enum_items(prop, DummyRNA_NULL_items); /* in fact dummy */ | RNA_def_property_enum_items(prop, DummyRNA_NULL_items); /* in fact dummy */ | ||||
| RNA_def_property_enum_default(prop, SPACE_VIEW3D << 16); | RNA_def_property_enum_default(prop, SPACE_VIEW3D << 16); | ||||
| RNA_def_property_enum_funcs( | RNA_def_property_enum_funcs( | ||||
| prop, "rna_Area_ui_type_get", "rna_Area_ui_type_set", "rna_Area_ui_type_itemf"); | prop, "rna_Area_ui_type_get", "rna_Area_ui_type_set", "rna_Area_ui_type_itemf"); | ||||
| RNA_def_property_ui_text(prop, "Editor Type", "Current editor type for this area"); | RNA_def_property_ui_text(prop, "Editor Type", "Current editor type for this area"); | ||||
| RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | ||||
| RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); | RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); | ||||
| RNA_def_property_editable_func(prop, "rna_Area_type_editable"); | |||||
| RNA_def_property_update(prop, 0, "rna_Area_ui_type_update"); | RNA_def_property_update(prop, 0, "rna_Area_ui_type_update"); | ||||
| prop = RNA_def_property(srna, "x", PROP_INT, PROP_NONE); | prop = RNA_def_property(srna, "x", PROP_INT, PROP_NONE); | ||||
| RNA_def_property_int_sdna(prop, NULL, "totrct.xmin"); | RNA_def_property_int_sdna(prop, NULL, "totrct.xmin"); | ||||
| RNA_def_property_clear_flag(prop, PROP_EDITABLE); | RNA_def_property_clear_flag(prop, PROP_EDITABLE); | ||||
| RNA_def_property_ui_text( | RNA_def_property_ui_text( | ||||
| prop, "X Position", "The window relative vertical location of the area"); | prop, "X Position", "The window relative vertical location of the area"); | ||||
| ▲ Show 20 Lines • Show All 273 Lines • Show Last 20 Lines | |||||
r_info also needs to be marked as UNUSED().