libikarus/src/objects/properties/toggle_property.cpp
Folling c65211e4ff
add default values as param to property_create funcs
Signed-off-by: Folling <mail@folling.io>
2025-01-01 14:07:47 +01:00

34 lines
1.2 KiB
C++

#include "toggle_property.hpp"
#include <cppbase/result.hpp>
#include <ikarus/objects/properties/property.h>
#include <objects/properties/property_source.hpp>
#include <objects/properties/util.hpp>
#include <values/value.hpp>
IkarusToggleProperty::IkarusToggleProperty(IkarusProject * project, IkarusId id):
IkarusProperty{project, id, this} {}
IkarusToggleProperty * ikarus_toggle_property_create(
struct IkarusProject * project,
char const * name,
struct IkarusPropertySource * property_source,
struct IkarusToggleValue * default_value,
IkarusErrorData * error_out
) {
return ikarus::util::create_property<IkarusToggleProperty>(project, name, property_source, default_value, error_out);
}
IkarusToggleValue * ikarus_toggle_property_get_default_value(struct IkarusToggleProperty * property, IkarusErrorData * error_out) {
return ikarus::util::get_default_value<IkarusToggleProperty>(property, error_out);
}
void ikarus_toggle_property_set_default_value(
struct IkarusToggleProperty * property,
struct IkarusToggleValue * new_default_value,
IkarusErrorData * error_out
) {
ikarus::util::set_default_value<IkarusToggleProperty>(property, new_default_value, error_out);
}