From 962bcb12224685b3a93fe5b449331d5d477eaf87 Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Thu, 7 Jun 2012 16:31:22 +0200 Subject: [PATCH] Add _clutter_actor_peek_layout_info This will be needed later to get a layout_info without creating one if there is none already. --- clutter/clutter-actor-private.h | 1 + clutter/clutter-actor.c | 20 ++++++++++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/clutter/clutter-actor-private.h b/clutter/clutter-actor-private.h index 55e4f46f2..07e2960fd 100644 --- a/clutter/clutter-actor-private.h +++ b/clutter/clutter-actor-private.h @@ -177,6 +177,7 @@ struct _ClutterLayoutInfo const ClutterLayoutInfo * _clutter_actor_get_layout_info_or_defaults (ClutterActor *self); ClutterLayoutInfo * _clutter_actor_get_layout_info (ClutterActor *self); +ClutterLayoutInfo * _clutter_actor_peek_layout_info (ClutterActor *self); struct _ClutterTransformInfo { diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c index fda5aca6a..96d3de294 100644 --- a/clutter/clutter-actor.c +++ b/clutter/clutter-actor.c @@ -16371,6 +16371,22 @@ layout_info_free (gpointer data) g_slice_free (ClutterLayoutInfo, data); } +/*< private > + * _clutter_actor_peek_layout_info: + * @self: a #ClutterActor + * + * Retrieves a pointer to the ClutterLayoutInfo structure. + * + * If the actor does not have a ClutterLayoutInfo associated to it, %NULL is returned. + * + * Return value: (transfer none): a pointer to the ClutterLayoutInfo structure + */ +ClutterLayoutInfo * +_clutter_actor_peek_layout_info (ClutterActor *self) +{ + return g_object_get_qdata (G_OBJECT (self), quark_actor_layout_info); +} + /*< private > * _clutter_actor_get_layout_info: * @self: a #ClutterActor @@ -16392,7 +16408,7 @@ _clutter_actor_get_layout_info (ClutterActor *self) { ClutterLayoutInfo *retval; - retval = g_object_get_qdata (G_OBJECT (self), quark_actor_layout_info); + retval = _clutter_actor_peek_layout_info (self); if (retval == NULL) { retval = g_slice_new (ClutterLayoutInfo); @@ -16425,7 +16441,7 @@ _clutter_actor_get_layout_info_or_defaults (ClutterActor *self) { const ClutterLayoutInfo *info; - info = g_object_get_qdata (G_OBJECT (self), quark_actor_layout_info); + info = _clutter_actor_peek_layout_info (self); if (info == NULL) return &default_layout_info;