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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
|
/**
* @author Felix Morgner (felix.morgner@gmail.com)
* @copyright Copyright (c) 2025
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#include "adwaitamm/dialog.hpp"
#include "adwaitamm/breakpoint.hpp"
#include "adwaitamm/enums.hpp"
#include "adwaitamm/private/dialog_p.hpp"
#include <glibmm/object.h>
#include <glibmm/objectbase.h>
#include <glibmm/propertyproxy.h>
#include <glibmm/refptr.h>
#include <glibmm/signalproxy.h>
#include <glibmm/ustring.h>
#include <glibmm/utility.h>
#include <glibmm/wrap.h>
#include <gtkmm/widget.h>
#include <glib-object.h>
#include <glib.h>
#include <gtk/gtk.h>
namespace Adwaita
{
namespace
{
auto constinit _class = Dialog_Class{};
namespace property_name
{
auto constexpr can_close = "can-close";
auto constexpr child = "child";
auto constexpr content_height = "content-height";
auto constexpr content_width = "content-width";
auto constexpr current_breakpoint = "current-breakpoint";
auto constexpr default_widget = "default-widget";
auto constexpr focus_widget = "focus-widget";
auto constexpr follows_content_size = "follows_content_size";
auto constexpr presentation_mode = "presentation_mode";
auto constexpr title = "title";
} // namespace property_name
namespace signal_info
{
auto const close_attempt = Glib::SignalProxyInfo{
"close-attempt",
reinterpret_cast<GCallback>(&Glib::SignalProxyNormal::slot0_void_callback),
reinterpret_cast<GCallback>(&Glib::SignalProxyNormal::slot0_void_callback),
};
auto const closed = Glib::SignalProxyInfo{
"closed",
reinterpret_cast<GCallback>(&Glib::SignalProxyNormal::slot0_void_callback),
reinterpret_cast<GCallback>(&Glib::SignalProxyNormal::slot0_void_callback),
};
} // namespace signal_info
} // namespace
auto Dialog::get_type() -> GType
{
return _class.init().get_type();
}
auto Dialog::get_base_type() -> GType
{
return adw_dialog_get_type();
}
Dialog::Dialog(Glib::ConstructParams const & params)
: Gtk::Widget{params}
{
}
Dialog::Dialog(AdwDialog * gobj)
: Gtk::Widget(GTK_WIDGET(gobj))
{
}
Dialog::Dialog()
: Glib::ObjectBase{nullptr}
, Gtk::Widget{Glib::ConstructParams{_class.init()}}
{
}
auto Dialog::add_breakpoint(Glib::RefPtr<Breakpoint> const & breakpoint) -> void
{
// Take a copy because the dialog will take ownership of the breakpoint.
adw_dialog_add_breakpoint(unwrap(this), Glib::unwrap_copy(breakpoint));
}
auto Dialog::close() -> void
{
adw_dialog_close(unwrap(this));
}
auto Dialog::force_close() -> void
{
adw_dialog_force_close(unwrap(this));
}
auto Dialog::present(Gtk::Widget * parent) -> void
{
adw_dialog_present(unwrap(this), Glib::unwrap(parent));
}
auto Dialog::get_can_close() const -> bool
{
return adw_dialog_get_can_close(const_cast<BaseObjectType *>(unwrap(this)));
}
auto Dialog::get_child() const -> Gtk::Widget *
{
return Glib::wrap(adw_dialog_get_child(const_cast<BaseObjectType *>(unwrap(this))), true);
}
auto Dialog::get_content_height() const -> int
{
return adw_dialog_get_content_height(const_cast<BaseObjectType *>(unwrap(this)));
}
auto Dialog::get_content_width() const -> int
{
return adw_dialog_get_content_width(const_cast<BaseObjectType *>(unwrap(this)));
}
auto Dialog::get_current_breakpoint() const -> Glib::RefPtr<Breakpoint>
{
return Glib::wrap(adw_dialog_get_current_breakpoint(const_cast<BaseObjectType *>(unwrap(this))), true);
}
auto Dialog::get_default_widget() const -> Gtk::Widget *
{
return Glib::wrap(adw_dialog_get_default_widget(const_cast<BaseObjectType *>(unwrap(this))));
}
auto Dialog::get_focus() const -> Gtk::Widget *
{
return Glib::wrap(adw_dialog_get_focus(const_cast<BaseObjectType *>(unwrap(this))));
}
auto Dialog::get_follows_content_size() const -> bool
{
return adw_dialog_get_follows_content_size(const_cast<BaseObjectType *>(unwrap(this)));
}
auto Dialog::get_presentation_mode() const -> PresentationMode
{
return static_cast<PresentationMode>(adw_dialog_get_presentation_mode(const_cast<BaseObjectType *>(unwrap(this))));
}
auto Dialog::get_title() const -> Glib::ustring
{
return adw_dialog_get_title(const_cast<BaseObjectType *>(unwrap(this)));
}
auto Dialog::set_can_close(bool value) -> void
{
return adw_dialog_set_can_close(unwrap(this), static_cast<gboolean>(value));
}
auto Dialog::set_child(Gtk::Widget & value) -> void
{
return adw_dialog_set_child(unwrap(this), unwrap(&value));
}
auto Dialog::set_content_height(int value) -> void
{
return adw_dialog_set_content_height(unwrap(this), value);
}
auto Dialog::set_content_width(int value) -> void
{
return adw_dialog_set_content_width(unwrap(this), value);
}
auto Dialog::set_default_widget(Gtk::Widget & value) -> void
{
return adw_dialog_set_default_widget(unwrap(this), unwrap(&value));
}
auto Dialog::set_focus(Gtk::Widget & value) -> void
{
return adw_dialog_set_focus(unwrap(this), unwrap(&value));
}
auto Dialog::set_follows_content_size(bool value) -> void
{
return adw_dialog_set_follows_content_size(unwrap(this), value);
}
auto Dialog::set_presentation_mode(PresentationMode value) -> void
{
return adw_dialog_set_presentation_mode(unwrap(this), static_cast<AdwDialogPresentationMode>(value));
}
auto Dialog::set_title(Glib::ustring const & str) -> void
{
return adw_dialog_set_title(unwrap(this), Glib::c_str_or_nullptr(str));
}
auto Dialog::property_can_close() -> Glib::PropertyProxy<bool>
{
return {this, property_name::can_close};
}
auto Dialog::property_can_close() const -> Glib::PropertyProxy_ReadOnly<bool>
{
return {this, property_name::can_close};
}
auto Dialog::property_child() -> Glib::PropertyProxy<Gtk::Widget *>
{
return {this, property_name::child};
}
auto Dialog::property_child() const -> Glib::PropertyProxy_ReadOnly<Gtk::Widget *>
{
return {this, property_name::child};
}
auto Dialog::property_content_height() -> Glib::PropertyProxy<int>
{
return {this, property_name::content_height};
}
auto Dialog::property_content_height() const -> Glib::PropertyProxy_ReadOnly<int>
{
return {this, property_name::content_height};
}
auto Dialog::property_content_width() -> Glib::PropertyProxy<int>
{
return {this, property_name::content_width};
}
auto Dialog::property_content_width() const -> Glib::PropertyProxy_ReadOnly<int>
{
return {this, property_name::content_width};
}
auto Dialog::property_current_breakpoint() const -> Glib::PropertyProxy_ReadOnly<Glib::RefPtr<Breakpoint>>
{
return {this, property_name::current_breakpoint};
}
auto Dialog::property_default_widget() -> Glib::PropertyProxy<Gtk::Widget *>
{
return {this, property_name::default_widget};
}
auto Dialog::property_default_widget() const -> Glib::PropertyProxy_ReadOnly<Gtk::Widget *>
{
return {this, property_name::default_widget};
}
auto Dialog::property_focus_widget() -> Glib::PropertyProxy<Gtk::Widget *>
{
return {this, property_name::focus_widget};
}
|