diff options
author | Lukas Toenne <lukas.toenne@googlemail.com> | 2012-12-20 13:33:12 +0400 |
---|---|---|
committer | Lukas Toenne <lukas.toenne@googlemail.com> | 2012-12-20 13:33:12 +0400 |
commit | 35c2267aee84d086c00574496b52e9c0641e320d (patch) | |
tree | 1cf49651a6a77424563afa9c68ef1c46f7dda5d4 /source/blender/makesrna/RNA_types.h | |
parent | b3dc1d585a5d5f976691c2a6a9fd432b1c6162e0 (diff) |
Support for actual class methods in the RNA/bpy. Previously all functions with FUNC_NO_SELF were treated as static methods, which is not sufficient for getting actual type information if the function can not be generated in advance in makesrna. Now the FUNC_USE_SELF_TYPE flag can be set in addition to FUNC_NO_SELF (if FUNC_NO_SELF is not set, FUNC_USE_SELF_TYPE has no effect). Such functions will be interpreted as class methods and must take a StructRNA pointer argument. This pointer is the same as the type member in PointerRNA, but can be passed without an actual data/id instance.
Diffstat (limited to 'source/blender/makesrna/RNA_types.h')
-rw-r--r-- | source/blender/makesrna/RNA_types.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/makesrna/RNA_types.h b/source/blender/makesrna/RNA_types.h index 87504dc6eb7..dacb2fee212 100644 --- a/source/blender/makesrna/RNA_types.h +++ b/source/blender/makesrna/RNA_types.h @@ -309,9 +309,10 @@ typedef struct ParameterDynAlloc { typedef enum FunctionFlag { FUNC_NO_SELF = 1, /* for static functions */ - FUNC_USE_MAIN = 2, - FUNC_USE_CONTEXT = 4, - FUNC_USE_REPORTS = 8, + FUNC_USE_SELF_TYPE = 2, /* for class methods, only used when FUNC_NO_SELF is set */ + FUNC_USE_MAIN = 4, + FUNC_USE_CONTEXT = 8, + FUNC_USE_REPORTS = 16, FUNC_USE_SELF_ID = 2048, FUNC_ALLOW_WRITE = 4096, |