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.
This commit is contained in:
@@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user