4 * An OpenGL based 'interactive canvas' library.
6 * Copyright (C) 2010 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 #ifndef __CLUTTER_ACTOR_PRIVATE_H__
23 #define __CLUTTER_ACTOR_PRIVATE_H__
25 #include <clutter/clutter-actor.h>
31 * @CLUTTER_REDRAW_CLIPPED_TO_ALLOCATION: Tells clutter the maximum
32 * extents of what needs to be redrawn lies within the actors
33 * current allocation. (Only use this for 2D actors though because
34 * any actor with depth may be projected outside of its allocation)
36 * Flags passed to the clutter_actor_queue_redraw_with_clip ()
43 CLUTTER_REDRAW_CLIPPED_TO_ALLOCATION = 1 << 0
47 * ClutterActorTraverseFlags:
48 * CLUTTER_ACTOR_TRAVERSE_DEPTH_FIRST: Traverse the graph in
49 * a depth first order.
50 * CLUTTER_ACTOR_TRAVERSE_BREADTH_FIRST: Traverse the graph in a
51 * breadth first order.
53 * Controls some options for how clutter_actor_traverse() iterates
57 CLUTTER_ACTOR_TRAVERSE_DEPTH_FIRST = 1L<<0,
58 CLUTTER_ACTOR_TRAVERSE_BREADTH_FIRST = 1L<<1
59 } ClutterActorTraverseFlags;
62 * ClutterActorTraverseVisitFlags:
63 * CLUTTER_ACTOR_TRAVERSE_VISIT_CONTINUE: Continue traversing as
65 * CLUTTER_ACTOR_TRAVERSE_VISIT_SKIP_CHILDREN: Don't traverse the
66 * children of the last visited actor. (Not applicable when using
67 * %CLUTTER_ACTOR_TRAVERSE_DEPTH_FIRST_POST_ORDER since the children
68 * are visited before having an opportunity to bail out)
69 * CLUTTER_ACTOR_TRAVERSE_VISIT_BREAK: Immediately bail out without
70 * visiting any more actors.
72 * Each time an actor is visited during a scenegraph traversal the
73 * ClutterTraverseCallback can return a set of flags that may affect
74 * the continuing traversal. It may stop traversal completely, just
75 * skip over children for the current actor or continue as normal.
78 CLUTTER_ACTOR_TRAVERSE_VISIT_CONTINUE = 1L<<0,
79 CLUTTER_ACTOR_TRAVERSE_VISIT_SKIP_CHILDREN = 1L<<1,
80 CLUTTER_ACTOR_TRAVERSE_VISIT_BREAK = 1L<<2
81 } ClutterActorTraverseVisitFlags;
84 * ClutterTraverseCallback:
86 * The callback prototype used with clutter_actor_traverse. The
87 * returned flags can be used to affect the continuing traversal
88 * either by continuing as normal, skipping over children of an
89 * actor or bailing out completely.
91 typedef ClutterActorTraverseVisitFlags (*ClutterTraverseCallback) (ClutterActor *actor,
96 * ClutterForeachCallback:
97 * @actor: The actor being iterated
98 * @user_data: The private data specified when starting the iteration
100 * A generic callback for iterating over actor, such as with
101 * _clutter_actor_foreach_child. The difference when compared to
102 * #ClutterCallback is that it returns a boolean so it is possible to break
103 * out of an iteration early.
105 * Return value: %TRUE to continue iterating or %FALSE to break iteration
108 typedef gboolean (*ClutterForeachCallback) (ClutterActor *actor,
111 typedef struct _AnchorCoord AnchorCoord;
112 typedef struct _SizeRequest SizeRequest;
114 typedef struct _ClutterLayoutInfo ClutterLayoutInfo;
115 typedef struct _ClutterTransformInfo ClutterTransformInfo;
116 typedef struct _ClutterAnimationInfo ClutterAnimationInfo;
118 /* Internal helper struct to represent a point that can be stored in
119 either direct pixel coordinates or as a fraction of the actor's
120 size. It is used for the anchor point, scale center and rotation
124 gboolean is_fractional;
128 /* Used when is_fractional == TRUE */
135 /* Use when is_fractional == FALSE */
150 * @fixed_pos: the fixed position of the actor
151 * @margin: the composed margin of the actor
152 * @x_align: the horizontal alignment, if the actor expands horizontally
153 * @y_align: the vertical alignment, if the actor expands vertically
154 * @x_expand: whether the actor should expand horizontally
155 * @y_expand: whether the actor should expand vertically
156 * @minimum: the fixed minimum size
157 * @natural: the fixed natural size
159 * Ancillary layout information for an actor.
161 struct _ClutterLayoutInfo
163 /* fixed position coordinates */
164 ClutterPoint fixed_pos;
166 ClutterMargin margin;
178 const ClutterLayoutInfo * _clutter_actor_get_layout_info_or_defaults (ClutterActor *self);
179 ClutterLayoutInfo * _clutter_actor_get_layout_info (ClutterActor *self);
181 struct _ClutterTransformInfo
183 /* rotation (angle and center) */
185 AnchorCoord rx_center;
188 AnchorCoord ry_center;
191 AnchorCoord rz_center;
196 AnchorCoord scale_center;
205 const ClutterTransformInfo * _clutter_actor_get_transform_info_or_defaults (ClutterActor *self);
206 ClutterTransformInfo * _clutter_actor_get_transform_info (ClutterActor *self);
208 typedef struct _AState {
209 guint easing_duration;
211 ClutterAnimationMode easing_mode;
214 struct _ClutterAnimationInfo
219 GHashTable *transitions;
222 const ClutterAnimationInfo * _clutter_actor_get_animation_info_or_defaults (ClutterActor *self);
223 ClutterAnimationInfo * _clutter_actor_get_animation_info (ClutterActor *self);
225 ClutterTransition * _clutter_actor_create_transition (ClutterActor *self,
228 ClutterTransition * _clutter_actor_get_transition (ClutterActor *self,
230 void _clutter_actor_update_transition (ClutterActor *self,
234 gboolean _clutter_actor_foreach_child (ClutterActor *self,
235 ClutterForeachCallback callback,
237 void _clutter_actor_traverse (ClutterActor *actor,
238 ClutterActorTraverseFlags flags,
239 ClutterTraverseCallback before_children_callback,
240 ClutterTraverseCallback after_children_callback,
242 ClutterActor *_clutter_actor_get_stage_internal (ClutterActor *actor);
244 void _clutter_actor_apply_modelview_transform (ClutterActor *self,
246 void _clutter_actor_apply_relative_transformation_matrix (ClutterActor *self,
247 ClutterActor *ancestor,
250 void _clutter_actor_rerealize (ClutterActor *self,
251 ClutterCallback callback,
254 void _clutter_actor_set_opacity_override (ClutterActor *self,
256 gint _clutter_actor_get_opacity_override (ClutterActor *self);
257 void _clutter_actor_set_in_clone_paint (ClutterActor *self,
258 gboolean is_in_clone_paint);
260 void _clutter_actor_set_enable_model_view_transform (ClutterActor *self,
263 void _clutter_actor_set_enable_paint_unmapped (ClutterActor *self,
266 void _clutter_actor_set_has_pointer (ClutterActor *self,
267 gboolean has_pointer);
269 void _clutter_actor_queue_redraw_with_clip (ClutterActor *self,
270 ClutterRedrawFlags flags,
271 ClutterPaintVolume *clip_volume);
272 void _clutter_actor_queue_redraw_full (ClutterActor *self,
273 ClutterRedrawFlags flags,
274 ClutterPaintVolume *volume,
275 ClutterEffect *effect);
277 ClutterPaintVolume *_clutter_actor_get_queue_redraw_clip (ClutterActor *self);
278 void _clutter_actor_set_queue_redraw_clip (ClutterActor *self,
279 ClutterPaintVolume *clip_volume);
280 void _clutter_actor_finish_queue_redraw (ClutterActor *self,
281 ClutterPaintVolume *clip);
283 gboolean _clutter_actor_set_default_paint_volume (ClutterActor *self,
285 ClutterPaintVolume *volume);
287 const gchar * _clutter_actor_get_debug_name (ClutterActor *self);
289 void _clutter_actor_push_clone_paint (void);
290 void _clutter_actor_pop_clone_paint (void);
292 guint32 _clutter_actor_get_pick_id (ClutterActor *self);
294 void _clutter_actor_shader_pre_paint (ClutterActor *actor,
296 void _clutter_actor_shader_post_paint (ClutterActor *actor);
298 ClutterActorAlign _clutter_actor_get_effective_x_align (ClutterActor *self);
302 #endif /* __CLUTTER_ACTOR_PRIVATE_H__ */