9
|
1 /*
|
|
2 * (SLIK) SimpLIstic sKin functions
|
|
3 * (C) 2004 John Ellis
|
475
|
4 * Copyright (C) 2008 The Geeqie Team
|
9
|
5 *
|
|
6 * Author: John Ellis
|
|
7 *
|
|
8 * This software is released under the GNU General Public License (GNU GPL).
|
|
9 * Please read the included file COPYING for more information.
|
|
10 * This software comes with no warranty of any kind, use at your own risk!
|
|
11 */
|
|
12
|
|
13 #ifndef UI_UTILDLG_H
|
|
14 #define UI_UTILDLG_H
|
|
15
|
|
16
|
|
17 #define GENERIC_DIALOG(gd) ((GenericDialog *)gd)
|
|
18
|
|
19 typedef struct _GenericDialog GenericDialog;
|
|
20 struct _GenericDialog
|
|
21 {
|
|
22 GtkWidget *dialog; /* window */
|
|
23 GtkWidget *vbox; /* place to add widgets */
|
|
24
|
|
25 GtkWidget *hbox; /* button hbox */
|
|
26
|
|
27 gint auto_close;
|
|
28
|
|
29 void (*default_cb)(GenericDialog *, gpointer);
|
|
30 void (*cancel_cb)(GenericDialog *, gpointer);
|
|
31 gpointer data;
|
|
32
|
|
33 /* private */
|
|
34 GtkWidget *cancel_button;
|
|
35 };
|
|
36
|
|
37 typedef struct _FileDialog FileDialog;
|
|
38 struct _FileDialog
|
|
39 {
|
|
40 GenericDialog gd;
|
|
41
|
|
42 GtkWidget *entry;
|
|
43
|
|
44 gint type;
|
|
45 gint multiple_files;
|
|
46
|
138
|
47 FileData *source_fd;
|
9
|
48 GList *source_list;
|
|
49
|
|
50 gchar *dest_path;
|
|
51 };
|
|
52
|
|
53
|
|
54 /* When parent is not NULL, the dialog is set as a transient of the window containing parent */
|
|
55 GenericDialog *generic_dialog_new(const gchar *title,
|
|
56 const gchar *wmclass, const gchar *wmsubclass,
|
|
57 GtkWidget *parent, gint auto_close,
|
|
58 void (*cancel_cb)(GenericDialog *, gpointer), gpointer data);
|
|
59 void generic_dialog_close(GenericDialog *gd);
|
|
60
|
|
61 GtkWidget *generic_dialog_add_button(GenericDialog *gd, const gchar *stock_id, const gchar *text,
|
|
62 void (*func_cb)(GenericDialog *, gpointer), gint is_default);
|
|
63 void generic_dialog_attach_default(GenericDialog *gd, GtkWidget *widget);
|
|
64
|
|
65 GtkWidget *generic_dialog_add_message(GenericDialog *gd, const gchar *icon_stock_id,
|
|
66 const gchar *heading, const gchar *text);
|
|
67
|
|
68 gint generic_dialog_get_alternative_button_order(GtkWidget *widget);
|
|
69
|
|
70 GenericDialog *warning_dialog(const gchar *heading, const gchar *text,
|
|
71 const gchar *icon_stock_id, GtkWidget *parent);
|
|
72
|
|
73 FileDialog *file_dialog_new(const gchar *title,
|
|
74 const gchar *wmclass, const gchar *wmsubclass,
|
|
75 GtkWidget *parent,
|
|
76 void (*cancel_cb)(FileDialog *, gpointer), gpointer data);
|
|
77 void file_dialog_close(FileDialog *fd);
|
|
78
|
|
79 GtkWidget *file_dialog_add_button(FileDialog *fd, const gchar *stock_id, const gchar *text,
|
|
80 void (*func_cb)(FileDialog *, gpointer), gint is_default);
|
|
81
|
|
82 /* default_path is default base directory, and is only used if no history
|
|
83 * exists for history_key (HOME is used if default_path is NULL).
|
|
84 * path can be a full path or only a file name. If name only, appended to
|
|
85 * the default_path or the last history (see default_path)
|
|
86 */
|
|
87 void file_dialog_add_path_widgets(FileDialog *fd, const gchar *default_path, const gchar *path,
|
|
88 const gchar *history_key, const gchar *filter, const gchar *filter_desc);
|
|
89
|
|
90 void file_dialog_add_filter(FileDialog *fd, const gchar *filter, const gchar *filter_desc, gint set);
|
|
91 void file_dialog_clear_filter(FileDialog *fd);
|
|
92 void file_dialog_sync_history(FileDialog *fd, gint dir_only);
|
|
93
|
|
94
|
|
95 #endif
|