[libhandy] swipeable: Rename switch-child signal to child-switched



commit 0baa348a7d1f4851ce539206f8486a058731e1a9
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Sun Jun 14 23:07:26 2020 +0500

    swipeable: Rename switch-child signal to child-switched
    
    Also rename emit_switch_child() to emit_child_switched()
    
    Signed-off-by: Alexander Mikhaylenko <alexm gnome org>

 debian/libhandy-1-0.symbols |  2 +-
 src/hdy-carousel.c          |  2 +-
 src/hdy-stackable-box.c     |  8 ++++----
 src/hdy-swipe-group.c       | 10 +++++-----
 src/hdy-swipeable-private.h |  6 +++---
 src/hdy-swipeable.c         | 26 +++++++++++++-------------
 6 files changed, 27 insertions(+), 27 deletions(-)
---
diff --git a/debian/libhandy-1-0.symbols b/debian/libhandy-1-0.symbols
index 704e5c85..1ece9630 100644
--- a/debian/libhandy-1-0.symbols
+++ b/debian/libhandy-1-0.symbols
@@ -333,7 +333,7 @@ libhandy-1.so.0 libhandy-1-0 #MINVER#
  hdy_swipe_tracker_set_reversed@LIBHANDY_1_0 0.0.11
  hdy_swipe_tracker_shift_position@LIBHANDY_1_0 0.81.0
  hdy_swipeable_begin_swipe@LIBHANDY_1_0 0.0.12
- hdy_swipeable_emit_switch_child@LIBHANDY_1_0 0.0.12
+ hdy_swipeable_emit_child_switched@LIBHANDY_1_0 0.82.0
  hdy_swipeable_end_swipe@LIBHANDY_1_0 0.0.12
  hdy_swipeable_get_cancel_progress@LIBHANDY_1_0 0.81.0
  hdy_swipeable_get_distance@LIBHANDY_1_0 0.81.0
diff --git a/src/hdy-carousel.c b/src/hdy-carousel.c
index 4a72e50f..189e8b90 100644
--- a/src/hdy-carousel.c
+++ b/src/hdy-carousel.c
@@ -1289,7 +1289,7 @@ hdy_carousel_scroll_to_full (HdyCarousel *self,
 
   hdy_carousel_box_scroll_to (self->scrolling_box, widget,
                                duration);
-  hdy_swipeable_emit_switch_child (HDY_SWIPEABLE (self), n, duration);
+  hdy_swipeable_emit_child_switched (HDY_SWIPEABLE (self), n, duration);
 }
 
 /**
diff --git a/src/hdy-stackable-box.c b/src/hdy-stackable-box.c
index 7b591f90..2da1d559 100644
--- a/src/hdy-stackable-box.c
+++ b/src/hdy-stackable-box.c
@@ -524,7 +524,7 @@ set_visible_child_info (HdyStackableBox               *self,
                         HdyStackableBoxChildInfo      *new_visible_child,
                         HdyStackableBoxTransitionType  transition_type,
                         guint                          transition_duration,
-                        gboolean                       emit_switch_child)
+                        gboolean                       emit_child_switched)
 {
   GtkWidget *widget = GTK_WIDGET (self->container);
   GList *children;
@@ -641,7 +641,7 @@ set_visible_child_info (HdyStackableBox               *self,
     hdy_stackable_box_start_child_transition (self, transition_duration, transition_direction);
   }
 
-  if (emit_switch_child) {
+  if (emit_child_switched) {
     gint index = 0;
 
     for (children = self->children; children; children = children->next) {
@@ -656,8 +656,8 @@ set_visible_child_info (HdyStackableBox               *self,
       index++;
     }
 
-    hdy_swipeable_emit_switch_child (HDY_SWIPEABLE (self->container), index,
-                                     transition_duration);
+    hdy_swipeable_emit_child_switched (HDY_SWIPEABLE (self->container), index,
+                                       transition_duration);
   }
 
   g_object_freeze_notify (G_OBJECT (self));
diff --git a/src/hdy-swipe-group.c b/src/hdy-swipe-group.c
index 0b05067f..4434fe8e 100644
--- a/src/hdy-swipe-group.c
+++ b/src/hdy-swipe-group.c
@@ -102,10 +102,10 @@ hdy_swipe_group_new (void)
 }
 
 static void
-switch_child_cb (HdySwipeGroup *self,
-                 uint           index,
-                 gint64         duration,
-                 HdySwipeable  *swipeable)
+child_switched_cb (HdySwipeGroup *self,
+                   uint           index,
+                   gint64         duration,
+                   HdySwipeable  *swipeable)
 {
   GSList *swipeables;
 
@@ -184,7 +184,7 @@ hdy_swipe_group_add_swipeable (HdySwipeGroup *self,
   g_return_if_fail (HDY_IS_SWIPE_GROUP (self));
   g_return_if_fail (HDY_IS_SWIPEABLE (swipeable));
 
-  g_signal_connect_swapped (swipeable, "switch-child", G_CALLBACK (switch_child_cb), self);
+  g_signal_connect_swapped (swipeable, "child-switched", G_CALLBACK (child_switched_cb), self);
   g_signal_connect_swapped (swipeable, "begin-swipe", G_CALLBACK (begin_swipe_cb), self);
   g_signal_connect_swapped (swipeable, "update-swipe", G_CALLBACK (update_swipe_cb), self);
   g_signal_connect_swapped (swipeable, "end-swipe", G_CALLBACK (end_swipe_cb), self);
diff --git a/src/hdy-swipeable-private.h b/src/hdy-swipeable-private.h
index 1fea7a9b..3df3e21e 100644
--- a/src/hdy-swipeable-private.h
+++ b/src/hdy-swipeable-private.h
@@ -23,9 +23,9 @@ void hdy_swipeable_end_swipe    (HdySwipeable *self,
                                  gint64        duration,
                                  gdouble       to);
 
-void hdy_swipeable_emit_switch_child (HdySwipeable *self,
-                                      guint         index,
-                                      gint64        duration);
+void hdy_swipeable_emit_child_switched (HdySwipeable *self,
+                                        guint         index,
+                                        gint64        duration);
 
 gdouble  hdy_swipeable_get_distance        (HdySwipeable *self);
 void     hdy_swipeable_get_range           (HdySwipeable *self,
diff --git a/src/hdy-swipeable.c b/src/hdy-swipeable.c
index addd220a..8c5b2452 100644
--- a/src/hdy-swipeable.c
+++ b/src/hdy-swipeable.c
@@ -25,7 +25,7 @@
 G_DEFINE_INTERFACE (HdySwipeable, hdy_swipeable, GTK_TYPE_WIDGET)
 
 enum {
-  SIGNAL_SWITCH_CHILD,
+  SIGNAL_CHILD_SWITCHED,
   SIGNAL_BEGIN_SWIPE,
   SIGNAL_UPDATE_SWIPE,
   SIGNAL_END_SWIPE,
@@ -38,7 +38,7 @@ static void
 hdy_swipeable_default_init (HdySwipeableInterface *iface)
 {
   /**
-   * HdySwipeable::switch-child:
+   * HdySwipeable::child-switched:
    * @self: The #HdySwipeable instance
    * @index: the index of the child to switch to
    * @duration: Animation duration in milliseconds
@@ -47,10 +47,10 @@ hdy_swipeable_default_init (HdySwipeableInterface *iface)
    *
    * @duration can be 0 if the child is switched without animation.
    *
-   * Since: 0.0.12
+   * Since: 1.0
    */
-  signals[SIGNAL_SWITCH_CHILD] =
-    g_signal_new ("switch-child",
+  signals[SIGNAL_CHILD_SWITCHED] =
+    g_signal_new ("child-switched",
                   G_TYPE_FROM_INTERFACE (iface),
                   G_SIGNAL_RUN_FIRST,
                   0,
@@ -129,7 +129,7 @@ hdy_swipeable_default_init (HdySwipeableInterface *iface)
  * @index: the index of the child to switch to
  * @duration: Animation duration in milliseconds
  *
- * See HdySwipeable::switch-child.
+ * See HdySwipeable::child-switched.
  *
  * Since: 0.0.12
  */
@@ -248,26 +248,26 @@ hdy_swipeable_end_swipe (HdySwipeable *self,
 }
 
 /**
- * hdy_swipeable_emit_switch_child:
+ * hdy_swipeable_emit_child_switched:
  * @self: a #HdySwipeable
  * @index: the index of the child to switch to
  * @duration: Animation duration in milliseconds
  *
- * Emits HdySwipeable::switch-child signal. This should be called when the
+ * Emits HdySwipeable::child-switched signal. This should be called when the
  * widget switches visible child widget.
  *
  * @duration can be 0 if the child is switched without animation.
  *
- * Since: 0.0.12
+ * Since: 1.0
  */
 void
-hdy_swipeable_emit_switch_child (HdySwipeable *self,
-                                 guint         index,
-                                 gint64        duration)
+hdy_swipeable_emit_child_switched (HdySwipeable *self,
+                                   guint         index,
+                                   gint64        duration)
 {
   g_return_if_fail (HDY_IS_SWIPEABLE (self));
 
-  g_signal_emit (self, signals[SIGNAL_SWITCH_CHILD], 0, index, duration);
+  g_signal_emit (self, signals[SIGNAL_CHILD_SWITCHED], 0, index, duration);
 }
 
 /**


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