4 * An object oriented GL/GLES Abstraction/Utility Layer
6 * Copyright (C) 2008,2009,2010 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
20 * <http://www.gnu.org/licenses/>.
25 * Robert Bragg <robert@linux.intel.com>
28 #ifndef __COGL_NODE_PRIVATE_H
29 #define __COGL_NODE_PRIVATE_H
31 #include "cogl-object-private.h"
32 #include "cogl-queue.h"
34 typedef struct _CoglNode CoglNode;
36 COGL_LIST_HEAD (CoglNodeList, CoglNode);
38 /* Pipelines and layers represent their state in a tree structure where
39 * some of the state relating to a given pipeline or layer may actually
40 * be owned by one if is ancestors in the tree. We have a common data
41 * type to track the tree heirachy so we can share code... */
44 /* the parent in terms of class hierarchy, so anything inheriting
45 * from CoglNode also inherits from CoglObject. */
48 /* The parent pipeline/layer */
51 /* The list entry here contains pointers to the node's siblings */
52 COGL_LIST_ENTRY (CoglNode) list_node;
54 /* List of children */
55 CoglNodeList children;
57 /* TRUE if the node took a strong reference on its parent. Weak
58 * pipelines for instance don't take a reference on their parent. */
59 gboolean has_parent_reference;
62 #define COGL_NODE(X) ((CoglNode *)(X))
65 _cogl_pipeline_node_init (CoglNode *node);
67 typedef void (*CoglNodeUnparentVFunc) (CoglNode *node);
70 _cogl_pipeline_node_set_parent_real (CoglNode *node,
72 CoglNodeUnparentVFunc unparent,
73 gboolean take_strong_reference);
76 _cogl_pipeline_node_unparent_real (CoglNode *node);
78 typedef gboolean (*CoglNodeChildCallback) (CoglNode *child, void *user_data);
81 _cogl_pipeline_node_foreach_child (CoglNode *node,
82 CoglNodeChildCallback callback,
85 #endif /* __COGL_NODE_PRIVATE_H */