Mercurial > pidgin
comparison finch/libgnt/gntfilesel.h @ 15988:e05e5b148723
Allow using different methods for reading directory entries.
author | Sadrul Habib Chowdhury <imadil@gmail.com> |
---|---|
date | Wed, 04 Apr 2007 08:33:50 +0000 |
parents | 0f1ab43db297 |
children | 8410511f4dbb |
comparison
equal
deleted
inserted
replaced
15987:7adb832667fd | 15988:e05e5b148723 |
---|---|
18 #define GNT_FILE_SEL_UNSET_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 | 19 |
20 typedef struct _GntFileSel GntFileSel; | 20 typedef struct _GntFileSel GntFileSel; |
21 typedef struct _GntFileSelPriv GntFileSelPriv; | 21 typedef struct _GntFileSelPriv GntFileSelPriv; |
22 typedef struct _GntFileSelClass GntFileSelClass; | 22 typedef struct _GntFileSelClass GntFileSelClass; |
23 typedef struct _GntFile GntFile; | |
23 | 24 |
24 struct _GntFileSel | 25 struct _GntFileSel |
25 { | 26 { |
26 GntWindow parent; | 27 GntWindow parent; |
27 | 28 |
37 /* XXX: someone should make these useful */ | 38 /* XXX: someone should make these useful */ |
38 gboolean must_exist; /* Make sure the selected file (the name entered in 'location') exists */ | 39 gboolean must_exist; /* Make sure the selected file (the name entered in 'location') exists */ |
39 gboolean dirsonly; /* Show only directories */ | 40 gboolean dirsonly; /* Show only directories */ |
40 gboolean multiselect; | 41 gboolean multiselect; |
41 GList *tags; /* List of tagged files when multiselect is set */ | 42 GList *tags; /* List of tagged files when multiselect is set */ |
43 | |
44 gboolean (*read_fn)(const char *path, GList **files, GError **error); | |
42 }; | 45 }; |
43 | 46 |
44 struct _GntFileSelClass | 47 struct _GntFileSelClass |
45 { | 48 { |
46 GntWindowClass parent; | 49 GntWindowClass parent; |
48 void (*file_selected)(GntFileSel *sel, const char *path, const char *filename); | 51 void (*file_selected)(GntFileSel *sel, const char *path, const char *filename); |
49 void (*gnt_reserved1)(void); | 52 void (*gnt_reserved1)(void); |
50 void (*gnt_reserved2)(void); | 53 void (*gnt_reserved2)(void); |
51 void (*gnt_reserved3)(void); | 54 void (*gnt_reserved3)(void); |
52 void (*gnt_reserved4)(void); | 55 void (*gnt_reserved4)(void); |
56 }; | |
57 | |
58 typedef enum _GntFileType | |
59 { | |
60 GNT_FILE_REGULAR, | |
61 GNT_FILE_DIR | |
62 } GntFileType; | |
63 | |
64 struct _GntFile | |
65 { | |
66 char *fullpath; | |
67 char *basename; | |
68 GntFileType type; | |
69 unsigned long size; | |
53 }; | 70 }; |
54 | 71 |
55 G_BEGIN_DECLS | 72 G_BEGIN_DECLS |
56 | 73 |
57 GType gnt_file_sel_get_gtype(void); | 74 GType gnt_file_sel_get_gtype(void); |
74 | 91 |
75 void gnt_file_sel_set_multi_select(GntFileSel *sel, gboolean set); | 92 void gnt_file_sel_set_multi_select(GntFileSel *sel, gboolean set); |
76 | 93 |
77 void gnt_file_sel_set_suggested_filename(GntFileSel *sel, const char *suggest); | 94 void gnt_file_sel_set_suggested_filename(GntFileSel *sel, const char *suggest); |
78 | 95 |
96 void gnt_file_sel_set_read_fn(GntFileSel *sel, gboolean (*read_fn)(const char *path, GList **files, GError **error)); | |
97 | |
98 GntFile* gnt_file_new(const char *name, unsigned long size); | |
99 | |
100 GntFile* gnt_file_new_dir(const char *name); | |
101 | |
79 G_END_DECLS | 102 G_END_DECLS |
80 | 103 |
81 #endif /* GNT_FILE_SEL_H */ | 104 #endif /* GNT_FILE_SEL_H */ |
82 | 105 |