#include "turnsmm/turn-order.hpp" #include "turns-turn-order.h" #include "turnsmm/enum_helpers.hpp" #include "turnsmm/participant.hpp" #include "turnsmm/private/turn-order_p.hpp" #include #include #include #include #include #include #include #include #include #include #include namespace Turns { namespace { auto constinit _class = TurnOrder_Class{}; } // namespace auto TurnOrder_Class::init() -> Glib::Class const & { if (!gtype_) { class_init_func_ = &class_init_function; gtype_ = turns_turn_order_get_type(); } return *this; } auto TurnOrder_Class::class_init_function(void * gclass, void * data) -> void { auto const klass = static_cast(gclass); CppClassParent::class_init_function(klass, data); } auto TurnOrder_Class::wrap_new(GObject * object) -> Glib::ObjectBase * { return new TurnOrder(TURNS_TURN_ORDER(object)); } auto TurnOrder::get_base_type() -> GType { return turns_turn_order_get_type(); } auto TurnOrder::get_type() -> GType { return _class.init().get_type(); } TurnOrder::TurnOrder() : Glib::ObjectBase{nullptr} , Glib::Object{Glib::ConstructParams{_class.init()}} { static_assert(enum_matches); static_assert(enum_matches); } auto TurnOrder::gobj() noexcept -> BaseObjectType * { return std::bit_cast(gobject_); } auto TurnOrder::gobj() const -> BaseObjectType const * { return std::bit_cast(gobject_); } auto TurnOrder::gobj_copy() noexcept -> BaseObjectType * { reference(); return gobj(); } auto TurnOrder::add(Glib::RefPtr const & participant) noexcept -> void { return turns_turn_order_add(unwrap(this), unwrap(participant)); } auto TurnOrder::get_participant_count() const noexcept -> std::size_t { return turns_turn_order_get_participant_count(unwrap(this)); } auto TurnOrder::get_running() const noexcept -> bool { return turns_turn_order_get_running(unwrap(this)); } auto TurnOrder::property_running() const noexcept -> Glib::PropertyProxy_ReadOnly { return {this, "running"}; } auto TurnOrder::get_sort_mode() const noexcept -> SortMode { return static_cast(turns_turn_order_get_sort_mode(unwrap(this))); } auto TurnOrder::set_sort_mode(SortMode value) noexcept -> void { turns_turn_order_set_sort_mode(unwrap(this), static_cast(value)); } auto TurnOrder::property_sort_mode() noexcept -> Glib::PropertyProxy { return {this, "sort_mode"}; } auto TurnOrder::property_sort_mode() const noexcept -> Glib::PropertyProxy_ReadOnly { return {this, "sort_mode"}; } TurnOrder::TurnOrder(BaseObjectType * gobj) : Glib::Object(G_OBJECT(gobj)) { } } // namespace Turns namespace Glib { auto Value::value_type() -> GType { return turns_turn_order_sort_mode_get_type(); } auto wrap(TurnsTurnOrder * object, bool copy) -> Glib::RefPtr { return Glib::make_refptr_for_instance(dynamic_cast(Glib::wrap_auto(G_OBJECT(object), copy))); } } // namespace Glib