r110: Added a option for using RISC OS mouse bindings to the options box, although
[rox-filer.git] / ROX-Filer / src / filer.h
blob14cd786fc75b2cfac379e4f9d64469b11fd43da7
1 /*
2 * $Id$
4 * ROX-Filer, filer for the ROX desktop project
5 * By Thomas Leonard, <tal197@ecs.soton.ac.uk>.
6 */
8 #ifndef _FILER_H
9 #define _FILER_H
11 #include <gtk/gtk.h>
12 #include "collection.h"
13 #include "pixmaps.h"
14 #include <sys/types.h>
15 #include <dirent.h>
17 typedef struct _FilerWindow FilerWindow;
18 typedef struct _FileItem FileItem;
19 typedef enum {LEFT, RIGHT, TOP, BOTTOM} Side;
21 typedef enum
23 ITEM_FLAG_SYMLINK = 0x01, /* Is a symlink */
24 ITEM_FLAG_APPDIR = 0x02, /* Contains /AppInfo */
25 ITEM_FLAG_MOUNT_POINT = 0x04, /* Is in mtab or fstab */
26 ITEM_FLAG_MOUNTED = 0x08, /* Is in /etc/mtab */
27 ITEM_FLAG_TEMP_ICON = 0x10, /* Free icon after use */
28 ITEM_FLAG_EXEC_FILE = 0x20, /* File, and has an X bit set */
29 ITEM_FLAG_MAY_DELETE = 0x40, /* Delete on finishing scan */
30 } ItemFlags;
32 typedef enum
34 FILER_NEEDS_RESCAN = 0x01, /* Call may_rescan after scanning */
35 FILER_UPDATING = 0x02, /* (scanning) items may already exist */
36 } FilerFlags;
38 #include "type.h"
40 struct _FilerWindow
42 GtkWidget *window;
43 char *path; /* pathname */
44 Collection *collection;
45 gboolean panel;
46 gboolean temp_item_selected;
47 gboolean show_hidden;
48 FilerFlags flags;
49 Side panel_side;
50 time_t m_time; /* m-time at last scan */
51 int (*sort_fn)(const void *a, const void *b);
53 /* Scanning */
54 DIR *dir;
55 gint idle_scan_id; /* (only if dir != NULL) */
56 guint scan_min_width; /* Min width possible so far */
59 struct _FileItem
61 char *leafname;
63 int base_type; /* (regular file, dir, pipe, etc) */
64 MIME_type *mime_type; /* NULL, except for non-exec files */
65 ItemFlags flags;
67 int text_width;
68 int pix_width;
69 int pix_height;
70 MaskedPixmap *image;
73 extern FilerWindow *window_with_focus;
74 extern GHashTable *child_to_filer;
76 /* Prototypes */
77 void filer_init();
78 void filer_opendir(char *path, gboolean panel, Side panel_side);
79 void update_dir(FilerWindow *filer_window);
80 void scan_dir(FilerWindow *filer_window);
81 FileItem *selected_item(Collection *collection);
82 void refresh_dirs(char *path);
83 void change_to_parent(FilerWindow *filer_window);
85 #endif /* _FILER_H */