[libhandy] swipe-tracker: Add get_swipeable()



commit 53aee572312c74d58961875165c03798f87b4aa6
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Sat Jun 20 15:41:08 2020 +0500

    swipe-tracker: Add get_swipeable()
    
    This will allow HdySwipeGroup to get the swipeable from signal handlers.
    
    Signed-off-by: Alexander Mikhaylenko <alexm gnome org>

 src/hdy-swipe-tracker-private.h |  2 ++
 src/hdy-swipe-tracker.c         | 20 +++++++++++++++++++-
 2 files changed, 21 insertions(+), 1 deletion(-)
---
diff --git a/src/hdy-swipe-tracker-private.h b/src/hdy-swipe-tracker-private.h
index 2f4fa541..ee4891dd 100644
--- a/src/hdy-swipe-tracker-private.h
+++ b/src/hdy-swipe-tracker-private.h
@@ -21,6 +21,8 @@ G_DECLARE_FINAL_TYPE (HdySwipeTracker, hdy_swipe_tracker, HDY, SWIPE_TRACKER, GO
 
 HdySwipeTracker *hdy_swipe_tracker_new (HdySwipeable *swipeable);
 
+HdySwipeable    *hdy_swipe_tracker_get_swipeable (HdySwipeTracker *self);
+
 gboolean         hdy_swipe_tracker_get_enabled (HdySwipeTracker *self);
 void             hdy_swipe_tracker_set_enabled (HdySwipeTracker *self,
                                                 gboolean         enabled);
diff --git a/src/hdy-swipe-tracker.c b/src/hdy-swipe-tracker.c
index fec43943..6895cb0c 100644
--- a/src/hdy-swipe-tracker.c
+++ b/src/hdy-swipe-tracker.c
@@ -601,7 +601,7 @@ hdy_swipe_tracker_get_property (GObject    *object,
 
   switch (prop_id) {
   case PROP_SWIPEABLE:
-    g_value_set_object (value, self->swipeable);
+    g_value_set_object (value, hdy_swipe_tracker_get_swipeable (self));
     break;
 
   case PROP_ENABLED:
@@ -775,6 +775,24 @@ hdy_swipe_tracker_new (HdySwipeable *swipeable)
                        NULL);
 }
 
+/**
+ * hdy_swipe_tracker_get_swipeable:
+ * @self: a #HdySwipeTracker
+ *
+ * Get @self's swipeable widget.
+ *
+ * Returns: the swipeable widget
+ *
+ * Since: 1.0
+ */
+HdySwipeable *
+hdy_swipe_tracker_get_swipeable (HdySwipeTracker *self)
+{
+  g_return_val_if_fail (HDY_IS_SWIPE_TRACKER (self), NULL);
+
+  return self->swipeable;
+}
+
 /**
  * hdy_swipe_tracker_get_enabled:
  * @self: a #HdySwipeTracker


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]