4 * An OpenGL based 'interactive canvas' library.
6 * Copyright (C) 2011 Intel Corporation.
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.
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.
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/>.
22 * Emmanuele Bassi <ebassi@linux.intel.com>
25 #ifndef __CLUTTER_PAINT_NODE_PRIVATE_H__
26 #define __CLUTTER_PAINT_NODE_PRIVATE_H__
28 #include <glib-object.h>
29 #include <json-glib/json-glib.h>
30 #include <clutter/clutter-paint-node.h>
34 #define CLUTTER_PAINT_NODE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_PAINT_NODE, ClutterPaintNodeClass))
35 #define CLUTTER_IS_PAINT_NODE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_PAINT_NODE))
36 #define CLUTTER_PAINT_NODE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_PAINT_NODE, ClutterPaintNodeClass))
38 typedef struct _ClutterPaintOperation ClutterPaintOperation;
40 struct _ClutterPaintNode
42 GTypeInstance parent_instance;
44 ClutterPaintNode *parent;
46 ClutterPaintNode *first_child;
47 ClutterPaintNode *prev_sibling;
48 ClutterPaintNode *next_sibling;
49 ClutterPaintNode *last_child;
57 volatile int ref_count;
60 struct _ClutterPaintNodeClass
62 GTypeClass base_class;
64 void (* finalize) (ClutterPaintNode *node);
66 gboolean (* pre_draw) (ClutterPaintNode *node);
67 void (* draw) (ClutterPaintNode *node);
68 void (* post_draw) (ClutterPaintNode *node);
70 JsonNode*(* serialize) (ClutterPaintNode *node);
73 #define PAINT_OP_INIT { PAINT_OP_INVALID }
82 struct _ClutterPaintOperation
91 CoglPrimitive *primitive;
95 GType _clutter_root_node_get_type (void) G_GNUC_CONST;
96 GType _clutter_transform_node_get_type (void) G_GNUC_CONST;
97 GType _clutter_dummy_node_get_type (void) G_GNUC_CONST;
99 void _clutter_paint_operation_paint_rectangle (const ClutterPaintOperation *op);
100 void _clutter_paint_operation_clip_rectangle (const ClutterPaintOperation *op);
101 void _clutter_paint_operation_paint_path (const ClutterPaintOperation *op);
102 void _clutter_paint_operation_clip_path (const ClutterPaintOperation *op);
103 void _clutter_paint_operation_paint_primitive (const ClutterPaintOperation *op);
105 void _clutter_paint_node_init_types (void);
106 gpointer _clutter_paint_node_create (GType gtype);
108 ClutterPaintNode * _clutter_root_node_new (CoglFramebuffer *framebuffer,
109 const ClutterColor *clear_color,
110 CoglBufferBit clear_flags,
111 const CoglMatrix *matrix);
112 ClutterPaintNode * _clutter_transform_node_new (const CoglMatrix *matrix);
113 ClutterPaintNode * _clutter_dummy_node_new (ClutterActor *actor);
115 void _clutter_paint_node_paint (ClutterPaintNode *root);
116 void _clutter_paint_node_dump_tree (ClutterPaintNode *root);
119 void clutter_paint_node_remove_child (ClutterPaintNode *node,
120 ClutterPaintNode *child);
122 void clutter_paint_node_replace_child (ClutterPaintNode *node,
123 ClutterPaintNode *old_child,
124 ClutterPaintNode *new_child);
126 void clutter_paint_node_remove_all (ClutterPaintNode *node);
129 guint clutter_paint_node_get_n_children (ClutterPaintNode *node);
132 ClutterPaintNode * clutter_paint_node_get_first_child (ClutterPaintNode *node);
134 ClutterPaintNode * clutter_paint_node_get_previous_sibling (ClutterPaintNode *node);
136 ClutterPaintNode * clutter_paint_node_get_next_sibling (ClutterPaintNode *node);
138 ClutterPaintNode * clutter_paint_node_get_last_child (ClutterPaintNode *node);
140 ClutterPaintNode * clutter_paint_node_get_parent (ClutterPaintNode *node);
142 #define CLUTTER_TYPE_LAYER_NODE (_clutter_layer_node_get_type ())
143 #define CLUTTER_LAYER_NODE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_LAYER_NODE, ClutterLayerNode))
144 #define CLUTTER_IS_LAYER_NODE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_LAYER_NODE))
149 * The <structname>ClutterLayerNode</structname> structure is an opaque
150 * type whose members cannot be directly accessed.
154 typedef struct _ClutterLayerNode ClutterLayerNode;
155 typedef struct _ClutterLayerNodeClass ClutterLayerNodeClass;
157 GType _clutter_layer_node_get_type (void) G_GNUC_CONST;
159 ClutterPaintNode * _clutter_layer_node_new (const CoglMatrix *projection,
160 const cairo_rectangle_t *viewport,
168 #endif /* __CLUTTER_PAINT_NODE_PRIVATE_H__ */