/** * @author Felix Morgner (felix.morgner@gmail.com) * @copyright Copyright (c) 2025 * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "adwaitamm/switchrow.hpp" #include "adwaitamm/actionrow.hpp" #include "adwaitamm/private/switchrow_p.hpp" #include #include #include #include #include namespace Adwaita { namespace { auto constinit _class = SwitchRow_Class{}; } // namespace SwitchRow::SwitchRow() : Glib::ObjectBase{nullptr} , ActionRow{Glib::ConstructParams{_class.init()}} { } auto SwitchRow::get_type() -> GType { return _class.init().get_type(); } auto SwitchRow::get_base_type() -> GType { return adw_switch_row_get_type(); } SwitchRow::SwitchRow(Glib::ConstructParams const & params) : ActionRow{params} { } SwitchRow::SwitchRow(BaseObjectType * gobj) : ActionRow(ADW_ACTION_ROW(gobj)) { } auto SwitchRow::get_active() const noexcept -> bool { return adw_switch_row_get_active(const_cast(unwrap(this))); } auto SwitchRow::set_active(bool value) noexcept -> void { adw_switch_row_set_active(unwrap(this), value); } auto SwitchRow::property_active() -> Glib::PropertyProxy { return Glib::PropertyProxy{this, "active"}; } auto SwitchRow::property_active() const -> Glib::PropertyProxy_ReadOnly { return Glib::PropertyProxy_ReadOnly{this, "active"}; } } // namespace Adwaita namespace Glib { auto wrap(AdwSwitchRow * object, bool copy) -> Adwaita::SwitchRow * { return dynamic_cast(Glib::wrap_auto(G_OBJECT(object), copy)); } } // namespace Glib