4 * Thomas Leonard, <tal197@users.sourceforge.net>
11 #include <sys/types.h>
15 DIR_START_SCAN
, /* Set 'scanning' indicator */
16 DIR_END_SCAN
, /* Clear 'scanning' indicator */
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 _DirUser DirUser
;
23 typedef void (*DirCallback
)(Directory
*dir
,
28 extern GFSCache
*dir_cache
;
36 typedef struct _DirectoryClass DirectoryClass
;
38 struct _DirectoryClass
{
46 char *pathname
; /* Internal use only */
47 GList
*users
; /* Functions to call on update */
48 char *error
; /* NULL => no error */
50 struct stat stat_info
; /* Internal use */
52 gboolean notify_active
; /* Notify timeout is running */
53 gint idle_callback
; /* Idle callback ID */
55 GHashTable
*known_items
; /* What our users know about */
56 GPtrArray
*new_items
; /* New items to add in */
57 GPtrArray
*up_items
; /* Items to redraw */
58 GPtrArray
*gone_items
; /* Items removed */
60 GList
*recheck_list
; /* Items to check on callback */
62 gboolean have_scanned
; /* TRUE after first complete scan */
63 gboolean scanning
; /* TRUE if we sent DIR_START_SCAN */
65 /* Indicates that the directory needs to be rescanned.
66 * This is cleared when scanning starts, and set when the fscache
67 * detects that the directory needs to be rescanned and is already
70 * If scanning finishes when this is set, or if someone attaches
71 * and scanning is not in progress, a rescan is triggered.
73 gboolean needs_update
;
77 void dir_attach(Directory
*dir
, DirCallback callback
, gpointer data
);
78 void dir_detach(Directory
*dir
, DirCallback callback
, gpointer data
);
79 void dir_update(Directory
*dir
, gchar
*pathname
);
80 void refresh_dirs(const char *path
);
81 void dir_check_this(const guchar
*path
);
82 DirItem
*dir_update_item(Directory
*dir
, const gchar
*leafname
);
83 void dir_rescan(Directory
*dir
, const guchar
*pathname
);
84 void dir_merge_new(Directory
*dir
);
85 void dir_force_update_path(const gchar
*path
);