|
Kanzi Graphics Engine
|
Value variant. More...
#include <user/properties/kzu_property_common.h>#include <user/properties/kzu_property_manager.h>#include <user/properties/kzu_property.h>#include <core/util/math/kzc_vector2.h>#include <core/util/math/kzc_vector3.h>#include <core/util/math/kzc_vector4.h>#include <core/util/math/kzc_matrix2x2.h>#include <core/util/math/kzc_matrix3x3.h>#include <core/util/math/kzc_matrix4x4.h>#include <core/util/color/kzc_color.h>#include <core/util/string/kzc_string.h>#include <system/kzs_types.h>#include <system/debug/kzs_error.h>#include <system/kzs_header.h>Functions | |
| kzsError | kzuVariantCreate (const struct KzcMemoryManager *memoryManager, struct KzuVariant **out_variant) |
| Creates an empty variant object. More... | |
| kzsError | kzuVariantDelete (struct KzuVariant *variant) |
| Deletes a variant object. More... | |
| kzsError | kzuVariantSetEmpty (struct KzuVariant *variant) |
| Set a variant to be empty. More... | |
| kzBool | kzuVariantIsEmpty (const struct KzuVariant *variant) |
| Checks if a variant is empty. More... | |
| enum KzuPropertyDataType | kzuVariantGetType (const struct KzuVariant *variant) |
| Get the type of the value stored in a variant. More... | |
| kzsError | kzuVariantSetFloat (struct KzuVariant *variant, kzFloat value) |
| Initialize a variant with a kzFloat value. More... | |
| kzsError | kzuVariantSetFloatWithField (struct KzuVariant *variant, enum KzuPropertyField field, kzFloat value) |
| Set a float field of a variant. More... | |
| kzFloat | kzuVariantGetFloat (const struct KzuVariant *variant) |
| Get the kzFloat value stored in a variant. More... | |
| kzFloat | kzuVariantGetFloatWithField (const struct KzuVariant *variant, enum KzuPropertyField field) |
| Get the kzFloat value stored in a variant, also use field. More... | |
| kzsError | kzuVariantSetInt (struct KzuVariant *variant, kzInt value) |
| Initialize a variant with a kzInt value. More... | |
| kzInt | kzuVariantGetInt (const struct KzuVariant *variant) |
| Get the kzInt value stored in a variant. More... | |
| kzsError | kzuVariantSetBool (struct KzuVariant *variant, kzBool value) |
| Initialize a variant with a kzBool value. More... | |
| kzBool | kzuVariantGetBool (const struct KzuVariant *variant) |
| Get the kzBool value stored in a variant. More... | |
| kzsError | kzuVariantSetColor (struct KzuVariant *variant, struct KzcColorRGBA value) |
| Initialize a variant with a KzcColorRGBA value. More... | |
| struct KzcColorRGBA | kzuVariantGetColor (const struct KzuVariant *variant) |
| Get the KzcColorRGBA value stored in a variant. More... | |
| kzsError | kzuVariantSetVector2 (struct KzuVariant *variant, struct KzcVector2 value) |
| Initialize a variant with a KzcVector2 value. More... | |
| struct KzcVector2 | kzuVariantGetVector2 (const struct KzuVariant *variant) |
| Get the KzcVector2 value stored in a variant. More... | |
| kzsError | kzuVariantSetVector3 (struct KzuVariant *variant, struct KzcVector3 value) |
| Initialize a variant with a KzcVector3 value. More... | |
| struct KzcVector3 | kzuVariantGetVector3 (const struct KzuVariant *variant) |
| Get the KzcVector3 value stored in a variant. More... | |
| kzsError | kzuVariantSetVector4 (struct KzuVariant *variant, struct KzcVector4 value) |
| Initialize a variant with a KzcVector4 value. More... | |
| struct KzcVector4 | kzuVariantGetVector4 (const struct KzuVariant *variant) |
| Get the KzcVector4 value stored in a variant. More... | |
| kzsError | kzuVariantSetMatrix2x2 (struct KzuVariant *variant, struct KzcMatrix2x2 value) |
| Initialize a variant with a KzcMatrix2x2 value. More... | |
| struct KzcMatrix2x2 | kzuVariantGetMatrix2x2 (const struct KzuVariant *variant) |
| Get the KzcMatrix2x2 value stored in a variant. More... | |
| kzsError | kzuVariantSetMatrix3x3 (struct KzuVariant *variant, struct KzcMatrix3x3 value) |
| Initialize a variant with a KzcMatrix3x3 value. More... | |
| kzsError | kzuVariantSetMatrix3x3SRT (struct KzuVariant *variant, const struct KzcVector2 *scale, kzFloat rotation, const struct KzcVector2 *translation) |
| Initialize a variant with KzcMatrix3x3 SRT values. More... | |
| struct KzcMatrix3x3 | kzuVariantGetMatrix3x3 (const struct KzuVariant *variant) |
| Get the KzcMatrix3x3 value stored in a variant. More... | |
| void | kzuVariantGetMatrix3x3SRT (const struct KzuVariant *variant, struct KzcVector2 *out_scale, kzFloat *out_rotation, struct KzcVector2 *out_translation) |
| Get the KzcMatrix3x3 SRT values stored in a variant. More... | |
| kzsError | kzuVariantSetMatrix4x4 (struct KzuVariant *variant, struct KzcMatrix4x4 value) |
| Initialize a variant with a KzcMatrix4x4 value. More... | |
| kzsError | kzuVariantSetMatrix4x4SRT (struct KzuVariant *variant, const struct KzcVector3 *scale, const struct KzcVector3 *rotation, const struct KzcVector3 *translation) |
| Initialize a variant with KzcMatrix4x4 SRT values. More... | |
| struct KzcMatrix4x4 | kzuVariantGetMatrix4x4 (const struct KzuVariant *variant) |
| Get the KzcMatrix4x4 value stored in a variant. More... | |
| void | kzuVariantGetMatrix4x4SRT (const struct KzuVariant *variant, struct KzcVector3 *out_scale, struct KzcVector3 *out_rotation, struct KzcVector3 *out_translation) |
| Get the KzcMatrix4x4 SRT values stored in a variant. More... | |
| kzsError | kzuVariantSetString (struct KzuVariant *variant, kzString value) |
| Initialize a variant with a kzString value. More... | |
| kzsError | kzuVariantSetStringWithoutCopy (struct KzuVariant *variant, kzMutableString value) |
| Initialize a variant with a kzString value without copying the value. More... | |
| kzString | kzuVariantGetString (const struct KzuVariant *variant) |
| Get the kzString value stored in a variant. More... | |
| kzsError | kzuVariantSetPointer (struct KzuVariant *variant, void *value) |
| Initialize a variant with a pointer value. More... | |
| kzsError | kzuVariantSetPointerResource (struct KzuVariant *variant, struct KzuResource *resource) |
| Initialize a variant with a resource value. More... | |
| kzsError | kzuVariantSetPointerRelativePath (struct KzuVariant *variant, kzString path) |
| Initialize a variant with a relative path. More... | |
| void * | kzuVariantGetPointer (const struct KzuVariant *variant) |
| Get the pointer value stored in a variant. More... | |
| kzsError | kzuVariantSetResourceID (struct KzuVariant *variant, kzString value) |
| Initialize a variant with a resourceID value. More... | |
| kzString | kzuVariantGetResourceID (const struct KzuVariant *variant) |
| Get the pointer value stored in a variant. More... | |
| kzBool | kzuVariantIsEqual (const struct KzuVariant *variantA, const struct KzuVariant *variantB) |
| Check if variants are equal. More... | |
| kzsError | kzuVariantCopy (struct KzuVariant *targetVariant, const struct KzuVariant *sourceVariant) |
| Copy a variant. More... | |
| enum KzuPropertyDataType | kzuVariantResolveType (const struct KzuVariant *variant, enum KzuPropertyField field) |
| Resolve the actual data type of a variant, including the field. More... | |
| kzsError | kzuVariantCast (struct KzuVariant *targetVariant, enum KzuPropertyDataType targetDataType, const struct KzuVariant *sourceVariant, kzBool *out_cast) |
| Cast a variant into the target variant. More... | |
| kzsError | kzuVariantInitializeFromProperty (const struct KzuPropertyManager *propertyManager, const void *object, const struct KzuPropertyType *propertyType, enum KzuPropertyField field, struct KzuVariant *variant, kzBool *out_found) |
| Gets an object's property from a property manager and sets the property value to the given variant. More... | |
| kzsError | kzuVariantSetToProperty (const struct KzuVariant *variant, const struct KzuPropertyManager *propertyManager, const void *object, const struct KzuPropertyType *propertyType, enum KzuPropertyField field, kzBool *out_written) |
| Sets an object's property from a variant. More... | |
| kzsError | kzuVariantFilterWithField (struct KzuVariant *variant, enum KzuPropertyField field) |
| Changes the value and the type of the variant to a sub-value and a sub-type of the variant. More... | |
Value variant.
Copyright 2008-2019 by Rightware. All rights reserved.
| kzsError kzuVariantCreate | ( | const struct KzcMemoryManager * | memoryManager, |
| struct KzuVariant ** | out_variant | ||
| ) |
Creates an empty variant object.
| kzsError kzuVariantDelete | ( | struct KzuVariant * | variant) |
Deletes a variant object.
| kzsError kzuVariantSetEmpty | ( | struct KzuVariant * | variant) |
Set a variant to be empty.
Empty variants are considered invalid.
| kzBool kzuVariantIsEmpty | ( | const struct KzuVariant * | variant) |
Checks if a variant is empty.
Empty variants are considered invalid.
| enum KzuPropertyDataType kzuVariantGetType | ( | const struct KzuVariant * | variant) |
Get the type of the value stored in a variant.
| kzsError kzuVariantSetFloat | ( | struct KzuVariant * | variant, |
| kzFloat | value | ||
| ) |
Initialize a variant with a kzFloat value.
| kzsError kzuVariantSetFloatWithField | ( | struct KzuVariant * | variant, |
| enum KzuPropertyField | field, | ||
| kzFloat | value | ||
| ) |
Set a float field of a variant.
| kzFloat kzuVariantGetFloat | ( | const struct KzuVariant * | variant) |
Get the kzFloat value stored in a variant.
| kzFloat kzuVariantGetFloatWithField | ( | const struct KzuVariant * | variant, |
| enum KzuPropertyField | field | ||
| ) |
Get the kzFloat value stored in a variant, also use field.
| kzsError kzuVariantSetInt | ( | struct KzuVariant * | variant, |
| kzInt | value | ||
| ) |
Initialize a variant with a kzInt value.
| kzInt kzuVariantGetInt | ( | const struct KzuVariant * | variant) |
Get the kzInt value stored in a variant.
| kzsError kzuVariantSetBool | ( | struct KzuVariant * | variant, |
| kzBool | value | ||
| ) |
Initialize a variant with a kzBool value.
| kzBool kzuVariantGetBool | ( | const struct KzuVariant * | variant) |
Get the kzBool value stored in a variant.
| kzsError kzuVariantSetColor | ( | struct KzuVariant * | variant, |
| struct KzcColorRGBA | value | ||
| ) |
Initialize a variant with a KzcColorRGBA value.
| struct KzcColorRGBA kzuVariantGetColor | ( | const struct KzuVariant * | variant) |
Get the KzcColorRGBA value stored in a variant.
| kzsError kzuVariantSetVector2 | ( | struct KzuVariant * | variant, |
| struct KzcVector2 | value | ||
| ) |
Initialize a variant with a KzcVector2 value.
| struct KzcVector2 kzuVariantGetVector2 | ( | const struct KzuVariant * | variant) |
Get the KzcVector2 value stored in a variant.
| kzsError kzuVariantSetVector3 | ( | struct KzuVariant * | variant, |
| struct KzcVector3 | value | ||
| ) |
Initialize a variant with a KzcVector3 value.
| struct KzcVector3 kzuVariantGetVector3 | ( | const struct KzuVariant * | variant) |
Get the KzcVector3 value stored in a variant.
| kzsError kzuVariantSetVector4 | ( | struct KzuVariant * | variant, |
| struct KzcVector4 | value | ||
| ) |
Initialize a variant with a KzcVector4 value.
| struct KzcVector4 kzuVariantGetVector4 | ( | const struct KzuVariant * | variant) |
Get the KzcVector4 value stored in a variant.
| kzsError kzuVariantSetMatrix2x2 | ( | struct KzuVariant * | variant, |
| struct KzcMatrix2x2 | value | ||
| ) |
Initialize a variant with a KzcMatrix2x2 value.
| struct KzcMatrix2x2 kzuVariantGetMatrix2x2 | ( | const struct KzuVariant * | variant) |
Get the KzcMatrix2x2 value stored in a variant.
| kzsError kzuVariantSetMatrix3x3 | ( | struct KzuVariant * | variant, |
| struct KzcMatrix3x3 | value | ||
| ) |
Initialize a variant with a KzcMatrix3x3 value.
| kzsError kzuVariantSetMatrix3x3SRT | ( | struct KzuVariant * | variant, |
| const struct KzcVector2 * | scale, | ||
| kzFloat | rotation, | ||
| const struct KzcVector2 * | translation | ||
| ) |
Initialize a variant with KzcMatrix3x3 SRT values.
| struct KzcMatrix3x3 kzuVariantGetMatrix3x3 | ( | const struct KzuVariant * | variant) |
Get the KzcMatrix3x3 value stored in a variant.
| void kzuVariantGetMatrix3x3SRT | ( | const struct KzuVariant * | variant, |
| struct KzcVector2 * | out_scale, | ||
| kzFloat * | out_rotation, | ||
| struct KzcVector2 * | out_translation | ||
| ) |
Get the KzcMatrix3x3 SRT values stored in a variant.
| kzsError kzuVariantSetMatrix4x4 | ( | struct KzuVariant * | variant, |
| struct KzcMatrix4x4 | value | ||
| ) |
Initialize a variant with a KzcMatrix4x4 value.
| kzsError kzuVariantSetMatrix4x4SRT | ( | struct KzuVariant * | variant, |
| const struct KzcVector3 * | scale, | ||
| const struct KzcVector3 * | rotation, | ||
| const struct KzcVector3 * | translation | ||
| ) |
Initialize a variant with KzcMatrix4x4 SRT values.
| struct KzcMatrix4x4 kzuVariantGetMatrix4x4 | ( | const struct KzuVariant * | variant) |
Get the KzcMatrix4x4 value stored in a variant.
| void kzuVariantGetMatrix4x4SRT | ( | const struct KzuVariant * | variant, |
| struct KzcVector3 * | out_scale, | ||
| struct KzcVector3 * | out_rotation, | ||
| struct KzcVector3 * | out_translation | ||
| ) |
Get the KzcMatrix4x4 SRT values stored in a variant.
| kzsError kzuVariantSetString | ( | struct KzuVariant * | variant, |
| kzString | value | ||
| ) |
Initialize a variant with a kzString value.
| kzsError kzuVariantSetStringWithoutCopy | ( | struct KzuVariant * | variant, |
| kzMutableString | value | ||
| ) |
Initialize a variant with a kzString value without copying the value.
The variant will take possession of the string. Only use this if ready to relinquish the ownership.
| kzString kzuVariantGetString | ( | const struct KzuVariant * | variant) |
Get the kzString value stored in a variant.
| kzsError kzuVariantSetPointer | ( | struct KzuVariant * | variant, |
| void * | value | ||
| ) |
Initialize a variant with a pointer value.
| kzsError kzuVariantSetPointerResource | ( | struct KzuVariant * | variant, |
| struct KzuResource * | resource | ||
| ) |
Initialize a variant with a resource value.
| kzsError kzuVariantSetPointerRelativePath | ( | struct KzuVariant * | variant, |
| kzString | path | ||
| ) |
Initialize a variant with a relative path.
| void* kzuVariantGetPointer | ( | const struct KzuVariant * | variant) |
Get the pointer value stored in a variant.
| kzsError kzuVariantSetResourceID | ( | struct KzuVariant * | variant, |
| kzString | value | ||
| ) |
Initialize a variant with a resourceID value.
| kzString kzuVariantGetResourceID | ( | const struct KzuVariant * | variant) |
Get the pointer value stored in a variant.
| kzBool kzuVariantIsEqual | ( | const struct KzuVariant * | variantA, |
| const struct KzuVariant * | variantB | ||
| ) |
Check if variants are equal.
Empty variants are not equal to each other. KZU_PROPERTY_DATA_TYPE_STRUCT and KZU_PROPERTY_DATA_TYPE_ARRAY data types are not supported.
| kzsError kzuVariantCopy | ( | struct KzuVariant * | targetVariant, |
| const struct KzuVariant * | sourceVariant | ||
| ) |
Copy a variant.
| enum KzuPropertyDataType kzuVariantResolveType | ( | const struct KzuVariant * | variant, |
| enum KzuPropertyField | field | ||
| ) |
Resolve the actual data type of a variant, including the field.
| variant | Variant to examine. |
| field | Field. |
| kzsError kzuVariantCast | ( | struct KzuVariant * | targetVariant, |
| enum KzuPropertyDataType | targetDataType, | ||
| const struct KzuVariant * | sourceVariant, | ||
| kzBool * | out_cast | ||
| ) |
Cast a variant into the target variant.
| targetVariant | The variant which value is written. |
| targetDataType | KzuPropertyDataType to use as the target variant's data type. |
| sourceVariant | The variant which value is read. |
| out_cast | Set on success. The value is KZ_TRUE if the cast succeeded, otherwise KZ_FALSE. |
| kzsError kzuVariantInitializeFromProperty | ( | const struct KzuPropertyManager * | propertyManager, |
| const void * | object, | ||
| const struct KzuPropertyType * | propertyType, | ||
| enum KzuPropertyField | field, | ||
| struct KzuVariant * | variant, | ||
| kzBool * | out_found | ||
| ) |
Gets an object's property from a property manager and sets the property value to the given variant.
| propertyManager | The property manager to use. |
| object | Object owning the property to read. |
| propertyType | KzuPropertyType of the property to read. |
| field | The field to read from the property. |
| variant | Previously created variant which value is set. |
| out_found | Set on success. The value is KZ_TRUE if the property was found, otherwise KZ_FALSE. |
| kzsError kzuVariantSetToProperty | ( | const struct KzuVariant * | variant, |
| const struct KzuPropertyManager * | propertyManager, | ||
| const void * | object, | ||
| const struct KzuPropertyType * | propertyType, | ||
| enum KzuPropertyField | field, | ||
| kzBool * | out_written | ||
| ) |
Sets an object's property from a variant.
| variant | Variant which value is read. |
| propertyManager | The property manager to use. |
| object | Object owning the property to set. |
| propertyType | KzuPropertyType of the property to set. |
| field | KzuPropertyField of the property to set. |
| out_found | Set on success. The value is KZ_TRUE if the property was written, otherwise KZ_FALSE. |
| kzsError kzuVariantFilterWithField | ( | struct KzuVariant * | variant, |
| enum KzuPropertyField | field | ||
| ) |
Changes the value and the type of the variant to a sub-value and a sub-type of the variant.
| variant | Variant which value is filtered. |
| field | The field to filter by. |