Package ch.bailu.gtk.gtk
Class GestureSingle
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.gobject.Object
ch.bailu.gtk.gtk.EventController
ch.bailu.gtk.gtk.Gesture
ch.bailu.gtk.gtk.GestureSingle
- All Implemented Interfaces:
PointerInterface
- Direct Known Subclasses:
DragSource
,GestureClick
,GestureDrag
,GestureLongPress
,GestureStylus
,GestureSwipe
`GtkGestureSingle` is a `GtkGestures` subclass optimized for singe-touch
and mouse gestures.
Under interaction, these gestures stick to the first interacting sequence,
which is accessible through [method@Gtk.GestureSingle.get_current_sequence]
while the gesture is being interacted with.
By default gestures react to both %GDK_BUTTON_PRIMARY and touch events.
[method@Gtk.GestureSingle.set_touch_only] can be used to change the
touch behavior. Callers may also specify a different mouse button number
to interact with through [method@Gtk.GestureSingle.set_button], or react
to any mouse button by setting it to 0. While the gesture is active, the
button being currently pressed can be known through
[method@Gtk.GestureSingle.get_current_button].
and mouse gestures.
Under interaction, these gestures stick to the first interacting sequence,
which is accessible through [method@Gtk.GestureSingle.get_current_sequence]
while the gesture is being interacted with.
By default gestures react to both %GDK_BUTTON_PRIMARY and touch events.
[method@Gtk.GestureSingle.set_touch_only] can be used to change the
touch behavior. Callers may also specify a different mouse button number
to interact with through [method@Gtk.GestureSingle.set_button], or react
to any mouse button by setting it to 0. While the gesture is active, the
button being currently pressed can be known through
[method@Gtk.GestureSingle.get_current_button].
-
Nested Class Summary
Nested classes/interfaces inherited from class ch.bailu.gtk.gtk.Gesture
Gesture.OnBegin, Gesture.OnCancel, Gesture.OnEnd, Gesture.OnSequenceStateChanged, Gesture.OnUpdate
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.gtk.Gesture
SIGNAL_ON_BEGIN, SIGNAL_ON_CANCEL, SIGNAL_ON_END, SIGNAL_ON_SEQUENCE_STATE_CHANGED, SIGNAL_ON_UPDATE
Fields inherited from class ch.bailu.gtk.gobject.Object
SIGNAL_ON_NOTIFY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
Returns the button number @gesture listens for.static ClassHandler
int
Returns the button number currently interacting
with @gesture, or 0 if there is none.Returns the event sequence currently interacting with @gesture.boolean
Gets whether a gesture is exclusive.static int
static long
static TypeSystem.TypeSize
boolean
Returns %TRUE if the gesture is only triggered by touch events.static long
static TypeSystem.TypeSize
void
setButton
(int button) Sets the button number @gesture listens to.void
setExclusive
(boolean exclusive) Sets whether @gesture is exclusive.void
setTouchOnly
(boolean touch_only) Sets whether to handle only touch events.Methods inherited from class ch.bailu.gtk.gtk.Gesture
getBoundingBox, getDevice, getGroup, getLastEvent, getLastUpdatedSequence, getSequences, getSequenceState, group, handlesSequence, isActive, isGroupedWith, isRecognized, onBegin, onCancel, onEnd, onSequenceStateChanged, onUpdate, setSequenceState, setState, ungroup
Methods inherited from class ch.bailu.gtk.gtk.EventController
getCurrentEvent, getCurrentEventDevice, getCurrentEventState, getCurrentEventTime, getName, getPropagationLimit, getPropagationPhase, getWidget, reset, setName, setName, setPropagationLimit, setPropagationPhase, setStaticName, setStaticName
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
-
GestureSingle
-
-
Method Details
-
getClassHandler
-
getButton
public int getButton()Returns the button number @gesture listens for.
If this is 0, the gesture reacts to any button press.- Returns:
- The button number, or 0 for any button
-
getCurrentButton
public int getCurrentButton()Returns the button number currently interacting
with @gesture, or 0 if there is none.- Returns:
- The current button number
-
getCurrentSequence
Returns the event sequence currently interacting with @gesture.
This is only meaningful if [method@Gtk.Gesture.is_active]
returns %TRUE.- Returns:
- the current sequence
-
getExclusive
public boolean getExclusive()Gets whether a gesture is exclusive.
For more information, see [method@Gtk.GestureSingle.set_exclusive].- Returns:
- Whether the gesture is exclusive
-
getTouchOnly
public boolean getTouchOnly()Returns %TRUE if the gesture is only triggered by touch events.- Returns:
- %TRUE if the gesture only handles touch events
-
setButton
public void setButton(int button) Sets the button number @gesture listens to.
If non-0, every button press from a different button
number will be ignored. Touch events implicitly match
with button 1.- Parameters:
button
- button number to listen to, or 0 for any button
-
setExclusive
public void setExclusive(boolean exclusive) Sets whether @gesture is exclusive.
An exclusive gesture will only handle pointer and "pointer emulated"
touch events, so at any given time, there is only one sequence able
to interact with those.- Parameters:
exclusive
- %TRUE to make @gesture exclusive
-
setTouchOnly
public void setTouchOnly(boolean touch_only) Sets whether to handle only touch events.
If @touch_only is %TRUE, @gesture will only handle events of type
%GDK_TOUCH_BEGIN, %GDK_TOUCH_UPDATE or %GDK_TOUCH_END. If %FALSE,
mouse events will be handled too.- Parameters:
touch_only
- whether @gesture handles only touch events
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-