public AttributeList(AttributeList a)
 {
     if (a.attrs != null)
         attrs = new Dictionary<string,string>(a.attrs);
     else
         attrs = null;
 }
 public Node(SVGNodeName name, AttributeList attributes, int depth)
 {
     this.parent = null;
     this.children = new List<Node>();
     this.name = name;
     this.attributes = attributes;
     this.depth = depth;
 }
Beispiel #3
0
 public Node(SVGNodeName name, AttributeList attributes, int depth)
 {
     this.parent     = null;
     this.children   = new List <Node>();
     this.name       = name;
     this.attributes = attributes;
     this.depth      = depth;
 }
 public AttributeList(AttributeList a)
 {
     if (a.attrs != null)
     {
         attrs = new Dictionary <string, string>(a.attrs);
     }
     else
     {
         attrs = null;
     }
 }
Beispiel #5
0
        public void OnStyleElement(string name, AttributeList attrs, string style)
        {
            Node node = new InlineNode(Lookup(name), new AttributeList(attrs), _currentDepth);
            node.content = style;
            node.parent = _lastParent;
            if (_lastParent != null)
            {
                _lastParent.children.Add(node);
            }

            AddNode(node);
        }
Beispiel #6
0
        public void OnInlineElement(string name, AttributeList attrs)
        {
            Node node = new InlineNode(Lookup(name), new AttributeList(attrs), _currentDepth);
//            Debug.Log("OnInlineElement: "+name);

            node.parent = _lastParent;
            if (_lastParent != null)
            {
                _lastParent.children.Add(node);
            }

            OnNode(node);
        }
Beispiel #7
0
        public void OnStartElement(string name, AttributeList attrs)
        {
            Node node = new BlockOpenNode(Lookup(name), new AttributeList(attrs), _currentDepth++);
//            Debug.Log("OnStartElement: "+name);

            node.parent = _lastParent;
            if (_lastParent != null)
            {
                _lastParent.children.Add(node);
            }

            _lastParent = node;

            OnNode(node);
            //Debug.Log("OnStartElement: "+node.name+", depth: "+node.depth);
        }
        public SVGElement(SVGParser xmlImp,
                    SVGTransformList inheritTransformList,
                    SVGPaintable inheritPaintable,
                    bool root = false) : base(inheritTransformList)
        {
            _rootElement = root;
            _name = _attrList.GetValue("id");
            _xmlImp = xmlImp;
            _attrList = _xmlImp.node.attributes;

            if(inheritPaintable != null)
            {
                _paintable = new SVGPaintable(inheritPaintable, _xmlImp.node);
            } else {
                _paintable = new SVGPaintable(_xmlImp.node);
            }

            Init();
        }
Beispiel #9
0
        public SVGElement(SVGParser xmlImp,
                          SVGTransformList inheritTransformList,
                          SVGPaintable inheritPaintable,
                          bool root = false) : base(inheritTransformList)
        {
            _rootElement = root;
            _name        = _attrList.GetValue("id");
            _xmlImp      = xmlImp;
            _attrList    = _xmlImp.node.attributes;

            if (inheritPaintable != null)
            {
                _paintable = new SVGPaintable(inheritPaintable, _xmlImp.node);
            }
            else
            {
                _paintable = new SVGPaintable(_xmlImp.node);
            }

            Init();
        }
 public BlockOpenNode(SVGNodeName name, AttributeList attributes, int depth) : base(name, attributes, depth)
 {
 }
 public InlineNode(SVGNodeName name, AttributeList attributes, int depth) : base(name, attributes, depth)
 {
 }
        public void OnStyleElement(string name, AttributeList attrs, string style)
        {
            Node node = new InlineNode(Lookup(name), new AttributeList(attrs), _currentDepth);
            node.content = style;
            node.parent = _lastParent;
            if (_lastParent != null)
            {
                _lastParent.children.Add(node);
            }

            AddNode(node);
        }
        public void OnStartElement(string name, AttributeList attrs)
        {
            Node node = new BlockOpenNode(Lookup(name), new AttributeList(attrs), _currentDepth++);
//            Debug.Log("OnStartElement: "+name);

            node.parent = _lastParent;
            if (_lastParent != null)
            {
                _lastParent.children.Add(node);
            }

            _lastParent = node;

            OnNode(node);
            //Debug.Log("OnStartElement: "+node.name+", depth: "+node.depth);
        }
        public void OnInlineElement(string name, AttributeList attrs)
        {
            Node node = new InlineNode(Lookup(name), new AttributeList(attrs), _currentDepth);
//            Debug.Log("OnInlineElement: "+name);

            node.parent = _lastParent;
            if (_lastParent != null)
            {
                _lastParent.children.Add(node);
            }

            OnNode(node);
        }
Beispiel #15
0
 public InlineNode(SVGNodeName name, AttributeList attributes, int depth) : base(name, attributes, depth)
 {
 }
        private void ReadAttribute(ref AttributeList a)
        {
            SkipWhitespaces(true);
            if (Peek() == '/' || Peek() == '>')
            // came here just to spend trailing whitespaces
                return;

            string name = ReadName();
            string value;
            SkipWhitespaces();
            Expect('=');
            SkipWhitespaces();
            switch (Read())
            {
                case '\'':
                    value = ReadUntil('\'', true);
                    break;
                case '"':
                    value = ReadUntil('"', true);
                    break;
                default:
                    throw Error("Invalid attribute value markup.");
            }
            a.Add(name, value);
        }
Beispiel #17
0
 public BlockOpenNode(SVGNodeName name, AttributeList attributes, int depth) : base(name, attributes, depth)
 {
 }