Class GestureStylus
- All Implemented Interfaces:
Proxy
GtkGestureStylus
is a GtkGesture
specific to stylus input.
The provided signals just relay the basic information of the stylus events.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
GestureStylus.Builder<B extends GestureStylus.Builder<B>>
Inner class implementing a builder pattern to construct a GObject with properties.static interface
Functional interface declaration of theDownCallback
callback.static class
static interface
Functional interface declaration of theMotionCallback
callback.static interface
Functional interface declaration of theProximityCallback
callback.static interface
Functional interface declaration of theUpCallback
callback.Nested classes/interfaces inherited from class org.gnome.gtk.GestureSingle
GestureSingle.GestureSingleClass
Nested classes/interfaces inherited from class org.gnome.gtk.Gesture
Gesture.BeginCallback, Gesture.CancelCallback, Gesture.EndCallback, Gesture.GestureClass, Gesture.GestureImpl, Gesture.SequenceStateChangedCallback, Gesture.UpdateCallback
Nested classes/interfaces inherited from class org.gnome.gtk.EventController
EventController.EventControllerClass, EventController.EventControllerImpl
Nested classes/interfaces inherited from class org.gnome.gobject.GObject
GObject.NotifyCallback, GObject.ObjectClass
-
Constructor Summary
ConstructorDescriptionCreates a newGtkGestureStylus
.GestureStylus
(MemorySegment address) Create a GestureStylus proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionprotected GestureStylus
asParent()
Returns this instance as if it were its parent type.static GestureStylus.Builder
<? extends GestureStylus.Builder> builder()
AGestureStylus.Builder
object constructs aGestureStylus
with the specified properties.void
emitDown
(double x, double y) Emits the "down" signal.void
emitMotion
(double x, double y) Emits the "motion" signal.void
emitProximity
(double x, double y) Emits the "proximity" signal.void
emitUp
(double x, double y) Emits the "up" signal.boolean
Returns the current values for the requestedaxes
.boolean
Returns the current value for the requestedaxis
.boolean
getBacklog
(Out<TimeCoord[]> backlog) Returns the accumulated backlog of tracking information.Returns theGdkDeviceTool
currently driving input through this gesture.boolean
Checks whether the gesture is for styluses only.static Type
getType()
Get the GType of the GestureStylus classonDown
(GestureStylus.DownCallback handler) Emitted when the stylus touches the device.onMotion
(GestureStylus.MotionCallback handler) Emitted when the stylus moves while touching the device.Emitted when the stylus is in proximity of the device.onUp
(GestureStylus.UpCallback handler) Emitted when the stylus no longer touches the device.void
setStylusOnly
(boolean stylusOnly) Sets the state of stylus-onlyMethods inherited from class org.gnome.gtk.GestureSingle
getButton, getCurrentButton, getCurrentSequence, getExclusive, getTouchOnly, setButton, setExclusive, setTouchOnly
Methods inherited from class org.gnome.gtk.Gesture
emitBegin, emitCancel, emitEnd, emitSequenceStateChanged, emitUpdate, getBoundingBox, getBoundingBoxCenter, getDevice, getGroup, getLastEvent, getLastUpdatedSequence, getPoint, getSequences, getSequenceState, group, handlesSequence, isActive, isGroupedWith, isRecognized, onBegin, onCancel, onEnd, onSequenceStateChanged, onUpdate, setSequenceState, setState, ungroup
Methods inherited from class org.gnome.gtk.EventController
getCurrentEvent, getCurrentEventDevice, getCurrentEventState, getCurrentEventTime, getName, getPropagationLimit, getPropagationPhase, getWidget, reset, setName, setPropagationLimit, setPropagationPhase, setStaticName
Methods inherited from class org.gnome.gobject.GObject
addToggleRef, addWeakPointer, bindProperty, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, connect, constructed, disconnect, dispatchPropertiesChanged, dispose, dupData, dupQdata, emit, emitNotify, finalize_, forceFloating, freezeNotify, get, getData, getMemoryLayout, getProperty, getProperty, getProperty, getQdata, getv, interfaceFindProperty, interfaceInstallProperty, interfaceListProperties, isFloating, newInstance, newInstance, newInstance, newInstance, newv, notify_, notify_, notifyByPspec, onNotify, ref, refSink, removeToggleRef, removeWeakPointer, replaceData, replaceQdata, runDispose, set, setData, setDataFull, setProperty, setProperty, setProperty, setQdata, setQdataFull, setv, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref, withProperties
Methods inherited from class org.gnome.gobject.TypeInstance
callParent, callParent, getPrivate, readGClass, writeGClass
Methods inherited from class io.github.jwharm.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
GestureStylus
Create a GestureStylus proxy instance for the provided memory address.- Parameters:
address
- the memory address of the native object
-
GestureStylus
public GestureStylus()Creates a newGtkGestureStylus
.
-
-
Method Details
-
getType
-
asParent
Returns this instance as if it were its parent type. This is mostly synonymous to the Javasuper
keyword, but will set the native typeclass function pointers to the parent type. When overriding a native virtual method in Java, "chaining up" withsuper.methodName()
doesn't work, because it invokes the overridden function pointer again. To chain up, callasParent().methodName()
. This will call the native function pointer of this virtual method in the typeclass of the parent type.- Overrides:
asParent
in classGestureSingle
-
getAxes
Returns the current values for the requestedaxes
.This function must be called from the handler of one of the
Gtk.GestureStylus::down
,Gtk.GestureStylus::motion
,Gtk.GestureStylus::up
orGtk.GestureStylus::proximity
signals.- Parameters:
axes
- array of requested axes, terminated withAxisUse.IGNORE
values
- return location for the axis values- Returns:
true
if there is a current value for the axes
-
getAxis
Returns the current value for the requestedaxis
.This function must be called from the handler of one of the
Gtk.GestureStylus::down
,Gtk.GestureStylus::motion
,Gtk.GestureStylus::up
orGtk.GestureStylus::proximity
signals.- Parameters:
axis
- requested device axisvalue
- return location for the axis value- Returns:
true
if there is a current value for the axis
-
getBacklog
Returns the accumulated backlog of tracking information.By default, GTK will limit rate of input events. On stylus input where accuracy of strokes is paramount, this function returns the accumulated coordinate/timing state before the emission of the current [Gtk.GestureStylus::motion] signal.
This function may only be called within a
Gtk.GestureStylus::motion
signal handler, the state given in this signal and obtainable throughgetAxis(org.gnome.gdk.AxisUse, io.github.jwharm.javagi.base.Out<java.lang.Double>)
express the latest (most up-to-date) state in motion history.The
backlog
is provided in chronological order.- Parameters:
backlog
- coordinates and times for the backlog events- Returns:
true
if there is a backlog to unfold in the current state.
-
getDeviceTool
Returns theGdkDeviceTool
currently driving input through this gesture.This function must be called from the handler of one of the
Gtk.GestureStylus::down
,Gtk.GestureStylus::motion
,Gtk.GestureStylus::up
orGtk.GestureStylus::proximity
signals.- Returns:
- The current stylus tool
-
getStylusOnly
public boolean getStylusOnly()Checks whether the gesture is for styluses only.Stylus-only gestures will signal events exclusively from stylus input devices.
- Returns:
true
if the gesture is only for stylus events
-
setStylusOnly
public void setStylusOnly(boolean stylusOnly) Sets the state of stylus-onlyIf true, the gesture will exclusively handle events from stylus input devices, otherwise it'll handle events from any pointing device.
- Parameters:
stylusOnly
- whether the gesture is used exclusively for stylus events
-
onDown
Emitted when the stylus touches the device.- Parameters:
handler
- the signal handler- Returns:
- a signal handler ID to keep track of the signal connection
- See Also:
-
emitDown
public void emitDown(double x, double y) Emits the "down" signal. SeeonDown(org.gnome.gtk.GestureStylus.DownCallback)
. -
onMotion
public SignalConnection<GestureStylus.MotionCallback> onMotion(GestureStylus.MotionCallback handler) Emitted when the stylus moves while touching the device.- Parameters:
handler
- the signal handler- Returns:
- a signal handler ID to keep track of the signal connection
- See Also:
-
emitMotion
public void emitMotion(double x, double y) Emits the "motion" signal. SeeonMotion(org.gnome.gtk.GestureStylus.MotionCallback)
. -
onProximity
public SignalConnection<GestureStylus.ProximityCallback> onProximity(GestureStylus.ProximityCallback handler) Emitted when the stylus is in proximity of the device.- Parameters:
handler
- the signal handler- Returns:
- a signal handler ID to keep track of the signal connection
- See Also:
-
emitProximity
public void emitProximity(double x, double y) Emits the "proximity" signal. SeeonProximity(org.gnome.gtk.GestureStylus.ProximityCallback)
. -
onUp
Emitted when the stylus no longer touches the device.- Parameters:
handler
- the signal handler- Returns:
- a signal handler ID to keep track of the signal connection
- See Also:
-
emitUp
public void emitUp(double x, double y) Emits the "up" signal. SeeonUp(org.gnome.gtk.GestureStylus.UpCallback)
. -
builder
AGestureStylus.Builder
object constructs aGestureStylus
with the specified properties. Use the variousset...()
methods to set properties, and finish construction withGestureStylus.Builder.build()
.
-