libikarus/src/ikarus/objects/properties/toggle_property.cpp
Folling 70820129ae
add flatbuffers support and initial rewrite
Signed-off-by: Folling <mail@folling.io>
2025-04-15 12:08:10 +02:00

32 lines
1.2 KiB
C++

#include "toggle_property.hpp"
#include <cppbase/result.hpp>
#include <ikarus/objects/properties/property.h>
#include <ikarus/objects/properties/property_scope.hpp>
#include <ikarus/objects/properties/util.hpp>
#include <ikarus/values/value.hpp>
IkarusToggleProperty::IkarusToggleProperty(IkarusProject * project, int64_t id):
IkarusProperty{project, id, this} {}
IkarusToggleProperty * ikarus_toggle_property_create(
struct IkarusProject * project,
char const * name,
struct IkarusPropertyScope * property_source,
IkarusErrorData * error_out
) {
return ikarus::util::create_property<IkarusToggleProperty>(project, name, property_source, 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);
}