blob: 4f8d28a19d235cfc7ca02503678856ab36ea5379 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
|
#include "turns/adw/toast.hpp"
#include <glibmm/class.h>
#include <glibmm/object.h>
#include <glibmm/objectbase.h>
#include <glibmm/private/object_p.h>
#include <glibmm/propertyproxy.h>
#include <glibmm/refptr.h>
#include <glibmm/ustring.h>
#include <glibmm/utility.h>
#include <glibmm/variant.h>
#include <gtkmm/widget.h>
#include <adwaita.h>
#include <gio/gio.h>
#include <glib-object.h>
namespace turns::adw
{
static_assert(static_cast<int>(Toast::Priority::NORMAL) == ADW_TOAST_PRIORITY_NORMAL);
static_assert(static_cast<int>(Toast::Priority::HIGH) == ADW_TOAST_PRIORITY_HIGH);
struct Toast_Class : Glib::Class
{
auto init() -> Glib::Class const &;
auto static class_init_function(void * gclass, void * data) -> void;
auto static wrap_new(GObject * object) -> Glib::ObjectBase *;
};
auto Toast_Class::init() -> Glib::Class const &
{
if (!gtype_)
{
gtype_ = adw_toast_get_type();
}
return *this;
}
auto Toast_Class::wrap_new(GObject * object) -> Glib::ObjectBase *
{
return new Toast(ADW_TOAST(object));
}
Toast_Class Toast::s_class{};
Toast::Toast(Glib::ustring const & title)
: Glib::ObjectBase{nullptr}
, Glib::Object{Glib::ConstructParams{s_class.init(), "title", Glib::c_str_or_nullptr(title), nullptr}}
{
}
auto Toast::get_type() -> GType
{
return s_class.init().get_type();
}
auto Toast::get_base_type() -> GType
{
return adw_toast_get_type();
}
auto Toast::dismiss() -> void
{
return adw_toast_dismiss(gobj());
}
Toast::Toast(Glib::ConstructParams const & params)
: Glib::Object{params}
{
}
Toast::Toast(AdwToast * gobj)
: Glib::ObjectBase{nullptr}
, Glib::Object((GObject *)gobj)
{
}
} // namespace turns::adw
namespace Glib
{
auto wrap(AdwToast * object, bool copy) -> Glib::RefPtr<turns::adw::Toast>
{
return Glib::make_refptr_for_instance<turns::adw::Toast>(dynamic_cast<turns::adw::Toast *>(Glib::wrap_auto(G_OBJECT(object), copy)));
}
} // namespace Glib
|