[libhandy] swipe-tracker: Make public
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libhandy] swipe-tracker: Make public
- Date: Wed, 1 Jul 2020 07:07:32 +0000 (UTC)
commit 916272c831c61a1e654557eeb0de03f2e95c0b63
Author: Alexander Mikhaylenko <alexm gnome org>
Date: Mon Jun 15 01:41:24 2020 +0500
swipe-tracker: Make public
Signed-off-by: Alexander Mikhaylenko <alexm gnome org>
doc/handy-docs.xml | 1 +
src/handy.h | 1 +
src/hdy-carousel.c | 2 +-
src/hdy-stackable-box.c | 2 +-
src/hdy-swipe-tracker-private.h | 42 +++++++++--------------------------------
src/hdy-swipe-tracker.c | 3 +--
src/hdy-swipe-tracker.h | 41 ++++++++++++++++++++++++++++++++++++++++
src/meson.build | 1 +
8 files changed, 56 insertions(+), 37 deletions(-)
---
diff --git a/doc/handy-docs.xml b/doc/handy-docs.xml
index 8c3b3c66..4c04e6be 100644
--- a/doc/handy-docs.xml
+++ b/doc/handy-docs.xml
@@ -58,6 +58,7 @@
<xi:include href="xml/hdy-squeezer.xml"/>
<xi:include href="xml/hdy-swipeable.xml"/>
<xi:include href="xml/hdy-swipe-group.xml"/>
+ <xi:include href="xml/hdy-swipe-tracker.xml"/>
<xi:include href="xml/hdy-title-bar.xml"/>
<xi:include href="xml/hdy-value-object.xml"/>
<xi:include href="xml/hdy-view-switcher.xml"/>
diff --git a/src/handy.h b/src/handy.h
index d63469e6..1e5128f8 100644
--- a/src/handy.h
+++ b/src/handy.h
@@ -49,6 +49,7 @@ G_BEGIN_DECLS
#include "hdy-search-bar.h"
#include "hdy-squeezer.h"
#include "hdy-swipe-group.h"
+#include "hdy-swipe-tracker.h"
#include "hdy-swipeable.h"
#include "hdy-title-bar.h"
#include "hdy-value-object.h"
diff --git a/src/hdy-carousel.c b/src/hdy-carousel.c
index 37821485..e63e9408 100644
--- a/src/hdy-carousel.c
+++ b/src/hdy-carousel.c
@@ -12,7 +12,7 @@
#include "hdy-animation-private.h"
#include "hdy-carousel-box-private.h"
#include "hdy-navigation-direction.h"
-#include "hdy-swipe-tracker-private.h"
+#include "hdy-swipe-tracker.h"
#include "hdy-swipeable.h"
#include <math.h>
diff --git a/src/hdy-stackable-box.c b/src/hdy-stackable-box.c
index 29cb2c60..9b48dcd4 100644
--- a/src/hdy-stackable-box.c
+++ b/src/hdy-stackable-box.c
@@ -14,7 +14,7 @@
#include "hdy-stackable-box-private.h"
#include "hdy-shadow-helper-private.h"
#include "hdy-swipeable.h"
-#include "hdy-swipe-tracker-private.h"
+#include "hdy-swipe-tracker.h"
/**
* PRIVATE:hdy-stackable-box
diff --git a/src/hdy-swipe-tracker-private.h b/src/hdy-swipe-tracker-private.h
index 99c6afa7..d4b5541e 100644
--- a/src/hdy-swipe-tracker-private.h
+++ b/src/hdy-swipe-tracker-private.h
@@ -10,41 +10,17 @@
#error "Only <handy.h> can be included directly."
#endif
-#include <gtk/gtk.h>
-#include "hdy-swipeable.h"
+#include "hdy-swipe-tracker.h"
G_BEGIN_DECLS
-#define HDY_TYPE_SWIPE_TRACKER (hdy_swipe_tracker_get_type())
-
-G_DECLARE_FINAL_TYPE (HdySwipeTracker, hdy_swipe_tracker, HDY, SWIPE_TRACKER, GObject)
-
-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);
-
-gboolean hdy_swipe_tracker_get_reversed (HdySwipeTracker *self);
-void hdy_swipe_tracker_set_reversed (HdySwipeTracker *self,
- gboolean reversed);
-
-gboolean hdy_swipe_tracker_get_allow_mouse_drag (HdySwipeTracker *self);
-void hdy_swipe_tracker_set_allow_mouse_drag (HdySwipeTracker *self,
- gboolean allow_mouse_drag);
-
-void hdy_swipe_tracker_shift_position (HdySwipeTracker *self,
- gdouble delta);
-
-void hdy_swipe_tracker_emit_begin_swipe (HdySwipeTracker *self,
- HdyNavigationDirection direction,
- gboolean direct);
-void hdy_swipe_tracker_emit_update_swipe (HdySwipeTracker *self,
- gdouble progress);
-void hdy_swipe_tracker_emit_end_swipe (HdySwipeTracker *self,
- gint64 duration,
- gdouble to);
+void hdy_swipe_tracker_emit_begin_swipe (HdySwipeTracker *self,
+ HdyNavigationDirection direction,
+ gboolean direct);
+void hdy_swipe_tracker_emit_update_swipe (HdySwipeTracker *self,
+ gdouble progress);
+void hdy_swipe_tracker_emit_end_swipe (HdySwipeTracker *self,
+ gint64 duration,
+ gdouble to);
G_END_DECLS
diff --git a/src/hdy-swipe-tracker.c b/src/hdy-swipe-tracker.c
index 5a718c6c..51c5d41a 100644
--- a/src/hdy-swipe-tracker.c
+++ b/src/hdy-swipe-tracker.c
@@ -24,11 +24,10 @@
#define DRAG_THRESHOLD_DISTANCE 5
/**
- * PRIVATE:hdy-swipe-tracker
+ * SECTION:hdy-swipe-tracker
* @short_description: Swipe tracker used in #HdyCarousel and #HdyLeaflet
* @title: HdySwipeTracker
* @See_also: #HdyCarousel, #HdyDeck, #HdyLeaflet, #HdySwipeable
- * @stability: Private
*
* The HdySwipeTracker object can be used for implementing widgets with swipe
* gestures. It supports touch-based swipes, pointer dragging, and touchpad
diff --git a/src/hdy-swipe-tracker.h b/src/hdy-swipe-tracker.h
new file mode 100644
index 00000000..fe77e04b
--- /dev/null
+++ b/src/hdy-swipe-tracker.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2019 Alexander Mikhaylenko <exalm7659 gmail com>
+ *
+ * SPDX-License-Identifier: LGPL-2.1+
+ */
+
+#pragma once
+
+#if !defined(_HANDY_INSIDE) && !defined(HANDY_COMPILATION)
+#error "Only <handy.h> can be included directly."
+#endif
+
+#include <gtk/gtk.h>
+#include "hdy-swipeable.h"
+
+G_BEGIN_DECLS
+
+#define HDY_TYPE_SWIPE_TRACKER (hdy_swipe_tracker_get_type())
+
+G_DECLARE_FINAL_TYPE (HdySwipeTracker, hdy_swipe_tracker, HDY, SWIPE_TRACKER, GObject)
+
+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);
+
+gboolean hdy_swipe_tracker_get_reversed (HdySwipeTracker *self);
+void hdy_swipe_tracker_set_reversed (HdySwipeTracker *self,
+ gboolean reversed);
+
+gboolean hdy_swipe_tracker_get_allow_mouse_drag (HdySwipeTracker *self);
+void hdy_swipe_tracker_set_allow_mouse_drag (HdySwipeTracker *self,
+ gboolean allow_mouse_drag);
+
+void hdy_swipe_tracker_shift_position (HdySwipeTracker *self,
+ gdouble delta);
+
+G_END_DECLS
diff --git a/src/meson.build b/src/meson.build
index d121fa16..2dfdd172 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -89,6 +89,7 @@ src_headers = [
'hdy-search-bar.h',
'hdy-squeezer.h',
'hdy-swipe-group.h',
+ 'hdy-swipe-tracker.h',
'hdy-swipeable.h',
'hdy-title-bar.h',
'hdy-value-object.h',
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]