![]() |
![]() |
![]() |
Thunar-VFS Reference Manual | ![]() |
---|
ThunarVfsMonitorThunarVfsMonitor — |
#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 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.
THUNAR_VFS_MONITOR_EVENT_CHANGED |
a file or directory was changed. |
THUNAR_VFS_MONITOR_EVENT_CREATED |
a file or directory was created. |
THUNAR_VFS_MONITOR_EVENT_DELETED |
a file or directory was deleted. |
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.
monitor : |
a ThunarVfsMonitor. |
handle : |
a ThunarVfsMonitorHandle. |
event : |
the event that occurred. |
handle_path : |
the ThunarVfsPath that was specified when registering the handle .
|
event_path : |
the ThunarVfsPath on which the event occurred.
|
user_data : |
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);
monitor : |
a ThunarVfsMonitor. |
path : |
the ThunarVfsPath of the directory that should be watched. |
callback : |
the callback function to invoke. |
user_data : |
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);
monitor : |
a ThunarVfsMonitor. |
path : |
the ThunarVfsPath of the file that should be watched. |
callback : |
the callback function to invoke. |
user_data : |
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
.
monitor : |
a ThunarVfsMonitor. |
handle : |
a valid ThunarVfsMonitorHandle for monitor .
|
void thunar_vfs_monitor_feed (ThunarVfsMonitor *monitor, ThunarVfsMonitorEvent event, ThunarVfsPath *path);
Explicitly injects the given event
into monitor
s event
processing logic.
monitor : |
a ThunarVfsMonitor. |
event : |
the ThunarVfsMonitorEvent that should be emulated. |
path : |
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!!
monitor : |
a ThunarVfsMonitor. |
<< Part III. Filesystem Monitoring | Part IV. MIME Types >> |