[librsvg: 23/30] Move attributes.rs in the xml submodule
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg: 23/30] Move attributes.rs in the xml submodule
- Date: Mon, 28 Dec 2020 20:06:30 +0000 (UTC)
commit 569b4fae180e0fe5f0555ba1c780a6881e0b151c
Author: Paolo Borelli <pborelli gnome org>
Date: Sat Dec 26 15:23:46 2020 +0100
Move attributes.rs in the xml submodule
It is part of the abstraction over libxml2, so it belongs in the submodule.
Makefile.am | 2 +-
po/POTFILES.in | 2 +-
src/document.rs | 3 +--
src/element.rs | 2 +-
src/filter.rs | 2 +-
src/filters/blend.rs | 2 +-
src/filters/color_matrix.rs | 2 +-
src/filters/component_transfer.rs | 2 +-
src/filters/composite.rs | 2 +-
src/filters/convolve_matrix.rs | 2 +-
src/filters/displacement_map.rs | 2 +-
src/filters/flood.rs | 2 +-
src/filters/gaussian_blur.rs | 2 +-
src/filters/image.rs | 2 +-
src/filters/lighting.rs | 2 +-
src/filters/merge.rs | 2 +-
src/filters/mod.rs | 2 +-
src/filters/morphology.rs | 2 +-
src/filters/offset.rs | 2 +-
src/filters/tile.rs | 2 +-
src/filters/turbulence.rs | 2 +-
src/gradient.rs | 2 +-
src/image.rs | 2 +-
src/lib.rs | 1 -
src/marker.rs | 2 +-
src/node.rs | 2 +-
src/pattern.rs | 2 +-
src/properties.rs | 2 +-
src/shapes.rs | 4 ++--
src/structure.rs | 2 +-
src/style.rs | 2 +-
src/text.rs | 2 +-
src/{ => xml}/attributes.rs | 0
src/xml/mod.rs | 4 +++-
src/xml/xml2_load.rs | 2 +-
35 files changed, 36 insertions(+), 36 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 376be0f3..d64bdeb2 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -32,7 +32,6 @@ LIBRSVG_SRC = \
src/angle.rs \
src/api.rs \
src/aspect_ratio.rs \
- src/attributes.rs \
src/bbox.rs \
src/c_api/color_utils.rs \
src/c_api/dpi.rs \
@@ -112,6 +111,7 @@ LIBRSVG_SRC = \
src/util.rs \
src/viewbox.rs \
src/ua.css \
+ src/xml/attributes.rs \
src/xml/mod.rs \
src/xml/xml2_load.rs \
src/xml/xml2.rs \
diff --git a/po/POTFILES.in b/po/POTFILES.in
index ce96f82e..e8e277ad 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -3,7 +3,6 @@
src/angle.rs
src/api.rs
src/aspect_ratio.rs
-src/attributes.rs
src/bbox.rs
src/c_api/color_utils.rs
src/c_api/dpi.rs
@@ -81,6 +80,7 @@ src/unit_interval.rs
src/url_resolver.rs
src/util.rs
src/viewbox.rs
+src/xml/attributes.rs
src/xml/mod.rs
src/xml/xml2.rs
src/xml/xml2_load.rs
diff --git a/src/document.rs b/src/document.rs
index fdb6214b..f28316ef 100644
--- a/src/document.rs
+++ b/src/document.rs
@@ -10,7 +10,6 @@ use std::fmt;
use std::include_str;
use std::rc::Rc;
-use crate::attributes::Attributes;
use crate::css::{self, Origin, Stylesheet};
use crate::error::{AcquireError, AllowedUrlError, LoadingError, NodeIdError};
use crate::handle::LoadOptions;
@@ -19,7 +18,7 @@ use crate::limits;
use crate::node::{Node, NodeBorrow, NodeData};
use crate::surface_utils::shared_surface::SharedImageSurface;
use crate::url_resolver::{AllowedUrl, UrlResolver};
-use crate::xml::xml_load_from_possibly_compressed_stream;
+use crate::xml::{xml_load_from_possibly_compressed_stream, Attributes};
static UA_STYLESHEETS: Lazy<Vec<Stylesheet>> = Lazy::new(|| {
vec![Stylesheet::from_data(
diff --git a/src/element.rs b/src/element.rs
index 3e463280..a417046f 100644
--- a/src/element.rs
+++ b/src/element.rs
@@ -7,7 +7,6 @@ use std::collections::{HashMap, HashSet};
use std::fmt;
use std::ops::Deref;
-use crate::attributes::Attributes;
use crate::bbox::BoundingBox;
use crate::cond::{RequiredExtensions, RequiredFeatures, SystemLanguage};
use crate::css::{Declaration, Origin};
@@ -45,6 +44,7 @@ use crate::structure::{ClipPath, Group, Link, Mask, NonRendering, Svg, Switch, S
use crate::style::Style;
use crate::text::{TRef, TSpan, Text};
use crate::transform::Transform;
+use crate::xml::Attributes;
// After creating/parsing a Element, it will be in a success or an error state.
// We represent this with a Result, aliased as a ElementResult. There is no
diff --git a/src/filter.rs b/src/filter.rs
index 17327cd6..6c2a6c9b 100644
--- a/src/filter.rs
+++ b/src/filter.rs
@@ -4,7 +4,6 @@ use cssparser::Parser;
use markup5ever::{expanded_name, local_name, namespace_url, ns, QualName};
use std::slice::Iter;
-use crate::attributes::Attributes;
use crate::coord_units::CoordUnits;
use crate::document::{AcquiredNodes, NodeId};
use crate::drawing_ctx::ViewParams;
@@ -15,6 +14,7 @@ use crate::node::{Node, NodeBorrow};
use crate::parsers::{Parse, ParseValue};
use crate::properties::ComputedValues;
use crate::rect::Rect;
+use crate::xml::Attributes;
/// The <filter> node.
pub struct Filter {
diff --git a/src/filters/blend.rs b/src/filters/blend.rs
index fbe33ef4..deace8d1 100755
--- a/src/filters/blend.rs
+++ b/src/filters/blend.rs
@@ -1,13 +1,13 @@
use cssparser::Parser;
use markup5ever::{expanded_name, local_name, namespace_url, ns};
-use crate::attributes::Attributes;
use crate::document::AcquiredNodes;
use crate::drawing_ctx::DrawingCtx;
use crate::element::{ElementResult, SetAttributes};
use crate::error::*;
use crate::node::Node;
use crate::parsers::{Parse, ParseValue};
+use crate::xml::Attributes;
use super::context::{FilterContext, FilterOutput, FilterResult};
use super::{FilterEffect, FilterError, Input, PrimitiveWithInput};
diff --git a/src/filters/color_matrix.rs b/src/filters/color_matrix.rs
index 9e279626..e7046316 100644
--- a/src/filters/color_matrix.rs
+++ b/src/filters/color_matrix.rs
@@ -2,7 +2,6 @@ use cssparser::Parser;
use markup5ever::{expanded_name, local_name, namespace_url, ns};
use nalgebra::{Matrix3, Matrix4x5, Matrix5, Vector5};
-use crate::attributes::Attributes;
use crate::document::AcquiredNodes;
use crate::drawing_ctx::DrawingCtx;
use crate::element::{ElementResult, SetAttributes};
@@ -13,6 +12,7 @@ use crate::surface_utils::{
iterators::Pixels, shared_surface::ExclusiveImageSurface, ImageSurfaceDataExt, Pixel,
};
use crate::util::clamp;
+use crate::xml::Attributes;
use super::context::{FilterContext, FilterOutput, FilterResult};
use super::{FilterEffect, FilterError, PrimitiveWithInput};
diff --git a/src/filters/component_transfer.rs b/src/filters/component_transfer.rs
index dad54411..696082d2 100644
--- a/src/filters/component_transfer.rs
+++ b/src/filters/component_transfer.rs
@@ -3,7 +3,6 @@ use std::cmp::min;
use cssparser::Parser;
use markup5ever::{expanded_name, local_name, namespace_url, ns};
-use crate::attributes::Attributes;
use crate::document::AcquiredNodes;
use crate::drawing_ctx::DrawingCtx;
use crate::element::{Draw, Element, ElementResult, SetAttributes};
@@ -14,6 +13,7 @@ use crate::surface_utils::{
iterators::Pixels, shared_surface::ExclusiveImageSurface, ImageSurfaceDataExt, Pixel,
};
use crate::util::clamp;
+use crate::xml::Attributes;
use super::context::{FilterContext, FilterOutput, FilterResult};
use super::{FilterEffect, FilterError, PrimitiveWithInput};
diff --git a/src/filters/composite.rs b/src/filters/composite.rs
index d256869b..1f89f200 100644
--- a/src/filters/composite.rs
+++ b/src/filters/composite.rs
@@ -1,13 +1,13 @@
use cssparser::Parser;
use markup5ever::{expanded_name, local_name, namespace_url, ns};
-use crate::attributes::Attributes;
use crate::document::AcquiredNodes;
use crate::drawing_ctx::DrawingCtx;
use crate::element::{ElementResult, SetAttributes};
use crate::error::*;
use crate::node::Node;
use crate::parsers::{Parse, ParseValue};
+use crate::xml::Attributes;
use super::context::{FilterContext, FilterOutput, FilterResult};
use super::{FilterEffect, FilterError, Input, PrimitiveWithInput};
diff --git a/src/filters/convolve_matrix.rs b/src/filters/convolve_matrix.rs
index 10298e73..c7052d33 100644
--- a/src/filters/convolve_matrix.rs
+++ b/src/filters/convolve_matrix.rs
@@ -2,7 +2,6 @@ use cssparser::Parser;
use markup5ever::{expanded_name, local_name, namespace_url, ns, QualName};
use nalgebra::{DMatrix, Dynamic, VecStorage};
-use crate::attributes::Attributes;
use crate::document::AcquiredNodes;
use crate::drawing_ctx::DrawingCtx;
use crate::element::{ElementResult, SetAttributes};
@@ -18,6 +17,7 @@ use crate::surface_utils::{
EdgeMode, ImageSurfaceDataExt, Pixel,
};
use crate::util::clamp;
+use crate::xml::Attributes;
use super::context::{FilterContext, FilterOutput, FilterResult};
use super::{FilterEffect, FilterError, PrimitiveWithInput};
diff --git a/src/filters/displacement_map.rs b/src/filters/displacement_map.rs
index 3dbabbcb..4eddfef0 100644
--- a/src/filters/displacement_map.rs
+++ b/src/filters/displacement_map.rs
@@ -1,7 +1,6 @@
use cssparser::Parser;
use markup5ever::{expanded_name, local_name, namespace_url, ns};
-use crate::attributes::Attributes;
use crate::document::AcquiredNodes;
use crate::drawing_ctx::DrawingCtx;
use crate::element::{ElementResult, SetAttributes};
@@ -9,6 +8,7 @@ use crate::error::*;
use crate::node::Node;
use crate::parsers::{Parse, ParseValue};
use crate::surface_utils::{iterators::Pixels, shared_surface::ExclusiveImageSurface};
+use crate::xml::Attributes;
use super::context::{FilterContext, FilterOutput, FilterResult};
use super::{FilterEffect, FilterError, Input, PrimitiveWithInput};
diff --git a/src/filters/flood.rs b/src/filters/flood.rs
index 4bf7a91e..e9bd333e 100644
--- a/src/filters/flood.rs
+++ b/src/filters/flood.rs
@@ -1,8 +1,8 @@
-use crate::attributes::Attributes;
use crate::document::AcquiredNodes;
use crate::drawing_ctx::DrawingCtx;
use crate::element::{ElementResult, SetAttributes};
use crate::node::{CascadedValues, Node};
+use crate::xml::Attributes;
use super::context::{FilterContext, FilterOutput, FilterResult};
use super::{FilterEffect, FilterError, Primitive};
diff --git a/src/filters/gaussian_blur.rs b/src/filters/gaussian_blur.rs
index cb448867..a973ca00 100644
--- a/src/filters/gaussian_blur.rs
+++ b/src/filters/gaussian_blur.rs
@@ -4,7 +4,6 @@ use std::f64;
use markup5ever::{expanded_name, local_name, namespace_url, ns};
use nalgebra::{DMatrix, Dynamic, VecStorage};
-use crate::attributes::Attributes;
use crate::document::AcquiredNodes;
use crate::drawing_ctx::DrawingCtx;
use crate::element::{ElementResult, SetAttributes};
@@ -15,6 +14,7 @@ use crate::surface_utils::{
shared_surface::{BlurDirection, Horizontal, SharedImageSurface, Vertical},
EdgeMode,
};
+use crate::xml::Attributes;
use super::context::{FilterContext, FilterOutput, FilterResult};
use super::{FilterEffect, FilterError, PrimitiveWithInput};
diff --git a/src/filters/image.rs b/src/filters/image.rs
index 5d6e040b..9af47502 100644
--- a/src/filters/image.rs
+++ b/src/filters/image.rs
@@ -1,7 +1,6 @@
use markup5ever::{expanded_name, local_name, namespace_url, ns};
use crate::aspect_ratio::AspectRatio;
-use crate::attributes::Attributes;
use crate::document::{AcquiredNodes, NodeId};
use crate::drawing_ctx::DrawingCtx;
use crate::element::{ElementResult, SetAttributes};
@@ -11,6 +10,7 @@ use crate::parsers::ParseValue;
use crate::rect::Rect;
use crate::surface_utils::shared_surface::SharedImageSurface;
use crate::viewbox::ViewBox;
+use crate::xml::Attributes;
use super::context::{FilterContext, FilterOutput, FilterResult};
use super::{FilterEffect, FilterError, Primitive};
diff --git a/src/filters/lighting.rs b/src/filters/lighting.rs
index fe196b48..d390fbbb 100644
--- a/src/filters/lighting.rs
+++ b/src/filters/lighting.rs
@@ -7,7 +7,6 @@ use num_traits::identities::Zero;
use rayon::prelude::*;
use std::cmp::max;
-use crate::attributes::Attributes;
use crate::document::AcquiredNodes;
use crate::drawing_ctx::DrawingCtx;
use crate::element::{Draw, Element, ElementResult, SetAttributes};
@@ -23,6 +22,7 @@ use crate::surface_utils::{
ImageSurfaceDataExt, Pixel,
};
use crate::util::clamp;
+use crate::xml::Attributes;
/// A light source with affine transformations applied.
pub enum LightSource {
diff --git a/src/filters/merge.rs b/src/filters/merge.rs
index 9d1ad0d6..48990339 100644
--- a/src/filters/merge.rs
+++ b/src/filters/merge.rs
@@ -1,6 +1,5 @@
use markup5ever::{expanded_name, local_name, namespace_url, ns};
-use crate::attributes::Attributes;
use crate::document::AcquiredNodes;
use crate::drawing_ctx::DrawingCtx;
use crate::element::{Draw, Element, ElementResult, SetAttributes};
@@ -8,6 +7,7 @@ use crate::node::{Node, NodeBorrow};
use crate::parsers::ParseValue;
use crate::rect::IRect;
use crate::surface_utils::shared_surface::{SharedImageSurface, SurfaceType};
+use crate::xml::Attributes;
use super::context::{FilterContext, FilterOutput, FilterResult};
use super::{FilterEffect, FilterError, Input, Primitive};
diff --git a/src/filters/mod.rs b/src/filters/mod.rs
index 3a8c6c93..640da576 100644
--- a/src/filters/mod.rs
+++ b/src/filters/mod.rs
@@ -5,7 +5,6 @@ use markup5ever::{expanded_name, local_name, namespace_url, ns};
use std::ops::Deref;
use std::time::Instant;
-use crate::attributes::Attributes;
use crate::bbox::BoundingBox;
use crate::coord_units::CoordUnits;
use crate::document::AcquiredNodes;
@@ -19,6 +18,7 @@ use crate::properties::ComputedValues;
use crate::property_defs::ColorInterpolationFilters;
use crate::surface_utils::shared_surface::{SharedImageSurface, SurfaceType};
use crate::transform::Transform;
+use crate::xml::Attributes;
mod bounds;
use self::bounds::BoundsBuilder;
diff --git a/src/filters/morphology.rs b/src/filters/morphology.rs
index c95246b2..65848f16 100644
--- a/src/filters/morphology.rs
+++ b/src/filters/morphology.rs
@@ -3,7 +3,6 @@ use std::cmp::{max, min};
use cssparser::Parser;
use markup5ever::{expanded_name, local_name, namespace_url, ns};
-use crate::attributes::Attributes;
use crate::document::AcquiredNodes;
use crate::drawing_ctx::DrawingCtx;
use crate::element::{ElementResult, SetAttributes};
@@ -16,6 +15,7 @@ use crate::surface_utils::{
shared_surface::ExclusiveImageSurface,
EdgeMode, ImageSurfaceDataExt, Pixel,
};
+use crate::xml::Attributes;
use super::context::{FilterContext, FilterOutput, FilterResult};
use super::{FilterEffect, FilterError, PrimitiveWithInput};
diff --git a/src/filters/offset.rs b/src/filters/offset.rs
index 83790378..5bfe11f9 100644
--- a/src/filters/offset.rs
+++ b/src/filters/offset.rs
@@ -1,11 +1,11 @@
use markup5ever::{expanded_name, local_name, namespace_url, ns};
-use crate::attributes::Attributes;
use crate::document::AcquiredNodes;
use crate::drawing_ctx::DrawingCtx;
use crate::element::{ElementResult, SetAttributes};
use crate::node::Node;
use crate::parsers::ParseValue;
+use crate::xml::Attributes;
use super::context::{FilterContext, FilterOutput, FilterResult};
use super::{FilterEffect, FilterError, PrimitiveWithInput};
diff --git a/src/filters/tile.rs b/src/filters/tile.rs
index 95087e1a..7b3eb3fd 100644
--- a/src/filters/tile.rs
+++ b/src/filters/tile.rs
@@ -1,8 +1,8 @@
-use crate::attributes::Attributes;
use crate::document::AcquiredNodes;
use crate::drawing_ctx::DrawingCtx;
use crate::element::{ElementResult, SetAttributes};
use crate::node::Node;
+use crate::xml::Attributes;
use super::context::{FilterContext, FilterInput, FilterOutput, FilterResult};
use super::{FilterEffect, FilterError, PrimitiveWithInput};
diff --git a/src/filters/turbulence.rs b/src/filters/turbulence.rs
index 79b8fe48..fadffeb7 100644
--- a/src/filters/turbulence.rs
+++ b/src/filters/turbulence.rs
@@ -1,7 +1,6 @@
use cssparser::Parser;
use markup5ever::{expanded_name, local_name, namespace_url, ns};
-use crate::attributes::Attributes;
use crate::document::AcquiredNodes;
use crate::drawing_ctx::DrawingCtx;
use crate::element::{ElementResult, SetAttributes};
@@ -13,6 +12,7 @@ use crate::surface_utils::{
ImageSurfaceDataExt, Pixel, PixelOps,
};
use crate::util::clamp;
+use crate::xml::Attributes;
use super::context::{FilterContext, FilterOutput, FilterResult};
use super::{FilterEffect, FilterError, Primitive};
diff --git a/src/gradient.rs b/src/gradient.rs
index e608295b..e1229db1 100644
--- a/src/gradient.rs
+++ b/src/gradient.rs
@@ -6,7 +6,6 @@ use markup5ever::{
};
use std::cell::RefCell;
-use crate::attributes::Attributes;
use crate::bbox::BoundingBox;
use crate::coord_units::CoordUnits;
use crate::document::{AcquiredNodes, NodeId, NodeStack};
@@ -21,6 +20,7 @@ use crate::properties::ComputedValues;
use crate::property_defs::StopColor;
use crate::transform::Transform;
use crate::unit_interval::UnitInterval;
+use crate::xml::Attributes;
/// Contents of a <stop> element for gradient color stops
#[derive(Copy, Clone)]
diff --git a/src/image.rs b/src/image.rs
index 2f72ce91..0fdd781c 100644
--- a/src/image.rs
+++ b/src/image.rs
@@ -3,7 +3,6 @@
use markup5ever::{expanded_name, local_name, namespace_url, ns};
use crate::aspect_ratio::AspectRatio;
-use crate::attributes::Attributes;
use crate::bbox::BoundingBox;
use crate::document::AcquiredNodes;
use crate::drawing_ctx::DrawingCtx;
@@ -14,6 +13,7 @@ use crate::length::*;
use crate::node::{CascadedValues, Node};
use crate::parsers::ParseValue;
use crate::rect::Rect;
+use crate::xml::Attributes;
#[derive(Default)]
pub struct Image {
diff --git a/src/lib.rs b/src/lib.rs
index 87457bb0..2d768f42 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -95,7 +95,6 @@ mod util;
mod angle;
mod api;
mod aspect_ratio;
-mod attributes;
mod bbox;
pub mod c_api;
mod color;
diff --git a/src/marker.rs b/src/marker.rs
index a29164fc..541feb32 100644
--- a/src/marker.rs
+++ b/src/marker.rs
@@ -8,7 +8,6 @@ use markup5ever::{expanded_name, local_name, namespace_url, ns};
use crate::angle::Angle;
use crate::aspect_ratio::*;
-use crate::attributes::Attributes;
use crate::bbox::BoundingBox;
use crate::document::{AcquiredNodes, NodeId};
use crate::drawing_ctx::DrawingCtx;
@@ -24,6 +23,7 @@ use crate::properties::ComputedValues;
use crate::rect::Rect;
use crate::transform::Transform;
use crate::viewbox::*;
+use crate::xml::Attributes;
// markerUnits attribute: https://www.w3.org/TR/SVG/painting.html#MarkerElement
#[derive(Debug, Copy, Clone, PartialEq)]
diff --git a/src/node.rs b/src/node.rs
index 810d48f5..5c9ddef2 100644
--- a/src/node.rs
+++ b/src/node.rs
@@ -15,7 +15,6 @@ use markup5ever::QualName;
use std::cell::{Ref, RefMut};
use std::fmt;
-use crate::attributes::Attributes;
use crate::bbox::BoundingBox;
use crate::document::AcquiredNodes;
use crate::drawing_ctx::DrawingCtx;
@@ -23,6 +22,7 @@ use crate::element::*;
use crate::error::*;
use crate::properties::ComputedValues;
use crate::text::Chars;
+use crate::xml::Attributes;
/// Strong reference to an element in the SVG tree.
///
diff --git a/src/pattern.rs b/src/pattern.rs
index e9511bfc..7432f06a 100644
--- a/src/pattern.rs
+++ b/src/pattern.rs
@@ -4,7 +4,6 @@ use markup5ever::{expanded_name, local_name, namespace_url, ns};
use std::cell::RefCell;
use crate::aspect_ratio::*;
-use crate::attributes::Attributes;
use crate::bbox::BoundingBox;
use crate::coord_units::CoordUnits;
use crate::document::{AcquiredNodes, NodeId, NodeStack};
@@ -19,6 +18,7 @@ use crate::properties::ComputedValues;
use crate::rect::Rect;
use crate::transform::Transform;
use crate::viewbox::*;
+use crate::xml::Attributes;
coord_units!(PatternUnits, CoordUnits::ObjectBoundingBox);
coord_units!(PatternContentUnits, CoordUnits::UserSpaceOnUse);
diff --git a/src/properties.rs b/src/properties.rs
index 16a708b3..2009f1e7 100644
--- a/src/properties.rs
+++ b/src/properties.rs
@@ -26,13 +26,13 @@ use markup5ever::{
};
use std::collections::HashSet;
-use crate::attributes::Attributes;
use crate::css::{DeclParser, Declaration, Origin};
use crate::error::*;
use crate::font_props::*;
use crate::parsers::{Parse, ParseValue};
use crate::property_defs::*;
use crate::property_macros::Property;
+use crate::xml::Attributes;
/// Representation of a single CSS property value.
///
diff --git a/src/shapes.rs b/src/shapes.rs
index a9721003..dfc5c831 100644
--- a/src/shapes.rs
+++ b/src/shapes.rs
@@ -1,11 +1,11 @@
//! Basic SVG shapes: the `path`, `polygon`, `polyline`, `line`,
//! `rect`, `circle`, `ellipse` elements.
+use cssparser::{Parser, Token};
use markup5ever::{expanded_name, local_name, namespace_url, ns};
use std::ops::Deref;
use std::rc::Rc;
-use crate::attributes::Attributes;
use crate::bbox::BoundingBox;
use crate::document::AcquiredNodes;
use crate::drawing_ctx::DrawingCtx;
@@ -17,7 +17,7 @@ use crate::parsers::{optional_comma, Parse, ParseValue};
use crate::path_builder::{LargeArc, Path as SvgPath, PathBuilder, Sweep};
use crate::path_parser;
use crate::properties::ComputedValues;
-use cssparser::{Parser, Token};
+use crate::xml::Attributes;
#[derive(Copy, Clone, PartialEq)]
pub enum Markers {
diff --git a/src/structure.rs b/src/structure.rs
index afa3efee..830d4b98 100644
--- a/src/structure.rs
+++ b/src/structure.rs
@@ -3,7 +3,6 @@
use markup5ever::{expanded_name, local_name, namespace_url, ns};
use crate::aspect_ratio::*;
-use crate::attributes::Attributes;
use crate::bbox::BoundingBox;
use crate::coord_units::CoordUnits;
use crate::document::{AcquiredNodes, NodeId};
@@ -17,6 +16,7 @@ use crate::parsers::{Parse, ParseValue};
use crate::properties::ComputedValues;
use crate::rect::Rect;
use crate::viewbox::*;
+use crate::xml::Attributes;
#[derive(Default)]
pub struct Group();
diff --git a/src/style.rs b/src/style.rs
index a0a76dbd..4c24d810 100644
--- a/src/style.rs
+++ b/src/style.rs
@@ -2,9 +2,9 @@
use markup5ever::{expanded_name, local_name, namespace_url, ns};
-use crate::attributes::Attributes;
use crate::element::{Draw, ElementResult, SetAttributes};
use crate::error::*;
+use crate::xml::Attributes;
/// Represents the syntax used in the <style> node.
///
diff --git a/src/text.rs b/src/text.rs
index c279edd6..18b8fa06 100644
--- a/src/text.rs
+++ b/src/text.rs
@@ -3,7 +3,6 @@
use markup5ever::{expanded_name, local_name, namespace_url, ns};
use std::cell::RefCell;
-use crate::attributes::Attributes;
use crate::bbox::BoundingBox;
use crate::document::{AcquiredNodes, NodeId};
use crate::drawing_ctx::DrawingCtx;
@@ -19,6 +18,7 @@ use crate::property_defs::{
XmlSpace,
};
use crate::space::{xml_space_normalize, NormalizeDefault, XmlSpaceNormalize};
+use crate::xml::Attributes;
/// An absolutely-positioned array of `Span`s
///
diff --git a/src/attributes.rs b/src/xml/attributes.rs
similarity index 100%
rename from src/attributes.rs
rename to src/xml/attributes.rs
diff --git a/src/xml/mod.rs b/src/xml/mod.rs
index 884e2997..b441fd91 100644
--- a/src/xml/mod.rs
+++ b/src/xml/mod.rs
@@ -19,7 +19,6 @@ use std::string::ToString;
use xml5ever::tendril::format_tendril;
use xml5ever::tokenizer::{TagKind, Token, TokenSink, XmlTokenizer, XmlTokenizerOpts};
-use crate::attributes::Attributes;
use crate::document::{Document, DocumentBuilder};
use crate::error::{ImplementationLimit, LoadingError};
use crate::io::{self, IoError};
@@ -30,9 +29,12 @@ use crate::url_resolver::AllowedUrl;
use xml2_load::Xml2Parser;
+mod attributes;
mod xml2;
mod xml2_load;
+pub use attributes::Attributes;
+
#[derive(Clone)]
enum Context {
// Starting state
diff --git a/src/xml/xml2_load.rs b/src/xml/xml2_load.rs
index 10ecf712..4318ffbd 100644
--- a/src/xml/xml2_load.rs
+++ b/src/xml/xml2_load.rs
@@ -15,11 +15,11 @@ use std::sync::Once;
use glib::translate::*;
use markup5ever::{namespace_url, ns, LocalName, Namespace, Prefix, QualName};
-use crate::attributes::Attributes;
use crate::error::LoadingError;
use crate::util::{cstr, opt_utf8_cstr, utf8_cstr};
use super::xml2::*;
+use super::Attributes;
use super::XmlState;
#[rustfmt::skip]
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]