From c61998283c8436dd4360e35ce10c309e7d3ee723 Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Thu, 25 Jul 2024 13:05:02 +0200 Subject: adw: add bare bones wrapper for AdwApplication --- adw/include/turns/adw/application.hpp | 55 +++++++++++++++++++++++++++++++++++ adw/include/turns/adw/wrap_init.hpp | 9 ++++++ 2 files changed, 64 insertions(+) create mode 100644 adw/include/turns/adw/application.hpp create mode 100644 adw/include/turns/adw/wrap_init.hpp (limited to 'adw/include/turns') diff --git a/adw/include/turns/adw/application.hpp b/adw/include/turns/adw/application.hpp new file mode 100644 index 0000000..26bec41 --- /dev/null +++ b/adw/include/turns/adw/application.hpp @@ -0,0 +1,55 @@ +#ifndef TURNS_ADW_APPLICATION_HPP +#define TURNS_ADW_APPLICATION_HPP + +#include +#include + +#include + +#include + +using AdwApplication = struct _AdwApplication; + +namespace turns::adw +{ + struct Application_Class; + + struct Application : Gtk::Application + { + Application(Application && other) noexcept = default; + auto operator=(Application && other) noexcept -> Application & = default; + + Application(Application const & other) = delete; + auto operator=(Application const & other) noexcept -> Application & = delete; + + auto static get_type() -> GType; + auto static get_base_type() -> GType; + + template + auto gobj(this Self && self) noexcept + { + return reinterpret_cast(self.gobject_); + } + + auto gobj_copy() -> AdwApplication *; + + auto static create(Glib::ustring const & id = {}, + Gio::Application::Flags flags = Gio::Application::Flags::NONE) -> Glib::RefPtr; + + protected: + explicit Application(Glib::ConstructParams const & params); + explicit Application(AdwApplication * gobj); + explicit Application(Glib::ustring const & id = {}, Gio::Application::Flags flags = Gio::Application::Flags::NONE); + + private: + friend Application_Class; + static Application_Class s_class; + }; +} // namespace turns::adw + +namespace Glib +{ + auto wrap(AdwApplication * object, bool copy = false) -> Glib::RefPtr; +} // namespace Glib + +#endif \ No newline at end of file diff --git a/adw/include/turns/adw/wrap_init.hpp b/adw/include/turns/adw/wrap_init.hpp new file mode 100644 index 0000000..5096736 --- /dev/null +++ b/adw/include/turns/adw/wrap_init.hpp @@ -0,0 +1,9 @@ +#ifndef TURNS_ADW_WRAP_INIT_HPP +#define TURNS_ADW_WRAP_INIT_HPP + +namespace turns::adw +{ + auto wrap_init() -> void; +} // namespace turns::adw + +#endif \ No newline at end of file -- cgit v1.2.3