4 * Thomas Leonard, <tal197@users.sourceforge.net>
11 #include <sys/types.h>
15 DIR_NAMES
, /* Got a list of names (used for resizing) */
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 _DirUser DirUser
;
24 typedef void (*DirCallback
)(Directory
*dir
,
32 extern GFSCache
*dir_cache
;
42 char *pathname
; /* Internal use only */
44 GList
*users
; /* Functions to call on update */
45 char *error
; /* NULL => no error */
47 gboolean do_thumbs
; /* Create thumbs while scanning */
48 gboolean notify_active
; /* Notify timeout is running */
49 gint idle_callback
; /* Idle callback ID */
51 GHashTable
*known_items
; /* What our users know about */
52 GPtrArray
*new_items
; /* New items to add in */
53 GPtrArray
*up_items
; /* Items to redraw */
55 GList
*recheck_list
; /* Items to check on callback */
57 gboolean have_scanned
; /* TRUE after first complete scan */
58 gboolean scanning
; /* TRUE if we sent DIR_START_SCAN */
60 /* Indicates that the directory needs to be rescanned.
61 * This is cleared when scanning starts, and set when the fscache
62 * detects that the directory needs to be rescanned and is already
65 * If scanning finishes when this is set, or if someone attaches
66 * and scanning is not in progress, a rescan is triggered.
68 gboolean needs_update
;
72 void dir_attach(Directory
*dir
, DirCallback callback
, gpointer data
);
73 void dir_detach(Directory
*dir
, DirCallback callback
, gpointer data
);
74 void dir_update(Directory
*dir
, gchar
*pathname
);
75 void dir_rescan_with_thumbs(Directory
*dir
, gchar
*pathname
);
76 int dir_item_cmp(const void *a
, const void *b
);
77 void refresh_dirs(char *path
);
78 void dir_stat(guchar
*path
, DirItem
*item
, gboolean make_thumb
);
79 void dir_restat(guchar
*path
, DirItem
*item
, gboolean make_thumb
);
80 void dir_item_clear(DirItem
*item
);
81 void dir_check_this(guchar
*path
);
82 void dir_rescan(Directory
*dir
, guchar
*pathname
);
83 void dir_merge_new(Directory
*dir
);