2.1 <AdwSwipeable>

Interface: <AdwSwipeable>

An interface for swipeable widgets.

The <AdwSwipeable> interface is implemented by all swipeable widgets.

See SwipeTracker for details about implementing it.

Procedures

Method: swipeable:get-cancel-progress self ⇒ %return
Method: get-cancel-progress self ⇒ %return

Gets the progress self will snap back to after the gesture is canceled.

self

Passed: a <AdwSwipeable>.

a swipeable

%return

Returned: a real number.

the cancel progress, unitless

Method: swipeable:get-distance self ⇒ %return
Method: get-distance self ⇒ %return

Gets the swipe distance of self.

This corresponds to how many pixels 1 unit represents.

self

Passed: a <AdwSwipeable>.

a swipeable

%return

Returned: a real number.

the swipe distance in pixels

Method: swipeable:get-progress self ⇒ %return
Method: get-progress self ⇒ %return

Gets the current progress of self.

self

Passed: a <AdwSwipeable>.

a swipeable

%return

Returned: a real number.

the current progress, unitless

Method: swipeable:get-snap-points self ⇒ %return
Method: get-snap-points self ⇒ %return

Gets the snap points of self.

Each snap point represents a progress value that is considered acceptable to end the swipe on.

self

Passed: a <AdwSwipeable>.

a swipeable

%return

Returned: a f64vector.

the snap points

n-snap-points

Not returned: it is the length of %return.

location to return the number of the snap points

Method: swipeable:get-swipe-area! self navigation-direction is-drag rect ⇒ rect
Method: get-swipe-area! self navigation-direction is-drag rect ⇒ rect

Gets the area self can start a swipe from for the given direction and gesture type.

This can be used to restrict swipes to only be possible from a certain area, for example, to only allow edge swipes, or to have a draggable element and ignore swipes elsewhere.

If not implemented, the default implementation returns the allocation of self, allowing swipes from anywhere.

self

Passed: a <AdwSwipeable>.

a swipeable

navigation-direction

Passed: a <AdwNavigationDirection>, or one of its symbols.

the direction of the swipe

is-drag

Passed: a boolean.

whether the swipe is caused by a dragging gesture

rect

Passed, filled in, and returned: a <GdkRectangle>.

a pointer to a rectangle to store the swipe area

Virtual methods

Virtual method: swipeable:do-get-cancel-progress implementor self ⇒ %return

Gets the progress self will snap back to after the gesture is canceled.

To override it in a new class, give register-type #:vfuncs `((get-cancel-progress . ,procedure)). The procedure is called as (procedure self) ⇒ %return.

implementor

Passed: the class whose implementation to call: a class that implements <AdwSwipeable>, or its GType number.

self

Passed: a <AdwSwipeable>.

a swipeable

%return

Returned: a real number.

the cancel progress, unitless

Virtual method: swipeable:do-get-distance implementor self ⇒ %return

Gets the swipe distance of self.

This corresponds to how many pixels 1 unit represents.

To override it in a new class, give register-type #:vfuncs `((get-distance . ,procedure)). The procedure is called as (procedure self) ⇒ %return.

implementor

Passed: the class whose implementation to call: a class that implements <AdwSwipeable>, or its GType number.

self

Passed: a <AdwSwipeable>.

a swipeable

%return

Returned: a real number.

the swipe distance in pixels

Virtual method: swipeable:do-get-progress implementor self ⇒ %return

Gets the current progress of self.

To override it in a new class, give register-type #:vfuncs `((get-progress . ,procedure)). The procedure is called as (procedure self) ⇒ %return.

implementor

Passed: the class whose implementation to call: a class that implements <AdwSwipeable>, or its GType number.

self

Passed: a <AdwSwipeable>.

a swipeable

%return

Returned: a real number.

the current progress, unitless

Virtual method: swipeable:do-get-snap-points implementor self ⇒ %return

Gets the snap points of self.

Each snap point represents a progress value that is considered acceptable to end the swipe on.

To override it in a new class, give register-type #:vfuncs `((get-snap-points . ,procedure)). The procedure is called as (procedure self) ⇒ %return.

implementor

Passed: the class whose implementation to call: a class that implements <AdwSwipeable>, or its GType number.

self

Passed: a <AdwSwipeable>.

a swipeable

%return

Returned: a f64vector.

the snap points

n-snap-points

Not returned: it is the length of %return.

location to return the number of the snap points

Virtual method: swipeable:do-get-swipe-area implementor self navigation-direction is-drag rect ⇒ rect

Gets the area self can start a swipe from for the given direction and gesture type.

This can be used to restrict swipes to only be possible from a certain area, for example, to only allow edge swipes, or to have a draggable element and ignore swipes elsewhere.

If not implemented, the default implementation returns the allocation of self, allowing swipes from anywhere.

To override it in a new class, give register-type #:vfuncs `((get-swipe-area . ,procedure)). The procedure is called as (procedure self navigation-direction is-drag rect).

implementor

Passed: the class whose implementation to call: a class that implements <AdwSwipeable>, or its GType number.

self

Passed: a <AdwSwipeable>.

a swipeable

navigation-direction

Passed: a <AdwNavigationDirection>, or one of its symbols.

the direction of the swipe

is-drag

Passed: a boolean.

whether the swipe is caused by a dragging gesture

rect

Passed, filled in, and returned: a <GdkRectangle>.

a pointer to a rectangle to store the swipe area