intermediate commit
Signed-off-by: Folling <mail@folling.io>
This commit is contained in:
parent
52580a4382
commit
2ab0109355
37 changed files with 131 additions and 1544 deletions
|
|
@ -21,37 +21,25 @@ struct IkarusBlueprint;
|
|||
/// \param project The project the blueprint is part of.
|
||||
/// \pre \li Must not be null.
|
||||
/// \pre \li Must exist.
|
||||
/// \param parent The parent folder of the blueprint.
|
||||
/// \pre \li Must not be null.
|
||||
/// \pre \li Must exist.
|
||||
/// \param position The position of the blueprint in the parent folder. \see #FolderPosition
|
||||
/// \pre \li Must be within bounds for the parent folder.
|
||||
/// \param name The name of the blueprint.
|
||||
/// \pre \li Must not be null.
|
||||
/// \pre \li Must not be empty.
|
||||
/// \return The created blueprint or null if an error occurs.
|
||||
/// \remark Must be freed using #ikarus_free.
|
||||
IKA_API IkarusBlueprint * ikarus_blueprint_create(
|
||||
struct IkarusProject * project, struct IkarusBlueprintFolder * parent, size_t position, char const * name
|
||||
);
|
||||
IKA_API IkarusBlueprint * ikarus_blueprint_create(struct IkarusProject * project, char const * name);
|
||||
|
||||
/// \brief Creates a blueprint from an entity.
|
||||
/// \details The created blueprint will have the same properties as the entity.
|
||||
/// \param entity The entity to create the blueprint from.
|
||||
/// \pre \li Must not be null.
|
||||
/// \param link_entity If true, the entity will be linked to the blueprint. If not they will remain separate.
|
||||
/// \param parent The parent folder of the blueprint.
|
||||
/// \pre \li Must not be null.
|
||||
/// \pre \li Must exist.
|
||||
/// \param position The position of the blueprint in the parent folder. \see #FolderPosition
|
||||
/// \pre \li Must be within bounds for the parent folder.
|
||||
/// \param name The name of the blueprint. Must not be empty.
|
||||
/// \pre \li Must not be null.
|
||||
/// \pre \li Must not be empty.
|
||||
/// \return The created blueprint or null if an error occurs.
|
||||
/// \remark Must be freed using #ikarus_free.
|
||||
IKA_API IkarusBlueprint * ikarus_blueprint_create_from_entity(
|
||||
struct IkarusEntity * entity, bool link_entity, struct IkarusBlueprintFolder * parent, size_t position, char const * name
|
||||
struct IkarusEntity * entity, bool link_entity, char const * name
|
||||
);
|
||||
|
||||
/// \brief Copies a blueprint.
|
||||
|
|
@ -59,20 +47,13 @@ IKA_API IkarusBlueprint * ikarus_blueprint_create_from_entity(
|
|||
/// \param blueprint The blueprint to copy.
|
||||
/// \pre \li Must not be null.
|
||||
/// \pre \li Must exist.
|
||||
/// \param parent The parent folder of the blueprint.
|
||||
/// \pre \li Must not be null.
|
||||
/// \pre \li Must exist.
|
||||
/// \param position The position of the blueprint in the parent folder. \see #FolderPosition
|
||||
/// \pre \li Must be within bounds for the parent folder.
|
||||
/// \param name The name of the blueprint.
|
||||
/// \pre \li Must not be null.
|
||||
/// \pre \li Must not be empty.
|
||||
/// \return The created blueprint or null if an error occurs.
|
||||
/// \remark Linked entities won't be copied.
|
||||
/// \remark Must be freed using #ikarus_free.
|
||||
IKA_API IkarusBlueprint * ikarus_blueprint_copy(
|
||||
IkarusBlueprint const * blueprint, struct IkarusBlueprintFolder * parent, size_t position, char const * name
|
||||
);
|
||||
IKA_API IkarusBlueprint * ikarus_blueprint_copy(IkarusBlueprint const * blueprint, char const * name);
|
||||
|
||||
/// \brief Deletes a blueprint.
|
||||
/// \param blueprint The blueprint to delete.
|
||||
|
|
@ -88,20 +69,6 @@ IKA_API void ikarus_blueprint_delete(IkarusBlueprint * blueprint);
|
|||
/// \return The project of the blueprint or null if an error occurs.
|
||||
IKA_API struct IkarusProject * ikarus_blueprint_get_project(IkarusBlueprint const * blueprint);
|
||||
|
||||
/// \brief Gets the parent folder of a blueprint.
|
||||
/// \param blueprint The blueprint to get the parent folder of.
|
||||
/// \pre \li Must not be null.
|
||||
/// \pre \li Must exist.
|
||||
/// \return The parent folder of the blueprint or null if an error occurs.
|
||||
IKA_API struct IkarusBlueprintFolder * ikarus_blueprint_get_parent(IkarusBlueprint const * blueprint);
|
||||
|
||||
/// \brief Gets the position of a blueprint within its parent folder.
|
||||
/// \param blueprint The blueprint to get the position of.
|
||||
/// \pre \li Must not be null.
|
||||
/// \pre \li Must exist.
|
||||
/// \return The position of the blueprint or undefined if an error occurs.
|
||||
IKA_API size_t ikarus_blueprint_get_position(IkarusBlueprint const * blueprint);
|
||||
|
||||
/// \brief Gets the name of a blueprint.
|
||||
/// \param blueprint The blueprint to get the name of.
|
||||
/// \pre \li Must not be null.
|
||||
|
|
@ -110,14 +77,6 @@ IKA_API size_t ikarus_blueprint_get_position(IkarusBlueprint const * blueprint);
|
|||
/// \remark The returned pointer is valid until the blueprint is freed but may be invalidated by other operations.
|
||||
IKA_API char const * ikarus_blueprint_get_name(IkarusBlueprint const * blueprint);
|
||||
|
||||
/// \brief Gets the property root folder of a blueprint.
|
||||
/// \param blueprint The blueprint to get the root folder of.
|
||||
/// \pre \li Must not be null.
|
||||
/// \pre \li Must exist.
|
||||
/// \return The root folder of all properties of the blueprint or null if an error occurs.
|
||||
/// \remark Must be freed using #ikarus_free.
|
||||
IKA_API struct IkarusPropertyFolder * ikarus_blueprint_get_property_root_folder(IkarusBlueprint const * blueprint);
|
||||
|
||||
/// \brief Gets the number of properties of a blueprint.
|
||||
/// \param blueprint The blueprint to get the number of properties of.
|
||||
/// \pre \li Must not be null.
|
||||
|
|
@ -154,29 +113,6 @@ IKA_API void ikarus_blueprint_get_linked_entities(
|
|||
IkarusBlueprint const * blueprint, struct IkarusEntity ** entities_out, size_t entities_out_size
|
||||
);
|
||||
|
||||
/// \brief Sets the parent folder of a blueprint.
|
||||
/// \param blueprint The blueprint to set the parent folder of.
|
||||
/// \pre \li Must not be null.
|
||||
/// \pre \li Must exist.
|
||||
/// \param new_parent The new parent folder of the blueprint.
|
||||
/// \pre \li Must not be null.
|
||||
/// \pre \li Must exist.
|
||||
/// \param new_position The new position of the blueprint in the parent folder. \see #FolderPosition
|
||||
/// \pre \li Must be within bounds for the parent folder.
|
||||
/// \remark This adjusts the positions of old and new siblings.
|
||||
IKA_API void ikarus_blueprint_set_parent(
|
||||
IkarusBlueprint * blueprint, struct IkarusBlueprintFolder * new_parent, size_t new_position
|
||||
);
|
||||
|
||||
/// \brief Sets the position of a blueprint within its parent folder.
|
||||
/// \param blueprint The blueprint to set the position of.
|
||||
/// \pre \li Must not be null.
|
||||
/// \pre \li Must exist.
|
||||
/// \param new_position The new position of the blueprint. \see #FolderPosition
|
||||
/// \pre \li Must be within bounds for the parent folder.
|
||||
/// \remark This adjusts the positions of siblings.
|
||||
IKA_API void ikarus_blueprint_set_position(IkarusBlueprint * blueprint, size_t new_position);
|
||||
|
||||
/// \brief Sets the name of a blueprint.
|
||||
/// \param blueprint The blueprint to set the name of.
|
||||
/// \pre \li Must not be null.
|
||||
|
|
@ -186,14 +122,6 @@ IKA_API void ikarus_blueprint_set_position(IkarusBlueprint * blueprint, size_t n
|
|||
/// \pre \li Must not be empty.
|
||||
IKA_API void ikarus_blueprint_set_name(IkarusBlueprint * blueprint, char const * new_name);
|
||||
|
||||
/// \brief Converts a blueprint to an object.
|
||||
/// \param blueprint The blueprint to convert.
|
||||
/// \pre \li Must not be null.
|
||||
/// \pre \li Must exist.
|
||||
/// \return The constructed object, representing the blueprint.
|
||||
/// \remark Must be freed using #ikarus_free.
|
||||
IKA_API struct IkarusObject * ikarus_blueprint_to_object(IkarusBlueprint const * blueprint);
|
||||
|
||||
/// \brief Compares two blueprints.
|
||||
/// \param left The left blueprint to compare.
|
||||
/// \pre \li Must not be null.
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <ikarus/macros.h>
|
||||
#include <ikarus/stdtypes.h>
|
||||
|
||||
/// \file entity.h
|
||||
/// \author Folling <folling@ikarus.world>
|
||||
|
|
@ -230,12 +231,6 @@ IKA_API void ikarus_entity_set_value(
|
|||
IkarusEntity * entity, struct IkarusProperty const * property, struct IkarusValue * value, bool validate_settings
|
||||
);
|
||||
|
||||
/// \brief Converts an entity to an object.
|
||||
/// \param entity The entity to convert.
|
||||
/// \return The constructed object, representing the entity.
|
||||
/// \remark Must be freed using #ikarus_free.
|
||||
IKA_API struct IkarusObject * ikarus_entity_to_object(IkarusEntity const * entity);
|
||||
|
||||
/// \brief Compares two entities.
|
||||
/// \param left The left entity to compare.
|
||||
/// \pre \li Must not be null.
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
#include <ikarus/macros.h>
|
||||
#include <ikarus/objects/property_type.h>
|
||||
#include <ikarus/stdtypes.h>
|
||||
|
||||
/// \defgroup properties Properties
|
||||
/// \brief Properties define the structure and types of data.
|
||||
|
|
@ -58,11 +59,6 @@ struct IkarusProperty;
|
|||
/// \param property_source The property source the property is part of.
|
||||
/// \pre \li Must not be null.
|
||||
/// \pre \li Must exist.
|
||||
/// \param parent_folder The parent folder of the property.
|
||||
/// \pre \li Must not be null.
|
||||
/// \pre \li Must exist.
|
||||
/// \param position The position of the property in the parent folder. \see #FolderPosition
|
||||
/// \pre \li Must be within bounds for the parent folder.
|
||||
/// \param name The name of the property.
|
||||
/// \pre \li Must not be null.
|
||||
/// \pre \li Must not be empty.
|
||||
|
|
@ -73,8 +69,6 @@ struct IkarusProperty;
|
|||
IKA_API struct IkarusProperty * ikarus_property_create(
|
||||
struct IkarusProject * project,
|
||||
struct IkarusPropertySource * property_source,
|
||||
struct IkarusPropertyFolder * parent_folder,
|
||||
size_t position,
|
||||
char const * name,
|
||||
struct IkarusPropertyTypeInfo * property_info
|
||||
);
|
||||
|
|
@ -87,22 +81,13 @@ IKA_API struct IkarusProperty * ikarus_property_create(
|
|||
/// \param source The source to copy the property to.
|
||||
/// \pre \li Must not be null.
|
||||
/// \pre \li Must exist.
|
||||
/// \param parent_folder The parent folder of the property.
|
||||
/// \pre \li Must not be null.
|
||||
/// \pre \li Must exist.
|
||||
/// \param position The position of the property in the parent folder. \see #FolderPosition
|
||||
/// \pre \li Must be within bounds for the parent folder.
|
||||
/// \param name The name of the property.
|
||||
/// \pre \li Must not be null.
|
||||
/// \pre \li Must not be empty.
|
||||
/// \return The created property or null if an error occurs.
|
||||
/// \remark Must be freed using #ikarus_free.
|
||||
IKA_API struct IkarusProperty * ikarus_property_copy(
|
||||
struct IkarusProperty * property,
|
||||
struct IkarusPropertySource * source,
|
||||
struct IkarusPropertyFolder * parent_folder,
|
||||
size_t position,
|
||||
char const * name
|
||||
struct IkarusProperty * property, struct IkarusPropertySource * source, char const * name
|
||||
);
|
||||
|
||||
/// \brief Deletes a property.
|
||||
|
|
@ -119,20 +104,6 @@ IKA_API void ikarus_property_delete(struct IkarusProperty * property);
|
|||
/// \return The project of the property or null if an error occurs.
|
||||
IKA_API struct IkarusProject * ikarus_property_get_project(IkarusProperty const * property);
|
||||
|
||||
/// \brief Gets the parent folder of a property.
|
||||
/// \param property The property to get the parent folder of.
|
||||
/// \pre \li Must not be null.
|
||||
/// \pre \li Must exist.
|
||||
/// \return The parent folder of the property or null if an error occurs.
|
||||
IKA_API struct IkarusPropertyFolder * ikarus_property_get_parent(IkarusProperty const * property);
|
||||
|
||||
/// \brief Gets the position of a property within its parent folder.
|
||||
/// \param property The property to get the position of.
|
||||
/// \pre \li Must not be null.
|
||||
/// \pre \li Must exist.
|
||||
/// \return The position of the property or undefined if an error occurs.
|
||||
IKA_API size_t ikarus_property_get_position(IkarusProperty const * property);
|
||||
|
||||
/// \brief Gets the name of a property.
|
||||
/// \param property The property to get the name of.
|
||||
/// \pre \li Must not be null.
|
||||
|
|
@ -165,29 +136,6 @@ IKA_API struct IkarusPropertySource * ikarus_property_get_source(IkarusProperty
|
|||
/// \remark Must be freed using #ikarus_free.
|
||||
IKA_API struct IkarusValue * ikarus_property_get_default_value(IkarusProperty const * property);
|
||||
|
||||
/// \brief Sets the parent folder of a property.
|
||||
/// \param property The property to set the parent folder of.
|
||||
/// \pre \li Must not be null.
|
||||
/// \pre \li Must exist.
|
||||
/// \param new_parent The new parent folder of the property.
|
||||
/// \pre \li Must not be null.
|
||||
/// \pre \li Must exist.
|
||||
/// \param new_position The new position of the property in the parent folder. \see #FolderPosition
|
||||
/// \pre \li Must be within bounds for the parent folder.
|
||||
/// \remark This adjusts the positions of old and new siblings.
|
||||
IKA_API void ikarus_property_set_parent(
|
||||
IkarusProperty * property, struct IkarusPropertyFolder * new_parent, size_t new_position
|
||||
);
|
||||
|
||||
/// \brief Sets the position of a property within its parent folder.
|
||||
/// \param property The property to set the position of.
|
||||
/// \pre \li Must not be null.
|
||||
/// \pre \li Must exist.
|
||||
/// \param new_position The new position of the property. \see #FolderPosition
|
||||
/// \pre \li Must be within bounds for the parent folder.
|
||||
/// \remark This adjusts the positions of siblings.
|
||||
IKA_API void ikarus_property_set_position(IkarusProperty * property, size_t new_position);
|
||||
|
||||
/// \brief Sets the name of a property.
|
||||
/// \param property The property to set the name of.
|
||||
/// \pre \li Must not be null.
|
||||
|
|
@ -208,11 +156,6 @@ IKA_API void ikarus_property_set_type_info(
|
|||
IkarusProperty * property, struct IkarusPropertyTypeInfo new_type_info, bool attempt_conversion
|
||||
);
|
||||
|
||||
/// \brief Converts a property to an object.
|
||||
/// \param property The property to convert.
|
||||
/// \return The constructed object, representing the property.
|
||||
IKA_API struct IkarusObject * ikarus_property_to_object(IkarusProperty const * property);
|
||||
|
||||
/// \brief Compares two properties.
|
||||
/// \param left The left property to compare.
|
||||
/// \pre \li Must not be null.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue