r32: Improved the panel code.
[rox-filer.git] / ROX-Filer / src / filer.h
blob215ebb5ae5ac97ce89361eac39252c2f82e39d42
1 /* vi: set cindent:
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 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 */
30 struct _FilerWindow
32 GtkWidget *window;
33 char *path; /* pathname */
34 Collection *collection;
35 gboolean panel;
36 gboolean temp_item_selected;
37 Side panel_side;
38 time_t m_time; /* m-time at last scan */
40 /* Scanning */
41 DIR *dir;
42 gint idle_scan_id; /* (only if dir != NULL) */
45 struct _FileItem
47 char *leafname;
49 int base_type; /* (regular file, dir, pipe, etc) */
50 int flags;
52 int text_width;
53 int pix_width;
54 int pix_height;
55 MaskedPixmap *image;
58 extern FilerWindow *window_with_focus;
59 extern GHashTable *child_to_filer;
61 /* Prototypes */
62 void filer_init();
63 void filer_opendir(char *path, gboolean panel, Side panel_side);
64 void scan_dir(FilerWindow *filer_window);
65 void panel_set_timeout(FilerWindow *filer_window, gulong msec);
67 #endif /* _FILER_H */