diff options
Diffstat (limited to 'adw/include/adwaitamm/toastoverlay.hpp')
| -rw-r--r-- | adw/include/adwaitamm/toastoverlay.hpp | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/adw/include/adwaitamm/toastoverlay.hpp b/adw/include/adwaitamm/toastoverlay.hpp new file mode 100644 index 0000000..0ae8bcb --- /dev/null +++ b/adw/include/adwaitamm/toastoverlay.hpp @@ -0,0 +1,77 @@ +#ifndef LIBADWAITAMM_TOASTOVERLAY_HPP +#define LIBADWAITAMM_TOASTOVERLAY_HPP + +#include "adwaitamm/helpers/gobj_mixin.hpp" +#include "adwaitamm/helpers/properties.hpp" + +#include <glibmm/class.h> +#include <glibmm/object.h> +#include <glibmm/objectbase.h> +#include <glibmm/refptr.h> + +#include <gtkmm/widget.h> + +#include <glib-object.h> + +#define _ADWAITA_INSIDE +#include <adw-toast-overlay.h> +#undef _ADWAITA_INSIDE + +namespace turns::adw +{ + struct ToastOverlay final : Gtk::Widget, + helpers::gobj_mixin<ToastOverlay, AdwToastOverlay> + { + struct Class : Glib::Class + { + using BaseClassParent = GtkWidgetClass; + using BaseClassType = AdwToastOverlayClass; + using BaseObjectType = AdwToastOverlay; + using CppClassParent = struct Gtk::Widget_Class; + using CppObjectType = ToastOverlay; + + 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; + + explicit ToastOverlay(); + ToastOverlay(ToastOverlay const & other) = delete; + ToastOverlay(ToastOverlay && other) noexcept = default; + + auto operator=(ToastOverlay const & other) noexcept -> ToastOverlay & = delete; + auto operator=(ToastOverlay && other) noexcept -> ToastOverlay & = default; + + auto static get_type() -> GType; + auto static get_base_type() -> GType; + + auto add(Glib::RefPtr<struct Toast> const & toast) -> void; + + auto property_child(this auto && self); + + protected: + explicit ToastOverlay(Glib::ConstructParams const & params); + explicit ToastOverlay(BaseObjectType * gobj); + }; + + auto ToastOverlay::property_child(this auto && self) + { + return helpers::make_property_proxy<Gtk::Widget *>(self, "child"); + } + +} // namespace turns::adw + +namespace Glib +{ + auto wrap(AdwToastOverlay * object, bool copy = false) -> turns::adw::ToastOverlay *; +} // namespace Glib + +#endif
\ No newline at end of file |
