Debian Codegraph @

gtk/gtkmessagedialog.c

raw symbols SCIP
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 2 -*- */cxx . . $ `<file>/gtk/gtkmessagedialog.c`/
2 /* GTK - The GIMP Toolkit
3 * Copyright (C) 2000 Red Hat, Inc.
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
14 *
15 * You should have received a copy of the GNU Library General Public
16 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19 /*
20 * Modified by the GTK+ Team and others 1997-2003. See the AUTHORS
21 * file for a list of people on the GTK+ Team. See the ChangeLog
22 * files for a list of changes. These files are distributed with
23 * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
24 */
25
26 #include "config.h"cxx . . $ `<file>/build/config.h`/
27
28 #include "deprecated/gtkmessagedialog.h"cxx . . $ `<file>/gtk/deprecated/gtkmessagedialog.h`/
29
30 #include "gtkbox.h"cxx . . $ `<file>/gtk/gtkbox.h`/
31 #include "gtkbuildable.h"cxx . . $ `<file>/gtk/gtkbuildable.h`/
32 #include "deprecated/gtkdialogprivate.h"cxx . . $ `<file>/gtk/deprecated/gtkdialogprivate.h`/
33 #include <glib/gi18n-lib.h>
34 #include "gtklabel.h"cxx . . $ `<file>/gtk/gtklabel.h`/
35 #include "gtkprivate.h"cxx . . $ `<file>/gtk/gtkprivate.h`/
36 #include "gtktypebuiltins.h"cxx . . $ `<file>/build/gtk/gtktypebuiltins.h`/
37
38 #include <string.h>
39
40 G_GNUC_BEGIN_IGNORE_DEPRECATIONScxx . . $ `<external>/12741050725406041920/gmacros.h:771:9`!
41
42 /**
43 * GtkMessageDialog:
44 *
45 * `GtkMessageDialog` presents a dialog with some message text.
46 *
47 * <picture>
48 * <source srcset="messagedialog-dark.png" media="(prefers-color-scheme: dark)">
49 * <img alt="An example GtkMessageDialog" src="messagedialog.png">
50 * </picture>
51 *
52 * It’s simply a convenience widget; you could construct the equivalent of
53 * `GtkMessageDialog` from `GtkDialog` without too much effort, but
54 * `GtkMessageDialog` saves typing.
55 *
56 * The easiest way to do a modal message dialog is to use the %GTK_DIALOG_MODAL
57 * flag, which will call [[email protected]_modal] internally. The dialog will
58 * prevent interaction with the parent window until it's hidden or destroyed.
59 * You can use the [[email protected]::response] signal to know when the user
60 * dismissed the dialog.
61 *
62 * An example for using a modal dialog:
63 * ```c
64 * GtkDialogFlags flags = GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_MODAL;
65 * dialog = gtk_message_dialog_new (parent_window,
66 * flags,
67 * GTK_MESSAGE_ERROR,
68 * GTK_BUTTONS_CLOSE,
69 * "Error reading “%s”: %s",
70 * filename,
71 * g_strerror (errno));
72 * // Destroy the dialog when the user responds to it
73 * // (e.g. clicks a button)
74 *
75 * g_signal_connect (dialog, "response",
76 * G_CALLBACK (gtk_window_destroy),
77 * NULL);
78 * ```
79 *
80 * You might do a non-modal `GtkMessageDialog` simply by omitting the
81 * %GTK_DIALOG_MODAL flag:
82 *
83 * ```c
84 * GtkDialogFlags flags = GTK_DIALOG_DESTROY_WITH_PARENT;
85 * dialog = gtk_message_dialog_new (parent_window,
86 * flags,
87 * GTK_MESSAGE_ERROR,
88 * GTK_BUTTONS_CLOSE,
89 * "Error reading “%s”: %s",
90 * filename,
91 * g_strerror (errno));
92 *
93 * // Destroy the dialog when the user responds to it
94 * // (e.g. clicks a button)
95 * g_signal_connect (dialog, "response",
96 * G_CALLBACK (gtk_window_destroy),
97 * NULL);
98 * ```
99 *
100 * # GtkMessageDialog as GtkBuildable
101 *
102 * The `GtkMessageDialog` implementation of the `GtkBuildable` interface exposes
103 * the message area as an internal child with the name “message_area”.
104 *
105 * Deprecated: 4.10: Use [[email protected]] instead
106 */
107
108 typedef structcxx . . $ $anonymous_type_b03a8fe6a4f1ef80_0#
109 {
110 GtkWidgetcxx . . $ GtkWidget# *labelcxx . . $ $anonymous_type_b03a8fe6a4f1ef80_0#label.;
111 GtkWidgetcxx . . $ GtkWidget# *message_areacxx . . $ $anonymous_type_b03a8fe6a4f1ef80_0#message_area.; /* vbox for the primary and secondary labels, and any extra content from the caller */
112 GtkWidgetcxx . . $ GtkWidget# *secondary_labelcxx . . $ $anonymous_type_b03a8fe6a4f1ef80_0#secondary_label.;
113
114 guintcxx . . $ guint# has_primary_markupcxx . . $ $anonymous_type_b03a8fe6a4f1ef80_0#has_primary_markup. : 1;
115 guintcxx . . $ guint# has_secondary_textcxx . . $ $anonymous_type_b03a8fe6a4f1ef80_0#has_secondary_text. : 1;
116 guintcxx . . $ guint# message_typecxx . . $ $anonymous_type_b03a8fe6a4f1ef80_0#message_type. : 3;
117 } GtkMessageDialogPrivatecxx . . $ GtkMessageDialogPrivate#;
118
119 struct _GtkMessageDialogClasscxx . . $ _GtkMessageDialogClass#
120 {
121 GtkDialogClasscxx . . $ GtkDialogClass# parent_classcxx . . $ _GtkMessageDialogClass#parent_class.;
122 };
123
124 enumcxx . . $ $anonymous_type_b03a8fe6a4f1ef80_1# {
125 PROP_0cxx . . $ PROP_0.,
126 PROP_MESSAGE_TYPEcxx . . $ PROP_MESSAGE_TYPE.,
127 PROP_BUTTONScxx . . $ PROP_BUTTONS.,
128 PROP_TEXTcxx . . $ PROP_TEXT.,
129 PROP_USE_MARKUPcxx . . $ PROP_USE_MARKUP.,
130 PROP_SECONDARY_TEXTcxx . . $ PROP_SECONDARY_TEXT.,
131 PROP_SECONDARY_USE_MARKUPcxx . . $ PROP_SECONDARY_USE_MARKUP.,
132 PROP_IMAGEcxx . . $ PROP_IMAGE.,
133 PROP_MESSAGE_AREAcxx . . $ PROP_MESSAGE_AREA.
134 };
135
136 G_DEFINE_TYPE_WITH_PRIVATEcxx . . $ `<external>/9567554376676449156/gtype.h:1876:9`! (GtkMessageDialog, gtk_message_dialog, GTK_TYPE_DIALOGcxx . . $ `gtk/deprecated/gtkdialog.h:91:9`!)
137
138 static void
139 setup_typecxx . . $ setup_type(b3dbc56fc04b2c6a). (GtkMessageDialogcxx . . $ GtkMessageDialog# *dialog,
140 GtkMessageTypecxx . . $ GtkMessageType# type)
141 {
142 GtkMessageDialogPrivatecxx . . $ GtkMessageDialogPrivate# *priv = gtk_message_dialog_get_instance_privatecxx . . $ gtk_message_dialog_get_instance_private(b09e48515344d248). (dialog);
143
144 if (priv->message_typecxx . . $ $anonymous_type_b03a8fe6a4f1ef80_0#message_type. == type)
145 return;
146
147 priv->message_typecxx . . $ $anonymous_type_b03a8fe6a4f1ef80_0#message_type. = type;
148
149 g_object_notifycxx . . $ g_object_notify(174c9e6df5777c4e). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (dialog), "message-type");
150 }
151
152 static void
153 gtk_message_dialog_add_buttonscxx . . $ gtk_message_dialog_add_buttons(e2ef0960dabdf6a2). (GtkMessageDialogcxx . . $ GtkMessageDialog# *message_dialog,
154 GtkButtonsTypecxx . . $ GtkButtonsType# buttons)
155 {
156 GtkDialogcxx . . $ GtkDialog#* dialog = GTK_DIALOGcxx . . $ `gtk/deprecated/gtkdialog.h:92:9`! (message_dialog);
157
158 switch (buttons)
159 {
160 case GTK_BUTTONS_NONEcxx . . $ GTK_BUTTONS_NONE.:
161 /* nothing */
162 break;
163
164 case GTK_BUTTONS_OKcxx . . $ GTK_BUTTONS_OK.:
165 gtk_dialog_add_buttoncxx . . $ gtk_dialog_add_button(d3209ef02c66779a). (dialog, _cxx . . $ `<external>/16453136837583379545/gi18n-lib.h:32:10`!("_OK"), GTK_RESPONSE_OKcxx . . $ GTK_RESPONSE_OK.);
166 break;
167
168 case GTK_BUTTONS_CLOSEcxx . . $ GTK_BUTTONS_CLOSE.:
169 gtk_dialog_add_buttoncxx . . $ gtk_dialog_add_button(d3209ef02c66779a). (dialog, _cxx . . $ `<external>/16453136837583379545/gi18n-lib.h:32:10`!("_Close"), GTK_RESPONSE_CLOSEcxx . . $ GTK_RESPONSE_CLOSE.);
170 break;
171
172 case GTK_BUTTONS_CANCELcxx . . $ GTK_BUTTONS_CANCEL.:
173 gtk_dialog_add_buttoncxx . . $ gtk_dialog_add_button(d3209ef02c66779a). (dialog, _cxx . . $ `<external>/16453136837583379545/gi18n-lib.h:32:10`!("_Cancel"), GTK_RESPONSE_CANCELcxx . . $ GTK_RESPONSE_CANCEL.);
174 break;
175
176 case GTK_BUTTONS_YES_NOcxx . . $ GTK_BUTTONS_YES_NO.:
177 gtk_dialog_add_buttoncxx . . $ gtk_dialog_add_button(d3209ef02c66779a). (dialog, _cxx . . $ `<external>/16453136837583379545/gi18n-lib.h:32:10`!("_No"), GTK_RESPONSE_NOcxx . . $ GTK_RESPONSE_NO.);
178 gtk_dialog_add_buttoncxx . . $ gtk_dialog_add_button(d3209ef02c66779a). (dialog, _cxx . . $ `<external>/16453136837583379545/gi18n-lib.h:32:10`!("_Yes"), GTK_RESPONSE_YEScxx . . $ GTK_RESPONSE_YES.);
179 break;
180
181 case GTK_BUTTONS_OK_CANCELcxx . . $ GTK_BUTTONS_OK_CANCEL.:
182 gtk_dialog_add_buttoncxx . . $ gtk_dialog_add_button(d3209ef02c66779a). (dialog, _cxx . . $ `<external>/16453136837583379545/gi18n-lib.h:32:10`!("_Cancel"), GTK_RESPONSE_CANCELcxx . . $ GTK_RESPONSE_CANCEL.);
183 gtk_dialog_add_buttoncxx . . $ gtk_dialog_add_button(d3209ef02c66779a). (dialog, _cxx . . $ `<external>/16453136837583379545/gi18n-lib.h:32:10`!("_OK"), GTK_RESPONSE_OKcxx . . $ GTK_RESPONSE_OK.);
184 break;
185
186 default:
187 g_warningcxx . . $ `<external>/5169755362661750954/gmessages.h:340:9`! ("Unknown GtkButtonsType");
188 break;
189 }
190
191 g_object_notifycxx . . $ g_object_notify(174c9e6df5777c4e). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (message_dialog), "buttons");
192 }
193
194 static void
195 gtk_message_dialog_set_propertycxx . . $ gtk_message_dialog_set_property(d7c4bb29f36c0dc4). (GObjectcxx . . $ GObject# *object,
196 guintcxx . . $ guint# prop_id,
197 const GValuecxx . . $ GValue# *value,
198 GParamSpeccxx . . $ GParamSpec# *pspec)
199 {
200 GtkMessageDialogcxx . . $ GtkMessageDialog# *dialog = GTK_MESSAGE_DIALOGcxx . . $ `gtk/deprecated/gtkmessagedialog.h:38:9`! (object);
201 GtkMessageDialogPrivatecxx . . $ GtkMessageDialogPrivate# *priv = gtk_message_dialog_get_instance_privatecxx . . $ gtk_message_dialog_get_instance_private(b09e48515344d248). (dialog);
202
203 switch (prop_id)
204 {
205 case PROP_MESSAGE_TYPEcxx . . $ PROP_MESSAGE_TYPE.:
206 setup_typecxx . . $ setup_type(b3dbc56fc04b2c6a). (dialog, g_value_get_enumcxx . . $ g_value_get_enum(f890c5c75ead5b21). (value));
207 break;
208 case PROP_BUTTONScxx . . $ PROP_BUTTONS.:
209 gtk_message_dialog_add_buttonscxx . . $ gtk_message_dialog_add_buttons(e2ef0960dabdf6a2). (dialog, g_value_get_enumcxx . . $ g_value_get_enum(f890c5c75ead5b21). (value));
210 break;
211 case PROP_TEXTcxx . . $ PROP_TEXT.:
212 if (priv->has_primary_markupcxx . . $ $anonymous_type_b03a8fe6a4f1ef80_0#has_primary_markup.)
213 gtk_label_set_markupcxx . . $ gtk_label_set_markup(3d016a7109913fca). (GTK_LABELcxx . . $ `gtk/gtklabel.h:36:9`! (priv->label), g_value_get_stringcxx . . $ g_value_get_string(cc0a2be2b8f7bdc8). (value));
214 else
215 gtk_label_set_textcxx . . $ gtk_label_set_text(3d016a7109913fca). (GTK_LABELcxx . . $ `gtk/gtklabel.h:36:9`! (priv->label), g_value_get_stringcxx . . $ g_value_get_string(cc0a2be2b8f7bdc8). (value));
216 break;
217 case PROP_USE_MARKUPcxx . . $ PROP_USE_MARKUP.:
218 if (priv->has_primary_markupcxx . . $ $anonymous_type_b03a8fe6a4f1ef80_0#has_primary_markup. != g_value_get_booleancxx . . $ g_value_get_boolean(f890c5c75ead5b21). (value))
219 {
220 priv->has_primary_markupcxx . . $ $anonymous_type_b03a8fe6a4f1ef80_0#has_primary_markup. = g_value_get_booleancxx . . $ g_value_get_boolean(f890c5c75ead5b21). (value);
221 gtk_label_set_use_markupcxx . . $ gtk_label_set_use_markup(ae51c99326df3b2e). (GTK_LABELcxx . . $ `gtk/gtklabel.h:36:9`! (priv->label), priv->has_primary_markupcxx . . $ $anonymous_type_b03a8fe6a4f1ef80_0#has_primary_markup.);
222 g_object_notify_by_pspeccxx . . $ g_object_notify_by_pspec(89706f8943b9e738). (object, pspec);
223 }
224 break;
225 case PROP_SECONDARY_TEXTcxx . . $ PROP_SECONDARY_TEXT.:
226 {
227 const char *txt = g_value_get_stringcxx . . $ g_value_get_string(cc0a2be2b8f7bdc8). (value);
228
229 if (gtk_label_get_use_markupcxx . . $ gtk_label_get_use_markup(f95750b06aaf936a). (GTK_LABELcxx . . $ `gtk/gtklabel.h:36:9`! (priv->secondary_label)))
230 gtk_label_set_markupcxx . . $ gtk_label_set_markup(3d016a7109913fca). (GTK_LABELcxx . . $ `gtk/gtklabel.h:36:9`! (priv->secondary_label), txt);
231 else
232 gtk_label_set_textcxx . . $ gtk_label_set_text(3d016a7109913fca). (GTK_LABELcxx . . $ `gtk/gtklabel.h:36:9`! (priv->secondary_label), txt);
233
234 if (txt)
235 {
236 priv->has_secondary_textcxx . . $ $anonymous_type_b03a8fe6a4f1ef80_0#has_secondary_text. = TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
237 gtk_widget_add_css_classcxx . . $ gtk_widget_add_css_class(3e0616a87a6c51e5). (priv->labelcxx . . $ $anonymous_type_b03a8fe6a4f1ef80_0#label., "title");
238 }
239 else
240 {
241 priv->has_secondary_textcxx . . $ $anonymous_type_b03a8fe6a4f1ef80_0#has_secondary_text. = FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!;
242 gtk_widget_remove_css_classcxx . . $ gtk_widget_remove_css_class(3e0616a87a6c51e5). (priv->labelcxx . . $ $anonymous_type_b03a8fe6a4f1ef80_0#label., "title");
243 }
244
245 gtk_widget_set_visiblecxx . . $ gtk_widget_set_visible(81f145f668a0074f). (priv->secondary_labelcxx . . $ $anonymous_type_b03a8fe6a4f1ef80_0#secondary_label., priv->has_secondary_textcxx . . $ $anonymous_type_b03a8fe6a4f1ef80_0#has_secondary_text.);
246 }
247 break;
248 case PROP_SECONDARY_USE_MARKUPcxx . . $ PROP_SECONDARY_USE_MARKUP.:
249 if (gtk_label_get_use_markupcxx . . $ gtk_label_get_use_markup(f95750b06aaf936a). (GTK_LABELcxx . . $ `gtk/gtklabel.h:36:9`! (priv->secondary_label)) != g_value_get_booleancxx . . $ g_value_get_boolean(f890c5c75ead5b21). (value))
250 {
251 gtk_label_set_use_markupcxx . . $ gtk_label_set_use_markup(ae51c99326df3b2e). (GTK_LABELcxx . . $ `gtk/gtklabel.h:36:9`! (priv->secondary_label), g_value_get_booleancxx . . $ g_value_get_boolean(f890c5c75ead5b21). (value));
252 g_object_notify_by_pspeccxx . . $ g_object_notify_by_pspec(89706f8943b9e738). (object, pspec);
253 }
254 break;
255
256 default:
257 G_OBJECT_WARN_INVALID_PROPERTY_IDcxx . . $ `<external>/1341695927569185362/gobject.h:690:9`! (object, prop_id, pspec);
258 break;
259 }
260 }
261
262 static void
263 gtk_message_dialog_get_propertycxx . . $ gtk_message_dialog_get_property(cee2c52f22407c66). (GObjectcxx . . $ GObject# *object,
264 guintcxx . . $ guint# prop_id,
265 GValuecxx . . $ GValue# *value,
266 GParamSpeccxx . . $ GParamSpec# *pspec)
267 {
268 GtkMessageDialogcxx . . $ GtkMessageDialog# *dialog = GTK_MESSAGE_DIALOGcxx . . $ `gtk/deprecated/gtkmessagedialog.h:38:9`! (object);
269 GtkMessageDialogPrivatecxx . . $ GtkMessageDialogPrivate# *priv = gtk_message_dialog_get_instance_privatecxx . . $ gtk_message_dialog_get_instance_private(b09e48515344d248). (dialog);
270
271 switch (prop_id)
272 {
273 case PROP_MESSAGE_TYPEcxx . . $ PROP_MESSAGE_TYPE.:
274 g_value_set_enumcxx . . $ g_value_set_enum(b698c61e8e30c4ea). (value, (GtkMessageTypecxx . . $ GtkMessageType#) priv->message_typecxx . . $ $anonymous_type_b03a8fe6a4f1ef80_0#message_type.);
275 break;
276 case PROP_TEXTcxx . . $ PROP_TEXT.:
277 g_value_set_stringcxx . . $ g_value_set_string(65b9ea7708b82b9b). (value, gtk_label_get_labelcxx . . $ gtk_label_get_label(204bfb80200b298b). (GTK_LABELcxx . . $ `gtk/gtklabel.h:36:9`! (priv->label)));
278 break;
279 case PROP_USE_MARKUPcxx . . $ PROP_USE_MARKUP.:
280 g_value_set_booleancxx . . $ g_value_set_boolean(b698c61e8e30c4ea). (value, priv->has_primary_markupcxx . . $ $anonymous_type_b03a8fe6a4f1ef80_0#has_primary_markup.);
281 break;
282 case PROP_SECONDARY_TEXTcxx . . $ PROP_SECONDARY_TEXT.:
283 if (priv->has_secondary_textcxx . . $ $anonymous_type_b03a8fe6a4f1ef80_0#has_secondary_text.)
284 g_value_set_stringcxx . . $ g_value_set_string(65b9ea7708b82b9b). (value,
285 gtk_label_get_labelcxx . . $ gtk_label_get_label(204bfb80200b298b). (GTK_LABELcxx . . $ `gtk/gtklabel.h:36:9`! (priv->secondary_label)));
286 else
287 g_value_set_stringcxx . . $ g_value_set_string(65b9ea7708b82b9b). (value, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
288 break;
289 case PROP_SECONDARY_USE_MARKUPcxx . . $ PROP_SECONDARY_USE_MARKUP.:
290 if (priv->has_secondary_textcxx . . $ $anonymous_type_b03a8fe6a4f1ef80_0#has_secondary_text.)
291 g_value_set_booleancxx . . $ g_value_set_boolean(b698c61e8e30c4ea). (value,
292 gtk_label_get_use_markupcxx . . $ gtk_label_get_use_markup(f95750b06aaf936a). (GTK_LABELcxx . . $ `gtk/gtklabel.h:36:9`! (priv->secondary_label)));
293 else
294 g_value_set_booleancxx . . $ g_value_set_boolean(b698c61e8e30c4ea). (value, FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!);
295 break;
296 case PROP_MESSAGE_AREAcxx . . $ PROP_MESSAGE_AREA.:
297 g_value_set_objectcxx . . $ g_value_set_object(e945b84c1e9702f). (value, priv->message_areacxx . . $ $anonymous_type_b03a8fe6a4f1ef80_0#message_area.);
298 break;
299 default:
300 G_OBJECT_WARN_INVALID_PROPERTY_IDcxx . . $ `<external>/1341695927569185362/gobject.h:690:9`! (object, prop_id, pspec);
301 break;
302 }
303 }
304
305 static void
306 update_titlecxx . . $ update_title(662069a4b9a346c). (GObjectcxx . . $ GObject# *dialog,
307 GParamSpeccxx . . $ GParamSpec# *pspec,
308 GtkWidgetcxx . . $ GtkWidget# *label)
309 {
310 const char *title;
311
312 title = gtk_window_get_titlecxx . . $ gtk_window_get_title(dcfdb037259f5d4d). (GTK_WINDOWcxx . . $ `gtk/gtkwindow.h:39:9`! (dialog));
313 gtk_label_set_labelcxx . . $ gtk_label_set_label(3d016a7109913fca). (GTK_LABELcxx . . $ `gtk/gtklabel.h:36:9`! (label), title);
314 gtk_widget_set_visiblecxx . . $ gtk_widget_set_visible(81f145f668a0074f). (label, title && title[0]);
315 }
316
317 static void
318 gtk_message_dialog_constructedcxx . . $ gtk_message_dialog_constructed(6087475fa43034d3). (GObjectcxx . . $ GObject# *object)
319 {
320 GtkMessageDialogcxx . . $ GtkMessageDialog# *dialog = GTK_MESSAGE_DIALOGcxx . . $ `gtk/deprecated/gtkmessagedialog.h:38:9`! (object);
321 gbooleancxx . . $ gboolean# use_header;
322
323 G_OBJECT_CLASScxx . . $ `<external>/1341695927569185362/gobject.h:61:9`! (gtk_message_dialog_parent_class)->constructedcxx . . $ _GObjectClass#constructed. (object);
324
325 g_object_getcxx . . $ g_object_get(1ac911bdc4e9a14d). (gtk_widget_get_settingscxx . . $ gtk_widget_get_settings(ffe4fbf99830fa29). (GTK_WIDGETcxx . . $ `gtk/gtkwidget.h:44:9`! (dialog)),
326 "gtk-dialogs-use-header", &use_header,
327 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
328
329 if (use_header)
330 {
331 GtkWidgetcxx . . $ GtkWidget# *box;
332 GtkWidgetcxx . . $ GtkWidget# *label;
333
334 box = gtk_box_newcxx . . $ gtk_box_new(b19e0ce02196028e). (GTK_ORIENTATION_HORIZONTALcxx . . $ GTK_ORIENTATION_HORIZONTAL., 0);
335 gtk_widget_set_size_requestcxx . . $ gtk_widget_set_size_request(f5b8e75990cfac4b). (box, -1, 16);
336 label = gtk_label_newcxx . . $ gtk_label_new(6d90f3ec8782e10d). ("");
337 gtk_widget_set_visiblecxx . . $ gtk_widget_set_visible(81f145f668a0074f). (label, FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!);
338 gtk_widget_set_margin_topcxx . . $ gtk_widget_set_margin_top(81f145f668a0074f). (label, 6);
339 gtk_widget_set_margin_bottomcxx . . $ gtk_widget_set_margin_bottom(81f145f668a0074f). (label, 6);
340 gtk_widget_set_haligncxx . . $ gtk_widget_set_halign(71362b4a1e4eb244). (label, GTK_ALIGN_CENTERcxx . . $ GTK_ALIGN_CENTER.);
341 gtk_widget_set_hexpandcxx . . $ gtk_widget_set_hexpand(81f145f668a0074f). (label, TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!);
342 gtk_widget_add_css_classcxx . . $ gtk_widget_add_css_class(3e0616a87a6c51e5). (label, "title");
343 gtk_box_appendcxx . . $ gtk_box_append(72f3a0256788ecaf). (GTK_BOXcxx . . $ `gtk/gtkbox.h:39:9`! (box), label);
344 g_signal_connect_objectcxx . . $ g_signal_connect_object(567cfbe0c886a38e). (dialog, "notify::title", G_CALLBACKcxx . . $ `<external>/16473872192229286895/gclosure.h:73:9`! (update_title), label, 0);
345
346 gtk_window_set_titlebarcxx . . $ gtk_window_set_titlebar(59a2a0eb4c9edf98). (GTK_WINDOWcxx . . $ `gtk/gtkwindow.h:39:9`! (dialog), box);
347 }
348 }
349
350 static void
351 gtk_message_dialog_class_initcxx . . $ gtk_message_dialog_class_init(54ae57d0f2881422). (GtkMessageDialogClasscxx . . $ GtkMessageDialogClass# *class)
352 {
353 GtkWidgetClasscxx . . $ GtkWidgetClass# *widget_class;
354 GObjectClasscxx . . $ GObjectClass# *gobject_class;
355
356 widget_class = GTK_WIDGET_CLASScxx . . $ `gtk/gtkwidget.h:45:9`! (class);
357 gobject_class = G_OBJECT_CLASScxx . . $ `<external>/1341695927569185362/gobject.h:61:9`! (class);
358
359 gobject_class->constructedcxx . . $ _GObjectClass#constructed. = gtk_message_dialog_constructedcxx . . $ gtk_message_dialog_constructed(6087475fa43034d3).;
360 gobject_class->set_propertycxx . . $ _GObjectClass#set_property. = gtk_message_dialog_set_propertycxx . . $ gtk_message_dialog_set_property(d7c4bb29f36c0dc4).;
361 gobject_class->get_propertycxx . . $ _GObjectClass#get_property. = gtk_message_dialog_get_propertycxx . . $ gtk_message_dialog_get_property(cee2c52f22407c66).;
362
363 /**
364 * GtkMessageDialog:message-type:
365 *
366 * The type of the message.
367 */
368 g_object_class_install_propertycxx . . $ g_object_class_install_property(9c80cb614dbe5a26). (gobject_class,
369 PROP_MESSAGE_TYPEcxx . . $ PROP_MESSAGE_TYPE.,
370 g_param_spec_enumcxx . . $ g_param_spec_enum(bfeb217b5dc6c0ac). ("message-type", 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`!,
371 GTK_TYPE_MESSAGE_TYPEcxx . . $ `build/gtk/gtktypebuiltins.h:142:9`!,
372 GTK_MESSAGE_INFOcxx . . $ GTK_MESSAGE_INFO.,
373 GTK_PARAM_READWRITEcxx . . $ `gtk/gtkprivate.h:44:9`!|G_PARAM_CONSTRUCTcxx . . $ G_PARAM_CONSTRUCT.|G_PARAM_EXPLICIT_NOTIFYcxx . . $ G_PARAM_EXPLICIT_NOTIFY.));
374 /**
375 * GtkMessageDialog:buttons:
376 *
377 * Set of buttons to display on the dialog.
378 */
379 g_object_class_install_propertycxx . . $ g_object_class_install_property(9c80cb614dbe5a26). (gobject_class,
380 PROP_BUTTONScxx . . $ PROP_BUTTONS.,
381 g_param_spec_enumcxx . . $ g_param_spec_enum(bfeb217b5dc6c0ac). ("buttons", 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`!,
382 GTK_TYPE_BUTTONS_TYPEcxx . . $ `build/gtk/gtktypebuiltins.h:52:9`!,
383 GTK_BUTTONS_NONEcxx . . $ GTK_BUTTONS_NONE.,
384 GTK_PARAM_WRITABLEcxx . . $ `gtk/gtkprivate.h:43:9`!|G_PARAM_CONSTRUCT_ONLYcxx . . $ G_PARAM_CONSTRUCT_ONLY.));
385 /**
386 * GtkMessageDialog:text:
387 *
388 * The primary text of the message dialog.
389 *
390 * If the dialog has a secondary text, this will appear as the title.
391 */
392 g_object_class_install_propertycxx . . $ g_object_class_install_property(9c80cb614dbe5a26). (gobject_class,
393 PROP_TEXTcxx . . $ PROP_TEXT.,
394 g_param_spec_stringcxx . . $ g_param_spec_string(378e8746be5cd899). ("text", 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`!,
395 "",
396 GTK_PARAM_READWRITEcxx . . $ `gtk/gtkprivate.h:44:9`!));
397 /**
398 * GtkMessageDialog:use-markup:
399 *
400 * %TRUE if the primary text of the dialog includes Pango markup.
401 *
402 * See [[email protected]_markup].
403 */
404 g_object_class_install_propertycxx . . $ g_object_class_install_property(9c80cb614dbe5a26). (gobject_class,
405 PROP_USE_MARKUPcxx . . $ PROP_USE_MARKUP.,
406 g_param_spec_booleancxx . . $ g_param_spec_boolean(315d86b79c0116e0). ("use-markup", 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`!,
407 FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!,
408 GTK_PARAM_READWRITEcxx . . $ `gtk/gtkprivate.h:44:9`!|G_PARAM_EXPLICIT_NOTIFYcxx . . $ G_PARAM_EXPLICIT_NOTIFY.));
409 /**
410 * GtkMessageDialog:secondary-text:
411 *
412 * The secondary text of the message dialog.
413 */
414 g_object_class_install_propertycxx . . $ g_object_class_install_property(9c80cb614dbe5a26). (gobject_class,
415 PROP_SECONDARY_TEXTcxx . . $ PROP_SECONDARY_TEXT.,
416 g_param_spec_stringcxx . . $ g_param_spec_string(378e8746be5cd899). ("secondary-text", 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`!,
417 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!,
418 GTK_PARAM_READWRITEcxx . . $ `gtk/gtkprivate.h:44:9`!));
419 /**
420 * GtkMessageDialog:secondary-use-markup:
421 *
422 * %TRUE if the secondary text of the dialog includes Pango markup.
423 *
424 * See [[email protected]_markup].
425 */
426 g_object_class_install_propertycxx . . $ g_object_class_install_property(9c80cb614dbe5a26). (gobject_class,
427 PROP_SECONDARY_USE_MARKUPcxx . . $ PROP_SECONDARY_USE_MARKUP.,
428 g_param_spec_booleancxx . . $ g_param_spec_boolean(315d86b79c0116e0). ("secondary-use-markup", 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`!,
429 FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!,
430 GTK_PARAM_READWRITEcxx . . $ `gtk/gtkprivate.h:44:9`!|G_PARAM_EXPLICIT_NOTIFYcxx . . $ G_PARAM_EXPLICIT_NOTIFY.));
431 /**
432 * GtkMessageDialog:message-area:
433 *
434 * The `GtkBox` that corresponds to the message area of this dialog.
435 *
436 * See [[email protected]_message_area] for a detailed
437 * description of this area.
438 */
439 g_object_class_install_propertycxx . . $ g_object_class_install_property(9c80cb614dbe5a26). (gobject_class,
440 PROP_MESSAGE_AREAcxx . . $ PROP_MESSAGE_AREA.,
441 g_param_spec_objectcxx . . $ g_param_spec_object(faf99966f027a127). ("message-area", 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`!,
442 GTK_TYPE_WIDGETcxx . . $ `gtk/gtkwidget.h:43:9`!,
443 GTK_PARAM_READABLEcxx . . $ `gtk/gtkprivate.h:42:9`!));
444
445 gtk_widget_class_set_template_from_resourcecxx . . $ gtk_widget_class_set_template_from_resource(6333614c746ab65a). (widget_class, "/org/gtk/libgtk/ui/gtkmessagedialog.ui");
446 gtk_widget_class_bind_template_child_privatecxx . . $ `gtk/gtkwidget.h:806:9`! (widget_class, GtkMessageDialog, label);
447 gtk_widget_class_bind_template_child_privatecxx . . $ `gtk/gtkwidget.h:806:9`! (widget_class, GtkMessageDialog, secondary_label);
448 gtk_widget_class_bind_template_child_internal_privatecxx . . $ `gtk/gtkwidget.h:829:9`! (widget_class, GtkMessageDialog, message_area);
449 }
450
451 static void
452 gtk_message_dialog_initcxx . . $ gtk_message_dialog_init(84b7f28509894aba). (GtkMessageDialogcxx . . $ GtkMessageDialog# *dialog)
453 {
454 GtkMessageDialogPrivatecxx . . $ GtkMessageDialogPrivate# *priv = gtk_message_dialog_get_instance_privatecxx . . $ gtk_message_dialog_get_instance_private(b09e48515344d248). (dialog);
455 GtkWidgetcxx . . $ GtkWidget# *action_area;
456 GtkSettingscxx . . $ GtkSettings# *settings;
457 gbooleancxx . . $ gboolean# use_caret;
458
459 priv->has_primary_markupcxx . . $ $anonymous_type_b03a8fe6a4f1ef80_0#has_primary_markup. = FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!;
460 priv->has_secondary_textcxx . . $ $anonymous_type_b03a8fe6a4f1ef80_0#has_secondary_text. = FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!;
461 priv->message_typecxx . . $ $anonymous_type_b03a8fe6a4f1ef80_0#message_type. = GTK_MESSAGE_OTHERcxx . . $ GTK_MESSAGE_OTHER.;
462
463 gtk_widget_add_css_classcxx . . $ gtk_widget_add_css_class(3e0616a87a6c51e5). (GTK_WIDGETcxx . . $ `gtk/gtkwidget.h:44:9`! (dialog), "message");
464
465 gtk_widget_init_templatecxx . . $ gtk_widget_init_template(d7cf858254b37903). (GTK_WIDGETcxx . . $ `gtk/gtkwidget.h:44:9`! (dialog));
466 action_area = gtk_dialog_get_action_areacxx . . $ gtk_dialog_get_action_area(79f8cae978236133). (GTK_DIALOGcxx . . $ `gtk/deprecated/gtkdialog.h:92:9`! (dialog));
467 gtk_widget_set_haligncxx . . $ gtk_widget_set_halign(71362b4a1e4eb244). (action_area, GTK_ALIGN_FILLcxx . . $ GTK_ALIGN_FILL.);
468 gtk_box_set_homogeneouscxx . . $ gtk_box_set_homogeneous(aaaf6a087046aaad). (GTK_BOXcxx . . $ `gtk/gtkbox.h:39:9`! (action_area), TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!);
469
470 settings = gtk_widget_get_settingscxx . . $ gtk_widget_get_settings(ffe4fbf99830fa29). (GTK_WIDGETcxx . . $ `gtk/gtkwidget.h:44:9`! (dialog));
471 g_object_getcxx . . $ g_object_get(1ac911bdc4e9a14d). (settings, "gtk-keynav-use-caret", &use_caret, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
472 gtk_label_set_selectablecxx . . $ gtk_label_set_selectable(ae51c99326df3b2e). (GTK_LABELcxx . . $ `gtk/gtklabel.h:36:9`! (priv->label), use_caret);
473 gtk_label_set_selectablecxx . . $ gtk_label_set_selectable(ae51c99326df3b2e). (GTK_LABELcxx . . $ `gtk/gtklabel.h:36:9`! (priv->secondary_label), use_caret);
474 }
475
476 /**
477 * gtk_message_dialog_new:
478 * @parent: (nullable): transient parent
479 * @flags: flags
480 * @type: type of message
481 * @buttons: set of buttons to use
482 * @message_format: (nullable): printf()-style format string
483 * @...: arguments for @message_format
484 *
485 * Creates a new message dialog.
486 *
487 * This is a simple dialog with some text the user may want to see.
488 * When the user clicks a button a “response” signal is emitted with
489 * response IDs from [[email protected]]. See [[email protected]]
490 * for more details.
491 *
492 * Returns: (transfer none): a new `GtkMessageDialog`
493 *
494 * Deprecated: 4.10: Use [[email protected]] instead
495 */
496 GtkWidgetcxx . . $ GtkWidget#*
497 gtk_message_dialog_newcxx . . $ gtk_message_dialog_new(cea72bf2d847cac2). (GtkWindowcxx . . $ GtkWindow# *parent,
498 GtkDialogFlagscxx . . $ GtkDialogFlags# flags,
499 GtkMessageTypecxx . . $ GtkMessageType# type,
500 GtkButtonsTypecxx . . $ GtkButtonsType# buttons,
501 const char *message_format,
502 ...)
503 {
504 GtkWidgetcxx . . $ GtkWidget# *widget;
505 GtkDialogcxx . . $ GtkDialog# *dialog;
506 char * msg = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
507 va_listcxx . . $ va_list# args;
508
509 g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (parent == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! || GTK_IS_WINDOWcxx . . $ `gtk/gtkwindow.h:41:9`! (parent), NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
510
511 widget = g_object_newcxx . . $ g_object_new(8485fe61b4be4c78). (GTK_TYPE_MESSAGE_DIALOGcxx . . $ `gtk/deprecated/gtkmessagedialog.h:37:9`!,
512 "use-header-bar", FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!,
513 "message-type", type,
514 "buttons", buttons,
515 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
516 dialog = GTK_DIALOGcxx . . $ `gtk/deprecated/gtkdialog.h:92:9`! (widget);
517
518 if (message_format)
519 {
520 GtkMessageDialogPrivatecxx . . $ GtkMessageDialogPrivate# *priv = gtk_message_dialog_get_instance_privatecxx . . $ gtk_message_dialog_get_instance_private(b09e48515344d248). ((GtkMessageDialogcxx . . $ GtkMessageDialog#*)dialog);
521 va_startcxx . . $ `<external>/8105065126723003039/stdarg.h:50:9`! (args, message_format);
522 msg = g_strdup_vprintfcxx . . $ g_strdup_vprintf(db813db1ba4aba5a). (message_format, args);
523 va_endcxx . . $ `<external>/8105065126723003039/stdarg.h:52:9`! (args);
524
525 gtk_label_set_textcxx . . $ gtk_label_set_text(3d016a7109913fca). (GTK_LABELcxx . . $ `gtk/gtklabel.h:36:9`! (priv->label), msg);
526
527 g_freecxx . . $ g_free(5d22bdacc48458e8). (msg);
528 }
529
530 if (parent != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
531 gtk_window_set_transient_forcxx . . $ gtk_window_set_transient_for(6701bc127c5ef35c). (GTK_WINDOWcxx . . $ `gtk/gtkwindow.h:39:9`! (widget), GTK_WINDOWcxx . . $ `gtk/gtkwindow.h:39:9`! (parent));
532
533 if (flags & GTK_DIALOG_MODALcxx . . $ GTK_DIALOG_MODAL.)
534 gtk_window_set_modalcxx . . $ gtk_window_set_modal(3adb53e0a0f76453). (GTK_WINDOWcxx . . $ `gtk/gtkwindow.h:39:9`! (dialog), TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!);
535
536 if (flags & GTK_DIALOG_DESTROY_WITH_PARENTcxx . . $ GTK_DIALOG_DESTROY_WITH_PARENT.)
537 gtk_window_set_destroy_with_parentcxx . . $ gtk_window_set_destroy_with_parent(3adb53e0a0f76453). (GTK_WINDOWcxx . . $ `gtk/gtkwindow.h:39:9`! (dialog), TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!);
538
539 return widget;
540 }
541
542 /**
543 * gtk_message_dialog_new_with_markup:
544 * @parent: (nullable): transient parent
545 * @flags: flags
546 * @type: type of message
547 * @buttons: set of buttons to use
548 * @message_format: (nullable): printf()-style format string
549 * @...: arguments for @message_format
550 *
551 * Creates a new message dialog.
552 *
553 * This is a simple dialog with some text that is marked up with
554 * Pango markup. When the user clicks a button a “response” signal
555 * is emitted with response IDs from [[email protected]]. See
556 * [[email protected]] for more details.
557 *
558 * Special XML characters in the printf() arguments passed to this
559 * function will automatically be escaped as necessary.
560 * (See g_markup_printf_escaped() for how this is implemented.)
561 * Usually this is what you want, but if you have an existing
562 * Pango markup string that you want to use literally as the
563 * label, then you need to use [[email protected]_markup]
564 * instead, since you can’t pass the markup string either
565 * as the format (it might contain “%” characters) or as a string
566 * argument.
567 *
568 * ```c
569 * GtkWidget *dialog;
570 * GtkDialogFlags flags = GTK_DIALOG_DESTROY_WITH_PARENT;
571 * dialog = gtk_message_dialog_new (parent_window,
572 * flags,
573 * GTK_MESSAGE_ERROR,
574 * GTK_BUTTONS_CLOSE,
575 * NULL);
576 * gtk_message_dialog_set_markup (GTK_MESSAGE_DIALOG (dialog),
577 * markup);
578 * ```
579 *
580 * Returns: a new `GtkMessageDialog`
581 *
582 * Deprecated: 4.10: Use [[email protected]] instead
583 **/
584 GtkWidgetcxx . . $ GtkWidget#*
585 gtk_message_dialog_new_with_markupcxx . . $ gtk_message_dialog_new_with_markup(cea72bf2d847cac2). (GtkWindowcxx . . $ GtkWindow# *parent,
586 GtkDialogFlagscxx . . $ GtkDialogFlags# flags,
587 GtkMessageTypecxx . . $ GtkMessageType# type,
588 GtkButtonsTypecxx . . $ GtkButtonsType# buttons,
589 const char *message_format,
590 ...)
591 {
592 GtkWidgetcxx . . $ GtkWidget# *widget;
593 va_listcxx . . $ va_list# args;
594 char *msg = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
595
596 g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (parent == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! || GTK_IS_WINDOWcxx . . $ `gtk/gtkwindow.h:41:9`! (parent), NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
597
598 widget = gtk_message_dialog_newcxx . . $ gtk_message_dialog_new(cea72bf2d847cac2). (parent, flags, type, buttons, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
599
600 if (message_format)
601 {
602 va_startcxx . . $ `<external>/8105065126723003039/stdarg.h:50:9`! (args, message_format);
603 msg = g_markup_vprintf_escapedcxx . . $ g_markup_vprintf_escaped(db813db1ba4aba5a). (message_format, args);
604 va_endcxx . . $ `<external>/8105065126723003039/stdarg.h:52:9`! (args);
605
606 gtk_message_dialog_set_markupcxx . . $ gtk_message_dialog_set_markup(6cbb1c256ba973b0). (GTK_MESSAGE_DIALOGcxx . . $ `gtk/deprecated/gtkmessagedialog.h:38:9`! (widget), msg);
607
608 g_freecxx . . $ g_free(5d22bdacc48458e8). (msg);
609 }
610
611 return widget;
612 }
613
614 /**
615 * gtk_message_dialog_set_markup:
616 * @message_dialog: a `GtkMessageDialog`
617 * @str: string with Pango markup
618 *
619 * Sets the text of the message dialog.
620 *
621 * Deprecated: 4.10: Use [[email protected]] instead
622 */
623 void
624 gtk_message_dialog_set_markupcxx . . $ gtk_message_dialog_set_markup(6cbb1c256ba973b0). (GtkMessageDialogcxx . . $ GtkMessageDialog# *message_dialog,
625 const char *str)
626 {
627 GtkMessageDialogPrivatecxx . . $ GtkMessageDialogPrivate# *priv = gtk_message_dialog_get_instance_privatecxx . . $ gtk_message_dialog_get_instance_private(b09e48515344d248). (message_dialog);
628
629 g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (GTK_IS_MESSAGE_DIALOGcxx . . $ `gtk/deprecated/gtkmessagedialog.h:39:9`! (message_dialog));
630
631 priv->has_primary_markupcxx . . $ $anonymous_type_b03a8fe6a4f1ef80_0#has_primary_markup. = TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
632 gtk_label_set_markupcxx . . $ gtk_label_set_markup(3d016a7109913fca). (GTK_LABELcxx . . $ `gtk/gtklabel.h:36:9`! (priv->label), str);
633 }
634
635 /**
636 * gtk_message_dialog_format_secondary_text:
637 * @message_dialog: a `GtkMessageDialog`
638 * @message_format: (nullable): printf()-style format string
639 * @...: arguments for @message_format
640 *
641 * Sets the secondary text of the message dialog.
642 *
643 * Deprecated: 4.10: Use [[email protected]] instead
644 */
645 void
646 gtk_message_dialog_format_secondary_textcxx . . $ gtk_message_dialog_format_secondary_text(ae7ede32d2324479). (GtkMessageDialogcxx . . $ GtkMessageDialog# *message_dialog,
647 const char *message_format,
648 ...)
649 {
650 GtkMessageDialogPrivatecxx . . $ GtkMessageDialogPrivate# *priv = gtk_message_dialog_get_instance_privatecxx . . $ gtk_message_dialog_get_instance_private(b09e48515344d248). (message_dialog);
651 va_listcxx . . $ va_list# args;
652 char *msg = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
653
654 g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (GTK_IS_MESSAGE_DIALOGcxx . . $ `gtk/deprecated/gtkmessagedialog.h:39:9`! (message_dialog));
655
656 if (message_format)
657 {
658 priv->has_secondary_textcxx . . $ $anonymous_type_b03a8fe6a4f1ef80_0#has_secondary_text. = TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
659 gtk_widget_add_css_classcxx . . $ gtk_widget_add_css_class(3e0616a87a6c51e5). (priv->labelcxx . . $ $anonymous_type_b03a8fe6a4f1ef80_0#label., "title");
660
661 va_startcxx . . $ `<external>/8105065126723003039/stdarg.h:50:9`! (args, message_format);
662 msg = g_strdup_vprintfcxx . . $ g_strdup_vprintf(db813db1ba4aba5a). (message_format, args);
663 va_endcxx . . $ `<external>/8105065126723003039/stdarg.h:52:9`! (args);
664
665 gtk_label_set_textcxx . . $ gtk_label_set_text(3d016a7109913fca). (GTK_LABELcxx . . $ `gtk/gtklabel.h:36:9`! (priv->secondary_label), msg);
666
667 g_freecxx . . $ g_free(5d22bdacc48458e8). (msg);
668 }
669 else
670 {
671 priv->has_secondary_textcxx . . $ $anonymous_type_b03a8fe6a4f1ef80_0#has_secondary_text. = FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!;
672 gtk_widget_remove_css_classcxx . . $ gtk_widget_remove_css_class(3e0616a87a6c51e5). (priv->labelcxx . . $ $anonymous_type_b03a8fe6a4f1ef80_0#label., "title");
673 }
674
675 gtk_widget_set_visiblecxx . . $ gtk_widget_set_visible(81f145f668a0074f). (priv->secondary_labelcxx . . $ $anonymous_type_b03a8fe6a4f1ef80_0#secondary_label., priv->has_secondary_textcxx . . $ $anonymous_type_b03a8fe6a4f1ef80_0#has_secondary_text.);
676 }
677
678 /**
679 * gtk_message_dialog_format_secondary_markup:
680 * @message_dialog: a `GtkMessageDialog`
681 * @message_format: printf()-style string with Pango markup
682 * @...: arguments for @message_format
683 *
684 * Sets the secondary text of the message dialog.
685 *
686 * The @message_format is assumed to contain Pango markup.
687 *
688 * Due to an oversight, this function does not escape special
689 * XML characters like [[email protected]_with_markup]
690 * does. Thus, if the arguments may contain special XML characters,
691 * you should use g_markup_printf_escaped() to escape it.
692 *
693 * ```c
694 * char *msg;
695 *
696 * msg = g_markup_printf_escaped (message_format, ...);
697 * gtk_message_dialog_format_secondary_markup (message_dialog,
698 * "%s", msg);
699 * g_free (msg);
700 * ```
701 *
702 * Deprecated: 4.10: Use [[email protected]] instead
703 */
704 void
705 gtk_message_dialog_format_secondary_markupcxx . . $ gtk_message_dialog_format_secondary_markup(ae7ede32d2324479). (GtkMessageDialogcxx . . $ GtkMessageDialog# *message_dialog,
706 const char *message_format,
707 ...)
708 {
709 GtkMessageDialogPrivatecxx . . $ GtkMessageDialogPrivate# *priv = gtk_message_dialog_get_instance_privatecxx . . $ gtk_message_dialog_get_instance_private(b09e48515344d248). (message_dialog);
710 va_listcxx . . $ va_list# args;
711 char *msg = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
712
713 g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (GTK_IS_MESSAGE_DIALOGcxx . . $ `gtk/deprecated/gtkmessagedialog.h:39:9`! (message_dialog));
714
715 if (message_format)
716 {
717 priv->has_secondary_textcxx . . $ $anonymous_type_b03a8fe6a4f1ef80_0#has_secondary_text. = TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
718 gtk_widget_add_css_classcxx . . $ gtk_widget_add_css_class(3e0616a87a6c51e5). (priv->labelcxx . . $ $anonymous_type_b03a8fe6a4f1ef80_0#label., "title");
719
720 va_startcxx . . $ `<external>/8105065126723003039/stdarg.h:50:9`! (args, message_format);
721 msg = g_strdup_vprintfcxx . . $ g_strdup_vprintf(db813db1ba4aba5a). (message_format, args);
722 va_endcxx . . $ `<external>/8105065126723003039/stdarg.h:52:9`! (args);
723
724 gtk_label_set_markupcxx . . $ gtk_label_set_markup(3d016a7109913fca). (GTK_LABELcxx . . $ `gtk/gtklabel.h:36:9`! (priv->secondary_label), msg);
725
726 g_freecxx . . $ g_free(5d22bdacc48458e8). (msg);
727 }
728 else
729 {
730 priv->has_secondary_textcxx . . $ $anonymous_type_b03a8fe6a4f1ef80_0#has_secondary_text. = FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!;
731 gtk_widget_remove_css_classcxx . . $ gtk_widget_remove_css_class(3e0616a87a6c51e5). (priv->labelcxx . . $ $anonymous_type_b03a8fe6a4f1ef80_0#label., "title");
732 }
733
734 gtk_widget_set_visiblecxx . . $ gtk_widget_set_visible(81f145f668a0074f). (priv->secondary_labelcxx . . $ $anonymous_type_b03a8fe6a4f1ef80_0#secondary_label., priv->has_secondary_textcxx . . $ $anonymous_type_b03a8fe6a4f1ef80_0#has_secondary_text.);
735 }
736
737 /**
738 * gtk_message_dialog_get_message_area:
739 * @message_dialog: a `GtkMessageDialog`
740 *
741 * Returns the message area of the dialog.
742 *
743 * This is the box where the dialog’s primary and secondary labels
744 * are packed. You can add your own extra content to that box and it
745 * will appear below those labels. See [[email protected]_content_area]
746 * for the corresponding function in the parent [[email protected]].
747 *
748 * Returns: (transfer none): A `GtkBox` corresponding to the
749 * “message area” in the @message_dialog
750 *
751 * Deprecated: 4.10: Use [[email protected]] instead
752 */
753 GtkWidgetcxx . . $ GtkWidget# *
754 gtk_message_dialog_get_message_areacxx . . $ gtk_message_dialog_get_message_area(88cc649006763b5b). (GtkMessageDialogcxx . . $ GtkMessageDialog# *message_dialog)
755 {
756 GtkMessageDialogPrivatecxx . . $ GtkMessageDialogPrivate# *priv = gtk_message_dialog_get_instance_privatecxx . . $ gtk_message_dialog_get_instance_private(b09e48515344d248). (message_dialog);
757
758 g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (GTK_IS_MESSAGE_DIALOGcxx . . $ `gtk/deprecated/gtkmessagedialog.h:39:9`! (message_dialog), NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
759
760 return priv->message_areacxx . . $ $anonymous_type_b03a8fe6a4f1ef80_0#message_area.;
761 }