diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-07-22 00:05:16 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-07-22 00:05:16 +0400 |
commit | 6b8dae0874d774888374992fc3923affb451c45a (patch) | |
tree | 3783cb8c8039971d1ddfaad1a93cc1738be0f5b3 /source/blender/blenkernel | |
parent | b8445173c4c8588a64870e93dd781d181d31c78b (diff) |
RNA
* ID blocks can now get RNA properties defined from python, e.g.:
bpy.types.Scene.BoolProperty(..)
* RNA structs/functions/properties can now get pointers duplicated
(mostly strings), since we can't point to some static string then.
* Added ExtensionRNA struct to add into *Type structs for subclassing,
is a bit more compact than defining the 4 variables each time.
Only disadvantage is it requires including RNA in more places.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_screen.h | 27 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/screen.c | 12 |
2 files changed, 14 insertions, 25 deletions
diff --git a/source/blender/blenkernel/BKE_screen.h b/source/blender/blenkernel/BKE_screen.h index 5a12c04780a..4fcb7c881be 100644 --- a/source/blender/blenkernel/BKE_screen.h +++ b/source/blender/blenkernel/BKE_screen.h @@ -46,10 +46,8 @@ struct wmWindow; struct wmWindowManager; struct uiLayout; struct uiMenuItem; -struct StructRNA; -struct PointerRNA; -struct FunctionRNA; -struct ParameterList; + +#include "RNA_types.h" /* spacetype has everything stored to get an editor working, it gets initialized via ED_spacetypes_init() in editors/area/spacetypes.c */ @@ -169,11 +167,8 @@ typedef struct PanelType { /* draw entirely, view changes should be handled here */ void (*draw)(const struct bContext *, struct Panel *); - /* python integration */ - void *py_data; - struct StructRNA *py_srna; - int (*py_call)(struct PointerRNA *, struct FunctionRNA *, struct ParameterList *); - void (*py_free)(void *py_data); + /* RNA integration */ + ExtensionRNA ext; } PanelType; /* header types */ @@ -187,11 +182,8 @@ typedef struct HeaderType { /* draw entirely, view changes should be handled here */ void (*draw)(const struct bContext *, struct Header *); - /* python integration */ - void *py_data; - struct StructRNA *py_srna; - int (*py_call)(struct PointerRNA *, struct FunctionRNA *, struct ParameterList *); - void (*py_free)(void *py_data); + /* RNA integration */ + ExtensionRNA ext; } HeaderType; typedef struct Header { @@ -214,11 +206,8 @@ typedef struct MenuType { /* draw entirely, view changes should be handled here */ void (*draw)(const struct bContext *, struct Menu *); - /* python integration */ - void *py_data; - struct StructRNA *py_srna; - int (*py_call)(struct PointerRNA *, struct FunctionRNA *, struct ParameterList *); - void (*py_free)(void *py_data); + /* RNA integration */ + ExtensionRNA ext; } MenuType; typedef struct Menu { diff --git a/source/blender/blenkernel/intern/screen.c b/source/blender/blenkernel/intern/screen.c index 4b6eddf60d0..d7aa38d5d03 100644 --- a/source/blender/blenkernel/intern/screen.c +++ b/source/blender/blenkernel/intern/screen.c @@ -61,16 +61,16 @@ static void spacetype_free(SpaceType *st) BLI_freelistN(&art->drawcalls); for(pt= art->paneltypes.first; pt; pt= pt->next) - if(pt->py_free) - pt->py_free(pt->py_data); + if(pt->ext.free) + pt->ext.free(pt->ext.data); for(ht= art->headertypes.first; ht; ht= ht->next) - if(ht->py_free) - ht->py_free(ht->py_data); + if(ht->ext.free) + ht->ext.free(ht->ext.data); for(mt= art->menutypes.first; mt; mt= mt->next) - if(mt->py_free) - mt->py_free(mt->py_data); + if(mt->ext.free) + mt->ext.free(mt->ext.data); BLI_freelistN(&art->paneltypes); BLI_freelistN(&art->headertypes); |