Package ch.bailu.gtk.gtk
Class EventController
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.gobject.Object
ch.bailu.gtk.gtk.EventController
- All Implemented Interfaces:
PointerInterface
- Direct Known Subclasses:
DropControllerMotion
,DropTarget
,DropTargetAsync
,EventControllerFocus
,EventControllerKey
,EventControllerLegacy
,EventControllerMotion
,EventControllerScroll
,Gesture
,PadController
,ShortcutController
`GtkEventController` is the base class for event controllers.
These are ancillary objects associated to widgets, which react
to `GdkEvents`, and possibly trigger actions as a consequence.
Event controllers are added to a widget with
[method@Gtk.Widget.add_controller]. It is rarely necessary to
explicitly remove a controller with [method@Gtk.Widget.remove_controller].
See the chapter on [input handling](input-handling.html) for
an overview of the basic concepts, such as the capture and bubble
phases of even propagation.
These are ancillary objects associated to widgets, which react
to `GdkEvents`, and possibly trigger actions as a consequence.
Event controllers are added to a widget with
[method@Gtk.Widget.add_controller]. It is rarely necessary to
explicitly remove a controller with [method@Gtk.Widget.remove_controller].
See the chapter on [input handling](input-handling.html) for
an overview of the basic concepts, such as the capture and bubble
phases of even propagation.
-
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 TypeMethodDescriptionstatic ClassHandler
Returns the event that is currently being handled by the controller.Returns the device of the event that is currently being
handled by the controller.int
Returns the modifier state of the event that is currently being
handled by the controller.int
Returns the timestamp of the event that is currently being
handled by the controller.static int
getName()
Gets the name of @controller.static long
static TypeSystem.TypeSize
int
Gets the propagation limit of the event controller.int
Gets the propagation phase at which @controller handles events.static long
static TypeSystem.TypeSize
Returns the `GtkWidget` this controller relates to.void
reset()
Resets the @controller to a clean state.void
Sets a name on the controller that can be used for debugging.void
Sets a name on the controller that can be used for debugging.void
setPropagationLimit
(int limit) Sets the event propagation limit on the event controller.void
setPropagationPhase
(int phase) Sets the propagation phase at which a controller handles events.void
setStaticName
(Str name) Sets a name on the controller that can be used for debugging.void
setStaticName
(String name) Sets a name on the controller that can be used for debugging.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
-
Constructor Details
-
EventController
-
-
Method Details
-
getClassHandler
-
getCurrentEvent
Returns the event that is currently being handled by the controller.
At other times, %NULL is returned.- Returns:
- the event that is currently handled by @controller
-
getCurrentEventDevice
Returns the device of the event that is currently being
handled by the controller.
At other times, %NULL is returned.- Returns:
- device of the event is currently handled by @controller
-
getCurrentEventState
public int getCurrentEventState()Returns the modifier state of the event that is currently being
handled by the controller.
At other times, 0 is returned.- Returns:
- modifier state of the event is currently handled by @controller
-
getCurrentEventTime
public int getCurrentEventTime()Returns the timestamp of the event that is currently being
handled by the controller.
At other times, 0 is returned.- Returns:
- timestamp of the event is currently handled by @controller
-
getName
Gets the name of @controller.- Returns:
- The controller name
-
getPropagationLimit
public int getPropagationLimit()Gets the propagation limit of the event controller.- Returns:
- the propagation limit
-
getPropagationPhase
public int getPropagationPhase()Gets the propagation phase at which @controller handles events.- Returns:
- the propagation phase
-
getWidget
Returns the `GtkWidget` this controller relates to.- Returns:
- a `GtkWidget`
-
reset
public void reset()Resets the @controller to a clean state. -
setName
Sets a name on the controller that can be used for debugging.- Parameters:
name
- a name for @controller
-
setName
Sets a name on the controller that can be used for debugging.- Parameters:
name
- a name for @controller
-
setPropagationLimit
public void setPropagationLimit(int limit) Sets the event propagation limit on the event controller.
If the limit is set to %GTK_LIMIT_SAME_NATIVE, the controller
won't handle events that are targeted at widgets on a different
surface, such as popovers.- Parameters:
limit
- the propagation limit
-
setPropagationPhase
public void setPropagationPhase(int phase) Sets the propagation phase at which a controller handles events.
If @phase is %GTK_PHASE_NONE, no automatic event handling will be
performed, but other additional gesture maintenance will.- Parameters:
phase
- a propagation phase
-
setStaticName
Sets a name on the controller that can be used for debugging.- Parameters:
name
- a name for @controller, must be a static string
-
setStaticName
Sets a name on the controller that can be used for debugging.- Parameters:
name
- a name for @controller, must be a static string
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-