diff options
| author | Felix Morgner <felix.morgner@gmail.com> | 2025-04-03 18:41:43 +0200 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@gmail.com> | 2025-04-03 18:41:43 +0200 |
| commit | ee599d7d62c16bb59603bedb62f03c01504a1893 (patch) | |
| tree | 8e371a4d211d56ea42b648c7cd1758568b27858b /adw/include/adwaitamm/application.hpp | |
| parent | 6ff0bb23a71f334fe0ca86581cc86aaab2882003 (diff) | |
| download | turns-ee599d7d62c16bb59603bedb62f03c01504a1893.tar.xz turns-ee599d7d62c16bb59603bedb62f03c01504a1893.zip | |
adw: prepare files for extraction
Diffstat (limited to 'adw/include/adwaitamm/application.hpp')
| -rw-r--r-- | adw/include/adwaitamm/application.hpp | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/adw/include/adwaitamm/application.hpp b/adw/include/adwaitamm/application.hpp new file mode 100644 index 0000000..c482b8a --- /dev/null +++ b/adw/include/adwaitamm/application.hpp @@ -0,0 +1,67 @@ +#ifndef LIBADWAITAMM_APPLICATION_HPP +#define LIBADWAITAMM_APPLICATION_HPP + +#include "adwaitamm/helpers/gobj_mixin.hpp" + +#include <glibmm/class.h> +#include <glibmm/refptr.h> +#include <glibmm/ustring.h> + +#include <giomm/application.h> + +#include <gtkmm/application.h> + +using AdwApplication = struct _AdwApplication; +using AdwApplicationClass = struct _AdwApplicationClass; + +namespace turns::adw +{ + 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 helpers::gobj_mixin<CppObjectType, BaseObjectType>::gobj; + using helpers::gobj_mixin<CppObjectType, BaseObjectType>::gobj_copy; + + Application(Application const & other) = delete; + Application(Application && other) noexcept = default; + + 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 get_type() -> GType; + auto static get_base_type() -> GType; + + protected: + explicit Application(Glib::ConstructParams const & params); + explicit Application(BaseObjectType * gobj); + explicit Application(Glib::ustring const & id = {}, Gio::Application::Flags flags = Gio::Application::Flags::NONE); + }; +} // namespace turns::adw + +namespace Glib +{ + auto wrap(AdwApplication * object, bool copy = false) -> Glib::RefPtr<turns::adw::Application>; +} // namespace Glib + +#endif
\ No newline at end of file |
