diff options
Diffstat (limited to 'source/blender/makesrna/RNA_access.h')
-rw-r--r-- | source/blender/makesrna/RNA_access.h | 51 |
1 files changed, 34 insertions, 17 deletions
diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index 75d1a328977..6c5562d9bdd 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -875,7 +875,7 @@ bool RNA_property_enum_item_from_value_gettexted( int RNA_property_enum_bitflag_identifiers(struct bContext *C, PointerRNA *ptr, PropertyRNA *prop, const int value, const char **identifier); StructRNA *RNA_property_pointer_type(PointerRNA *ptr, PropertyRNA *prop); -int RNA_property_pointer_poll(PointerRNA *ptr, PropertyRNA *prop, PointerRNA *value); +bool RNA_property_pointer_poll(PointerRNA *ptr, PropertyRNA *prop, PointerRNA *value); bool RNA_property_editable(PointerRNA *ptr, PropertyRNA *prop); bool RNA_property_editable_info(PointerRNA *ptr, PropertyRNA *prop, const char **r_info); @@ -899,15 +899,15 @@ void RNA_property_update_cache_free(void); /* Property Data */ -int RNA_property_boolean_get(PointerRNA *ptr, PropertyRNA *prop); -void RNA_property_boolean_set(PointerRNA *ptr, PropertyRNA *prop, int value); -void RNA_property_boolean_get_array(PointerRNA *ptr, PropertyRNA *prop, int *values); -int RNA_property_boolean_get_index(PointerRNA *ptr, PropertyRNA *prop, int index); -void RNA_property_boolean_set_array(PointerRNA *ptr, PropertyRNA *prop, const int *values); -void RNA_property_boolean_set_index(PointerRNA *ptr, PropertyRNA *prop, int index, int value); -int RNA_property_boolean_get_default(PointerRNA *ptr, PropertyRNA *prop); -void RNA_property_boolean_get_default_array(PointerRNA *ptr, PropertyRNA *prop, int *values); -int RNA_property_boolean_get_default_index(PointerRNA *ptr, PropertyRNA *prop, int index); +bool RNA_property_boolean_get(PointerRNA *ptr, PropertyRNA *prop); +void RNA_property_boolean_set(PointerRNA *ptr, PropertyRNA *prop, bool value); +void RNA_property_boolean_get_array(PointerRNA *ptr, PropertyRNA *prop, bool *values); +bool RNA_property_boolean_get_index(PointerRNA *ptr, PropertyRNA *prop, int index); +void RNA_property_boolean_set_array(PointerRNA *ptr, PropertyRNA *prop, const bool *values); +void RNA_property_boolean_set_index(PointerRNA *ptr, PropertyRNA *prop, int index, bool value); +bool RNA_property_boolean_get_default(PointerRNA *ptr, PropertyRNA *prop); +void RNA_property_boolean_get_default_array(PointerRNA *ptr, PropertyRNA *prop, bool *values); +bool RNA_property_boolean_get_default_index(PointerRNA *ptr, PropertyRNA *prop, int index); int RNA_property_int_get(PointerRNA *ptr, PropertyRNA *prop); void RNA_property_int_set(PointerRNA *ptr, PropertyRNA *prop, int value); @@ -978,7 +978,7 @@ void RNA_property_collection_clear(PointerRNA *ptr, PropertyRNA *prop); bool RNA_property_collection_move(PointerRNA *ptr, PropertyRNA *prop, int key, int pos); /* copy/reset */ -bool RNA_property_copy(PointerRNA *ptr, PointerRNA *fromptr, PropertyRNA *prop, int index); +bool RNA_property_copy(struct Main *bmain, PointerRNA *ptr, PointerRNA *fromptr, PropertyRNA *prop, int index); bool RNA_property_reset(PointerRNA *ptr, PropertyRNA *prop, int index); /* Path @@ -1008,6 +1008,16 @@ bool RNA_path_resolve_property(PointerRNA *ptr, const char *path, bool RNA_path_resolve_property_full(PointerRNA *ptr, const char *path, PointerRNA *r_ptr, PropertyRNA **r_prop, int *r_index); +/* path_resolve_property_and_item_pointer() variants ensure that pointer + property both exist, + * and resolve last Pointer value if possible (Pointer prop or item of a Collection prop). */ +bool RNA_path_resolve_property_and_item_pointer( + PointerRNA *ptr, const char *path, PointerRNA *r_ptr, PropertyRNA **r_prop, + PointerRNA *r_item_ptr); + +bool RNA_path_resolve_property_and_item_pointer_full( + PointerRNA *ptr, const char *path, PointerRNA *r_ptr, PropertyRNA **r_prop, int *r_index, + PointerRNA *r_item_ptr); + typedef struct PropertyElemRNA PropertyElemRNA; struct PropertyElemRNA { PropertyElemRNA *next, *prev; @@ -1041,10 +1051,10 @@ char *RNA_path_property_py(struct PointerRNA *ptr, struct PropertyRNA *prop, int * There is no support for pointers and collections here yet, these can be * added when ID properties support them. */ -int RNA_boolean_get(PointerRNA *ptr, const char *name); -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_set_array(PointerRNA *ptr, const char *name, const int *values); +bool RNA_boolean_get(PointerRNA *ptr, const char *name); +void RNA_boolean_set(PointerRNA *ptr, const char *name, bool value); +void RNA_boolean_get_array(PointerRNA *ptr, const char *name, bool *values); +void RNA_boolean_set_array(PointerRNA *ptr, const char *name, const bool *values); int RNA_int_get(PointerRNA *ptr, const char *name); void RNA_int_set(PointerRNA *ptr, const char *name, int value); @@ -1242,8 +1252,12 @@ typedef enum eRNACompareMode { RNA_EQ_COMPARE, } eRNACompareMode; -bool RNA_property_equals(struct PointerRNA *ptr_a, struct PointerRNA *ptr_b, struct PropertyRNA *prop, eRNACompareMode mode); -bool RNA_struct_equals(struct PointerRNA *ptr_a, struct PointerRNA *ptr_b, eRNACompareMode mode); +bool RNA_property_equals( + struct Main *bmain, + struct PointerRNA *ptr_a, struct PointerRNA *ptr_b, struct PropertyRNA *prop, eRNACompareMode mode); +bool RNA_struct_equals( + struct Main *bmain, + struct PointerRNA *ptr_a, struct PointerRNA *ptr_b, eRNACompareMode mode); /* Override. */ @@ -1275,15 +1289,18 @@ typedef enum eRNAOverrideStatus { } eRNAOverrideStatus; bool RNA_struct_override_matches( + struct Main *bmain, struct PointerRNA *ptr_local, struct PointerRNA *ptr_reference, const char *root_path, struct IDOverrideStatic *override, const eRNAOverrideMatch flags, eRNAOverrideMatchResult *r_report_flags); bool RNA_struct_override_store( + struct Main *bmain, struct PointerRNA *ptr_local, struct PointerRNA *ptr_reference, PointerRNA *ptr_storage, struct IDOverrideStatic *override); void RNA_struct_override_apply( + struct Main *bmain, struct PointerRNA *ptr_local, struct PointerRNA *ptr_override, struct PointerRNA *ptr_storage, struct IDOverrideStatic *override); |