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/makesrna/RNA_types.h | |
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/makesrna/RNA_types.h')
-rw-r--r-- | source/blender/makesrna/RNA_types.h | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/source/blender/makesrna/RNA_types.h b/source/blender/makesrna/RNA_types.h index bf4fa97b6fe..243551b527e 100644 --- a/source/blender/makesrna/RNA_types.h +++ b/source/blender/makesrna/RNA_types.h @@ -113,6 +113,7 @@ typedef enum PropertyFlag { PROP_IDPROPERTY = 1024, PROP_RAW_ACCESS = 8192, PROP_RAW_ARRAY = 16384, + PROP_FREE_POINTERS = 32768 } PropertyFlag; typedef struct CollectionPropertyIterator { @@ -198,7 +199,8 @@ typedef enum FunctionFlag { /* internal flags */ FUNC_BUILTIN = 128, FUNC_EXPORT = 256, - FUNC_RUNTIME = 512 + FUNC_RUNTIME = 512, + FUNC_FREE_POINTERS = 1024 } FunctionFlag; typedef void (*CallFunc)(struct bContext *C, struct ReportList *reports, PointerRNA *ptr, ParameterList *parms); @@ -214,7 +216,8 @@ typedef enum StructFlag { /* internal flags */ STRUCT_RUNTIME = 4, - STRUCT_GENERATED = 8 + STRUCT_GENERATED = 8, + STRUCT_FREE_POINTERS = 16 } StructFlag; typedef int (*StructValidateFunc)(struct PointerRNA *ptr, void *data, int *have_function); @@ -232,6 +235,19 @@ typedef struct StructRNA StructRNA; typedef struct BlenderRNA BlenderRNA; +/* Extending + * + * This struct must be embedded in *Type structs in + * order to make then definable through RNA. */ + +typedef struct ExtensionRNA { + void *data; + StructRNA *srna; + + int (*call)(PointerRNA *, FunctionRNA *, ParameterList *); + void (*free)(void *data); +} ExtensionRNA; + #ifdef __cplusplus } #endif |