#include "adwaitamm/toastoverlay.hpp" #include "adwaitamm/private/toastoverlay_p.hpp" #include "adwaitamm/toast.hpp" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include namespace Adwaita { namespace { auto constinit _class = ToastOverlay_Class{}; } // namespace auto ToastOverlay::get_type() -> GType { return _class.init().get_type(); } auto ToastOverlay::get_base_type() -> GType { return adw_toast_overlay_get_type(); } auto ToastOverlay::add_toast(Toast & toast) -> void { // Take a copy since the overlay will take ownership of the toast. adw_toast_overlay_add_toast(Glib::unwrap(this), Glib::unwrap_copy(toast)); } auto ToastOverlay::dismiss_all() -> void { adw_toast_overlay_dismiss_all(unwrap(this)); } auto ToastOverlay::get_child() const -> Gtk::Widget * { return Glib::wrap(adw_toast_overlay_get_child(const_cast(unwrap(this)))); } auto ToastOverlay::set_child(Gtk::Widget & value) -> void { adw_toast_overlay_set_child(unwrap(this), unwrap(&value)); } auto ToastOverlay::property_child() -> Glib::PropertyProxy { return Glib::PropertyProxy{this, "child"}; } auto ToastOverlay::property_child() const -> Glib::PropertyProxy_ReadOnly { return Glib::PropertyProxy_ReadOnly{this, "child"}; } ToastOverlay::ToastOverlay(Glib::ConstructParams const & params) : Gtk::Widget{params} { } ToastOverlay::ToastOverlay(BaseObjectType * gobj) : Gtk::Widget((GtkWidget *)gobj) { } ToastOverlay::ToastOverlay() : Glib::ObjectBase{nullptr} , Gtk::Widget{Glib::ConstructParams{_class.init()}} { } } // namespace Adwaita namespace Glib { auto wrap(AdwToastOverlay * object, bool copy) -> Adwaita::ToastOverlay * { return dynamic_cast(Glib::wrap_auto(G_OBJECT(object), copy)); } } // namespace Glib