Top | ![]() |
![]() |
![]() |
![]() |
HdySwipeTrackerHdySwipeTracker — Swipe tracker used in HdyCarousel and HdyLeaflet |
HdySwipeTracker * | hdy_swipe_tracker_new () |
HdySwipeable * | hdy_swipe_tracker_get_swipeable () |
gboolean | hdy_swipe_tracker_get_enabled () |
void | hdy_swipe_tracker_set_enabled () |
gboolean | hdy_swipe_tracker_get_reversed () |
void | hdy_swipe_tracker_set_reversed () |
gboolean | hdy_swipe_tracker_get_allow_mouse_drag () |
void | hdy_swipe_tracker_set_allow_mouse_drag () |
gboolean | hdy_swipe_tracker_get_allow_long_swipes () |
void | hdy_swipe_tracker_set_allow_long_swipes () |
void | hdy_swipe_tracker_shift_position () |
gboolean | allow-long-swipes | Read / Write |
gboolean | allow-mouse-drag | Read / Write |
gboolean | enabled | Read / Write |
gboolean | reversed | Read / Write |
HdySwipeable * | swipeable | Read / Write / Construct Only |
The HdySwipeTracker 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 “enabled” property. If they expect to use horizontal orientation, “reversed” property can be used for supporting RTL text direction.
HdySwipeTracker *
hdy_swipe_tracker_new (HdySwipeable *swipeable
);
Create a new HdySwipeTracker object on widget
.
Since: 1.0
HdySwipeable *
hdy_swipe_tracker_get_swipeable (HdySwipeTracker *self
);
Get self
's swipeable widget.
Since: 1.0
gboolean
hdy_swipe_tracker_get_enabled (HdySwipeTracker *self
);
Get whether self
is enabled. When it's not enabled, no events will be
processed. Generally widgets will want to expose this via a property.
Since: 1.0
void hdy_swipe_tracker_set_enabled (HdySwipeTracker *self
,gboolean enabled
);
Set whether self
is enabled. When it's not enabled, no events will be
processed. Usually widgets will want to expose this via a property.
Since: 1.0
gboolean
hdy_swipe_tracker_get_reversed (HdySwipeTracker *self
);
Get whether self
is reversing the swipe direction.
Since: 1.0
void hdy_swipe_tracker_set_reversed (HdySwipeTracker *self
,gboolean reversed
);
Set whether to reverse the swipe direction. If self
is horizontal,
can be used for supporting RTL text direction.
Since: 1.0
gboolean
hdy_swipe_tracker_get_allow_mouse_drag
(HdySwipeTracker *self
);
Get whether self
can be dragged with mouse pointer.
Since: 1.0
void hdy_swipe_tracker_set_allow_mouse_drag (HdySwipeTracker *self
,gboolean allow_mouse_drag
);
Set whether self
can be dragged with mouse pointer. This should usually be
FALSE
.
Since: 1.0
gboolean
hdy_swipe_tracker_get_allow_long_swipes
(HdySwipeTracker *self
);
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.
Since: 1.2
void hdy_swipe_tracker_set_allow_long_swipes (HdySwipeTracker *self
,gboolean 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.
Since: 1.2
void hdy_swipe_tracker_shift_position (HdySwipeTracker *self
,gdouble delta
);
Move the current progress value by delta
. This can be used to adjust the
current position if snap points move during the gesture.
Since: 1.0
“allow-long-swipes”
property “allow-long-swipes” gboolean
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.
Owner: HdySwipeTracker
Flags: Read / Write
Default value: FALSE
Since: 1.2
“allow-mouse-drag”
property “allow-mouse-drag” gboolean
Whether to allow dragging with mouse pointer. This should usually be
FALSE
.
Owner: HdySwipeTracker
Flags: Read / Write
Default value: FALSE
Since: 1.0
“enabled”
property “enabled” gboolean
Whether the swipe tracker is enabled. When it's not enabled, no events will be processed. Usually widgets will want to expose this via a property.
Owner: HdySwipeTracker
Flags: Read / Write
Default value: TRUE
Since: 1.0
“reversed”
property “reversed” gboolean
Whether to reverse the swipe direction. If the swipe tracker is horizontal, it can be used for supporting RTL text direction.
Owner: HdySwipeTracker
Flags: Read / Write
Default value: FALSE
Since: 1.0
“swipeable”
property“swipeable” HdySwipeable *
The widget the swipe tracker is attached to. Must not be NULL
.
Owner: HdySwipeTracker
Flags: Read / Write / Construct Only
Since: 1.0
“begin-swipe”
signalvoid user_function (HdySwipeTracker *self, HdyNavigationDirection direction, gboolean direct, gpointer user_data)
This signal is emitted when a possible swipe is detected.
The direction
value can be used to restrict the swipe to a certain
direction.
self |
The HdySwipeTracker instance |
|
direction |
The direction of the swipe |
|
direct |
|
|
user_data |
user data set when the signal handler was connected. |
Flags: Run First
Since: 1.0
“end-swipe”
signalvoid user_function (HdySwipeTracker *self, gint64 duration, double to, gpointer user_data)
This signal is emitted as soon as the gesture has stopped.
self |
The HdySwipeTracker instance |
|
duration |
Snap-back animation duration in milliseconds |
|
to |
The progress value to animate to |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run First
Since: 1.0
“update-swipe”
signalvoid user_function (HdySwipeTracker *self, double progress, gpointer user_data)
This signal is emitted every time the progress value changes.
self |
The HdySwipeTracker instance |
|
progress |
The current animation progress value |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run First
Since: 1.0