Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/RNA_access.h
| Show All 33 Lines | |||||
| #include "BLI_compiler_attrs.h" | #include "BLI_compiler_attrs.h" | ||||
| #ifdef __cplusplus | #ifdef __cplusplus | ||||
| extern "C" { | extern "C" { | ||||
| #endif | #endif | ||||
| struct bContext; | struct bContext; | ||||
| struct ID; | struct ID; | ||||
| struct IDOverrideStatic; | |||||
| struct IDOverrideStaticProperty; | |||||
| struct IDOverrideStaticPropertyOperation; | |||||
| struct ListBase; | struct ListBase; | ||||
| struct Main; | struct Main; | ||||
| struct ReportList; | struct ReportList; | ||||
| struct Scene; | struct Scene; | ||||
| /* Types */ | /* Types */ | ||||
| extern BlenderRNA BLENDER_RNA; | extern BlenderRNA BLENDER_RNA; | ||||
| ▲ Show 20 Lines • Show All 987 Lines • ▼ Show 20 Lines | |||||
| char *RNA_path_property_py(struct PointerRNA *ptr, struct PropertyRNA *prop, int index); | char *RNA_path_property_py(struct PointerRNA *ptr, struct PropertyRNA *prop, int index); | ||||
| /* Quick name based property access | /* Quick name based property access | ||||
| * | * | ||||
| * These are just an easier way to access property values without having to | * These are just an easier way to access property values without having to | ||||
| * call RNA_struct_find_property. The names have to exist as RNA properties | * call RNA_struct_find_property. The names have to exist as RNA properties | ||||
| * for the type in the pointer, if they do not exist an error will be printed. | * for the type in the pointer, if they do not exist an error will be printed. | ||||
| * | * | ||||
| * There is no support for pointers and collections here yet, these can be | * There is no support for pointers and collections here yet, these can be | ||||
| * added when ID properties support them. */ | * added when ID properties support them. */ | ||||
| int RNA_boolean_get(PointerRNA *ptr, const char *name); | int RNA_boolean_get(PointerRNA *ptr, const char *name); | ||||
| void RNA_boolean_set(PointerRNA *ptr, const char *name, int value); | void RNA_boolean_set(PointerRNA *ptr, const char *name, int value); | ||||
| void RNA_boolean_get_array(PointerRNA *ptr, const char *name, int *values); | void RNA_boolean_get_array(PointerRNA *ptr, const char *name, int *values); | ||||
| void RNA_boolean_set_array(PointerRNA *ptr, const char *name, const int *values); | void RNA_boolean_set_array(PointerRNA *ptr, const char *name, const int *values); | ||||
| int RNA_int_get(PointerRNA *ptr, const char *name); | int RNA_int_get(PointerRNA *ptr, const char *name); | ||||
| ▲ Show 20 Lines • Show All 175 Lines • ▼ Show 20 Lines | |||||
| #if defined __GNUC__ | #if defined __GNUC__ | ||||
| # define RNA_warning(format, args ...) _RNA_warning("%s: " format "\n", __func__, ##args) | # define RNA_warning(format, args ...) _RNA_warning("%s: " format "\n", __func__, ##args) | ||||
| #else | #else | ||||
| # define RNA_warning(format, ...) _RNA_warning("%s: " format "\n", __FUNCTION__, __VA_ARGS__) | # define RNA_warning(format, ...) _RNA_warning("%s: " format "\n", __FUNCTION__, __VA_ARGS__) | ||||
| #endif | #endif | ||||
| void _RNA_warning(const char *format, ...) ATTR_PRINTF_FORMAT(1, 2); | void _RNA_warning(const char *format, ...) ATTR_PRINTF_FORMAT(1, 2); | ||||
| /* Equals test (skips pointers and collections) | /* Equals test. */ | ||||
| * is_strict false assumes uninitialized properties are equal */ | |||||
| typedef enum eRNAEqualsMode { | /* Note: In practice, EQ_STRICT and EQ_COMPARE have same behavior currently, and will yield same result. */ | ||||
| typedef enum eRNACompareMode { | |||||
| /* Only care about equality, not full comparison. */ | |||||
| RNA_EQ_STRICT, /* set/unset ignored */ | RNA_EQ_STRICT, /* set/unset ignored */ | ||||
| RNA_EQ_UNSET_MATCH_ANY, /* unset property matches anything */ | RNA_EQ_UNSET_MATCH_ANY, /* unset property matches anything */ | ||||
| RNA_EQ_UNSET_MATCH_NONE /* unset property never matches set property */ | RNA_EQ_UNSET_MATCH_NONE, /* unset property never matches set property */ | ||||
| } eRNAEqualsMode; | /* Full comparison. */ | ||||
| RNA_EQ_COMPARE, | |||||
| bool RNA_property_equals(struct PointerRNA *a, struct PointerRNA *b, struct PropertyRNA *prop, eRNAEqualsMode mode); | } eRNACompareMode; | ||||
| bool RNA_struct_equals(struct PointerRNA *a, struct PointerRNA *b, eRNAEqualsMode mode); | |||||
| bool RNA_property_equals(struct PointerRNA *a, struct PointerRNA *b, struct PropertyRNA *prop, eRNACompareMode mode); | |||||
| bool RNA_struct_equals(struct PointerRNA *a, struct PointerRNA *b, eRNACompareMode mode); | |||||
| /* Override. */ | |||||
| bool RNA_struct_override_matches(struct PointerRNA *local, struct PointerRNA *reference, | |||||
| struct IDOverrideStatic *override, const bool ignore_non_overridable, const bool ignore_overridden); | |||||
| bool RNA_struct_override_store( | |||||
| struct PointerRNA *local, struct PointerRNA *reference, PointerRNA *storage, struct IDOverrideStatic *override); | |||||
| void RNA_property_override_apply( | |||||
| struct PointerRNA *dst, struct PointerRNA *src, struct PointerRNA *storage, struct PropertyRNA *prop, | |||||
| struct IDOverrideStaticProperty *op); | |||||
| void RNA_struct_override_apply( | |||||
| struct PointerRNA *dst, struct PointerRNA *src, struct PointerRNA *storage, | |||||
| struct IDOverrideStatic *override); | |||||
| bool RNA_struct_auto_override( | |||||
| struct PointerRNA *local, struct PointerRNA *reference, struct IDOverrideStatic *override, const char *root_path); | |||||
| struct IDOverrideStaticProperty *RNA_property_override_property_find(PointerRNA *ptr, PropertyRNA *prop); | |||||
| struct IDOverrideStaticProperty *RNA_property_override_property_get(PointerRNA *ptr, PropertyRNA *prop, bool *r_created); | |||||
| struct IDOverrideStaticPropertyOperation *RNA_property_override_property_operation_find( | |||||
| PointerRNA *ptr, PropertyRNA *prop, const int index, const bool strict, bool *r_strict); | |||||
| struct IDOverrideStaticPropertyOperation *RNA_property_override_property_operation_get( | |||||
| PointerRNA *ptr, PropertyRNA *prop, const short operation, const int index, | |||||
| const bool strict, bool *r_strict, bool *r_created); | |||||
| void RNA_property_override_status( | |||||
| PointerRNA *ptr, PropertyRNA *prop, const int index, | |||||
| bool *r_overridable, bool *r_overridden, bool *r_mandatory, bool *r_locked); | |||||
| #ifdef __cplusplus | #ifdef __cplusplus | ||||
| } | } | ||||
| #endif | #endif | ||||
| #endif /* __RNA_ACCESS_H__ */ | #endif /* __RNA_ACCESS_H__ */ | ||||