diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-01-15 07:22:23 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-01-15 07:22:23 +0300 |
commit | 2213fa1c528027d363a546fe3a5377f65b5a6d26 (patch) | |
tree | 81109b4a0e1a6d855dec83d1a0baae7b9d60f088 /source/blender/makesrna/intern/rna_screen.c | |
parent | f08032e8f967e5c5893116fc24c82a18da7bdf79 (diff) |
RNA
* Work around bScreen/Screen DNA name patching, so bScreen does not
require manual callbacks to be written for properties.
* Added SpaceLink and SpaceImage RNA.
* Fix issue initializing ID property arrays with default values.
DNA
* Some DNA changes for space image.
* And a fix for corrupt clone image pointer in reading brushes.
Diffstat (limited to 'source/blender/makesrna/intern/rna_screen.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_screen.c | 55 |
1 files changed, 27 insertions, 28 deletions
diff --git a/source/blender/makesrna/intern/rna_screen.c b/source/blender/makesrna/intern/rna_screen.c index d56230bf2a5..f67c36427b7 100644 --- a/source/blender/makesrna/intern/rna_screen.c +++ b/source/blender/makesrna/intern/rna_screen.c @@ -34,30 +34,34 @@ #ifdef RNA_RUNTIME -static void *rna_Screen_scene_get(PointerRNA *ptr) -{ - bScreen *sc= (bScreen*)ptr->data; - return sc->scene; -} - -static void rna_Screen_areas_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) -{ - bScreen *scr= (bScreen*)ptr->data; - rna_iterator_listbase_begin(iter, &scr->areabase, NULL); -} - #else -static void RNA_def_scrarea(BlenderRNA *brna) +static void rna_def_scrarea(BlenderRNA *brna) { StructRNA *srna; + PropertyRNA *prop; srna= RNA_def_struct(brna, "Area", NULL); RNA_def_struct_ui_text(srna, "Area", "Area in a subdivided screen, containing an editor."); RNA_def_struct_sdna(srna, "ScrArea"); + + prop= RNA_def_property(srna, "spaces", PROP_COLLECTION, PROP_NONE); + RNA_def_property_collection_sdna(prop, NULL, "spacedata", NULL); + RNA_def_property_struct_type(prop, "Space"); + RNA_def_property_ui_text(prop, "Spaces", "Spaces contained in this area, the first space is active."); + + prop= RNA_def_property(srna, "active_space", PROP_POINTER, PROP_NONE); + RNA_def_property_pointer_sdna(prop, NULL, "spacedata.first"); + RNA_def_property_struct_type(prop, "Space"); + RNA_def_property_ui_text(prop, "Active Space", "Space currently being displayed in this area."); + + prop= RNA_def_property(srna, "regions", PROP_COLLECTION, PROP_NONE); + RNA_def_property_collection_sdna(prop, NULL, "regionbase", NULL); + RNA_def_property_struct_type(prop, "Region"); + RNA_def_property_ui_text(prop, "Regions", "Regions this area is subdivided in."); } -static void RNA_def_panel(BlenderRNA *brna) +static void rna_def_panel(BlenderRNA *brna) { StructRNA *srna; @@ -66,7 +70,7 @@ static void RNA_def_panel(BlenderRNA *brna) RNA_def_struct_sdna(srna, "Panel"); } -static void RNA_def_region(BlenderRNA *brna) +static void rna_def_region(BlenderRNA *brna) { StructRNA *srna; @@ -75,36 +79,31 @@ static void RNA_def_region(BlenderRNA *brna) RNA_def_struct_sdna(srna, "ARegion"); } -static void RNA_def_bscreen(BlenderRNA *brna) +static void rna_def_bscreen(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; srna= RNA_def_struct(brna, "Screen", "ID"); + RNA_def_struct_sdna(srna, "Screen"); /* it is actually bScreen but for 2.5 the dna is patched! */ RNA_def_struct_ui_text(srna, "Screen", "Screen datablock, defining the layout of areas in a window."); - RNA_def_struct_sdna(srna, "bScreen"); prop= RNA_def_property(srna, "scene", PROP_POINTER, PROP_NEVER_NULL); - RNA_def_property_flag(prop, PROP_NOT_EDITABLE); - RNA_def_property_struct_type(prop, "Scene"); - RNA_def_property_pointer_funcs(prop, "rna_Screen_scene_get", NULL, NULL); RNA_def_property_ui_text(prop, "Scene", "Active scene to be edited in the screen."); prop= RNA_def_property(srna, "areas", PROP_COLLECTION, PROP_NONE); - RNA_def_property_flag(prop, PROP_NOT_EDITABLE); + RNA_def_property_collection_sdna(prop, NULL, "areabase", NULL); RNA_def_property_struct_type(prop, "Area"); - RNA_def_property_collection_funcs(prop, "rna_Screen_areas_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", 0, 0, 0, 0); - RNA_def_property_ui_text(prop, "Areas", "All Screen Areas"); + RNA_def_property_ui_text(prop, "Areas", "Areas the screen is subdivided into."); } void RNA_def_screen(BlenderRNA *brna) { - RNA_def_bscreen(brna); - RNA_def_scrarea(brna); - RNA_def_panel(brna); - RNA_def_region(brna); + rna_def_bscreen(brna); + rna_def_scrarea(brna); + rna_def_panel(brna); + rna_def_region(brna); } #endif - |