4 * Thomas Leonard, <tal197@ecs.soton.ac.uk>
12 #include <sys/types.h>
16 DIR_END_SCAN
, /* Remove busy cursor */
17 DIR_ADD
, /* Add the listed items to the display */
18 DIR_REMOVE
, /* Remove listed items from display */
19 DIR_UPDATE
, /* Redraw these items */
22 typedef struct _Directory Directory
;
23 typedef struct _DirItem DirItem
;
24 typedef struct _DirUser DirUser
;
25 typedef void (*DirCallback
)(Directory
*dir
,
32 ITEM_FLAG_SYMLINK
= 0x01, /* Is a symlink */
33 ITEM_FLAG_APPDIR
= 0x02, /* Contains /AppInfo */
34 ITEM_FLAG_MOUNT_POINT
= 0x04, /* Is in mtab or fstab */
35 ITEM_FLAG_MOUNTED
= 0x08, /* Is in /etc/mtab */
36 ITEM_FLAG_TEMP_ICON
= 0x10, /* Free icon after use */
37 ITEM_FLAG_EXEC_FILE
= 0x20, /* File, and has an X bit set */
38 ITEM_FLAG_MAY_DELETE
= 0x40, /* Delete on finishing scan */
45 extern GFSCache
*dir_cache
;
50 gboolean may_delete
; /* Not yet found, this scan */
69 char *pathname
; /* Internal use only */
71 GList
*users
; /* Functions to call on update */
72 char *error
; /* NULL => no error */
74 gboolean needs_update
; /* When scan is finished, rescan */
75 gboolean notify_active
; /* Notify timeout is running */
76 gint idle
; /* Idle callback ID */
77 DIR *dir_handle
; /* NULL => not scanning */
79 GPtrArray
*items
; /* What our users know about */
80 GPtrArray
*new_items
; /* New items to add in */
81 GPtrArray
*up_items
; /* Items to redraw */
85 void dir_attach(Directory
*dir
, DirCallback callback
, gpointer data
);
86 void dir_detach(Directory
*dir
, DirCallback callback
, gpointer data
);
87 void dir_update(Directory
*dir
, gchar
*pathname
);
88 int dir_item_cmp(const void *a
, const void *b
);
89 void refresh_dirs(char *path
);