[libadwaita] reorder getters/setters
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libadwaita] reorder getters/setters
- Date: Mon, 26 Jul 2021 19:56:41 +0000 (UTC)
commit 8c31695d56a8ca72a1260becb3c8e5d59e743aae
Author: Manuel Genovés <manuel genoves gmail com>
Date: Mon Jul 26 21:25:13 2021 +0200
reorder getters/setters
src/adw-animation.c | 110 ++++++++++++++++++++++++++--------------------------
1 file changed, 55 insertions(+), 55 deletions(-)
---
diff --git a/src/adw-animation.c b/src/adw-animation.c
index 014a947f..521398bf 100644
--- a/src/adw-animation.c
+++ b/src/adw-animation.c
@@ -432,69 +432,69 @@ adw_animation_get_value_from (AdwAnimation *self)
return priv->value_from;
}
-double
-adw_animation_get_value_to (AdwAnimation *self)
+void
+adw_animation_set_value_from (AdwAnimation *self,
+ double value)
{
AdwAnimationPrivate *priv;
- g_return_val_if_fail (ADW_IS_ANIMATION (self), 0.0);
+ g_return_if_fail (ADW_IS_ANIMATION (self));
priv = adw_animation_get_instance_private (self);
- return priv->value_to;
-}
-
-gint64
-adw_animation_get_duration (AdwAnimation *self)
-{
- AdwAnimationPrivate *priv;
-
- g_return_val_if_fail (ADW_IS_ANIMATION (self), 0);
+ if (priv->value_from == value)
+ return;
- priv = adw_animation_get_instance_private (self);
+ priv->value_from = value;
- return priv->duration;
+ g_object_notify_by_pspec (G_OBJECT (self), props[PROP_VALUE_FROM]);
}
-AdwAnimationInterpolator
-adw_animation_get_interpolator (AdwAnimation *self)
+double
+adw_animation_get_value_to (AdwAnimation *self)
{
AdwAnimationPrivate *priv;
- g_return_val_if_fail (ADW_IS_ANIMATION (self), ADW_ANIMATION_INTERPOLATOR_EASE_OUT);
+ g_return_val_if_fail (ADW_IS_ANIMATION (self), 0.0);
priv = adw_animation_get_instance_private (self);
- return priv->interpolator;
+ return priv->value_to;
}
-AdwAnimationTarget *
-adw_animation_get_target (AdwAnimation *self)
+void
+adw_animation_set_value_to (AdwAnimation *self,
+ double value)
{
AdwAnimationPrivate *priv;
- g_return_val_if_fail (ADW_IS_ANIMATION (self), NULL);
+ g_return_if_fail (ADW_IS_ANIMATION (self));
priv = adw_animation_get_instance_private (self);
- return priv->target;
+ if (priv->value_to == value)
+ return;
+
+ priv->value_to = value;
+
+ g_object_notify_by_pspec (G_OBJECT (self), props[PROP_VALUE_TO]);
}
-AdwAnimationStatus
-adw_animation_get_status (AdwAnimation *self)
+gint64
+adw_animation_get_duration (AdwAnimation *self)
{
AdwAnimationPrivate *priv;
- g_return_val_if_fail (ADW_IS_ANIMATION (self), ADW_ANIMATION_STATUS_NONE);
+ g_return_val_if_fail (ADW_IS_ANIMATION (self), 0);
priv = adw_animation_get_instance_private (self);
- return priv->status;
+ return priv->duration;
}
void
-adw_animation_set_value_from (AdwAnimation *self,
- double value)
+adw_animation_set_duration (AdwAnimation *self,
+ gint64 duration)
{
AdwAnimationPrivate *priv;
@@ -502,67 +502,67 @@ adw_animation_set_value_from (AdwAnimation *self,
priv = adw_animation_get_instance_private (self);
- if (priv->value_from == value)
+ if (priv->duration == duration)
return;
- priv->value_from = value;
+ priv->duration = duration;
- g_object_notify_by_pspec (G_OBJECT (self), props[PROP_VALUE_FROM]);
+ g_object_notify_by_pspec (G_OBJECT (self), props[PROP_DURATION]);
}
-void
-adw_animation_set_value_to (AdwAnimation *self,
- double value)
+AdwAnimationInterpolator
+adw_animation_get_interpolator (AdwAnimation *self)
{
AdwAnimationPrivate *priv;
- g_return_if_fail (ADW_IS_ANIMATION (self));
+ g_return_val_if_fail (ADW_IS_ANIMATION (self), ADW_ANIMATION_INTERPOLATOR_EASE_OUT);
priv = adw_animation_get_instance_private (self);
- if (priv->value_to == value)
- return;
-
- priv->value_to = value;
-
- g_object_notify_by_pspec (G_OBJECT (self), props[PROP_VALUE_TO]);
+ return priv->interpolator;
}
void
-adw_animation_set_duration (AdwAnimation *self,
- gint64 duration)
+adw_animation_set_interpolator (AdwAnimation *self,
+ AdwAnimationInterpolator interpolator)
{
AdwAnimationPrivate *priv;
g_return_if_fail (ADW_IS_ANIMATION (self));
+ g_return_if_fail (interpolator <= ADW_ANIMATION_INTERPOLATOR_EASE_IN_OUT);
priv = adw_animation_get_instance_private (self);
- if (priv->duration == duration)
+ if (priv->interpolator == interpolator)
return;
- priv->duration = duration;
+ priv->interpolator = interpolator;
- g_object_notify_by_pspec (G_OBJECT (self), props[PROP_DURATION]);
+ g_object_notify_by_pspec (G_OBJECT (self), props[PROP_INTERPOLATOR]);
}
-void
-adw_animation_set_interpolator (AdwAnimation *self,
- AdwAnimationInterpolator interpolator)
+AdwAnimationTarget *
+adw_animation_get_target (AdwAnimation *self)
{
AdwAnimationPrivate *priv;
- g_return_if_fail (ADW_IS_ANIMATION (self));
- g_return_if_fail (interpolator <= ADW_ANIMATION_INTERPOLATOR_EASE_IN_OUT);
+ g_return_val_if_fail (ADW_IS_ANIMATION (self), NULL);
priv = adw_animation_get_instance_private (self);
- if (priv->interpolator == interpolator)
- return;
+ return priv->target;
+}
- priv->interpolator = interpolator;
+AdwAnimationStatus
+adw_animation_get_status (AdwAnimation *self)
+{
+ AdwAnimationPrivate *priv;
- g_object_notify_by_pspec (G_OBJECT (self), props[PROP_INTERPOLATOR]);
+ g_return_val_if_fail (ADW_IS_ANIMATION (self), ADW_ANIMATION_STATUS_NONE);
+
+ priv = adw_animation_get_instance_private (self);
+
+ return priv->status;
}
void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]