| |
1 #ifndef GNT_FILE_SEL_H |
| |
2 #define GNT_FILE_SEL_H |
| |
3 |
| |
4 #include "gntwindow.h" |
| |
5 #include "gnt.h" |
| |
6 #include "gntcolors.h" |
| |
7 #include "gntkeys.h" |
| |
8 |
| |
9 #define GNT_TYPE_FILE_SEL (gnt_file_sel_get_gtype()) |
| |
10 #define GNT_FILE_SEL(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GNT_TYPE_FILE_SEL, GntFileSel)) |
| |
11 #define GNT_FILE_SEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GNT_TYPE_FILE_SEL, GntFileSelClass)) |
| |
12 #define GNT_IS_FILE_SEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GNT_TYPE_FILE_SEL)) |
| |
13 #define GNT_IS_FILE_SEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GNT_TYPE_FILE_SEL)) |
| |
14 #define GNT_FILE_SEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GNT_TYPE_FILE_SEL, GntFileSelClass)) |
| |
15 |
| |
16 #define GNT_FILE_SEL_FLAGS(obj) (GNT_FILE_SEL(obj)->priv.flags) |
| |
17 #define GNT_FILE_SEL_SET_FLAGS(obj, flags) (GNT_FILE_SEL_FLAGS(obj) |= flags) |
| |
18 #define GNT_FILE_SEL_UNSET_FLAGS(obj, flags) (GNT_FILE_SEL_FLAGS(obj) &= ~(flags)) |
| |
19 |
| |
20 typedef struct _GnFileSel GntFileSel; |
| |
21 typedef struct _GnFileSelPriv GntFileSelPriv; |
| |
22 typedef struct _GnFileSelClass GntFileSelClass; |
| |
23 |
| |
24 struct _GnFileSel |
| |
25 { |
| |
26 GntWindow parent; |
| |
27 |
| |
28 GntWidget *dirs; /* list of files */ |
| |
29 GntWidget *files; /* list of directories */ |
| |
30 GntWidget *location; /* location entry */ |
| |
31 |
| |
32 GntWidget *select; /* select button */ |
| |
33 GntWidget *cancel; /* cancel button */ |
| |
34 |
| |
35 char *current; /* Full path of the current location */ |
| |
36 /* XXX: someone should make these useful */ |
| |
37 gboolean must_exist; /* Make sure the selected file (the name entered in 'location') exists */ |
| |
38 gboolean dirsonly; /* Show only directories */ |
| |
39 }; |
| |
40 |
| |
41 struct _GnFileSelClass |
| |
42 { |
| |
43 GntWindowClass parent; |
| |
44 |
| |
45 void (*file_selected)(GntFileSel *sel, const char *path, const char *filename); |
| |
46 void (*gnt_reserved1)(void); |
| |
47 void (*gnt_reserved2)(void); |
| |
48 void (*gnt_reserved3)(void); |
| |
49 void (*gnt_reserved4)(void); |
| |
50 }; |
| |
51 |
| |
52 G_BEGIN_DECLS |
| |
53 |
| |
54 GType gnt_file_sel_get_gtype(void); |
| |
55 |
| |
56 GntWidget *gnt_file_sel_new(); |
| |
57 |
| |
58 gboolean gnt_file_sel_set_current_location(GntFileSel *sel, const char *path); |
| |
59 |
| |
60 const char *gnt_file_sel_get_current_location(GntFileSel *sel); |
| |
61 |
| |
62 G_END_DECLS |
| |
63 |
| |
64 #endif /* GNT_FILE_SEL_H */ |