summaryrefslogtreecommitdiff
path: root/adw/src/preferencesdialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'adw/src/preferencesdialog.cpp')
-rw-r--r--adw/src/preferencesdialog.cpp91
1 files changed, 91 insertions, 0 deletions
diff --git a/adw/src/preferencesdialog.cpp b/adw/src/preferencesdialog.cpp
new file mode 100644
index 0000000..b18c0e6
--- /dev/null
+++ b/adw/src/preferencesdialog.cpp
@@ -0,0 +1,91 @@
+#include "turns/adw/preferencesdialog.hpp"
+
+#include "turns/adw/dialog.hpp"
+#include "turns/adw/preferencespage.hpp"
+
+#include <glibmm/class.h>
+#include <glibmm/object.h>
+#include <glibmm/objectbase.h>
+#include <glibmm/refptr.h>
+#include <glibmm/ustring.h>
+#include <glibmm/utility.h>
+#include <glibmm/wrap.h>
+
+#include <gtkmm/init.h>
+#include <gtkmm/private/widget_p.h>
+#include <gtkmm/widget.h>
+
+#include <adwaita.h>
+#include <glib-object.h>
+#include <gtk/gtk.h>
+
+namespace turns::adw
+{
+ namespace
+ {
+ auto constinit _class = PreferencesDialog::Class{};
+ }
+
+ auto PreferencesDialog::Class::init() -> Glib::Class const &
+ {
+ if (!gtype_)
+ {
+ class_init_func_ = &PreferencesDialog::Class::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<AdwPreferencesDialogClass *>(gclass);
+ Gtk::Widget_Class::class_init_function(klass, data);
+ }
+
+ auto PreferencesDialog::Class::wrap_new(GObject * object) -> Glib::ObjectBase *
+ {
+ return 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)
+ : adw::Dialog{params}
+ {
+ }
+
+ PreferencesDialog::PreferencesDialog(AdwPreferencesDialog * gobj)
+ : Glib::ObjectBase{nullptr}
+ , adw::Dialog(ADW_DIALOG(gobj))
+ {
+ }
+
+ PreferencesDialog::PreferencesDialog()
+ : Glib::ObjectBase{nullptr}
+ , adw::Dialog{Glib::ConstructParams{_class.init()}}
+ {
+ }
+
+ auto PreferencesDialog::add(adw::PreferencesPage & page) -> void
+ {
+ adw_preferences_dialog_add(Glib::unwrap(this), Glib::unwrap(&page));
+ }
+
+} // namespace turns::adw
+
+namespace Glib
+{
+ auto wrap(AdwPreferencesDialog * object, bool copy) -> Glib::RefPtr<turns::adw::PreferencesDialog>
+ {
+ return Glib::make_refptr_for_instance<turns::adw::PreferencesDialog>(
+ dynamic_cast<turns::adw::PreferencesDialog *>(Glib::wrap_auto(G_OBJECT(object), copy)));
+ }
+} // namespace Glib \ No newline at end of file