annotate finch/libgnt/gntfilesel.h @ 15849:65b45106bfbb

Use the file selector for request-file.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Tue, 20 Mar 2007 11:52:46 +0000
parents 3da9d5da9054
children f771cdcc551a b4086a92568f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
15846
a2ab257116ce File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
1 #ifndef GNT_FILE_SEL_H
a2ab257116ce File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
2 #define GNT_FILE_SEL_H
a2ab257116ce File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
3
a2ab257116ce File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
4 #include "gntwindow.h"
a2ab257116ce File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
5 #include "gnt.h"
a2ab257116ce File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
6 #include "gntcolors.h"
a2ab257116ce File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
7 #include "gntkeys.h"
a2ab257116ce File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
8
a2ab257116ce File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
9 #define GNT_TYPE_FILE_SEL (gnt_file_sel_get_gtype())
a2ab257116ce File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
10 #define GNT_FILE_SEL(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GNT_TYPE_FILE_SEL, GntFileSel))
a2ab257116ce File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
11 #define GNT_FILE_SEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GNT_TYPE_FILE_SEL, GntFileSelClass))
a2ab257116ce File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
12 #define GNT_IS_FILE_SEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GNT_TYPE_FILE_SEL))
a2ab257116ce File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
13 #define GNT_IS_FILE_SEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GNT_TYPE_FILE_SEL))
a2ab257116ce File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
14 #define GNT_FILE_SEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GNT_TYPE_FILE_SEL, GntFileSelClass))
a2ab257116ce File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
15
a2ab257116ce File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
16 #define GNT_FILE_SEL_FLAGS(obj) (GNT_FILE_SEL(obj)->priv.flags)
a2ab257116ce File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
17 #define GNT_FILE_SEL_SET_FLAGS(obj, flags) (GNT_FILE_SEL_FLAGS(obj) |= flags)
a2ab257116ce File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
18 #define GNT_FILE_SEL_UNSET_FLAGS(obj, flags) (GNT_FILE_SEL_FLAGS(obj) &= ~(flags))
a2ab257116ce File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
19
a2ab257116ce File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
20 typedef struct _GnFileSel GntFileSel;
a2ab257116ce File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
21 typedef struct _GnFileSelPriv GntFileSelPriv;
a2ab257116ce File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
22 typedef struct _GnFileSelClass GntFileSelClass;
a2ab257116ce File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
23
a2ab257116ce File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
24 struct _GnFileSel
a2ab257116ce File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
25 {
a2ab257116ce File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
26 GntWindow parent;
a2ab257116ce File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
27
a2ab257116ce File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
28 GntWidget *dirs; /* list of files */
a2ab257116ce File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
29 GntWidget *files; /* list of directories */
a2ab257116ce File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
30 GntWidget *location; /* location entry */
a2ab257116ce File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
31
a2ab257116ce File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
32 GntWidget *select; /* select button */
a2ab257116ce File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
33 GntWidget *cancel; /* cancel button */
a2ab257116ce File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
34
a2ab257116ce File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
35 char *current; /* Full path of the current location */
a2ab257116ce File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
36 /* XXX: someone should make these useful */
a2ab257116ce File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
37 gboolean must_exist; /* Make sure the selected file (the name entered in 'location') exists */
a2ab257116ce File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
38 gboolean dirsonly; /* Show only directories */
a2ab257116ce File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
39 };
a2ab257116ce File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
40
a2ab257116ce File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
41 struct _GnFileSelClass
a2ab257116ce File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
42 {
a2ab257116ce File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
43 GntWindowClass parent;
a2ab257116ce File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
44
a2ab257116ce File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
45 void (*file_selected)(GntFileSel *sel, const char *path, const char *filename);
a2ab257116ce File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
46 void (*gnt_reserved1)(void);
a2ab257116ce File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
47 void (*gnt_reserved2)(void);
a2ab257116ce File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
48 void (*gnt_reserved3)(void);
a2ab257116ce File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
49 void (*gnt_reserved4)(void);
a2ab257116ce File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
50 };
a2ab257116ce File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
51
a2ab257116ce File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
52 G_BEGIN_DECLS
a2ab257116ce File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
53
a2ab257116ce File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
54 GType gnt_file_sel_get_gtype(void);
a2ab257116ce File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
55
a2ab257116ce File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
56 GntWidget *gnt_file_sel_new();
a2ab257116ce File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
57
a2ab257116ce File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
58 gboolean gnt_file_sel_set_current_location(GntFileSel *sel, const char *path);
a2ab257116ce File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
59
a2ab257116ce File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
60 const char *gnt_file_sel_get_current_location(GntFileSel *sel);
a2ab257116ce File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
61
15848
3da9d5da9054 Directory only selection.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 15846
diff changeset
62 void gnt_file_sel_set_dirs_only(GntFileSel *sel, gboolean dirs);
3da9d5da9054 Directory only selection.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 15846
diff changeset
63
3da9d5da9054 Directory only selection.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 15846
diff changeset
64 gboolean gnt_file_sel_get_dirs_only(GntFileSel *sel);
3da9d5da9054 Directory only selection.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 15846
diff changeset
65
15849
65b45106bfbb Use the file selector for request-file.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 15848
diff changeset
66 void gnt_file_sel_set_must_exist(GntFileSel *sel, gboolean must);
65b45106bfbb Use the file selector for request-file.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 15848
diff changeset
67
65b45106bfbb Use the file selector for request-file.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 15848
diff changeset
68 gboolean gnt_file_sel_get_must_exist(GntFileSel *sel);
65b45106bfbb Use the file selector for request-file.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 15848
diff changeset
69
65b45106bfbb Use the file selector for request-file.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 15848
diff changeset
70 char *gnt_file_sel_get_selected_file(GntFileSel *sel); /* The returned value should be free'd */
65b45106bfbb Use the file selector for request-file.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 15848
diff changeset
71
15846
a2ab257116ce File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
72 G_END_DECLS
a2ab257116ce File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
73
a2ab257116ce File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
74 #endif /* GNT_FILE_SEL_H */