diff options
Diffstat (limited to 'source/blender/makesrna/intern/rna_screen.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_screen.c | 41 |
1 files changed, 35 insertions, 6 deletions
diff --git a/source/blender/makesrna/intern/rna_screen.c b/source/blender/makesrna/intern/rna_screen.c index e153994e7a6..fb836a98a52 100644 --- a/source/blender/makesrna/intern/rna_screen.c +++ b/source/blender/makesrna/intern/rna_screen.c @@ -33,15 +33,41 @@ #include "DNA_scene_types.h" EnumPropertyItem region_type_items[] = { - {RGN_TYPE_WINDOW, "WINDOW", "Window", ""}, - {RGN_TYPE_HEADER, "HEADER", "Header", ""}, - {RGN_TYPE_CHANNELS, "CHANNELS", "Channels", ""}, - {RGN_TYPE_TEMPORARY, "TEMPORARY", "Temporary", ""}, - {RGN_TYPE_UI, "UI", "UI", ""}, - {0, NULL, NULL, NULL}}; + {RGN_TYPE_WINDOW, "WINDOW", 0, "Window", ""}, + {RGN_TYPE_HEADER, "HEADER", 0, "Header", ""}, + {RGN_TYPE_CHANNELS, "CHANNELS", 0, "Channels", ""}, + {RGN_TYPE_TOOLS, "TOOLS", 0, "Tools", ""}, + {RGN_TYPE_TEMPORARY, "TEMPORARY", 0, "Temporary", ""}, + {RGN_TYPE_UI, "UI", 0, "UI", ""}, + {0, NULL, 0, NULL, NULL}}; #ifdef RNA_RUNTIME +#include "WM_api.h" +#include "WM_types.h" + +static void rna_Screen_scene_set(PointerRNA *ptr, PointerRNA value) +{ + bScreen *sc= (bScreen*)ptr->data; + + if(value.data == NULL) + return; + + /* exception: can't set screens inside of area/region handers */ + sc->newscene= value.data; +} + +static void rna_Screen_scene_update(bContext *C, PointerRNA *ptr) +{ + bScreen *sc= (bScreen*)ptr->data; + + /* exception: can't set screens inside of area/region handers */ + if(sc->newscene) { + WM_event_add_notifier(C, NC_SCENE|ND_SCENEBROWSE, sc->newscene); + sc->newscene= NULL; + } +} + #else static void rna_def_scrarea(BlenderRNA *brna) @@ -94,6 +120,9 @@ static void rna_def_bscreen(BlenderRNA *brna) prop= RNA_def_property(srna, "scene", PROP_POINTER, PROP_NEVER_NULL); RNA_def_property_ui_text(prop, "Scene", "Active scene to be edited in the screen."); + RNA_def_property_flag(prop, PROP_EDITABLE); + RNA_def_property_pointer_funcs(prop, NULL, "rna_Screen_scene_set", NULL); + RNA_def_property_update(prop, 0, "rna_Screen_scene_update"); prop= RNA_def_property(srna, "areas", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "areabase", NULL); |