diff options
author | Xabier Rodriguez Calvar <xrcalvar@igalia.com> | 2010-01-27 13:37:44 +0100 |
---|---|---|
committer | Xabier Rodriguez Calvar <xrcalvar@igalia.com> | 2010-01-27 16:47:00 +0100 |
commit | 4db0c3ed11f441f10e7eff8b7cdf74530d220fa7 (patch) | |
tree | a8c083921c526b274477f3175950dc9fb4f3a1cb | |
parent | 35831bc95e7f58501f37a62682cd6ce2996904e1 (diff) |
Replace "axis" and "gravity" defines with enums.
Based on a patch of David King <davidk@openismus.com>.
Replace "axis" and "gravity" defines with HildonAnimationActorAxis and
HildonAnimationActorGravity enums. Adjust function arguments
appropriately.
Fixes: MB#4695 (HildonAnimationActor defines are passively documented
in function descriptions)
-rw-r--r-- | doc/hildon-sections.txt | 14 | ||||
-rw-r--r-- | hildon/hildon-animation-actor.c | 20 | ||||
-rw-r--r-- | hildon/hildon-animation-actor.h | 65 |
3 files changed, 54 insertions, 45 deletions
diff --git a/doc/hildon-sections.txt b/doc/hildon-sections.txt index 7ba4b1d..8ba907e 100644 --- a/doc/hildon-sections.txt +++ b/doc/hildon-sections.txt @@ -2,6 +2,8 @@ <FILE>hildon-animation-actor</FILE> <TITLE>HildonAnimationActor</TITLE> HildonAnimationActor +HildonAnimationActorAxis +HildonAnimationActorGravity hildon_animation_actor_new hildon_animation_actor_send_message hildon_animation_actor_set_anchor @@ -17,18 +19,6 @@ hildon_animation_actor_set_scale hildon_animation_actor_set_scalex hildon_animation_actor_set_show hildon_animation_actor_set_show_full -HILDON_AA_CENTER_GRAVITY -HILDON_AA_E_GRAVITY -HILDON_AA_NE_GRAVITY -HILDON_AA_NW_GRAVITY -HILDON_AA_N_GRAVITY -HILDON_AA_SE_GRAVITY -HILDON_AA_SW_GRAVITY -HILDON_AA_S_GRAVITY -HILDON_AA_W_GRAVITY -HILDON_AA_X_AXIS -HILDON_AA_Y_AXIS -HILDON_AA_Z_AXIS <SUBSECTION Standard> HILDON_ANIMATION_ACTOR HILDON_ANIMATION_ACTOR_CLASS diff --git a/hildon/hildon-animation-actor.c b/hildon/hildon-animation-actor.c index 421bf9a..cf691e7 100644 --- a/hildon/hildon-animation-actor.c +++ b/hildon/hildon-animation-actor.c @@ -884,8 +884,8 @@ hildon_animation_actor_set_scale (HildonAnimationActor *self, * Since: 2.2 **/ void -hildon_animation_actor_set_rotationx (HildonAnimationActor *self, - gint axis, +hildon_animation_actor_set_rotationx (HildonAnimationActor *self, + HildonAnimationActorAxis axis, gint32 degrees, gint x, gint y, @@ -956,7 +956,7 @@ hildon_animation_actor_set_rotationx (HildonAnimationActor *self, **/ void hildon_animation_actor_set_rotation (HildonAnimationActor *self, - gint axis, + HildonAnimationActorAxis axis, double degrees, gint x, gint y, @@ -1015,17 +1015,7 @@ hildon_animation_actor_set_anchor (HildonAnimationActor *self, * the animation actor. The anchor point is the relative position of * the actor within its parent window. Instead of being defined in (x, * y)-coordinates, the anchor point is defined in the relative - * "gravity" constant as: - * - * * %HILDON_AA_N_GRAVITY translates to (width / 2, 0) coordinate - * * %HILDON_AA_NE_GRAVITY translates to (width, 0) coordinate - * * %HILDON_AA_E_GRAVITY translates to (width, height / 2) coordinate - * * %HILDON_AA_SE_GRAVITY translates to (width, height) coordinate - * * %HILDON_AA_S_GRAVITY translates to (width / 2, height) coordinate - * * %HILDON_AA_SW_GRAVITY translates to (0, height) coordinate - * * %HILDON_AA_W_GRAVITY translates to (0, height / 2) coordinate - * * %HILDON_AA_NW_GRAVITY translates to (0, 0) coordinate - * * %HILDON_AA_CENTER_GRAVITY translates to (width / 2, height / 2) coordinate + * %gravity constant. * * If the animation actor WM-counterpart is not ready, the show message * will be queued until the WM is ready for it. @@ -1034,7 +1024,7 @@ hildon_animation_actor_set_anchor (HildonAnimationActor *self, **/ void hildon_animation_actor_set_anchor_from_gravity (HildonAnimationActor *self, - guint gravity) + HildonAnimationActorGravity gravity) { HildonAnimationActorPrivate *priv = HILDON_ANIMATION_ACTOR_GET_PRIVATE (self); diff --git a/hildon/hildon-animation-actor.h b/hildon/hildon-animation-actor.h index 884de15..449b88e 100644 --- a/hildon/hildon-animation-actor.h +++ b/hildon/hildon-animation-actor.h @@ -74,19 +74,47 @@ struct _HildonAnimationActor GtkWindow parent; }; -#define HILDON_AA_X_AXIS 0 -#define HILDON_AA_Y_AXIS 1 -#define HILDON_AA_Z_AXIS 2 - -#define HILDON_AA_N_GRAVITY 1 -#define HILDON_AA_NE_GRAVITY 2 -#define HILDON_AA_E_GRAVITY 3 -#define HILDON_AA_SE_GRAVITY 4 -#define HILDON_AA_S_GRAVITY 5 -#define HILDON_AA_SW_GRAVITY 6 -#define HILDON_AA_W_GRAVITY 7 -#define HILDON_AA_NW_GRAVITY 8 -#define HILDON_AA_CENTER_GRAVITY 9 +/** + * HildonAnimationActorAxis: + * @HILDON_AA_X_AXIS: Rotate around the X axis. + * @HILDON_AA_Y_AXIS: Rotate around the Y axis. + * @HILDON_AA_Z_AXIS: Rotate around the Z axis. + * + * Used to specify the axis to rotate the animation actor around. + */ +typedef enum +{ + HILDON_AA_X_AXIS, + HILDON_AA_Y_AXIS, + HILDON_AA_Z_AXIS +} HildonAnimationActorAxis; + +/** + * HildonAnimationActorGravity: + * @HILDON_AA_N_GRAVITY: translates to (width / 2, 0) coordinate. + * @HILDON_AA_NE_GRAVITY: translates to (width, 0) coordinate. + * @HILDON_AA_E_GRAVITY: translates to (width, height / 2) coordinate. + * @HILDON_AA_SE_GRAVITY: translates to (width, height) coordinate. + * @HILDON_AA_S_GRAVITY: translates to (width / 2, height) coordinate. + * @HILDON_AA_SW_GRAVITY: translates to (0, height) coordinate. + * @HILDON_AA_W_GRAVITY: translates to (0, height / 2) coordinate. + * @HILDON_AA_NW_GRAVITY: translates to (0, 0) coordinate. + * @HILDON_AA_CENTER_GRAVITY: translates to (width / 2, height / 2) coordinate. + * + * Used to specify the position of the animation actor within its parent window. + */ +typedef enum +{ + HILDON_AA_N_GRAVITY = 1, + HILDON_AA_NE_GRAVITY, + HILDON_AA_E_GRAVITY, + HILDON_AA_SE_GRAVITY, + HILDON_AA_S_GRAVITY, + HILDON_AA_SW_GRAVITY, + HILDON_AA_W_GRAVITY, + HILDON_AA_NW_GRAVITY, + HILDON_AA_CENTER_GRAVITY +} HildonAnimationActorGravity; GType hildon_animation_actor_get_type (void) G_GNUC_CONST; @@ -133,15 +161,15 @@ hildon_animation_actor_set_scale (HildonAnimationActor *self, double x_scale, double y_scale); void -hildon_animation_actor_set_rotationx (HildonAnimationActor *self, - gint axis, +hildon_animation_actor_set_rotationx (HildonAnimationActor *self, + HildonAnimationActorAxis axis, gint32 degrees, gint x, gint y, gint z); void -hildon_animation_actor_set_rotation (HildonAnimationActor *self, - gint axis, +hildon_animation_actor_set_rotation (HildonAnimationActor *self, + HildonAnimationActorAxis axis, double degrees, gint x, gint y, @@ -152,7 +180,8 @@ hildon_animation_actor_set_anchor (HildonAnimationActor *self, gint y); void hildon_animation_actor_set_anchor_from_gravity (HildonAnimationActor *self, - guint gravity); + HildonAnimationActorGravity gravity); + void hildon_animation_actor_set_parent (HildonAnimationActor *self, GtkWindow *parent); |