ThunarVfsMonitor

## ThunarVfsMonitor ThunarVfsMonitor — |

## Synopsis

    #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);

## Object Hierarchy

      GObject
       +----ThunarVfsMonitor

## Description

## Details

### ThunarVfsMonitor

    typedef struct _ThunarVfsMonitor ThunarVfsMonitor;

### enum ThunarVfsMonitorEvent

    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.

### ThunarVfsMonitorHandle

    typedef struct _ThunarVfsMonitorHandle ThunarVfsMonitorHandle;

A handle on a file system entity, which is currently watched by a ThunarVfsMonitor.

### ThunarVfsMonitorCallback ()

    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`.

### thunar_vfs_monitor_get_default ()

    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.

### thunar_vfs_monitor_add_directory ()

    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.

### thunar_vfs_monitor_add_file ()

    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.

### thunar_vfs_monitor_remove ()

    void        thunar_vfs_monitor_remove       (ThunarVfsMonitor *monitor,
                                                 ThunarVfsMonitorHandle *handle);

Removes `handle` from `monitor`.

`monitor` : | a ThunarVfsMonitor.
`handle` : | a valid ThunarVfsMonitorHandle for `monitor`.

### thunar_vfs_monitor_feed ()

    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.