summaryrefslogtreecommitdiff
path: root/src/zenity.h
blob: 404eec774eb4ef8cba45ad3991e102286e334635 (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
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
#ifndef ZENITY_H
#define ZENITY_H

#include <gtk/gtk.h>

G_BEGIN_DECLS

#include <libintl.h>
#define _(String) dgettext (GETTEXT_PACKAGE, String)
#ifdef gettext_noop
#define N_(String) gettext_noop (String)
#else
#define N_(String) (String)
#endif

typedef struct {
	gchar *dialog_title;
	gchar *window_icon;
	gchar *ok_label;
	gchar *cancel_label;
	gchar **extra_label;
	gint width;
	gint height;
	gint exit_code;
	gint timeout_delay;
	gboolean modal;
	guintptr attach;
} ZenityData;

typedef enum {
	ZENITY_OK,
	ZENITY_CANCEL,
	ZENITY_ESC,
	ZENITY_ERROR,
	ZENITY_EXTRA,
	ZENITY_TIMEOUT
} ZenityExitCode;

typedef struct {
	gchar *dialog_text;
	gint day;
	gint month;
	gint year;
	gchar *date_format;
} ZenityCalendarData;

typedef enum {
	ZENITY_MSG_WARNING,
	ZENITY_MSG_QUESTION,
	ZENITY_MSG_SWITCH,
	ZENITY_MSG_ERROR,
	ZENITY_MSG_INFO
} MsgMode;

typedef struct {
	gchar *dialog_text;
	gchar *dialog_icon;
	MsgMode mode;
	gboolean no_wrap;
	gboolean no_markup;
	gboolean default_cancel;
	gboolean ellipsize;
} ZenityMsgData;

typedef struct {
	gchar *dialog_text;
	gint value;
	gint min_value;
	gint max_value;
	gint step;
	gboolean print_partial;
	gboolean hide_value;
} ZenityScaleData;

typedef struct {
	gchar *uri;
	gboolean multi;
	gboolean directory;
	gboolean save;
	gboolean confirm_overwrite;
	gchar *separator;
	gchar **filter;
} ZenityFileData;

typedef struct {
	gchar *dialog_text;
	gchar *entry_text;
	gboolean hide_text;
	const gchar **data;
} ZenityEntryData;

typedef struct {
	gchar *dialog_text;
	gchar *entry_text;
	gboolean pulsate;
	gboolean autoclose;
	gboolean autokill;
	gdouble percentage;
	gboolean no_cancel;
	gboolean time_remaining;
} ZenityProgressData;

typedef struct {
	gchar *uri;
	gboolean editable;
	gboolean no_wrap;
	gboolean auto_scroll;
	gchar *font;
	GtkTextBuffer *buffer;
	gchar *checkbox;
#ifdef HAVE_WEBKITGTK
	gboolean html;
	gboolean no_interaction;
	gchar *url;
#endif
} ZenityTextData;

typedef struct {
	gchar *dialog_text;
	GSList *columns;
	gboolean checkbox;
	gboolean radiobox;
	gboolean hide_header;
	gboolean imagebox;
	gchar *separator;
	gboolean multi;
	gboolean editable;
	gboolean mid_search;
	gchar *print_column;
	gchar *hide_column;
	const gchar **data;
} ZenityTreeData;

#ifdef HAVE_LIBNOTIFY
typedef struct {
	gchar *notification_text;
	gboolean listen;
	gchar **notification_hints;
} ZenityNotificationData;
#endif

typedef struct {
	gchar *color;
	gboolean show_palette;
} ZenityColorData;

typedef struct {
	GSList *list;
	GSList *list_widgets;
	GSList *list_values;
	GSList *column_values;
	GSList *combo_values;
	gchar *dialog_text;
	gchar *separator;
	gchar *date_format;
	//  gchar *hide_column;
	gboolean show_header;
} ZenityFormsData;

typedef enum {
	ZENITY_FORMS_ENTRY,
	ZENITY_FORMS_PASSWORD,
	ZENITY_FORMS_CALENDAR,
	ZENITY_FORMS_LIST,
	ZENITY_FORMS_COMBO
} ZenityFormsType;

typedef struct {
	gchar *option_value;
	ZenityFormsType type;
	GtkWidget *forms_widget;
} ZenityFormsValue;

typedef struct {
	gboolean username;
	gchar *password;
	GtkWidget *entry_username;
	GtkWidget *entry_password;
} ZenityPasswordData;

void zenity_calendar (ZenityData *data, ZenityCalendarData *calendar_data);
void zenity_msg (ZenityData *data, ZenityMsgData *msg_data);
void zenity_fileselection (ZenityData *data, ZenityFileData *file_data);
void zenity_entry (ZenityData *data, ZenityEntryData *entry_data);
void zenity_progress (ZenityData *data, ZenityProgressData *progress_data);
void zenity_text (ZenityData *data, ZenityTextData *text_data);
void zenity_tree (ZenityData *data, ZenityTreeData *tree_data);
#ifdef HAVE_LIBNOTIFY
void zenity_notification (
	ZenityData *data, ZenityNotificationData *notification_data);
#endif

void zenity_colorselection (
	ZenityData *data, ZenityColorData *notification_data);
void zenity_scale (ZenityData *data, ZenityScaleData *scale_data);
void zenity_about (ZenityData *data);

void zenity_password_dialog (
	ZenityData *data, ZenityPasswordData *password_data);
void zenity_forms_dialog (ZenityData *data, ZenityFormsData *forms_data);
G_END_DECLS

#endif /* ZENITY_H */
bgstack15