From 33e61b16363a67a989acce1d3ca375637316b1df Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Sat, 17 Aug 2024 21:01:51 +0200 Subject: app: add skip-defeated preference --- adw/src/switchrow.cpp | 72 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 adw/src/switchrow.cpp (limited to 'adw/src/switchrow.cpp') diff --git a/adw/src/switchrow.cpp b/adw/src/switchrow.cpp new file mode 100644 index 0000000..8e9508d --- /dev/null +++ b/adw/src/switchrow.cpp @@ -0,0 +1,72 @@ +#include "turns/adw/switchrow.hpp" + +#include "turns/adw/actionrow.hpp" + +#include +#include +#include +#include +#include + +#include +#include +#include + +namespace turns::adw +{ + namespace + { + auto constinit _class = SwitchRow::Class{}; + } // namespace + + auto SwitchRow::Class::init() -> Glib::Class const & + { + if (!gtype_) + { + gtype_ = adw_switch_row_get_type(); + } + return *this; + } + + auto SwitchRow::Class::wrap_new(GObject * object) -> Glib::ObjectBase * + { + return new SwitchRow(ADW_SWITCH_ROW(object)); + } + + SwitchRow::SwitchRow() + : Glib::ObjectBase{nullptr} + , adw::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) + : adw::ActionRow{params} + { + } + + SwitchRow::SwitchRow(BaseObjectType * gobj) + : Glib::ObjectBase{nullptr} + , adw::ActionRow(ADW_ACTION_ROW(gobj)) + { + } + +} // namespace turns::adw + +namespace Glib +{ + auto wrap(AdwSwitchRow * object, bool copy) -> Glib::RefPtr + { + return Glib::make_refptr_for_instance( + dynamic_cast(Glib::wrap_auto(G_OBJECT(object), copy))); + } +} // namespace Glib \ No newline at end of file -- cgit v1.2.3