From 95dc7e43a23300b3eacbb7e1e0a9d4f31a8bd5a0 Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Thu, 24 Apr 2025 20:12:26 +0200 Subject: adw: extract class definitions --- adw/include/adwaitamm/preferencesdialog.hpp | 32 +++++++++-------------------- 1 file changed, 10 insertions(+), 22 deletions(-) (limited to 'adw/include/adwaitamm/preferencesdialog.hpp') diff --git a/adw/include/adwaitamm/preferencesdialog.hpp b/adw/include/adwaitamm/preferencesdialog.hpp index 2beaf64..080651f 100644 --- a/adw/include/adwaitamm/preferencesdialog.hpp +++ b/adw/include/adwaitamm/preferencesdialog.hpp @@ -1,9 +1,9 @@ #ifndef LIBADWAITAMM_PREFERENCES_DIALOG_HPP #define LIBADWAITAMM_PREFERENCES_DIALOG_HPP +#include "adwaitamm/preferencespage.hpp" #include "dialog.hpp" #include "helpers/gobj_mixin.hpp" -#include "adwaitamm/preferencespage.hpp" #include #include @@ -15,33 +15,19 @@ #include -using AdwPreferencesDialog = struct _AdwPreferencesDialog; -using AdwPreferencesDialogClass = struct _AdwPreferencesDialogClass; +#define _ADWAITA_INSIDE +#include +#undef _ADWAITA_INSIDE namespace Adwaita { - struct PreferencesDialog_Class; - struct PreferencesDialog : Dialog, helpers::gobj_mixin { - struct Class : Glib::Class - { - using BaseClassParent = AdwDialogClass; - using BaseClassType = AdwPreferencesDialogClass; - using BaseObjectType = AdwPreferencesDialog; - using CppClassParent = Dialog::Class; - using CppObjectType = PreferencesDialog; - - auto init() -> Glib::Class const &; - auto static class_init_function(void * gclass, void * data) -> void; - auto static wrap_new(GObject * object) -> Glib::ObjectBase *; - }; - - using BaseObjectType = Class::BaseObjectType; - using BaseClassType = Class::BaseClassType; - using CppObjectType = Class::CppObjectType; - using CppClassType = Class; + using BaseObjectType = AdwPreferencesDialog; + using BaseClassType = AdwPreferencesDialogClass; + using CppObjectType = PreferencesDialog; + using CppClassType = struct PreferencesDialog_Class; using helpers::gobj_mixin::gobj; using helpers::gobj_mixin::gobj_copy; @@ -60,6 +46,8 @@ namespace Adwaita auto set_visible_page(PreferencesPage & page) -> void; protected: + friend PreferencesDialog_Class; + explicit PreferencesDialog(Glib::ConstructParams const & params); explicit PreferencesDialog(BaseObjectType * gobj); }; -- cgit v1.2.3