2008-01-04 Emmanuele Bassi <ebassi@openedhand.com>

* clutter.symbols: Add clutter_actor_move_byu()
	
	* clutter/clutter-actor.h:
	* clutter/clutter-actor.c:
	(clutter_actor_move_by),
	(clutter_actor_move_byu): Add a units-based variant of the
	clutter_actor_move_by() function
This commit is contained in:
Emmanuele Bassi 2008-01-04 18:30:25 +00:00
parent fae1c9fe95
commit 28ef76edfa
6 changed files with 46 additions and 7 deletions

View File

@ -1,3 +1,13 @@
2008-01-04 Emmanuele Bassi <ebassi@openedhand.com>
* clutter.symbols: Add clutter_actor_move_byu()
* clutter/clutter-actor.h:
* clutter/clutter-actor.c:
(clutter_actor_move_by),
(clutter_actor_move_byu): Add a units-based variant of the
clutter_actor_move_by() function
2008-01-02 Johan Bilien <jobi@via.ecp.fr> 2008-01-02 Johan Bilien <jobi@via.ecp.fr>
reviewed by: Emmanuele Bassi <ebassi@openedhand.com> reviewed by: Emmanuele Bassi <ebassi@openedhand.com>

View File

@ -37,6 +37,7 @@ clutter_actor_hide_all
clutter_actor_lower clutter_actor_lower
clutter_actor_lower_bottom clutter_actor_lower_bottom
clutter_actor_move_by clutter_actor_move_by
clutter_actor_move_byu
clutter_actor_paint clutter_actor_paint
clutter_actor_pick clutter_actor_pick
clutter_actor_query_coords clutter_actor_query_coords

View File

@ -2220,7 +2220,7 @@ clutter_actor_set_positionu (ClutterActor *self,
} }
/** /**
* clutter_actor_move_by * clutter_actor_move_by:
* @self: A #ClutterActor * @self: A #ClutterActor
* @dx: Distance to move Actor on X axis. * @dx: Distance to move Actor on X axis.
* @dy: Distance to move Actor on Y axis. * @dy: Distance to move Actor on Y axis.
@ -2234,19 +2234,39 @@ void
clutter_actor_move_by (ClutterActor *self, clutter_actor_move_by (ClutterActor *self,
gint dx, gint dx,
gint dy) gint dy)
{
g_return_if_fail (CLUTTER_IS_ACTOR (self));
clutter_actor_move_byu (self,
CLUTTER_UNITS_FROM_DEVICE (dx),
CLUTTER_UNITS_FROM_DEVICE (dy));
}
/**
* clutter_actor_move_byu:
* @self: A #ClutterActor
* @dx: Distance to move Actor on X axis, in #ClutterUnit<!-- -->s.
* @dy: Distance to move Actor on Y axis, in #ClutterUnit<!-- -->s.
*
* Moves an actor by specified distance relative to the current position.
*
* Since: 0.6
*/
void
clutter_actor_move_byu (ClutterActor *self,
ClutterUnit dx,
ClutterUnit dy)
{ {
ClutterActorBox box; ClutterActorBox box;
gint32 dxu = CLUTTER_UNITS_FROM_INT (dx);
gint32 dyu = CLUTTER_UNITS_FROM_INT (dy);
g_return_if_fail (CLUTTER_IS_ACTOR (self)); g_return_if_fail (CLUTTER_IS_ACTOR (self));
clutter_actor_query_coords (self, &box); clutter_actor_query_coords (self, &box);
box.x2 += dxu; box.x2 += dx;
box.y2 += dyu; box.y2 += dy;
box.x1 += dxu; box.x1 += dx;
box.y1 += dyu; box.y1 += dy;
clutter_actor_request_coords (self, &box); clutter_actor_request_coords (self, &box);
} }

View File

@ -388,6 +388,9 @@ void clutter_actor_get_scale (ClutterActor *sel
void clutter_actor_move_by (ClutterActor *self, void clutter_actor_move_by (ClutterActor *self,
gint dx, gint dx,
gint dy); gint dy);
void clutter_actor_move_byu (ClutterActor *self,
ClutterUnit dx,
ClutterUnit dy);
void clutter_actor_get_vertices (ClutterActor *self, void clutter_actor_get_vertices (ClutterActor *self,
ClutterVertex verts[4]); ClutterVertex verts[4]);

View File

@ -1,3 +1,7 @@
2008-01-04 Emmanuele Bassi <ebassi@openedhand.com>
* clutter-sections.txt: Add clutter_actor_move_byu()
2007-12-24 Emmanuele Bassi <ebassi@openedhand.com> 2007-12-24 Emmanuele Bassi <ebassi@openedhand.com>
* clutter-sections.txt: Add the units-based clip accessors * clutter-sections.txt: Add the units-based clip accessors

View File

@ -386,6 +386,7 @@ clutter_actor_set_anchor_pointu
clutter_actor_get_anchor_pointu clutter_actor_get_anchor_pointu
clutter_actor_set_clipu clutter_actor_set_clipu
clutter_actor_get_clipu clutter_actor_get_clipu
clutter_actor_move_byu
<SUBSECTION> <SUBSECTION>
clutter_actor_set_scalex clutter_actor_set_scalex