1 /*
2  * Clutter.
3  *
4  * An OpenGL based 'interactive canvas' library.
5  *
6  * Authored By Matthew Allum  <mallum@openedhand.com>
7  *
8  * Copyright (C) 2006 OpenedHand
9  *
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.
14  *
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.
19  *
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/>.
22  */
23 
24 #ifndef __CLUTTER_TYPES_H__
25 #define __CLUTTER_TYPES_H__
26 
27 #if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
28 #error "Only <clutter/clutter.h> can be included directly."
29 #endif
30 
31 #include <stdlib.h>
32 #include <cairo.h>
33 #include <cogl/cogl.h>
34 #include <clutter/clutter-macros.h>
35 #include <clutter/clutter-enums.h>
36 
37 G_BEGIN_DECLS
38 
39 #define CLUTTER_TYPE_ACTOR_BOX          (clutter_actor_box_get_type ())
40 #define CLUTTER_TYPE_FOG                (clutter_fog_get_type ())
41 #define CLUTTER_TYPE_GEOMETRY           (clutter_geometry_get_type ())
42 #define CLUTTER_TYPE_KNOT               (clutter_knot_get_type ())
43 #define CLUTTER_TYPE_MARGIN             (clutter_margin_get_type ())
44 #define CLUTTER_TYPE_MATRIX             (clutter_matrix_get_type ())
45 #define CLUTTER_TYPE_PAINT_VOLUME       (clutter_paint_volume_get_type ())
46 #define CLUTTER_TYPE_PERSPECTIVE        (clutter_perspective_get_type ())
47 #define CLUTTER_TYPE_VERTEX             (clutter_vertex_get_type ())
48 #define CLUTTER_TYPE_POINT              (clutter_point_get_type ())
49 #define CLUTTER_TYPE_SIZE               (clutter_size_get_type ())
50 #define CLUTTER_TYPE_RECT               (clutter_rect_get_type ())
51 
52 typedef struct _ClutterActor                    ClutterActor;
53 
54 typedef struct _ClutterStage                    ClutterStage;
55 typedef struct _ClutterFrameInfo                ClutterFrameInfo;
56 typedef struct _ClutterContainer                ClutterContainer; /* dummy */
57 typedef struct _ClutterChildMeta                ClutterChildMeta;
58 typedef struct _ClutterLayoutMeta               ClutterLayoutMeta;
59 typedef struct _ClutterActorMeta                ClutterActorMeta;
60 typedef struct _ClutterLayoutManager            ClutterLayoutManager;
61 typedef struct _ClutterActorIter                ClutterActorIter;
62 typedef struct _ClutterPaintNode                ClutterPaintNode;
63 typedef struct _ClutterContent                  ClutterContent; /* dummy */
64 typedef struct _ClutterScrollActor	        ClutterScrollActor;
65 
66 typedef struct _ClutterInterval         	ClutterInterval;
67 typedef struct _ClutterAnimatable       	ClutterAnimatable; /* dummy */
68 typedef struct _ClutterTimeline         	ClutterTimeline;
69 typedef struct _ClutterTransition       	ClutterTransition;
70 typedef struct _ClutterPropertyTransition       ClutterPropertyTransition;
71 typedef struct _ClutterKeyframeTransition       ClutterKeyframeTransition;
72 typedef struct _ClutterTransitionGroup		ClutterTransitionGroup;
73 
74 typedef struct _ClutterAction                   ClutterAction;
75 typedef struct _ClutterConstraint               ClutterConstraint;
76 typedef struct _ClutterEffect                   ClutterEffect;
77 
78 typedef struct _ClutterPath                     ClutterPath;
79 typedef struct _ClutterPathNode                 ClutterPathNode;
80 
81 typedef struct _ClutterActorBox                 ClutterActorBox;
82 typedef struct _ClutterColor                    ClutterColor;
83 typedef struct _ClutterGeometry                 ClutterGeometry; /* XXX:2.0 - remove */
84 typedef struct _ClutterKnot                     ClutterKnot;
85 typedef struct _ClutterMargin                   ClutterMargin;
86 typedef struct _ClutterPerspective              ClutterPerspective;
87 typedef struct _ClutterPoint                    ClutterPoint;
88 typedef struct _ClutterRect                     ClutterRect;
89 typedef struct _ClutterSize                     ClutterSize;
90 typedef struct _ClutterVertex                   ClutterVertex;
91 
92 typedef struct _ClutterAlpha            	ClutterAlpha;
93 typedef struct _ClutterAnimation                ClutterAnimation;
94 typedef struct _ClutterAnimator         	ClutterAnimator;
95 typedef struct _ClutterState            	ClutterState;
96 
97 typedef struct _ClutterInputDeviceTool          ClutterInputDeviceTool;
98 typedef struct _ClutterInputDevice              ClutterInputDevice;
99 typedef struct _ClutterVirtualInputDevice       ClutterVirtualInputDevice;
100 
101 typedef struct _ClutterInputMethod              ClutterInputMethod;
102 typedef struct _ClutterInputFocus               ClutterInputFocus;
103 
104 typedef CoglMatrix                              ClutterMatrix;
105 
106 typedef union _ClutterEvent                     ClutterEvent;
107 
108 /**
109  * ClutterEventSequence:
110  *
111  * The #ClutterEventSequence structure is an opaque
112  * type used to denote the event sequence of a touch event.
113  *
114  * Since: 1.12
115  */
116 typedef struct _ClutterEventSequence            ClutterEventSequence;
117 
118 typedef struct _ClutterFog                      ClutterFog; /* deprecated */
119 typedef struct _ClutterBehaviour                ClutterBehaviour; /* deprecated */
120 typedef struct _ClutterShader                   ClutterShader; /* deprecated */
121 
122 /**
123  * ClutterPaintVolume:
124  *
125  * #ClutterPaintVolume is an opaque structure
126  * whose members cannot be directly accessed.
127  *
128  * A #ClutterPaintVolume represents an
129  * a bounding volume whose internal representation isn't defined but
130  * can be set and queried in terms of an axis aligned bounding box.
131  *
132  * A #ClutterPaintVolume for a #ClutterActor
133  * is defined to be relative from the current actor modelview matrix.
134  *
135  * Other internal representation and methods for describing the
136  * bounding volume may be added in the future.
137  *
138  * Since: 1.4
139  */
140 typedef struct _ClutterPaintVolume      ClutterPaintVolume;
141 
142 /**
143  * ClutterPoint:
144  * @x: X coordinate, in pixels
145  * @y: Y coordinate, in pixels
146  *
147  * A point in 2D space.
148  *
149  * Since: 1.12
150  */
151 struct _ClutterPoint
152 {
153   float x;
154   float y;
155 };
156 
157 /**
158  * CLUTTER_POINT_INIT:
159  * @x: X coordinate
160  * @y: Y coordinate
161  *
162  * A simple macro for initializing a #ClutterPoint when declaring it, e.g.:
163  *
164  * |[
165  *   ClutterPoint p = CLUTTER_POINT_INIT (100, 100);
166  * ]|
167  *
168  * Since: 1.12
169  */
170 #define CLUTTER_POINT_INIT(x,y)         { (x), (y) }
171 
172 /**
173  * CLUTTER_POINT_INIT_ZERO:
174  *
175  * A simple macro for initializing a #ClutterPoint to (0, 0) when
176  * declaring it.
177  *
178  * Since: 1.12
179  */
180 #define CLUTTER_POINT_INIT_ZERO         CLUTTER_POINT_INIT (0.f, 0.f)
181 
182 CLUTTER_AVAILABLE_IN_1_12
183 GType clutter_point_get_type (void) G_GNUC_CONST;
184 
185 CLUTTER_AVAILABLE_IN_1_12
186 const ClutterPoint *    clutter_point_zero      (void);
187 CLUTTER_AVAILABLE_IN_1_12
188 ClutterPoint *          clutter_point_alloc     (void);
189 CLUTTER_AVAILABLE_IN_1_12
190 ClutterPoint *          clutter_point_init      (ClutterPoint       *point,
191                                                  float               x,
192                                                  float               y);
193 CLUTTER_AVAILABLE_IN_1_12
194 ClutterPoint *          clutter_point_copy      (const ClutterPoint *point);
195 CLUTTER_AVAILABLE_IN_1_12
196 void                    clutter_point_free      (ClutterPoint       *point);
197 CLUTTER_AVAILABLE_IN_1_12
198 gboolean                clutter_point_equals    (const ClutterPoint *a,
199                                                  const ClutterPoint *b);
200 CLUTTER_AVAILABLE_IN_1_12
201 float                   clutter_point_distance  (const ClutterPoint *a,
202                                                  const ClutterPoint *b,
203                                                  float              *x_distance,
204                                                  float              *y_distance);
205 
206 /**
207  * ClutterSize:
208  * @width: the width, in pixels
209  * @height: the height, in pixels
210  *
211  * A size, in 2D space.
212  *
213  * Since: 1.12
214  */
215 struct _ClutterSize
216 {
217   float width;
218   float height;
219 };
220 
221 /**
222  * CLUTTER_SIZE_INIT:
223  * @width: the width
224  * @height: the height
225  *
226  * A simple macro for initializing a #ClutterSize when declaring it, e.g.:
227  *
228  * |[
229  *   ClutterSize s = CLUTTER_SIZE_INIT (200, 200);
230  * ]|
231  *
232  * Since: 1.12
233  */
234 #define CLUTTER_SIZE_INIT(width,height) { (width), (height) }
235 
236 /**
237  * CLUTTER_SIZE_INIT_ZERO:
238  *
239  * A simple macro for initializing a #ClutterSize to (0, 0) when
240  * declaring it.
241  *
242  * Since: 1.12
243  */
244 #define CLUTTER_SIZE_INIT_ZERO          CLUTTER_SIZE_INIT (0.f, 0.f)
245 
246 CLUTTER_AVAILABLE_IN_1_12
247 GType clutter_size_get_type (void) G_GNUC_CONST;
248 
249 CLUTTER_AVAILABLE_IN_1_12
250 ClutterSize *   clutter_size_alloc      (void);
251 CLUTTER_AVAILABLE_IN_1_12
252 ClutterSize *   clutter_size_init       (ClutterSize       *size,
253                                          float              width,
254                                          float              height);
255 CLUTTER_AVAILABLE_IN_1_12
256 ClutterSize *   clutter_size_copy       (const ClutterSize *size);
257 CLUTTER_AVAILABLE_IN_1_12
258 void            clutter_size_free       (ClutterSize       *size);
259 CLUTTER_AVAILABLE_IN_1_12
260 gboolean        clutter_size_equals     (const ClutterSize *a,
261                                          const ClutterSize *b);
262 
263 /**
264  * ClutterRect:
265  * @origin: the origin of the rectangle
266  * @size: the size of the rectangle
267  *
268  * The location and size of a rectangle.
269  *
270  * The width and height of a #ClutterRect can be negative; Clutter considers
271  * a rectangle with an origin of [ 0.0, 0.0 ] and a size of [ 10.0, 10.0 ] to
272  * be equivalent to a rectangle with origin of [ 10.0, 10.0 ] and size of
273  * [ -10.0, -10.0 ].
274  *
275  * Application code can normalize rectangles using clutter_rect_normalize():
276  * this function will ensure that the width and height of a #ClutterRect are
277  * positive values. All functions taking a #ClutterRect as an argument will
278  * implicitly normalize it before computing eventual results. For this reason
279  * it is safer to access the contents of a #ClutterRect by using the provided
280  * API at all times, instead of directly accessing the structure members.
281  *
282  * Since: 1.12
283  */
284 struct _ClutterRect
285 {
286   ClutterPoint origin;
287   ClutterSize size;
288 };
289 
290 /**
291  * CLUTTER_RECT_INIT:
292  * @x: the X coordinate
293  * @y: the Y coordinate
294  * @width: the width
295  * @height: the height
296  *
297  * A simple macro for initializing a #ClutterRect when declaring it, e.g.:
298  *
299  * |[
300  *   ClutterRect r = CLUTTER_RECT_INIT (100, 100, 200, 200);
301  * ]|
302  *
303  * Since: 1.12
304  */
305 #define CLUTTER_RECT_INIT(x,y,width,height)     { { (x), (y) }, { (width), (height) } }
306 
307 /**
308  * CLUTTER_RECT_INIT_ZERO:
309  *
310  * A simple macro for initializing a #ClutterRect to (0, 0, 0, 0) when
311  * declaring it.
312  *
313  * Since: 1.12
314  */
315 #define CLUTTER_RECT_INIT_ZERO                  CLUTTER_RECT_INIT (0.f, 0.f, 0.f, 0.f)
316 
317 CLUTTER_AVAILABLE_IN_1_12
318 GType clutter_rect_get_type (void) G_GNUC_CONST;
319 
320 CLUTTER_AVAILABLE_IN_1_12
321 const ClutterRect *     clutter_rect_zero               (void);
322 CLUTTER_AVAILABLE_IN_1_12
323 ClutterRect *           clutter_rect_alloc              (void);
324 CLUTTER_AVAILABLE_IN_1_12
325 ClutterRect *           clutter_rect_init               (ClutterRect       *rect,
326                                                          float              x,
327                                                          float              y,
328                                                          float              width,
329                                                          float              height);
330 CLUTTER_AVAILABLE_IN_1_12
331 ClutterRect *           clutter_rect_copy               (const ClutterRect *rect);
332 CLUTTER_AVAILABLE_IN_1_12
333 void                    clutter_rect_free               (ClutterRect       *rect);
334 CLUTTER_AVAILABLE_IN_1_12
335 gboolean                clutter_rect_equals             (ClutterRect       *a,
336                                                          ClutterRect       *b);
337 
338 CLUTTER_AVAILABLE_IN_1_12
339 ClutterRect *           clutter_rect_normalize          (ClutterRect       *rect);
340 CLUTTER_AVAILABLE_IN_1_12
341 void                    clutter_rect_get_center         (ClutterRect       *rect,
342                                                          ClutterPoint      *center);
343 CLUTTER_AVAILABLE_IN_1_12
344 gboolean                clutter_rect_contains_point     (ClutterRect       *rect,
345                                                          ClutterPoint      *point);
346 CLUTTER_AVAILABLE_IN_1_12
347 gboolean                clutter_rect_contains_rect      (ClutterRect       *a,
348                                                          ClutterRect       *b);
349 CLUTTER_AVAILABLE_IN_1_12
350 void                    clutter_rect_union              (ClutterRect       *a,
351                                                          ClutterRect       *b,
352                                                          ClutterRect       *res);
353 CLUTTER_AVAILABLE_IN_1_12
354 gboolean                clutter_rect_intersection       (ClutterRect       *a,
355                                                          ClutterRect       *b,
356                                                          ClutterRect       *res);
357 CLUTTER_AVAILABLE_IN_1_12
358 void                    clutter_rect_offset             (ClutterRect       *rect,
359                                                          float              d_x,
360                                                          float              d_y);
361 CLUTTER_AVAILABLE_IN_1_12
362 void                    clutter_rect_inset              (ClutterRect       *rect,
363                                                          float              d_x,
364                                                          float              d_y);
365 CLUTTER_AVAILABLE_IN_1_12
366 void                    clutter_rect_clamp_to_pixel     (ClutterRect       *rect);
367 CLUTTER_AVAILABLE_IN_1_12
368 float                   clutter_rect_get_x              (ClutterRect       *rect);
369 CLUTTER_AVAILABLE_IN_1_12
370 float                   clutter_rect_get_y              (ClutterRect       *rect);
371 CLUTTER_AVAILABLE_IN_1_12
372 float                   clutter_rect_get_width          (ClutterRect       *rect);
373 CLUTTER_AVAILABLE_IN_1_12
374 float                   clutter_rect_get_height         (ClutterRect       *rect);
375 
376 /**
377  * ClutterVertex:
378  * @x: X coordinate of the vertex
379  * @y: Y coordinate of the vertex
380  * @z: Z coordinate of the vertex
381  *
382  * A point in 3D space, expressed in pixels
383  *
384  * Since: 0.4
385  */
386 struct _ClutterVertex
387 {
388   gfloat x;
389   gfloat y;
390   gfloat z;
391 };
392 
393 /**
394  * CLUTTER_VERTEX_INIT:
395  * @x: the X coordinate of the vertex
396  * @y: the Y coordinate of the vertex
397  * @z: the Z coordinate of the vertex
398  *
399  * A simple macro for initializing a #ClutterVertex when declaring it, e.g.:
400  *
401  * |[
402  *   ClutterVertex v = CLUTTER_VERTEX_INIT (x, y, z);
403  * ]|
404  *
405  * Since: 1.10
406  */
407 #define CLUTTER_VERTEX_INIT(x,y,z)      { (x), (y), (z) }
408 
409 /**
410  * CLUTTER_VERTEX_INIT_ZERO:
411  *
412  * A simple macro for initializing a #ClutterVertex to (0, 0, 0).
413  *
414  * Since: 1.12
415  */
416 #define CLUTTER_VERTEX_INIT_ZERO        CLUTTER_VERTEX_INIT (0.f, 0.f, 0.f)
417 
418 CLUTTER_AVAILABLE_IN_ALL
419 GType          clutter_vertex_get_type (void) G_GNUC_CONST;
420 CLUTTER_AVAILABLE_IN_ALL
421 ClutterVertex *clutter_vertex_new      (gfloat               x,
422                                         gfloat               y,
423                                         gfloat               z);
424 CLUTTER_AVAILABLE_IN_1_12
425 ClutterVertex *clutter_vertex_alloc    (void);
426 CLUTTER_AVAILABLE_IN_ALL
427 ClutterVertex *clutter_vertex_init     (ClutterVertex       *vertex,
428                                         gfloat               x,
429                                         gfloat               y,
430                                         gfloat               z);
431 CLUTTER_AVAILABLE_IN_ALL
432 ClutterVertex *clutter_vertex_copy     (const ClutterVertex *vertex);
433 CLUTTER_AVAILABLE_IN_ALL
434 void           clutter_vertex_free     (ClutterVertex       *vertex);
435 CLUTTER_AVAILABLE_IN_ALL
436 gboolean       clutter_vertex_equal    (const ClutterVertex *vertex_a,
437                                         const ClutterVertex *vertex_b);
438 
439 /**
440  * ClutterActorBox:
441  * @x1: X coordinate of the top left corner
442  * @y1: Y coordinate of the top left corner
443  * @x2: X coordinate of the bottom right corner
444  * @y2: Y coordinate of the bottom right corner
445  *
446  * Bounding box of an actor. The coordinates of the top left and right bottom
447  * corners of an actor. The coordinates of the two points are expressed in
448  * pixels with sub-pixel precision
449  */
450 struct _ClutterActorBox
451 {
452   gfloat x1;
453   gfloat y1;
454 
455   gfloat x2;
456   gfloat y2;
457 };
458 
459 /**
460  * CLUTTER_ACTOR_BOX_INIT:
461  * @x_1: the X coordinate of the top left corner
462  * @y_1: the Y coordinate of the top left corner
463  * @x_2: the X coordinate of the bottom right corner
464  * @y_2: the Y coordinate of the bottom right corner
465  *
466  * A simple macro for initializing a #ClutterActorBox when declaring
467  * it, e.g.:
468  *
469  * |[
470  *   ClutterActorBox box = CLUTTER_ACTOR_BOX_INIT (0, 0, 400, 600);
471  * ]|
472  *
473  * Since: 1.10
474  */
475 #define CLUTTER_ACTOR_BOX_INIT(x_1,y_1,x_2,y_2)         { (x_1), (y_1), (x_2), (y_2) }
476 
477 /**
478  * CLUTTER_ACTOR_BOX_INIT_ZERO:
479  *
480  * A simple macro for initializing a #ClutterActorBox to 0 when
481  * declaring it, e.g.:
482  *
483  * |[
484  *   ClutterActorBox box = CLUTTER_ACTOR_BOX_INIT_ZERO;
485  * ]|
486  *
487  * Since: 1.12
488  */
489 #define CLUTTER_ACTOR_BOX_INIT_ZERO                     CLUTTER_ACTOR_BOX_INIT (0.f, 0.f, 0.f, 0.f)
490 
491 CLUTTER_AVAILABLE_IN_ALL
492 GType            clutter_actor_box_get_type      (void) G_GNUC_CONST;
493 CLUTTER_AVAILABLE_IN_ALL
494 ClutterActorBox *clutter_actor_box_new           (gfloat                 x_1,
495                                                   gfloat                 y_1,
496                                                   gfloat                 x_2,
497                                                   gfloat                 y_2);
498 CLUTTER_AVAILABLE_IN_1_12
499 ClutterActorBox *clutter_actor_box_alloc         (void);
500 CLUTTER_AVAILABLE_IN_ALL
501 ClutterActorBox *clutter_actor_box_init          (ClutterActorBox       *box,
502                                                   gfloat                 x_1,
503                                                   gfloat                 y_1,
504                                                   gfloat                 x_2,
505                                                   gfloat                 y_2);
506 CLUTTER_AVAILABLE_IN_ALL
507 void             clutter_actor_box_init_rect     (ClutterActorBox       *box,
508                                                   gfloat                 x,
509                                                   gfloat                 y,
510                                                   gfloat                 width,
511                                                   gfloat                 height);
512 CLUTTER_AVAILABLE_IN_ALL
513 ClutterActorBox *clutter_actor_box_copy          (const ClutterActorBox *box);
514 CLUTTER_AVAILABLE_IN_ALL
515 void             clutter_actor_box_free          (ClutterActorBox       *box);
516 CLUTTER_AVAILABLE_IN_ALL
517 gboolean         clutter_actor_box_equal         (const ClutterActorBox *box_a,
518                                                   const ClutterActorBox *box_b);
519 CLUTTER_AVAILABLE_IN_ALL
520 gfloat           clutter_actor_box_get_x         (const ClutterActorBox *box);
521 CLUTTER_AVAILABLE_IN_ALL
522 gfloat           clutter_actor_box_get_y         (const ClutterActorBox *box);
523 CLUTTER_AVAILABLE_IN_ALL
524 gfloat           clutter_actor_box_get_width     (const ClutterActorBox *box);
525 CLUTTER_AVAILABLE_IN_ALL
526 gfloat           clutter_actor_box_get_height    (const ClutterActorBox *box);
527 CLUTTER_AVAILABLE_IN_ALL
528 void             clutter_actor_box_get_origin    (const ClutterActorBox *box,
529                                                   gfloat                *x,
530                                                   gfloat                *y);
531 CLUTTER_AVAILABLE_IN_ALL
532 void             clutter_actor_box_get_size      (const ClutterActorBox *box,
533                                                   gfloat                *width,
534                                                   gfloat                *height);
535 CLUTTER_AVAILABLE_IN_ALL
536 gfloat           clutter_actor_box_get_area      (const ClutterActorBox *box);
537 CLUTTER_AVAILABLE_IN_ALL
538 gboolean         clutter_actor_box_contains      (const ClutterActorBox *box,
539                                                   gfloat                 x,
540                                                   gfloat                 y);
541 CLUTTER_AVAILABLE_IN_ALL
542 void             clutter_actor_box_from_vertices (ClutterActorBox       *box,
543                                                   const ClutterVertex    verts[]);
544 CLUTTER_AVAILABLE_IN_ALL
545 void             clutter_actor_box_interpolate   (const ClutterActorBox *initial,
546                                                   const ClutterActorBox *final,
547                                                   gdouble                progress,
548                                                   ClutterActorBox       *result);
549 CLUTTER_AVAILABLE_IN_ALL
550 void             clutter_actor_box_clamp_to_pixel (ClutterActorBox       *box);
551 CLUTTER_AVAILABLE_IN_ALL
552 void             clutter_actor_box_union          (const ClutterActorBox *a,
553                                                    const ClutterActorBox *b,
554                                                    ClutterActorBox       *result);
555 
556 CLUTTER_AVAILABLE_IN_ALL
557 void             clutter_actor_box_set_origin     (ClutterActorBox       *box,
558                                                    gfloat                 x,
559                                                    gfloat                 y);
560 CLUTTER_AVAILABLE_IN_ALL
561 void             clutter_actor_box_set_size       (ClutterActorBox       *box,
562                                                    gfloat                 width,
563                                                    gfloat                 height);
564 
565 /**
566  * ClutterGeometry:
567  * @x: X coordinate of the top left corner of an actor
568  * @y: Y coordinate of the top left corner of an actor
569  * @width: width of an actor
570  * @height: height of an actor
571  *
572  * The rectangle containing an actor's bounding box, measured in pixels.
573  *
574  * You should not use #ClutterGeometry, or operate on its fields
575  * directly; you should use #cairo_rectangle_int_t or #ClutterRect if you
576  * need a rectangle type, depending on the precision required.
577  *
578  * Deprecated: 1.16
579  */
580 struct _ClutterGeometry
581 {
582   /*< public >*/
583   gint   x;
584   gint   y;
585   guint  width;
586   guint  height;
587 };
588 
589 CLUTTER_AVAILABLE_IN_ALL
590 GType clutter_geometry_get_type (void) G_GNUC_CONST;
591 
592 CLUTTER_DEPRECATED_IN_1_16
593 void      clutter_geometry_union      (const ClutterGeometry *geometry_a,
594                                        const ClutterGeometry *geometry_b,
595                                        ClutterGeometry       *result);
596 CLUTTER_DEPRECATED_IN_1_16
597 gboolean  clutter_geometry_intersects (const ClutterGeometry *geometry0,
598                                        const ClutterGeometry *geometry1);
599 
600 /**
601  * ClutterKnot:
602  * @x: X coordinate of the knot
603  * @y: Y coordinate of the knot
604  *
605  * Point in a path behaviour.
606  *
607  * Since: 0.2
608  */
609 struct _ClutterKnot
610 {
611   gint x;
612   gint y;
613 };
614 
615 CLUTTER_AVAILABLE_IN_ALL
616 GType        clutter_knot_get_type (void) G_GNUC_CONST;
617 CLUTTER_AVAILABLE_IN_ALL
618 ClutterKnot *clutter_knot_copy     (const ClutterKnot *knot);
619 CLUTTER_AVAILABLE_IN_ALL
620 void         clutter_knot_free     (ClutterKnot       *knot);
621 CLUTTER_AVAILABLE_IN_ALL
622 gboolean     clutter_knot_equal    (const ClutterKnot *knot_a,
623                                     const ClutterKnot *knot_b);
624 
625 /**
626  * ClutterPathNode:
627  * @type: the node's type
628  * @points: the coordinates of the node
629  *
630  * Represents a single node of a #ClutterPath.
631  *
632  * Some of the coordinates in @points may be unused for some node
633  * types. %CLUTTER_PATH_MOVE_TO and %CLUTTER_PATH_LINE_TO use only one
634  * pair of coordinates, %CLUTTER_PATH_CURVE_TO uses all three and
635  * %CLUTTER_PATH_CLOSE uses none.
636  *
637  * Since: 1.0
638  */
639 struct _ClutterPathNode
640 {
641   ClutterPathNodeType type;
642 
643   ClutterKnot points[3];
644 };
645 
646 CLUTTER_AVAILABLE_IN_1_0
647 GType clutter_path_node_get_type (void) G_GNUC_CONST;
648 
649 CLUTTER_AVAILABLE_IN_1_0
650 ClutterPathNode *clutter_path_node_copy  (const ClutterPathNode *node);
651 CLUTTER_AVAILABLE_IN_1_0
652 void             clutter_path_node_free  (ClutterPathNode       *node);
653 CLUTTER_AVAILABLE_IN_1_0
654 gboolean         clutter_path_node_equal (const ClutterPathNode *node_a,
655                                           const ClutterPathNode *node_b);
656 
657 /*
658  * ClutterPaintVolume
659  */
660 
661 CLUTTER_AVAILABLE_IN_1_2
662 GType clutter_paint_volume_get_type (void) G_GNUC_CONST;
663 
664 CLUTTER_AVAILABLE_IN_1_2
665 ClutterPaintVolume *clutter_paint_volume_copy                (const ClutterPaintVolume *pv);
666 CLUTTER_AVAILABLE_IN_1_2
667 void                clutter_paint_volume_free                (ClutterPaintVolume       *pv);
668 
669 CLUTTER_AVAILABLE_IN_1_2
670 void                clutter_paint_volume_set_origin          (ClutterPaintVolume       *pv,
671                                                               const ClutterVertex      *origin);
672 CLUTTER_AVAILABLE_IN_1_2
673 void                clutter_paint_volume_get_origin          (const ClutterPaintVolume *pv,
674                                                               ClutterVertex            *vertex);
675 CLUTTER_AVAILABLE_IN_1_2
676 void                clutter_paint_volume_set_width           (ClutterPaintVolume       *pv,
677                                                               gfloat                    width);
678 CLUTTER_AVAILABLE_IN_1_2
679 gfloat              clutter_paint_volume_get_width           (const ClutterPaintVolume *pv);
680 CLUTTER_AVAILABLE_IN_1_2
681 void                clutter_paint_volume_set_height          (ClutterPaintVolume       *pv,
682                                                               gfloat                    height);
683 CLUTTER_AVAILABLE_IN_1_2
684 gfloat              clutter_paint_volume_get_height          (const ClutterPaintVolume *pv);
685 CLUTTER_AVAILABLE_IN_1_2
686 void                clutter_paint_volume_set_depth           (ClutterPaintVolume       *pv,
687                                                               gfloat                    depth);
688 CLUTTER_AVAILABLE_IN_1_2
689 gfloat              clutter_paint_volume_get_depth           (const ClutterPaintVolume *pv);
690 CLUTTER_AVAILABLE_IN_1_2
691 void                clutter_paint_volume_union               (ClutterPaintVolume       *pv,
692                                                               const ClutterPaintVolume *another_pv);
693 CLUTTER_AVAILABLE_IN_1_10
694 void                clutter_paint_volume_union_box           (ClutterPaintVolume       *pv,
695                                                               const ClutterActorBox    *box);
696 
697 CLUTTER_AVAILABLE_IN_1_2
698 gboolean            clutter_paint_volume_set_from_allocation (ClutterPaintVolume       *pv,
699                                                               ClutterActor             *actor);
700 
701 /**
702  * ClutterMargin:
703  * @left: the margin from the left
704  * @right: the margin from the right
705  * @top: the margin from the top
706  * @bottom: the margin from the bottom
707  *
708  * A representation of the components of a margin.
709  *
710  * Since: 1.10
711  */
712 struct _ClutterMargin
713 {
714   float left;
715   float right;
716   float top;
717   float bottom;
718 };
719 
720 CLUTTER_AVAILABLE_IN_1_10
721 GType clutter_margin_get_type (void) G_GNUC_CONST;
722 
723 CLUTTER_AVAILABLE_IN_1_10
724 ClutterMargin * clutter_margin_new      (void) G_GNUC_MALLOC;
725 CLUTTER_AVAILABLE_IN_1_10
726 ClutterMargin * clutter_margin_copy     (const ClutterMargin *margin_);
727 CLUTTER_AVAILABLE_IN_1_10
728 void            clutter_margin_free     (ClutterMargin       *margin_);
729 
730 /**
731  * ClutterProgressFunc:
732  * @a: the initial value of an interval
733  * @b: the final value of an interval
734  * @progress: the progress factor, between 0 and 1
735  * @retval: the value used to store the progress
736  *
737  * Prototype of the progress function used to compute the value
738  * between the two ends @a and @b of an interval depending on
739  * the value of @progress.
740  *
741  * The #GValue in @retval is already initialized with the same
742  * type as @a and @b.
743  *
744  * This function will be called by #ClutterInterval if the
745  * type of the values of the interval was registered using
746  * clutter_interval_register_progress_func().
747  *
748  * Return value: %TRUE if the function successfully computed
749  *   the value and stored it inside @retval
750  *
751  * Since: 1.0
752  */
753 typedef gboolean (* ClutterProgressFunc) (const GValue *a,
754                                           const GValue *b,
755                                           gdouble       progress,
756                                           GValue       *retval);
757 
758 CLUTTER_AVAILABLE_IN_1_0
759 void clutter_interval_register_progress_func (GType               value_type,
760                                               ClutterProgressFunc func);
761 
762 CLUTTER_AVAILABLE_IN_1_12
763 GType clutter_matrix_get_type (void) G_GNUC_CONST;
764 
765 CLUTTER_AVAILABLE_IN_1_12
766 ClutterMatrix * clutter_matrix_alloc            (void);
767 CLUTTER_AVAILABLE_IN_1_12
768 ClutterMatrix * clutter_matrix_init_identity    (ClutterMatrix       *matrix);
769 CLUTTER_AVAILABLE_IN_1_12
770 ClutterMatrix * clutter_matrix_init_from_array  (ClutterMatrix       *matrix,
771                                                  const float          values[16]);
772 CLUTTER_AVAILABLE_IN_1_12
773 ClutterMatrix * clutter_matrix_init_from_matrix (ClutterMatrix       *a,
774                                                  const ClutterMatrix *b);
775 CLUTTER_AVAILABLE_IN_1_12
776 void            clutter_matrix_free             (ClutterMatrix       *matrix);
777 
778 G_END_DECLS
779 
780 #endif /* __CLUTTER_TYPES_H__ */
781