4 * An OpenGL based 'interactive canvas' library.
6 * Authored By Matthew Allum <mallum@openedhand.com>
8 * Copyright (C) 2006 OpenedHand
10 * This library is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Lesser General Public
12 * License as published by the Free Software Foundation; either
13 * version 2 of the License, or (at your option) any later version.
15 * This library is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * Lesser General Public License for more details.
20 * You should have received a copy of the GNU Lesser General Public
21 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
24 #if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
25 #error "Only <clutter/clutter.h> can be included directly."
28 #ifndef __CLUTTER_TYPES_H__
29 #define __CLUTTER_TYPES_H__
31 #include <glib-object.h>
35 #define CLUTTER_TYPE_ACTOR_BOX (clutter_actor_box_get_type ())
36 #define CLUTTER_TYPE_GEOMETRY (clutter_geometry_get_type ())
37 #define CLUTTER_TYPE_KNOT (clutter_knot_get_type ())
38 #define CLUTTER_TYPE_PAINT_VOLUME (clutter_paint_volume_get_type ())
39 #define CLUTTER_TYPE_VERTEX (clutter_vertex_get_type ())
41 /* Forward delarations to avoid header catch 22's */
42 typedef struct _ClutterActor ClutterActor;
44 typedef struct _ClutterStage ClutterStage;
45 typedef struct _ClutterContainer ClutterContainer; /* dummy */
46 typedef struct _ClutterChildMeta ClutterChildMeta;
47 typedef struct _ClutterLayoutMeta ClutterLayoutMeta;
48 typedef struct _ClutterActorMeta ClutterActorMeta;
50 typedef struct _ClutterAnimator ClutterAnimator;
52 typedef struct _ClutterAction ClutterAction;
53 typedef struct _ClutterConstraint ClutterConstraint;
54 typedef struct _ClutterEffect ClutterEffect;
56 typedef struct _ClutterShader ClutterShader;
58 typedef struct _ClutterColor ClutterColor;
60 typedef union _ClutterEvent ClutterEvent;
64 * @CLUTTER_GRAVITY_NONE: Do not apply any gravity
65 * @CLUTTER_GRAVITY_NORTH: Scale from topmost downwards
66 * @CLUTTER_GRAVITY_NORTH_EAST: Scale from the top right corner
67 * @CLUTTER_GRAVITY_EAST: Scale from the right side
68 * @CLUTTER_GRAVITY_SOUTH_EAST: Scale from the bottom right corner
69 * @CLUTTER_GRAVITY_SOUTH: Scale from the bottom upwards
70 * @CLUTTER_GRAVITY_SOUTH_WEST: Scale from the bottom left corner
71 * @CLUTTER_GRAVITY_WEST: Scale from the left side
72 * @CLUTTER_GRAVITY_NORTH_WEST: Scale from the top left corner
73 * @CLUTTER_GRAVITY_CENTER: Scale from the center.
75 * Gravity of the scaling operations. When a gravity different than
76 * %CLUTTER_GRAVITY_NONE is used, an actor is scaled keeping the position
77 * of the specified portion at the same coordinates.
81 typedef enum { /*< prefix=CLUTTER_GRAVITY >*/
82 CLUTTER_GRAVITY_NONE = 0,
83 CLUTTER_GRAVITY_NORTH,
84 CLUTTER_GRAVITY_NORTH_EAST,
86 CLUTTER_GRAVITY_SOUTH_EAST,
87 CLUTTER_GRAVITY_SOUTH,
88 CLUTTER_GRAVITY_SOUTH_WEST,
90 CLUTTER_GRAVITY_NORTH_WEST,
91 CLUTTER_GRAVITY_CENTER
94 typedef struct _ClutterActorBox ClutterActorBox;
95 typedef struct _ClutterGeometry ClutterGeometry;
96 typedef struct _ClutterKnot ClutterKnot;
97 typedef struct _ClutterVertex ClutterVertex;
100 * ClutterPaintVolume:
102 * <structname>ClutterPaintVolume</structname> is an opaque structure
103 * whose members cannot be directly accessed.
105 * A <structname>ClutterPaintVolume</structname> represents an
106 * a bounding volume whos internal representation isn't defined but
107 * can be set and queried in terms of an axis aligned bounding box.
109 * Other internal representation and methods for describing the
110 * bounding volume may be added in the future.
114 typedef struct _ClutterPaintVolume ClutterPaintVolume;
118 * @x: X coordinate of the vertex
119 * @y: Y coordinate of the vertex
120 * @z: Z coordinate of the vertex
122 * Vertex of an actor in 3D space, expressed in pixels
126 struct _ClutterVertex
133 GType clutter_vertex_get_type (void) G_GNUC_CONST;
134 ClutterVertex *clutter_vertex_new (gfloat x,
137 ClutterVertex *clutter_vertex_copy (const ClutterVertex *vertex);
138 void clutter_vertex_free (ClutterVertex *vertex);
139 gboolean clutter_vertex_equal (const ClutterVertex *vertex_a,
140 const ClutterVertex *vertex_b);
144 * @x1: X coordinate of the top left corner
145 * @y1: Y coordinate of the top left corner
146 * @x2: X coordinate of the bottom right corner
147 * @y2: Y coordinate of the bottom right corner
149 * Bounding box of an actor. The coordinates of the top left and right bottom
150 * corners of an actor. The coordinates of the two points are expressed in
151 * pixels with sub-pixel precision
153 struct _ClutterActorBox
162 GType clutter_actor_box_get_type (void) G_GNUC_CONST;
163 ClutterActorBox *clutter_actor_box_new (gfloat x_1,
167 ClutterActorBox *clutter_actor_box_copy (const ClutterActorBox *box);
168 void clutter_actor_box_free (ClutterActorBox *box);
169 gboolean clutter_actor_box_equal (const ClutterActorBox *box_a,
170 const ClutterActorBox *box_b);
171 gfloat clutter_actor_box_get_x (const ClutterActorBox *box);
172 gfloat clutter_actor_box_get_y (const ClutterActorBox *box);
173 gfloat clutter_actor_box_get_width (const ClutterActorBox *box);
174 gfloat clutter_actor_box_get_height (const ClutterActorBox *box);
175 void clutter_actor_box_get_origin (const ClutterActorBox *box,
178 void clutter_actor_box_get_size (const ClutterActorBox *box,
181 gfloat clutter_actor_box_get_area (const ClutterActorBox *box);
182 gboolean clutter_actor_box_contains (const ClutterActorBox *box,
185 void clutter_actor_box_from_vertices (ClutterActorBox *box,
186 const ClutterVertex verts[]);
187 void clutter_actor_box_interpolate (const ClutterActorBox *initial,
188 const ClutterActorBox *final,
190 ClutterActorBox *result);
191 void clutter_actor_box_clamp_to_pixel (ClutterActorBox *box);
192 void clutter_actor_box_union (const ClutterActorBox *a,
193 const ClutterActorBox *b,
194 ClutterActorBox *result);
196 void clutter_actor_box_set_origin (ClutterActorBox *box,
199 void clutter_actor_box_set_size (ClutterActorBox *box,
205 * @x: X coordinate of the top left corner of an actor
206 * @y: Y coordinate of the top left corner of an actor
207 * @width: width of an actor
208 * @height: height of an actor
210 * The rectangle containing an actor's bounding box, measured in pixels.
212 struct _ClutterGeometry
221 GType clutter_geometry_get_type (void) G_GNUC_CONST;
223 void clutter_geometry_union (const ClutterGeometry *geometry_a,
224 const ClutterGeometry *geometry_b,
225 ClutterGeometry *result);
226 gboolean clutter_geometry_intersects (const ClutterGeometry *geometry0,
227 const ClutterGeometry *geometry1);
231 * @x: X coordinate of the knot
232 * @y: Y coordinate of the knot
234 * Point in a path behaviour.
244 GType clutter_knot_get_type (void) G_GNUC_CONST;
245 ClutterKnot *clutter_knot_copy (const ClutterKnot *knot);
246 void clutter_knot_free (ClutterKnot *knot);
247 gboolean clutter_knot_equal (const ClutterKnot *knot_a,
248 const ClutterKnot *knot_b);
252 * @CLUTTER_X_AXIS: Rotate around the X axis
253 * @CLUTTER_Y_AXIS: Rotate around the Y axis
254 * @CLUTTER_Z_AXIS: Rotate around the Z axis
256 * Axis of a rotation.
260 typedef enum { /*< prefix=CLUTTER >*/
267 * ClutterRotateDirection:
268 * @CLUTTER_ROTATE_CW: Clockwise rotation
269 * @CLUTTER_ROTATE_CCW: Counter-clockwise rotation
271 * Direction of a rotation.
275 typedef enum { /*< prefix=CLUTTER_ROTATE >*/
278 } ClutterRotateDirection;
281 * ClutterRequestMode:
282 * @CLUTTER_REQUEST_HEIGHT_FOR_WIDTH: Height for width requests
283 * @CLUTTER_REQUEST_WIDTH_FOR_HEIGHT: Width for height requests
285 * Specifies the type of requests for a #ClutterActor.
290 CLUTTER_REQUEST_HEIGHT_FOR_WIDTH,
291 CLUTTER_REQUEST_WIDTH_FOR_HEIGHT
292 } ClutterRequestMode;
295 * ClutterAnimationMode:
296 * @CLUTTER_CUSTOM_MODE: custom progress function
297 * @CLUTTER_LINEAR: linear tweening
298 * @CLUTTER_EASE_IN_QUAD: quadratic tweening
299 * @CLUTTER_EASE_OUT_QUAD: quadratic tweening, inverse of
300 * %CLUTTER_EASE_IN_QUAD
301 * @CLUTTER_EASE_IN_OUT_QUAD: quadratic tweening, combininig
302 * %CLUTTER_EASE_IN_QUAD and %CLUTTER_EASE_OUT_QUAD
303 * @CLUTTER_EASE_IN_CUBIC: cubic tweening
304 * @CLUTTER_EASE_OUT_CUBIC: cubic tweening, invers of
305 * %CLUTTER_EASE_IN_CUBIC
306 * @CLUTTER_EASE_IN_OUT_CUBIC: cubic tweening, combining
307 * %CLUTTER_EASE_IN_CUBIC and %CLUTTER_EASE_OUT_CUBIC
308 * @CLUTTER_EASE_IN_QUART: quartic tweening
309 * @CLUTTER_EASE_OUT_QUART: quartic tweening, inverse of
310 * %CLUTTER_EASE_IN_QUART
311 * @CLUTTER_EASE_IN_OUT_QUART: quartic tweening, combining
312 * %CLUTTER_EASE_IN_QUART and %CLUTTER_EASE_OUT_QUART
313 * @CLUTTER_EASE_IN_QUINT: quintic tweening
314 * @CLUTTER_EASE_OUT_QUINT: quintic tweening, inverse of
315 * %CLUTTER_EASE_IN_QUINT
316 * @CLUTTER_EASE_IN_OUT_QUINT: fifth power tweening, combining
317 * %CLUTTER_EASE_IN_QUINT and %CLUTTER_EASE_OUT_QUINT
318 * @CLUTTER_EASE_IN_SINE: sinusoidal tweening
319 * @CLUTTER_EASE_OUT_SINE: sinusoidal tweening, inverse of
320 * %CLUTTER_EASE_IN_SINE
321 * @CLUTTER_EASE_IN_OUT_SINE: sine wave tweening, combining
322 * %CLUTTER_EASE_IN_SINE and %CLUTTER_EASE_OUT_SINE
323 * @CLUTTER_EASE_IN_EXPO: exponential tweening
324 * @CLUTTER_EASE_OUT_EXPO: exponential tweening, inverse of
325 * %CLUTTER_EASE_IN_EXPO
326 * @CLUTTER_EASE_IN_OUT_EXPO: exponential tweening, combining
327 * %CLUTTER_EASE_IN_EXPO and %CLUTTER_EASE_OUT_EXPO
328 * @CLUTTER_EASE_IN_CIRC: circular tweening
329 * @CLUTTER_EASE_OUT_CIRC: circular tweening, inverse of
330 * %CLUTTER_EASE_IN_CIRC
331 * @CLUTTER_EASE_IN_OUT_CIRC: circular tweening, combining
332 * %CLUTTER_EASE_IN_CIRC and %CLUTTER_EASE_OUT_CIRC
333 * @CLUTTER_EASE_IN_ELASTIC: elastic tweening, with offshoot on start
334 * @CLUTTER_EASE_OUT_ELASTIC: elastic tweening, with offshoot on end
335 * @CLUTTER_EASE_IN_OUT_ELASTIC: elastic tweening with offshoot on both ends
336 * @CLUTTER_EASE_IN_BACK: overshooting cubic tweening, with
337 * backtracking on start
338 * @CLUTTER_EASE_OUT_BACK: overshooting cubic tweening, with
339 * backtracking on end
340 * @CLUTTER_EASE_IN_OUT_BACK: overshooting cubic tweening, with
341 * backtracking on both ends
342 * @CLUTTER_EASE_IN_BOUNCE: exponentially decaying parabolic (bounce)
343 * tweening, with bounce on start
344 * @CLUTTER_EASE_OUT_BOUNCE: exponentially decaying parabolic (bounce)
345 * tweening, with bounce on end
346 * @CLUTTER_EASE_IN_OUT_BOUNCE: exponentially decaying parabolic (bounce)
347 * tweening, with bounce on both ends
348 * @CLUTTER_ANIMATION_LAST: last animation mode, used as a guard for
349 * registered global alpha functions
351 * The animation modes used by #ClutterAlpha and #ClutterAnimation. This
352 * enumeration can be expanded in later versions of Clutter. See the
353 * #ClutterAlpha documentation for a graph of all the animation modes.
355 * Every global alpha function registered using clutter_alpha_register_func()
356 * or clutter_alpha_register_closure() will have a logical id greater than
357 * %CLUTTER_ANIMATION_LAST.
362 CLUTTER_CUSTOM_MODE = 0,
368 CLUTTER_EASE_IN_QUAD,
369 CLUTTER_EASE_OUT_QUAD,
370 CLUTTER_EASE_IN_OUT_QUAD,
373 CLUTTER_EASE_IN_CUBIC,
374 CLUTTER_EASE_OUT_CUBIC,
375 CLUTTER_EASE_IN_OUT_CUBIC,
378 CLUTTER_EASE_IN_QUART,
379 CLUTTER_EASE_OUT_QUART,
380 CLUTTER_EASE_IN_OUT_QUART,
383 CLUTTER_EASE_IN_QUINT,
384 CLUTTER_EASE_OUT_QUINT,
385 CLUTTER_EASE_IN_OUT_QUINT,
388 CLUTTER_EASE_IN_SINE,
389 CLUTTER_EASE_OUT_SINE,
390 CLUTTER_EASE_IN_OUT_SINE,
393 CLUTTER_EASE_IN_EXPO,
394 CLUTTER_EASE_OUT_EXPO,
395 CLUTTER_EASE_IN_OUT_EXPO,
398 CLUTTER_EASE_IN_CIRC,
399 CLUTTER_EASE_OUT_CIRC,
400 CLUTTER_EASE_IN_OUT_CIRC,
403 CLUTTER_EASE_IN_ELASTIC,
404 CLUTTER_EASE_OUT_ELASTIC,
405 CLUTTER_EASE_IN_OUT_ELASTIC,
407 /* overshooting cubic */
408 CLUTTER_EASE_IN_BACK,
409 CLUTTER_EASE_OUT_BACK,
410 CLUTTER_EASE_IN_OUT_BACK,
412 /* exponentially decaying parabolic */
413 CLUTTER_EASE_IN_BOUNCE,
414 CLUTTER_EASE_OUT_BOUNCE,
415 CLUTTER_EASE_IN_OUT_BOUNCE,
417 /* guard, before registered alpha functions */
418 CLUTTER_ANIMATION_LAST
419 } ClutterAnimationMode;
423 * @CLUTTER_FONT_MIPMAPPING: Set to use mipmaps for the glyph cache textures.
424 * @CLUTTER_FONT_HINTING: Set to enable hinting on the glyphs.
426 * Runtime flags to change the font quality. To be used with
427 * clutter_set_font_flags().
433 CLUTTER_FONT_MIPMAPPING = (1 << 0),
434 CLUTTER_FONT_HINTING = (1 << 1)
438 * ClutterTextDirection:
439 * @CLUTTER_TEXT_DIRECTION_DEFAULT: Use the default setting, as returned
440 * by clutter_get_default_text_direction()
441 * @CLUTTER_TEXT_DIRECTION_LTR: Use left-to-right text direction
442 * @CLUTTER_TEXT_DIRECTION_RTL: Use right-to-left text direction
444 * The text direction to be used by #ClutterActor<!-- -->s
449 CLUTTER_TEXT_DIRECTION_DEFAULT,
450 CLUTTER_TEXT_DIRECTION_LTR,
451 CLUTTER_TEXT_DIRECTION_RTL
452 } ClutterTextDirection;
456 * @CLUTTER_VERTEX_SHADER: a vertex shader
457 * @CLUTTER_FRAGMENT_SHADER: a fragment shader
459 * The type of GLSL shader program
464 CLUTTER_VERTEX_SHADER,
465 CLUTTER_FRAGMENT_SHADER
468 GType clutter_paint_volume_get_type (void) G_GNUC_CONST;
470 ClutterPaintVolume *clutter_paint_volume_copy (const ClutterPaintVolume *pv);
471 void clutter_paint_volume_free (ClutterPaintVolume *pv);
473 void clutter_paint_volume_set_origin (ClutterPaintVolume *pv,
474 const ClutterVertex *origin);
475 void clutter_paint_volume_get_origin (const ClutterPaintVolume *pv,
476 ClutterVertex *vertex);
477 void clutter_paint_volume_set_width (ClutterPaintVolume *pv,
479 gfloat clutter_paint_volume_get_width (const ClutterPaintVolume *pv);
480 void clutter_paint_volume_set_height (ClutterPaintVolume *pv,
482 gfloat clutter_paint_volume_get_height (const ClutterPaintVolume *pv);
483 void clutter_paint_volume_set_depth (ClutterPaintVolume *pv,
485 gfloat clutter_paint_volume_get_depth (const ClutterPaintVolume *pv);
486 void clutter_paint_volume_union (ClutterPaintVolume *pv,
487 const ClutterPaintVolume *another_pv);
489 gboolean clutter_paint_volume_set_from_allocation (ClutterPaintVolume *pv,
490 ClutterActor *actor);
494 #endif /* __CLUTTER_TYPES_H__ */