Class GestureStylus
- All Implemented Interfaces:
Proxy
Recognizes tablet stylus input.
The provided signals just relay the basic information of the stylus events.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classGestureStylus.Builder<B extends GestureStylus.Builder<B>>Inner class implementing a builder pattern to construct a GObject with properties.static interfaceFunctional interface declaration of theDownCallbackcallback.static classstatic interfaceFunctional interface declaration of theMotionCallbackcallback.static interfaceFunctional interface declaration of theProximityCallbackcallback.static interfaceFunctional interface declaration of theUpCallbackcallback.Nested classes/interfaces inherited from class GestureSingle
GestureSingle.GestureSingleClassNested classes/interfaces inherited from class Gesture
Gesture.BeginCallback, Gesture.CancelCallback, Gesture.EndCallback, Gesture.Gesture$Impl, Gesture.GestureClass, Gesture.SequenceStateChangedCallback, Gesture.UpdateCallbackNested classes/interfaces inherited from class EventController
EventController.EventController$Impl, EventController.EventControllerClassNested classes/interfaces inherited from class GObject
GObject.NotifyCallback, GObject.ObjectClass -
Constructor Summary
ConstructorsConstructorDescriptionCreate a new GestureStylus.GestureStylus(MemorySegment address) Create a GestureStylus instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionprotected GestureStylusasParent()Return this instance as if it were its parent type.static GestureStylus.Builder<? extends GestureStylus.Builder> builder()AGestureStylus.Builderobject constructs aGestureStyluswith the specified properties.voidemitDown(double x, double y) Emits the "down" signal.voidemitMotion(double x, double y) Emits the "motion" signal.voidemitProximity(double x, double y) Emits the "proximity" signal.voidemitUp(double x, double y) Emits the "up" signal.booleanReturns the current values for the requestedaxes.booleanReturns the current value for the requestedaxis.booleangetBacklog(@Nullable Out<TimeCoord[]> backlog) Returns the accumulated backlog of tracking information.@Nullable DeviceToolReturns theGdkDeviceToolcurrently driving input through this gesture.static MemoryLayoutThe memory layout of the native struct.booleanChecks whether the gesture is for styluses only.static @Nullable TypegetType()Get the GType of the GestureStylus class.onDown(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.voidsetStylusOnly(boolean stylusOnly) Sets the state of stylus-onlyMethods inherited from class GestureSingle
getButton, getCurrentButton, getCurrentSequence, getExclusive, getTouchOnly, setButton, setExclusive, setTouchOnlyMethods inherited from class 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, ungroupMethods inherited from class EventController
getCurrentEvent, getCurrentEventDevice, getCurrentEventState, getCurrentEventTime, getName, getPropagationLimit, getPropagationPhase, getWidget, reset, setName, setPropagationLimit, setPropagationPhase, setStaticNameMethods inherited from class 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, getProperty, getProperty, getProperty, getQdata, getv, interfaceFindProperty, interfaceInstallProperty, interfaceListProperties, isFloating, 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, withPropertiesMethods inherited from class TypeInstance
callParent, callParent, cast, getPrivate, readGClass, writeGClassMethods inherited from class ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
GestureStylus
Create a GestureStylus instance for the provided memory address.- Parameters:
address- the memory address of the native object
-
GestureStylus
public GestureStylus()Create a new GestureStylus.
-
-
Method Details
-
getType
-
getMemoryLayout
The memory layout of the native struct.- Returns:
- the memory layout
-
asParent
Return this instance as if it were its parent type. Comparable to the Javasuperkeyword, but ensures the parent typeclass is also used in native code.- Overrides:
asParentin classGestureSingle- Returns:
- the instance as if it were its parent type
-
getAxes
Returns the current values for the requested
axes.This function must be called from the handler of one of the
Gtk.GestureStylus::down,Gtk.GestureStylus::motion,Gtk.GestureStylus::uporGtk.GestureStylus::proximitysignals.- Parameters:
axes- array of requested axes, terminated withAxisUse.IGNOREvalues- return location for the axis values- Returns:
trueif there is a current value for the axes
-
getAxis
Returns the current value for the requested
axis.This function must be called from the handler of one of the
Gtk.GestureStylus::down,Gtk.GestureStylus::motion,Gtk.GestureStylus::uporGtk.GestureStylus::proximitysignals.- Parameters:
axis- requested device axisvalue- return location for the axis value- Returns:
trueif 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::motionsignal handler, the state given in this signal and obtainable throughgetAxis(AxisUse, Out)express the latest (most up-to-date) state in motion history.The
backlogis provided in chronological order.- Parameters:
backlog- coordinates and times for the backlog events- Returns:
trueif there is a backlog to unfold in the current state.
-
getDeviceTool
Returns the
GdkDeviceToolcurrently 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::uporGtk.GestureStylus::proximitysignals.- 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:
trueif the gesture is only for stylus events- Since:
- 4.10
-
setStylusOnly
public void setStylusOnly(boolean stylusOnly) Sets the state of stylus-only
If 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- Since:
- 4.10
-
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(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(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(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(GestureStylus.UpCallback). -
builder
AGestureStylus.Builderobject constructs aGestureStyluswith the specified properties. Use the variousset...()methods to set properties, and finish construction withGestureStylus.Builder.build().- Returns:
- the builder object
-