[lasem/properties] [SVG] Property list WIP.
- From: Emmanuel Pacaud <emmanuel src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [lasem/properties] [SVG] Property list WIP.
- Date: Wed, 29 Jul 2009 15:54:32 +0000 (UTC)
commit 6db0b7cdfd37229b6d3a79c120d86c969ac732d5
Author: Emmanuel Pacaud <emmanuel pacaud lapp in2p3 fr>
Date: Wed Jul 29 17:54:05 2009 +0200
[SVG] Property list WIP.
src/lsmsvgattributebags.c | 2 +
src/lsmsvgattributebags.h | 2 +
src/lsmsvgattributes.c | 2 +
src/lsmsvgattributes.h | 45 ++++--
src/lsmsvgcircleelement.c | 6 +-
src/lsmsvgcircleelement.h | 6 +-
src/lsmsvgclippathelement.h | 2 +-
src/lsmsvgelement.c | 4 +-
src/lsmsvgelement.h | 4 +-
src/lsmsvgellipseelement.c | 8 +-
src/lsmsvgellipseelement.h | 8 +-
src/lsmsvggradientelement.h | 6 +-
src/lsmsvggraphic.c | 84 +++++-----
src/lsmsvggraphic.h | 12 +-
src/lsmsvgimageelement.c | 15 +-
src/lsmsvgimageelement.h | 10 +-
src/lsmsvglineargradientelement.c | 8 +-
src/lsmsvglineargradientelement.h | 8 +-
src/lsmsvglineelement.c | 8 +-
src/lsmsvglineelement.h | 8 +-
src/lsmsvgmaskelement.c | 8 +-
src/lsmsvgmaskelement.h | 12 +-
src/lsmsvgpathelement.c | 3 +-
src/lsmsvgpathelement.h | 4 +-
src/lsmsvgpatternelement.c | 15 +-
src/lsmsvgpatternelement.h | 14 +-
src/lsmsvgpolygonelement.h | 2 +-
src/lsmsvgpolylineelement.h | 2 +-
src/lsmsvgradialgradientelement.c | 10 +-
src/lsmsvgradialgradientelement.h | 10 +-
src/lsmsvgrectelement.c | 36 +++--
src/lsmsvgrectelement.h | 12 +-
src/lsmsvgstopelement.c | 16 +-
src/lsmsvgstyle.c | 316 ++++++++++++++++++++++++++++++-------
src/lsmsvgstyle.h | 112 ++++++++-----
src/lsmsvgsvgelement.c | 35 +++--
src/lsmsvgsvgelement.h | 2 +-
src/lsmsvgtextelement.c | 4 +-
src/lsmsvgtextelement.h | 4 +-
src/lsmsvguseelement.c | 8 +-
src/lsmsvguseelement.h | 10 +-
src/lsmsvgview.c | 169 +++++++++++---------
src/lsmsvgview.h | 36 +++--
43 files changed, 691 insertions(+), 397 deletions(-)
---
diff --git a/src/lsmsvgattributebags.c b/src/lsmsvgattributebags.c
index 923498f..07f3041 100644
--- a/src/lsmsvgattributebags.c
+++ b/src/lsmsvgattributebags.c
@@ -21,6 +21,7 @@
#include <lsmsvgattributebags.h>
+#if 0
static void *
lsm_svg_mask_attribute_bag_init (void)
{
@@ -270,3 +271,4 @@ lsm_dom_attribute_map_add_stop_attribute_bag (LsmDomAttributeMap *map, ptrdiff_t
NULL,
bag_offset, &lsm_svg_stop_attribute_bag_class);
}
+#endif
diff --git a/src/lsmsvgattributebags.h b/src/lsmsvgattributebags.h
index 73b7311..580a5a3 100644
--- a/src/lsmsvgattributebags.h
+++ b/src/lsmsvgattributebags.h
@@ -27,6 +27,7 @@
G_BEGIN_DECLS
+#if 0
typedef struct {
LsmSvgDoubleAttribute opacity;
LsmDomAttribute clip_path;
@@ -71,6 +72,7 @@ void lsm_dom_attribute_map_add_stroke_attribute_bag (LsmDomAttributeMap *map,
void lsm_dom_attribute_map_add_transform_attribute_bag (LsmDomAttributeMap *map, ptrdiff_t bag_offset);
void lsm_dom_attribute_map_add_text_attribute_bag (LsmDomAttributeMap *map, ptrdiff_t bag_offset);
void lsm_dom_attribute_map_add_stop_attribute_bag (LsmDomAttributeMap *map, ptrdiff_t bag_offset);
+#endif
G_END_DECLS
diff --git a/src/lsmsvgattributes.c b/src/lsmsvgattributes.c
index d5f1928..bd9cc49 100644
--- a/src/lsmsvgattributes.c
+++ b/src/lsmsvgattributes.c
@@ -29,6 +29,7 @@
#include <stdio.h>
#include <math.h>
+#if 0
static const char *
lsm_svg_attribute_get_value (LsmDomAttribute *attribute)
{
@@ -608,3 +609,4 @@ lsm_svg_preserve_aspect_ratio_attribute_parse (LsmSvgPreserveAspectRatioAttribut
attribute->value.meet_or_slice = LSM_SVG_MEET_OR_SLICE_MEET;
}
}
+#endif
diff --git a/src/lsmsvgattributes.h b/src/lsmsvgattributes.h
index 9027064..1a2e298 100644
--- a/src/lsmsvgattributes.h
+++ b/src/lsmsvgattributes.h
@@ -23,7 +23,7 @@
#ifndef LSM_SVG_ATTRIBUTES_H
#define LSM_SVG_ATTRIBUTES_H
-#include <lsmdomattributes.h>
+#include <lsmattributes.h>
#include <lsmdomview.h>
#include <lsmsvg.h>
#include <lsmsvgenums.h>
@@ -34,57 +34,68 @@
G_BEGIN_DECLS
typedef struct {
- LsmDomAttribute attr;
+ LsmAttribute base;
double value;
} LsmSvgDoubleAttribute;
typedef struct {
- LsmDomAttribute attr;
+ LsmAttribute base;
LsmSvgDashArray *value;
} LsmSvgDashArrayAttribute;
typedef struct {
- LsmDomAttribute attr;
+ LsmAttribute base;
LsmSvgLength length;
- double value;
+// double value;
} LsmSvgLengthAttribute;
-typedef struct {
- LsmDomAttribute attr;
- LsmSvgAnimatedLength length;
- double value;
-} LsmSvgAnimatedLengthAttribute;
+//typedef struct {
+// LsmAttribute base;
+// LsmSvgAnimatedLength length;
+// double value;
+//} LsmSvgAnimatedLengthAttribute;
typedef struct {
- LsmDomAttribute attr;
+ LsmAttribute base;
LsmSvgPaint paint;
} LsmSvgPaintAttribute;
typedef struct {
- LsmDomAttribute attr;
+ LsmAttribute base;
char *value;
} LsmSvgStringAttribute;
typedef struct {
- LsmDomAttribute attr;
+ LsmAttribute base;
LsmSvgColor value;
} LsmSvgColorAttribute;
typedef struct {
- LsmDomAttribute attr;
+ LsmAttribute base;
LsmBox value;
} LsmSvgViewboxAttribute;
typedef struct {
- LsmDomAttribute attr;
+ LsmAttribute base;
LsmSvgMatrix matrix;
} LsmSvgTransformAttribute;
typedef struct {
- LsmDomAttribute attr;
+ LsmAttribute base;
LsmSvgPreserveAspectRatio value;
} LsmSvgPreserveAspectRatioAttribute;
+typedef struct {
+ LsmAttribute base;
+ LsmSvgSpreadMethod value;
+} LsmSvgSpreadMethodAtttribute;
+
+typedef struct {
+ LsmAttribute base;
+ LsmSvgPatternUnits value;
+} LsmSvgPatternUnitsAttribute;
+
+#if 0
/* Properties */
void lsm_svg_double_attribute_parse (LsmSvgDoubleAttribute *attribute,
@@ -123,6 +134,8 @@ void lsm_svg_viewbox_attribute_parse (LsmSvgViewboxAttribute *attribute);
void lsm_svg_transform_attribute_parse (LsmSvgTransformAttribute *attribute);
void lsm_svg_preserve_aspect_ratio_attribute_parse (LsmSvgPreserveAspectRatioAttribute *attribute);
+#endif
+
G_END_DECLS
#endif
diff --git a/src/lsmsvgcircleelement.c b/src/lsmsvgcircleelement.c
index 3750f7d..9c0674e 100644
--- a/src/lsmsvgcircleelement.c
+++ b/src/lsmsvgcircleelement.c
@@ -66,9 +66,9 @@ lsm_svg_circle_element_graphic_render (LsmSvgElement *self, LsmSvgView *view)
LsmSvgCircleElement *circle = LSM_SVG_CIRCLE_ELEMENT (self);
double cx, cy, r;
- cx = lsm_svg_view_normalize_length (view, &circle->cx.length.base, LSM_SVG_LENGTH_DIRECTION_HORIZONTAL);
- cy = lsm_svg_view_normalize_length (view, &circle->cy.length.base, LSM_SVG_LENGTH_DIRECTION_VERTICAL);
- r = lsm_svg_view_normalize_length (view, &circle->r.length.base, LSM_SVG_LENGTH_DIRECTION_DIAGONAL);
+ cx = lsm_svg_view_normalize_length (view, &circle->cx.length, LSM_SVG_LENGTH_DIRECTION_HORIZONTAL);
+ cy = lsm_svg_view_normalize_length (view, &circle->cy.length, LSM_SVG_LENGTH_DIRECTION_VERTICAL);
+ r = lsm_svg_view_normalize_length (view, &circle->r.length, LSM_SVG_LENGTH_DIRECTION_DIAGONAL);
lsm_debug ("[LsmSvgCircleElement::graphic_render] cx = %g, cy = %g, r = %g",
cx, cy, r);
diff --git a/src/lsmsvgcircleelement.h b/src/lsmsvgcircleelement.h
index 83541b7..32f0f3b 100644
--- a/src/lsmsvgcircleelement.h
+++ b/src/lsmsvgcircleelement.h
@@ -39,9 +39,9 @@ typedef struct _LsmSvgCircleElementClass LsmSvgCircleElementClass;
struct _LsmSvgCircleElement {
LsmSvgGraphic graphic;
- LsmSvgAnimatedLengthAttribute cx;
- LsmSvgAnimatedLengthAttribute cy;
- LsmSvgAnimatedLengthAttribute r;
+ LsmSvgLengthAttribute cx;
+ LsmSvgLengthAttribute cy;
+ LsmSvgLengthAttribute r;
};
struct _LsmSvgCircleElementClass {
diff --git a/src/lsmsvgclippathelement.h b/src/lsmsvgclippathelement.h
index 9959a1e..464dea0 100644
--- a/src/lsmsvgclippathelement.h
+++ b/src/lsmsvgclippathelement.h
@@ -39,7 +39,7 @@ typedef struct _LsmSvgClipPathElementClass LsmSvgClipPathElementClass;
struct _LsmSvgClipPathElement {
LsmSvgGraphic graphic;
- LsmDomEnumAttribute units;
+ LsmSvgPatternUnitsAttribute units;
};
struct _LsmSvgClipPathElementClass {
diff --git a/src/lsmsvgelement.c b/src/lsmsvgelement.c
index 478d34e..0060e7a 100644
--- a/src/lsmsvgelement.c
+++ b/src/lsmsvgelement.c
@@ -89,6 +89,7 @@ lsm_svg_element_get_attribute (LsmDomElement *self, const char *name)
/* LsmSvgElement implementation */
+#if 0
void
lsm_svg_element_update (LsmSvgElement *self, const LsmSvgStyle *parent_style)
{
@@ -133,6 +134,7 @@ lsm_svg_element_update (LsmSvgElement *self, const LsmSvgStyle *parent_style)
self->need_update = FALSE;
self->need_children_update = FALSE;
}
+#endif
/* LsmSvgElement implementation */
@@ -286,7 +288,7 @@ lsm_svg_element_class_init (LsmSvgElementClass *s_element_class)
d_element_class->get_attribute = lsm_svg_element_get_attribute;
d_element_class->set_attribute = lsm_svg_element_set_attribute;
- s_element_class->update = NULL;
+/* s_element_class->update = NULL;*/
s_element_class->render = _render;
s_element_class->render_paint = NULL;
diff --git a/src/lsmsvgelement.h b/src/lsmsvgelement.h
index 18f654c..5682d4f 100644
--- a/src/lsmsvgelement.h
+++ b/src/lsmsvgelement.h
@@ -63,7 +63,7 @@ struct _LsmSvgElementClass {
// LsmDomAttributeMap *attributes;
LsmAttributeManager *attribute_manager;
- void (*update) (LsmSvgElement *element, LsmSvgStyle *style);
+// void (*update) (LsmSvgElement *element, LsmSvgStyle *style);
void (*render) (LsmSvgElement *element, LsmSvgView *view);
void (*render_paint) (LsmSvgElement *element, LsmSvgView *view);
void (*render_clip) (LsmSvgElement *element, LsmSvgView *view);
@@ -72,7 +72,7 @@ struct _LsmSvgElementClass {
GType lsm_svg_element_get_type (void);
-void lsm_svg_element_update (LsmSvgElement *element, const LsmSvgStyle *style);
+//void lsm_svg_element_update (LsmSvgElement *element, const LsmSvgStyle *style);
void lsm_svg_element_render (LsmSvgElement *element, LsmSvgView *view);
void lsm_svg_element_render_paint (LsmSvgElement *element, LsmSvgView *view);
void lsm_svg_element_render_clip (LsmSvgElement *element, LsmSvgView *view);
diff --git a/src/lsmsvgellipseelement.c b/src/lsmsvgellipseelement.c
index f6bccac..e1cbaff 100644
--- a/src/lsmsvgellipseelement.c
+++ b/src/lsmsvgellipseelement.c
@@ -69,10 +69,10 @@ lsm_svg_ellipse_element_graphic_render (LsmSvgElement *self, LsmSvgView *view)
LsmSvgEllipseElement *ellipse = LSM_SVG_ELLIPSE_ELEMENT (self);
double cx, cy, rx, ry;
- cx = lsm_svg_view_normalize_length (view, &ellipse->cx.length.base, LSM_SVG_LENGTH_DIRECTION_HORIZONTAL);
- cy = lsm_svg_view_normalize_length (view, &ellipse->cy.length.base, LSM_SVG_LENGTH_DIRECTION_VERTICAL);
- rx = lsm_svg_view_normalize_length (view, &ellipse->rx.length.base, LSM_SVG_LENGTH_DIRECTION_HORIZONTAL);
- ry = lsm_svg_view_normalize_length (view, &ellipse->ry.length.base, LSM_SVG_LENGTH_DIRECTION_VERTICAL);
+ cx = lsm_svg_view_normalize_length (view, &ellipse->cx.length, LSM_SVG_LENGTH_DIRECTION_HORIZONTAL);
+ cy = lsm_svg_view_normalize_length (view, &ellipse->cy.length, LSM_SVG_LENGTH_DIRECTION_VERTICAL);
+ rx = lsm_svg_view_normalize_length (view, &ellipse->rx.length, LSM_SVG_LENGTH_DIRECTION_HORIZONTAL);
+ ry = lsm_svg_view_normalize_length (view, &ellipse->ry.length, LSM_SVG_LENGTH_DIRECTION_VERTICAL);
lsm_svg_view_show_ellipse (view, cx, cy, rx, ry);
}
diff --git a/src/lsmsvgellipseelement.h b/src/lsmsvgellipseelement.h
index d5e6d74..fe5c9b3 100644
--- a/src/lsmsvgellipseelement.h
+++ b/src/lsmsvgellipseelement.h
@@ -39,10 +39,10 @@ typedef struct _LsmSvgEllipseElementClass LsmSvgEllipseElementClass;
struct _LsmSvgEllipseElement {
LsmSvgGraphic graphic;
- LsmSvgAnimatedLengthAttribute cx;
- LsmSvgAnimatedLengthAttribute cy;
- LsmSvgAnimatedLengthAttribute rx;
- LsmSvgAnimatedLengthAttribute ry;
+ LsmSvgLengthAttribute cx;
+ LsmSvgLengthAttribute cy;
+ LsmSvgLengthAttribute rx;
+ LsmSvgLengthAttribute ry;
};
struct _LsmSvgEllipseElementClass {
diff --git a/src/lsmsvggradientelement.h b/src/lsmsvggradientelement.h
index cad2a35..d053890 100644
--- a/src/lsmsvggradientelement.h
+++ b/src/lsmsvggradientelement.h
@@ -40,9 +40,9 @@ struct _LsmSvgGradientElement {
LsmSvgGraphic graphic;
LsmSvgTransformAttribute transform;
- LsmDomEnumAttribute units;
- LsmDomEnumAttribute spread_method;
- LsmDomAttribute href;
+ LsmSvgPatternUnitsAttribute units;
+ LsmSvgSpreadMethodAtttribute spread_method;
+ LsmAttribute href;
};
struct _LsmSvgGradientElementClass {
diff --git a/src/lsmsvggraphic.c b/src/lsmsvggraphic.c
index 3cf12c7..e3107fe 100644
--- a/src/lsmsvggraphic.c
+++ b/src/lsmsvggraphic.c
@@ -26,9 +26,9 @@
static GObjectClass *parent_class;
-static void
-lsm_svg_graphic_update (LsmSvgElement *self, LsmSvgStyle *parent_style)
-{
+/*static void*/
+/*lsm_svg_graphic_update (LsmSvgElement *self, LsmSvgStyle *parent_style)*/
+/*{*/
/* Handle inline style here for now. This should move to the CSS handling part. */
/*
@@ -145,26 +145,26 @@ lsm_svg_graphic_update (LsmSvgElement *self, LsmSvgStyle *parent_style)
lsm_svg_double_attribute_parse (&graphic->stop->opacity, &parent_style->stop.opacity);
}
#endif
-}
+/*}*/
static void
_graphic_render (LsmSvgElement *self, LsmSvgView *view)
{
- LsmSvgGraphic *graphic = LSM_SVG_GRAPHIC (self);
+/* LsmSvgGraphic *graphic = LSM_SVG_GRAPHIC (self);*/
LsmDomNode *node;
lsm_debug ("[LsmSvgGraphic::_graphic_render]");
- if (graphic->mask != NULL)
- lsm_svg_view_push_group_opacity (view);
+/* if (graphic->mask != NULL)*/
+/* lsm_svg_view_push_group_opacity (view);*/
for (node = LSM_DOM_NODE (self)->first_child; node != NULL; node = node->next_sibling) {
if (LSM_IS_SVG_ELEMENT (node))
lsm_svg_element_render (LSM_SVG_ELEMENT (node), view);
}
- if (graphic->mask != NULL)
- lsm_svg_view_pop_group_opacity (view);
+/* if (graphic->mask != NULL)*/
+/* lsm_svg_view_pop_group_opacity (view);*/
}
static void
@@ -172,37 +172,41 @@ lsm_svg_graphic_render (LsmSvgElement *self, LsmSvgView *view)
{
LsmSvgGraphic *graphic = LSM_SVG_GRAPHIC (self);
- if (graphic->transform != NULL)
- lsm_svg_view_push_matrix (view, &graphic->transform->transform.matrix);
+/* lsm_svg_view_push_style (view, style);*/
- if (graphic->mask != NULL)
- lsm_svg_view_push_mask_attributes (view, graphic->mask);
- if (graphic->fill != NULL)
- lsm_svg_view_push_fill_attributes (view, graphic->fill);
- if (graphic->stroke != NULL)
- lsm_svg_view_push_stroke_attributes (view, graphic->stroke);
- if (graphic->text != NULL)
- lsm_svg_view_push_text_attributes (view, graphic->text);
+/* if (graphic->transform != NULL)*/
+/* lsm_svg_view_push_matrix (view, &graphic->transform->transform.matrix);*/
+
+/* if (graphic->mask != NULL)*/
+/* lsm_svg_view_push_mask_attributes (view, graphic->mask);*/
+/* if (graphic->fill != NULL)*/
+/* lsm_svg_view_push_fill_attributes (view, graphic->fill);*/
+/* if (graphic->stroke != NULL)*/
+/* lsm_svg_view_push_stroke_attributes (view, graphic->stroke);*/
+/* if (graphic->text != NULL)*/
+/* lsm_svg_view_push_text_attributes (view, graphic->text);*/
LSM_SVG_GRAPHIC_GET_CLASS (graphic)->graphic_render (self, view);
- if (graphic->text != NULL)
- lsm_svg_view_pop_text_attributes (view);
- if (graphic->stroke != NULL)
- lsm_svg_view_pop_stroke_attributes (view);
- if (graphic->fill != NULL)
- lsm_svg_view_pop_fill_attributes (view);
- if (graphic->mask != NULL)
- lsm_svg_view_pop_mask_attributes (view);
-
- if (graphic->transform != NULL)
- lsm_svg_view_pop_matrix (view);
+/* if (graphic->text != NULL)*/
+/* lsm_svg_view_pop_text_attributes (view);*/
+/* if (graphic->stroke != NULL)*/
+/* lsm_svg_view_pop_stroke_attributes (view);*/
+/* if (graphic->fill != NULL)*/
+/* lsm_svg_view_pop_fill_attributes (view);*/
+/* if (graphic->mask != NULL)*/
+/* lsm_svg_view_pop_mask_attributes (view);*/
+
+/* if (graphic->transform != NULL)*/
+/* lsm_svg_view_pop_matrix (view);*/
+
+/* lsm_svg_view_pop_style (view, style);*/
}
static void
_graphic_get_extents (LsmSvgElement *self, LsmSvgView *view, LsmExtents *extents)
{
- LsmSvgGraphic *graphic = LSM_SVG_GRAPHIC (self);
+/* LsmSvgGraphic *graphic = LSM_SVG_GRAPHIC (self);*/
LsmDomNode *node;
gboolean first_child = TRUE;
LsmExtents element_extents = {0.0, 0.0, 0.0, 0.0};
@@ -215,10 +219,10 @@ _graphic_get_extents (LsmSvgElement *self, LsmSvgView *view, LsmExtents *extents
lsm_svg_element_get_extents (LSM_SVG_ELEMENT (node), view, &child_extents);
- if (graphic->transform != NULL)
- lsm_svg_matrix_transform_bounding_box (&graphic->transform->transform.matrix,
- &child_extents.x1, &child_extents.y1,
- &child_extents.x2, &child_extents.y2);
+/* if (graphic->transform != NULL)*/
+/* lsm_svg_matrix_transform_bounding_box (&graphic->transform->transform.matrix,*/
+/* &child_extents.x1, &child_extents.y1,*/
+/* &child_extents.x2, &child_extents.y2);*/
if (first_child) {
element_extents = child_extents;
first_child = FALSE;
@@ -239,13 +243,13 @@ lsm_svg_graphic_get_extents (LsmSvgElement *self, LsmSvgView *view, LsmExtents *
{
LsmSvgGraphic *graphic = LSM_SVG_GRAPHIC (self);
- if (graphic->text != NULL)
- lsm_svg_view_push_text_attributes (view, graphic->text);
+/* if (graphic->text != NULL)*/
+/* lsm_svg_view_push_text_attributes (view, graphic->text);*/
LSM_SVG_GRAPHIC_GET_CLASS (graphic)->graphic_get_extents (self, view, extents);
- if (graphic->text != NULL)
- lsm_svg_view_pop_text_attributes (view);
+/* if (graphic->text != NULL)*/
+/* lsm_svg_view_pop_text_attributes (view);*/
}
/* LsmSvgGraphic implementation */
@@ -273,7 +277,7 @@ lsm_svg_graphic_class_init (LsmSvgGraphicClass *s_graphic_class)
object_class->finalize = lsm_svg_graphic_finalize;
- s_element_class->update = lsm_svg_graphic_update;
+/* s_element_class->update = lsm_svg_graphic_update;*/
s_element_class->render = lsm_svg_graphic_render;
s_element_class->get_extents = lsm_svg_graphic_get_extents;
diff --git a/src/lsmsvggraphic.h b/src/lsmsvggraphic.h
index d17e768..965476d 100644
--- a/src/lsmsvggraphic.h
+++ b/src/lsmsvggraphic.h
@@ -45,12 +45,12 @@ struct _LsmSvgGraphic {
// LsmSvgColorAttribute color;
/* FIXME kill kill kill ! */
- LsmSvgMaskAttributeBag *mask;
- LsmSvgFillAttributeBag *fill;
- LsmSvgStrokeAttributeBag *stroke;
- LsmSvgTransformAttributeBag *transform;
- LsmSvgTextAttributeBag *text;
- LsmSvgStopAttributeBag *stop;
+// LsmSvgMaskAttributeBag *mask;
+// LsmSvgFillAttributeBag *fill;
+// LsmSvgStrokeAttributeBag *stroke;
+// LsmSvgTransformAttributeBag *transform;
+// LsmSvgTextAttributeBag *text;
+// LsmSvgStopAttributeBag *stop;
};
struct _LsmSvgGraphicClass {
diff --git a/src/lsmsvgimageelement.c b/src/lsmsvgimageelement.c
index 3aeb1ed..0f5c5bc 100644
--- a/src/lsmsvgimageelement.c
+++ b/src/lsmsvgimageelement.c
@@ -44,12 +44,12 @@ lsm_svg_use_can_append_child (LsmDomNode *node, LsmDomNode *child)
/* LsmSvgElement implementation */
+#if 0
static void
lsm_svg_image_element_update (LsmSvgElement *self, LsmSvgStyle *parent_style)
{
LsmSvgImageElement *image_element = LSM_SVG_IMAGE_ELEMENT (self);
const char *href;
-#if 0
LsmSvgLength length;
length.value_unit = 0.0;
@@ -69,7 +69,7 @@ lsm_svg_image_element_update (LsmSvgElement *self, LsmSvgStyle *parent_style)
lsm_svg_animated_length_attribute_parse (&image_element->height, &length);
lsm_svg_preserve_aspect_ratio_attribute_parse (&image_element->preserve_aspect_ratio);
-#endif
+
LSM_SVG_ELEMENT_CLASS (parent_class)->update (self, parent_style);
if (image_element->pixbuf != NULL) {
@@ -114,6 +114,7 @@ lsm_svg_image_element_update (LsmSvgElement *self, LsmSvgStyle *parent_style)
}
}
}
+#endif
/* LsmSvgGraphic implementation */
@@ -128,13 +129,13 @@ lsm_svg_image_element_graphic_render (LsmSvgElement *self, LsmSvgView *view)
if (image->pixbuf == NULL)
return;
- viewport.x = lsm_svg_view_normalize_length (view, &image->x.length.base,
+ viewport.x = lsm_svg_view_normalize_length (view, &image->x.length,
LSM_SVG_LENGTH_DIRECTION_HORIZONTAL);
- viewport.y = lsm_svg_view_normalize_length (view, &image->y.length.base,
+ viewport.y = lsm_svg_view_normalize_length (view, &image->y.length,
LSM_SVG_LENGTH_DIRECTION_VERTICAL);
- viewport.width = lsm_svg_view_normalize_length (view, &image->width.length.base,
+ viewport.width = lsm_svg_view_normalize_length (view, &image->width.length,
LSM_SVG_LENGTH_DIRECTION_HORIZONTAL);
- viewport.height = lsm_svg_view_normalize_length (view, &image->height.length.base,
+ viewport.height = lsm_svg_view_normalize_length (view, &image->height.length,
LSM_SVG_LENGTH_DIRECTION_VERTICAL);
lsm_debug ("[LsmSvgImageElement::graphic_render] viewport %g, %g, %g, %g",
@@ -239,7 +240,7 @@ lsm_svg_image_element_class_init (LsmSvgImageElementClass *klass)
d_node_class->get_node_name = lsm_svg_image_element_get_node_name;
d_node_class->can_append_child = lsm_svg_use_can_append_child;
- s_element_class->update = lsm_svg_image_element_update;
+/* s_element_class->update = lsm_svg_image_element_update;*/
s_graphic_class->graphic_render = lsm_svg_image_element_graphic_render;
diff --git a/src/lsmsvgimageelement.h b/src/lsmsvgimageelement.h
index d2d63d2..4fcce7e 100644
--- a/src/lsmsvgimageelement.h
+++ b/src/lsmsvgimageelement.h
@@ -40,12 +40,12 @@ typedef struct _LsmSvgImageElementClass LsmSvgImageElementClass;
struct _LsmSvgImageElement {
LsmSvgGraphic graphic;
- LsmSvgAnimatedLengthAttribute x;
- LsmSvgAnimatedLengthAttribute y;
- LsmSvgAnimatedLengthAttribute width;
- LsmSvgAnimatedLengthAttribute height;
+ LsmSvgLengthAttribute x;
+ LsmSvgLengthAttribute y;
+ LsmSvgLengthAttribute width;
+ LsmSvgLengthAttribute height;
- LsmDomAttribute href;
+ LsmAttribute href;
LsmSvgPreserveAspectRatioAttribute preserve_aspect_ratio;
diff --git a/src/lsmsvglineargradientelement.c b/src/lsmsvglineargradientelement.c
index 9b227b4..ca67836 100644
--- a/src/lsmsvglineargradientelement.c
+++ b/src/lsmsvglineargradientelement.c
@@ -79,10 +79,10 @@ _linear_gradient_element_render_paint (LsmSvgElement *self, LsmSvgView *view)
lsm_svg_view_push_viewbox (view, &viewbox);
}
- x1 = lsm_svg_view_normalize_length (view, &linear->x1.length.base, LSM_SVG_LENGTH_DIRECTION_HORIZONTAL);
- y1 = lsm_svg_view_normalize_length (view, &linear->y1.length.base, LSM_SVG_LENGTH_DIRECTION_VERTICAL);
- x2 = lsm_svg_view_normalize_length (view, &linear->x2.length.base, LSM_SVG_LENGTH_DIRECTION_HORIZONTAL);
- y2 = lsm_svg_view_normalize_length (view, &linear->y2.length.base, LSM_SVG_LENGTH_DIRECTION_VERTICAL);
+ x1 = lsm_svg_view_normalize_length (view, &linear->x1.length, LSM_SVG_LENGTH_DIRECTION_HORIZONTAL);
+ y1 = lsm_svg_view_normalize_length (view, &linear->y1.length, LSM_SVG_LENGTH_DIRECTION_VERTICAL);
+ x2 = lsm_svg_view_normalize_length (view, &linear->x2.length, LSM_SVG_LENGTH_DIRECTION_HORIZONTAL);
+ y2 = lsm_svg_view_normalize_length (view, &linear->y2.length, LSM_SVG_LENGTH_DIRECTION_VERTICAL);
lsm_debug ("[LsmSvgLinearGradientElement::render] Create linear %g, %g, %g, %g",
x1, y1, x2, y2);
diff --git a/src/lsmsvglineargradientelement.h b/src/lsmsvglineargradientelement.h
index 4a5127e..7797355 100644
--- a/src/lsmsvglineargradientelement.h
+++ b/src/lsmsvglineargradientelement.h
@@ -39,10 +39,10 @@ typedef struct _LsmSvgLinearGradientElementClass LsmSvgLinearGradientElementClas
struct _LsmSvgLinearGradientElement {
LsmSvgGradientElement gradient;
- LsmSvgAnimatedLengthAttribute x1;
- LsmSvgAnimatedLengthAttribute y1;
- LsmSvgAnimatedLengthAttribute x2;
- LsmSvgAnimatedLengthAttribute y2;
+ LsmSvgLengthAttribute x1;
+ LsmSvgLengthAttribute y1;
+ LsmSvgLengthAttribute x2;
+ LsmSvgLengthAttribute y2;
};
struct _LsmSvgLinearGradientElementClass {
diff --git a/src/lsmsvglineelement.c b/src/lsmsvglineelement.c
index b85026e..63f55a8 100644
--- a/src/lsmsvglineelement.c
+++ b/src/lsmsvglineelement.c
@@ -70,10 +70,10 @@ lsm_svg_line_element_graphic_render (LsmSvgElement *self, LsmSvgView *view)
LsmSvgLineElement *line = LSM_SVG_LINE_ELEMENT (self);
double x1, y1, x2, y2;
- x1 = lsm_svg_view_normalize_length (view, &line->x1.length.base, LSM_SVG_LENGTH_DIRECTION_HORIZONTAL);
- y1 = lsm_svg_view_normalize_length (view, &line->y1.length.base, LSM_SVG_LENGTH_DIRECTION_VERTICAL);
- x2 = lsm_svg_view_normalize_length (view, &line->x2.length.base, LSM_SVG_LENGTH_DIRECTION_HORIZONTAL);
- y2 = lsm_svg_view_normalize_length (view, &line->y2.length.base, LSM_SVG_LENGTH_DIRECTION_VERTICAL);
+ x1 = lsm_svg_view_normalize_length (view, &line->x1.length, LSM_SVG_LENGTH_DIRECTION_HORIZONTAL);
+ y1 = lsm_svg_view_normalize_length (view, &line->y1.length, LSM_SVG_LENGTH_DIRECTION_VERTICAL);
+ x2 = lsm_svg_view_normalize_length (view, &line->x2.length, LSM_SVG_LENGTH_DIRECTION_HORIZONTAL);
+ y2 = lsm_svg_view_normalize_length (view, &line->y2.length, LSM_SVG_LENGTH_DIRECTION_VERTICAL);
lsm_debug ("[LsmSvgLineElement::graphic_render] %g, %g, %g, %g", x1, y1, x2, y2);
diff --git a/src/lsmsvglineelement.h b/src/lsmsvglineelement.h
index deeff47..a65c0d8 100644
--- a/src/lsmsvglineelement.h
+++ b/src/lsmsvglineelement.h
@@ -39,10 +39,10 @@ typedef struct _LsmSvgLineElementClass LsmSvgLineElementClass;
struct _LsmSvgLineElement {
LsmSvgGraphic graphic;
- LsmSvgAnimatedLengthAttribute x1;
- LsmSvgAnimatedLengthAttribute y1;
- LsmSvgAnimatedLengthAttribute x2;
- LsmSvgAnimatedLengthAttribute y2;
+ LsmSvgLengthAttribute x1;
+ LsmSvgLengthAttribute y1;
+ LsmSvgLengthAttribute x2;
+ LsmSvgLengthAttribute y2;
};
struct _LsmSvgLineElementClass {
diff --git a/src/lsmsvgmaskelement.c b/src/lsmsvgmaskelement.c
index b8d673d..17db8e9 100644
--- a/src/lsmsvgmaskelement.c
+++ b/src/lsmsvgmaskelement.c
@@ -88,13 +88,13 @@ _mask_element_render_paint (LsmSvgElement *self, LsmSvgView *view)
lsm_svg_view_push_viewbox (view, &viewbox);
}
- viewport.x = lsm_svg_view_normalize_length (view, &mask->x.length.base,
+ viewport.x = lsm_svg_view_normalize_length (view, &mask->x.length,
LSM_SVG_LENGTH_DIRECTION_HORIZONTAL);
- viewport.y = lsm_svg_view_normalize_length (view, &mask->y.length.base,
+ viewport.y = lsm_svg_view_normalize_length (view, &mask->y.length,
LSM_SVG_LENGTH_DIRECTION_VERTICAL);
- viewport.width = lsm_svg_view_normalize_length (view, &mask->width.length.base,
+ viewport.width = lsm_svg_view_normalize_length (view, &mask->width.length,
LSM_SVG_LENGTH_DIRECTION_HORIZONTAL);
- viewport.height = lsm_svg_view_normalize_length (view, &mask->height.length.base,
+ viewport.height = lsm_svg_view_normalize_length (view, &mask->height.length,
LSM_SVG_LENGTH_DIRECTION_VERTICAL);
if (is_object_bounding_box) {
diff --git a/src/lsmsvgmaskelement.h b/src/lsmsvgmaskelement.h
index c51338a..ebac493 100644
--- a/src/lsmsvgmaskelement.h
+++ b/src/lsmsvgmaskelement.h
@@ -39,12 +39,12 @@ typedef struct _LsmSvgMaskElementClass LsmSvgMaskElementClass;
struct _LsmSvgMaskElement {
LsmSvgGraphic graphic;
- LsmSvgAnimatedLengthAttribute x;
- LsmSvgAnimatedLengthAttribute y;
- LsmSvgAnimatedLengthAttribute width;
- LsmSvgAnimatedLengthAttribute height;
- LsmDomEnumAttribute units;
- LsmDomEnumAttribute content_units;
+ LsmSvgLengthAttribute x;
+ LsmSvgLengthAttribute y;
+ LsmSvgLengthAttribute width;
+ LsmSvgLengthAttribute height;
+ LsmSvgPatternUnitsAttribute units;
+ LsmSvgPatternUnitsAttribute content_units;
};
struct _LsmSvgMaskElementClass {
diff --git a/src/lsmsvgpathelement.c b/src/lsmsvgpathelement.c
index d39add4..5d7de2d 100644
--- a/src/lsmsvgpathelement.c
+++ b/src/lsmsvgpathelement.c
@@ -44,7 +44,8 @@ lsm_svg_path_element_graphic_render (LsmSvgElement *self, LsmSvgView *view)
lsm_debug ("[LsmSvgPathElement::graphic_render]");
- lsm_svg_view_show_path (view, lsm_dom_attribute_get_value (&path->d));
+/* lsm_svg_view_show_path (view, lsm_dom_attribute_get_value (&path->d));*/
+ lsm_svg_view_show_path (view, path->d.value);
}
/* LsmSvgPathElement implementation */
diff --git a/src/lsmsvgpathelement.h b/src/lsmsvgpathelement.h
index 0e9afa0..7468118 100644
--- a/src/lsmsvgpathelement.h
+++ b/src/lsmsvgpathelement.h
@@ -39,8 +39,8 @@ typedef struct _LsmSvgPathElementClass LsmSvgPathElementClass;
struct _LsmSvgPathElement {
LsmSvgGraphic graphic;
- LsmDomAttribute d;
- LsmDomDoubleAttribute path_length;
+ LsmAttribute d;
+ LsmSvgDoubleAttribute path_length;
};
struct _LsmSvgPathElementClass {
diff --git a/src/lsmsvgpatternelement.c b/src/lsmsvgpatternelement.c
index 80d64e3..a36eb55 100644
--- a/src/lsmsvgpatternelement.c
+++ b/src/lsmsvgpatternelement.c
@@ -36,6 +36,7 @@ _pattern_element_get_node_name (LsmDomNode *node)
/* LsmSvgElement implementation */
+#if 0
static void
_pattern_element_update (LsmSvgElement *self, LsmSvgStyle *parent_style)
{
@@ -72,6 +73,7 @@ _pattern_element_update (LsmSvgElement *self, LsmSvgStyle *parent_style)
LSM_SVG_ELEMENT_CLASS (parent_class)->update (self, parent_style);
}
+#endif
static void
_pattern_element_render_paint (LsmSvgElement *self, LsmSvgView *view)
@@ -92,13 +94,13 @@ _pattern_element_render_paint (LsmSvgElement *self, LsmSvgView *view)
lsm_svg_view_push_viewbox (view, &viewbox);
}
- viewport.x = lsm_svg_view_normalize_length (view, &pattern->x.length.base,
+ viewport.x = lsm_svg_view_normalize_length (view, &pattern->x.length,
LSM_SVG_LENGTH_DIRECTION_HORIZONTAL);
- viewport.y = lsm_svg_view_normalize_length (view, &pattern->y.length.base,
+ viewport.y = lsm_svg_view_normalize_length (view, &pattern->y.length,
LSM_SVG_LENGTH_DIRECTION_VERTICAL);
- viewport.width = lsm_svg_view_normalize_length (view, &pattern->width.length.base,
+ viewport.width = lsm_svg_view_normalize_length (view, &pattern->width.length,
LSM_SVG_LENGTH_DIRECTION_HORIZONTAL);
- viewport.height = lsm_svg_view_normalize_length (view, &pattern->height.length.base,
+ viewport.height = lsm_svg_view_normalize_length (view, &pattern->height.length,
LSM_SVG_LENGTH_DIRECTION_VERTICAL);
if (is_object_bounding_box) {
@@ -139,7 +141,8 @@ _pattern_element_render_paint (LsmSvgElement *self, LsmSvgView *view)
pattern_extents->x, pattern_extents->y);
}
- is_viewbox_defined = lsm_dom_attribute_is_defined ((LsmDomAttribute *) &pattern->viewbox);
+/* is_viewbox_defined = lsm_dom_attribute_is_defined ((LsmDomAttribute *) &pattern->viewbox);*/
+ is_viewbox_defined = FALSE;
if (!(is_viewbox_defined) ||
(is_viewbox_defined && pattern->viewbox.value.width > 0.0 && pattern->viewbox.value.height > 0.0)) {
@@ -266,7 +269,7 @@ lsm_svg_pattern_element_class_init (LsmSvgPatternElementClass *klass)
d_node_class->get_node_name = _pattern_element_get_node_name;
- s_element_class->update = _pattern_element_update;
+/* s_element_class->update = _pattern_element_update;*/
s_element_class->render_paint = _pattern_element_render_paint;
s_element_class->render = NULL;
diff --git a/src/lsmsvgpatternelement.h b/src/lsmsvgpatternelement.h
index b2c17bd..acbb5c4 100644
--- a/src/lsmsvgpatternelement.h
+++ b/src/lsmsvgpatternelement.h
@@ -39,14 +39,14 @@ typedef struct _LsmSvgPatternElementClass LsmSvgPatternElementClass;
struct _LsmSvgPatternElement {
LsmSvgGraphic graphic;
- LsmSvgAnimatedLengthAttribute x;
- LsmSvgAnimatedLengthAttribute y;
- LsmSvgAnimatedLengthAttribute width;
- LsmSvgAnimatedLengthAttribute height;
+ LsmSvgLengthAttribute x;
+ LsmSvgLengthAttribute y;
+ LsmSvgLengthAttribute width;
+ LsmSvgLengthAttribute height;
LsmSvgTransformAttribute transform;
- LsmDomEnumAttribute units;
- LsmDomEnumAttribute content_units;
- LsmDomAttribute href;
+ LsmSvgPatternUnitsAttribute units;
+ LsmSvgPatternUnitsAttribute content_units;
+ LsmAttribute href;
LsmSvgViewboxAttribute viewbox;
LsmSvgPreserveAspectRatioAttribute preserve_aspect_ratio;
diff --git a/src/lsmsvgpolygonelement.h b/src/lsmsvgpolygonelement.h
index e9bb558..5f8be5c 100644
--- a/src/lsmsvgpolygonelement.h
+++ b/src/lsmsvgpolygonelement.h
@@ -39,7 +39,7 @@ typedef struct _LsmSvgPolygonElementClass LsmSvgPolygonElementClass;
struct _LsmSvgPolygonElement {
LsmSvgGraphic graphic;
- LsmDomAttribute points;
+ LsmAttribute points;
};
struct _LsmSvgPolygonElementClass {
diff --git a/src/lsmsvgpolylineelement.h b/src/lsmsvgpolylineelement.h
index c4c15f2..ec5947c 100644
--- a/src/lsmsvgpolylineelement.h
+++ b/src/lsmsvgpolylineelement.h
@@ -39,7 +39,7 @@ typedef struct _LsmSvgPolylineElementClass LsmSvgPolylineElementClass;
struct _LsmSvgPolylineElement {
LsmSvgGraphic graphic;
- LsmDomAttribute points;
+ LsmAttribute points;
};
struct _LsmSvgPolylineElementClass {
diff --git a/src/lsmsvgradialgradientelement.c b/src/lsmsvgradialgradientelement.c
index 1269670..bccd771 100644
--- a/src/lsmsvgradialgradientelement.c
+++ b/src/lsmsvgradialgradientelement.c
@@ -83,11 +83,11 @@ _radial_gradient_element_render_paint (LsmSvgElement *self, LsmSvgView *view)
lsm_svg_view_push_viewbox (view, &viewbox);
}
- cx = lsm_svg_view_normalize_length (view, &radial->cx.length.base, LSM_SVG_LENGTH_DIRECTION_HORIZONTAL);
- cy = lsm_svg_view_normalize_length (view, &radial->cy.length.base, LSM_SVG_LENGTH_DIRECTION_VERTICAL);
- r = lsm_svg_view_normalize_length (view, &radial->r.length.base, LSM_SVG_LENGTH_DIRECTION_DIAGONAL);
- fx = lsm_svg_view_normalize_length (view, &radial->fx.length.base, LSM_SVG_LENGTH_DIRECTION_HORIZONTAL);
- fy = lsm_svg_view_normalize_length (view, &radial->fy.length.base, LSM_SVG_LENGTH_DIRECTION_VERTICAL);
+ cx = lsm_svg_view_normalize_length (view, &radial->cx.length, LSM_SVG_LENGTH_DIRECTION_HORIZONTAL);
+ cy = lsm_svg_view_normalize_length (view, &radial->cy.length, LSM_SVG_LENGTH_DIRECTION_VERTICAL);
+ r = lsm_svg_view_normalize_length (view, &radial->r.length, LSM_SVG_LENGTH_DIRECTION_DIAGONAL);
+ fx = lsm_svg_view_normalize_length (view, &radial->fx.length, LSM_SVG_LENGTH_DIRECTION_HORIZONTAL);
+ fy = lsm_svg_view_normalize_length (view, &radial->fy.length, LSM_SVG_LENGTH_DIRECTION_VERTICAL);
gradient_radius = sqrt ((fx - cx) * (fx - cx) + (fy - cy) * (fy - cy));
if (gradient_radius > r) {
diff --git a/src/lsmsvgradialgradientelement.h b/src/lsmsvgradialgradientelement.h
index 6be6a7c..47ae183 100644
--- a/src/lsmsvgradialgradientelement.h
+++ b/src/lsmsvgradialgradientelement.h
@@ -39,11 +39,11 @@ typedef struct _LsmSvgRadialGradientElementClass LsmSvgRadialGradientElementClas
struct _LsmSvgRadialGradientElement {
LsmSvgGradientElement gradient;
- LsmSvgAnimatedLengthAttribute cx;
- LsmSvgAnimatedLengthAttribute cy;
- LsmSvgAnimatedLengthAttribute r;
- LsmSvgAnimatedLengthAttribute fx;
- LsmSvgAnimatedLengthAttribute fy;
+ LsmSvgLengthAttribute cx;
+ LsmSvgLengthAttribute cy;
+ LsmSvgLengthAttribute r;
+ LsmSvgLengthAttribute fx;
+ LsmSvgLengthAttribute fy;
};
struct _LsmSvgRadialGradientElementClass {
diff --git a/src/lsmsvgrectelement.c b/src/lsmsvgrectelement.c
index 4306edd..b310326 100644
--- a/src/lsmsvgrectelement.c
+++ b/src/lsmsvgrectelement.c
@@ -79,21 +79,28 @@ lsm_svg_rect_element_graphic_render (LsmSvgElement *self, LsmSvgView *view)
double rx, ry;
double w, h;
- x = lsm_svg_view_normalize_length (view, &rect->x.length.base, LSM_SVG_LENGTH_DIRECTION_HORIZONTAL);
- y = lsm_svg_view_normalize_length (view, &rect->y.length.base, LSM_SVG_LENGTH_DIRECTION_VERTICAL);
- rx = lsm_svg_view_normalize_length (view, &rect->rx.length.base, LSM_SVG_LENGTH_DIRECTION_HORIZONTAL);
- ry = lsm_svg_view_normalize_length (view, &rect->ry.length.base, LSM_SVG_LENGTH_DIRECTION_VERTICAL);
- w = lsm_svg_view_normalize_length (view, &rect->width.length.base, LSM_SVG_LENGTH_DIRECTION_HORIZONTAL);
- h = lsm_svg_view_normalize_length (view, &rect->height.length.base, LSM_SVG_LENGTH_DIRECTION_VERTICAL);
+ x = lsm_svg_view_normalize_length (view, &rect->x.length, LSM_SVG_LENGTH_DIRECTION_HORIZONTAL);
+ y = lsm_svg_view_normalize_length (view, &rect->y.length, LSM_SVG_LENGTH_DIRECTION_VERTICAL);
+ rx = lsm_svg_view_normalize_length (view, &rect->rx.length, LSM_SVG_LENGTH_DIRECTION_HORIZONTAL);
+ ry = lsm_svg_view_normalize_length (view, &rect->ry.length, LSM_SVG_LENGTH_DIRECTION_VERTICAL);
+ w = lsm_svg_view_normalize_length (view, &rect->width.length, LSM_SVG_LENGTH_DIRECTION_HORIZONTAL);
+ h = lsm_svg_view_normalize_length (view, &rect->height.length, LSM_SVG_LENGTH_DIRECTION_VERTICAL);
/* SVG specification is so weird sometimes ... */
if (w == 0.0 || h == 0.0)
return;
- if (!lsm_dom_attribute_is_defined (&rect->rx.attr))
+/* if (!lsm_dom_attribute_is_defined (&rect->rx.attr))*/
+/* rx = ry;*/
+/* else if (!lsm_dom_attribute_is_defined (&rect->ry.attr))*/
+/* ry = rx;*/
+
+
+ if (rect->rx.length.type == LSM_SVG_LENGTH_TYPE_UNKNOWN) {
rx = ry;
- else if (!lsm_dom_attribute_is_defined (&rect->ry.attr))
+ } else if (rect->rx.length.type == LSM_SVG_LENGTH_TYPE_UNKNOWN) {
ry = rx;
+ }
lsm_svg_view_show_rectangle (view, x, y, w, h, rx, ry);
}
@@ -105,10 +112,10 @@ lsm_svg_rect_element_graphic_get_extents (LsmSvgElement *self, LsmSvgView *view,
double x, y;
double w, h;
- x = lsm_svg_view_normalize_length (view, &rect->x.length.base, LSM_SVG_LENGTH_DIRECTION_HORIZONTAL);
- y = lsm_svg_view_normalize_length (view, &rect->y.length.base, LSM_SVG_LENGTH_DIRECTION_VERTICAL);
- w = lsm_svg_view_normalize_length (view, &rect->width.length.base, LSM_SVG_LENGTH_DIRECTION_HORIZONTAL);
- h = lsm_svg_view_normalize_length (view, &rect->height.length.base, LSM_SVG_LENGTH_DIRECTION_VERTICAL);
+ x = lsm_svg_view_normalize_length (view, &rect->x.length, LSM_SVG_LENGTH_DIRECTION_HORIZONTAL);
+ y = lsm_svg_view_normalize_length (view, &rect->y.length, LSM_SVG_LENGTH_DIRECTION_VERTICAL);
+ w = lsm_svg_view_normalize_length (view, &rect->width.length, LSM_SVG_LENGTH_DIRECTION_HORIZONTAL);
+ h = lsm_svg_view_normalize_length (view, &rect->height.length, LSM_SVG_LENGTH_DIRECTION_VERTICAL);
extents->x1 = x;
extents->y1 = y;
@@ -138,6 +145,7 @@ lsm_svg_rect_element_finalize (GObject *object)
/* LsmSvgRectElement class */
static const LsmSvgLength length_default = { .value_unit = 0.0, .type = LSM_SVG_LENGTH_TYPE_PX};
+static const LsmSvgLength unset_length_default = { .value_unit = 0.0, .type = LSM_SVG_LENGTH_TYPE_UNKNOWN};
static const LsmAttributeInfos lsm_svg_rect_element_attribute_infos[] = {
{
@@ -168,13 +176,13 @@ static const LsmAttributeInfos lsm_svg_rect_element_attribute_infos[] = {
.name = "rx",
.attribute_offset = offsetof (LsmSvgRectElement, rx),
.trait_class = &lsm_svg_length_trait_class,
- .trait_default = &length_default
+ .trait_default = &unset_length_default
},
{
.name = "ry",
.attribute_offset = offsetof (LsmSvgRectElement, ry),
.trait_class = &lsm_svg_length_trait_class,
- .trait_default = &length_default
+ .trait_default = &unset_length_default
}
};
diff --git a/src/lsmsvgrectelement.h b/src/lsmsvgrectelement.h
index 9bf874a..a6bdd02 100644
--- a/src/lsmsvgrectelement.h
+++ b/src/lsmsvgrectelement.h
@@ -39,12 +39,12 @@ typedef struct _LsmSvgRectElementClass LsmSvgRectElementClass;
struct _LsmSvgRectElement {
LsmSvgGraphic graphic;
- LsmSvgAnimatedLengthAttribute x;
- LsmSvgAnimatedLengthAttribute y;
- LsmSvgAnimatedLengthAttribute width;
- LsmSvgAnimatedLengthAttribute height;
- LsmSvgAnimatedLengthAttribute rx;
- LsmSvgAnimatedLengthAttribute ry;
+ LsmSvgLengthAttribute x;
+ LsmSvgLengthAttribute y;
+ LsmSvgLengthAttribute width;
+ LsmSvgLengthAttribute height;
+ LsmSvgLengthAttribute rx;
+ LsmSvgLengthAttribute ry;
};
struct _LsmSvgRectElementClass {
diff --git a/src/lsmsvgstopelement.c b/src/lsmsvgstopelement.c
index e77bd11..7463059 100644
--- a/src/lsmsvgstopelement.c
+++ b/src/lsmsvgstopelement.c
@@ -67,22 +67,22 @@ lsm_svg_stop_element_get_offset (LsmSvgStopElement *self)
const LsmSvgColor *
lsm_svg_stop_element_get_color (LsmSvgStopElement *self)
{
- g_return_val_if_fail (LSM_IS_SVG_STOP_ELEMENT (self), &lsm_svg_color_null);
+/* g_return_val_if_fail (LSM_IS_SVG_STOP_ELEMENT (self), &lsm_svg_color_null);*/
- if (LSM_SVG_GRAPHIC(self)->stop != NULL)
- return &(LSM_SVG_GRAPHIC (self)->stop->color.value);
- else
+/* if (LSM_SVG_GRAPHIC (self)->stop != NULL)*/
+/* return &(LSM_SVG_GRAPHIC (self)->stop->color.value);*/
+/* else*/
return &lsm_svg_color_null;
}
double
lsm_svg_stop_element_get_opacity (LsmSvgStopElement *self)
{
- g_return_val_if_fail (LSM_IS_SVG_STOP_ELEMENT (self), 1.0);
+/* g_return_val_if_fail (LSM_IS_SVG_STOP_ELEMENT (self), 1.0);*/
- if (LSM_SVG_GRAPHIC(self)->stop != NULL)
- return LSM_SVG_GRAPHIC (self)->stop->opacity.value;
- else
+/* if (LSM_SVG_GRAPHIC(self)->stop != NULL)*/
+/* return LSM_SVG_GRAPHIC (self)->stop->opacity.value;*/
+/* else*/
return 1.0;
}
diff --git a/src/lsmsvgstyle.c b/src/lsmsvgstyle.c
index b8a265f..05acdab 100644
--- a/src/lsmsvgstyle.c
+++ b/src/lsmsvgstyle.c
@@ -28,109 +28,310 @@
static const LsmPropertyInfos lsm_svg_property_infos[] = {
{
+ .name = "alignment-baseline",
+ .id = LSM_PROPERTY_OFFSET_TO_ID (LsmSvgStyle, alignment_baseline),
+ .trait_class = &lsm_null_trait_class
+ },
+ {
+ .name = "baseline-shift",
+ .id = LSM_PROPERTY_OFFSET_TO_ID (LsmSvgStyle, baseline_shift),
+ .trait_class = &lsm_null_trait_class
+ },
+ {
+ .name = "clip",
+ .id = LSM_PROPERTY_OFFSET_TO_ID (LsmSvgStyle, clip),
+ .trait_class = &lsm_null_trait_class
+ },
+ {
+ .name = "clip-path",
+ .id = LSM_PROPERTY_OFFSET_TO_ID (LsmSvgStyle, clip_path),
+ .trait_class = &lsm_null_trait_class
+ },
+ {
+ .name = "dominant-baseline",
+ .id = LSM_PROPERTY_OFFSET_TO_ID (LsmSvgStyle, dominant_baseline),
+ .trait_class = &lsm_null_trait_class
+ },
+ {
+ .name = "enable-background",
+ .id = LSM_PROPERTY_OFFSET_TO_ID (LsmSvgStyle, enable_background),
+ .trait_class = &lsm_null_trait_class
+ },
+ {
+ .name = "filter",
+ .id = LSM_PROPERTY_OFFSET_TO_ID (LsmSvgStyle, filter),
+ .trait_class = &lsm_null_trait_class
+ },
+ {
+ .name = "flood-color",
+ .id = LSM_PROPERTY_OFFSET_TO_ID (LsmSvgStyle, flood_color),
+ .trait_class = &lsm_null_trait_class
+ },
+ {
+ .name = "flood-opacity",
+ .id = LSM_PROPERTY_OFFSET_TO_ID (LsmSvgStyle, flood_opacity),
+ .trait_class = &lsm_null_trait_class
+ },
+ {
+ .name = "lighting-color",
+ .id = LSM_PROPERTY_OFFSET_TO_ID (LsmSvgStyle, lighting_color),
+ .trait_class = &lsm_null_trait_class
+ },
+ {
+ .name = "mask",
+ .id = LSM_PROPERTY_OFFSET_TO_ID (LsmSvgStyle, mask),
+ .trait_class = &lsm_null_trait_class
+ },
+ {
+ .name = "opacity",
+ .id = LSM_PROPERTY_OFFSET_TO_ID (LsmSvgStyle, opacity),
+ .trait_class = &lsm_double_trait_class
+ },
+ {
+ .name = "overflow",
+ .id = LSM_PROPERTY_OFFSET_TO_ID (LsmSvgStyle, overflow),
+ .trait_class = &lsm_null_trait_class
+ },
+ {
+ .name = "stop-color",
+ .id = LSM_PROPERTY_OFFSET_TO_ID (LsmSvgStyle, stop_color),
+ .trait_class = &lsm_svg_color_trait_class
+ },
+ {
+ .name = "stop-opacity",
+ .id = LSM_PROPERTY_OFFSET_TO_ID (LsmSvgStyle, stop_opacity),
+ .trait_class = &lsm_double_trait_class
+ },
+ {
+ .name = "text-decoration",
+ .id = LSM_PROPERTY_OFFSET_TO_ID (LsmSvgStyle, text_decoration),
+ .trait_class = &lsm_null_trait_class
+ },
+ {
+ .name = "unicode-bidi",
+ .id = LSM_PROPERTY_OFFSET_TO_ID (LsmSvgStyle, unicode_bidi),
+ .trait_class = &lsm_null_trait_class
+ },
+ /* Inherited properties */
+ {
+ .name = "clip-rule",
+ .id = LSM_PROPERTY_OFFSET_TO_ID (LsmSvgStyle, clip_rule),
+ .trait_class = &lsm_svg_fill_rule_trait_class
+ },
+ {
.name = "color",
.id = LSM_PROPERTY_OFFSET_TO_ID (LsmSvgStyle, color),
.trait_class = &lsm_svg_color_trait_class
},
{
- .name = "opacity",
- .id = LSM_PROPERTY_OFFSET_TO_ID (LsmSvgStyle, group_opacity),
- .trait_class = &lsm_double_trait_class
+ .name = "color-interpolation",
+ .id = LSM_PROPERTY_OFFSET_TO_ID (LsmSvgStyle, color_interpolation),
+ .trait_class = &lsm_null_trait_class
},
{
- .name = "transform",
- .id = LSM_PROPERTY_OFFSET_TO_ID (LsmSvgStyle, transform),
- .trait_class = &lsm_svg_matrix_trait_class
+ .name = "color-interpolation-filters",
+ .id = LSM_PROPERTY_OFFSET_TO_ID (LsmSvgStyle, color_interpolation_filters),
+ .trait_class = &lsm_null_trait_class
+ },
+ {
+ .name = "color-profile",
+ .id = LSM_PROPERTY_OFFSET_TO_ID (LsmSvgStyle, color_profile),
+ .trait_class = &lsm_null_trait_class
+ },
+ {
+ .name = "color-rendering",
+ .id = LSM_PROPERTY_OFFSET_TO_ID (LsmSvgStyle, color_rendering),
+ .trait_class = &lsm_null_trait_class
+ },
+ {
+ .name = "cursor",
+ .id = LSM_PROPERTY_OFFSET_TO_ID (LsmSvgStyle, cursor),
+ .trait_class = &lsm_null_trait_class
+ },
+ {
+ .name = "direction",
+ .id = LSM_PROPERTY_OFFSET_TO_ID (LsmSvgStyle, direction),
+ .trait_class = &lsm_null_trait_class
+ },
+ {
+ .name = "display",
+ .id = LSM_PROPERTY_OFFSET_TO_ID (LsmSvgStyle, display),
+ .trait_class = &lsm_null_trait_class
},
{
.name = "fill",
- .id = LSM_PROPERTY_OFFSET_TO_ID (LsmSvgStyle, fill.paint),
+ .id = LSM_PROPERTY_OFFSET_TO_ID (LsmSvgStyle, fill),
.trait_class = &lsm_svg_paint_trait_class
},
{
.name = "fill-opacity",
- .id = LSM_PROPERTY_OFFSET_TO_ID (LsmSvgStyle, fill.opacity),
+ .id = LSM_PROPERTY_OFFSET_TO_ID (LsmSvgStyle, fill_opacity),
.trait_class = &lsm_double_trait_class
},
{
.name = "fill-rule",
- .id = LSM_PROPERTY_OFFSET_TO_ID (LsmSvgStyle, fill.rule),
+ .id = LSM_PROPERTY_OFFSET_TO_ID (LsmSvgStyle, fill_rule),
.trait_class = &lsm_svg_fill_rule_trait_class
},
{
- .name = "stroke",
- .id = LSM_PROPERTY_OFFSET_TO_ID (LsmSvgStyle, stroke.paint),
- .trait_class = &lsm_svg_paint_trait_class
+ .name = "font",
+ .id = LSM_PROPERTY_OFFSET_TO_ID (LsmSvgStyle, font),
+ .trait_class = &lsm_null_trait_class
},
{
- .name = "stroke-opacity",
- .id = LSM_PROPERTY_OFFSET_TO_ID (LsmSvgStyle, stroke.opacity),
- .trait_class = &lsm_double_trait_class
+ .name = "font-family",
+ .id = LSM_PROPERTY_OFFSET_TO_ID (LsmSvgStyle, font_family),
+ .trait_class = &lsm_null_trait_class
},
{
- .name = "stroke-width",
- .id = LSM_PROPERTY_OFFSET_TO_ID (LsmSvgStyle, stroke.width),
+ .name = "font-size",
+ .id = LSM_PROPERTY_OFFSET_TO_ID (LsmSvgStyle, font_size),
.trait_class = &lsm_svg_length_trait_class
},
{
- .name = "stroke-linejoin",
- .id = LSM_PROPERTY_OFFSET_TO_ID (LsmSvgStyle, stroke.line_join),
- .trait_class = &lsm_svg_line_join_trait_class
+ .name = "font-size-adjust",
+ .id = LSM_PROPERTY_OFFSET_TO_ID (LsmSvgStyle, font_size_adjust),
+ .trait_class = &lsm_null_trait_class
},
{
- .name = "stroke-linecap",
- .id = LSM_PROPERTY_OFFSET_TO_ID (LsmSvgStyle, stroke.line_cap),
- .trait_class = &lsm_svg_line_cap_trait_class
+ .name = "font-stretch",
+ .id = LSM_PROPERTY_OFFSET_TO_ID (LsmSvgStyle, font_stretch),
+ .trait_class = &lsm_null_trait_class
},
{
- .name = "stroke-miterlimit",
- .id = LSM_PROPERTY_OFFSET_TO_ID (LsmSvgStyle, stroke.miter_limit),
- .trait_class = &lsm_double_trait_class
+ .name = "font-style",
+ .id = LSM_PROPERTY_OFFSET_TO_ID (LsmSvgStyle, font_style),
+ .trait_class = &lsm_null_trait_class
},
{
- .name = "stroke-dashoffset",
- .id = LSM_PROPERTY_OFFSET_TO_ID (LsmSvgStyle, stroke.dash_offset),
- .trait_class = &lsm_svg_length_trait_class
+ .name = "font-variant",
+ .id = LSM_PROPERTY_OFFSET_TO_ID (LsmSvgStyle, font_variant),
+ .trait_class = &lsm_null_trait_class
+ },
+ {
+ .name = "font-weight",
+ .id = LSM_PROPERTY_OFFSET_TO_ID (LsmSvgStyle, font_weight),
+ .trait_class = &lsm_null_trait_class
+ },
+ {
+ .name = "glyph-orientation-horizontal",
+ .id = LSM_PROPERTY_OFFSET_TO_ID (LsmSvgStyle, glyph_orientation_horizontal),
+ .trait_class = &lsm_null_trait_class
+ },
+ {
+ .name = "glyph-orientation-vertical",
+ .id = LSM_PROPERTY_OFFSET_TO_ID (LsmSvgStyle, glyph_orientation_vertical),
+ .trait_class = &lsm_null_trait_class
+ },
+ {
+ .name = "image-rendering",
+ .id = LSM_PROPERTY_OFFSET_TO_ID (LsmSvgStyle, image_rendering),
+ .trait_class = &lsm_null_trait_class
+ },
+ {
+ .name = "kerning",
+ .id = LSM_PROPERTY_OFFSET_TO_ID (LsmSvgStyle, kerning),
+ .trait_class = &lsm_null_trait_class
+ },
+ {
+ .name = "letter-spacing",
+ .id = LSM_PROPERTY_OFFSET_TO_ID (LsmSvgStyle, letter_spacing),
+ .trait_class = &lsm_null_trait_class
+ },
+ {
+ .name = "marker",
+ .id = LSM_PROPERTY_OFFSET_TO_ID (LsmSvgStyle, marker),
+ .trait_class = &lsm_null_trait_class
+ },
+ {
+ .name = "marker-end",
+ .id = LSM_PROPERTY_OFFSET_TO_ID (LsmSvgStyle, marker_end),
+ .trait_class = &lsm_null_trait_class
+ },
+ {
+ .name = "marker-mid",
+ .id = LSM_PROPERTY_OFFSET_TO_ID (LsmSvgStyle, marker_mid),
+ .trait_class = &lsm_null_trait_class
+ },
+ {
+ .name = "marker-start",
+ .id = LSM_PROPERTY_OFFSET_TO_ID (LsmSvgStyle, marker_start),
+ .trait_class = &lsm_null_trait_class
+ },
+ {
+ .name = "pointer-events",
+ .id = LSM_PROPERTY_OFFSET_TO_ID (LsmSvgStyle, pointer_events),
+ .trait_class = &lsm_null_trait_class
+ },
+ {
+ .name = "shape-rendering",
+ .id = LSM_PROPERTY_OFFSET_TO_ID (LsmSvgStyle, shape_rendering),
+ .trait_class = &lsm_null_trait_class
+ },
+ {
+ .name = "stroke",
+ .id = LSM_PROPERTY_OFFSET_TO_ID (LsmSvgStyle, stroke),
+ .trait_class = &lsm_svg_paint_trait_class
},
{
.name = "stroke-dasharray",
- .id = LSM_PROPERTY_OFFSET_TO_ID (LsmSvgStyle, stroke.dash_array),
+ .id = LSM_PROPERTY_OFFSET_TO_ID (LsmSvgStyle, stroke_dash_array),
.trait_class = &lsm_svg_dash_array_trait_class
},
{
- .name = "font-family",
- .id = LSM_PROPERTY_OFFSET_TO_ID (LsmSvgStyle, text.font_family),
- .trait_class = &lsm_null_trait_class
+ .name = "stroke-dashoffset",
+ .id = LSM_PROPERTY_OFFSET_TO_ID (LsmSvgStyle, stroke_dash_offset),
+ .trait_class = &lsm_svg_length_trait_class
},
{
- .name = "font-size",
- .id = LSM_PROPERTY_OFFSET_TO_ID (LsmSvgStyle, text.font_size),
+ .name = "stroke-linecap",
+ .id = LSM_PROPERTY_OFFSET_TO_ID (LsmSvgStyle, stroke_line_cap),
+ .trait_class = &lsm_svg_line_cap_trait_class
+ },
+ {
+ .name = "stroke-linejoin",
+ .id = LSM_PROPERTY_OFFSET_TO_ID (LsmSvgStyle, stroke_line_join),
+ .trait_class = &lsm_svg_line_join_trait_class
+ },
+ {
+ .name = "stroke-miterlimit",
+ .id = LSM_PROPERTY_OFFSET_TO_ID (LsmSvgStyle, stroke_miter_limit),
+ .trait_class = &lsm_double_trait_class
+ },
+ {
+ .name = "stroke-opacity",
+ .id = LSM_PROPERTY_OFFSET_TO_ID (LsmSvgStyle, stroke_opacity),
+ .trait_class = &lsm_double_trait_class
+ },
+ {
+ .name = "stroke-width",
+ .id = LSM_PROPERTY_OFFSET_TO_ID (LsmSvgStyle, stroke_width),
.trait_class = &lsm_svg_length_trait_class
},
{
- .name = "clip-path",
- .id = LSM_PROPERTY_OFFSET_TO_ID (LsmSvgStyle, clip.url),
+ .name = "text-anchor",
+ .id = LSM_PROPERTY_OFFSET_TO_ID (LsmSvgStyle, text_anchor),
.trait_class = &lsm_null_trait_class
},
{
- .name = "clip-rule",
- .id = LSM_PROPERTY_OFFSET_TO_ID (LsmSvgStyle, clip.rule),
- .trait_class = &lsm_svg_fill_rule_trait_class
+ .name = "text-rendering",
+ .id = LSM_PROPERTY_OFFSET_TO_ID (LsmSvgStyle, text_rendering),
+ .trait_class = &lsm_null_trait_class
},
{
- .name = "mask",
- .id = LSM_PROPERTY_OFFSET_TO_ID (LsmSvgStyle, mask.url),
+ .name = "visibility",
+ .id = LSM_PROPERTY_OFFSET_TO_ID (LsmSvgStyle, visibility),
.trait_class = &lsm_null_trait_class
},
{
- .name = "stop-color",
- .id = LSM_PROPERTY_OFFSET_TO_ID (LsmSvgStyle, gradient_stop.color),
- .trait_class = &lsm_svg_color_trait_class
+ .name = "word-spacing",
+ .id = LSM_PROPERTY_OFFSET_TO_ID (LsmSvgStyle, word_spacing),
+ .trait_class = &lsm_null_trait_class
},
{
- .name = "stop-opacity",
- .id = LSM_PROPERTY_OFFSET_TO_ID (LsmSvgStyle, gradient_stop.opacity),
- .trait_class = &lsm_double_trait_class
+ .name = "writing-mode",
+ .id = LSM_PROPERTY_OFFSET_TO_ID (LsmSvgStyle, writing_mode),
+ .trait_class = &lsm_null_trait_class
}
};
@@ -179,16 +380,14 @@ lsm_svg_property_bag_serialize (LsmPropertyBag *property_bag)
return lsm_property_manager_serialize (property_manager, property_bag);
}
-#if 0
LsmSvgStyle *
lsm_svg_style_new (void)
{
LsmSvgStyle *style;
style = g_new0 (LsmSvgStyle, 1);
- g_return_val_if_fail (style != NULL, NULL);
- style->text.font_family = g_strdup ("sans");
+/* style->text.font_family = g_strdup ("sans");*/
return style;
}
@@ -198,9 +397,9 @@ lsm_svg_style_free (LsmSvgStyle *style)
{
g_return_if_fail (style != NULL);
- lsm_svg_dash_array_free (style->stroke.dash_array);
+/* lsm_svg_dash_array_free (style->stroke.dash_array);*/
- g_free (style->text.font_family);
+/* g_free (style->text.font_family);*/
g_free (style);
}
@@ -211,14 +410,13 @@ lsm_svg_style_duplicate (const LsmSvgStyle *from)
g_return_val_if_fail (from != NULL, NULL);
- style = lsm_svg_style_new ();
- g_return_val_if_fail (style != NULL, NULL);
+ style = g_new (LsmSvgStyle, 1);
- memcpy (style, from, sizeof (LsmSvgStyle));
+ memset (style, 0, offsetof (LsmSvgStyle, clip_path));
+ memcpy (&style->clip_path, &from->clip_path, sizeof (LsmSvgStyle) - offsetof (LsmSvgStyle, clip_path));
- style->stroke.dash_array = lsm_svg_dash_array_duplicate (from->stroke.dash_array);
- style->text.font_family = g_strdup (from->text.font_family);
+/* style->stroke.dash_array = lsm_svg_dash_array_duplicate (from->stroke.dash_array);*/
+/* style->text.font_family = g_strdup (from->text.font_family);*/
return style;
}
-#endif
diff --git a/src/lsmsvgstyle.h b/src/lsmsvgstyle.h
index 87d8238..8614697 100644
--- a/src/lsmsvgstyle.h
+++ b/src/lsmsvgstyle.h
@@ -70,53 +70,76 @@ typedef struct {
typedef struct {
LsmProperty base;
- LsmSvgDashArray *value;
+ LsmSvgDashArray value;
} LsmSvgDashArrayProperty;
struct _LsmSvgStyle {
+ /* Not inherited */
+
+ LsmProperty * alignment_baseline;
+ LsmProperty * baseline_shift;
+ LsmProperty * clip;
+ LsmProperty * clip_path;
+ LsmProperty * dominant_baseline;
+ LsmProperty * enable_background;
+ LsmProperty * filter;
+ LsmProperty * flood_color;
+ LsmProperty * flood_opacity;
+ LsmProperty * lighting_color;
+ LsmProperty * mask;
+ LsmSvgDoubleProperty * opacity;
+ LsmProperty * overflow;
+ LsmProperty * stop_color;
+ LsmProperty * stop_opacity;
+ LsmProperty * text_decoration;
+ LsmProperty * unicode_bidi;
+
+ /* Inherited */
+
+ LsmSvgFillRuleProperty * clip_rule;
LsmSvgColorProperty * color;
- LsmSvgDoubleProperty * group_opacity;
- LsmSvgTransformProperty * transform;
-
- struct {
- LsmSvgPaintProperty * paint;
- LsmSvgDoubleProperty * opacity;
- LsmSvgFillRuleProperty * rule;
- } fill;
-
- struct {
- LsmSvgPaintProperty * paint;
- LsmSvgDoubleProperty * opacity;
- LsmSvgLengthProperty * width;
- LsmSvgLineJoinProperty * line_join;
- LsmSvgLineCapProperty * line_cap;
- LsmSvgDoubleProperty * miter_limit;
- LsmSvgLengthProperty * dash_offset;
- LsmSvgDashArrayProperty * dash_array;
- } stroke;
-
- struct {
- LsmProperty * font_family;
- LsmSvgLengthProperty * font_size;
- } text;
-
- struct {
- LsmProperty * url;
- LsmSvgFillRuleProperty * rule;
- } clip;
-
- struct {
- LsmProperty * url;
- } mask;
-
- struct {
- LsmSvgTransformProperty * tranform;
- } gradient;
-
- struct {
- LsmSvgColorProperty * color;
- LsmSvgDoubleProperty * opacity;
- } gradient_stop;
+ LsmProperty * color_interpolation;
+ LsmProperty * color_interpolation_filters;
+ LsmProperty * color_profile;
+ LsmProperty * color_rendering;
+ LsmProperty * cursor;
+ LsmProperty * direction;
+ LsmProperty * display;
+ LsmSvgPaintProperty * fill;
+ LsmSvgDoubleProperty * fill_opacity;
+ LsmSvgFillRuleProperty * fill_rule;
+ LsmProperty * font;
+ LsmProperty * font_family;
+ LsmSvgLengthProperty * font_size;
+ LsmProperty * font_size_adjust;
+ LsmProperty * font_stretch;
+ LsmProperty * font_style;
+ LsmProperty * font_variant;
+ LsmProperty * font_weight;
+ LsmProperty * glyph_orientation_horizontal;
+ LsmProperty * glyph_orientation_vertical;
+ LsmProperty * image_rendering;
+ LsmProperty * kerning;
+ LsmProperty * letter_spacing;
+ LsmProperty * marker;
+ LsmProperty * marker_end;
+ LsmProperty * marker_mid;
+ LsmProperty * marker_start;
+ LsmProperty * pointer_events;
+ LsmProperty * shape_rendering;
+ LsmSvgPaintProperty * stroke;
+ LsmSvgDashArrayProperty * stroke_dash_array;
+ LsmSvgLengthProperty * stroke_dash_offset;
+ LsmSvgLineCapProperty * stroke_line_cap;
+ LsmSvgLineJoinProperty * stroke_line_join;
+ LsmSvgDoubleProperty * stroke_miter_limit;
+ LsmSvgDoubleProperty * stroke_opacity;
+ LsmSvgLengthProperty * stroke_width;
+ LsmProperty * text_anchor;
+ LsmProperty * text_rendering;
+ LsmProperty * visibility;
+ LsmProperty * word_spacing;
+ LsmProperty * writing_mode;
};
void lsm_svg_property_bag_set_property (LsmPropertyBag *property_bag,
@@ -163,10 +186,11 @@ struct _LsmSvgStyle {
} stop;
};
+#endif
+
LsmSvgStyle * lsm_svg_style_new (void);
void lsm_svg_style_free (LsmSvgStyle *style);
LsmSvgStyle * lsm_svg_style_duplicate (const LsmSvgStyle *style);
-#endif
G_END_DECLS
diff --git a/src/lsmsvgsvgelement.c b/src/lsmsvgsvgelement.c
index 007cdaa..f04e3ff 100644
--- a/src/lsmsvgsvgelement.c
+++ b/src/lsmsvgsvgelement.c
@@ -140,11 +140,14 @@ lsm_svg_svg_element_graphic_render (LsmSvgElement *self, LsmSvgView *view)
viewport.width = lsm_svg_view_normalize_length (view, &svg->width.length, LSM_SVG_LENGTH_DIRECTION_HORIZONTAL);
viewport.height = lsm_svg_view_normalize_length (view, &svg->height.length, LSM_SVG_LENGTH_DIRECTION_VERTICAL);
- is_viewbox_defined = lsm_dom_attribute_is_defined ((LsmDomAttribute *) &svg->viewbox);
+/* is_viewbox_defined = lsm_dom_attribute_is_defined ((LsmDomAttribute *) &svg->viewbox);*/
- if (is_viewbox_defined && (svg->viewbox.value.width <= 0.0 ||
- svg->viewbox.value.height <= 0.0))
- return;
+/* if (is_viewbox_defined && (svg->viewbox.value.width <= 0.0 ||*/
+/* svg->viewbox.value.height <= 0.0))*/
+/* return;*/
+
+ is_viewbox_defined = svg->viewbox.value.width > 0.0 && svg->viewbox.value.height > 0.0;
+/* return;*/
lsm_debug ("[LsmSvgSvgElement::graphic_render] viewport %g, %g, %g, %g",
viewport.x, viewport.y, viewport.width, viewport.height);
@@ -167,23 +170,23 @@ lsm_svg_svg_element_get_default_style (LsmSvgSvgElement *svg_element)
return svg_element->default_style;
}
-void
-lsm_svg_svg_element_update (LsmSvgSvgElement *svg_element)
-{
- LsmDomDocument *document;
- LsmSvgStyle *style;
+/*void*/
+/*lsm_svg_svg_element_update (LsmSvgSvgElement *svg_element)*/
+/*{*/
+/* LsmDomDocument *document;*/
+/* LsmSvgStyle *style;*/
- g_return_if_fail (LSM_IS_SVG_SVG_ELEMENT (svg_element));
+/* g_return_if_fail (LSM_IS_SVG_SVG_ELEMENT (svg_element));*/
- document = LSM_DOM_DOCUMENT (LSM_DOM_NODE (svg_element)->parent_node);
- g_return_if_fail (LSM_IS_DOM_DOCUMENT (document));
+/* document = LSM_DOM_DOCUMENT (LSM_DOM_NODE (svg_element)->parent_node);*/
+/* g_return_if_fail (LSM_IS_DOM_DOCUMENT (document));*/
- style = lsm_svg_svg_element_get_default_style (svg_element);
+/* style = lsm_svg_svg_element_get_default_style (svg_element);*/
- style->viewport = lsm_dom_document_get_viewport_px (document);
+/* style->viewport = lsm_dom_document_get_viewport_px (document);*/
- lsm_svg_element_update (LSM_SVG_ELEMENT (svg_element), style);
-}
+/* lsm_svg_element_update (LSM_SVG_ELEMENT (svg_element), style);*/
+/*}*/
void
lsm_svg_svg_element_render (LsmSvgSvgElement *svg, LsmSvgView *view)
diff --git a/src/lsmsvgsvgelement.h b/src/lsmsvgsvgelement.h
index bfb9f75..280cee5 100644
--- a/src/lsmsvgsvgelement.h
+++ b/src/lsmsvgsvgelement.h
@@ -61,7 +61,7 @@ GType lsm_svg_svg_element_get_type (void);
LsmDomNode * lsm_svg_svg_element_new (void);
LsmSvgStyle * lsm_svg_svg_element_get_default_style (LsmSvgSvgElement *svg_element);
-void lsm_svg_svg_element_update (LsmSvgSvgElement *svg_element);
+//void lsm_svg_svg_element_update (LsmSvgSvgElement *svg_element);
void lsm_svg_svg_element_measure (LsmSvgSvgElement *self, double *width, double *height);
void lsm_svg_svg_element_render (LsmSvgSvgElement *svg_element, LsmSvgView *view);
diff --git a/src/lsmsvgtextelement.c b/src/lsmsvgtextelement.c
index 46713c9..f6dc929 100644
--- a/src/lsmsvgtextelement.c
+++ b/src/lsmsvgtextelement.c
@@ -80,8 +80,8 @@ lsm_svg_text_element_graphic_render (LsmSvgElement *self, LsmSvgView *view)
}
}
- x = lsm_svg_view_normalize_length (view, &text->x.length.base, LSM_SVG_LENGTH_DIRECTION_HORIZONTAL);
- y = lsm_svg_view_normalize_length (view, &text->y.length.base, LSM_SVG_LENGTH_DIRECTION_VERTICAL);
+ x = lsm_svg_view_normalize_length (view, &text->x.length, LSM_SVG_LENGTH_DIRECTION_HORIZONTAL);
+ y = lsm_svg_view_normalize_length (view, &text->y.length, LSM_SVG_LENGTH_DIRECTION_VERTICAL);
lsm_svg_view_show_text (view, g_strstrip (string->str), x, y);
diff --git a/src/lsmsvgtextelement.h b/src/lsmsvgtextelement.h
index c3017ed..c0da1f6 100644
--- a/src/lsmsvgtextelement.h
+++ b/src/lsmsvgtextelement.h
@@ -39,8 +39,8 @@ typedef struct _LsmSvgTextElementClass LsmSvgTextElementClass;
struct _LsmSvgTextElement {
LsmSvgGraphic graphic;
- LsmSvgAnimatedLengthAttribute x;
- LsmSvgAnimatedLengthAttribute y;
+ LsmSvgLengthAttribute x;
+ LsmSvgLengthAttribute y;
};
struct _LsmSvgTextElementClass {
diff --git a/src/lsmsvguseelement.c b/src/lsmsvguseelement.c
index 27bdc56..bafb6ff 100644
--- a/src/lsmsvguseelement.c
+++ b/src/lsmsvguseelement.c
@@ -104,18 +104,18 @@ lsm_svg_use_element_graphic_render (LsmSvgElement *self, LsmSvgView *view)
return;
}
- width = lsm_svg_view_normalize_length (view, &use_element->width.length.base,
+ width = lsm_svg_view_normalize_length (view, &use_element->width.length,
LSM_SVG_LENGTH_DIRECTION_HORIZONTAL);
- height = lsm_svg_view_normalize_length (view, &use_element->height.length.base,
+ height = lsm_svg_view_normalize_length (view, &use_element->height.length,
LSM_SVG_LENGTH_DIRECTION_VERTICAL);
/* if (width <= 0.0 || height <= 0.0)*/
/* return;*/
lsm_debug ("[LsmSvgUseElement::graphic_render] Use '%s'", id);
- x = lsm_svg_view_normalize_length (view, &use_element->x.length.base,
+ x = lsm_svg_view_normalize_length (view, &use_element->x.length,
LSM_SVG_LENGTH_DIRECTION_HORIZONTAL);
- y = lsm_svg_view_normalize_length (view, &use_element->y.length.base,
+ y = lsm_svg_view_normalize_length (view, &use_element->y.length,
LSM_SVG_LENGTH_DIRECTION_VERTICAL);
lsm_svg_matrix_init_translate (&matrix, x, y);
diff --git a/src/lsmsvguseelement.h b/src/lsmsvguseelement.h
index 285d7e8..5b33c89 100644
--- a/src/lsmsvguseelement.h
+++ b/src/lsmsvguseelement.h
@@ -39,12 +39,12 @@ typedef struct _LsmSvgUseElementClass LsmSvgUseElementClass;
struct _LsmSvgUseElement {
LsmSvgGraphic graphic;
- LsmSvgAnimatedLengthAttribute x;
- LsmSvgAnimatedLengthAttribute y;
- LsmSvgAnimatedLengthAttribute width;
- LsmSvgAnimatedLengthAttribute height;
+ LsmSvgLengthAttribute x;
+ LsmSvgLengthAttribute y;
+ LsmSvgLengthAttribute width;
+ LsmSvgLengthAttribute height;
- LsmDomAttribute href;
+ LsmAttribute href;
};
struct _LsmSvgUseElementClass {
diff --git a/src/lsmsvgview.c b/src/lsmsvgview.c
index 598a135..518093b 100644
--- a/src/lsmsvgview.c
+++ b/src/lsmsvgview.c
@@ -58,11 +58,14 @@ lsm_svg_view_normalize_length (LsmSvgView *view, const LsmSvgLength *length, Lsm
g_return_val_if_fail (LSM_IS_SVG_VIEW (view), 0.0);
/* TODO cache font size */
- if (view->text_stack != NULL && view->viewbox_stack != NULL) {
- LsmSvgTextAttributeBag *text;
-
- text = view->text_stack->data;
- font_size = lsm_svg_length_normalize (&text->font_size.length, view->viewbox_stack->data,
+/* if (view->text_stack != NULL && view->viewbox_stack != NULL) {*/
+ if (view->viewbox_stack != NULL && view->style != NULL) {
+/* LsmSvgTextAttributeBag *text;*/
+
+/* text = view->text_stack->data;*/
+/* font_size = lsm_svg_length_normalize (&text->font_size.length, view->viewbox_stack->data,*/
+/* 0.0, LSM_SVG_LENGTH_DIRECTION_DIAGONAL);*/
+ font_size = lsm_svg_length_normalize (&view->style->font_size->length, view->viewbox_stack->data,
0.0, LSM_SVG_LENGTH_DIRECTION_DIAGONAL);
} else
font_size = 0.0;
@@ -781,33 +784,41 @@ _set_color (LsmSvgView *view, LsmSvgViewPaintOperation operation,
static void
paint (LsmSvgView *view)
{
- LsmSvgFillAttributeBag *fill;
- LsmSvgStrokeAttributeBag *stroke;
+/* LsmSvgFillAttributeBag *fill;*/
+/* LsmSvgStrokeAttributeBag *stroke;*/
LsmSvgGraphic *graphic;
+ const LsmSvgStyle *style;
cairo_t *cairo;
gboolean use_group;
double group_opacity;
- g_return_if_fail (view->fill_stack != NULL);
- g_return_if_fail (view->stroke_stack != NULL);
- g_return_if_fail (view->element_stack != NULL);
+/* g_return_if_fail (view->fill_stack != NULL);*/
+/* g_return_if_fail (view->stroke_stack != NULL);*/
+/* g_return_if_fail (view->element_stack != NULL);*/
graphic = view->element_stack->data;
g_return_if_fail (LSM_IS_SVG_GRAPHIC (graphic));
cairo = view->dom_view.cairo;
- fill = view->fill_stack->data;
- stroke = view->stroke_stack->data;
+ style = view->style;
+
+/* fill = view->fill_stack->data;*/
+/* stroke = view->stroke_stack->data;*/
- if (view->mask_stack != NULL && view->mask_stack->data == graphic->mask) {
- LsmSvgMaskAttributeBag *mask;
+/* if (view->mask_stack != NULL && view->mask_stack->data == graphic->mask) {*/
+ if (style->opacity != NULL) {
+/* LsmSvgMaskAttributeBag *mask;*/
- mask = view->mask_stack->data;
- group_opacity = mask->opacity.value;
+/* mask = view->mask_stack->data;*/
+/* group_opacity = mask->opacity.value;*/
+ group_opacity = style->opacity->value;
- use_group = fill->paint.paint.type != LSM_SVG_PAINT_TYPE_NONE &&
- stroke->paint.paint.type != LSM_SVG_PAINT_TYPE_NONE &&
+/* use_group = fill->paint.paint.type != LSM_SVG_PAINT_TYPE_NONE &&*/
+/* stroke->paint.paint.type != LSM_SVG_PAINT_TYPE_NONE &&*/
+/* group_opacity < 1.0;*/
+ use_group = style->fill->paint.type != LSM_SVG_PAINT_TYPE_NONE &&
+ style->stroke->paint.type != LSM_SVG_PAINT_TYPE_NONE &&
group_opacity < 1.0;
} else {
use_group = FALSE;
@@ -818,18 +829,22 @@ paint (LsmSvgView *view)
if (use_group)
cairo_push_group (cairo);
- if (_set_color (view, LSM_SVG_VIEW_PAINT_OPERATION_FILL,
- &fill->paint.paint, fill->opacity.value * (use_group ? 1.0 : group_opacity))) {
- cairo_set_fill_rule (cairo, fill->rule.value == LSM_SVG_FILL_RULE_EVEN_ODD ?
+ if (_set_color (view,
+ LSM_SVG_VIEW_PAINT_OPERATION_FILL,
+ &style->fill->paint,
+ style->fill_opacity->value * (use_group ? 1.0 : group_opacity))) {
+ cairo_set_fill_rule (cairo, style->fill_rule->value == LSM_SVG_FILL_RULE_EVEN_ODD ?
CAIRO_FILL_RULE_EVEN_ODD : CAIRO_FILL_RULE_WINDING);
cairo_fill_preserve (cairo);
}
- if (_set_color (view, LSM_SVG_VIEW_PAINT_OPERATION_STROKE,
- &stroke->paint.paint, stroke->opacity.value * (use_group ? 1.0 : group_opacity))) {
+ if (_set_color (view,
+ LSM_SVG_VIEW_PAINT_OPERATION_STROKE,
+ &style->stroke->paint,
+ style->stroke_opacity->value * (use_group ? 1.0 : group_opacity))) {
double line_width;
- switch (stroke->line_join.value) {
+ switch (style->stroke_line_join->value) {
case LSM_SVG_LINE_JOIN_MITER:
cairo_set_line_join (cairo, CAIRO_LINE_JOIN_MITER);
break;
@@ -840,7 +855,7 @@ paint (LsmSvgView *view)
cairo_set_line_join (cairo,CAIRO_LINE_JOIN_BEVEL);
}
- switch (stroke->line_cap.value) {
+ switch (style->stroke_line_cap->value) {
case LSM_SVG_LINE_CAP_BUTT:
cairo_set_line_cap (cairo, CAIRO_LINE_CAP_BUTT);
break;
@@ -851,31 +866,28 @@ paint (LsmSvgView *view)
cairo_set_line_cap (cairo, CAIRO_LINE_CAP_SQUARE);
}
- line_width = lsm_svg_view_normalize_length (view, &stroke->width.length,
+ line_width = lsm_svg_view_normalize_length (view, &style->stroke_width->length,
LSM_SVG_LENGTH_DIRECTION_DIAGONAL);
- cairo_set_miter_limit (cairo, stroke->miter_limit.value);
+ cairo_set_miter_limit (cairo, style->stroke_miter_limit->value);
cairo_set_line_width (cairo, line_width);
- if (stroke->dash_array.value != NULL &&
- stroke->dash_array.value->n_dashes > 0) {
+ if (style->stroke_dash_array->value.n_dashes > 0) {
+/* != NULL &&*/
+/* stroke->dash_array.value->n_dashes > 0) {*/
double dash_offset;
double *dashes;
unsigned int i;
- dash_offset = lsm_svg_view_normalize_length (view, &stroke->dash_offset.length,
+ dash_offset = lsm_svg_view_normalize_length (view, &style->stroke_dash_offset->length,
LSM_SVG_LENGTH_DIRECTION_DIAGONAL);
- dashes = g_new(double, stroke->dash_array.value->n_dashes);
- for (i = 0; i < stroke->dash_array.value->n_dashes; i++)
+ dashes = g_new (double, style->stroke_dash_array->value.n_dashes);
+ for (i = 0; i < style->stroke_dash_array->value.n_dashes; i++)
dashes[i] = lsm_svg_view_normalize_length (view,
- &stroke->dash_array.value->dashes[i],
+ &style->stroke_dash_array->value.dashes[i],
LSM_SVG_LENGTH_DIRECTION_DIAGONAL);
- cairo_set_dash (cairo,
- dashes,
- stroke->dash_array.value->n_dashes,
- dash_offset);
-
+ cairo_set_dash (cairo, dashes, style->stroke_dash_array->value.n_dashes, dash_offset);
g_free (dashes);
} else
cairo_set_dash (cairo, NULL, 0, 0.0);
@@ -895,10 +907,11 @@ static void
process_path (LsmSvgView *view)
{
if (view->is_clipping) {
- LsmSvgMaskAttributeBag *mask;
+/* LsmSvgMaskAttributeBag *mask;*/
- mask = view->mask_stack->data;
- cairo_set_fill_rule (view->dom_view.cairo, mask->clip_rule.value);
+/* mask = view->mask_stack->data;*/
+/* cairo_set_fill_rule (view->dom_view.cairo, mask->clip_rule.value);*/
+ cairo_set_fill_rule (view->dom_view.cairo, view->style->clip_rule->value);
} else
paint (view);
}
@@ -1051,11 +1064,12 @@ lsm_svg_view_show_polygon (LsmSvgView *view, const char *points)
void
lsm_svg_view_show_text (LsmSvgView *view, char const *string, double x, double y)
{
+ const LsmSvgStyle *style;
PangoLayout *pango_layout;
PangoFontDescription *font_description;
PangoLayoutIter *iter;
PangoRectangle ink_rect;
- LsmSvgTextAttributeBag *text;
+/* LsmSvgTextAttributeBag *text;*/
double font_size;
int baseline;
@@ -1064,15 +1078,17 @@ lsm_svg_view_show_text (LsmSvgView *view, char const *string, double x, double y
g_return_if_fail (LSM_IS_SVG_VIEW (view));
- text = view->text_stack->data;
- g_return_if_fail (text != NULL);
+ style = view->style;
+/* text = view->text_stack->data;*/
+/* g_return_if_fail (text != NULL);*/
pango_layout = view->dom_view.pango_layout;
font_description = view->dom_view.font_description;
- font_size = lsm_svg_view_normalize_length (view, &text->font_size.length, LSM_SVG_LENGTH_DIRECTION_DIAGONAL);
+ font_size = lsm_svg_view_normalize_length (view, &style->font_size->length,
+ LSM_SVG_LENGTH_DIRECTION_DIAGONAL);
- pango_font_description_set_family (font_description, text->font_family.value);
+ pango_font_description_set_family (font_description, style->font_family->value);
pango_font_description_set_size (font_description, font_size * PANGO_SCALE);
pango_layout_set_text (pango_layout, string, -1);
@@ -1290,6 +1306,7 @@ lsm_svg_view_pop_element (LsmSvgView *view)
view->element_stack = g_slist_delete_link (view->element_stack, view->element_stack);
}
+#if 0
static void
lsm_svg_view_push_clip (LsmSvgView *view, char *clip_path, LsmSvgFillRule clip_rule)
{
@@ -1531,6 +1548,8 @@ lsm_svg_view_pop_text_attributes (LsmSvgView *view)
view->text_stack = g_slist_delete_link (view->text_stack, view->text_stack);
}
+#endif
+
const LsmBox *
lsm_svg_view_get_pattern_extents (LsmSvgView *view)
{
@@ -1562,7 +1581,7 @@ lsm_svg_view_measure (LsmDomView *view, double *width, double *height)
if (svg_element == NULL)
return;
- lsm_svg_svg_element_update (svg_element);
+/* lsm_svg_svg_element_update (svg_element);*/
lsm_svg_svg_element_measure (svg_element, width, height);
}
@@ -1579,14 +1598,15 @@ lsm_svg_view_render (LsmDomView *view)
if (svg_element == NULL)
return;
- lsm_svg_svg_element_update (svg_element);
+/* lsm_svg_svg_element_update (svg_element);*/
+ svg_view->style_stack = NULL;
svg_view->element_stack = NULL;
svg_view->viewbox_stack = NULL;
- svg_view->mask_stack = NULL;
- svg_view->fill_stack = NULL;
- svg_view->stroke_stack = NULL;
- svg_view->text_stack = NULL;
+/* svg_view->mask_stack = NULL;*/
+/* svg_view->fill_stack = NULL;*/
+/* svg_view->stroke_stack = NULL;*/
+/* svg_view->text_stack = NULL;*/
svg_view->matrix_stack = NULL;
svg_view->is_clipping = FALSE;
@@ -1608,31 +1628,36 @@ lsm_svg_view_render (LsmDomView *view)
g_slist_free (svg_view->viewbox_stack);
svg_view->viewbox_stack = NULL;
}
- if (svg_view->fill_stack != NULL) {
- g_warning ("[LsmSvgView::render] Dangling fill attributes in stack");
- g_slist_free (svg_view->fill_stack);
- svg_view->fill_stack = NULL;
- }
- if (svg_view->stroke_stack != NULL) {
- g_warning ("[LsmSvgView::render] Dangling stroke attributes in stack");
- g_slist_free (svg_view->stroke_stack);
- svg_view->stroke_stack = NULL;
- }
- if (svg_view->mask_stack != NULL) {
- g_warning ("[LsmSvgView::render] Dangling mask attributes in stack");
- g_slist_free (svg_view->mask_stack);
- svg_view->mask_stack = NULL;
- }
- if (svg_view->text_stack != NULL) {
- g_warning ("[LsmSvgView::render] Dangling text attribute in stack");
- g_slist_free (svg_view->text_stack);
- svg_view->text_stack = NULL;
- }
+/* if (svg_view->fill_stack != NULL) {*/
+/* g_warning ("[LsmSvgView::render] Dangling fill attributes in stack");*/
+/* g_slist_free (svg_view->fill_stack);*/
+/* svg_view->fill_stack = NULL;*/
+/* }*/
+/* if (svg_view->stroke_stack != NULL) {*/
+/* g_warning ("[LsmSvgView::render] Dangling stroke attributes in stack");*/
+/* g_slist_free (svg_view->stroke_stack);*/
+/* svg_view->stroke_stack = NULL;*/
+/* }*/
+/* if (svg_view->mask_stack != NULL) {*/
+/* g_warning ("[LsmSvgView::render] Dangling mask attributes in stack");*/
+/* g_slist_free (svg_view->mask_stack);*/
+/* svg_view->mask_stack = NULL;*/
+/* }*/
+/* if (svg_view->text_stack != NULL) {*/
+/* g_warning ("[LsmSvgView::render] Dangling text attribute in stack");*/
+/* g_slist_free (svg_view->text_stack);*/
+/* svg_view->text_stack = NULL;*/
+/* }*/
if (svg_view->element_stack != NULL) {
g_warning ("[LsmSvgView::render] Dangling element in stack");
g_slist_free (svg_view->element_stack);
svg_view->element_stack = NULL;
}
+ if (svg_view->style_stack != NULL) {
+ g_warning ("[LsmSvgView::render] Dangling style in stack");
+ g_slist_free (svg_view->style_stack);
+ svg_view->style_stack = NULL;
+ }
}
LsmSvgView *
diff --git a/src/lsmsvgview.h b/src/lsmsvgview.h
index d295ffe..8b375ec 100644
--- a/src/lsmsvgview.h
+++ b/src/lsmsvgview.h
@@ -51,12 +51,15 @@ struct _LsmSvgView {
double resolution_ppi;
+ const LsmSvgStyle *style;
+
+ GSList *style_stack;
GSList *element_stack;
GSList *viewbox_stack;
- GSList *mask_stack;
- GSList *fill_stack;
- GSList *stroke_stack;
- GSList *text_stack;
+// GSList *mask_stack;
+// GSList *fill_stack;
+// GSList *stroke_stack;
+// GSList *text_stack;
GSList *matrix_stack;
LsmSvgViewPatternData *pattern_data;
@@ -122,17 +125,20 @@ void lsm_svg_view_pop_matrix (LsmSvgView *view);
void lsm_svg_view_push_element (LsmSvgView *view, const LsmSvgElement *element);
void lsm_svg_view_pop_element (LsmSvgView *view);
-void lsm_svg_view_push_group_opacity (LsmSvgView *view);
-void lsm_svg_view_pop_group_opacity (LsmSvgView *view);
-
-void lsm_svg_view_push_mask_attributes (LsmSvgView *view, const LsmSvgMaskAttributeBag *mask);
-void lsm_svg_view_pop_mask_attributes (LsmSvgView *view);
-void lsm_svg_view_push_fill_attributes (LsmSvgView *view, const LsmSvgFillAttributeBag *fill);
-void lsm_svg_view_pop_fill_attributes (LsmSvgView *view);
-void lsm_svg_view_push_stroke_attributes (LsmSvgView *view, const LsmSvgStrokeAttributeBag *stroke);
-void lsm_svg_view_pop_stroke_attributes (LsmSvgView *view);
-void lsm_svg_view_push_text_attributes (LsmSvgView *view, const LsmSvgTextAttributeBag *text);
-void lsm_svg_view_pop_text_attributes (LsmSvgView *view);
+//void lsm_svg_view_push_group_opacity (LsmSvgView *view);
+//void lsm_svg_view_pop_group_opacity (LsmSvgView *view);
+
+void lsm_svg_view_push_style (LsmSvgView *view, const LsmSvgStyle *style);
+void lsm_svg_view_pop_style (LsmSvgView *view, const LsmSvgStyle *style);
+
+//void lsm_svg_view_push_mask_attributes (LsmSvgView *view, const LsmSvgMaskAttributeBag *mask);
+//void lsm_svg_view_pop_mask_attributes (LsmSvgView *view);
+//void lsm_svg_view_push_fill_attributes (LsmSvgView *view, const LsmSvgFillAttributeBag *fill);
+//void lsm_svg_view_pop_fill_attributes (LsmSvgView *view);
+//void lsm_svg_view_push_stroke_attributes (LsmSvgView *view, const LsmSvgStrokeAttributeBag *stroke);
+//void lsm_svg_view_pop_stroke_attributes (LsmSvgView *view);
+//void lsm_svg_view_push_text_attributes (LsmSvgView *view, const LsmSvgTextAttributeBag *text);
+//void lsm_svg_view_pop_text_attributes (LsmSvgView *view);
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]