diff options
Diffstat (limited to 'source/blender/makesrna/intern/rna_internal_types.h')
-rw-r--r-- | source/blender/makesrna/intern/rna_internal_types.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_internal_types.h b/source/blender/makesrna/intern/rna_internal_types.h index 345d84fc5b1..6336be25ac3 100644 --- a/source/blender/makesrna/intern/rna_internal_types.h +++ b/source/blender/makesrna/intern/rna_internal_types.h @@ -41,6 +41,8 @@ struct Scene; struct StructRNA; struct bContext; +typedef struct IDProperty IDProperty; + /* store local properties here */ #define RNA_IDP_UI "_RNA_UI" @@ -155,6 +157,43 @@ typedef void (*PropEnumSetFuncEx)(struct PointerRNA *ptr, struct PropertyRNA *pr /* Handling override operations, and also comparison. */ +/** Structure storing all needed data to process all three kinds of RNA properties. */ +typedef struct PropertyRNAOrID { + PointerRNA ptr; + + /** The PropertyRNA passed as parameter, used to generate that structure's content: + * - Static RNA: The RNA property (same as `rnaprop`), never NULL. + * - Runtime RNA: The RNA property (same as `rnaprop`), never NULL. + * - IDProperty: The IDProperty, never NULL. + */ + PropertyRNA *rawprop; + /** The real RNA property of this property, never NULL: + * - Static RNA: The rna property, also gives direct access to the data (from any matching + * PointerRNA). + * - Runtime RNA: The rna property, does not directly gives access to the data. + * - IDProperty: The generic PropertyRNA matching its type. + */ + PropertyRNA *rnaprop; + /** The IDProperty storing the data of this property, may be NULL: + * - Static RNA: Always NULL. + * - Runtime RNA: The IDProperty storing the data of that property, may be NULL if never set yet. + * - IDProperty: The IDProperty, never NULL. + */ + IDProperty *idprop; + /** The name of the property. */ + const char *identifier; + + /** Whether this property is a 'pure' IDProperty or not. */ + bool is_idprop; + /** For runtime RNA properties, whether it is set, defined, or not. + * WARNING: This DOES take into account the `IDP_FLAG_GHOST` flag, i.e. it matches result of + * `RNA_property_is_set`. */ + bool is_set; + + bool is_array; + uint array_len; +} PropertyRNAOrID; + /** * If \a override is NULL, merely do comparison between prop_a from ptr_a and prop_b from ptr_b, * following comparison mode given. |