diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-04-07 04:49:39 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-04-07 04:49:39 +0400 |
commit | 767db1b71674efb599f03b5892c32d207647acd3 (patch) | |
tree | fc64129bea43fe563bc0ad1448e17405e1b04bb0 /source/blender/makesrna/RNA_types.h | |
parent | 88ab62c03189a04f6a74b040ad269e5a901c4af1 (diff) |
RNA: Commit of the API patch by vekoon. This adds Functions to RNA,
which can be defined to call C functions with defined parameters.
* Parameters are RNA properties, with the same types.
* Parameters are stored in a ParameterList, which is like a small
stack with the values. This is then used to call the C function.
* Includes Python integration.
* Only one test function is part of this commit, ID.rename.
* Integration with the editors/ module is not included in this
commit, there's some issues to be worked out for that still.
Diffstat (limited to 'source/blender/makesrna/RNA_types.h')
-rw-r--r-- | source/blender/makesrna/RNA_types.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/source/blender/makesrna/RNA_types.h b/source/blender/makesrna/RNA_types.h index c3dcf4040ea..4ea97041f83 100644 --- a/source/blender/makesrna/RNA_types.h +++ b/source/blender/makesrna/RNA_types.h @@ -29,6 +29,8 @@ extern "C" { #endif +struct ParameterList; +struct FunctionRNA; struct PropertyRNA; struct StructRNA; struct BlenderRNA; @@ -123,6 +125,35 @@ typedef struct EnumPropertyItem { typedef struct PropertyRNA PropertyRNA; +/* Parameter List */ + +typedef struct ParameterList ParameterList; + +typedef struct ParameterIterator { + ParameterList *parms; + PointerRNA funcptr; + void *data; + int size, offset; + + PropertyRNA *parm; + int valid; +} ParameterIterator; + +/* Function */ + +typedef enum FunctionFlag { + FUNC_TYPESTATIC = 1, /* for static functions, FUNC_ STATIC is taken by some windows header it seems */ + + /* internal flags */ + FUNC_BUILTIN = 128, + FUNC_EXPORT = 256, + FUNC_RUNTIME = 512 +} FunctionFlag; + +typedef void (*CallFunc)(PointerRNA *ptr, ParameterList *parms); + +typedef struct FunctionRNA FunctionRNA; + /* Struct */ typedef enum StructFlag { |