r3768: Updated years.
[rox-filer.git] / ROX-Filer / src / global.h
blob984ca8d077d631a4d4ba7d9b9529c9d07073f839
1 /*
2 * ROX-Filer, filer for the ROX desktop project
3 * By Thomas Leonard, <tal197@users.sourceforge.net>.
4 */
6 /* global.h is included by most of the other source files, just after
7 * including config.h and the system header files, but before any other
8 * ROX-Filer header files.
9 */
11 #include <glib.h>
13 #ifdef HAVE_GNOME_VFS
14 # include <libgnomevfs/gnome-vfs.h>
15 #endif
17 /* We put all the global typedefs here to avoid creating dependencies
18 * between header files.
21 /* Each filer window has one of these all to itself */
22 typedef struct _FilerWindow FilerWindow;
24 /* There is one Directory object per cached disk directory inode number.
25 * Multiple FilerWindows may share a single Directory. Directories
26 * are cached, so a Directory may exist without any filer windows
27 * referencing it at all.
29 typedef struct _Directory Directory;
31 /* Each item in a directory has a DirItem. This contains information from
32 * stat()ing the file, plus a few other bits. There may be several of these
33 * for a single file, if it appears (hard-linked) in several directories.
34 * Each pinboard and panel icon also has one of these (not shared).
36 typedef struct _DirItem DirItem;
38 /* Widgets which can display directories implement the View interface.
39 * This should be used in preference to the old collection interface because
40 * it isn't specific to a particular type of display.
42 typedef struct _ViewIface ViewIface;
44 /* A ViewIter specifies a single item in a View, rather like an index.
45 * They can be used to iterate over all the items in a View, and remain
46 * valid until the View is changed. If allocated on the stack, they do not need
47 * to be freed.
49 typedef struct _ViewIter ViewIter;
51 /* This contains the pixbufs for an image, in various sizes.
52 * Despite the name, it now contains neither pixmaps nor masks!
54 typedef struct _MaskedPixmap MaskedPixmap;
56 /* Each MIME type (eg 'text/plain') has one of these. It contains
57 * a link to the image and the type's name (used so that the image can
58 * be refreshed, among other things).
60 typedef struct _MIME_type MIME_type;
62 /* Icon is an abstract base class for pinboard and panel icons.
63 * It contains the name and path of the icon, as well as its DirItem.
65 typedef struct _Icon Icon;
67 /* There will be one of these if the pinboard is in use. It contains
68 * the name of the pinboard and links to the pinned Icons inside.
70 typedef struct _Pinboard Pinboard;
72 /* There is one of these for each panel window open. Panels work rather
73 * like little pinboards, but with a more rigid layout.
75 typedef struct _Panel Panel;
77 /* Each option has a static Option structure. This is initialised by
78 * calling option_add_int() or similar. See options.c for details.
79 * This structure is read-only.
81 typedef struct _Option Option;
83 /* A filesystem cache provides a quick and easy way to load files.
84 * When a cache is created, functions to load and update files are
85 * registered to it. Requesting an object from the cache will load
86 * or update it as needed, or return the cached copy if the current
87 * version of the file is already cached.
88 * Caches are used to access directories, images and XML files.
90 typedef struct _GFSCache GFSCache;
92 /* Each cached XML file is represented by one of these */
93 typedef struct _XMLwrapper XMLwrapper;
95 /* This holds a pre-parsed version of a filename, which can be quickly
96 * compared with another CollateKey for intelligent sorting.
98 typedef struct _CollateKey CollateKey;
100 /* Like a regular GtkLabel, except that the text can be wrapped to any
101 * width. Used for pinboard icons.
103 typedef struct _WrappedLabel WrappedLabel;
105 /* A filename where " " has been replaced by "%20", etc.
106 * This is really just a string, but we try to catch type errors.
108 typedef struct _EscapedPath EscapedPath;
110 /* The minibuffer is a text field which appears at the bottom of
111 * a filer window. It has various modes of operation:
113 typedef enum {
114 MINI_NONE,
115 MINI_PATH,
116 MINI_SHELL,
117 MINI_SELECT_IF,
118 MINI_FILTER,
119 MINI_SELECT_BY_NAME,
120 } MiniType;
122 /* The next three correspond to the styles on the Display submenu: */
124 typedef enum { /* Values used in options, must start at 0 */
125 LARGE_ICONS = 0,
126 SMALL_ICONS = 1,
127 HUGE_ICONS = 2,
128 AUTO_SIZE_ICONS = 3,
129 UNKNOWN_STYLE
130 } DisplayStyle;
132 typedef enum { /* Values used in options, must start at 0 */
133 DETAILS_NONE = 0,
134 DETAILS_SIZE = 2,
135 DETAILS_PERMISSIONS = 3,
136 DETAILS_TYPE = 4,
137 DETAILS_TIMES = 5,
138 DETAILS_UNKNOWN = -1,
139 } DetailsType;
141 typedef enum { /* Values used in options */
142 SORT_NAME = 0,
143 SORT_TYPE = 1,
144 SORT_DATE = 2,
145 SORT_SIZE = 3,
146 SORT_OWNER = 4,
147 SORT_GROUP = 5
148 } SortType;
150 /* Each DirItem has a base type with indicates what kind of object it is.
151 * If the base_type is TYPE_FILE, then the MIME type field gives the exact
152 * type.
154 enum
156 /* Base types - this also determines the sort order */
157 TYPE_ERROR,
158 TYPE_UNKNOWN, /* Not scanned yet */
159 TYPE_DIRECTORY,
160 TYPE_PIPE,
161 TYPE_SOCKET,
162 TYPE_FILE,
163 TYPE_CHAR_DEVICE,
164 TYPE_BLOCK_DEVICE,
165 TYPE_DOOR,
167 /* These are purely for colour allocation */
168 TYPE_EXEC,
169 TYPE_APPDIR,
172 /* The namespaces for the SOAP messages */
173 #define SOAP_ENV_NS_OLD "http://www.w3.org/2001/06/soap-envelope"
174 #define SOAP_ENV_NS "http://www.w3.org/2001/12/soap-envelope"
175 #define SOAP_RPC_NS "http://www.w3.org/2001/12/soap-rpc"
176 #define ROX_NS "http://rox.sourceforge.net/SOAP/ROX-Filer"
178 /* Stock icons */
179 #define ROX_STOCK_SHOW_DETAILS "rox-show-details"
180 #define ROX_STOCK_SHOW_HIDDEN "rox-show-hidden"
181 #define ROX_STOCK_SELECT "rox-select"
182 #define ROX_STOCK_MOUNT "rox-mount"
183 #define ROX_STOCK_MOUNTED "rox-mounted"
184 #define ROX_STOCK_BOOKMARKS GTK_STOCK_JUMP_TO
186 #include <libxml/tree.h>