[libadwaita] animation-target: Add docs
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libadwaita] animation-target: Add docs
- Date: Mon, 22 Nov 2021 13:33:36 +0000 (UTC)
commit 5be1b1b9ae745ee21f355952aaa3ac6e4cdb2f21
Author: Alexander Mikhaylenko <alexm gnome org>
Date: Mon Nov 22 18:07:43 2021 +0500
animation-target: Add docs
src/adw-animation-target.c | 33 +++++++++++++++++++++++++++++++++
src/adw-animation-target.h | 9 +++++++++
2 files changed, 42 insertions(+)
---
diff --git a/src/adw-animation-target.c b/src/adw-animation-target.c
index 87488962..f8095cd6 100644
--- a/src/adw-animation-target.c
+++ b/src/adw-animation-target.c
@@ -8,6 +8,25 @@
#include "adw-animation-target-private.h"
+/**
+ * AdwAnimationTarget:
+ *
+ * Represents a value [class@Adw.Animation] can animate.
+ *
+ * Currently the only implementation is [class@Adw.CallbackAnimationTarget].
+ *
+ * Since: 1.0
+ */
+
+/**
+ * AdwCallbackAnimationTarget:
+ *
+ * An [class@Adw.AnimationTarget] that calls a given callback during the
+ * animation.
+ *
+ * Since: 1.0
+ */
+
struct _AdwAnimationTarget
{
GObject parent_instance;
@@ -94,6 +113,20 @@ adw_callback_animation_target_init (AdwCallbackAnimationTarget *self)
{
}
+/**
+ * adw_callback_animation_target_new:
+ * @callback: (scope notified): the callback to call
+ * @user_data: (closure callback): the data to be passed to @callback
+ * @destroy: (destroy user_data): the function to be called when the
+ * callback action is finalized
+ *
+ * Creates a new `AdwAnimationTarget` that calls the given @callback during
+ * the animation.
+ *
+ * Returns: the newly created callback target
+ *
+ * Since: 1.0
+ */
AdwAnimationTarget *
adw_callback_animation_target_new (AdwAnimationTargetFunc callback,
gpointer user_data,
diff --git a/src/adw-animation-target.h b/src/adw-animation-target.h
index c0fb6337..6a579530 100644
--- a/src/adw-animation-target.h
+++ b/src/adw-animation-target.h
@@ -22,6 +22,15 @@ ADW_AVAILABLE_IN_ALL
GDK_DECLARE_INTERNAL_TYPE (AdwAnimationTarget, adw_animation_target, ADW, ANIMATION_TARGET, GObject)
+/**
+ * AdwAnimationTargetFunc:
+ * @user_data: (nullable): The user data provided when creating the target
+ * @value: The animation value
+ *
+ * Prototype for animation targets based on user callbacks.
+ *
+ * Since: 1.0
+ */
typedef void (*AdwAnimationTargetFunc) (gpointer user_data,
double value);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]