Package ch.bailu.gtk.gio
Class FileMonitor
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.gobject.Object
ch.bailu.gtk.gio.FileMonitor
- All Implemented Interfaces:
PointerInterface
Monitors a file or directory for changes.
To obtain a #GFileMonitor for a file or directory, use
g_file_monitor(), g_file_monitor_file(), or
g_file_monitor_directory().
To get informed about changes to the file or directory you are
monitoring, connect to the #GFileMonitor::changed signal. The
signal will be emitted in the
[thread-default main context][g-main-context-push-thread-default]
of the thread that the monitor was created in
(though if the global default main context is blocked, this may
cause notifications to be blocked even if the thread-default
context is still running).
To obtain a #GFileMonitor for a file or directory, use
g_file_monitor(), g_file_monitor_file(), or
g_file_monitor_directory().
To get informed about changes to the file or directory you are
monitoring, connect to the #GFileMonitor::changed signal. The
signal will be emitted in the
[thread-default main context][g-main-context-push-thread-default]
of the thread that the monitor was created in
(though if the global default main context is blocked, this may
cause notifications to be blocked even if the thread-default
context is still running).
-
Nested Class Summary
Nested classes/interfaces inherited from class ch.bailu.gtk.gobject.Object
Object.OnBindingTransformFunc, Object.OnDestroyNotify, Object.OnDuplicateFunc, Object.OnNotify, Object.OnToggleNotify, Object.OnWeakNotify
-
Field Summary
Fields inherited from class ch.bailu.gtk.gobject.Object
SIGNAL_ON_NOTIFY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
cancel()
Cancels a file monitor.void
Emits the #GFileMonitor::changed signal if a change
has taken place.static ClassHandler
static int
static long
static TypeSystem.TypeSize
static long
static TypeSystem.TypeSize
boolean
Returns whether the monitor is canceled.onChanged
(FileMonitor.OnChanged signal) Connect to signal "changed".void
setRateLimit
(int limit_msecs) Sets the rate limit to which the @monitor will report
consecutive change events to the same file.Methods inherited from class ch.bailu.gtk.gobject.Object
addToggleRef, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, disconnect, disconnect, dupData, dupData, dupQdata, forceFloating, freezeNotify, get, get, getData, getData, getProperty, getProperty, getQdata, interfaceFindProperty, interfaceInstallProperty, isFloating, notify, notify, notifyByPspec, onNotify, ref, refSink, removeToggleRef, replaceData, replaceData, replaceQdata, runDispose, set, set, setData, setData, setDataFull, setDataFull, setProperty, setProperty, setQdata, setQdataFull, stealData, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref
Methods inherited from class ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacks
Methods inherited from class ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Field Details
-
SIGNAL_ON_CHANGED
- See Also:
-
-
Constructor Details
-
FileMonitor
-
-
Method Details
-
getClassHandler
-
cancel
public boolean cancel()Cancels a file monitor.- Returns:
- always %TRUE
-
emitEvent
Emits the #GFileMonitor::changed signal if a change
has taken place. Should be called from file monitor
implementations only.
Implementations are responsible to call this method from the
[thread-default main context][g-main-context-push-thread-default] of the
thread that the monitor was created in.- Parameters:
child
- a #GFile.other_file
- a #GFile.event_type
- a set of #GFileMonitorEvent flags.
-
isCancelled
public boolean isCancelled()Returns whether the monitor is canceled.- Returns:
- %TRUE if monitor is canceled. %FALSE otherwise.
-
setRateLimit
public void setRateLimit(int limit_msecs) Sets the rate limit to which the @monitor will report
consecutive change events to the same file.- Parameters:
limit_msecs
- a non-negative integer with the limit in milliseconds to poll for changes
-
onChanged
Connect to signal "changed".
SeeFileMonitor.OnChanged.onChanged(ch.bailu.gtk.gio.File, ch.bailu.gtk.gio.File, int)
for signal description.
FieldSIGNAL_ON_CHANGED
contains original signal name and can be used as resource reference.- Parameters:
signal
- callback function (lambda).- Returns:
SignalHandler
. Can be used to disconnect signal and to release callback function.
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-