diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-08-05 20:21:37 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-08-05 20:21:37 +0400 |
commit | 85fe36ab611aae8b47089c24110d4d176bc8143c (patch) | |
tree | 0f82edae81ed9d0e8a052895cf0fac335f880afa /source/blender/python/intern/bpy_rna.h | |
parent | db319f8544a908a280a92550fc4c2cc706fc12e2 (diff) |
pyrna - add own callable function type rather then using a standard python method, gives small speedup drawing buttons since every layout.prop/col/operator/menu etc creates and throws away one of these.
Diffstat (limited to 'source/blender/python/intern/bpy_rna.h')
-rw-r--r-- | source/blender/python/intern/bpy_rna.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/python/intern/bpy_rna.h b/source/blender/python/intern/bpy_rna.h index 5db352af53d..3796984ea81 100644 --- a/source/blender/python/intern/bpy_rna.h +++ b/source/blender/python/intern/bpy_rna.h @@ -71,6 +71,7 @@ extern PyTypeObject pyrna_struct_Type; extern PyTypeObject pyrna_prop_Type; extern PyTypeObject pyrna_prop_array_Type; extern PyTypeObject pyrna_prop_collection_Type; +extern PyTypeObject pyrna_func_Type; #define BPy_StructRNA_Check(v) (PyObject_TypeCheck(v, &pyrna_struct_Type)) #define BPy_StructRNA_CheckExact(v) (Py_TYPE(v) == &pyrna_struct_Type) @@ -142,6 +143,15 @@ typedef struct { CollectionPropertyIterator iter; } BPy_PropertyCollectionIterRNA; +typedef struct { + PyObject_HEAD /* required python macro */ +#ifdef USE_WEAKREFS + PyObject *in_weakreflist; +#endif + PointerRNA ptr; + FunctionRNA *func; +} BPy_FunctionRNA; + /* cheap trick */ #define BPy_BaseTypeRNA BPy_PropertyRNA |