#include "adwaitamm/preferencesdialog.hpp" #include "adwaitamm/dialog.hpp" #include "adwaitamm/preferencespage.hpp" #include #include #include #include #include #include #include #include #include #include #include #include #include #include namespace Adwaita { namespace { auto constinit _class = PreferencesDialog::Class{}; } // namespace auto PreferencesDialog::Class::init() -> Glib::Class const & { if (!gtype_) { class_init_func_ = &class_init_function; register_derived_type(adw_preferences_dialog_get_type()); } return *this; } auto PreferencesDialog::Class::class_init_function(void * gclass, void * data) -> void { auto const klass = static_cast(gclass); CppClassParent::class_init_function(klass, data); } auto PreferencesDialog::Class::wrap_new(GObject * object) -> Glib::ObjectBase * { return Gtk::manage(new PreferencesDialog(ADW_PREFERENCES_DIALOG(object))); } auto PreferencesDialog::get_type() -> GType { return _class.init().get_type(); } auto PreferencesDialog::get_base_type() -> GType { return adw_dialog_get_type(); } PreferencesDialog::PreferencesDialog(Glib::ConstructParams const & params) : Dialog{params} { } PreferencesDialog::PreferencesDialog(AdwPreferencesDialog * gobj) : Dialog(ADW_DIALOG(gobj)) { } PreferencesDialog::PreferencesDialog() : Glib::ObjectBase{nullptr} , Dialog{Glib::ConstructParams{_class.init()}} { } auto PreferencesDialog::add(PreferencesPage & page) -> void { adw_preferences_dialog_add(Glib::unwrap(this), Glib::unwrap(&page)); } auto PreferencesDialog::set_visible_page(PreferencesPage & page) -> void { adw_preferences_dialog_set_visible_page(unwrap(this), Glib::unwrap(&page)); } } // namespace Adwaita namespace Glib { auto wrap(AdwPreferencesDialog * object, bool copy) -> Adwaita::PreferencesDialog * { return dynamic_cast(Glib::wrap_auto(G_OBJECT(object), copy)); } } // namespace Glib