diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2008-11-21 05:23:46 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2008-11-21 05:23:46 +0300 |
commit | 129585285c47a016cf93fb183117eb86ce544461 (patch) | |
tree | 22df9052a2b967f3055a2208476ec365c04168de /source/blender/makesrna/intern/rna_internal_types.h | |
parent | a1b2c0c0fb7adb1758b0503a5422c377f8d0f73e (diff) |
RNA
* More ID property support. What was already possible was showing
ID properties as RNA properties. Now it is possible to define
RNA properties and have an ID property automatically created the
first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
This is useful for python and plugins, and could also be used
for operators, not sure yet what is best there, they could be done
in preprocess for speed, but not sure how to do that while keeping
operator registration a single function.
* Added quick functions to get/set properties based on names, to be
used for operators.
* Added some simple support for inheritance, was already doing this
but having it as a feature simplifies things. Two things were added
for this: when defining a struct you can give a 'from' struct whose
properties will be copied, and structs like ID, operator, modifier,
can define a refine callback that will return the more specific type
of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
list, used for testing RNA for operators.
Diffstat (limited to 'source/blender/makesrna/intern/rna_internal_types.h')
-rw-r--r-- | source/blender/makesrna/intern/rna_internal_types.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/source/blender/makesrna/intern/rna_internal_types.h b/source/blender/makesrna/intern/rna_internal_types.h index 6deaba547e6..3cb4bbea63e 100644 --- a/source/blender/makesrna/intern/rna_internal_types.h +++ b/source/blender/makesrna/intern/rna_internal_types.h @@ -36,7 +36,9 @@ struct bContext; /* Function Callbacks */ -typedef void (*PropNotifyFunc)(struct bContext *C, struct PointerRNA *ptr); +typedef void (*NotifyFunc)(struct bContext *C, struct PointerRNA *ptr); +typedef struct StructRNA *(*StructRefineFunc)(struct PointerRNA *ptr); + typedef int (*PropBooleanGetFunc)(struct PointerRNA *ptr); typedef void (*PropBooleanSetFunc)(struct PointerRNA *ptr, int value); typedef int (*PropBooleanArrayGetFunc)(struct PointerRNA *ptr, int index); @@ -90,7 +92,7 @@ struct PropertyRNA { unsigned int arraylength; /* callback for notifys on change */ - PropNotifyFunc notify; + NotifyFunc notify; }; /* Property Types */ @@ -209,6 +211,15 @@ struct StructRNA { /* property to iterate over properties */ PropertyRNA *iteratorproperty; + /* struct this is derivedfrom */ + struct StructRNA *from; + + /* callback for notifys on change */ + NotifyFunc notify; + + /* function to give the more specific type */ + StructRefineFunc refine; + /* properties of this struct */ ListBase properties; }; |