diff options
Diffstat (limited to 'source/blender/makesrna/intern/rna_screen.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_screen.c | 118 |
1 files changed, 117 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_screen.c b/source/blender/makesrna/intern/rna_screen.c index 043c98d9166..b599a607670 100644 --- a/source/blender/makesrna/intern/rna_screen.c +++ b/source/blender/makesrna/intern/rna_screen.c @@ -34,15 +34,131 @@ #ifdef RNA_RUNTIME + +static void *rna_Screen_scene_get(PointerRNA *ptr) +{ + bScreen *sc= (bScreen*)ptr->data; + return sc->scene; +} + +static void rna_Screen_verts_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) +{ + bScreen *scr= (bScreen*)ptr->data; + rna_iterator_listbase_begin(iter, &scr->vertbase, NULL); +} + +static void rna_Screen_edges_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) +{ + bScreen *scr= (bScreen*)ptr->data; + rna_iterator_listbase_begin(iter, &scr->edgebase, NULL); +} + +static void rna_Screen_areas_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) +{ + bScreen *scr= (bScreen*)ptr->data; + rna_iterator_listbase_begin(iter, &scr->areabase, NULL); +} + #else -void RNA_def_screen(BlenderRNA *brna) +static void RNA_def_vectypes(BlenderRNA *brna) +{ + StructRNA *srna; + + srna= RNA_def_struct(brna, "vec2s", NULL, "vec2s"); + RNA_def_struct_sdna(srna, "vec2s"); +} + +static void RNA_def_scrvert(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + srna= RNA_def_struct(brna, "ScrVert", NULL, "Screen Vertex"); + RNA_def_struct_sdna(srna, "ScrVert"); + + prop= RNA_def_property(srna, "Location", PROP_INT, PROP_VECTOR); + RNA_def_property_int_sdna(prop, NULL, "vec.x"); + RNA_def_property_array(prop, 2); + RNA_def_property_ui_text(prop, "Location", "Screen Vert Location"); + /* + prop= RNA_def_property(srna, "y", PROP_INT, PROP_NONE); + RNA_def_property_int_sdna(prop, NULL, "vec.y"); + RNA_def_property_array(prop, 2); + RNA_def_property_ui_text(prop, "Y Location", "Screen Vert Y-Location");*/ +} + +static void RNA_def_scredge(BlenderRNA *brna) +{ + StructRNA *srna; + + srna= RNA_def_struct(brna, "ScrEdge", NULL, "Screen Edge"); + RNA_def_struct_sdna(srna, "ScrEdge"); +} + +static void RNA_def_scrarea(BlenderRNA *brna) +{ + StructRNA *srna; + + srna= RNA_def_struct(brna, "ScrArea", NULL, "Area"); + RNA_def_struct_sdna(srna, "ScrArea"); +} + +static void RNA_def_panel(BlenderRNA *brna) +{ + StructRNA *srna; + + srna= RNA_def_struct(brna, "Panel", NULL, "Panel"); + RNA_def_struct_sdna(srna, "Panel"); +} + +static void RNA_def_region(BlenderRNA *brna) +{ + StructRNA *srna; + + srna= RNA_def_struct(brna, "Region", NULL, "Area Region"); + RNA_def_struct_sdna(srna, "ARegion"); +} + +static void RNA_def_bscreen(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; srna= RNA_def_struct(brna, "Screen", "ID", "Screen"); RNA_def_struct_sdna(srna, "bScreen"); + + prop= RNA_def_property(srna, "scene", PROP_POINTER, PROP_NONE); + 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."); + + prop= RNA_def_property(srna, "vertbase", PROP_COLLECTION, PROP_NONE); + RNA_def_property_struct_type(prop, "ScrVert"); + RNA_def_property_collection_funcs(prop, "rna_Screen_verts_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", 0, 0, 0, 0); + RNA_def_property_ui_text(prop, "Verts", "All Screen Verts"); + + prop= RNA_def_property(srna, "edgebase", PROP_COLLECTION, PROP_NONE); + RNA_def_property_struct_type(prop, "ScrEdge"); + RNA_def_property_collection_funcs(prop, "rna_Screen_edges_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", 0, 0, 0, 0); + RNA_def_property_ui_text(prop, "Edges", "All Screen Edges"); + + prop= RNA_def_property(srna, "areabase", PROP_COLLECTION, PROP_NONE); + RNA_def_property_struct_type(prop, "ScrArea"); + 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"); +} + +void RNA_def_screen(BlenderRNA *brna) +{ + RNA_def_bscreen(brna); + RNA_def_vectypes(brna); + RNA_def_scrvert(brna); + RNA_def_scredge(brna); + RNA_def_scrarea(brna); + RNA_def_panel(brna); + RNA_def_region(brna); } #endif |