4 * An OpenGL based 'interactive canvas' library.
6 * Copyright (C) 2009 Intel Corporation.
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
22 * Emmanuele Bassi <ebassi@linux.intel.com>
26 * SECTION:clutter-layout-meta
27 * @short_description: Wrapper for actors inside a layout manager
29 * #ClutterLayoutMeta is a wrapper object created by #ClutterLayoutManager
30 * implementations in order to store child-specific data and properties.
32 * A #ClutterLayoutMeta wraps a #ClutterActor inside a #ClutterContainer
33 * using a #ClutterLayoutManager.
35 * #ClutterLayoutMeta is available since Clutter 1.2
41 #include "clutter-layout-meta.h"
42 #include "clutter-debug.h"
43 #include "clutter-private.h"
45 G_DEFINE_ABSTRACT_TYPE (ClutterLayoutMeta,
47 CLUTTER_TYPE_CHILD_META);
58 static GParamSpec *obj_props[PROP_LAST];
61 clutter_layout_meta_set_property (GObject *object,
66 ClutterLayoutMeta *layout_meta = CLUTTER_LAYOUT_META (object);
71 layout_meta->manager = g_value_get_object (value);
75 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
81 clutter_layout_meta_get_property (GObject *object,
86 ClutterLayoutMeta *layout_meta = CLUTTER_LAYOUT_META (object);
91 g_value_set_object (value, layout_meta->manager);
95 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
101 clutter_layout_meta_class_init (ClutterLayoutMetaClass *klass)
103 GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
106 gobject_class->set_property = clutter_layout_meta_set_property;
107 gobject_class->get_property = clutter_layout_meta_get_property;
110 * ClutterLayoutMeta:manager:
112 * The #ClutterLayoutManager that created this #ClutterLayoutMeta.
116 pspec = g_param_spec_object ("manager",
118 P_("The manager that created this data"),
119 CLUTTER_TYPE_LAYOUT_MANAGER,
120 G_PARAM_CONSTRUCT_ONLY |
121 CLUTTER_PARAM_READWRITE);
122 obj_props[PROP_MANAGER] = pspec;
123 g_object_class_install_property (gobject_class, PROP_MANAGER, pspec);
127 clutter_layout_meta_init (ClutterLayoutMeta *self)
132 * clutter_layout_meta_get_manager:
133 * @data: a #ClutterLayoutMeta
135 * Retrieves the actor wrapped by @data
137 * Return value: (transfer none): a #ClutterLayoutManager
141 ClutterLayoutManager *
142 clutter_layout_meta_get_manager (ClutterLayoutMeta *data)
144 g_return_val_if_fail (CLUTTER_IS_LAYOUT_META (data), NULL);
146 return data->manager;