Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/makesrna/intern/rna_internal_types.h')
-rw-r--r--source/blender/makesrna/intern/rna_internal_types.h621
1 files changed, 337 insertions, 284 deletions
diff --git a/source/blender/makesrna/intern/rna_internal_types.h b/source/blender/makesrna/intern/rna_internal_types.h
index 11fb7856af2..93409a7d008 100644
--- a/source/blender/makesrna/intern/rna_internal_types.h
+++ b/source/blender/makesrna/intern/rna_internal_types.h
@@ -18,7 +18,6 @@
* \ingroup RNA
*/
-
#ifndef __RNA_INTERNAL_TYPES_H__
#define __RNA_INTERNAL_TYPES_H__
@@ -48,7 +47,9 @@ struct bContext;
/* Function Callbacks */
typedef void (*UpdateFunc)(struct Main *main, struct Scene *scene, struct PointerRNA *ptr);
-typedef void (*ContextPropUpdateFunc)(struct bContext *C, struct PointerRNA *ptr, struct PropertyRNA *prop);
+typedef void (*ContextPropUpdateFunc)(struct bContext *C,
+ struct PointerRNA *ptr,
+ struct PropertyRNA *prop);
typedef void (*ContextUpdateFunc)(struct bContext *C, struct PointerRNA *ptr);
typedef int (*EditableFunc)(struct PointerRNA *ptr, const char **r_info);
typedef int (*ItemEditableFunc)(struct PointerRNA *ptr, int index);
@@ -65,52 +66,88 @@ typedef int (*PropIntGetFunc)(struct PointerRNA *ptr);
typedef void (*PropIntSetFunc)(struct PointerRNA *ptr, int value);
typedef void (*PropIntArrayGetFunc)(struct PointerRNA *ptr, int *values);
typedef void (*PropIntArraySetFunc)(struct PointerRNA *ptr, const int *values);
-typedef void (*PropIntRangeFunc)(struct PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax);
+typedef void (*PropIntRangeFunc)(
+ struct PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax);
typedef float (*PropFloatGetFunc)(struct PointerRNA *ptr);
typedef void (*PropFloatSetFunc)(struct PointerRNA *ptr, float value);
typedef void (*PropFloatArrayGetFunc)(struct PointerRNA *ptr, float *values);
typedef void (*PropFloatArraySetFunc)(struct PointerRNA *ptr, const float *values);
-typedef void (*PropFloatRangeFunc)(struct PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax);
+typedef void (*PropFloatRangeFunc)(
+ struct PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax);
typedef void (*PropStringGetFunc)(struct PointerRNA *ptr, char *value);
typedef int (*PropStringLengthFunc)(struct PointerRNA *ptr);
typedef void (*PropStringSetFunc)(struct PointerRNA *ptr, const char *value);
typedef int (*PropEnumGetFunc)(struct PointerRNA *ptr);
typedef void (*PropEnumSetFunc)(struct PointerRNA *ptr, int value);
-typedef const EnumPropertyItem *(*PropEnumItemFunc)(
- struct bContext *C, struct PointerRNA *ptr,
- struct PropertyRNA *prop, bool *r_free);
+typedef const EnumPropertyItem *(*PropEnumItemFunc)(struct bContext *C,
+ struct PointerRNA *ptr,
+ struct PropertyRNA *prop,
+ bool *r_free);
typedef PointerRNA (*PropPointerGetFunc)(struct PointerRNA *ptr);
typedef StructRNA *(*PropPointerTypeFunc)(struct PointerRNA *ptr);
typedef void (*PropPointerSetFunc)(struct PointerRNA *ptr, const PointerRNA value);
typedef bool (*PropPointerPollFunc)(struct PointerRNA *ptr, const PointerRNA value);
-typedef bool (*PropPointerPollFuncPy)(struct PointerRNA *ptr, const PointerRNA value, const PropertyRNA *prop);
-typedef void (*PropCollectionBeginFunc)(struct CollectionPropertyIterator *iter, struct PointerRNA *ptr);
+typedef bool (*PropPointerPollFuncPy)(struct PointerRNA *ptr,
+ const PointerRNA value,
+ const PropertyRNA *prop);
+typedef void (*PropCollectionBeginFunc)(struct CollectionPropertyIterator *iter,
+ struct PointerRNA *ptr);
typedef void (*PropCollectionNextFunc)(struct CollectionPropertyIterator *iter);
typedef void (*PropCollectionEndFunc)(struct CollectionPropertyIterator *iter);
typedef PointerRNA (*PropCollectionGetFunc)(struct CollectionPropertyIterator *iter);
typedef int (*PropCollectionLengthFunc)(struct PointerRNA *ptr);
-typedef int (*PropCollectionLookupIntFunc)(struct PointerRNA *ptr, int key, struct PointerRNA *r_ptr);
-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);
+typedef int (*PropCollectionLookupIntFunc)(struct PointerRNA *ptr,
+ int key,
+ struct PointerRNA *r_ptr);
+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 bool (*PropBooleanGetFuncEx)(struct PointerRNA *ptr, struct PropertyRNA *prop);
typedef void (*PropBooleanSetFuncEx)(struct PointerRNA *ptr, struct PropertyRNA *prop, bool value);
-typedef void (*PropBooleanArrayGetFuncEx)(struct PointerRNA *ptr, struct PropertyRNA *prop, bool *values);
-typedef void (*PropBooleanArraySetFuncEx)(struct PointerRNA *ptr, struct PropertyRNA *prop, const bool *values);
+typedef void (*PropBooleanArrayGetFuncEx)(struct PointerRNA *ptr,
+ struct PropertyRNA *prop,
+ bool *values);
+typedef void (*PropBooleanArraySetFuncEx)(struct PointerRNA *ptr,
+ struct PropertyRNA *prop,
+ const bool *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 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 (*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 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);
@@ -126,14 +163,18 @@ typedef void (*PropEnumSetFuncEx)(struct PointerRNA *ptr, struct PropertyRNA *pr
* \note In non-array cases, \a len values are 0.
* \note \a override, \a rna_path and \a r_override_changed may be NULL pointers.
*/
-typedef int (*RNAPropOverrideDiff)(
- struct Main *bmain,
- struct PointerRNA *ptr_a, struct PointerRNA *ptr_b,
- struct PropertyRNA *prop_a, struct PropertyRNA *prop_b,
- const int len_a, const int len_b,
- const int mode,
- struct IDOverrideStatic *override, const char *rna_path,
- const int flags, bool *r_override_changed);
+typedef int (*RNAPropOverrideDiff)(struct Main *bmain,
+ struct PointerRNA *ptr_a,
+ struct PointerRNA *ptr_b,
+ struct PropertyRNA *prop_a,
+ struct PropertyRNA *prop_b,
+ const int len_a,
+ const int len_b,
+ const int mode,
+ struct IDOverrideStatic *override,
+ const char *rna_path,
+ const int flags,
+ bool *r_override_changed);
/**
* Only used for differential override (add, sub, etc.).
@@ -144,12 +185,17 @@ typedef int (*RNAPropOverrideDiff)(
* \note Might change given override operation (e.g. change 'add' one into 'sub'), in case computed storage value
* is out of range (or even change it to basic 'set' operation if nothing else works).
*/
-typedef bool (*RNAPropOverrideStore)(
- struct Main *bmain,
- struct PointerRNA *ptr_local, struct PointerRNA *ptr_reference, struct PointerRNA *ptr_storage,
- struct PropertyRNA *prop_local, struct PropertyRNA *prop_reference, struct PropertyRNA *prop_storage,
- const int len_local, const int len_reference, const int len_storage,
- struct IDOverrideStaticPropertyOperation *opop);
+typedef bool (*RNAPropOverrideStore)(struct Main *bmain,
+ struct PointerRNA *ptr_local,
+ struct PointerRNA *ptr_reference,
+ struct PointerRNA *ptr_storage,
+ struct PropertyRNA *prop_local,
+ struct PropertyRNA *prop_reference,
+ struct PropertyRNA *prop_storage,
+ const int len_local,
+ const int len_reference,
+ const int len_storage,
+ struct IDOverrideStaticPropertyOperation *opop);
/**
* Apply given override operation from src to dst (using value from storage as second operand
@@ -158,306 +204,313 @@ typedef bool (*RNAPropOverrideStore)(
* \note Given PropertyRNA are final (in case of IDProps...).
* \note In non-array cases, \a len values are 0.
*/
-typedef bool (*RNAPropOverrideApply)(
- struct Main *bmain,
- struct PointerRNA *ptr_dst, struct PointerRNA *ptr_src, struct PointerRNA *ptr_storage,
- struct PropertyRNA *prop_dst, struct PropertyRNA *prop_src, struct PropertyRNA *prop_storage,
- const int len_dst, const int len_src, const int len_storage,
- struct PointerRNA *ptr_item_dst, struct PointerRNA *ptr_item_src, struct PointerRNA *ptr_item_storage,
- struct IDOverrideStaticPropertyOperation *opop);
+typedef bool (*RNAPropOverrideApply)(struct Main *bmain,
+ struct PointerRNA *ptr_dst,
+ struct PointerRNA *ptr_src,
+ struct PointerRNA *ptr_storage,
+ struct PropertyRNA *prop_dst,
+ struct PropertyRNA *prop_src,
+ struct PropertyRNA *prop_storage,
+ const int len_dst,
+ const int len_src,
+ const int len_storage,
+ struct PointerRNA *ptr_item_dst,
+ struct PointerRNA *ptr_item_src,
+ struct PointerRNA *ptr_item_storage,
+ struct IDOverrideStaticPropertyOperation *opop);
/* Container - generic abstracted container of RNA properties */
typedef struct ContainerRNA {
- void *next, *prev;
+ void *next, *prev;
- struct GHash *prophash;
- ListBase properties;
+ struct GHash *prophash;
+ ListBase properties;
} ContainerRNA;
struct FunctionRNA {
- /* structs are containers of properties */
- ContainerRNA cont;
+ /* structs are containers of properties */
+ ContainerRNA cont;
- /* unique identifier, keep after 'cont' */
- const char *identifier;
- /* various options */
- int flag;
+ /* unique identifier, keep after 'cont' */
+ const char *identifier;
+ /* various options */
+ int flag;
- /* single line description, displayed in the tooltip for example */
- const char *description;
+ /* single line description, displayed in the tooltip for example */
+ const char *description;
- /* callback to execute the function */
- CallFunc call;
+ /* callback to execute the function */
+ CallFunc call;
- /* parameter for the return value
- * note: this is only the C return value, rna functions can have multiple return values */
- PropertyRNA *c_ret;
+ /* parameter for the return value
+ * note: this is only the C return value, rna functions can have multiple return values */
+ PropertyRNA *c_ret;
};
struct PropertyRNA {
- struct PropertyRNA *next, *prev;
-
- /* magic bytes to distinguish with IDProperty */
- int magic;
-
- /* unique identifier */
- const char *identifier;
- /* various options */
- int flag;
- /* various override options */
- int flag_override;
- /* Function parameters flags. */
- short flag_parameter;
- /* Internal ("private") flags. */
- short flag_internal;
- /* The subset of StructRNA.prop_tag_defines values that applies to this property. */
- short tags;
-
- /* user readable name */
- const char *name;
- /* single line description, displayed in the tooltip for example */
- const char *description;
- /* icon ID */
- int icon;
- /* context for translation */
- const char *translation_context;
-
- /* property type as it appears to the outside */
- PropertyType type;
- /* subtype, 'interpretation' of the property */
- PropertySubType subtype;
- /* if non-NULL, overrides arraylength. Must not return 0? */
- PropArrayLengthGetFunc getlength;
- /* dimension of array */
- unsigned int arraydimension;
- /* array lengths lengths for all dimensions (when arraydimension > 0) */
- unsigned int arraylength[RNA_MAX_ARRAY_DIMENSION];
- unsigned int totarraylength;
-
- /* callback for updates on change */
- UpdateFunc update;
- int noteflag;
-
- /* Callback for testing if editable. Its r_info parameter can be used to
- * return info on editable state that might be shown to user. E.g. tooltips
- * of disabled buttons can show reason why button is disabled using this. */
- EditableFunc editable;
- /* callback for testing if array-item editable (if applicable) */
- ItemEditableFunc itemeditable;
-
- /* Override handling callbacks (diff is also used for comparison). */
- RNAPropOverrideDiff override_diff;
- RNAPropOverrideStore override_store;
- RNAPropOverrideApply override_apply;
-
- /* raw access */
- int rawoffset;
- RawPropertyType rawtype;
-
- /* This is used for accessing props/functions of this property
- * any property can have this but should only be used for collections and arrays
- * since python will convert int/bool/pointer's */
- struct StructRNA *srna; /* attributes attached directly to this collection */
-
- /* python handle to hold all callbacks
- * (in a pointer array at the moment, may later be a tuple) */
- void *py_data;
+ struct PropertyRNA *next, *prev;
+
+ /* magic bytes to distinguish with IDProperty */
+ int magic;
+
+ /* unique identifier */
+ const char *identifier;
+ /* various options */
+ int flag;
+ /* various override options */
+ int flag_override;
+ /* Function parameters flags. */
+ short flag_parameter;
+ /* Internal ("private") flags. */
+ short flag_internal;
+ /* The subset of StructRNA.prop_tag_defines values that applies to this property. */
+ short tags;
+
+ /* user readable name */
+ const char *name;
+ /* single line description, displayed in the tooltip for example */
+ const char *description;
+ /* icon ID */
+ int icon;
+ /* context for translation */
+ const char *translation_context;
+
+ /* property type as it appears to the outside */
+ PropertyType type;
+ /* subtype, 'interpretation' of the property */
+ PropertySubType subtype;
+ /* if non-NULL, overrides arraylength. Must not return 0? */
+ PropArrayLengthGetFunc getlength;
+ /* dimension of array */
+ unsigned int arraydimension;
+ /* array lengths lengths for all dimensions (when arraydimension > 0) */
+ unsigned int arraylength[RNA_MAX_ARRAY_DIMENSION];
+ unsigned int totarraylength;
+
+ /* callback for updates on change */
+ UpdateFunc update;
+ int noteflag;
+
+ /* Callback for testing if editable. Its r_info parameter can be used to
+ * return info on editable state that might be shown to user. E.g. tooltips
+ * of disabled buttons can show reason why button is disabled using this. */
+ EditableFunc editable;
+ /* callback for testing if array-item editable (if applicable) */
+ ItemEditableFunc itemeditable;
+
+ /* Override handling callbacks (diff is also used for comparison). */
+ RNAPropOverrideDiff override_diff;
+ RNAPropOverrideStore override_store;
+ RNAPropOverrideApply override_apply;
+
+ /* raw access */
+ int rawoffset;
+ RawPropertyType rawtype;
+
+ /* This is used for accessing props/functions of this property
+ * any property can have this but should only be used for collections and arrays
+ * since python will convert int/bool/pointer's */
+ struct StructRNA *srna; /* attributes attached directly to this collection */
+
+ /* python handle to hold all callbacks
+ * (in a pointer array at the moment, may later be a tuple) */
+ void *py_data;
};
/* internal flags WARNING! 16bits only! */
typedef enum PropertyFlagIntern {
- PROP_INTERN_BUILTIN = (1 << 0),
- PROP_INTERN_RUNTIME = (1 << 1),
- PROP_INTERN_RAW_ACCESS = (1 << 2),
- PROP_INTERN_RAW_ARRAY = (1 << 3),
- PROP_INTERN_FREE_POINTERS = (1 << 4),
+ PROP_INTERN_BUILTIN = (1 << 0),
+ PROP_INTERN_RUNTIME = (1 << 1),
+ PROP_INTERN_RAW_ACCESS = (1 << 2),
+ PROP_INTERN_RAW_ARRAY = (1 << 3),
+ PROP_INTERN_FREE_POINTERS = (1 << 4),
} PropertyFlagIntern;
/* Property Types */
typedef struct BoolPropertyRNA {
- PropertyRNA property;
+ PropertyRNA property;
- PropBooleanGetFunc get;
- PropBooleanSetFunc set;
- PropBooleanArrayGetFunc getarray;
- PropBooleanArraySetFunc setarray;
+ PropBooleanGetFunc get;
+ PropBooleanSetFunc set;
+ PropBooleanArrayGetFunc getarray;
+ PropBooleanArraySetFunc setarray;
- PropBooleanGetFuncEx get_ex;
- PropBooleanSetFuncEx set_ex;
- PropBooleanArrayGetFuncEx getarray_ex;
- PropBooleanArraySetFuncEx setarray_ex;
+ PropBooleanGetFuncEx get_ex;
+ PropBooleanSetFuncEx set_ex;
+ PropBooleanArrayGetFuncEx getarray_ex;
+ PropBooleanArraySetFuncEx setarray_ex;
- bool defaultvalue;
- const bool *defaultarray;
+ bool defaultvalue;
+ const bool *defaultarray;
} BoolPropertyRNA;
typedef struct IntPropertyRNA {
- PropertyRNA property;
-
- 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;
-
- int defaultvalue;
- const int *defaultarray;
+ PropertyRNA property;
+
+ 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;
+
+ int defaultvalue;
+ const int *defaultarray;
} IntPropertyRNA;
typedef struct FloatPropertyRNA {
- PropertyRNA property;
-
- 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;
- int precision;
-
- float defaultvalue;
- const float *defaultarray;
+ PropertyRNA property;
+
+ 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;
+ int precision;
+
+ float defaultvalue;
+ const float *defaultarray;
} FloatPropertyRNA;
typedef struct StringPropertyRNA {
- PropertyRNA property;
+ PropertyRNA property;
- PropStringGetFunc get;
- PropStringLengthFunc length;
- PropStringSetFunc set;
+ PropStringGetFunc get;
+ PropStringLengthFunc length;
+ PropStringSetFunc set;
- PropStringGetFuncEx get_ex;
- PropStringLengthFuncEx length_ex;
- PropStringSetFuncEx set_ex;
+ PropStringGetFuncEx get_ex;
+ PropStringLengthFuncEx length_ex;
+ PropStringSetFuncEx set_ex;
- int maxlength; /* includes string terminator! */
+ int maxlength; /* includes string terminator! */
- const char *defaultvalue;
+ const char *defaultvalue;
} StringPropertyRNA;
typedef struct EnumPropertyRNA {
- PropertyRNA property;
+ PropertyRNA property;
- PropEnumGetFunc get;
- PropEnumSetFunc set;
- PropEnumItemFunc itemf;
+ PropEnumGetFunc get;
+ PropEnumSetFunc set;
+ PropEnumItemFunc itemf;
- PropEnumGetFuncEx get_ex;
- PropEnumSetFuncEx set_ex;
- void *py_data; /* store py callback here */
+ PropEnumGetFuncEx get_ex;
+ PropEnumSetFuncEx set_ex;
+ void *py_data; /* store py callback here */
- const EnumPropertyItem *item;
- int totitem;
+ const EnumPropertyItem *item;
+ int totitem;
- int defaultvalue;
+ int defaultvalue;
} EnumPropertyRNA;
typedef struct PointerPropertyRNA {
- PropertyRNA property;
+ PropertyRNA property;
- PropPointerGetFunc get;
- PropPointerSetFunc set;
- PropPointerTypeFunc typef;
- PropPointerPollFunc poll; /* unlike operators, 'set' can still run if poll fails, used for filtering display */
+ PropPointerGetFunc get;
+ PropPointerSetFunc set;
+ PropPointerTypeFunc typef;
+ PropPointerPollFunc
+ poll; /* unlike operators, 'set' can still run if poll fails, used for filtering display */
- struct StructRNA *type;
+ struct StructRNA *type;
} PointerPropertyRNA;
typedef struct CollectionPropertyRNA {
- PropertyRNA property;
-
- PropCollectionBeginFunc begin;
- PropCollectionNextFunc next;
- PropCollectionEndFunc end; /* optional */
- PropCollectionGetFunc get;
- PropCollectionLengthFunc length; /* optional */
- PropCollectionLookupIntFunc lookupint; /* optional */
- PropCollectionLookupStringFunc lookupstring; /* optional */
- PropCollectionAssignIntFunc assignint; /* optional */
-
- struct StructRNA *item_type; /* the type of this item */
+ PropertyRNA property;
+
+ PropCollectionBeginFunc begin;
+ PropCollectionNextFunc next;
+ PropCollectionEndFunc end; /* optional */
+ PropCollectionGetFunc get;
+ PropCollectionLengthFunc length; /* optional */
+ PropCollectionLookupIntFunc lookupint; /* optional */
+ PropCollectionLookupStringFunc lookupstring; /* optional */
+ PropCollectionAssignIntFunc assignint; /* optional */
+
+ struct StructRNA *item_type; /* the type of this item */
} CollectionPropertyRNA;
-
/* changes to this struct require updating rna_generate_struct in makesrna.c */
struct StructRNA {
- /* structs are containers of properties */
- ContainerRNA cont;
-
- /* unique identifier, keep after 'cont' */
- const char *identifier;
-
- /* python type, this is a subtype of pyrna_struct_Type but used so each struct can have its own type
- * which is useful for subclassing RNA */
- void *py_type;
- void *blender_type;
-
- /* various options */
- int flag;
- /* Each StructRNA type can define own tags which properties can set
- * (PropertyRNA.tags) for changed behavior based on struct-type. */
- const EnumPropertyItem *prop_tag_defines;
-
- /* user readable name */
- const char *name;
- /* single line description, displayed in the tooltip for example */
- const char *description;
- /* context for translation */
- const char *translation_context;
- /* icon ID */
- int icon;
-
- /* property that defines the name */
- PropertyRNA *nameproperty;
-
- /* property to iterate over properties */
- PropertyRNA *iteratorproperty;
-
- /* struct this is derivedfrom */
- struct StructRNA *base;
-
- /* only use for nested structs, where both the parent and child access
- * the same C Struct but nesting is used for grouping properties.
- * The parent property is used so we know NULL checks are not needed,
- * and that this struct will never exist without its parent */
- struct StructRNA *nested;
-
- /* function to give the more specific type */
- StructRefineFunc refine;
-
- /* function to find path to this struct in an ID */
- StructPathFunc path;
-
- /* function to register/unregister subclasses */
- StructRegisterFunc reg;
- StructUnregisterFunc unreg;
- StructInstanceFunc instance;
-
- /* callback to get id properties */
- IDPropertiesFunc idproperties;
-
- /* functions of this struct */
- ListBase functions;
+ /* structs are containers of properties */
+ ContainerRNA cont;
+
+ /* unique identifier, keep after 'cont' */
+ const char *identifier;
+
+ /* python type, this is a subtype of pyrna_struct_Type but used so each struct can have its own type
+ * which is useful for subclassing RNA */
+ void *py_type;
+ void *blender_type;
+
+ /* various options */
+ int flag;
+ /* Each StructRNA type can define own tags which properties can set
+ * (PropertyRNA.tags) for changed behavior based on struct-type. */
+ const EnumPropertyItem *prop_tag_defines;
+
+ /* user readable name */
+ const char *name;
+ /* single line description, displayed in the tooltip for example */
+ const char *description;
+ /* context for translation */
+ const char *translation_context;
+ /* icon ID */
+ int icon;
+
+ /* property that defines the name */
+ PropertyRNA *nameproperty;
+
+ /* property to iterate over properties */
+ PropertyRNA *iteratorproperty;
+
+ /* struct this is derivedfrom */
+ struct StructRNA *base;
+
+ /* only use for nested structs, where both the parent and child access
+ * the same C Struct but nesting is used for grouping properties.
+ * The parent property is used so we know NULL checks are not needed,
+ * and that this struct will never exist without its parent */
+ struct StructRNA *nested;
+
+ /* function to give the more specific type */
+ StructRefineFunc refine;
+
+ /* function to find path to this struct in an ID */
+ StructPathFunc path;
+
+ /* function to register/unregister subclasses */
+ StructRegisterFunc reg;
+ StructUnregisterFunc unreg;
+ StructInstanceFunc instance;
+
+ /* callback to get id properties */
+ IDPropertiesFunc idproperties;
+
+ /* functions of this struct */
+ ListBase functions;
};
/* Blender RNA
@@ -465,14 +518,14 @@ struct StructRNA {
* Root RNA data structure that lists all struct types. */
struct BlenderRNA {
- ListBase structs;
- /* A map of structs: {StructRNA.identifier -> StructRNA}
- * These are ensured to have unique names (with STRUCT_PUBLIC_NAMESPACE enabled). */
- struct GHash *structs_map;
- /* Needed because types with an empty identifier aren't included in 'structs_map'. */
- unsigned int structs_len;
+ ListBase structs;
+ /* A map of structs: {StructRNA.identifier -> StructRNA}
+ * These are ensured to have unique names (with STRUCT_PUBLIC_NAMESPACE enabled). */
+ struct GHash *structs_map;
+ /* Needed because types with an empty identifier aren't included in 'structs_map'. */
+ unsigned int structs_len;
};
-#define CONTAINER_RNA_ID(cont) (*(const char **)(((ContainerRNA *)(cont))+1))
+#define CONTAINER_RNA_ID(cont) (*(const char **)(((ContainerRNA *)(cont)) + 1))
#endif /* __RNA_INTERNAL_TYPES_H__ */