summaryrefslogtreecommitdiff
path: root/src/util.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/util.h')
-rw-r--r--src/util.h25
1 files changed, 18 insertions, 7 deletions
diff --git a/src/util.h b/src/util.h
index fd3d446..5ea703d 100644
--- a/src/util.h
+++ b/src/util.h
@@ -7,7 +7,7 @@
* © 1999, 2000 Red Hat Inc.
* © 1998 James Henstridge
* © 1995-2002 Free Software Foundation
- * © 2021 Logan Rathbone
+ * © 2021-2023 Logan Rathbone
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -33,8 +33,7 @@
* Tom Tromey <tromey@redhat.com>
*/
-#ifndef UTIL_H
-#define UTIL_H
+#pragma once
#include "zenity.h"
#include <gtk/gtk.h>
@@ -43,6 +42,17 @@ G_BEGIN_DECLS
#define ZENITY_IMAGE_FULLPATH(filename) (PACKAGE_DATADIR "/" filename)
+#define ZENITY_UTIL_ADD_EXTRA_LABELS(DIALOG) \
+ for (int i = 0; data->extra_label[i] != NULL; ++i) { \
+ zenity_util_add_button (ADW_MESSAGE_DIALOG (DIALOG), data->extra_label[i], i); \
+ }
+
+#define ZENITY_UTIL_SETUP_OK_BUTTON_LABEL(DIALOG) \
+ adw_message_dialog_set_response_label (ADW_MESSAGE_DIALOG(DIALOG), "ok", data->ok_label);
+
+#define ZENITY_UTIL_SETUP_CANCEL_BUTTON_LABEL(DIALOG) \
+ adw_message_dialog_set_response_label (ADW_MESSAGE_DIALOG(DIALOG), "cancel", data->cancel_label);
+
GIcon *zenity_util_gicon_from_string (const char *str);
GtkBuilder *zenity_util_load_ui_file (const char *widget_root,
...) G_GNUC_NULL_TERMINATED;
@@ -53,11 +63,12 @@ void zenity_util_show_help (GError **error);
int zenity_util_return_exit_code (ZenityExitCode value);
void zenity_util_exit_code_with_data (ZenityExitCode value, ZenityData *data);
void zenity_util_show_dialog (GtkWidget *widget);
-gboolean zenity_util_timeout_handle (gpointer data);
+gboolean zenity_util_timeout_handle (AdwMessageDialog *dialog);
char *zenity_util_pango_font_description_to_css (PangoFontDescription *desc);
void zenity_util_gapp_main (GtkWindow *window);
-void zenity_util_gapp_quit (GtkWindow *window);
+void zenity_util_gapp_quit (GtkWindow *window, ZenityData *data);
+ZenityExitCode zenity_util_parse_dialog_response (const char *response);
+GtkWidget *zenity_util_add_button (AdwMessageDialog *dialog, const char
+ *button_text, ZenityExitCode response_id);
G_END_DECLS
-
-#endif /* UTIL_H */