[libhandy] swipeable: Remove get_range()



commit 3c00784606b082a63d35809ecddf83b44df2c72b
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Sun Jun 28 20:04:59 2020 +0500

    swipeable: Remove get_range()
    
    And now the interface is a little more similar for C and bindings.
    
    Signed-off-by: Alexander Mikhaylenko <alexm gnome org>

 debian/libhandy-1-0.symbols     |  2 --
 src/hdy-carousel.c              | 11 ---------
 src/hdy-deck.c                  |  9 --------
 src/hdy-leaflet.c               |  9 --------
 src/hdy-stackable-box-private.h |  3 ---
 src/hdy-stackable-box.c         | 51 -----------------------------------------
 src/hdy-swipeable-private.h     |  3 ---
 src/hdy-swipeable.c             | 25 --------------------
 src/hdy-swipeable.h             |  4 ----
 9 files changed, 117 deletions(-)
---
diff --git a/debian/libhandy-1-0.symbols b/debian/libhandy-1-0.symbols
index b2525229..5b179e20 100644
--- a/debian/libhandy-1-0.symbols
+++ b/debian/libhandy-1-0.symbols
@@ -288,7 +288,6 @@ libhandy-1.so.0 libhandy-1-0 #MINVER#
  hdy_stackable_box_get_mode_transition_duration@LIBHANDY_1_0 0.80.0
  hdy_stackable_box_get_orientation@LIBHANDY_1_0 0.80.0
  hdy_stackable_box_get_progress@LIBHANDY_1_0 0.81.0
- hdy_stackable_box_get_range@LIBHANDY_1_0 0.81.0
  hdy_stackable_box_get_transition_type@LIBHANDY_1_0 0.80.0
  hdy_stackable_box_get_type@LIBHANDY_1_0 0.80.0
  hdy_stackable_box_get_visible_child@LIBHANDY_1_0 0.80.0
@@ -334,7 +333,6 @@ libhandy-1.so.0 libhandy-1-0 #MINVER#
  hdy_swipeable_get_cancel_progress@LIBHANDY_1_0 0.81.0
  hdy_swipeable_get_distance@LIBHANDY_1_0 0.81.0
  hdy_swipeable_get_progress@LIBHANDY_1_0 0.81.0
- hdy_swipeable_get_range@LIBHANDY_1_0 0.81.0
  hdy_swipeable_get_snap_points@LIBHANDY_1_0 0.81.0
  hdy_swipeable_get_type@LIBHANDY_1_0 0.0.12
  hdy_swipeable_switch_child@LIBHANDY_1_0 0.0.12
diff --git a/src/hdy-carousel.c b/src/hdy-carousel.c
index 997ae87f..d2c19f40 100644
--- a/src/hdy-carousel.c
+++ b/src/hdy-carousel.c
@@ -216,16 +216,6 @@ hdy_carousel_get_distance (HdySwipeable *swipeable)
   return hdy_carousel_box_get_distance (self->scrolling_box);
 }
 
-static void
-hdy_carousel_get_range (HdySwipeable *swipeable,
-                        gdouble      *lower,
-                        gdouble      *upper)
-{
-  HdyCarousel *self = HDY_CAROUSEL (swipeable);
-
-  hdy_carousel_box_get_range (self->scrolling_box, lower, upper);
-}
-
 static gdouble *
 hdy_carousel_get_snap_points (HdySwipeable *swipeable,
                               gint         *n_snap_points)
@@ -916,7 +906,6 @@ hdy_carousel_swipeable_init (HdySwipeableInterface *iface)
 {
   iface->switch_child = hdy_carousel_switch_child;
   iface->get_distance = hdy_carousel_get_distance;
-  iface->get_range = hdy_carousel_get_range;
   iface->get_snap_points = hdy_carousel_get_snap_points;
   iface->get_progress = hdy_carousel_get_progress;
   iface->get_cancel_progress = hdy_carousel_get_cancel_progress;
diff --git a/src/hdy-deck.c b/src/hdy-deck.c
index f3bfac28..f547b61b 100644
--- a/src/hdy-deck.c
+++ b/src/hdy-deck.c
@@ -775,14 +775,6 @@ hdy_deck_get_distance (HdySwipeable *swipeable)
   return hdy_stackable_box_get_distance (HDY_GET_HELPER (swipeable));
 }
 
-static void
-hdy_deck_get_range (HdySwipeable *swipeable,
-                       gdouble      *lower,
-                       gdouble      *upper)
-{
-  hdy_stackable_box_get_range (HDY_GET_HELPER (swipeable), lower, upper);
-}
-
 static gdouble *
 hdy_deck_get_snap_points (HdySwipeable *swipeable,
                           gint         *n_snap_points)
@@ -1054,7 +1046,6 @@ hdy_deck_swipeable_init (HdySwipeableInterface *iface)
 {
   iface->switch_child = hdy_deck_switch_child;
   iface->get_distance = hdy_deck_get_distance;
-  iface->get_range = hdy_deck_get_range;
   iface->get_snap_points = hdy_deck_get_snap_points;
   iface->get_progress = hdy_deck_get_progress;
   iface->get_cancel_progress = hdy_deck_get_cancel_progress;
diff --git a/src/hdy-leaflet.c b/src/hdy-leaflet.c
index c6e113ef..9dcc923a 100644
--- a/src/hdy-leaflet.c
+++ b/src/hdy-leaflet.c
@@ -848,14 +848,6 @@ hdy_leaflet_get_distance (HdySwipeable *swipeable)
   return hdy_stackable_box_get_distance (HDY_GET_HELPER (swipeable));
 }
 
-static void
-hdy_leaflet_get_range (HdySwipeable *swipeable,
-                       gdouble      *lower,
-                       gdouble      *upper)
-{
-  hdy_stackable_box_get_range (HDY_GET_HELPER (swipeable), lower, upper);
-}
-
 static gdouble *
 hdy_leaflet_get_snap_points (HdySwipeable *swipeable,
                              gint         *n_snap_points)
@@ -1159,7 +1151,6 @@ hdy_leaflet_swipeable_init (HdySwipeableInterface *iface)
 {
   iface->switch_child = hdy_leaflet_switch_child;
   iface->get_distance = hdy_leaflet_get_distance;
-  iface->get_range = hdy_leaflet_get_range;
   iface->get_snap_points = hdy_leaflet_get_snap_points;
   iface->get_progress = hdy_leaflet_get_progress;
   iface->get_cancel_progress = hdy_leaflet_get_cancel_progress;
diff --git a/src/hdy-stackable-box-private.h b/src/hdy-stackable-box-private.h
index 143a29ea..f2497803 100644
--- a/src/hdy-stackable-box-private.h
+++ b/src/hdy-stackable-box-private.h
@@ -91,9 +91,6 @@ void             hdy_stackable_box_switch_child (HdyStackableBox *self,
 gdouble          hdy_stackable_box_get_distance (HdyStackableBox *self);
 gdouble         *hdy_stackable_box_get_snap_points (HdyStackableBox *self,
                                                     gint            *n_snap_points);
-void             hdy_stackable_box_get_range (HdyStackableBox *self,
-                                              gdouble         *lower,
-                                              gdouble         *upper);
 gdouble          hdy_stackable_box_get_progress (HdyStackableBox *self);
 gdouble          hdy_stackable_box_get_cancel_progress (HdyStackableBox *self);
 
diff --git a/src/hdy-stackable-box.c b/src/hdy-stackable-box.c
index 0832e578..09b59388 100644
--- a/src/hdy-stackable-box.c
+++ b/src/hdy-stackable-box.c
@@ -2613,57 +2613,6 @@ hdy_stackable_box_get_snap_points (HdyStackableBox *self,
   return points;
 }
 
-void
-hdy_stackable_box_get_range (HdyStackableBox *self,
-                             gdouble         *lower,
-                             gdouble         *upper)
-{
-  if (self->child_transition.tick_id > 0 ||
-      self->child_transition.is_gesture_active) {
-    gint current_direction;
-    gboolean is_rtl;
-
-    is_rtl = (gtk_widget_get_direction (GTK_WIDGET (self->container)) == GTK_TEXT_DIR_RTL);
-
-    switch (self->child_transition.active_direction) {
-    case GTK_PAN_DIRECTION_UP:
-      current_direction = 1;
-      break;
-    case GTK_PAN_DIRECTION_DOWN:
-      current_direction = -1;
-      break;
-    case GTK_PAN_DIRECTION_LEFT:
-      current_direction = is_rtl ? -1 : 1;
-      break;
-    case GTK_PAN_DIRECTION_RIGHT:
-      current_direction = is_rtl ? 1 : -1;
-      break;
-    default:
-      g_assert_not_reached ();
-    }
-
-    if (lower)
-      *lower = MIN (0, current_direction);
-
-    if (upper)
-      *upper = MAX (0, current_direction);
-  } else {
-    HdyStackableBoxChildInfo *child;
-
-    if ((can_swipe_in_direction (self, self->child_transition.swipe_direction) ||
-         !self->child_transition.is_direct_swipe) && self->folded)
-      child = find_swipeable_child (self, self->child_transition.swipe_direction);
-    else
-      child = NULL;
-
-    if (lower)
-      *lower = MIN (0, child ? self->child_transition.swipe_direction : 0);
-
-    if (upper)
-      *upper = MAX (0, child ? self->child_transition.swipe_direction : 0);
-  }
-}
-
 gdouble
 hdy_stackable_box_get_progress (HdyStackableBox *self)
 {
diff --git a/src/hdy-swipeable-private.h b/src/hdy-swipeable-private.h
index 77357573..17c6bbe2 100644
--- a/src/hdy-swipeable-private.h
+++ b/src/hdy-swipeable-private.h
@@ -20,9 +20,6 @@ void hdy_swipeable_emit_child_switched (HdySwipeable *self,
                                         gint64        duration);
 
 gdouble  hdy_swipeable_get_distance        (HdySwipeable *self);
-void     hdy_swipeable_get_range           (HdySwipeable *self,
-                                            gdouble      *lower,
-                                            gdouble      *upper);
 gdouble *hdy_swipeable_get_snap_points     (HdySwipeable *self,
                                             gint         *n_snap_points);
 gdouble  hdy_swipeable_get_progress        (HdySwipeable *self);
diff --git a/src/hdy-swipeable.c b/src/hdy-swipeable.c
index d0bd6841..8d8fb687 100644
--- a/src/hdy-swipeable.c
+++ b/src/hdy-swipeable.c
@@ -131,31 +131,6 @@ hdy_swipeable_get_distance (HdySwipeable *self)
   return (* iface->get_distance) (self);
 }
 
-/**
- * hdy_swipeable_get_range:
- * @self: a #HdySwipeable
- * @lower: (out) (allow-none): location to store the minimum possible value, or %NULL
- * @upper: (out) (allow-none): location to store the maximum possible value, or %NULL
- *
- * Gets the range of possible progress values.
- *
- * Since: 1.0
- */
-void
-hdy_swipeable_get_range (HdySwipeable *self,
-                         gdouble      *lower,
-                         gdouble      *upper)
-{
-  HdySwipeableInterface *iface;
-
-  g_return_if_fail (HDY_IS_SWIPEABLE (self));
-
-  iface = HDY_SWIPEABLE_GET_IFACE (self);
-  g_return_if_fail (iface->get_range != NULL);
-
-  (* iface->get_range) (self, lower, upper);
-}
-
 /**
  * hdy_swipeable_get_snap_points: (virtual get_snap_points)
  * @self: a #HdySwipeable
diff --git a/src/hdy-swipeable.h b/src/hdy-swipeable.h
index 5c4f4ef5..5f3d7fd1 100644
--- a/src/hdy-swipeable.h
+++ b/src/hdy-swipeable.h
@@ -24,7 +24,6 @@ G_DECLARE_INTERFACE (HdySwipeable, hdy_swipeable, HDY, SWIPEABLE, GtkWidget)
  * @parent: The parent interface.
  * @switch_child: Switches visible child.
  * @get_distance: Gets the swipe distance.
- * @get_range: Gets the range of progress values.
  * @get_snap_points: Gets the snap points
  * @get_progress: Gets the current progress.
  * @get_cancel_progress: Gets the cancel progress.
@@ -43,9 +42,6 @@ struct _HdySwipeableInterface
                         gint64        duration);
 
   gdouble   (*get_distance)        (HdySwipeable *self);
-  void      (*get_range)           (HdySwipeable *self,
-                                    gdouble      *lower,
-                                    gdouble      *upper);
   gdouble * (*get_snap_points)     (HdySwipeable *self,
                                     gint         *n_snap_points);
   gdouble   (*get_progress)        (HdySwipeable *self);


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