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

fixed use problems

parent a3613bf3
2005-05-17 Caleb Moore <c.moore@student.unsw.edu.au>
* rsvg_structure.c: Fixed a problem with <use> not working.
2005-05-17 Caleb Moore <c.moore@student.unsw.edu.au>
* A_whole_bunch_o'_files: Did a bit of fiddling. Now Children are stored in the RsvgNode structure, since DOM seems to mandate that everything be able to have children. I shall get rid of virtual functions for adding children soon.
......
......@@ -615,18 +615,6 @@ rsvg_new_filter (void)
return &filter->super;
}
/**
* rsvg_end_filter: Create a filter from xml arguments.
* @ctx: the current rsvg handle
*
* Ends the current filter block by setting the currentfilter ot null
**/
void
rsvg_end_filter (RsvgHandle * ctx)
{
ctx->currentnode = ctx->currentnode->parent;
}
/*************************************************************/
/*************************************************************/
......
......@@ -47,9 +47,6 @@ rsvg_filter_render (RsvgFilter *self, GdkPixbuf *source, GdkPixbuf *output, GdkP
RsvgNode *
rsvg_new_filter (void);
void
rsvg_end_filter (RsvgHandle *ctx);
RsvgFilter *
rsvg_filter_parse (const RsvgDefs *defs, const char *str);
......
......@@ -113,12 +113,6 @@ rsvg_new_mask (void)
return &mask->super;
}
void
rsvg_end_mask (RsvgHandle *ctx)
{
ctx->currentnode = ((RsvgNode *)ctx->currentnode)->parent;
}
RsvgNode *
rsvg_mask_parse (const RsvgDefs * defs, const char *str)
{
......@@ -199,12 +193,6 @@ rsvg_new_clip_path (void)
return &clip_path->super;
}
void
rsvg_end_clip_path (RsvgHandle *ctx)
{
ctx->currentnode = ((RsvgNode *)ctx->currentnode)->parent;
}
RsvgNode *
rsvg_clip_path_parse (const RsvgDefs * defs, const char *str)
{
......
......@@ -47,9 +47,6 @@ struct _RsvgMask {
RsvgNode *
rsvg_new_mask (void);
void
rsvg_end_mask (RsvgHandle *ctx);
RsvgNode *
rsvg_mask_parse (const RsvgDefs * defs, const char *str);
......@@ -63,9 +60,6 @@ struct _RsvgClipPath {
RsvgNode *
rsvg_new_clip_path (void);
void
rsvg_end_clip_path (RsvgHandle *ctx);
RsvgNode *
rsvg_clip_path_parse (const RsvgDefs * defs, const char *str);
......
......@@ -110,12 +110,6 @@ rsvg_node_group_set_atts (RsvgNode * self, RsvgHandle *ctx, RsvgPropertyBag *att
}
}
void
rsvg_end_g (RsvgHandle *ctx)
{
rsvg_pop_def_group (ctx);
}
RsvgNode *
rsvg_new_group (void)
{
......@@ -186,13 +180,6 @@ rsvg_node_use_resolve(RsvgNodeUse * self, RsvgDrawingCtx *ctx, double * affine_o
if (parent != NULL)
switch(parent->type)
{
case RSVG_NODE_PATH:
{
_rsvg_affine_translate(affine, x, y);
_rsvg_affine_multiply(affine_out, affine, affine_out);
return (RsvgNode *)parent;
}
case RSVG_NODE_SYMBOL:
{
RsvgNode *drawable =
......@@ -223,7 +210,11 @@ rsvg_node_use_resolve(RsvgNodeUse * self, RsvgDrawingCtx *ctx, double * affine_o
return drawable;
}
default:
break;
{
_rsvg_affine_translate(affine, x, y);
_rsvg_affine_multiply(affine_out, affine, affine_out);
return (RsvgNode *)parent;
}
}
return NULL;
}
......@@ -235,9 +226,6 @@ rsvg_node_use_draw (RsvgNode * self, RsvgDrawingCtx *ctx,
RsvgNodeUse *use = (RsvgNodeUse*)self;
RsvgNode * child;
if (use->w <= 0 || use->h <= 0)
return;
rsvg_state_reinherit_top(ctx, self->state, dominate);
child = rsvg_node_use_resolve(use, ctx, rsvg_state_current(ctx)->affine);
......@@ -391,13 +379,6 @@ rsvg_new_svg (void)
return &svg->super;
}
void
rsvg_end_svg(RsvgHandle *ctx)
{
ctx->nest_level--;
rsvg_pop_def_group (ctx);
}
static void
rsvg_node_use_set_atts (RsvgNode * self, RsvgHandle *ctx, RsvgPropertyBag *atts)
{
......@@ -601,9 +582,3 @@ rsvg_new_switch (void)
group->super.set_atts = rsvg_node_group_set_atts;
return &group->super;
}
void
rsvg_end_switch (RsvgHandle *ctx)
{
rsvg_pop_def_group (ctx);
}
......@@ -41,9 +41,6 @@ RsvgNode * rsvg_new_svg (void);
RsvgNode * rsvg_new_defs (void);
RsvgNode * rsvg_new_group (void);
RsvgNode * rsvg_new_switch (void);
void rsvg_end_g (RsvgHandle *ctx);
void rsvg_end_svg (RsvgHandle *ctx);
void rsvg_end_switch (RsvgHandle *ctx);
typedef struct _RsvgNodeGroup RsvgNodeGroup;
typedef struct _RsvgNodeUse RsvgNodeUse;
......
......@@ -578,36 +578,26 @@ rsvg_end_element (void *data, const xmlChar *name)
ctx->handler = NULL;
}
if (!strcmp ((char *)name, "g"))
rsvg_end_g (ctx);
else if (!strcmp ((char *)name, "a")) /*treat anchors as groups for now*/
rsvg_end_g (ctx);
else if (!strcmp ((char *)name, "svg"))
rsvg_end_svg (ctx);
else if (!strcmp ((char *)name, "symbol"))
rsvg_end_g (ctx);
else if (!strcmp ((char *)name, "use"))
rsvg_end_g (ctx);
else if (!strcmp ((char *)name, "filter"))
rsvg_end_filter (ctx);
else if (!strcmp ((char *)name, "defs"))
rsvg_end_g (ctx);
else if (!strcmp ((char *)name, "mask"))
rsvg_end_mask(ctx);
else if (!strcmp ((char *)name, "clipPath"))
rsvg_end_clip_path(ctx);
else if (!strcmp ((char *)name, "marker"))
rsvg_end_filter(ctx);
else if (!strcmp ((char *)name, "switch"))
rsvg_end_filter (ctx); /* treat switches as groups for now */
else if (!strcmp ((char *)name, "pattern"))
rsvg_pop_def_group(ctx);
else if (!strcmp ((char *)name, "image") ||
!strcmp ((char *)name, "use"))
rsvg_end_filter(ctx);
if (!strcmp ((char *)name, "image") ||
!strcmp ((char *)name, "use") ||
!strcmp ((char *)name, "switch") ||
!strcmp ((char *)name, "marker") ||
!strcmp ((char *)name, "clipPath") ||
!strcmp ((char *)name, "mask") ||
!strcmp ((char *)name, "defs") ||
!strcmp ((char *)name, "filter") ||
!strcmp ((char *)name, "symbol") ||
!strcmp ((char *)name, "svg") ||
!strcmp ((char *)name, "a") ||
!strcmp ((char *)name, "g") ||
!strcmp ((char *)name, "pattern"))
{
printf ("ended %s\n", (char *)name);
rsvg_pop_def_group(ctx);
}
else if (!strncmp ((char *)name, "fe", 2) &&
strncmp ((char *)name, "feFunc", 6))
rsvg_end_filter(ctx);
rsvg_pop_def_group(ctx);
}
}
......
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