r39: Dropping on the panel now works correctly.
[rox-filer.git] / ROX-Filer / src / filer.h
blobb2a51b9bb4c1b07b8cfd741532f9d986972abb18
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 #include "type.h"
23 enum
25 ITEM_FLAG_SYMLINK = 0x01, /* Is a symlink */
26 ITEM_FLAG_APPDIR = 0x02, /* Contains /AppInfo */
27 ITEM_FLAG_MOUNT_POINT = 0x04, /* Is in mtab or fstab */
28 ITEM_FLAG_MOUNTED = 0x08, /* Is in /etc/mtab */
29 ITEM_FLAG_TEMP_ICON = 0x10, /* Free icon after use */
30 ITEM_FLAG_EXEC_FILE = 0x20, /* File, and has an X bit set */
33 struct _FilerWindow
35 GtkWidget *window;
36 char *path; /* pathname */
37 Collection *collection;
38 gboolean panel;
39 gboolean temp_item_selected;
40 Side panel_side;
41 time_t m_time; /* m-time at last scan */
43 /* Scanning */
44 DIR *dir;
45 gint idle_scan_id; /* (only if dir != NULL) */
46 guint scan_min_width; /* Min width possible so far */
49 struct _FileItem
51 char *leafname;
53 int base_type; /* (regular file, dir, pipe, etc) */
54 MIME_type *mime_type; /* May be NULL */
55 int flags;
57 int text_width;
58 int pix_width;
59 int pix_height;
60 MaskedPixmap *image;
63 extern FilerWindow *window_with_focus;
64 extern GHashTable *child_to_filer;
66 /* Prototypes */
67 void filer_init();
68 void filer_opendir(char *path, gboolean panel, Side panel_side);
69 void scan_dir(FilerWindow *filer_window);
70 void panel_set_timeout(FilerWindow *filer_window, gulong msec);
71 FileItem *selected_item(Collection *collection);
73 #endif /* _FILER_H */