Top | ![]() |
![]() |
![]() |
![]() |
double | adw_swipeable_get_distance () |
double * | adw_swipeable_get_snap_points () |
double | adw_swipeable_get_progress () |
double | adw_swipeable_get_cancel_progress () |
void | adw_swipeable_get_swipe_area () |
double
adw_swipeable_get_distance (AdwSwipeable *self
);
Gets the swipe distance of self
. This corresponds to how many pixels
1 unit represents.
Since: 1.0
double * adw_swipeable_get_snap_points (AdwSwipeable *self
,int *n_snap_points
);
Gets the snap points of self
. Each snap point represents a progress value
that is considered acceptable to end the swipe on.
[virtual get_snap_points]
the snap points of
self
. The array must be freed with g_free()
.
[array length=n_snap_points][transfer full]
Since: 1.0
double
adw_swipeable_get_progress (AdwSwipeable *self
);
Gets the current progress of self
Since: 1.0
double
adw_swipeable_get_cancel_progress (AdwSwipeable *self
);
Gets the progress self
will snap back to after the gesture is canceled.
Since: 1.0
void adw_swipeable_get_swipe_area (AdwSwipeable *self
,AdwNavigationDirection navigation_direction
,gboolean is_drag
,GdkRectangle *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 |
||
navigation_direction |
the direction of the swipe |
|
is_drag |
whether the swipe is caused by a dragging gesture |
|
rect |
a pointer to a GdkRectangle to store the swipe area. |
[out] |
Since: 1.0
struct AdwSwipeableInterface { GTypeInterface parent; double (*get_distance) (AdwSwipeable *self); double * (*get_snap_points) (AdwSwipeable *self, int *n_snap_points); double (*get_progress) (AdwSwipeable *self); double (*get_cancel_progress) (AdwSwipeable *self); void (*get_swipe_area) (AdwSwipeable *self, AdwNavigationDirection navigation_direction, gboolean is_drag, GdkRectangle *rect); };
An interface for swipeable widgets.
Since: 1.0