From: Emmanuele Bassi Date: Sat, 17 Mar 2012 16:29:09 +0000 (+0000) Subject: Add initializer utilities for ClutterVertex X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=82bc7285847ef50aae3d4e48907309ec509105ad;p=profile%2Fivi%2Fclutter.git Add initializer utilities for ClutterVertex Similar to what we did for ClutterActorBox. --- diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c index 78f3006..5556be7 100644 --- a/clutter/clutter-actor.c +++ b/clutter/clutter-actor.c @@ -13297,11 +13297,33 @@ clutter_vertex_new (gfloat x, ClutterVertex *vertex; vertex = g_slice_new (ClutterVertex); + clutter_vertex_init (vertex, x, y, z); + + return vertex; +} + +/** + * clutter_vertex_init: + * @vertex: a #ClutterVertex + * @x: X coordinate + * @y: Y coordinate + * @z: Z coordinate + * + * Initializes @vertex with the given coordinates. + * + * Since: 1.10 + */ +void +clutter_vertex_init (ClutterVertex *vertex, + gfloat x, + gfloat y, + gfloat z) +{ + g_return_if_fail (vertex != NULL); + vertex->x = x; vertex->y = y; vertex->z = z; - - return vertex; } /** diff --git a/clutter/clutter-types.h b/clutter/clutter-types.h index f9cda74..a3092ce 100644 --- a/clutter/clutter-types.h +++ b/clutter/clutter-types.h @@ -122,10 +122,30 @@ struct _ClutterVertex gfloat z; }; +/** + * CLUTTER_VERTEX_INIT: + * @x: the X coordinate of the vertex + * @y: the Y coordinate of the vertex + * @z: the Z coordinate of the vertex + * + * A simple macro for initializing a #ClutterVertex when declaring it, e.g.: + * + * |[ + * ClutterVertext v = CLUTTER_VERTEX_INIT (x, y, z); + * ]| + * + * Since: 1.10 + */ +#define CLUTTER_VERTEX_INIT(x,y,z) { (x), (y), (z) } + GType clutter_vertex_get_type (void) G_GNUC_CONST; ClutterVertex *clutter_vertex_new (gfloat x, gfloat y, gfloat z); +void clutter_vertex_init (ClutterVertex *vertex, + gfloat x, + gfloat y, + gfloat z); ClutterVertex *clutter_vertex_copy (const ClutterVertex *vertex); void clutter_vertex_free (ClutterVertex *vertex); gboolean clutter_vertex_equal (const ClutterVertex *vertex_a, diff --git a/clutter/clutter.symbols b/clutter/clutter.symbols index 3b4f8b1..339d8a0 100644 --- a/clutter/clutter.symbols +++ b/clutter/clutter.symbols @@ -1413,6 +1413,7 @@ clutter_vertex_copy clutter_vertex_equal clutter_vertex_free clutter_vertex_get_type +clutter_vertex_init clutter_vertex_new #ifdef CLUTTER_WINDOWING_WAYLAND clutter_wayland_get_egl_display diff --git a/doc/reference/clutter/clutter-sections.txt b/doc/reference/clutter/clutter-sections.txt index 09ca289..87f166e 100644 --- a/doc/reference/clutter/clutter-sections.txt +++ b/doc/reference/clutter/clutter-sections.txt @@ -546,7 +546,9 @@ clutter_actor_box_union ClutterVertex +CLUTTER_VERTEX_INIT clutter_vertex_new +clutter_vertex_init clutter_vertex_copy clutter_vertex_free clutter_vertex_equal