diff options
| author | Felix Morgner <felix.morgner@gmail.com> | 2025-04-24 20:12:26 +0200 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@gmail.com> | 2025-04-25 07:43:33 +0200 |
| commit | 95dc7e43a23300b3eacbb7e1e0a9d4f31a8bd5a0 (patch) | |
| tree | 9fedc2fef0f5459f3df38c91f3b6366ffb9d48b3 /adw/include/adwaitamm/application.hpp | |
| parent | 48eb849abde6c9af75c015a9721c9b337f3a5fd9 (diff) | |
| download | turns-95dc7e43a23300b3eacbb7e1e0a9d4f31a8bd5a0.tar.xz turns-95dc7e43a23300b3eacbb7e1e0a9d4f31a8bd5a0.zip | |
adw: extract class definitions
Diffstat (limited to 'adw/include/adwaitamm/application.hpp')
| -rw-r--r-- | adw/include/adwaitamm/application.hpp | 35 |
1 files changed, 14 insertions, 21 deletions
diff --git a/adw/include/adwaitamm/application.hpp b/adw/include/adwaitamm/application.hpp index 5242d50..0cbc24f 100644 --- a/adw/include/adwaitamm/application.hpp +++ b/adw/include/adwaitamm/application.hpp @@ -4,6 +4,7 @@ #include "adwaitamm/helpers/gobj_mixin.hpp" #include <glibmm/class.h> +#include <glibmm/object.h> #include <glibmm/refptr.h> #include <glibmm/ustring.h> @@ -11,31 +12,21 @@ #include <gtkmm/application.h> -using AdwApplication = struct _AdwApplication; -using AdwApplicationClass = struct _AdwApplicationClass; +#include <glib-object.h> + +#define _ADWAITA_INSIDE +#include <adw-application.h> +#undef _ADWAITA_INSIDE namespace Adwaita { struct Application : Gtk::Application, helpers::gobj_mixin<Application, AdwApplication> { - struct Class : Glib::Class - { - using BaseClassParent = GtkApplicationClass; - using BaseClassType = AdwApplicationClass; - using BaseObjectType = AdwApplication; - using CppClassParent = struct Gtk::Application_Class; - using CppObjectType = Application; - - 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 = AdwApplication; + using BaseClassType = AdwApplicationClass; + using CppObjectType = Application; + using CppClassType = struct Application_Class; using helpers::gobj_mixin<CppObjectType, BaseObjectType>::gobj; using helpers::gobj_mixin<CppObjectType, BaseObjectType>::gobj_copy; @@ -46,13 +37,15 @@ namespace Adwaita auto operator=(Application const & other) noexcept -> Application & = delete; auto operator=(Application && other) noexcept -> Application & = default; - auto static create(Glib::ustring const & id = {}, - Gio::Application::Flags flags = Gio::Application::Flags::NONE) -> Glib::RefPtr<Application>; + auto static create(Glib::ustring const & id = {}, Gio::Application::Flags flags = Gio::Application::Flags::NONE) + -> Glib::RefPtr<Application>; auto static get_type() -> GType; auto static get_base_type() -> GType; protected: + friend Application_Class; + explicit Application(Glib::ConstructParams const & params); explicit Application(BaseObjectType * gobj); explicit Application(Glib::ustring const & id = {}, Gio::Application::Flags flags = Gio::Application::Flags::NONE); |
