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

#include <gtk/gtk.h>

G_BEGIN_DECLS

#ifdef ENABLE_NLS
#include <libintl.h>
#define _(String) dgettext(GETTEXT_PACKAGE,String)
#ifdef gettext_noop
#define N_(String) gettext_noop(String)
#else
#define N_(String) (String)
#endif
#else /* NLS is disabled */
#define _(String) (String)
#define N_(String) (String)
#define textdomain(String) (String)
#define gettext(String) (String)
#define dgettext(Domain,String) (String)
#define dcgettext(Domain,String,Type) (String)
#define bindtextdomain(Domain,Directory) (Domain) 
#endif

typedef struct {
  gchar *dialog_title;
  gchar *window_icon;
  gint   width;
  gint   height;
  gint   exit_code;
  gint   timeout_delay;
} 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_ERROR,
  ZENITY_MSG_INFO
} MsgMode;

typedef struct {
  gchar   *dialog_text;
  MsgMode  mode;
  gboolean no_wrap;
  gchar   *ok_label;
  gchar   *cancel_label;
} 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;
} ZenityProgressData;

typedef struct {
  gchar         *uri;
  gboolean       editable;
  GtkTextBuffer	*buffer;
} ZenityTextData;

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

typedef struct {
  gchar   *notification_text;
  gboolean listen;
} ZenityNotificationData;

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

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);
void	zenity_notification	(ZenityData		*data,
				 ZenityNotificationData	*notification_data);
void    zenity_colorselection   (ZenityData             *data,
                                 ZenityColorData        *notification_data);
void	zenity_scale		(ZenityData		*data,
				 ZenityScaleData	*scale_data);
void    zenity_about            (ZenityData             *data);

G_END_DECLS

#endif /* ZENITY_H */