diff options
Diffstat (limited to 'source/blender/makesrna/intern/rna_internal_types.h')
-rw-r--r-- | source/blender/makesrna/intern/rna_internal_types.h | 56 |
1 files changed, 49 insertions, 7 deletions
diff --git a/source/blender/makesrna/intern/rna_internal_types.h b/source/blender/makesrna/intern/rna_internal_types.h index ccfb83b61e3..1dce89c343d 100644 --- a/source/blender/makesrna/intern/rna_internal_types.h +++ b/source/blender/makesrna/intern/rna_internal_types.h @@ -30,6 +30,8 @@ #include "DNA_listBase.h" +#include "RNA_types.h" + struct BlenderRNA; struct ContainerRNA; struct StructRNA; @@ -64,7 +66,7 @@ typedef void (*ContextPropUpdateFunc)(struct bContext *C, struct PointerRNA *ptr typedef void (*ContextUpdateFunc)(struct bContext *C, struct PointerRNA *ptr); typedef int (*EditableFunc)(struct PointerRNA *ptr); typedef int (*ItemEditableFunc)(struct PointerRNA *ptr, int index); -typedef struct IDProperty* (*IDPropertiesFunc)(struct PointerRNA *ptr, int create); +typedef struct IDProperty *(*IDPropertiesFunc)(struct PointerRNA *ptr, bool create); typedef struct StructRNA *(*StructRefineFunc)(struct PointerRNA *ptr); typedef char *(*StructPathFunc)(struct PointerRNA *ptr); @@ -91,7 +93,7 @@ typedef void (*PropEnumSetFunc)(struct PointerRNA *ptr, int value); typedef EnumPropertyItem *(*PropEnumItemFunc)(struct bContext *C, struct PointerRNA *ptr, struct PropertyRNA *prop, int *free); typedef PointerRNA (*PropPointerGetFunc)(struct PointerRNA *ptr); -typedef StructRNA* (*PropPointerTypeFunc)(struct PointerRNA *ptr); +typedef StructRNA *(*PropPointerTypeFunc)(struct PointerRNA *ptr); typedef void (*PropPointerSetFunc)(struct PointerRNA *ptr, const PointerRNA value); typedef int (*PropPointerPollFunc)(struct PointerRNA *ptr, const PointerRNA value); typedef void (*PropCollectionBeginFunc)(struct CollectionPropertyIterator *iter, struct PointerRNA *ptr); @@ -103,6 +105,27 @@ typedef int (*PropCollectionLookupIntFunc)(struct PointerRNA *ptr, int key, stru typedef int (*PropCollectionLookupStringFunc)(struct PointerRNA *ptr, const char *key, struct PointerRNA *r_ptr); typedef int (*PropCollectionAssignIntFunc)(struct PointerRNA *ptr, int key, const struct PointerRNA *assign_ptr); +/* extended versions with PropertyRNA argument */ +typedef int (*PropBooleanGetFuncEx)(struct PointerRNA *ptr, struct PropertyRNA *prop); +typedef void (*PropBooleanSetFuncEx)(struct PointerRNA *ptr, struct PropertyRNA *prop, int value); +typedef void (*PropBooleanArrayGetFuncEx)(struct PointerRNA *ptr, struct PropertyRNA *prop, int *values); +typedef void (*PropBooleanArraySetFuncEx)(struct PointerRNA *ptr, struct PropertyRNA *prop, const int *values); +typedef int (*PropIntGetFuncEx)(struct PointerRNA *ptr, struct PropertyRNA *prop); +typedef void (*PropIntSetFuncEx)(struct PointerRNA *ptr, struct PropertyRNA *prop, int value); +typedef void (*PropIntArrayGetFuncEx)(struct PointerRNA *ptr, struct PropertyRNA *prop, int *values); +typedef void (*PropIntArraySetFuncEx)(struct PointerRNA *ptr, struct PropertyRNA *prop, const int *values); +typedef void (*PropIntRangeFuncEx)(struct PointerRNA *ptr, struct PropertyRNA *prop, int *min, int *max, int *softmin, int *softmax); +typedef float (*PropFloatGetFuncEx)(struct PointerRNA *ptr, struct PropertyRNA *prop); +typedef void (*PropFloatSetFuncEx)(struct PointerRNA *ptr, struct PropertyRNA *prop, float value); +typedef void (*PropFloatArrayGetFuncEx)(struct PointerRNA *ptr, struct PropertyRNA *prop, float *values); +typedef void (*PropFloatArraySetFuncEx)(struct PointerRNA *ptr, struct PropertyRNA *prop, const float *values); +typedef void (*PropFloatRangeFuncEx)(struct PointerRNA *ptr, struct PropertyRNA *prop, float *min, float *max, float *softmin, float *softmax); +typedef void (*PropStringGetFuncEx)(struct PointerRNA *ptr, struct PropertyRNA *prop, char *value); +typedef int (*PropStringLengthFuncEx)(struct PointerRNA *ptr, struct PropertyRNA *prop); +typedef void (*PropStringSetFuncEx)(struct PointerRNA *ptr, struct PropertyRNA *prop, const char *value); +typedef int (*PropEnumGetFuncEx)(struct PointerRNA *ptr, struct PropertyRNA *prop); +typedef void (*PropEnumSetFuncEx)(struct PointerRNA *ptr, struct PropertyRNA *prop, int value); + /* Container - generic abstracted container of RNA properties */ typedef struct ContainerRNA { void *next, *prev; @@ -193,10 +216,14 @@ typedef struct BoolPropertyRNA { PropBooleanGetFunc get; PropBooleanSetFunc set; - PropBooleanArrayGetFunc getarray; PropBooleanArraySetFunc setarray; + PropBooleanGetFuncEx get_ex; + PropBooleanSetFuncEx set_ex; + PropBooleanArrayGetFuncEx getarray_ex; + PropBooleanArraySetFuncEx setarray_ex; + int defaultvalue; const int *defaultarray; } BoolPropertyRNA; @@ -206,12 +233,16 @@ typedef struct IntPropertyRNA { PropIntGetFunc get; PropIntSetFunc set; - PropIntArrayGetFunc getarray; PropIntArraySetFunc setarray; - PropIntRangeFunc range; + PropIntGetFuncEx get_ex; + PropIntSetFuncEx set_ex; + PropIntArrayGetFuncEx getarray_ex; + PropIntArraySetFuncEx setarray_ex; + PropIntRangeFuncEx range_ex; + int softmin, softmax; int hardmin, hardmax; int step; @@ -225,12 +256,16 @@ typedef struct FloatPropertyRNA { PropFloatGetFunc get; PropFloatSetFunc set; - PropFloatArrayGetFunc getarray; PropFloatArraySetFunc setarray; - PropFloatRangeFunc range; + PropFloatGetFuncEx get_ex; + PropFloatSetFuncEx set_ex; + PropFloatArrayGetFuncEx getarray_ex; + PropFloatArraySetFuncEx setarray_ex; + PropFloatRangeFuncEx range_ex; + float softmin, softmax; float hardmin, hardmax; float step; @@ -247,6 +282,10 @@ typedef struct StringPropertyRNA { PropStringLengthFunc length; PropStringSetFunc set; + PropStringGetFuncEx get_ex; + PropStringLengthFuncEx length_ex; + PropStringSetFuncEx set_ex; + int maxlength; /* includes string terminator! */ const char *defaultvalue; @@ -258,6 +297,9 @@ typedef struct EnumPropertyRNA { PropEnumGetFunc get; PropEnumSetFunc set; PropEnumItemFunc itemf; + + PropEnumGetFuncEx get_ex; + PropEnumSetFuncEx set_ex; void *py_data; /* store py callback here */ EnumPropertyItem *item; |