1 /*
2  * Clutter.
3  *
4  * An OpenGL based 'interactive canvas' library.
5  *
6  * Copyright (C) 2011  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 #ifndef __CLUTTER_PAINT_NODE_H__
26 #define __CLUTTER_PAINT_NODE_H__
27 
28 #if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
29 #error "Only <clutter/clutter.h> can be included directly."
30 #endif
31 
32 #include <cogl/cogl.h>
33 #include <clutter/clutter-types.h>
34 
35 G_BEGIN_DECLS
36 
37 #define CLUTTER_TYPE_PAINT_NODE                 (clutter_paint_node_get_type ())
38 #define CLUTTER_PAINT_NODE(obj)                 (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_PAINT_NODE, ClutterPaintNode))
39 #define CLUTTER_IS_PAINT_NODE(obj)              (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_PAINT_NODE))
40 
41 typedef struct _ClutterPaintNodePrivate ClutterPaintNodePrivate;
42 typedef struct _ClutterPaintNodeClass   ClutterPaintNodeClass;
43 
44 CLUTTER_AVAILABLE_IN_1_10
45 GType clutter_paint_node_get_type (void) G_GNUC_CONST;
46 
47 CLUTTER_AVAILABLE_IN_1_10
48 ClutterPaintNode *      clutter_paint_node_ref                          (ClutterPaintNode      *node);
49 CLUTTER_AVAILABLE_IN_1_10
50 void                    clutter_paint_node_unref                        (ClutterPaintNode      *node);
51 
52 CLUTTER_AVAILABLE_IN_1_10
53 void                    clutter_paint_node_set_name                     (ClutterPaintNode      *node,
54                                                                          const char            *name);
55 
56 CLUTTER_AVAILABLE_IN_1_10
57 void                    clutter_paint_node_add_child                    (ClutterPaintNode      *node,
58                                                                          ClutterPaintNode      *child);
59 CLUTTER_AVAILABLE_IN_1_10
60 void                    clutter_paint_node_add_rectangle                (ClutterPaintNode      *node,
61                                                                          const ClutterActorBox *rect);
62 CLUTTER_AVAILABLE_IN_1_10
63 void                    clutter_paint_node_add_texture_rectangle        (ClutterPaintNode      *node,
64                                                                          const ClutterActorBox *rect,
65                                                                          float                  x_1,
66                                                                          float                  y_1,
67                                                                          float                  x_2,
68                                                                          float                  y_2);
69 #if defined(COGL_ENABLE_EXPERIMENTAL_API) && defined(CLUTTER_ENABLE_EXPERIMENTAL_API)
70 CLUTTER_AVAILABLE_IN_1_10
71 void                    clutter_paint_node_add_path                     (ClutterPaintNode      *node,
72                                                                          CoglPath              *path);
73 CLUTTER_AVAILABLE_IN_1_10
74 void                    clutter_paint_node_add_primitive                (ClutterPaintNode      *node,
75                                                                          CoglPrimitive         *primitive);
76 #endif /* COGL_ENABLE_EXPERIMENTAL_API && CLUTTER_ENABLE_EXPERIMENTAL_API */
77 
78 /**
79  * CLUTTER_VALUE_HOLDS_PAINT_NODE:
80  * @value: a #GValue
81  *
82  * Evaluates to %TRUE if the @value has been initialized to hold
83  * a #ClutterPaintNode.
84  *
85  * Since: 1.10
86  */
87 #define CLUTTER_VALUE_HOLDS_PAINT_NODE(value)   (G_VALUE_HOLDS (value, CLUTTER_TYPE_PAINT_NODE))
88 
89 CLUTTER_AVAILABLE_IN_1_10
90 void                    clutter_value_set_paint_node                    (GValue                *value,
91                                                                          gpointer               node);
92 CLUTTER_AVAILABLE_IN_1_10
93 void                    clutter_value_take_paint_node                   (GValue                *value,
94                                                                          gpointer               node);
95 CLUTTER_AVAILABLE_IN_1_10
96 gpointer                clutter_value_get_paint_node                    (const GValue          *value);
97 CLUTTER_AVAILABLE_IN_1_10
98 gpointer                clutter_value_dup_paint_node                    (const GValue          *value);
99 
100 G_END_DECLS
101 
102 #endif /* __CLUTTER_PAINT_NODE_H__ */
103