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