Rename rsvg_acquire_node*() / rsvg_release_node() to rsvg_drawing_ctx_*_node() throughout

These operate on an RsvgDrawingCtx, so make their naming consistent
parent 4b084cd3
......@@ -2202,7 +2202,7 @@ rsvg_push_discrete_layer (RsvgDrawingCtx * ctx)
}
/*
* rsvg_acquire_node:
* rsvg_drawing_ctx_acquire_node:
* @ctx: The drawing context in use
* @url: The IRI to lookup, or %NULL
*
......@@ -2211,7 +2211,7 @@ rsvg_push_discrete_layer (RsvgDrawingCtx * ctx)
* infinite loops.
*
* Nodes acquired by this function must be released using
* rsvg_release_node() in reverse acquiring order.
* rsvg_drawing_ctx_release_node() in reverse acquiring order.
*
* Note that if you acquire a node, you have to release it before trying to
* acquire it again. If you acquire a node "#foo" and don't release it before
......@@ -2221,7 +2221,7 @@ rsvg_push_discrete_layer (RsvgDrawingCtx * ctx)
* is %NULL or it does not reference a node.
*/
RsvgNode *
rsvg_acquire_node (RsvgDrawingCtx * ctx, const char *url)
rsvg_drawing_ctx_acquire_node (RsvgDrawingCtx * ctx, const char *url)
{
RsvgNode *node;
......@@ -2241,7 +2241,7 @@ rsvg_acquire_node (RsvgDrawingCtx * ctx, const char *url)
}
/**
* rsvg_acquire_node_of_type:
* rsvg_drawing_ctx_acquire_node_of_type:
* @ctx: The drawing context in use
* @url: The IRI to lookup
* @type: Type which the node must have
......@@ -2254,7 +2254,7 @@ rsvg_acquire_node (RsvgDrawingCtx * ctx, const char *url)
* the object referenced by the IRI is not a marker.
*
* Nodes acquired by this function must be released using
* rsvg_release_node() in reverse acquiring order.
* rsvg_drawing_ctx_release_node() in reverse acquiring order.
*
* Note that if you acquire a node, you have to release it before trying to
* acquire it again. If you acquire a node "#foo" and don't release it before
......@@ -2265,13 +2265,13 @@ rsvg_acquire_node (RsvgDrawingCtx * ctx, const char *url)
* the node referenced by @url is not of the specified @type.
*/
RsvgNode *
rsvg_acquire_node_of_type (RsvgDrawingCtx * ctx, const char *url, RsvgNodeType type)
rsvg_drawing_ctx_acquire_node_of_type (RsvgDrawingCtx * ctx, const char *url, RsvgNodeType type)
{
RsvgNode *node;
node = rsvg_acquire_node (ctx, url);
node = rsvg_drawing_ctx_acquire_node (ctx, url);
if (node == NULL || rsvg_node_type (node) != type) {
rsvg_release_node (ctx, node);
rsvg_drawing_ctx_release_node (ctx, node);
return NULL;
}
......@@ -2279,17 +2279,17 @@ rsvg_acquire_node_of_type (RsvgDrawingCtx * ctx, const char *url, RsvgNodeType t
}
/*
* rsvg_release_node:
* rsvg_drawing_ctx_release_node:
* @ctx: The drawing context the node was acquired from
* @node: Node to release
*
* Releases a node previously acquired via rsvg_acquire_node() or
* rsvg_acquire_node_of_type().
* Releases a node previously acquired via rsvg_drawing_ctx_acquire_node() or
* rsvg_drawing_ctx_acquire_node_of_type().
*
* if @node is %NULL, this function does nothing.
*/
void
rsvg_release_node (RsvgDrawingCtx * ctx, RsvgNode *node)
rsvg_drawing_ctx_release_node (RsvgDrawingCtx * ctx, RsvgNode *node)
{
if (node == NULL)
return;
......
......@@ -451,7 +451,7 @@ _set_source_rsvg_paint_server (RsvgDrawingCtx * ctx,
switch (ps->type) {
case RSVG_PAINT_SERVER_IRI:
node = rsvg_acquire_node (ctx, ps->core.iri);
node = rsvg_drawing_ctx_acquire_node (ctx, ps->core.iri);
if (node == NULL)
break;
else if (rsvg_node_type (node) == RSVG_NODE_TYPE_LINEAR_GRADIENT)
......@@ -461,7 +461,7 @@ _set_source_rsvg_paint_server (RsvgDrawingCtx * ctx,
else if (rsvg_node_type (node) == RSVG_NODE_TYPE_PATTERN)
_set_source_rsvg_pattern (ctx, (RsvgPattern *) node, opacity, bbox);
rsvg_release_node (ctx, node);
rsvg_drawing_ctx_release_node (ctx, node);
break;
case RSVG_PAINT_SERVER_SOLID:
_set_source_rsvg_solid_color (ctx, ps->core.color, opacity, current_color);
......@@ -852,7 +852,7 @@ rsvg_cairo_push_render_stack (RsvgDrawingCtx * ctx)
if (rsvg_current_state (ctx)->clip_path) {
RsvgNode *node;
node = rsvg_acquire_node_of_type (ctx, rsvg_current_state (ctx)->clip_path, RSVG_NODE_TYPE_CLIP_PATH);
node = rsvg_drawing_ctx_acquire_node_of_type (ctx, rsvg_current_state (ctx)->clip_path, RSVG_NODE_TYPE_CLIP_PATH);
if (node) {
RsvgClipPath *clip_path = (RsvgClipPath *) node;
......@@ -869,7 +869,7 @@ rsvg_cairo_push_render_stack (RsvgDrawingCtx * ctx)
break;
}
rsvg_release_node (ctx, node);
rsvg_drawing_ctx_release_node (ctx, node);
}
}
......@@ -930,11 +930,11 @@ rsvg_cairo_pop_render_stack (RsvgDrawingCtx * ctx)
if (rsvg_current_state (ctx)->clip_path) {
RsvgNode *node;
node = rsvg_acquire_node_of_type (ctx, rsvg_current_state (ctx)->clip_path, RSVG_NODE_TYPE_CLIP_PATH);
node = rsvg_drawing_ctx_acquire_node_of_type (ctx, rsvg_current_state (ctx)->clip_path, RSVG_NODE_TYPE_CLIP_PATH);
if (node && ((RsvgClipPath *) node)->units == objectBoundingBox)
lateclip = (RsvgClipPath *) node;
else
rsvg_release_node (ctx, node);
rsvg_drawing_ctx_release_node (ctx, node);
}
if (state->opacity == 0xFF
......@@ -951,11 +951,11 @@ rsvg_cairo_pop_render_stack (RsvgDrawingCtx * ctx)
output = render->surfaces_stack->data;
render->surfaces_stack = g_list_delete_link (render->surfaces_stack, render->surfaces_stack);
filter = rsvg_acquire_node_of_type (ctx, state->filter, RSVG_NODE_TYPE_FILTER);
filter = rsvg_drawing_ctx_acquire_node_of_type (ctx, state->filter, RSVG_NODE_TYPE_FILTER);
if (filter) {
needs_destroy = TRUE;
surface = rsvg_filter_render ((RsvgFilter *) filter, output, ctx, &render->bbox, "2103");
rsvg_release_node (ctx, filter);
rsvg_drawing_ctx_release_node (ctx, filter);
/* Don't destroy the output surface, it's owned by child_cr */
}
......@@ -972,7 +972,7 @@ rsvg_cairo_pop_render_stack (RsvgDrawingCtx * ctx)
if (lateclip) {
rsvg_cairo_clip (ctx, lateclip, &render->bbox);
rsvg_release_node (ctx, (RsvgNode *) lateclip);
rsvg_drawing_ctx_release_node (ctx, (RsvgNode *) lateclip);
}
cairo_set_operator (render->cr, state->comp_op);
......@@ -980,10 +980,10 @@ rsvg_cairo_pop_render_stack (RsvgDrawingCtx * ctx)
if (state->mask) {
RsvgNode *mask;
mask = rsvg_acquire_node_of_type (ctx, state->mask, RSVG_NODE_TYPE_MASK);
mask = rsvg_drawing_ctx_acquire_node_of_type (ctx, state->mask, RSVG_NODE_TYPE_MASK);
if (mask) {
rsvg_cairo_generate_mask (render->cr, (RsvgMask *) mask, ctx, &render->bbox);
rsvg_release_node (ctx, mask);
rsvg_drawing_ctx_release_node (ctx, mask);
}
} else if (state->opacity != 0xFF)
cairo_paint_with_alpha (render->cr, (double) state->opacity / 255.0);
......
......@@ -3778,7 +3778,7 @@ rsvg_filter_primitive_image_render_in (RsvgFilterPrimitive * self, RsvgFilterCon
if (!upself->href)
return NULL;
drawable = rsvg_acquire_node (ctx, upself->href->str);
drawable = rsvg_drawing_ctx_acquire_node (ctx, upself->href->str);
if (!drawable)
return NULL;
......@@ -3786,7 +3786,7 @@ rsvg_filter_primitive_image_render_in (RsvgFilterPrimitive * self, RsvgFilterCon
result = rsvg_get_surface_of_node (ctx, drawable, context->width, context->height);
rsvg_release_node (ctx, drawable);
rsvg_drawing_ctx_release_node (ctx, drawable);
return result;
}
......
......@@ -126,7 +126,7 @@ rsvg_marker_render (const char * marker_name, gdouble xpos, gdouble ypos, gdoubl
gdouble rotation;
RsvgState *state = rsvg_current_state (ctx);
self = (RsvgMarker *) rsvg_acquire_node_of_type (ctx, marker_name, RSVG_NODE_TYPE_MARKER);
self = (RsvgMarker *) rsvg_drawing_ctx_acquire_node_of_type (ctx, marker_name, RSVG_NODE_TYPE_MARKER);
if (self == NULL)
return;
......@@ -200,5 +200,5 @@ rsvg_marker_render (const char * marker_name, gdouble xpos, gdouble ypos, gdoubl
if (self->vbox.active)
rsvg_drawing_ctx_pop_view_box (ctx);
rsvg_release_node (ctx, (RsvgNode *) self);
rsvg_drawing_ctx_release_node (ctx, (RsvgNode *) self);
}
......@@ -502,14 +502,14 @@ resolve_fallbacks (RsvgDrawingCtx *ctx,
fallback_id = get_fallback (last_fallback);
if (fallback_id == NULL)
return;
fallback = rsvg_acquire_node (ctx, fallback_id);
fallback = rsvg_drawing_ctx_acquire_node (ctx, fallback_id);
if (fallback == NULL)
return;
apply_fallback (data, fallback);
resolve_fallbacks (ctx, data, fallback, get_fallback, apply_fallback);
rsvg_release_node (ctx, fallback);
rsvg_drawing_ctx_release_node (ctx, fallback);
}
static const char *
......
......@@ -386,16 +386,19 @@ G_GNUC_INTERNAL
gboolean rsvg_eval_switch_attributes (RsvgPropertyBag * atts, gboolean * p_has_cond);
G_GNUC_INTERNAL
gchar *rsvg_get_base_uri_from_filename (const gchar * file_name);
G_GNUC_INTERNAL
void rsvg_pop_discrete_layer (RsvgDrawingCtx * ctx);
G_GNUC_INTERNAL
void rsvg_push_discrete_layer (RsvgDrawingCtx * ctx);
G_GNUC_INTERNAL
RsvgNode *rsvg_acquire_node (RsvgDrawingCtx * ctx, const char *url);
RsvgNode *rsvg_drawing_ctx_acquire_node (RsvgDrawingCtx * ctx, const char *url);
G_GNUC_INTERNAL
RsvgNode *rsvg_acquire_node_of_type (RsvgDrawingCtx * ctx, const char *url, RsvgNodeType type);
RsvgNode *rsvg_drawing_ctx_acquire_node_of_type (RsvgDrawingCtx * ctx, const char *url, RsvgNodeType type);
G_GNUC_INTERNAL
void rsvg_release_node (RsvgDrawingCtx * ctx, RsvgNode *node);
void rsvg_drawing_ctx_release_node (RsvgDrawingCtx * ctx, RsvgNode *node);
G_GNUC_INTERNAL
void rsvg_render_path_builder (RsvgDrawingCtx * ctx, RsvgPathBuilder *builder);
G_GNUC_INTERNAL
......
......@@ -180,11 +180,11 @@ rsvg_node_use_draw (RsvgNode * self, RsvgDrawingCtx * ctx, int dominate)
if (use->link == NULL)
return;
child = rsvg_acquire_node (ctx, use->link);
child = rsvg_drawing_ctx_acquire_node (ctx, use->link);
if (!child)
return;
else if (rsvg_node_is_ancestor (child, self)) { /* or, if we're <use>'ing ourself */
rsvg_release_node (ctx, child);
rsvg_drawing_ctx_release_node (ctx, child);
return;
}
......@@ -235,7 +235,7 @@ rsvg_node_use_draw (RsvgNode * self, RsvgDrawingCtx * ctx, int dominate)
rsvg_drawing_ctx_pop_view_box (ctx);
}
rsvg_release_node (ctx, child);
rsvg_drawing_ctx_release_node (ctx, child);
}
static void
......
......@@ -482,14 +482,14 @@ _rsvg_node_text_type_tref (RsvgNodeTref * self, RsvgDrawingCtx * ctx,
if (self->link == NULL)
return;
link = rsvg_acquire_node (ctx, self->link);
link = rsvg_drawing_ctx_acquire_node (ctx, self->link);
if (link == NULL)
return;
_rsvg_node_text_type_children (link, ctx, x, y, lastwasspace,
TRUE);
rsvg_release_node (ctx, link);
rsvg_drawing_ctx_release_node (ctx, link);
}
static gboolean
......@@ -501,13 +501,13 @@ _rsvg_node_text_length_tref (RsvgNodeTref * self, RsvgDrawingCtx * ctx, gdouble
if (self->link == NULL)
return FALSE;
link = rsvg_acquire_node (ctx, self->link);
link = rsvg_drawing_ctx_acquire_node (ctx, self->link);
if (link == NULL)
return FALSE;
result = _rsvg_node_text_length_children (link, ctx, x, lastwasspace, TRUE);
rsvg_release_node (ctx, link);
rsvg_drawing_ctx_release_node (ctx, link);
return result;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment