[gxml] Deprecating xNode/xDocument classes



commit 0ab36b1c799d3d95e6fe630bf3eaab7d66b9b894
Author: Daniel Espinosa <esodan gmail com>
Date:   Tue Sep 13 17:28:42 2016 -0500

    Deprecating xNode/xDocument classes

 NEWS                                   |    4 ++++
 gxml/GXmlCharacter.vala                |    3 +++
 gxml/GXmlNode.vala                     |    2 --
 gxml/libxml-Attr.vala                  |    1 +
 gxml/libxml-BackedNode.vala            |    1 +
 gxml/libxml-CDATASection.vala          |    1 +
 gxml/libxml-CharacterData.vala         |    1 +
 gxml/libxml-Comment.vala               |    1 +
 gxml/libxml-Document.vala              |    1 +
 gxml/libxml-DocumentFragment.vala      |    1 +
 gxml/libxml-DocumentType.vala          |    1 +
 gxml/libxml-DomException.vala          |    1 +
 gxml/libxml-Element.vala               |    1 +
 gxml/libxml-Entity.vala                |    1 +
 gxml/libxml-EntityReference.vala       |    1 +
 gxml/libxml-Error.vala                 |    1 +
 gxml/libxml-Implementation.vala        |    1 +
 gxml/libxml-NamedAttrMap.vala          |    1 +
 gxml/libxml-NamedNodeMap.vala          |    1 +
 gxml/libxml-NamespaceAttr.vala         |    1 +
 gxml/libxml-Node.vala                  |    1 +
 gxml/libxml-NodeList.vala              |    1 +
 gxml/libxml-NodeType.vala              |    1 +
 gxml/libxml-Notation.vala              |    1 +
 gxml/libxml-ProcessingInstruction.vala |    1 +
 gxml/libxml-Text.vala                  |    1 +
 26 files changed, 30 insertions(+), 2 deletions(-)
---
diff --git a/NEWS b/NEWS
index 3ef54d0..90b46a6 100644
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,7 @@ Version 0.11.0
 * Fixed vapi installation, honoring vala pc file
 * Fixed Bug #760568
 * Fixed Bug #769363
+* Simplified documentation generation using just --enable-docs
 * Removed Node.childs
 * DOM4 implementation:
     API Changes:
@@ -17,6 +18,8 @@ Version 0.11.0
         * Node: get_elements_by_name (), get_elements_by_name_ns ()
     Implementations:
         * GNode series implement DOM4 interfaces
+    Deprecations:
+        * xNode/xDocument type classes now are deprecated, they use an old DOM1 API
 * New and updated translations:
     Updated Serbian     by Мирослав Николић <miroslavnikolic rocketmail com>
     Updated Czech       by Marek Černocký <marek manet cz>
@@ -24,6 +27,7 @@ Version 0.11.0
     Updated Hungarian   by Balázs Meskó <meskobalazs gmail com>
     Updated Spanish     by Daniel Mustieles <daniel mustieles gmail com>
     Added Indonesian    by Andika Triwidada <atriwidada gnome org>
+    Updated Brazilian Portuguese by Enrico Nicoletto <liverig gmail com>
 * TNode based classes API changes:
     * TDocument.read_doc_stream() now throws GLib.Error
 * Reducing number of warnings at valac compilation time
diff --git a/gxml/GXmlCharacter.vala b/gxml/GXmlCharacter.vala
index faa8b82..d399d91 100644
--- a/gxml/GXmlCharacter.vala
+++ b/gxml/GXmlCharacter.vala
@@ -20,6 +20,9 @@
  *      Daniel Espinosa <esodan gmail com>
  */
 
+/**
+ * Base class for character data
+ */
 public class GXml.GCharacterData : GXml.GNonDocumentChildNode, GXml.Character,
               GXml.DomCharacterData
 {
diff --git a/gxml/GXmlNode.vala b/gxml/GXmlNode.vala
index 7fd9877..9f01a24 100644
--- a/gxml/GXmlNode.vala
+++ b/gxml/GXmlNode.vala
@@ -84,8 +84,6 @@ public abstract class GXml.GNode : Object,
     switch (t) {
       case GXml.NodeType.ELEMENT:
         return new GElement (doc, node);
-      case GXml.NodeType.ATTRIBUTE:
-        return new GAttribute (doc, (Xml.Attr*) node);
       case GXml.NodeType.TEXT:
         return new GText (doc, node);
       case GXml.NodeType.CDATA_SECTION:
diff --git a/gxml/libxml-Attr.vala b/gxml/libxml-Attr.vala
index 6a5a394..14a9db7 100644
--- a/gxml/libxml-Attr.vala
+++ b/gxml/libxml-Attr.vala
@@ -55,6 +55,7 @@ namespace GXml {
         *
         * @see GXml.Node
         */
+       [Version (deprecated=true, deprecated_since="0.12", replacement="GAttribute")]
        public class xAttr : BackedNode, GXml.Attribute {
                /** Private properties */
                /* this displaces BackedNode's xmlNode node */
diff --git a/gxml/libxml-BackedNode.vala b/gxml/libxml-BackedNode.vala
index 69e89a6..a5b88fd 100644
--- a/gxml/libxml-BackedNode.vala
+++ b/gxml/libxml-BackedNode.vala
@@ -35,6 +35,7 @@ namespace GXml {
         * This would normally be hidden, but Vala wants base classes
         * to be at least as public as subclasses.
         */
+       [Version (deprecated=true, deprecated_since="0.12", replacement="GNode")]
        public class BackedNode : xNode {
                /** Private properties */
                internal Xml.Node *node;
diff --git a/gxml/libxml-CDATASection.vala b/gxml/libxml-CDATASection.vala
index 4baab1f..c724cd6 100644
--- a/gxml/libxml-CDATASection.vala
+++ b/gxml/libxml-CDATASection.vala
@@ -36,6 +36,7 @@ namespace GXml {
         * {{{ <![CDATA[Here contains non-XML data, like code, or something that requires a lot of special 
XML entities.]]>.}}}
         * It is a type of Text node. For more, see: 
[[http://www.w3.org/TR/DOM-Level-1/level-one-core.html#ID-667469212]]
         */
+       [Version (deprecated=true, deprecated_since="0.12", replacement="GCDATA")]
        public class xCDATASection : xText, GXml.CDATA {
                internal xCDATASection (Xml.Node *cdata_node, xDocument doc) {
                        base (cdata_node, doc);
diff --git a/gxml/libxml-CharacterData.vala b/gxml/libxml-CharacterData.vala
index a77f878..8843441 100644
--- a/gxml/libxml-CharacterData.vala
+++ b/gxml/libxml-CharacterData.vala
@@ -33,6 +33,7 @@ namespace GXml {
         * Version: DOM Level 1 Core<<BR>>
         * URL: [[http://www.w3.org/TR/DOM-Level-1/level-one-core.html#ID-FF21A306]]
         */
+       [Version (deprecated=true, deprecated_since="0.12", replacement="GCharacterData")]
        public class xCharacterData : BackedNode {
                /**
                 * The character data in string form for the node.
diff --git a/gxml/libxml-Comment.vala b/gxml/libxml-Comment.vala
index 2882265..def63c4 100644
--- a/gxml/libxml-Comment.vala
+++ b/gxml/libxml-Comment.vala
@@ -32,6 +32,7 @@
  *
  * For more, see: [[http://www.w3.org/TR/DOM-Level-1/level-one-core.html#ID-1728279322]]
  */
+[Version (deprecated=true, deprecated_since="0.12", replacement="GComment")]
 public class GXml.xComment : GXml.xCharacterData, GXml.Comment {
        // TODO: Can I make this only accessible from within the GXml.Dom namespace (e.g. from 
GXml.Dom.xDocument?)
        internal xComment (Xml.Node *comment_node, xDocument doc) {
diff --git a/gxml/libxml-Document.vala b/gxml/libxml-Document.vala
index aa2c074..4d3f0b1 100644
--- a/gxml/libxml-Document.vala
+++ b/gxml/libxml-Document.vala
@@ -46,6 +46,7 @@ namespace GXml {
         * Version: DOM Level 1 Core<<BR>>
         * URL: [[http://www.w3.org/TR/DOM-Level-1/level-one-core.html#i-xDocument]]
         */
+       [Version (deprecated=true, deprecated_since="0.12", replacement="GDocument")]
        public class xDocument : xNode, GXml.Document {
                /* *** Private properties *** */
 
diff --git a/gxml/libxml-DocumentFragment.vala b/gxml/libxml-DocumentFragment.vala
index 8218399..0f22507 100644
--- a/gxml/libxml-DocumentFragment.vala
+++ b/gxml/libxml-DocumentFragment.vala
@@ -52,6 +52,7 @@ namespace GXml {
         * Version: DOM Level 1 Core<<BR>>
         * URL: [[http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#ID-B63ED1A3]]
         */
+       [Version (deprecated=true, deprecated_since="0.12", replacement="GDocumentFragment")]
        public class DocumentFragment : BackedNode { // TODO: Create DomDocumentFragment interface
                internal DocumentFragment (Xml.Node *fragment_node, xDocument doc) {
                        base (fragment_node, doc);
diff --git a/gxml/libxml-DocumentType.vala b/gxml/libxml-DocumentType.vala
index 007441e..bac7441 100644
--- a/gxml/libxml-DocumentType.vala
+++ b/gxml/libxml-DocumentType.vala
@@ -31,6 +31,7 @@ namespace GXml {
         * 
         * For more, see: [[http://www.w3.org/TR/DOM-Level-1/level-one-core.html#ID-412266927]]
         */
+       [Version (deprecated=true, deprecated_since="0.12", replacement="GDocumentType")]
        public class xDocumentType : xNode, GXml.DocumentType {
                private Xml.Doc* doc;
                private Xml.Dtd *int_subset;
diff --git a/gxml/libxml-DomException.vala b/gxml/libxml-DomException.vala
index 1b70a2a..190d0ba 100644
--- a/gxml/libxml-DomException.vala
+++ b/gxml/libxml-DomException.vala
@@ -45,6 +45,7 @@ namespace GXml {
         * @param exception rised
         * @param message message to log
         */
+       [Version (deprecated=true, deprecated_since="0.12", replacement="GLib.Error per methods")]
        public static void exception (GXml.DomException ex, string message) {
                GXml.last_error = ex;   
 #if DEBUG
diff --git a/gxml/libxml-Element.vala b/gxml/libxml-Element.vala
index 908d6d4..ecc93aa 100644
--- a/gxml/libxml-Element.vala
+++ b/gxml/libxml-Element.vala
@@ -41,6 +41,7 @@ namespace GXml {
         * Version: DOM Level 1 Core<<BR>>
         * URL: [[http://www.w3.org/TR/DOM-Level-1/level-one-core.html#ID-745549614]]
         */
+       [Version (deprecated=true, deprecated_since="0.12", replacement="GElement")]
        public class xElement : BackedNode, GXml.Element {
                string _content = null;
        
diff --git a/gxml/libxml-Entity.vala b/gxml/libxml-Entity.vala
index a351f17..ca72563 100644
--- a/gxml/libxml-Entity.vala
+++ b/gxml/libxml-Entity.vala
@@ -29,6 +29,7 @@ namespace GXml {
         *
         * For more, see: [[http://www.w3.org/TR/DOM-Level-1/level-one-core.html#ID-527DCFF2]]
         */
+       [Version (deprecated=true, deprecated_since="0.12", replacement="")]
        public class Entity : xNode {
                private Xml.Entity *entity;
                private xNodeList _entity_list;
diff --git a/gxml/libxml-EntityReference.vala b/gxml/libxml-EntityReference.vala
index 39d6488..5c2cdb0 100644
--- a/gxml/libxml-EntityReference.vala
+++ b/gxml/libxml-EntityReference.vala
@@ -37,6 +37,7 @@ namespace GXml {
         * The entity name, e.g. "apos", is stored as the EntityReference's `node_name`.
         * For more, see: [[http://www.w3.org/TR/DOM-Level-1/level-one-core.html#ID-11C98490]]
         */
+       [Version (deprecated=true, deprecated_since="0.12", replacement="")]
        public class EntityReference : xNode {
                internal EntityReference (string refname, xDocument doc) {
                        // TODO: may want to handle refname differently
diff --git a/gxml/libxml-Error.vala b/gxml/libxml-Error.vala
index f0b29d3..783fda1 100644
--- a/gxml/libxml-Error.vala
+++ b/gxml/libxml-Error.vala
@@ -2,6 +2,7 @@ namespace GXml {
        /**
         * libmxl2 bindings for Errors on parse and write.
         */
+       [Version (deprecated=true, deprecated_since="0.12", replacement="use GLib.Error exceptions")]
        public errordomain Error {
                NOT_SUPPORTED, /* TODO: GET RID OF THIS */
                PARSER, WRITER;
diff --git a/gxml/libxml-Implementation.vala b/gxml/libxml-Implementation.vala
index 464a662..c5d9a97 100644
--- a/gxml/libxml-Implementation.vala
+++ b/gxml/libxml-Implementation.vala
@@ -35,6 +35,7 @@ namespace GXml {
         * Version: DOM Level 1 Core<<BR>>
         * URL: [[http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#ID-102161490]]
         */
+       [Version (deprecated=true, deprecated_since="0.12", replacement="GImplementation")]
        public class Implementation : GLib.Object { // TODO: Add DomImplementation interface
 
                construct { Init.init (); }
diff --git a/gxml/libxml-NamedAttrMap.vala b/gxml/libxml-NamedAttrMap.vala
index ba3dde1..e259e78 100644
--- a/gxml/libxml-NamedAttrMap.vala
+++ b/gxml/libxml-NamedAttrMap.vala
@@ -31,6 +31,7 @@ namespace GXml {
         * This is just an auxiliary class to implement {@link Gee.Traversable}
         * {@link Gee.Iterable} interfaces.
         */
+       [Version (deprecated=true, deprecated_since="0.12", replacement="GHashMapAttr")]
        public abstract class AbstractNamedAttrMap : Object,
                Traversable<Entry>,
                Iterable<Entry>
diff --git a/gxml/libxml-NamedNodeMap.vala b/gxml/libxml-NamedNodeMap.vala
index ca114cc..93b07c9 100644
--- a/gxml/libxml-NamedNodeMap.vala
+++ b/gxml/libxml-NamedNodeMap.vala
@@ -28,6 +28,7 @@ namespace GXml {
        /**
         * DOM API. A collection of elements with a named objects.
         */
+       [Version (deprecated=true, deprecated_since="0.12", replacement="DomNamedNodeMap")]
        public interface NamedNodeMap<T> : GLib.Object {
                // TODO: consider adding lookup, remove, etc from GLib.HashTable as convenience API
                // TODO: figure out how to let people do attributes["pie"] for attributes.get_named_item 
("pie"); GLib HashTables can do it
diff --git a/gxml/libxml-NamespaceAttr.vala b/gxml/libxml-NamespaceAttr.vala
index 228ab0f..dbc6dc9 100644
--- a/gxml/libxml-NamespaceAttr.vala
+++ b/gxml/libxml-NamespaceAttr.vala
@@ -30,6 +30,7 @@ namespace GXml {
         * prefix=uri pairs that define namespaces for XML {@link GXml.xElement}
         * and {@link GXml.xAttr}.
         */
+       [Version (deprecated=true, deprecated_since="0.12", replacement="GNamespace")]
        public class NamespaceAttr : xNode, GXml.Namespace {
                /** Private properties */
                private Xml.Ns *ns; // XPATH:TODO: do they extend us?
diff --git a/gxml/libxml-Node.vala b/gxml/libxml-Node.vala
index 7cfa7d0..063d6cb 100644
--- a/gxml/libxml-Node.vala
+++ b/gxml/libxml-Node.vala
@@ -37,6 +37,7 @@ namespace GXml {
         * Version: DOM Level 1 Core<<BR>>
         * URL: [[http://www.w3.org/TR/DOM-Level-1/level-one-core.html#ID-1950641247]]
         */
+       [Version (deprecated=true, deprecated_since="0.12", replacement="GNode")]
        public abstract class xNode : GLib.Object, GXml.Node {
                protected xNodeList _child_nodes;
                protected NamedAttrMap _attributes = null;
diff --git a/gxml/libxml-NodeList.vala b/gxml/libxml-NodeList.vala
index 0fb7ef7..3157929 100644
--- a/gxml/libxml-NodeList.vala
+++ b/gxml/libxml-NodeList.vala
@@ -42,6 +42,7 @@ namespace GXml {
         * Version: DOM Level 1 Core<<BR>>
         * URL: [[http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#ID-536297177]]
         */
+       [Version (deprecated=true, deprecated_since="0.12", replacement="DomNodeList")]
        public interface xNodeList : GLib.Object, Gee.Iterable<xNode>, Gee.Collection<xNode>
        {
                /* NOTE:
diff --git a/gxml/libxml-NodeType.vala b/gxml/libxml-NodeType.vala
index d99e6d5..738e0b9 100644
--- a/gxml/libxml-NodeType.vala
+++ b/gxml/libxml-NodeType.vala
@@ -29,6 +29,7 @@
  *
  * For more, see: [[http://www.w3.org/TR/DOM-Level-1/level-one-core.html#ID-1950641247]]
  */
+[Version (deprecated=true, deprecated_since="0.12", replacement="DomNode.NodeType")]
 public enum GXml.NodeType { // TODO: Rename to DomNodeType
        /* NOTE: bug in vala?  if I don't have == 0, I fail when creating
           this class because I can't set default values for NodeType properties
diff --git a/gxml/libxml-Notation.vala b/gxml/libxml-Notation.vala
index 640ea63..75d08fa 100644
--- a/gxml/libxml-Notation.vala
+++ b/gxml/libxml-Notation.vala
@@ -32,6 +32,7 @@ namespace GXml {
         * ProcessingInstruction targets.
         * For more, see: [[http://www.w3.org/TR/DOM-Level-1/level-one-core.html#ID-5431D1B9]]
         */
+       [Version (deprecated=true, deprecated_since="0.12", replacement="")]
        public class xNotation : xNode, GXml.Notation {
                // private Xml.Notation *notation; // TODO: wrap libxml's xmlNotation
 
diff --git a/gxml/libxml-ProcessingInstruction.vala b/gxml/libxml-ProcessingInstruction.vala
index 8048d8a..538719b 100644
--- a/gxml/libxml-ProcessingInstruction.vala
+++ b/gxml/libxml-ProcessingInstruction.vala
@@ -40,6 +40,7 @@ namespace GXml {
         * {{{pi_target processing instruction data}}}
         * For more, see: [[http://www.w3.org/TR/DOM-Level-1/level-one-core.html#ID-1004215813]]
         */
+       [Version (deprecated=true, deprecated_since="0.12", replacement="GProcessingInstruction")]
        public class xProcessingInstruction : xNode, GXml.ProcessingInstruction {
                string _target;
                string _data;
diff --git a/gxml/libxml-Text.vala b/gxml/libxml-Text.vala
index 956a8fd..f861c5f 100644
--- a/gxml/libxml-Text.vala
+++ b/gxml/libxml-Text.vala
@@ -40,6 +40,7 @@ namespace GXml {
         * Version: DOM Level 1 Core<<BR>>
         * URL: [[http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#ID-1312295772]]
         */
+       [Version (deprecated=true, deprecated_since="0.12", replacement="GText")]
        public class xText : xCharacterData, GXml.Text {
                internal xText (Xml.Node *text_node, xDocument doc) {
                        base (text_node, doc);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]