2
* Copyright (C) 2007, 2008 Mark Lee <avant-wn@lazymalevolence.com>
4
* This library is free software; you can redistribute it and/or
5
* modify it under the terms of the GNU Lesser General Public
6
* License as published by the Free Software Foundation; either
7
* version 2 of the License, or (at your option) any later version.
9
* This library is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
* Lesser General Public License for more details.
14
* You should have received a copy of the GNU Lesser General Public
15
* License along with this library; if not, write to the
16
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17
* Boston, MA 02111-1307, USA.
19
* Author : Mark Lee <avant-wn@lazymalevolence.com>
22
#ifndef _LIBAWN_AWN_VFS_H
23
#define _LIBAWN_AWN_VFS_H
30
* A wrapper structure for the VFS libraries' file/directory monitoring
31
* structure. In the case of the GIO implementation, it is an opaque structure.
33
typedef struct _AwnVfsMonitor AwnVfsMonitor;
38
* @AWN_VFS_MONITOR_EVENT_CHANGED: Indicates that the path referenced has
40
* @AWN_VFS_MONITOR_EVENT_CREATED: Indicates that the path referenced has
41
* been created on the filesystem.
42
* @AWN_VFS_MONITOR_EVENT_DELETED: Indicates that the path referenced has
43
* been removed from the filesystem.
45
* A list of valid monitor event types for use with monitor event emission or
46
* retrieving the type of monitor event in the callback. Due to thunar-vfs's
47
* limited support for event types, only "changed", "created", and "deleted"
48
* are available for use.
51
AWN_VFS_MONITOR_EVENT_CHANGED,
52
AWN_VFS_MONITOR_EVENT_CREATED,
53
AWN_VFS_MONITOR_EVENT_DELETED
58
* @AWN_VFS_MONITOR_FILE: Indicates that the #AwnVfsMonitor instance is
60
* @AWN_VFS_MONITOR_DIRECTORY: Indicates that the #AwnVfsMonitor instance is
61
* monitoring a directory.
63
* The type of path that an #AwnVfsMonitor instance is monitoring.
67
AWN_VFS_MONITOR_DIRECTORY
72
* @monitor: The monitor structure.
73
* @monitor_path: The path that is associated with the monitor structure.
74
* @event_path: In the case of a directory monitor, the path inside the folder
75
* that triggered the event. Otherwise, it is the same as the @monitor_path.
76
* @event: The filesystem operation that triggered the callback to be executed.
77
* @user_data: The data passed to awn_vfs_monitor_add() so that it could be used
80
* The function template used for callbacks executed when a filesystem event has
81
* occurred on a path that is being monitored.
83
typedef void (*AwnVfsMonitorFunc) (AwnVfsMonitor *monitor, gchar *monitor_path, gchar *event_path, AwnVfsMonitorEvent event, gpointer user_data);
85
/* File/Directory monitoring */
86
AwnVfsMonitor *awn_vfs_monitor_add (gchar *path, AwnVfsMonitorType monitor_type, AwnVfsMonitorFunc callback, gpointer user_data);
87
void awn_vfs_monitor_emit (AwnVfsMonitor *monitor, gchar *path, AwnVfsMonitorEvent event);
88
void awn_vfs_monitor_remove (AwnVfsMonitor *monitor);
90
/* utility functions */
91
void awn_vfs_init (void);
92
GSList *awn_vfs_get_pathlist_from_string (gchar *paths, GError **err);
94
#endif /* _LIBAWN_AWN_VFS_H */
95
/* vim: set noet ts=8 sts=8 sw=8 : */