[libadwaita] Make animations public
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libadwaita] Make animations public
- Date: Mon, 22 Nov 2021 13:33:36 +0000 (UTC)
commit bbdbb3a30382f4912d320e8ce9a404077675dfc3
Author: Manuel Genovés <manuel genoves gmail com>
Date: Tue Nov 16 14:31:53 2021 +0500
Make animations public
src/adw-animation-private.h | 34 +-----------
src/adw-animation-target-private.h | 21 +-------
src/adw-animation-target.h | 38 ++++++++++++++
src/adw-animation.c | 1 +
src/adw-animation.h | 60 ++++++++++++++++++++++
src/adw-carousel-indicator-dots.c | 2 +-
src/adw-carousel-indicator-lines.c | 2 +-
src/adw-carousel.c | 2 +-
src/adw-flap.c | 2 +-
src/adw-tab-box.c | 2 +-
src/adw-tab.c | 2 +-
src/adw-timed-animation.c | 2 +-
...d-animation-private.h => adw-timed-animation.h} | 18 ++++++-
src/adw-toast-overlay.c | 2 +-
src/adwaita.h | 3 ++
src/meson.build | 7 ++-
16 files changed, 134 insertions(+), 64 deletions(-)
---
diff --git a/src/adw-animation-private.h b/src/adw-animation-private.h
index faca2343..59509875 100644
--- a/src/adw-animation-private.h
+++ b/src/adw-animation-private.h
@@ -11,28 +11,10 @@
#error "Only <adwaita.h> can be included directly."
#endif
-#include "adw-version.h"
-
-#include <gtk/gtk.h>
-
-#include "adw-enums-private.h"
-#include "adw-animation-target-private.h"
+#include "adw-animation.h"
G_BEGIN_DECLS
-#define ADW_DURATION_INFINITE G_MAXUINT
-
-#define ADW_TYPE_ANIMATION (adw_animation_get_type())
-
-G_DECLARE_DERIVABLE_TYPE (AdwAnimation, adw_animation, ADW, ANIMATION, GObject)
-
-typedef enum {
- ADW_ANIMATION_IDLE,
- ADW_ANIMATION_PAUSED,
- ADW_ANIMATION_PLAYING,
- ADW_ANIMATION_FINISHED,
-} AdwAnimationState;
-
struct _AdwAnimationClass
{
GObjectClass parent_class;
@@ -43,18 +25,4 @@ struct _AdwAnimationClass
guint t);
};
-GtkWidget *adw_animation_get_widget (AdwAnimation *self);
-
-AdwAnimationTarget *adw_animation_get_target (AdwAnimation *self);
-
-double adw_animation_get_value (AdwAnimation *self);
-
-AdwAnimationState adw_animation_get_state (AdwAnimation *self);
-
-void adw_animation_play (AdwAnimation *self);
-void adw_animation_pause (AdwAnimation *self);
-void adw_animation_resume (AdwAnimation *self);
-void adw_animation_reset (AdwAnimation *self);
-void adw_animation_skip (AdwAnimation *self);
-
G_END_DECLS
diff --git a/src/adw-animation-target-private.h b/src/adw-animation-target-private.h
index bfa7006f..960d0213 100644
--- a/src/adw-animation-target-private.h
+++ b/src/adw-animation-target-private.h
@@ -10,30 +10,11 @@
#error "Only <adwaita.h> can be included directly."
#endif
-#include "adw-version.h"
-
-#include <gtk/gtk.h>
+#include "adw-animation-target.h"
G_BEGIN_DECLS
-#define ADW_TYPE_ANIMATION_TARGET (adw_animation_target_get_type())
-
-GDK_DECLARE_INTERNAL_TYPE (AdwAnimationTarget, adw_animation_target, ADW, ANIMATION_TARGET, GObject)
-
void adw_animation_target_set_value (AdwAnimationTarget *self,
double value);
-
-
-typedef void (*AdwAnimationTargetFunc) (gpointer user_data,
- double value);
-
-#define ADW_TYPE_CALLBACK_ANIMATION_TARGET (adw_callback_animation_target_get_type())
-
-GDK_DECLARE_INTERNAL_TYPE (AdwCallbackAnimationTarget, adw_callback_animation_target, ADW,
CALLBACK_ANIMATION_TARGET, AdwAnimationTarget)
-
-AdwAnimationTarget *adw_callback_animation_target_new (AdwAnimationTargetFunc callback,
- gpointer user_data,
- GDestroyNotify destroy);
-
G_END_DECLS
diff --git a/src/adw-animation-target.h b/src/adw-animation-target.h
new file mode 100644
index 00000000..c0fb6337
--- /dev/null
+++ b/src/adw-animation-target.h
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2021 Manuel Genovés <manuel genoves gmail com>
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#pragma once
+
+#if !defined(_ADWAITA_INSIDE) && !defined(ADWAITA_COMPILATION)
+#error "Only <adwaita.h> can be included directly."
+#endif
+
+#include "adw-version.h"
+
+#include <gtk/gtk.h>
+
+G_BEGIN_DECLS
+
+#define ADW_TYPE_ANIMATION_TARGET (adw_animation_target_get_type())
+
+ADW_AVAILABLE_IN_ALL
+GDK_DECLARE_INTERNAL_TYPE (AdwAnimationTarget, adw_animation_target, ADW, ANIMATION_TARGET, GObject)
+
+
+typedef void (*AdwAnimationTargetFunc) (gpointer user_data,
+ double value);
+
+#define ADW_TYPE_CALLBACK_ANIMATION_TARGET (adw_callback_animation_target_get_type())
+
+ADW_AVAILABLE_IN_ALL
+GDK_DECLARE_INTERNAL_TYPE (AdwCallbackAnimationTarget, adw_callback_animation_target, ADW,
CALLBACK_ANIMATION_TARGET, AdwAnimationTarget)
+
+ADW_AVAILABLE_IN_ALL
+AdwAnimationTarget *adw_callback_animation_target_new (AdwAnimationTargetFunc callback,
+ gpointer user_data,
+ GDestroyNotify destroy);
+
+G_END_DECLS
diff --git a/src/adw-animation.c b/src/adw-animation.c
index fbe3355e..56f81794 100644
--- a/src/adw-animation.c
+++ b/src/adw-animation.c
@@ -8,6 +8,7 @@
#include "config.h"
#include "adw-animation-private.h"
+#include "adw-animation-target-private.h"
#include "adw-animation-util-private.h"
typedef struct
diff --git a/src/adw-animation.h b/src/adw-animation.h
new file mode 100644
index 00000000..a9ed8d39
--- /dev/null
+++ b/src/adw-animation.h
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2019 Purism SPC
+ * Copyright (C) 2021 Manuel Genovés <manuel genoves gmail com>
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#pragma once
+
+#if !defined(_ADWAITA_INSIDE) && !defined(ADWAITA_COMPILATION)
+#error "Only <adwaita.h> can be included directly."
+#endif
+
+#include "adw-version.h"
+
+#include <gtk/gtk.h>
+
+#include "adw-animation-target.h"
+#include "adw-enums.h"
+
+G_BEGIN_DECLS
+
+#define ADW_DURATION_INFINITE G_MAXUINT
+
+#define ADW_TYPE_ANIMATION (adw_animation_get_type())
+
+ADW_AVAILABLE_IN_ALL
+G_DECLARE_DERIVABLE_TYPE (AdwAnimation, adw_animation, ADW, ANIMATION, GObject)
+
+typedef enum {
+ ADW_ANIMATION_IDLE,
+ ADW_ANIMATION_PAUSED,
+ ADW_ANIMATION_PLAYING,
+ ADW_ANIMATION_FINISHED,
+} AdwAnimationState;
+
+ADW_AVAILABLE_IN_ALL
+GtkWidget *adw_animation_get_widget (AdwAnimation *self);
+
+ADW_AVAILABLE_IN_ALL
+AdwAnimationTarget *adw_animation_get_target (AdwAnimation *self);
+
+ADW_AVAILABLE_IN_ALL
+double adw_animation_get_value (AdwAnimation *self);
+
+ADW_AVAILABLE_IN_ALL
+AdwAnimationState adw_animation_get_state (AdwAnimation *self);
+
+ADW_AVAILABLE_IN_ALL
+void adw_animation_play (AdwAnimation *self);
+ADW_AVAILABLE_IN_ALL
+void adw_animation_pause (AdwAnimation *self);
+ADW_AVAILABLE_IN_ALL
+void adw_animation_resume (AdwAnimation *self);
+ADW_AVAILABLE_IN_ALL
+void adw_animation_reset (AdwAnimation *self);
+ADW_AVAILABLE_IN_ALL
+void adw_animation_skip (AdwAnimation *self);
+
+G_END_DECLS
diff --git a/src/adw-carousel-indicator-dots.c b/src/adw-carousel-indicator-dots.c
index ac9f3000..c4a4982a 100644
--- a/src/adw-carousel-indicator-dots.c
+++ b/src/adw-carousel-indicator-dots.c
@@ -11,7 +11,7 @@
#include "adw-animation-util-private.h"
#include "adw-macros-private.h"
#include "adw-swipeable.h"
-#include "adw-timed-animation-private.h"
+#include "adw-timed-animation.h"
#include <math.h>
diff --git a/src/adw-carousel-indicator-lines.c b/src/adw-carousel-indicator-lines.c
index 030951e5..97c8df32 100644
--- a/src/adw-carousel-indicator-lines.c
+++ b/src/adw-carousel-indicator-lines.c
@@ -10,7 +10,7 @@
#include "adw-macros-private.h"
#include "adw-swipeable.h"
-#include "adw-timed-animation-private.h"
+#include "adw-timed-animation.h"
#include <math.h>
diff --git a/src/adw-carousel.c b/src/adw-carousel.c
index 1bcf4060..6acea27f 100644
--- a/src/adw-carousel.c
+++ b/src/adw-carousel.c
@@ -13,7 +13,7 @@
#include "adw-navigation-direction.h"
#include "adw-swipe-tracker.h"
#include "adw-swipeable.h"
-#include "adw-timed-animation-private.h"
+#include "adw-timed-animation.h"
#include "adw-widget-utils-private.h"
#include <math.h>
diff --git a/src/adw-flap.c b/src/adw-flap.c
index f361acf0..9e9b4993 100644
--- a/src/adw-flap.c
+++ b/src/adw-flap.c
@@ -16,7 +16,7 @@
#include "adw-shadow-helper-private.h"
#include "adw-swipeable.h"
#include "adw-swipe-tracker-private.h"
-#include "adw-timed-animation-private.h"
+#include "adw-timed-animation.h"
#include "adw-widget-utils-private.h"
/**
diff --git a/src/adw-tab-box.c b/src/adw-tab-box.c
index 8f975cff..5383d6aa 100644
--- a/src/adw-tab-box.c
+++ b/src/adw-tab-box.c
@@ -15,7 +15,7 @@
#include "adw-tab-private.h"
#include "adw-tab-bar-private.h"
#include "adw-tab-view-private.h"
-#include "adw-timed-animation-private.h"
+#include "adw-timed-animation.h"
#include <math.h>
/* Border collapsing without glitches */
diff --git a/src/adw-tab.c b/src/adw-tab.c
index b6883f58..a1c7076e 100644
--- a/src/adw-tab.c
+++ b/src/adw-tab.c
@@ -13,7 +13,7 @@
#include "adw-bidi-private.h"
#include "adw-fading-label-private.h"
#include "adw-macros-private.h"
-#include "adw-timed-animation-private.h"
+#include "adw-timed-animation.h"
#define FADE_WIDTH 18
#define CLOSE_BTN_ANIMATION_DURATION 150
diff --git a/src/adw-timed-animation.c b/src/adw-timed-animation.c
index 9af67cd2..eb18ca03 100644
--- a/src/adw-timed-animation.c
+++ b/src/adw-timed-animation.c
@@ -6,7 +6,7 @@
#include "config.h"
-#include "adw-timed-animation-private.h"
+#include "adw-timed-animation.h"
#include "adw-animation-private.h"
#include "adw-animation-util-private.h"
diff --git a/src/adw-timed-animation-private.h b/src/adw-timed-animation.h
similarity index 87%
rename from src/adw-timed-animation-private.h
rename to src/adw-timed-animation.h
index 998e0e0c..9f8b35dd 100644
--- a/src/adw-timed-animation-private.h
+++ b/src/adw-timed-animation.h
@@ -14,13 +14,14 @@
#include <gtk/gtk.h>
-#include "adw-animation-private.h"
+#include "adw-animation.h"
#include "adw-enums.h"
G_BEGIN_DECLS
#define ADW_TYPE_TIMED_ANIMATION (adw_timed_animation_get_type())
+ADW_AVAILABLE_IN_ALL
GDK_DECLARE_INTERNAL_TYPE (AdwTimedAnimation, adw_timed_animation, ADW, TIMED_ANIMATION, AdwAnimation)
typedef enum {
@@ -29,37 +30,52 @@ typedef enum {
ADW_EASING_EASE_IN_OUT_CUBIC,
} AdwEasing;
+ADW_AVAILABLE_IN_ALL
AdwAnimation *adw_timed_animation_new (GtkWidget *widget,
double from,
double to,
guint duration,
AdwAnimationTarget *target) G_GNUC_WARN_UNUSED_RESULT;
+ADW_AVAILABLE_IN_ALL
double adw_timed_animation_get_value_from (AdwTimedAnimation *self);
+ADW_AVAILABLE_IN_ALL
void adw_timed_animation_set_value_from (AdwTimedAnimation *self,
double value);
+ADW_AVAILABLE_IN_ALL
double adw_timed_animation_get_value_to (AdwTimedAnimation *self);
+ADW_AVAILABLE_IN_ALL
void adw_timed_animation_set_value_to (AdwTimedAnimation *self,
double value);
+ADW_AVAILABLE_IN_ALL
guint adw_timed_animation_get_duration (AdwTimedAnimation *self);
+ADW_AVAILABLE_IN_ALL
void adw_timed_animation_set_duration (AdwTimedAnimation *self,
guint duration);
+ADW_AVAILABLE_IN_ALL
AdwEasing adw_timed_animation_get_easing (AdwTimedAnimation *self);
+ADW_AVAILABLE_IN_ALL
void adw_timed_animation_set_easing (AdwTimedAnimation *self,
AdwEasing easing);
+ADW_AVAILABLE_IN_ALL
guint adw_timed_animation_get_repeat_count (AdwTimedAnimation *self);
+ADW_AVAILABLE_IN_ALL
void adw_timed_animation_set_repeat_count (AdwTimedAnimation *self,
guint repeat_count);
+ADW_AVAILABLE_IN_ALL
gboolean adw_timed_animation_get_reverse (AdwTimedAnimation *self);
+ADW_AVAILABLE_IN_ALL
void adw_timed_animation_set_reverse (AdwTimedAnimation *self,
gboolean reverse);
+ADW_AVAILABLE_IN_ALL
gboolean adw_timed_animation_get_alternate (AdwTimedAnimation *self);
+ADW_AVAILABLE_IN_ALL
void adw_timed_animation_set_alternate (AdwTimedAnimation *self,
gboolean alternate);
diff --git a/src/adw-toast-overlay.c b/src/adw-toast-overlay.c
index 8c3b2d14..081c98e2 100644
--- a/src/adw-toast-overlay.c
+++ b/src/adw-toast-overlay.c
@@ -10,7 +10,7 @@
#include "adw-animation-util-private.h"
#include "adw-macros-private.h"
-#include "adw-timed-animation-private.h"
+#include "adw-timed-animation.h"
#include "adw-toast-private.h"
#include "adw-toast-widget-private.h"
#include "adw-widget-utils-private.h"
diff --git a/src/adwaita.h b/src/adwaita.h
index c5aa0189..6b366528 100644
--- a/src/adwaita.h
+++ b/src/adwaita.h
@@ -22,6 +22,8 @@ G_BEGIN_DECLS
#include "adw-version.h"
#include "adw-action-row.h"
+#include "adw-animation.h"
+#include "adw-animation-target.h"
#include "adw-animation-util.h"
#include "adw-application.h"
#include "adw-application-window.h"
@@ -56,6 +58,7 @@ G_BEGIN_DECLS
#include "adw-swipeable.h"
#include "adw-tab-bar.h"
#include "adw-tab-view.h"
+#include "adw-timed-animation.h"
#include "adw-toast-overlay.h"
#include "adw-toast.h"
#include "adw-view-stack.h"
diff --git a/src/meson.build b/src/meson.build
index 2ae88545..88563433 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -10,6 +10,7 @@ libadwaita_resources = gnome.compile_resources(
)
adw_public_enum_headers = [
+ 'adw-animation.h',
'adw-flap.h',
'adw-fold-threshold-policy.h',
'adw-header-bar.h',
@@ -17,14 +18,13 @@ adw_public_enum_headers = [
'adw-navigation-direction.h',
'adw-style-manager.h',
'adw-squeezer.h',
+ 'adw-timed-animation.h',
'adw-toast.h',
'adw-view-switcher.h',
]
adw_private_enum_headers = [
- 'adw-animation-private.h',
'adw-settings-private.h',
- 'adw-timed-animation-private.h',
]
version_data = configuration_data()
@@ -81,6 +81,8 @@ libadwaita_generated_headers += [adw_public_enums[1]]
src_headers = [
'adw-action-row.h',
+ 'adw-animation.h',
+ 'adw-animation-target.h',
'adw-animation-util.h',
'adw-application.h',
'adw-application-window.h',
@@ -115,6 +117,7 @@ src_headers = [
'adw-swipeable.h',
'adw-tab-bar.h',
'adw-tab-view.h',
+ 'adw-timed-animation.h',
'adw-toast.h',
'adw-toast-overlay.h',
'adw-view-stack.h',
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]