Package ch.bailu.gtk.adw
Class SwipeTracker
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.gobject.Object
ch.bailu.gtk.adw.SwipeTracker
- All Implemented Interfaces:
PointerInterface
A swipe tracker used in [class@Carousel], [class@Flap] and [class@Leaflet].
The `AdwSwipeTracker` object can be used for implementing widgets with swipe
gestures. It supports touch-based swipes, pointer dragging, and touchpad
scrolling.
The widgets will probably want to expose the [property@SwipeTracker:enabled]
property. If they expect to use horizontal orientation,
[property@SwipeTracker:reversed] can be used for supporting RTL text
direction.
The `AdwSwipeTracker` object can be used for implementing widgets with swipe
gestures. It supports touch-based swipes, pointer dragging, and touchpad
scrolling.
The widgets will probably want to expose the [property@SwipeTracker:enabled]
property. If they expect to use horizontal orientation,
[property@SwipeTracker:reversed] can be used for supporting RTL text
direction.
https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.SwipeTracker.html
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic interfacestatic interfacestatic interfaceNested classes/interfaces inherited from class ch.bailu.gtk.gobject.Object
Object.OnBindingTransformFunc, Object.OnDestroyNotify, Object.OnDuplicateFunc, Object.OnNotify, Object.OnToggleNotify, Object.OnWeakNotify -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from class ch.bailu.gtk.gobject.Object
SIGNAL_ON_NOTIFY -
Constructor Summary
ConstructorsConstructorDescriptionSwipeTracker(Swipeable swipeable) Creates a new `AdwSwipeTracker` for @widget.SwipeTracker(PointerContainer pointer) -
Method Summary
Modifier and TypeMethodDescriptionImplements interfaceOrientable.booleanGets whether to allow swiping for more than one snap point at a time.booleanGets whether @self can be dragged with mouse pointer.static ClassHandlerbooleanGets whether @self is enabled.static intstatic longstatic TypeSystem.TypeSizebooleanGets whether @self is reversing the swipe direction.Get the widget @self is attached to.static longstatic TypeSystem.TypeSizeConnect to signal "begin-swipe".onEndSwipe(SwipeTracker.OnEndSwipe signal) Connect to signal "end-swipe".onPrepare(SwipeTracker.OnPrepare signal) Connect to signal "prepare".Connect to signal "update-swipe".voidsetAllowLongSwipes(boolean allow_long_swipes) Sets whether to allow swiping for more than one snap point at a time.voidsetAllowMouseDrag(boolean allow_mouse_drag) Sets whether @self can be dragged with mouse pointer.voidsetEnabled(boolean enabled) Sets whether @self is enabled.voidsetReversed(boolean reversed) Sets whether to reverse the swipe direction.voidshiftPosition(double delta) Moves the current progress value by @delta.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, weakUnrefMethods inherited from class ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacksMethods inherited from class ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNullMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Field Details
-
SIGNAL_ON_BEGIN_SWIPE
- See Also:
-
SIGNAL_ON_END_SWIPE
- See Also:
-
SIGNAL_ON_PREPARE
- See Also:
-
SIGNAL_ON_UPDATE_SWIPE
- See Also:
-
-
Constructor Details
-
SwipeTracker
-
SwipeTracker
Creates a new `AdwSwipeTracker` for @widget.- Parameters:
swipeable- a widget to add the tracker on
-
-
Method Details
-
getClassHandler
-
getAllowLongSwipes
public boolean getAllowLongSwipes()Gets whether to allow swiping for more than one snap point at a time.- Returns:
- whether long swipes are allowed
-
getAllowMouseDrag
public boolean getAllowMouseDrag()Gets whether @self can be dragged with mouse pointer.- Returns:
- whether mouse dragging is allowed
-
getEnabled
public boolean getEnabled()Gets whether @self is enabled.- Returns:
- whether @self is enabled
-
getReversed
public boolean getReversed()Gets whether @self is reversing the swipe direction.- Returns:
- whether the direction is reversed
-
getSwipeable
Get the widget @self is attached to.- Returns:
- the swipeable widget
-
setAllowLongSwipes
public void setAllowLongSwipes(boolean allow_long_swipes) Sets whether to allow swiping for more than one snap point at a time.
If the value is `FALSE`, each swipe can only move to the adjacent snap
points.- Parameters:
allow_long_swipes- whether to allow long swipes
-
setAllowMouseDrag
public void setAllowMouseDrag(boolean allow_mouse_drag) Sets whether @self can be dragged with mouse pointer.- Parameters:
allow_mouse_drag- whether to allow mouse dragging
-
setEnabled
public void setEnabled(boolean enabled) Sets whether @self is enabled.
When it's not enabled, no events will be processed. Usually widgets will want
to expose this via a property.- Parameters:
enabled- whether @self is enabled
-
setReversed
public void setReversed(boolean reversed) Sets whether to reverse the swipe direction.
If the swipe tracker is horizontal, it can be used for supporting RTL text
direction.- Parameters:
reversed- whether to reverse the swipe direction
-
shiftPosition
public void shiftPosition(double delta) Moves the current progress value by @delta.
This can be used to adjust the current position if snap points move during
the gesture.- Parameters:
delta- the position delta
-
onBeginSwipe
Connect to signal "begin-swipe".
SeeSwipeTracker.OnBeginSwipe.onBeginSwipe()for signal description.
FieldSIGNAL_ON_BEGIN_SWIPEcontains 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.
-
onEndSwipe
Connect to signal "end-swipe".
SeeSwipeTracker.OnEndSwipe.onEndSwipe(double, double)for signal description.
FieldSIGNAL_ON_END_SWIPEcontains 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.
-
onPrepare
Connect to signal "prepare".
SeeSwipeTracker.OnPrepare.onPrepare(int)for signal description.
FieldSIGNAL_ON_PREPAREcontains 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.
-
onUpdateSwipe
Connect to signal "update-swipe".
SeeSwipeTracker.OnUpdateSwipe.onUpdateSwipe(double)for signal description.
FieldSIGNAL_ON_UPDATE_SWIPEcontains 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.
-
asOrientable
Implements interfaceOrientable. Call this to get access to interface functions.- Returns:
Orientable
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-