change clang-format
Signed-off-by: Folling <mail@folling.io>
This commit is contained in:
parent
f63d2b2fe2
commit
eab9bafe7b
33 changed files with 217 additions and 254 deletions
|
|
@ -15,10 +15,10 @@
|
|||
IKARUS_BEGIN_HEADER
|
||||
|
||||
/// \brief Delineates what caused an error.
|
||||
/// \details First 2 bytes delineate the major type, next 2 bytes delineate the minor type, next 4 bytes delineate the detail
|
||||
/// type.
|
||||
/// \remark Note that this doesn't show responsibility. An error with source "SubSystem" could still be the fault of
|
||||
/// libikarus.
|
||||
/// \details First 2 bytes delineate the major type, next 2 bytes delineate the minor type, next 4 bytes delineate the
|
||||
/// detail type.
|
||||
/// \remark Note that this doesn't show responsibility. An error with source "SubSystem" could still be the
|
||||
/// fault of libikarus.
|
||||
enum IkarusErrorInfo {
|
||||
/// \brief No error occurred.
|
||||
IkarusErrorInfo_Source_None = 0x0001000000000000,
|
||||
|
|
|
|||
|
|
@ -11,8 +11,8 @@
|
|||
|
||||
IKARUS_BEGIN_HEADER
|
||||
|
||||
/// \brief Frees a pointer allocated by ikarus. Every pointer returned by a function must be freed using this function unless
|
||||
/// explicitly stated otherwise.
|
||||
/// \brief Frees a pointer allocated by ikarus. Every pointer returned by a function must be freed using this function
|
||||
/// unless explicitly stated otherwise.
|
||||
IKA_API void ikarus_free(void * ptr);
|
||||
|
||||
IKARUS_END_HEADER
|
||||
|
|
|
|||
|
|
@ -43,9 +43,8 @@ IKA_API void ikarus_blueprint_delete(IkarusBlueprint * blueprint);
|
|||
/// \pre \li Must not be null.
|
||||
/// \param properties_out_size The size of the buffer.
|
||||
/// \see ikarus_blueprint_get_property_count
|
||||
IKA_API void ikarus_blueprint_get_properties(
|
||||
IkarusBlueprint const * blueprint, struct IkarusProperty ** properties_out, size_t properties_out_size
|
||||
);
|
||||
IKA_API void
|
||||
ikarus_blueprint_get_properties(IkarusBlueprint const * blueprint, struct IkarusProperty ** properties_out, size_t properties_out_size);
|
||||
|
||||
/// \brief Gets the number of properties of a blueprint.
|
||||
/// \param blueprint The blueprint to get the number of properties of.
|
||||
|
|
@ -62,9 +61,8 @@ IKA_API size_t ikarus_blueprint_get_property_count(IkarusBlueprint const * bluep
|
|||
/// \pre \li Must not be null.
|
||||
/// \param entities_out_size The size of the buffer.
|
||||
/// \see ikarus_blueprint_get_linked_entity_count
|
||||
IKA_API void ikarus_blueprint_get_linked_entities(
|
||||
IkarusBlueprint const * blueprint, struct IkarusEntity ** entities_out, size_t entities_out_size
|
||||
);
|
||||
IKA_API void
|
||||
ikarus_blueprint_get_linked_entities(IkarusBlueprint const * blueprint, struct IkarusEntity ** entities_out, size_t entities_out_size);
|
||||
|
||||
/// \brief Gets the number of entities linked to a blueprint.
|
||||
/// \param blueprint The blueprint to get the number of linked entities of.
|
||||
|
|
|
|||
|
|
@ -56,6 +56,14 @@ IKA_API IkarusEntity * ikarus_entity_create(struct IkarusProject * project, char
|
|||
/// \remark The entity must not be accessed after deletion.
|
||||
IKA_API void ikarus_entity_delete(IkarusEntity * entity);
|
||||
|
||||
/// \brief Checks if an entity is linked to a blueprint.
|
||||
/// \param entity The entity to check.
|
||||
/// \pre \li Must not be null.
|
||||
/// \pre \li Must exist.
|
||||
/// \param blueprint The blueprint to check.
|
||||
/// \pre \li Must not be null.
|
||||
/// \pre \li Must exist.
|
||||
/// \return True if the entity is linked to the blueprint, false otherwise.
|
||||
IKA_API bool ikarus_entity_is_linked_to_blueprint(IkarusEntity const * entity, struct IkarusBlueprint const * blueprint);
|
||||
|
||||
/// \brief Links an entity to a blueprint.
|
||||
|
|
@ -68,8 +76,8 @@ IKA_API bool ikarus_entity_is_linked_to_blueprint(IkarusEntity const * entity, s
|
|||
/// \remark No-op if the entity is already linked to the blueprint.
|
||||
IKA_API void ikarus_entity_link_to_blueprint(IkarusEntity * entity, struct IkarusBlueprint * blueprint);
|
||||
|
||||
/// \brief Unlinks an entity from a blueprint. All values of the properties of the blueprint the entity is linked with will be
|
||||
/// deleted.
|
||||
/// \brief Unlinks an entity from a blueprint. All values of the properties of the blueprint the entity is linked with
|
||||
/// will be deleted.
|
||||
/// \param entity The entity to unlink.
|
||||
/// \pre \li Must not be null.
|
||||
/// \pre \li Must exist.
|
||||
|
|
@ -103,12 +111,11 @@ IKA_API size_t ikarus_entity_get_property_count(IkarusEntity const * entity);
|
|||
/// \param properties_out The buffer to write the properties to.
|
||||
/// \pre \li Must not be null.
|
||||
/// \param properties_out_size The size of the buffer.
|
||||
IKA_API void ikarus_entity_get_properties(
|
||||
IkarusEntity const * entity, struct IkarusProperty ** properties_out, size_t properties_out_size
|
||||
);
|
||||
IKA_API void ikarus_entity_get_properties(IkarusEntity const * entity, struct IkarusProperty ** properties_out, size_t properties_out_size);
|
||||
|
||||
/// \brief Gets the value of a property of an entity.
|
||||
/// \details If the entity has never set the value of the property, the default value is returned (which may be undefined).
|
||||
/// \details If the entity has never set the value of the property, the default value is returned (which may be
|
||||
/// undefined).
|
||||
/// \param entity The entity to get the value of.
|
||||
/// \pre \li Must not be null.
|
||||
/// \pre \li Must exist.
|
||||
|
|
@ -116,7 +123,8 @@ IKA_API void ikarus_entity_get_properties(
|
|||
/// \pre \li Must not be null.
|
||||
/// \pre \li Must exist.
|
||||
/// \return The value of the property or null if the entity does not have the property or an error occurs.
|
||||
/// \remark Must be freed using #ikarus_free.
|
||||
/// \remark Must be freed using
|
||||
/// #ikarus_free.
|
||||
IKA_API struct IkarusEntityValue * ikarus_entity_get_value(IkarusEntity const * entity, struct IkarusProperty const * property);
|
||||
|
||||
/// \brief Sets the value of a property of an entity.
|
||||
|
|
@ -131,9 +139,7 @@ IKA_API struct IkarusEntityValue * ikarus_entity_get_value(IkarusEntity const *
|
|||
/// \pre \li Must be of the same type as the property.
|
||||
/// \pre \li Must be valid for the property's settings.
|
||||
/// \remark If the entity does not have the property, this function fails.
|
||||
IKA_API void ikarus_entity_set_value(
|
||||
IkarusEntity * entity, struct IkarusProperty const * property, struct IkarusValue const * value
|
||||
);
|
||||
IKA_API void ikarus_entity_set_value(IkarusEntity * entity, struct IkarusProperty const * property, struct IkarusValue const * value);
|
||||
|
||||
/// \brief Casts an entity to an object.
|
||||
/// \param entity The entity to cast.
|
||||
|
|
|
|||
|
|
@ -19,11 +19,8 @@ IKARUS_BEGIN_HEADER
|
|||
struct IkarusObject;
|
||||
|
||||
/// \brief Compares two objects for equality.
|
||||
/// \details This neither compares the pointers nor does a deep copy. Instead it figures out if the objects _are_ the same
|
||||
/// object.
|
||||
/// \param lhs The left hand side object.
|
||||
/// \pre \li Must not be null.
|
||||
/// \param rhs The right hand side object.
|
||||
/// \details This neither compares the pointers nor does a deep copy. Instead it figures out if the objects _are_ the
|
||||
/// same object. \param lhs The left hand side object. \pre \li Must not be null. \param rhs The right hand side object.
|
||||
/// \pre \li Must not be null.
|
||||
/// \return True if the objects are equal, false otherwise.
|
||||
IKA_API bool ikarus_object_is_equal(IkarusObject const * lhs, IkarusObject const * rhs);
|
||||
|
|
|
|||
|
|
@ -13,9 +13,8 @@ IKARUS_BEGIN_HEADER
|
|||
|
||||
struct IkarusNumberProperty;
|
||||
|
||||
IKA_API IkarusNumberProperty * ikarus_number_property_create(
|
||||
struct IkarusProject * project, char const * name, struct IkarusPropertySource * property_source
|
||||
);
|
||||
IKA_API IkarusNumberProperty *
|
||||
ikarus_number_property_create(struct IkarusProject * project, char const * name, struct IkarusPropertySource * property_source);
|
||||
|
||||
/// \brief Sets the default value for a number property.
|
||||
/// \param property The number property.
|
||||
|
|
@ -30,11 +29,9 @@ IKA_API struct IkarusNumberValue * ikarus_number_property_get_default_value(stru
|
|||
/// \param default_value The default value.
|
||||
/// \pre \li Must not be null.
|
||||
/// \pre \li Must be a valid value for the property.
|
||||
/// \remark Please see \ref property.h "the property documentation" for more information on the interplay between default values
|
||||
/// and other settings.
|
||||
IKA_API void ikarus_number_property_set_default_value(
|
||||
struct IkarusNumberProperty * property, struct IkarusNumberValue * default_value
|
||||
);
|
||||
/// \remark Please see \ref property.h "the property documentation" for more information on the interplay between
|
||||
/// default values and other settings.
|
||||
IKA_API void ikarus_number_property_set_default_value(struct IkarusNumberProperty * property, struct IkarusNumberValue * default_value);
|
||||
|
||||
IKARUS_END_HEADER
|
||||
|
||||
|
|
|
|||
|
|
@ -33,8 +33,8 @@ IKARUS_BEGIN_HEADER
|
|||
/// - May be undefined
|
||||
///
|
||||
/// Additionally, each property has a default value. If no default value is provided, a sensible default is chosen.
|
||||
/// Setting a default value that isn't valid for the property is an error. Changing settings so that the current default value
|
||||
/// becomes invalid is valid but unsets the custom default value.
|
||||
/// Setting a default value that isn't valid for the property is an error. Changing settings so that the current default
|
||||
/// value becomes invalid is valid but unsets the custom default value.
|
||||
///
|
||||
/// The former transforms a property into a list. Instead of one number, you could then specify a series of numbers.
|
||||
/// The latter allows you to specify an "unknown" value for a property.
|
||||
|
|
|
|||
|
|
@ -13,9 +13,8 @@ IKARUS_BEGIN_HEADER
|
|||
|
||||
struct IkarusTextProperty;
|
||||
|
||||
IKA_API IkarusTextProperty * ikarus_text_property_create(
|
||||
struct IkarusProject * project, char const * name, struct IkarusPropertySource * property_source
|
||||
);
|
||||
IKA_API IkarusTextProperty *
|
||||
ikarus_text_property_create(struct IkarusProject * project, char const * name, struct IkarusPropertySource * property_source);
|
||||
|
||||
/// \brief Sets the default value for a text property.
|
||||
/// \param property The text property.
|
||||
|
|
@ -30,11 +29,9 @@ IKA_API struct IkarusTextValue * ikarus_text_property_get_default_value(struct I
|
|||
/// \param default_value The default value.
|
||||
/// \pre \li Must not be null.
|
||||
/// \pre \li Must be a valid value for the property.
|
||||
/// \remark Please see \ref property.h "the property documentation" for more information on the interplay between default values
|
||||
/// and other settings.
|
||||
IKA_API void ikarus_text_property_set_default_value(
|
||||
struct IkarusTextProperty * property, struct IkarusTextValue * default_value
|
||||
);
|
||||
/// \remark Please see \ref property.h "the property documentation" for more information on the interplay between
|
||||
/// default values and other settings.
|
||||
IKA_API void ikarus_text_property_set_default_value(struct IkarusTextProperty * property, struct IkarusTextValue * default_value);
|
||||
|
||||
IKARUS_END_HEADER
|
||||
|
||||
|
|
|
|||
|
|
@ -13,9 +13,8 @@ IKARUS_BEGIN_HEADER
|
|||
|
||||
struct IkarusToggleProperty;
|
||||
|
||||
IKA_API IkarusToggleProperty * ikarus_toggle_property_create(
|
||||
struct IkarusProject * project, char const * name, struct IkarusPropertySource * property_source
|
||||
);
|
||||
IKA_API IkarusToggleProperty *
|
||||
ikarus_toggle_property_create(struct IkarusProject * project, char const * name, struct IkarusPropertySource * property_source);
|
||||
|
||||
/// \brief Sets the default value for a toggle property.
|
||||
/// \param property The toggle property.
|
||||
|
|
@ -30,11 +29,9 @@ IKA_API struct IkarusToggleValue * ikarus_toggle_property_get_default_value(stru
|
|||
/// \param default_value The default value.
|
||||
/// \pre \li Must not be null.
|
||||
/// \pre \li Must be a valid value for the property.
|
||||
/// \remark Please see \ref property.h "the property documentation" for more information on the interplay between default values
|
||||
/// and other settings.
|
||||
IKA_API void ikarus_toggle_property_set_default_value(
|
||||
struct IkarusToggleProperty * property, struct IkarusToggleValue * default_value
|
||||
);
|
||||
/// \remark Please see \ref property.h "the property documentation" for more information on the interplay between
|
||||
/// default values and other settings.
|
||||
IKA_API void ikarus_toggle_property_set_default_value(struct IkarusToggleProperty * property, struct IkarusToggleValue * default_value);
|
||||
|
||||
IKARUS_END_HEADER
|
||||
|
||||
|
|
|
|||
|
|
@ -144,9 +144,8 @@ IKA_API size_t ikarus_project_get_blueprint_count(IkarusProject const * project)
|
|||
/// \param blueprints_out The buffer to write the blueprints to.
|
||||
/// \pre \li Must not be null.
|
||||
/// \param blueprints_out_size The size of the buffer.
|
||||
IKA_API void ikarus_project_get_blueprints(
|
||||
IkarusProject const * project, struct IkarusBlueprint ** blueprints_out, size_t blueprints_out_size
|
||||
);
|
||||
IKA_API void
|
||||
ikarus_project_get_blueprints(IkarusProject const * project, struct IkarusBlueprint ** blueprints_out, size_t blueprints_out_size);
|
||||
|
||||
/// \brief Gets the entity root folder of a project.
|
||||
/// \param project The project to get the entity root folder of.
|
||||
|
|
@ -170,9 +169,7 @@ IKA_API size_t ikarus_project_get_entity_count(IkarusProject const * project);
|
|||
/// \param entities_out The buffer to write the entities to.
|
||||
/// \pre \li Must not be null.
|
||||
/// \param entities_out_size The size of the buffer.
|
||||
IKA_API void ikarus_project_get_entities(
|
||||
IkarusProject const * project, struct IkarusEntity ** entities_out, size_t entities_out_size
|
||||
);
|
||||
IKA_API void ikarus_project_get_entities(IkarusProject const * project, struct IkarusEntity ** entities_out, size_t entities_out_size);
|
||||
|
||||
IKARUS_END_HEADER
|
||||
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@
|
|||
/// Each value may be undefined. \see IkarusProperty
|
||||
/// Values are stored as lists. If a property is "singular" then its value is a list of size 1.
|
||||
/// Values are typed, with types existing for each of the corresponding property types.
|
||||
/// When setting values for a property the type must match the property type and the value must be valid under the property's
|
||||
/// settings. \see PropertyType
|
||||
/// When setting values for a property the type must match the property type and the value must be valid under the
|
||||
/// property's settings. \see PropertyType
|
||||
/// @{
|
||||
|
||||
IKARUS_BEGIN_HEADER
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue