paint-nodes: Make part of the API internal

At least for the time being, we only expose the parts of the API that we
want to use internally and for new, out-of-tree Content implementations.

The full PaintNode tree API will be made public in 1.12 once we branch
master.
This commit is contained in:
Emmanuele Bassi 2012-03-16 11:57:34 +00:00
parent 74f5bbe5aa
commit 8904f7cbe4
7 changed files with 78 additions and 86 deletions

View File

@ -101,7 +101,7 @@ void _clutter_paint_operation_clip_path (const C
void _clutter_paint_operation_paint_primitive (const ClutterPaintOperation *op);
void _clutter_paint_node_init_types (void);
gpointer _clutter_paint_node_internal (GType gtype);
gpointer _clutter_paint_node_create (GType gtype);
ClutterPaintNode * _clutter_root_node_new (CoglFramebuffer *framebuffer,
const ClutterColor *clear_color,
@ -113,6 +113,54 @@ ClutterPaintNode * _clutter_dummy_node_new (void);
void _clutter_paint_node_paint (ClutterPaintNode *root);
void _clutter_paint_node_dump_tree (ClutterPaintNode *root);
G_GNUC_INTERNAL
void clutter_paint_node_remove_child (ClutterPaintNode *node,
ClutterPaintNode *child);
G_GNUC_INTERNAL
void clutter_paint_node_replace_child (ClutterPaintNode *node,
ClutterPaintNode *old_child,
ClutterPaintNode *new_child);
G_GNUC_INTERNAL
void clutter_paint_node_remove_all (ClutterPaintNode *node);
G_GNUC_INTERNAL
guint clutter_paint_node_get_n_children (ClutterPaintNode *node);
G_GNUC_INTERNAL
ClutterPaintNode * clutter_paint_node_get_first_child (ClutterPaintNode *node);
G_GNUC_INTERNAL
ClutterPaintNode * clutter_paint_node_get_previous_sibling (ClutterPaintNode *node);
G_GNUC_INTERNAL
ClutterPaintNode * clutter_paint_node_get_next_sibling (ClutterPaintNode *node);
G_GNUC_INTERNAL
ClutterPaintNode * clutter_paint_node_get_last_child (ClutterPaintNode *node);
G_GNUC_INTERNAL
ClutterPaintNode * clutter_paint_node_get_parent (ClutterPaintNode *node);
#define CLUTTER_TYPE_LAYER_NODE (_clutter_layer_node_get_type ())
#define CLUTTER_LAYER_NODE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_LAYER_NODE, ClutterLayerNode))
#define CLUTTER_IS_LAYER_NODE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_LAYER_NODE))
/*
* ClutterLayerNode:
*
* The <structname>ClutterLayerNode</structname> structure is an opaque
* type whose members cannot be directly accessed.
*
* Since: 1.10
*/
typedef struct _ClutterLayerNode ClutterLayerNode;
typedef struct _ClutterLayerNodeClass ClutterLayerNodeClass;
GType _clutter_layer_node_get_type (void) G_GNUC_CONST;
ClutterPaintNode * _clutter_layer_node_new (const CoglMatrix *projection,
const cairo_rectangle_t *viewport,
float width,
float height,
guint8 opacity);
G_END_DECLS
#endif /* __CLUTTER_PAINT_NODE_PRIVATE_H__ */

View File

@ -1105,8 +1105,17 @@ _clutter_paint_node_dump_tree (ClutterPaintNode *node)
#endif /* CLUTTER_ENABLE_DEBUG */
}
/*< private >
* _clutter_paint_node_create:
* @gtype: a #ClutterPaintNode type
*
* Creates a new #ClutterPaintNode instance using @gtype
*
* Return value: (transfer full): the newly created #ClutterPaintNode
* sub-class instance; use clutter_paint_node_unref() when done
*/
gpointer
_clutter_paint_node_internal (GType gtype)
_clutter_paint_node_create (GType gtype)
{
g_return_val_if_fail (g_type_is_a (gtype, CLUTTER_TYPE_PAINT_NODE), NULL);

View File

@ -51,21 +51,6 @@ void clutter_paint_node_set_name (Clutter
void clutter_paint_node_add_child (ClutterPaintNode *node,
ClutterPaintNode *child);
void clutter_paint_node_remove_child (ClutterPaintNode *node,
ClutterPaintNode *child);
void clutter_paint_node_replace_child (ClutterPaintNode *node,
ClutterPaintNode *old_child,
ClutterPaintNode *new_child);
void clutter_paint_node_remove_all (ClutterPaintNode *node);
guint clutter_paint_node_get_n_children (ClutterPaintNode *node);
ClutterPaintNode * clutter_paint_node_get_first_child (ClutterPaintNode *node);
ClutterPaintNode * clutter_paint_node_get_previous_sibling (ClutterPaintNode *node);
ClutterPaintNode * clutter_paint_node_get_next_sibling (ClutterPaintNode *node);
ClutterPaintNode * clutter_paint_node_get_last_child (ClutterPaintNode *node);
ClutterPaintNode * clutter_paint_node_get_parent (ClutterPaintNode *node);
void clutter_paint_node_add_rectangle (ClutterPaintNode *node,
const ClutterActorBox *rect);
void clutter_paint_node_add_texture_rectangle (ClutterPaintNode *node,

View File

@ -165,7 +165,7 @@ _clutter_root_node_new (CoglFramebuffer *framebuffer,
{
ClutterRootNode *res;
res = _clutter_paint_node_internal (_clutter_root_node_get_type ());
res = _clutter_paint_node_create (_clutter_root_node_get_type ());
cogl_color_init_from_4ub (&res->clear_color,
clear_color->red,
@ -242,7 +242,7 @@ _clutter_transform_node_new (const CoglMatrix *modelview)
{
ClutterTransformNode *res;
res = _clutter_paint_node_internal (_clutter_transform_node_get_type ());
res = _clutter_paint_node_create (_clutter_transform_node_get_type ());
if (modelview != NULL)
res->modelview = *modelview;
@ -291,7 +291,7 @@ clutter_dummy_node_init (ClutterDummyNode *self)
ClutterPaintNode *
_clutter_dummy_node_new (void)
{
return _clutter_paint_node_internal (_clutter_dummy_node_get_type ());
return _clutter_paint_node_create (_clutter_dummy_node_get_type ());
}
/*
@ -474,7 +474,7 @@ clutter_pipeline_node_new (CoglPipeline *pipeline)
g_return_val_if_fail (pipeline == NULL || cogl_is_pipeline (pipeline), NULL);
res = _clutter_paint_node_internal (CLUTTER_TYPE_PIPELINE_NODE);
res = _clutter_paint_node_create (CLUTTER_TYPE_PIPELINE_NODE);
if (pipeline != NULL)
res->pipeline = cogl_object_ref (pipeline);
@ -546,7 +546,7 @@ clutter_color_node_new (const ClutterColor *color)
{
ClutterPipelineNode *cnode;
cnode = _clutter_paint_node_internal (CLUTTER_TYPE_COLOR_NODE);
cnode = _clutter_paint_node_create (CLUTTER_TYPE_COLOR_NODE);
if (color != NULL)
{
@ -658,7 +658,7 @@ clutter_texture_node_new (CoglTexture *texture,
g_return_val_if_fail (cogl_is_texture (texture), NULL);
tnode = _clutter_paint_node_internal (CLUTTER_TYPE_TEXTURE_NODE);
tnode = _clutter_paint_node_create (CLUTTER_TYPE_TEXTURE_NODE);
cogl_pipeline_set_layer_texture (tnode->pipeline, 0, texture);
@ -856,7 +856,7 @@ clutter_text_node_new (PangoLayout *layout,
g_return_val_if_fail (layout == NULL || PANGO_IS_LAYOUT (layout), NULL);
res = _clutter_paint_node_internal (CLUTTER_TYPE_TEXT_NODE);
res = _clutter_paint_node_create (CLUTTER_TYPE_TEXT_NODE);
if (layout != NULL)
res->layout = g_object_ref (layout);
@ -991,13 +991,15 @@ clutter_clip_node_init (ClutterClipNode *self)
ClutterPaintNode *
clutter_clip_node_new (void)
{
return _clutter_paint_node_internal (CLUTTER_TYPE_CLIP_NODE);
return _clutter_paint_node_create (CLUTTER_TYPE_CLIP_NODE);
}
/*
* ClutterLayerNode
* ClutterLayerNode (private)
*/
#define clutter_layer_node_get_type _clutter_layer_node_get_type
struct _ClutterLayerNode
{
ClutterPaintNode parent_instance;
@ -1152,7 +1154,7 @@ clutter_layer_node_init (ClutterLayerNode *self)
cogl_matrix_init_identity (&self->projection);
}
/**
/*
* clutter_layer_node_new:
* @projection: the projection matrix to use to set up the layer
* @viewport: (type cairo.Rectangle): the viewport to use to set up the layer
@ -1172,16 +1174,16 @@ clutter_layer_node_init (ClutterLayerNode *self)
* Since: 1.10
*/
ClutterPaintNode *
clutter_layer_node_new (const CoglMatrix *projection,
const cairo_rectangle_t *viewport,
float width,
float height,
guint8 opacity)
_clutter_layer_node_new (const CoglMatrix *projection,
const cairo_rectangle_t *viewport,
float width,
float height,
guint8 opacity)
{
ClutterLayerNode *res;
CoglColor color;
res = _clutter_paint_node_internal (CLUTTER_TYPE_LAYER_NODE);
res = _clutter_paint_node_create (CLUTTER_TYPE_LAYER_NODE);
res->projection = *projection;
res->viewport = *viewport;
@ -1203,7 +1205,7 @@ clutter_layer_node_new (const CoglMatrix *projection,
cogl_object_unref (res->texture);
res->texture = NULL;
goto out;;
goto out;
}
cogl_color_init_from_4ub (&color, opacity, opacity, opacity, opacity);

View File

@ -135,29 +135,6 @@ GType clutter_text_node_get_type (void) G_GNUC_CONST;
ClutterPaintNode * clutter_text_node_new (PangoLayout *layout,
const ClutterColor *color);
#define CLUTTER_TYPE_LAYER_NODE (clutter_layer_node_get_type ())
#define CLUTTER_LAYER_NODE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_LAYER_NODE, ClutterLayerNode))
#define CLUTTER_IS_LAYER_NODE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_LAYER_NODE))
/**
* ClutterLayerNode:
*
* The <structname>ClutterLayerNode</structname> structure is an opaque
* type whose members cannot be directly accessed.
*
* Since: 1.10
*/
typedef struct _ClutterLayerNode ClutterLayerNode;
typedef struct _ClutterLayerNodeClass ClutterLayerNodeClass;
GType clutter_layer_node_get_type (void) G_GNUC_CONST;
ClutterPaintNode * clutter_layer_node_new (const CoglMatrix *projection,
const cairo_rectangle_t *viewport,
float width,
float height,
guint8 opacity);
G_END_DECLS
#endif /* __CLUTTER_PAINT_NODES_H__ */

View File

@ -792,8 +792,6 @@ clutter_knot_copy
clutter_knot_equal
clutter_knot_free
clutter_knot_get_type
clutter_layer_node_get_type
clutter_layer_node_new
clutter_layout_meta_get_manager
clutter_layout_meta_get_type
clutter_layout_manager_allocate
@ -907,17 +905,8 @@ clutter_paint_node_add_path
clutter_paint_node_add_primitive
clutter_paint_node_add_rectangle
clutter_paint_node_add_texture_rectangle
clutter_paint_node_get_first_child
clutter_paint_node_get_last_child
clutter_paint_node_get_n_children
clutter_paint_node_get_next_sibling
clutter_paint_node_get_parent
clutter_paint_node_get_previous_sibling
clutter_paint_node_get_type
clutter_paint_node_ref
clutter_paint_node_remove_all
clutter_paint_node_remove_child
clutter_paint_node_replace_child
clutter_paint_node_set_name
clutter_paint_node_unref
clutter_path_add_cairo_path

View File

@ -3046,16 +3046,6 @@ clutter_paint_node_unref
clutter_paint_node_set_name
<SUBSECTION>
clutter_paint_node_add_child
clutter_paint_node_remove_child
clutter_paint_node_replace_child
clutter_paint_node_remove_all
clutter_paint_node_get_n_children
<SUBSECTION>
clutter_paint_node_get_first_child
clutter_paint_node_get_next_sibling
clutter_paint_node_get_previous_sibling
clutter_paint_node_get_last_child
clutter_paint_node_get_parent
<SUBSECTION>
clutter_paint_node_add_rectangle
clutter_paint_node_add_texture_rectangle
@ -3097,36 +3087,28 @@ clutter_text_node_new
ClutterClipNode
ClutterClipNodeClass
clutter_clip_node_new
<SUBSECTION>
ClutterLayerNode
ClutterLayerNodeClass
clutter_layer_node_new
<SUBSECTION Standard>
CLUTTER_TYPE_COLOR_NODE
CLUTTER_TYPE_TEXTURE_NODE
CLUTTER_TYPE_PIPELINE_NODE
CLUTTER_TYPE_TEXT_NODE
CLUTTER_TYPE_CLIP_NODE
CLUTTER_TYPE_LAYER_NODE
CLUTTER_COLOR_NODE
CLUTTER_TEXTURE_NODE
CLUTTER_PIPELINE_NODE
CLUTTER_TEXT_NODE
CLUTTER_CLIP_NODE
CLUTTER_LAYER_NODE
CLUTTER_IS_COLOR_NODE
CLUTTER_IS_TEXTURE_NODE
CLUTTER_IS_PIPELINE_NODE
CLUTTER_IS_TEXT_NODE
CLUTTER_IS_CLIP_NODE
CLUTTER_IS_LAYER_NODE
<SUBSECTION Private>
clutter_color_node_get_type
clutter_texture_node_get_type
clutter_pipeline_node_get_type
clutter_text_node_get_type
clutter_clip_node_get_type
clutter_layer_node_get_type
</SECTION>
<SECTION>