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>
10 * Copyright (C) 2006 OpenedHand
12 * This library is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU Lesser General Public
14 * License as published by the Free Software Foundation; either
15 * version 2 of the License, or (at your option) any later version.
17 * This library is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * Lesser General Public License for more details.
22 * You should have received a copy of the GNU Lesser General Public
23 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
26 #if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
27 #error "Only <clutter/clutter.h> can be included directly."
30 #ifndef __CLUTTER_BEHAVIOUR_H__
31 #define __CLUTTER_BEHAVIOUR_H__
33 #include <clutter/clutter-types.h>
37 #define CLUTTER_TYPE_BEHAVIOUR clutter_behaviour_get_type()
39 #define CLUTTER_BEHAVIOUR(obj) \
40 (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
41 CLUTTER_TYPE_BEHAVIOUR, ClutterBehaviour))
43 #define CLUTTER_BEHAVIOUR_CLASS(klass) \
44 (G_TYPE_CHECK_CLASS_CAST ((klass), \
45 CLUTTER_TYPE_BEHAVIOUR, ClutterBehaviourClass))
47 #define CLUTTER_IS_BEHAVIOUR(obj) \
48 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
49 CLUTTER_TYPE_BEHAVIOUR))
51 #define CLUTTER_IS_BEHAVIOUR_CLASS(klass) \
52 (G_TYPE_CHECK_CLASS_TYPE ((klass), \
53 CLUTTER_TYPE_BEHAVIOUR))
55 #define CLUTTER_BEHAVIOUR_GET_CLASS(obj) \
56 (G_TYPE_INSTANCE_GET_CLASS ((obj), \
57 CLUTTER_TYPE_BEHAVIOUR, ClutterBehaviourClass))
59 typedef struct _ClutterBehaviourPrivate ClutterBehaviourPrivate;
60 typedef struct _ClutterBehaviourClass ClutterBehaviourClass;
63 * ClutterBehaviourForeachFunc:
64 * @behaviour: the #ClutterBehaviour
65 * @actor: an actor driven by @behaviour
66 * @data: (closure): optional data passed to the function
68 * This function is passed to clutter_behaviour_actors_foreach() and
69 * will be called for each actor driven by @behaviour.
75 typedef void (*ClutterBehaviourForeachFunc) (ClutterBehaviour *behaviour,
82 * #ClutterBehaviour-struct contains only private data and should
83 * be accessed with the functions below.
89 struct _ClutterBehaviour
93 ClutterBehaviourPrivate *priv;
97 * ClutterBehaviourClass:
98 * @alpha_notify: virtual function, called each time the #ClutterAlpha
99 * computes a new alpha value; the actors to which the behaviour applies
100 * should be changed in this function. Every subclass of #ClutterBehaviour
101 * must implement this virtual function
102 * @applied: signal class handler for the ClutterBehaviour::applied signal
103 * @removed: signal class handler for the ClutterBehaviour::removed signal
105 * Base class for behaviours.
111 struct _ClutterBehaviourClass
114 GObjectClass parent_class;
117 /* vfunc, not signal */
118 void (*alpha_notify) (ClutterBehaviour *behave,
119 gdouble alpha_value);
122 void (*applied) (ClutterBehaviour *behave,
123 ClutterActor *actor);
124 void (*removed) (ClutterBehaviour *behave,
125 ClutterActor *actor);
128 /* padding, for future expansion */
129 void (*_clutter_behaviour1) (void);
130 void (*_clutter_behaviour2) (void);
131 void (*_clutter_behaviour3) (void);
132 void (*_clutter_behaviour4) (void);
133 void (*_clutter_behaviour5) (void);
134 void (*_clutter_behaviour6) (void);
137 GType clutter_behaviour_get_type (void) G_GNUC_CONST;
139 CLUTTER_DEPRECATED_IN_1_6
140 void clutter_behaviour_apply (ClutterBehaviour *behave,
141 ClutterActor *actor);
142 CLUTTER_DEPRECATED_IN_1_6
143 void clutter_behaviour_remove (ClutterBehaviour *behave,
144 ClutterActor *actor);
145 CLUTTER_DEPRECATED_IN_1_6
146 void clutter_behaviour_remove_all (ClutterBehaviour *behave);
147 CLUTTER_DEPRECATED_IN_1_6
148 void clutter_behaviour_actors_foreach (ClutterBehaviour *behave,
149 ClutterBehaviourForeachFunc func,
151 CLUTTER_DEPRECATED_IN_1_6
152 gint clutter_behaviour_get_n_actors (ClutterBehaviour *behave);
153 CLUTTER_DEPRECATED_IN_1_6
154 ClutterActor *clutter_behaviour_get_nth_actor (ClutterBehaviour *behave,
156 CLUTTER_DEPRECATED_IN_1_6
157 GSList * clutter_behaviour_get_actors (ClutterBehaviour *behave);
158 CLUTTER_DEPRECATED_IN_1_6
159 ClutterAlpha *clutter_behaviour_get_alpha (ClutterBehaviour *behave);
160 CLUTTER_DEPRECATED_IN_1_6
161 void clutter_behaviour_set_alpha (ClutterBehaviour *behave,
162 ClutterAlpha *alpha);
163 CLUTTER_DEPRECATED_IN_1_6
164 gboolean clutter_behaviour_is_applied (ClutterBehaviour *behave,
165 ClutterActor *actor);
169 #endif /* __CLUTTER_BEHAVIOUR_H__ */