Debian Codegraph @

gtk/gtknativedialog.c

raw symbols SCIP
1 /* -*- Mode: C; c-file-style: "gnu"; tab-width: 8 -*- */cxx . . $ `<file>/gtk/gtknativedialog.c`/
2 /* GTK - The GIMP Toolkit
3 * gtkfilechoosernative.c: Native File selector dialog
4 * Copyright (C) 2015, Red Hat, Inc.
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20 #include "config.h"cxx . . $ `<file>/build/config.h`/
21
22 #include "gtknativedialogprivate.h"cxx . . $ `<file>/gtk/gtknativedialogprivate.h`/
23
24 #include "gtkprivate.h"cxx . . $ `<file>/gtk/gtkprivate.h`/
25 #include "gtksizerequest.h"cxx . . $ `<file>/gtk/gtksizerequest.h`/
26 #include "gtktypebuiltins.h"cxx . . $ `<file>/build/gtk/gtktypebuiltins.h`/
27 #include "gtksettings.h"cxx . . $ `<file>/gtk/gtksettings.h`/
28 #include "gtktogglebutton.h"cxx . . $ `<file>/gtk/gtktogglebutton.h`/
29 #include "gtkheaderbar.h"cxx . . $ `<file>/gtk/gtkheaderbar.h`/
30 #include "gtklabel.h"cxx . . $ `<file>/gtk/gtklabel.h`/
31
32 /**
33 * GtkNativeDialog:
34 *
35 * Base class for platform dialogs that don't use `GtkDialog`.
36 *
37 * Native dialogs are used in order to integrate better with a platform,
38 * by looking the same as other native applications and supporting
39 * platform specific features.
40 *
41 * The [[email protected]] functions cannot be used on such objects,
42 * but we need a similar API in order to drive them. The `GtkNativeDialog`
43 * object is an API that allows you to do this. It allows you to set
44 * various common properties on the dialog, as well as show and hide
45 * it and get a [[email protected]::response] signal when the user
46 * finished with the dialog.
47 *
48 * Note that unlike `GtkDialog`, `GtkNativeDialog` objects are not
49 * toplevel widgets, and GTK does not keep them alive. It is your
50 * responsibility to keep a reference until you are done with the
51 * object.
52 */
53
54 typedef struct _GtkNativeDialogPrivatecxx . . $ _GtkNativeDialogPrivate# GtkNativeDialogPrivatecxx . . $ GtkNativeDialogPrivate#;
55
56 struct _GtkNativeDialogPrivatecxx . . $ _GtkNativeDialogPrivate#
57 {
58 GtkWindowcxx . . $ GtkWindow# *transient_forcxx . . $ _GtkNativeDialogPrivate#transient_for.;
59 char *titlecxx . . $ _GtkNativeDialogPrivate#title.;
60
61 guintcxx . . $ guint# visiblecxx . . $ _GtkNativeDialogPrivate#visible. : 1;
62 guintcxx . . $ guint# modalcxx . . $ _GtkNativeDialogPrivate#modal. : 1;
63 };
64
65 enumcxx . . $ $anonymous_type_8f9d623bf076860a_0# {
66 PROP_0cxx . . $ PROP_0.,
67 PROP_TITLEcxx . . $ PROP_TITLE.,
68 PROP_VISIBLEcxx . . $ PROP_VISIBLE.,
69 PROP_MODALcxx . . $ PROP_MODAL.,
70 PROP_TRANSIENT_FORcxx . . $ PROP_TRANSIENT_FOR.,
71
72 LAST_ARGcxx . . $ LAST_ARG.,
73 };
74
75 enumcxx . . $ $anonymous_type_8f9d623bf076860a_1# {
76 RESPONSEcxx . . $ RESPONSE.,
77
78 LAST_SIGNALcxx . . $ LAST_SIGNAL.
79 };
80
81 static GParamSpeccxx . . $ GParamSpec# *native_propscxx . . $ native_props.[LAST_ARGcxx . . $ LAST_ARG.] = { NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, };
82 static guintcxx . . $ guint# native_signalscxx . . $ native_signals.[LAST_SIGNALcxx . . $ LAST_SIGNAL.];
83
84 G_DEFINE_ABSTRACT_TYPE_WITH_CODEcxx . . $ `<external>/9567554376676449156/gtype.h:1910:9`! (GtkNativeDialog, gtk_native_dialog, G_TYPE_OBJECTcxx . . $ `<external>/9567554376676449156/gtype.h:189:9`!,
85 G_ADD_PRIVATEcxx . . $ `<external>/9567554376676449156/gtype.h:2194:9`! (GtkNativeDialog))
86
87 static void
88 gtk_native_dialog_set_propertycxx . . $ gtk_native_dialog_set_property(d7c4bb29f36c0dc4). (GObjectcxx . . $ GObject# *object,
89 guintcxx . . $ guint# prop_id,
90 const GValuecxx . . $ GValue# *value,
91 GParamSpeccxx . . $ GParamSpec# *pspec)
92
93 {
94 GtkNativeDialogcxx . . $ GtkNativeDialog# *self = GTK_NATIVE_DIALOGcxx . . $ GTK_NATIVE_DIALOG(1d2b9897278f2b81). (object);
95
96 switch (prop_id)
97 {
98 case PROP_TITLEcxx . . $ PROP_TITLE.:
99 gtk_native_dialog_set_titlecxx . . $ gtk_native_dialog_set_title(75cf34d6919d5770). (self, g_value_get_stringcxx . . $ g_value_get_string(cc0a2be2b8f7bdc8). (value));
100 break;
101
102 case PROP_MODALcxx . . $ PROP_MODAL.:
103 gtk_native_dialog_set_modalcxx . . $ gtk_native_dialog_set_modal(d059f2ad62fa0d2b). (self, g_value_get_booleancxx . . $ g_value_get_boolean(f890c5c75ead5b21). (value));
104 break;
105
106 case PROP_VISIBLEcxx . . $ PROP_VISIBLE.:
107 if (g_value_get_booleancxx . . $ g_value_get_boolean(f890c5c75ead5b21). (value))
108 gtk_native_dialog_showcxx . . $ gtk_native_dialog_show(4e7b09755cef6259). (self);
109 else
110 gtk_native_dialog_hidecxx . . $ gtk_native_dialog_hide(4e7b09755cef6259). (self);
111 break;
112
113 case PROP_TRANSIENT_FORcxx . . $ PROP_TRANSIENT_FOR.:
114 gtk_native_dialog_set_transient_forcxx . . $ gtk_native_dialog_set_transient_for(8ad361b7e26a6e9b). (self, g_value_get_objectcxx . . $ g_value_get_object(e12dff36056c2cce). (value));
115 break;
116
117 default:
118 G_OBJECT_WARN_INVALID_PROPERTY_IDcxx . . $ `<external>/1341695927569185362/gobject.h:690:9`! (object, prop_id, pspec);
119 break;
120 }
121 }
122
123 static void
124 gtk_native_dialog_get_propertycxx . . $ gtk_native_dialog_get_property(cee2c52f22407c66). (GObjectcxx . . $ GObject# *object,
125 guintcxx . . $ guint# prop_id,
126 GValuecxx . . $ GValue# *value,
127 GParamSpeccxx . . $ GParamSpec# *pspec)
128 {
129 GtkNativeDialogcxx . . $ GtkNativeDialog# *self = GTK_NATIVE_DIALOGcxx . . $ GTK_NATIVE_DIALOG(1d2b9897278f2b81). (object);
130 GtkNativeDialogPrivatecxx . . $ GtkNativeDialogPrivate# *priv = gtk_native_dialog_get_instance_privatecxx . . $ gtk_native_dialog_get_instance_private(8c364ba9916905a). (self);
131
132 switch (prop_id)
133 {
134 case PROP_TITLEcxx . . $ PROP_TITLE.:
135 g_value_set_stringcxx . . $ g_value_set_string(65b9ea7708b82b9b). (value, priv->titlecxx . . $ _GtkNativeDialogPrivate#title.);
136 break;
137
138 case PROP_MODALcxx . . $ PROP_MODAL.:
139 g_value_set_booleancxx . . $ g_value_set_boolean(b698c61e8e30c4ea). (value, priv->modalcxx . . $ _GtkNativeDialogPrivate#modal.);
140 break;
141
142 case PROP_VISIBLEcxx . . $ PROP_VISIBLE.:
143 g_value_set_booleancxx . . $ g_value_set_boolean(b698c61e8e30c4ea). (value, priv->visiblecxx . . $ _GtkNativeDialogPrivate#visible.);
144 break;
145
146 case PROP_TRANSIENT_FORcxx . . $ PROP_TRANSIENT_FOR.:
147 g_value_set_objectcxx . . $ g_value_set_object(e945b84c1e9702f). (value, priv->transient_forcxx . . $ _GtkNativeDialogPrivate#transient_for.);
148 break;
149
150 default:
151 G_OBJECT_WARN_INVALID_PROPERTY_IDcxx . . $ `<external>/1341695927569185362/gobject.h:690:9`! (object, prop_id, pspec);
152 break;
153 }
154 }
155
156 static void parent_destroyedcxx . . $ parent_destroyed(3af427408a49af89). (GtkWidgetcxx . . $ GtkWidget# *parent,
157 GtkNativeDialogcxx . . $ GtkNativeDialog# *self);
158
159 static void
160 gtk_native_dialog_disposecxx . . $ gtk_native_dialog_dispose(6087475fa43034d3). (GObjectcxx . . $ GObject# *object)
161 {
162 GtkNativeDialogcxx . . $ GtkNativeDialog# *self = GTK_NATIVE_DIALOGcxx . . $ GTK_NATIVE_DIALOG(1d2b9897278f2b81). (object);
163 GtkNativeDialogPrivatecxx . . $ GtkNativeDialogPrivate# *priv = gtk_native_dialog_get_instance_privatecxx . . $ gtk_native_dialog_get_instance_private(8c364ba9916905a). (self);
164
165 if (priv->transient_forcxx . . $ _GtkNativeDialogPrivate#transient_for.)
166 {
167 g_signal_handlers_disconnect_by_funccxx . . $ `<external>/15952772511652638895/gsignal.h:629:9`! (priv->transient_for, parent_destroyed, self);
168 priv->transient_forcxx . . $ _GtkNativeDialogPrivate#transient_for. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
169 }
170
171 if (priv->visiblecxx . . $ _GtkNativeDialogPrivate#visible.)
172 gtk_native_dialog_hidecxx . . $ gtk_native_dialog_hide(4e7b09755cef6259). (self);
173
174 G_OBJECT_CLASScxx . . $ `<external>/1341695927569185362/gobject.h:61:9`! (gtk_native_dialog_parent_class)->disposecxx . . $ _GObjectClass#dispose. (object);
175 }
176
177 static void
178 gtk_native_dialog_finalizecxx . . $ gtk_native_dialog_finalize(6087475fa43034d3). (GObjectcxx . . $ GObject# *object)
179 {
180 GtkNativeDialogcxx . . $ GtkNativeDialog# *self = GTK_NATIVE_DIALOGcxx . . $ GTK_NATIVE_DIALOG(1d2b9897278f2b81). (object);
181 GtkNativeDialogPrivatecxx . . $ GtkNativeDialogPrivate# *priv = gtk_native_dialog_get_instance_privatecxx . . $ gtk_native_dialog_get_instance_private(8c364ba9916905a). (self);
182
183 g_clear_pointercxx . . $ `<external>/1123956534522462559/gmem.h:135:9`! (&priv->title, g_free);
184 g_clear_objectcxx . . $ `<external>/1341695927569185362/gobject.h:695:9`! (&priv->transient_for);
185
186 G_OBJECT_CLASScxx . . $ `<external>/1341695927569185362/gobject.h:61:9`! (gtk_native_dialog_parent_class)->finalizecxx . . $ _GObjectClass#finalize. (object);
187 }
188
189 static void
190 gtk_native_dialog_class_initcxx . . $ gtk_native_dialog_class_init(4da95e5e0c2d7e77). (GtkNativeDialogClasscxx . . $ GtkNativeDialogClass# *class)
191 {
192 GObjectClasscxx . . $ GObjectClass# *gobject_class = G_OBJECT_CLASScxx . . $ `<external>/1341695927569185362/gobject.h:61:9`! (class);
193
194 gobject_class->set_propertycxx . . $ _GObjectClass#set_property. = gtk_native_dialog_set_propertycxx . . $ gtk_native_dialog_set_property(d7c4bb29f36c0dc4).;
195 gobject_class->get_propertycxx . . $ _GObjectClass#get_property. = gtk_native_dialog_get_propertycxx . . $ gtk_native_dialog_get_property(cee2c52f22407c66).;
196 gobject_class->finalizecxx . . $ _GObjectClass#finalize. = gtk_native_dialog_finalizecxx . . $ gtk_native_dialog_finalize(6087475fa43034d3).;
197 gobject_class->disposecxx . . $ _GObjectClass#dispose. = gtk_native_dialog_disposecxx . . $ gtk_native_dialog_dispose(6087475fa43034d3).;
198
199 /**
200 * GtkNativeDialog:title:
201 *
202 * The title of the dialog window
203 */
204 native_propscxx . . $ native_props.[PROP_TITLEcxx . . $ PROP_TITLE.] =
205 g_param_spec_stringcxx . . $ g_param_spec_string(378e8746be5cd899). ("title", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!,
206 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!,
207 GTK_PARAM_READWRITEcxx . . $ `gtk/gtkprivate.h:44:9`!);
208
209 /**
210 * GtkNativeDialog:modal:
211 *
212 * Whether the window should be modal with respect to its transient parent.
213 */
214 native_propscxx . . $ native_props.[PROP_MODALcxx . . $ PROP_MODAL.] =
215 g_param_spec_booleancxx . . $ g_param_spec_boolean(315d86b79c0116e0). ("modal", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!,
216 FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!,
217 GTK_PARAM_READWRITEcxx . . $ `gtk/gtkprivate.h:44:9`! | G_PARAM_EXPLICIT_NOTIFYcxx . . $ G_PARAM_EXPLICIT_NOTIFY.);
218
219 /**
220 * GtkNativeDialog:visible:
221 *
222 * Whether the window is currently visible.
223 */
224 native_propscxx . . $ native_props.[PROP_VISIBLEcxx . . $ PROP_VISIBLE.] =
225 g_param_spec_booleancxx . . $ g_param_spec_boolean(315d86b79c0116e0). ("visible", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!,
226 FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!,
227 GTK_PARAM_READWRITEcxx . . $ `gtk/gtkprivate.h:44:9`! | G_PARAM_EXPLICIT_NOTIFYcxx . . $ G_PARAM_EXPLICIT_NOTIFY.);
228
229 /**
230 * GtkNativeDialog:transient-for:
231 *
232 * The transient parent of the dialog, or %NULL for none.
233 */
234 native_propscxx . . $ native_props.[PROP_TRANSIENT_FORcxx . . $ PROP_TRANSIENT_FOR.] =
235 g_param_spec_objectcxx . . $ g_param_spec_object(faf99966f027a127). ("transient-for", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!,
236 GTK_TYPE_WINDOWcxx . . $ `gtk/gtkwindow.h:38:9`!,
237 GTK_PARAM_READWRITEcxx . . $ `gtk/gtkprivate.h:44:9`! | G_PARAM_CONSTRUCTcxx . . $ G_PARAM_CONSTRUCT. | G_PARAM_EXPLICIT_NOTIFYcxx . . $ G_PARAM_EXPLICIT_NOTIFY.);
238
239 g_object_class_install_propertiescxx . . $ g_object_class_install_properties(569d03e6a4088541). (gobject_class, LAST_ARGcxx . . $ LAST_ARG., native_propscxx . . $ native_props.);
240
241 /**
242 * GtkNativeDialog::response:
243 * @self: the object on which the signal is emitted
244 * @response_id: the response ID
245 *
246 * Emitted when the user responds to the dialog.
247 *
248 * When this is called the dialog has been hidden.
249 *
250 * If you call [[email protected]] before the user
251 * responds to the dialog this signal will not be emitted.
252 */
253 native_signalscxx . . $ native_signals.[RESPONSEcxx . . $ RESPONSE.] =
254 g_signal_newcxx . . $ g_signal_new(b0aa5e8090fb95c0). (I_cxx . . $ `gdk/gdkprivate.h:35:9`!("response"),
255 G_OBJECT_CLASS_TYPEcxx . . $ `<external>/1341695927569185362/gobject.h:117:9`! (class),
256 G_SIGNAL_RUN_LASTcxx . . $ G_SIGNAL_RUN_LAST.,
257 G_STRUCT_OFFSETcxx . . $ `<external>/12741050725406041920/gmacros.h:1005:9`! (GtkNativeDialogClass, response),
258 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!,
259 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!,
260 G_TYPE_NONEcxx . . $ `<external>/9567554376676449156/gtype.h:72:9`!, 1,
261 G_TYPE_INTcxx . . $ `<external>/9567554376676449156/gtype.h:105:9`!);
262 }
263
264 static void
265 gtk_native_dialog_initcxx . . $ gtk_native_dialog_init(4e7b09755cef6259). (GtkNativeDialogcxx . . $ GtkNativeDialog# *self)
266 {
267 }
268
269 /**
270 * gtk_native_dialog_show:
271 * @self: a `GtkNativeDialog`
272 *
273 * Shows the dialog on the display.
274 *
275 * When the user accepts the state of the dialog the dialog will
276 * be automatically hidden and the [[email protected]::response]
277 * signal will be emitted.
278 *
279 * Multiple calls while the dialog is visible will be ignored.
280 */
281 void
282 gtk_native_dialog_showcxx . . $ gtk_native_dialog_show(4e7b09755cef6259). (GtkNativeDialogcxx . . $ GtkNativeDialog# *self)
283 {
284 GtkNativeDialogPrivatecxx . . $ GtkNativeDialogPrivate# *priv = gtk_native_dialog_get_instance_privatecxx . . $ gtk_native_dialog_get_instance_private(8c364ba9916905a). (self);
285 GtkNativeDialogClasscxx . . $ GtkNativeDialogClass# *klass;
286
287 g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (GTK_IS_NATIVE_DIALOG (self));
288
289 if (priv->visiblecxx . . $ _GtkNativeDialogPrivate#visible.)
290 return;
291
292 klass = GTK_NATIVE_DIALOG_GET_CLASScxx . . $ GTK_NATIVE_DIALOG_GET_CLASS(4e13f77aa066e7e6). (self);
293
294 g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (klass->show != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
295
296 klass->showcxx . . $ _GtkNativeDialogClass#show. (self);
297
298 priv->visiblecxx . . $ _GtkNativeDialogPrivate#visible. = TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
299 g_object_notify_by_pspeccxx . . $ g_object_notify_by_pspec(89706f8943b9e738). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (self), native_propscxx . . $ native_props.[PROP_VISIBLEcxx . . $ PROP_VISIBLE.]);
300 }
301
302 /**
303 * gtk_native_dialog_hide:
304 * @self: a `GtkNativeDialog`
305 *
306 * Hides the dialog if it is visible, aborting any interaction.
307 *
308 * Once this is called the [[email protected]::response] signal
309 * will *not* be emitted until after the next call to
310 * [[email protected]].
311 *
312 * If the dialog is not visible this does nothing.
313 */
314 void
315 gtk_native_dialog_hidecxx . . $ gtk_native_dialog_hide(4e7b09755cef6259). (GtkNativeDialogcxx . . $ GtkNativeDialog# *self)
316 {
317 GtkNativeDialogPrivatecxx . . $ GtkNativeDialogPrivate# *priv = gtk_native_dialog_get_instance_privatecxx . . $ gtk_native_dialog_get_instance_private(8c364ba9916905a). (self);
318 GtkNativeDialogClasscxx . . $ GtkNativeDialogClass# *klass;
319
320 g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (GTK_IS_NATIVE_DIALOG (self));
321
322 if (!priv->visiblecxx . . $ _GtkNativeDialogPrivate#visible.)
323 return;
324
325 priv->visiblecxx . . $ _GtkNativeDialogPrivate#visible. = FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!;
326
327 klass = GTK_NATIVE_DIALOG_GET_CLASScxx . . $ GTK_NATIVE_DIALOG_GET_CLASS(4e13f77aa066e7e6). (self);
328
329 g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (klass->hide != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
330
331 klass->hidecxx . . $ _GtkNativeDialogClass#hide. (self);
332
333 g_object_notify_by_pspeccxx . . $ g_object_notify_by_pspec(89706f8943b9e738). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (self), native_propscxx . . $ native_props.[PROP_VISIBLEcxx . . $ PROP_VISIBLE.]);
334 }
335
336 /**
337 * gtk_native_dialog_destroy:
338 * @self: a `GtkNativeDialog`
339 *
340 * Destroys a dialog.
341 *
342 * When a dialog is destroyed, it will break any references it holds
343 * to other objects.
344 *
345 * If it is visible it will be hidden and any underlying window system
346 * resources will be destroyed.
347 *
348 * Note that this does not release any reference to the object (as opposed
349 * to destroying a `GtkWindow`) because there is no reference from the
350 * windowing system to the `GtkNativeDialog`.
351 */
352 void
353 gtk_native_dialog_destroycxx . . $ gtk_native_dialog_destroy(4e7b09755cef6259). (GtkNativeDialogcxx . . $ GtkNativeDialog# *self)
354 {
355 g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (GTK_IS_NATIVE_DIALOG (self));
356
357 g_object_run_disposecxx . . $ g_object_run_dispose(6087475fa43034d3). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (self));
358 }
359
360 void
361 _gtk_native_dialog_emit_responsecxx . . $ _gtk_native_dialog_emit_response(d059f2ad62fa0d2b). (GtkNativeDialogcxx . . $ GtkNativeDialog# *self,
362 int response_id)
363 {
364 GtkNativeDialogPrivatecxx . . $ GtkNativeDialogPrivate# *priv = gtk_native_dialog_get_instance_privatecxx . . $ gtk_native_dialog_get_instance_private(8c364ba9916905a). (self);
365 priv->visiblecxx . . $ _GtkNativeDialogPrivate#visible. = FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!;
366 g_object_notify_by_pspeccxx . . $ g_object_notify_by_pspec(89706f8943b9e738). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (self), native_propscxx . . $ native_props.[PROP_VISIBLEcxx . . $ PROP_VISIBLE.]);
367
368 g_signal_emitcxx . . $ g_signal_emit(cc3f7c2ba1c6a182). (self, native_signalscxx . . $ native_signals.[RESPONSEcxx . . $ RESPONSE.], 0, response_id);
369 }
370
371 /**
372 * gtk_native_dialog_get_visible:
373 * @self: a `GtkNativeDialog`
374 *
375 * Determines whether the dialog is visible.
376 *
377 * Returns: %TRUE if the dialog is visible
378 */
379 gbooleancxx . . $ gboolean#
380 gtk_native_dialog_get_visiblecxx . . $ gtk_native_dialog_get_visible(ab2141fde0482c8f). (GtkNativeDialogcxx . . $ GtkNativeDialog# *self)
381 {
382 GtkNativeDialogPrivatecxx . . $ GtkNativeDialogPrivate# *priv = gtk_native_dialog_get_instance_privatecxx . . $ gtk_native_dialog_get_instance_private(8c364ba9916905a). (self);
383
384 g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (GTK_IS_NATIVE_DIALOG (self), FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!);
385
386 return priv->visiblecxx . . $ _GtkNativeDialogPrivate#visible.;
387 }
388
389 /**
390 * gtk_native_dialog_set_modal:
391 * @self: a `GtkNativeDialog`
392 * @modal: whether the window is modal
393 *
394 * Sets a dialog modal or non-modal.
395 *
396 * Modal dialogs prevent interaction with other windows in the same
397 * application. To keep modal dialogs on top of main application
398 * windows, use [[email protected]_transient_for] to make
399 * the dialog transient for the parent; most window managers will
400 * then disallow lowering the dialog below the parent.
401 */
402 void
403 gtk_native_dialog_set_modalcxx . . $ gtk_native_dialog_set_modal(d059f2ad62fa0d2b). (GtkNativeDialogcxx . . $ GtkNativeDialog# *self,
404 gbooleancxx . . $ gboolean# modal)
405 {
406 GtkNativeDialogPrivatecxx . . $ GtkNativeDialogPrivate# *priv = gtk_native_dialog_get_instance_privatecxx . . $ gtk_native_dialog_get_instance_private(8c364ba9916905a). (self);
407
408 g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (GTK_IS_NATIVE_DIALOG (self));
409
410 modal = modal != FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!;
411
412 if (priv->modalcxx . . $ _GtkNativeDialogPrivate#modal. == modal)
413 return;
414
415 priv->modalcxx . . $ _GtkNativeDialogPrivate#modal. = modal;
416 g_object_notify_by_pspeccxx . . $ g_object_notify_by_pspec(89706f8943b9e738). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (self), native_propscxx . . $ native_props.[PROP_MODALcxx . . $ PROP_MODAL.]);
417 }
418
419 /**
420 * gtk_native_dialog_get_modal:
421 * @self: a `GtkNativeDialog`
422 *
423 * Returns whether the dialog is modal.
424 *
425 * Returns: %TRUE if the dialog is set to be modal
426 */
427 gbooleancxx . . $ gboolean#
428 gtk_native_dialog_get_modalcxx . . $ gtk_native_dialog_get_modal(ab2141fde0482c8f). (GtkNativeDialogcxx . . $ GtkNativeDialog# *self)
429 {
430 GtkNativeDialogPrivatecxx . . $ GtkNativeDialogPrivate# *priv = gtk_native_dialog_get_instance_privatecxx . . $ gtk_native_dialog_get_instance_private(8c364ba9916905a). (self);
431
432 g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (GTK_IS_NATIVE_DIALOG (self), FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!);
433
434 return priv->modalcxx . . $ _GtkNativeDialogPrivate#modal.;
435 }
436
437 /**
438 * gtk_native_dialog_set_title:
439 * @self: a `GtkNativeDialog`
440 * @title: title of the dialog
441 *
442 * Sets the title of the `GtkNativeDialog.`
443 */
444 void
445 gtk_native_dialog_set_titlecxx . . $ gtk_native_dialog_set_title(75cf34d6919d5770). (GtkNativeDialogcxx . . $ GtkNativeDialog# *self,
446 const char *title)
447 {
448 GtkNativeDialogPrivatecxx . . $ GtkNativeDialogPrivate# *priv = gtk_native_dialog_get_instance_privatecxx . . $ gtk_native_dialog_get_instance_private(8c364ba9916905a). (self);
449
450 g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (GTK_IS_NATIVE_DIALOG (self));
451
452 g_freecxx . . $ g_free(5d22bdacc48458e8). (priv->titlecxx . . $ _GtkNativeDialogPrivate#title.);
453 priv->titlecxx . . $ _GtkNativeDialogPrivate#title. = g_strdupcxx . . $ `<external>/7822753393113922331/gstrfuncs.h:324:9`! (title);
454
455 g_object_notify_by_pspeccxx . . $ g_object_notify_by_pspec(89706f8943b9e738). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (self), native_propscxx . . $ native_props.[PROP_TITLEcxx . . $ PROP_TITLE.]);
456 }
457
458 /**
459 * gtk_native_dialog_get_title:
460 * @self: a `GtkNativeDialog`
461 *
462 * Gets the title of the `GtkNativeDialog`.
463 *
464 * Returns: (nullable): the title of the dialog, or %NULL if none has
465 * been set explicitly. The returned string is owned by the widget
466 * and must not be modified or freed.
467 */
468 const char *
469 gtk_native_dialog_get_titlecxx . . $ gtk_native_dialog_get_title(6c14b2adf8503b44). (GtkNativeDialogcxx . . $ GtkNativeDialog# *self)
470 {
471 GtkNativeDialogPrivatecxx . . $ GtkNativeDialogPrivate# *priv = gtk_native_dialog_get_instance_privatecxx . . $ gtk_native_dialog_get_instance_private(8c364ba9916905a). (self);
472
473 g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (GTK_IS_NATIVE_DIALOG (self), NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
474
475 return priv->titlecxx . . $ _GtkNativeDialogPrivate#title.;
476 }
477
478 static void
479 parent_destroyedcxx . . $ parent_destroyed(3af427408a49af89). (GtkWidgetcxx . . $ GtkWidget# *parent,
480 GtkNativeDialogcxx . . $ GtkNativeDialog# *self)
481 {
482 GtkNativeDialogPrivatecxx . . $ GtkNativeDialogPrivate# *priv = gtk_native_dialog_get_instance_privatecxx . . $ gtk_native_dialog_get_instance_private(8c364ba9916905a). (self);
483
484 priv->transient_forcxx . . $ _GtkNativeDialogPrivate#transient_for. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
485 }
486
487 /**
488 * gtk_native_dialog_set_transient_for:
489 * @self: a `GtkNativeDialog`
490 * @parent: (nullable): parent window
491 *
492 * Dialog windows should be set transient for the main application
493 * window they were spawned from.
494 *
495 * This allows window managers to e.g. keep the dialog on top of the
496 * main window, or center the dialog over the main window.
497 *
498 * Passing %NULL for @parent unsets the current transient window.
499 */
500 void
501 gtk_native_dialog_set_transient_forcxx . . $ gtk_native_dialog_set_transient_for(8ad361b7e26a6e9b). (GtkNativeDialogcxx . . $ GtkNativeDialog# *self,
502 GtkWindowcxx . . $ GtkWindow# *parent)
503 {
504 GtkNativeDialogPrivatecxx . . $ GtkNativeDialogPrivate# *priv = gtk_native_dialog_get_instance_privatecxx . . $ gtk_native_dialog_get_instance_private(8c364ba9916905a). (self);
505
506 g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (GTK_IS_NATIVE_DIALOG (self));
507
508 if (parent == priv->transient_forcxx . . $ _GtkNativeDialogPrivate#transient_for.)
509 return;
510
511 if (priv->transient_forcxx . . $ _GtkNativeDialogPrivate#transient_for.)
512 g_signal_handlers_disconnect_by_funccxx . . $ `<external>/15952772511652638895/gsignal.h:629:9`! (priv->transient_for, parent_destroyed, self);
513
514 priv->transient_forcxx . . $ _GtkNativeDialogPrivate#transient_for. = parent;
515
516 if (parent)
517 g_signal_connectcxx . . $ `<external>/15952772511652638895/gsignal.h:548:9`! (parent, "destroy", G_CALLBACKcxx . . $ `<external>/16473872192229286895/gclosure.h:73:9`! (parent_destroyed), self);
518
519 g_object_notify_by_pspeccxx . . $ g_object_notify_by_pspec(89706f8943b9e738). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (self), native_propscxx . . $ native_props.[PROP_TRANSIENT_FORcxx . . $ PROP_TRANSIENT_FOR.]);
520 }
521
522 /**
523 * gtk_native_dialog_get_transient_for:
524 * @self: a `GtkNativeDialog`
525 *
526 * Fetches the transient parent for this window.
527 *
528 * Returns: (nullable) (transfer none): the transient parent for this window,
529 * or %NULL if no transient parent has been set.
530 */
531 GtkWindowcxx . . $ GtkWindow# *
532 gtk_native_dialog_get_transient_forcxx . . $ gtk_native_dialog_get_transient_for(2b17aeaf418fcb2c). (GtkNativeDialogcxx . . $ GtkNativeDialog# *self)
533 {
534 GtkNativeDialogPrivatecxx . . $ GtkNativeDialogPrivate# *priv = gtk_native_dialog_get_instance_privatecxx . . $ gtk_native_dialog_get_instance_private(8c364ba9916905a). (self);
535
536 g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (GTK_IS_NATIVE_DIALOG (self), NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
537
538 return priv->transient_forcxx . . $ _GtkNativeDialogPrivate#transient_for.;
539 }