From 0840ff9a28e627351a520437ec83902d88310fe5 Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Thu, 15 Aug 2024 11:25:30 +0200 Subject: adw: add Toast and ToastOverlay classes --- include/turns/adw/toastoverlay.hpp | 64 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 include/turns/adw/toastoverlay.hpp (limited to 'include/turns/adw/toastoverlay.hpp') diff --git a/include/turns/adw/toastoverlay.hpp b/include/turns/adw/toastoverlay.hpp new file mode 100644 index 0000000..bd5402f --- /dev/null +++ b/include/turns/adw/toastoverlay.hpp @@ -0,0 +1,64 @@ +#ifndef TURNS_ADW_TOASTOVERLAY_HPP +#define TURNS_ADW_TOASTOVERLAY_HPP + +#include "turns/adw/helpers/gobj_cast.hpp" +#include "turns/adw/helpers/properties.hpp" + +#include + +#include + +using AdwToastOverlay = struct _AdwToastOverlay; + +namespace turns::adw +{ + struct ToastOverlay_Class; + + struct Toast; + + struct ToastOverlay : Gtk::Widget, + helpers::gobj_mixin + { + using helpers::gobj_mixin::gobj; + using helpers::gobj_mixin::gobj_copy; + + ToastOverlay(ToastOverlay && other) noexcept = default; + auto operator=(ToastOverlay && other) noexcept -> ToastOverlay & = default; + + ToastOverlay(ToastOverlay const & other) = delete; + auto operator=(ToastOverlay const & other) noexcept -> ToastOverlay & = delete; + + explicit ToastOverlay(); + + auto static get_type() -> GType; + auto static get_base_type() -> GType; + + auto add(Toast && toast) -> void; + + // clang-format off + template auto property_child(this Self && self); + // clang-format on + + protected: + explicit ToastOverlay(Glib::ConstructParams const & params); + explicit ToastOverlay(AdwToastOverlay * gobj); + + private: + friend ToastOverlay_Class; + static ToastOverlay_Class s_class; + }; + + template + auto ToastOverlay::property_child(this Self && self) + { + return helpers::make_property_proxy(self, "child"); + } + +} // namespace turns::adw + +namespace Glib +{ + auto wrap(AdwToastOverlay * object, bool copy = false) -> Glib::RefPtr; +} // namespace Glib + +#endif \ No newline at end of file -- cgit v1.2.3