4 * An OpenGL based 'interactive canvas' library.
6 * Authored By Matthew Allum <mallum@openedhand.com>
7 * Jorn Baayen <jorn@openedhand.com>
8 * Emmanuele Bassi <ebassi@openedhand.com>
9 * Tomas Frydrych <tf@openedhand.com>
10 * Øyvind Kolås <ok@openedhand.com>
12 * Copyright (C) 2008 OpenedHand
14 * This library is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU Lesser General Public
16 * License as published by the Free Software Foundation; either
17 * version 2 of the License, or (at your option) any later version.
19 * This library is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 * Lesser General Public License for more details.
24 * You should have received a copy of the GNU Lesser General Public
25 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
28 #if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
29 #error "Only <clutter/clutter.h> can be included directly."
32 #ifndef __CLUTTER_CHILD_META_H__
33 #define __CLUTTER_CHILD_META_H__
35 #include <glib-object.h>
36 #include <clutter/clutter-types.h>
40 #define CLUTTER_TYPE_CHILD_META (clutter_child_meta_get_type ())
41 #define CLUTTER_CHILD_META(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_CHILD_META, ClutterChildMeta))
42 #define CLUTTER_CHILD_META_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_CHILD_META, ClutterChildMetaClass))
43 #define CLUTTER_IS_CHILD_META(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_CHILD_META))
44 #define CLUTTER_IS_CHILD_META_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_CHILD_META))
45 #define CLUTTER_CHILD_META_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_CHILD_META, ClutterChildMetaClass))
47 typedef struct _ClutterChildMetaClass ClutterChildMetaClass;
51 * @container: the container handling this data
52 * @actor: the actor wrapped by this data
54 * Base interface for container specific state for child actors. A child
55 * data is meant to be used when you need to keep track of information
56 * about each individual child added to a container.
58 * In order to use it you should create your own subclass of
59 * #ClutterChildMeta and set the #ClutterContainerIface child_meta_type
60 * interface member to your subclass type, like:
64 * my_container_iface_init (ClutterContainerIface *iface)
66 * /* set the rest of the #ClutterContainer vtable */
68 * container_iface->child_meta_type = MY_TYPE_CHILD_META;
72 * This will automatically create a #ClutterChildMeta of type
73 * MY_TYPE_CHILD_META for every actor that is added to the container.
75 * The child data for an actor can be retrieved using the
76 * clutter_container_get_child_meta() function.
78 * The properties of the data and your subclass can be manipulated with
79 * clutter_container_child_set() and clutter_container_child_get() which
80 * act like g_object_set() and g_object_get().
82 * You can provide hooks for your own storage as well as control the
83 * instantiation by overriding the #ClutterContainerIface virtual functions
84 * <function>create_child_meta</function>,
85 * <function>destroy_child_meta</function>,
86 * and <function>get_child_meta</function>.
90 struct _ClutterChildMeta
93 GObject parent_instance;
96 ClutterContainer *container;
101 * ClutterChildMetaClass:
103 * The #ClutterChildMetaClass contains only private data
107 struct _ClutterChildMetaClass
110 GObjectClass parent_class;
113 GType clutter_child_meta_get_type (void) G_GNUC_CONST;
115 ClutterContainer *clutter_child_meta_get_container (ClutterChildMeta *data);
116 ClutterActor *clutter_child_meta_get_actor (ClutterChildMeta *data);
120 #endif /* __CLUTTER_CHILD_META_H__ */