Release Clutter 1.11.4 (snapshot)
[profile/ivi/clutter.git] / clutter / clutter-canvas.h
1 /*
2  * Clutter.
3  *
4  * An OpenGL based 'interactive canvas' library.
5  *
6  * Copyright (C) 2012  Intel Corporation.
7  *
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.
12  *
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.
17  *
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/>.
20  *
21  * Author:
22  *   Emmanuele Bassi <ebassi@linux.intel.com>
23  */
24
25 #if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
26 #error "Only <clutter/clutter.h> can be included directly."
27 #endif
28
29 #ifndef __CLUTTER_CANVAS_H__
30 #define __CLUTTER_CANVAS_H__
31
32 #include <clutter/clutter-types.h>
33
34 G_BEGIN_DECLS
35
36 #define CLUTTER_TYPE_CANVAS             (clutter_canvas_get_type ())
37 #define CLUTTER_CANVAS(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_CANVAS, ClutterCanvas))
38 #define CLUTTER_IS_CANVAS(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_CANVAS))
39 #define CLUTTER_CANVAS_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_CANVAS, ClutterCanvasClass))
40 #define CLUTTER_IS_CANVAS_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_CANVAS))
41 #define CLUTTER_CANVAS_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_CANVAS, ClutterCanvasClass))
42
43 typedef struct _ClutterCanvas           ClutterCanvas;
44 typedef struct _ClutterCanvasPrivate    ClutterCanvasPrivate;
45 typedef struct _ClutterCanvasClass      ClutterCanvasClass;
46
47 /**
48  * ClutterCanvas:
49  *
50  * The <structname>ClutterCanvas</structname> structure contains
51  * private data and should only be accessed using the provided
52  * API.
53  *
54  * Since: 1.10
55  */
56 struct _ClutterCanvas
57 {
58   /*< private >*/
59   GObject parent_instance;
60
61   ClutterCanvasPrivate *priv;
62 };
63
64 /**
65  * ClutterCanvasClass:
66  * @draw: class handler for the #ClutterCanvas::draw signal
67  *
68  * The <structname>ClutterCanvasClass</structname> structure contains
69  * private data.
70  *
71  * Since: 1.10
72  */
73 struct _ClutterCanvasClass
74 {
75   /*< private >*/
76   GObjectClass parent_class;
77
78   /*< public >*/
79   gboolean (* draw) (ClutterCanvas *canvas,
80                      cairo_t       *cr,
81                      int            width,
82                      int            height);
83
84   /*< private >*/
85   gpointer _padding[16];
86 };
87
88 CLUTTER_AVAILABLE_IN_1_10
89 GType clutter_canvas_get_type (void) G_GNUC_CONST;
90
91 CLUTTER_AVAILABLE_IN_1_10
92 ClutterContent *        clutter_canvas_new              (void);
93 CLUTTER_AVAILABLE_IN_1_10
94 void                    clutter_canvas_set_size         (ClutterCanvas *canvas,
95                                                          int            width,
96                                                          int            height);
97
98 G_END_DECLS
99
100 #endif /* __CLUTTER_CANVAS_H__ */