[libhandy/correct-signal-params: 126/126] swipeable: Correct signal parameters for begin-swipe
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libhandy/correct-signal-params: 126/126] swipeable: Correct signal parameters for begin-swipe
- Date: Fri, 22 May 2020 13:39:25 +0000 (UTC)
commit 70a3f684beb7e5c882e9bd334573b85f794ce450
Author: Ujjwal Kumar <ujjwalkumar0501 gmail com>
Date: Wed Mar 18 21:08:53 2020 +0530
swipeable: Correct signal parameters for begin-swipe
Fixes the function name conflict warning during introspection
src/hdy-swipe-group.c | 1 +
src/hdy-swipeable.c | 12 +++++++++---
2 files changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/src/hdy-swipe-group.c b/src/hdy-swipe-group.c
index 0b05067f..d5dfc58e 100644
--- a/src/hdy-swipe-group.c
+++ b/src/hdy-swipe-group.c
@@ -120,6 +120,7 @@ switch_child_cb (HdySwipeGroup *self,
static void
begin_swipe_cb (HdySwipeGroup *self,
HdyNavigationDirection direction,
+ gboolean direct,
HdySwipeable *swipeable)
{
GSList *swipeables;
diff --git a/src/hdy-swipeable.c b/src/hdy-swipeable.c
index 9228ac7f..78c57b5b 100644
--- a/src/hdy-swipeable.c
+++ b/src/hdy-swipeable.c
@@ -63,12 +63,18 @@ hdy_swipeable_default_init (HdySwipeableInterface *iface)
* HdySwipeable::begin-swipe:
* @self: The #HdySwipeable instance
* @direction: The direction of the swipe, can be 1 or -1
+ * @direct: %TRUE if the swipe is directly triggered by a gesture,
+ * %FALSE if it's triggered via a #HdySwipeGroup
*
* This signal is emitted when a possible swipe is detected. This is used by
* #HdySwipeGroup, applications should not connect to it.
* The @direction value can be used to restrict the swipe to a certain
* direction.
*
+ * The @direct parameter can be used to have widgets that aren't swipeable, but
+ * can still animate in sync with other widgets in a #HdySwipeGroup by only
+ * applying restrictions if @direct is %TRUE.
+ *
* Since: 0.0.12
*/
signals[SIGNAL_BEGIN_SWIPE] =
@@ -78,8 +84,8 @@ hdy_swipeable_default_init (HdySwipeableInterface *iface)
0,
NULL, NULL, NULL,
G_TYPE_NONE,
- 1,
- HDY_TYPE_NAVIGATION_DIRECTION);
+ 2,
+ HDY_TYPE_NAVIGATION_DIRECTION, G_TYPE_BOOLEAN);
/**
* HdySwipeable::update-swipe:
@@ -181,7 +187,7 @@ hdy_swipeable_begin_swipe (HdySwipeable *self,
(* iface->begin_swipe) (self, direction, direct);
- g_signal_emit (self, signals[SIGNAL_BEGIN_SWIPE], 0, direction);
+ g_signal_emit (self, signals[SIGNAL_BEGIN_SWIPE], 0, direction, direct);
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]