| Thunar-VFS Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | Object Hierarchy | ||||
#include <thunar-vfs/thunar-vfs.h>
ThunarVfsMonitor;
enum ThunarVfsMonitorEvent;
ThunarVfsMonitorHandle;
void (*ThunarVfsMonitorCallback) (ThunarVfsMonitor *monitor,
ThunarVfsMonitorHandle *handle,
ThunarVfsMonitorEvent event,
ThunarVfsPath *handle_path,
ThunarVfsPath *event_path,
gpointer user_data);
ThunarVfsMonitor * thunar_vfs_monitor_get_default (void);
ThunarVfsMonitorHandle * thunar_vfs_monitor_add_directory
(ThunarVfsMonitor *monitor,
ThunarVfsPath *path,
ThunarVfsMonitorCallback callback,
gpointer user_data);
ThunarVfsMonitorHandle * thunar_vfs_monitor_add_file (ThunarVfsMonitor *monitor,
ThunarVfsPath *path,
ThunarVfsMonitorCallback callback,
gpointer user_data);
void thunar_vfs_monitor_remove (ThunarVfsMonitor *monitor,
ThunarVfsMonitorHandle *handle);
void thunar_vfs_monitor_feed (ThunarVfsMonitor *monitor,
ThunarVfsMonitorEvent event,
ThunarVfsPath *path);
void thunar_vfs_monitor_wait (ThunarVfsMonitor *monitor);
typedef struct _ThunarVfsMonitor ThunarVfsMonitor;
The ThunarVfsMonitor contains private data only, and should be accessed using the functions below.
typedef enum
{
THUNAR_VFS_MONITOR_EVENT_CHANGED,
THUNAR_VFS_MONITOR_EVENT_CREATED,
THUNAR_VFS_MONITOR_EVENT_DELETED,
} ThunarVfsMonitorEvent;
Describes an event that occurred on a ThunarVfsMonitorHandle.
typedef struct _ThunarVfsMonitorHandle ThunarVfsMonitorHandle;
A handle on a file system entity, which is currently watched by a ThunarVfsMonitor.
void (*ThunarVfsMonitorCallback) (ThunarVfsMonitor *monitor,ThunarVfsMonitorHandle *handle,ThunarVfsMonitorEvent event,ThunarVfsPath *handle_path,ThunarVfsPath *event_path,gpointer user_data);
The prototype for callback functions that will be called by a ThunarVfsMonitor whenever one of its associated ThunarVfsMonitorHandles notice a change.
|
a ThunarVfsMonitor. |
|
a ThunarVfsMonitorHandle. |
|
the event that occurred. |
|
the ThunarVfsPath that was specified when registering the handle.
|
|
the ThunarVfsPath on which the event occurred.
|
|
the user data that was specified when registering the handle with the monitor.
|
ThunarVfsMonitor * thunar_vfs_monitor_get_default (void);
Returns the shared ThunarVfsMonitor instance. The caller
is responsible to call g_object_unref() on the returned
object when no longer needed.
Returns : |
a reference to the shared ThunarVfsMonitor instance. |
ThunarVfsMonitorHandle * thunar_vfs_monitor_add_directory (ThunarVfsMonitor *monitor,ThunarVfsPath *path,ThunarVfsMonitorCallback callback,gpointer user_data);
Registers path as directory for monitor. monitor will invoke
callback whenever it notices a change to the directory to which
path refers or any of the files within the directory.
The returned ThunarVfsMonitorHandle can be used to remove
the path from monitor using thunar_vfs_monitor_remove().
|
a ThunarVfsMonitor. |
|
the ThunarVfsPath of the directory that should be watched. |
|
the callback function to invoke. |
|
additional data to pass to callback.
|
Returns : |
the ThunarVfsMonitorHandle for the new watch. |
ThunarVfsMonitorHandle * thunar_vfs_monitor_add_file (ThunarVfsMonitor *monitor,ThunarVfsPath *path,ThunarVfsMonitorCallback callback,gpointer user_data);
Registers path as file with monitor. monitor will then invoke
callback whenever it notices a change to the file to which
path refers.
The returned ThunarVfsMonitorHandle can be used to remove
the path from monitor using thunar_vfs_monitor_remove().
|
a ThunarVfsMonitor. |
|
the ThunarVfsPath of the file that should be watched. |
|
the callback function to invoke. |
|
additional data to pass to callback.
|
Returns : |
the ThunarVfsMonitorHandle for the new watch. |
void thunar_vfs_monitor_remove (ThunarVfsMonitor *monitor,ThunarVfsMonitorHandle *handle);
Removes handle from monitor.
|
a ThunarVfsMonitor. |
|
a valid ThunarVfsMonitorHandle for monitor.
|
void thunar_vfs_monitor_feed (ThunarVfsMonitor *monitor,ThunarVfsMonitorEvent event,ThunarVfsPath *path);
Explicitly injects the given event into monitors event
processing logic.
|
a ThunarVfsMonitor. |
|
the ThunarVfsMonitorEvent that should be emulated. |
|
the ThunarVfsPath on which event took place.
|
void thunar_vfs_monitor_wait (ThunarVfsMonitor *monitor);
Suspends the execution of the current thread until the
monitor has processed all currently pending events. The
calling thread must own a reference on the monitor!
This method should never be called from the main thread or you'll lock up your application!!
|
a ThunarVfsMonitor. |