Release Clutter 1.11.4 (snapshot)
[profile/ivi/clutter.git] / clutter / clutter-bezier.h
1 /*
2  * Clutter.
3  *
4  * An OpenGL based 'interactive canvas' library.
5  *
6  * Authored By Tomas Frydrych  <tf@openedhand.com>
7  *
8  * Copyright (C) 2006, 2007 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_BEZIER_H__
25 #define __CLUTTER_BEZIER_H__
26
27 #include <glib.h>
28 #include "clutter-types.h"
29
30 G_BEGIN_DECLS
31
32 /* This is used in _clutter_bezier_advance to represent the full
33    length of the bezier curve. Anything less than that represents a
34    fraction of the length */
35 #define CLUTTER_BEZIER_MAX_LENGTH (1 << 18)
36
37 typedef struct _ClutterBezier ClutterBezier;
38
39 ClutterBezier *_clutter_bezier_new ();
40
41 void           _clutter_bezier_free (ClutterBezier * b);
42
43 ClutterBezier *_clutter_bezier_clone_and_move (const ClutterBezier *b,
44                                                gint           x,
45                                                gint           y);
46
47 void           _clutter_bezier_advance (const ClutterBezier *b,
48                                         gint           L,
49                                         ClutterKnot   *knot);
50
51 void           _clutter_bezier_init (ClutterBezier *b,
52                                      gint x_0, gint y_0,
53                                      gint x_1, gint y_1,
54                                      gint x_2, gint y_2,
55                                      gint x_3, gint y_3);
56
57 void           _clutter_bezier_adjust (ClutterBezier *b,
58                                        ClutterKnot   *knot,
59                                        guint          indx);
60
61 guint          _clutter_bezier_get_length (const ClutterBezier *b);
62
63 G_END_DECLS
64
65 #endif /* __CLUTTER_BEZIER_H__ */