Commit d19b22f8 authored by Caleb Michael Moore's avatar Caleb Michael Moore

DOM stuff

parent a5eeb4cf
2005-05-15 Caleb Moore <c.moore@student.unsw.edu.au>
* everwhere: misc movement towards a DOM interface
2005-03-16 Caleb Moore <c.moore@student.unsw.edu.au>
* everywhere: we no longer have RsvgDef* we have RsvgNode*
......
......@@ -133,7 +133,7 @@ rsvg_art_clip_path_render (RsvgClipPath * self, RsvgDrawingCtx *ctx)
for (i = 0; i < group->children->len; i++)
{
rsvg_node_drawable_draw (g_ptr_array_index(group->children, i),
rsvg_node_draw (g_ptr_array_index(group->children, i),
ctx, 0);
}
......@@ -166,7 +166,7 @@ rsvg_art_mask_render (RsvgMask *self, GdkPixbuf *tos, GdkPixbuf *nos, RsvgDrawin
((RsvgArtRender *)ctx->render)->pixbuf = mask;
rsvg_state_push(ctx);
rsvg_node_drawable_draw (drawable, ctx, 0);
rsvg_node_draw (drawable, ctx, 0);
rsvg_state_pop(ctx);
((RsvgArtRender *)ctx->render)->pixbuf = save;
......
......@@ -489,9 +489,9 @@ rsvg_art_paint_server_pattern_render (RsvgPattern *pattern, ArtRender *ar,
if (((RsvgNodeGroup *)drawable)->children->len ||
pattern->gfallback == NULL)
rsvg_node_drawable_draw (drawable, hctx, 2);
rsvg_node_draw (drawable, hctx, 2);
else
rsvg_node_drawable_draw ((RsvgNode *)pattern->gfallback, hctx, 2);
rsvg_node_draw ((RsvgNode *)pattern->gfallback, hctx, 2);
rsvg_state_pop(ctx->ctx);
......
......@@ -56,7 +56,7 @@ rsvg_defs_new (void)
RsvgDefs *result = g_new (RsvgDefs, 1);
result->hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
result->externs = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
result->externs = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify)rsvg_handle_free);
result->unnamed = g_ptr_array_new ();
result->base_uri = NULL;
result->toresolve = NULL;
......@@ -150,7 +150,19 @@ rsvg_defs_set (RsvgDefs *defs, const char *name, RsvgNode *val)
else if (name[0] == '\0')
;
else
g_hash_table_insert (defs->hash, g_strdup (name), val);
rsvg_defs_register_name(defs, name, val);
rsvg_defs_register_memory(defs, val);
}
void
rsvg_defs_register_name (RsvgDefs *defs, const char *name, RsvgNode *val)
{
g_hash_table_insert (defs->hash, g_strdup (name), val);
}
void
rsvg_defs_register_memory (RsvgDefs *defs, RsvgNode *val)
{
g_ptr_array_add(defs->unnamed, val);
}
......@@ -165,6 +177,8 @@ rsvg_defs_free (RsvgDefs *defs)
((RsvgNode *)g_ptr_array_index(defs->unnamed, i))->free(g_ptr_array_index(defs->unnamed, i));
g_ptr_array_free(defs->unnamed, TRUE);
g_hash_table_destroy (defs->externs);
g_free (defs);
}
......
......@@ -54,6 +54,12 @@ rsvg_defs_add_resolver(RsvgDefs *defs, RsvgNode ** tochange,
void
rsvg_defs_resolve_all(RsvgDefs *defs);
void
rsvg_defs_register_name (RsvgDefs *defs, const char *name, RsvgNode *val);
void
rsvg_defs_register_memory (RsvgDefs *defs, RsvgNode *val);
G_END_DECLS
#endif
This diff is collapsed.
......@@ -45,7 +45,7 @@ struct _RsvgFilter {
void
rsvg_filter_render (RsvgFilter *self, GdkPixbuf *source, GdkPixbuf *output, GdkPixbuf *bg, RsvgDrawingCtx *context);
void
RsvgNode *
rsvg_start_filter (RsvgHandle *ctx, RsvgPropertyBag *atts);
void
......@@ -54,69 +54,69 @@ rsvg_end_filter (RsvgHandle *ctx);
RsvgFilter *
rsvg_filter_parse (const RsvgDefs *defs, const char *str);
void
RsvgNode *
rsvg_start_filter_primitive_blend (RsvgHandle *ctx, RsvgPropertyBag *atts);
void
RsvgNode *
rsvg_start_filter_primitive_convolve_matrix (RsvgHandle *ctx, RsvgPropertyBag *atts);
void
RsvgNode *
rsvg_start_filter_primitive_gaussian_blur (RsvgHandle *ctx, RsvgPropertyBag *atts);
void
RsvgNode *
rsvg_start_filter_primitive_offset (RsvgHandle *ctx, RsvgPropertyBag *atts);
void
RsvgNode *
rsvg_start_filter_primitive_merge (RsvgHandle *ctx, RsvgPropertyBag *atts);
void
void
rsvg_start_filter_primitive_merge_node (RsvgHandle *ctx, RsvgPropertyBag *atts);
void
RsvgNode *
rsvg_start_filter_primitive_colour_matrix (RsvgHandle *ctx, RsvgPropertyBag *atts);
void
RsvgNode *
rsvg_start_filter_primitive_component_transfer (RsvgHandle * ctx,
RsvgPropertyBag * atts);
void
void
rsvg_start_filter_primitive_component_transfer_function (RsvgHandle * ctx,
RsvgPropertyBag * atts, char channel);
void
RsvgNode *
rsvg_start_filter_primitive_erode (RsvgHandle * ctx,
RsvgPropertyBag * atts);
void
RsvgNode *
rsvg_start_filter_primitive_composite (RsvgHandle * ctx, RsvgPropertyBag * atts);
void
RsvgNode *
rsvg_start_filter_primitive_flood (RsvgHandle * ctx,
RsvgPropertyBag * atts);
void
RsvgNode *
rsvg_start_filter_primitive_displacement_map (RsvgHandle * ctx, RsvgPropertyBag * atts);
void
RsvgNode *
rsvg_start_filter_primitive_turbulence (RsvgHandle * ctx, RsvgPropertyBag * atts);
void
RsvgNode *
rsvg_start_filter_primitive_image (RsvgHandle * ctx, RsvgPropertyBag * atts);
void
RsvgNode *
rsvg_start_filter_primitive_diffuse_lighting (RsvgHandle * ctx, RsvgPropertyBag * atts);
void
void
rsvg_start_filter_primitive_light_source (RsvgHandle * ctx,
RsvgPropertyBag * atts, char type);
void
RsvgNode *
rsvg_start_filter_primitive_specular_lighting (RsvgHandle * ctx, RsvgPropertyBag * atts);
void
RsvgNode *
rsvg_start_filter_primitive_tile (RsvgHandle * ctx, RsvgPropertyBag * atts);
void
void
rsvg_filter_adobe_blend(gint modenum, GdkPixbuf *in, GdkPixbuf *bg, GdkPixbuf *output,
RsvgDrawingCtx * ctx);
......
......@@ -491,7 +491,7 @@ rsvg_preserve_aspect_ratio(unsigned int aspect_ratio, double width,
}
static void
rsvg_node_drawable_image_free (RsvgNode * self)
rsvg_node_image_free (RsvgNode * self)
{
RsvgNodeImage *z = (RsvgNodeImage *)self;
rsvg_state_finalize (z->super.state);
......@@ -501,7 +501,7 @@ rsvg_node_drawable_image_free (RsvgNode * self)
}
static void
rsvg_node_drawable_image_draw (RsvgNode * self, RsvgDrawingCtx *ctx,
rsvg_node_image_draw (RsvgNode * self, RsvgDrawingCtx *ctx,
int dominate)
{
RsvgNodeImage *z = (RsvgNodeImage *)self;
......@@ -593,13 +593,12 @@ rsvg_start_image (RsvgHandle *ctx, RsvgPropertyBag *atts)
image->overflow = overflow;
image->super.state = state;
image->super.type = RSVG_NODE_PATH;
image->super.free = rsvg_node_drawable_image_free;
image->super.draw = rsvg_node_drawable_image_draw;
image->super.free = rsvg_node_image_free;
image->super.draw = rsvg_node_image_draw;
rsvg_defs_set (ctx->defs, id, &image->super);
image->super.parent = (RsvgNode *)ctx->current_defs_group;
image->super.parent = (RsvgNode *)ctx->currentnode;
if (image->super.parent != NULL)
rsvg_node_drawable_group_pack((RsvgNodeGroup *)image->super.parent,
&image->super);
rsvg_node_group_pack(image->super.parent, &image->super);
}
......@@ -248,7 +248,7 @@ rsvg_marker_render (RsvgMarker *self, gdouble x, gdouble y, gdouble orient, gdou
state->affine[i] = affine[i];
}
rsvg_node_drawable_draw (self->contents, ctx, 3);
rsvg_node_draw (self->contents, ctx, 3);
rsvg_state_pop(ctx);
}
......
......@@ -39,7 +39,7 @@ rsvg_mask_free (RsvgNode * self)
}
static void
rsvg_node_drawable_mask_draw (RsvgNode * self, RsvgDrawingCtx *ctx,
rsvg_node_mask_draw (RsvgNode * self, RsvgDrawingCtx *ctx,
int dominate)
{
RsvgNodeGroup *group = (RsvgNodeGroup*)self;
......@@ -53,7 +53,7 @@ rsvg_node_drawable_mask_draw (RsvgNode * self, RsvgDrawingCtx *ctx,
{
rsvg_state_push(ctx);
rsvg_node_drawable_draw (g_ptr_array_index(group->children, i),
rsvg_node_draw (g_ptr_array_index(group->children, i),
ctx, 0);
rsvg_state_pop(ctx);
......@@ -77,7 +77,10 @@ rsvg_new_mask (void)
mask->height = 1;
mask->super.super.state = g_new(RsvgState, 1);
mask->super.children = g_ptr_array_new ();
mask->super.super.type = RSVG_NODE_MASK;
mask->super.super.free = rsvg_mask_free;
mask->super.super.draw = rsvg_node_mask_draw;
mask->super.super.add_child = rsvg_node_group_add_child;
return mask;
}
......@@ -141,14 +144,9 @@ rsvg_start_mask (RsvgHandle *ctx, RsvgPropertyBag *atts)
rsvg_state_init(mask->super.super.state);
rsvg_parse_style_attrs (ctx, mask->super.super.state, "mask", klazz, id, atts);
mask->super.super.parent = (RsvgNode *)ctx->current_defs_group;
mask->super.super.parent = (RsvgNode *)ctx->currentnode;
ctx->current_defs_group = &mask->super;
/* set up the defval stuff */
mask->super.super.type = RSVG_NODE_MASK;
mask->super.super.free = &rsvg_mask_free;
mask->super.super.draw = &rsvg_node_drawable_mask_draw;
ctx->currentnode = &mask->super.super;
rsvg_defs_set (ctx->defs, id, &mask->super.super);
}
......@@ -156,7 +154,7 @@ rsvg_start_mask (RsvgHandle *ctx, RsvgPropertyBag *atts)
void
rsvg_end_mask (RsvgHandle *ctx)
{
ctx->current_defs_group = ((RsvgNode *)ctx->current_defs_group)->parent;
ctx->currentnode = ((RsvgNode *)ctx->currentnode)->parent;
}
RsvgNode *
......@@ -208,6 +206,9 @@ rsvg_new_clip_path (void)
clip_path->super.children = g_ptr_array_new ();
clip_path->units = userSpaceOnUse;
clip_path->super.super.state = g_new(RsvgState, 1);
clip_path->super.super.type = RSVG_NODE_CLIP_PATH;
clip_path->super.super.free = rsvg_clip_path_free;
clip_path->super.super.add_child = rsvg_node_group_add_child;
return clip_path;
}
......@@ -240,20 +241,18 @@ rsvg_start_clip_path (RsvgHandle *ctx, RsvgPropertyBag *atts)
rsvg_parse_style_attrs (ctx, clip_path->super.super.state, "clipPath", klazz, id, atts);
clip_path->super.super.parent = (RsvgNode *)ctx->current_defs_group;
clip_path->super.super.parent = (RsvgNode *)ctx->currentnode;
ctx->current_defs_group = &clip_path->super;
ctx->currentnode = &clip_path->super.super;
/* set up the defval stuff */
clip_path->super.super.type = RSVG_NODE_CLIP_PATH;
clip_path->super.super.free = &rsvg_clip_path_free;
rsvg_defs_set (ctx->defs, id, &clip_path->super.super);
}
void
rsvg_end_clip_path (RsvgHandle *ctx)
{
ctx->current_defs_group = ((RsvgNode *)ctx->current_defs_group)->parent;
ctx->currentnode = ((RsvgNode *)ctx->currentnode)->parent;
}
RsvgNode *
......
......@@ -83,7 +83,7 @@ struct RsvgHandle {
RsvgDefs *defs;
guint nest_level;
void *current_defs_group;
RsvgNode *currentnode;
/* this is the root level of the displayable tree, essentially what the
file is converted into at the end */
void *treebase;
......@@ -116,9 +116,6 @@ struct RsvgHandle {
gboolean finished;
void * currentfilter;
void * currentsubfilter;
gboolean first_write;
gboolean is_gzipped;
void * gzipped_data; /* really a GsfOutput */
......@@ -191,6 +188,7 @@ typedef enum {
RSVG_NODE_PATTERN,
RSVG_NODE_PATH,
RSVG_NODE_FILTER,
RSVG_NODE_FILTER_PRIMITIVE,
RSVG_NODE_MASK,
RSVG_NODE_MARKER,
RSVG_NODE_SYMBOL,
......@@ -200,8 +198,9 @@ typedef enum {
struct _RsvgNode {
RsvgNodeType type;
RsvgState * state;
void (*free) (RsvgNode *self);
RsvgNode * parent;
void (*add_child) (RsvgNode *self, RsvgNode *child);
void (*free) (RsvgNode *self);
void (*draw) (RsvgNode * self, RsvgDrawingCtx *ctx, int dominate);
};
......
......@@ -39,7 +39,7 @@
#define RSVG_ARC_MAGIC ((double) 0.5522847498)
static void
rsvg_node_drawable_path_free (RsvgNode *self)
rsvg_node_ath_free (RsvgNode *self)
{
RsvgNodePath *z = (RsvgNodePath *)self;
rsvg_state_finalize (z->super.state);
......@@ -49,15 +49,14 @@ rsvg_node_drawable_path_free (RsvgNode *self)
}
static void
rsvg_node_drawable_path_draw (RsvgNode * self, RsvgDrawingCtx *ctx,
rsvg_node_ath_draw (RsvgNode * self, RsvgDrawingCtx *ctx,
int dominate)
{
RsvgNodePath *path = (RsvgNodePath*)self;
rsvg_state_reinherit_top(ctx, self->state, dominate);
rsvg_render_path (ctx, path->d);
rsvg_render_path (ctx, path->d);
}
void
......@@ -70,14 +69,14 @@ rsvg_handle_path (RsvgHandle *ctx, const char * d, const char * id, RsvgState st
path->super.state = g_new(RsvgState, 1);
*path->super.state = state;
path->super.type = RSVG_NODE_PATH;
path->super.free = rsvg_node_drawable_path_free;
path->super.draw = rsvg_node_drawable_path_draw;
path->super.free = rsvg_node_ath_free;
path->super.draw = rsvg_node_ath_draw;
rsvg_defs_set (ctx->defs, id, &path->super);
path->super.parent = (RsvgNode *)ctx->current_defs_group;
path->super.parent = (RsvgNode *)ctx->currentnode;
if (path->super.parent != NULL)
rsvg_node_drawable_group_pack((RsvgNodeGroup *)path->super.parent,
&path->super);
rsvg_node_group_pack(path->super.parent,
&path->super);
}
void
......
......@@ -3,8 +3,8 @@
rsvg-structure.c: Rsvg's structual elements
Copyright (C) 2000 Eazel, Inc.
Copyright (C) 2002, 2003, 2004, 2005 Dom Lachowicz <cinamod@hotmail.com>
Copyright (C) 2003, 2004, 2005 Caleb Moore <c.moore@student.unsw.edu.au>
Copyright (C) 2002 - 2005 Dom Lachowicz <cinamod@hotmail.com>
Copyright (C) 2003 - 2005 Caleb Moore <c.moore@student.unsw.edu.au>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
......@@ -33,7 +33,7 @@
#include <stdio.h>
void
rsvg_node_drawable_draw (RsvgNode * self, RsvgDrawingCtx *ctx,
rsvg_node_draw (RsvgNode * self, RsvgDrawingCtx *ctx,
int dominate)
{
RsvgState *state;
......@@ -73,7 +73,7 @@ rsvg_end_g (RsvgHandle *ctx)
}
static void
rsvg_node_drawable_group_draw (RsvgNode * self, RsvgDrawingCtx *ctx,
rsvg_node_group_draw (RsvgNode * self, RsvgDrawingCtx *ctx,
int dominate)
{
RsvgNodeGroup *group = (RsvgNodeGroup*)self;
......@@ -86,7 +86,7 @@ rsvg_node_drawable_group_draw (RsvgNode * self, RsvgDrawingCtx *ctx,
for (i = 0; i < group->children->len; i++)
{
rsvg_state_push(ctx);
rsvg_node_drawable_draw (g_ptr_array_index(group->children, i),
rsvg_node_draw (g_ptr_array_index(group->children, i),
ctx, 0);
rsvg_state_pop(ctx);
}
......@@ -95,7 +95,7 @@ rsvg_node_drawable_group_draw (RsvgNode * self, RsvgDrawingCtx *ctx,
}
static void
rsvg_node_drawable_group_free (RsvgNode *self)
rsvg_node_group_free (RsvgNode *self)
{
RsvgNodeGroup *z = (RsvgNodeGroup *)self;
rsvg_state_finalize (z->super.state);
......@@ -104,68 +104,93 @@ rsvg_node_drawable_group_free (RsvgNode *self)
g_free (z);
}
/* exported for group derived things... hopefully group derived things
shouldn't be used for much longer */
void
rsvg_node_group_add_child (RsvgNode *overself, RsvgNode *child)
{
RsvgNodeGroup *self = (RsvgNodeGroup *)overself;
if (self == NULL)
return;
g_ptr_array_add(self->children, child);
}
RsvgNode *
rsvg_push_def_group (RsvgHandle *ctx, const char * id,
RsvgState *state)
{
RsvgNode * group;
RsvgNodeGroup *group;
group = rsvg_push_part_def_group (ctx, id, state);
group = g_new (RsvgNodeGroup, 1);
group->children = g_ptr_array_new();
group->super.state = g_new(RsvgState, 1);
*group->super.state = *state;
if (group->parent != NULL)
rsvg_node_drawable_group_pack((RsvgNodeGroup *)group->parent,
group);
group->super.type = RSVG_NODE_PATH;
group->super.free = rsvg_node_group_free;
group->super.add_child = rsvg_node_group_add_child;
group->super.draw = rsvg_node_group_draw;
return group;
}
rsvg_defs_set (ctx->defs, id, &group->super);
void
rsvg_pop_def_group (RsvgHandle *ctx)
{
RsvgNodeGroup * group;
group->super.parent = (RsvgNode *)ctx->currentnode;
group = (RsvgNodeGroup *)ctx->current_defs_group;
if (group == NULL)
return;
ctx->current_defs_group = group->super.parent;
ctx->currentnode = &group->super;
}
if (group->super.parent != NULL)
rsvg_node_group_pack(group->super.parent,
&group->super);
void
rsvg_node_drawable_group_pack (RsvgNodeGroup *self, RsvgNode *child)
{
if (self == NULL)
return;
g_ptr_array_add(self->children, child);
return &group->super;
}
/* warning: takes ownership of @tempstate */
RsvgNode *
rsvg_push_part_def_group (RsvgHandle *ctx, const char * id,
RsvgState * tempstate)
RsvgState *state)
{
RsvgNodeGroup *group;
group = g_new (RsvgNodeGroup, 1);
group->children = g_ptr_array_new();
group->super.state = g_new(RsvgState, 1);
*group->super.state = *tempstate;
*group->super.state = *state;
group->super.type = RSVG_NODE_PATH;
group->super.free = rsvg_node_drawable_group_free;
group->super.draw = rsvg_node_drawable_group_draw;
group->super.free = rsvg_node_group_free;
group->super.draw = rsvg_node_group_draw;
group->super.add_child = rsvg_node_group_add_child;
rsvg_defs_set (ctx->defs, id, &group->super);
group->super.parent = (RsvgNode *)ctx->current_defs_group;
group->super.parent = (RsvgNode *)ctx->currentnode;
ctx->current_defs_group = group;
ctx->currentnode = &group->super;
return &group->super;
}
void
rsvg_pop_def_group (RsvgHandle *ctx)
{
RsvgNodeGroup * group;
group = (RsvgNodeGroup *)ctx->currentnode;
if (group == NULL)
return;
ctx->currentnode = group->super.parent;
}
void
rsvg_node_group_pack (RsvgNode *self, RsvgNode *child)
{
self->add_child(self, child);
child->parent = self;
}
static RsvgNode *
rsvg_node_drawable_use_resolve(RsvgNodeUse * self, RsvgDrawingCtx *ctx, double * affine_out)
rsvg_node_use_resolve(RsvgNodeUse * self, RsvgDrawingCtx *ctx, double * affine_out)
{
double affine[6];
double x, y, width, height;
......@@ -222,7 +247,7 @@ rsvg_node_drawable_use_resolve(RsvgNodeUse * self, RsvgDrawingCtx *ctx, double *
}
static void
rsvg_node_drawable_use_draw (RsvgNode * self, RsvgDrawingCtx *ctx,
rsvg_node_use_draw (RsvgNode * self, RsvgDrawingCtx *ctx,
int dominate)
{
RsvgNodeUse *use = (RsvgNodeUse*)self;
......@@ -230,7 +255,7 @@ rsvg_node_drawable_use_draw (RsvgNode * self, RsvgDrawingCtx *ctx,
rsvg_state_reinherit_top(ctx, self->state, dominate);
child = rsvg_node_drawable_use_resolve(use, ctx, rsvg_state_current(ctx)->affine);
child = rsvg_node_use_resolve(use, ctx, rsvg_state_current(ctx)->affine);
/* If it can find nothing to draw... draw nothing */
if (!use->link)
......@@ -240,7 +265,7 @@ rsvg_node_drawable_use_draw (RsvgNode * self, RsvgDrawingCtx *ctx,
rsvg_state_push(ctx);
rsvg_node_drawable_draw (child, ctx, 1);
rsvg_node_draw (child, ctx, 1);
rsvg_state_pop(ctx);
......@@ -248,7 +273,7 @@ rsvg_node_drawable_use_draw (RsvgNode * self, RsvgDrawingCtx *ctx,
}
static void
rsvg_node_drawable_use_free (RsvgNode *self)
rsvg_node_use_free (RsvgNode *self)
{
RsvgNodeUse *z = (RsvgNodeUse *)self;
rsvg_state_finalize (z->super.state);
......@@ -257,7 +282,7 @@ rsvg_node_drawable_use_free (RsvgNode *self)
}
static void
rsvg_node_drawable_svg_draw (RsvgNode * self, RsvgDrawingCtx *ctx,
rsvg_node_svg_draw (RsvgNode * self, RsvgDrawingCtx *ctx,
int dominate)
{
RsvgNodeSvg * sself;
......@@ -303,7 +328,7 @@ rsvg_node_drawable_svg_draw (RsvgNode * self, RsvgDrawingCtx *ctx,
{
rsvg_state_push(ctx);
rsvg_node_drawable_draw (g_ptr_array_index(group->children, i),
rsvg_node_draw (g_ptr_array_index(group->children, i),
ctx, 0);
rsvg_state_pop(ctx);
......@@ -313,7 +338,7 @@ rsvg_node_drawable_svg_draw (RsvgNode * self, RsvgDrawingCtx *ctx,
}
static void
rsvg_node_drawable_svg_free (RsvgNode *self)
rsvg_node_svg_free (RsvgNode *self)
{
RsvgNodeGroup *z = (RsvgNodeGroup *)self;
rsvg_state_finalize (z->super.state);
......@@ -388,18 +413,18 @@ rsvg_start_svg (RsvgHandle *ctx, RsvgPropertyBag *atts)
*group->super.state = state;
group->super.type = RSVG_NODE_PATH;
group->super.free = rsvg_node_drawable_svg_free;
group->super.draw = rsvg_node_drawable_svg_draw;
group->super.free = rsvg_node_svg_free;
group->super.draw = rsvg_node_svg_draw;
group->super.add_child = rsvg_node_group_add_child;
rsvg_defs_set (ctx->defs, id, &group->super);
group->super.parent = (RsvgNode *)ctx->current_defs_group;
group->super.parent = (RsvgNode *)ctx->currentnode;
ctx->current_defs_group = group;
ctx->currentnode = &group->super;
if (group->super.parent != NULL)
rsvg_node_drawable_group_pack((RsvgNodeGroup *)group->super.parent,
&group->super);
rsvg_node_group_pack(group->super.parent, &group->super);
if (!ctx->nest_level)
ctx->treebase = group;
......@@ -459,8 +484,8 @@ rsvg_start_use (RsvgHandle *ctx, RsvgPropertyBag *atts)
use->super.state = g_new(RsvgState, 1);
*use->super.state = state;
use->super.type = RSVG_NODE_PATH;
use->super.free = rsvg_node_drawable_use_free;
use->super.draw = rsvg_node_drawable_use_draw;
use->super.free = rsvg_node_use_free;
use->super.draw = rsvg_node_use_draw;
use->x = x;
use->y = y;
use->w = width;
......@@ -469,14 +494,13 @@ rsvg_start_use (RsvgHandle *ctx, RsvgPropertyBag *atts)
rsvg_defs_add_resolver (ctx->defs, &use->link, xlink_href);
rsvg_defs_set (ctx->defs, id, &use->super);
use->super.parent = (RsvgNode *)ctx->current_defs_group;
use->super.parent = (RsvgNode *)ctx->currentnode;
if (use->super.parent != NULL)
rsvg_node_drawable_group_pack((RsvgNodeGroup *)use->super.parent,
&use->super);
rsvg_node_group_pack(use->super.parent, &use->super);
}
static void
rsvg_node_drawable_symbol_free (RsvgNode *self)
rsvg_node_symbol_free (RsvgNode *self)
{
RsvgNodeGroup *z = (RsvgNodeGroup *)self;
rsvg_state_finalize (z->super.state);
......@@ -486,7 +510,7 @@ rsvg_node_drawable_symbol_free (RsvgNode *self)
}
static void
rsvg_node_drawable_symbol_draw (RsvgNode * self, RsvgDrawingCtx *ctx,
rsvg_node_symbol_draw (RsvgNode * self, RsvgDrawingCtx *ctx,
int dominate)
{
RsvgNodeSymbol * sself;
......@@ -509,7 +533,7 @@ rsvg_node_drawable_symbol_draw (RsvgNode * self, RsvgDrawingCtx *ctx,
{
rsvg_state_push(ctx);
rsvg_node_drawable_draw (g_ptr_array_index(group->children, i),
rsvg_node_draw (g_ptr_array_index(group->children, i),
ctx, 0);
rsvg_state_pop(ctx);
......@@ -564,14 +588,15 @@ rsvg_start_symbol(RsvgHandle *ctx, RsvgPropertyBag *atts)
group->super.state = g_new(RsvgState, 1);
*group->super.state = state;
group->super.type = RSVG_NODE_SYMBOL;
group->super.free = rsvg_node_drawable_symbol_free;
group->super.draw = rsvg_node_drawable_symbol_draw;
group->super.free = rsvg_node_symbol_free;
group->super.draw = rsvg_node_symbol_draw;
group->super.add_child = rsvg_node_group_add_child;
rsvg_defs_set (ctx->defs, id, &group->super);
group->super.parent = (RsvgNode *)ctx->current_defs_group;
group->super.parent = (RsvgNode *)ctx->currentnode;
ctx->current_defs_group = group;
ctx->currentnode = &group->super;
}
void
......@@ -597,7 +622,7 @@ rsvg_start_defs (RsvgHandle *ctx, RsvgPropertyBag *atts)
}
static void
_rsvg_node_drawable_switch_draw (RsvgNode * self, RsvgDrawingCtx *ctx,
_rsvg_node_switch_draw (RsvgNode * self, RsvgDrawingCtx *ctx,
int dominate)
{
RsvgNodeGroup *group = (RsvgNodeGroup*)self;
......@@ -613,7 +638,7 @@ _rsvg_node_drawable_switch_draw (RsvgNode * self, RsvgDrawingCtx *ctx,
if (drawable->state->cond_true) {
rsvg_state_push(ctx);
rsvg_node_drawable_draw (g_ptr_array_index(group->children, i),
rsvg_node_draw (g_ptr_array_index(group->children, i),
ctx, 0);
rsvg_state_pop(ctx);
......@@ -644,7 +669,7 @@ rsvg_start_switch (RsvgHandle *ctx, RsvgPropertyBag *atts)
}