[gxml/style] gxml/*.vala: align parametres to GTK+ style
- From: Richard Hans Schwarting <rschwart src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gxml/style] gxml/*.vala: align parametres to GTK+ style
- Date: Sun, 25 Aug 2013 15:17:48 +0000 (UTC)
commit 60f83546beea3ab8d6dc31258aab8e67688aec31
Author: Richard Schwarting <aquarichy gmail com>
Date: Sun Aug 25 12:35:02 2013 -0230
gxml/*.vala: align parametres to GTK+ style
gxml/Attr.vala | 9 ++++--
gxml/BackedNode.vala | 12 +++++---
gxml/CDATASection.vala | 4 ++-
gxml/CharacterData.vala | 21 ++++++++++----
gxml/Comment.vala | 3 +-
gxml/Document.vala | 37 ++++++++++++++++++--------
gxml/DocumentFragment.vala | 3 +-
gxml/DocumentType.vala | 10 +++++-
gxml/Element.vala | 18 ++++++++----
gxml/Entity.vala | 6 +++-
gxml/EntityReference.vala | 3 +-
gxml/Implementation.vala | 6 +++-
gxml/NamespaceAttr.vala | 3 +-
gxml/Node.vala | 12 +++++---
gxml/NodeList.vala | 55 ++++++++++++++++++++++++++------------
gxml/ProcessingInstruction.vala | 4 ++-
gxml/Serializable.vala | 14 +++++++---
gxml/Serialization.vala | 19 ++++++++++---
gxml/Text.vala | 3 +-
19 files changed, 168 insertions(+), 74 deletions(-)
---
diff --git a/gxml/Attr.vala b/gxml/Attr.vala
index 111df9d..18e4fc1 100644
--- a/gxml/Attr.vala
+++ b/gxml/Attr.vala
@@ -96,7 +96,8 @@ namespace GXml {
internal Xml.Attr *node;
/** Constructors */
- internal Attr (Xml.Attr *node, Document doc) {
+ internal Attr (Xml.Attr *node,
+ Document doc) {
// TODO: wish valac would warn against using this. before calling base()
base (NodeType.ATTRIBUTE, doc);
this.node = node;
@@ -220,13 +221,15 @@ namespace GXml {
/**
* { inheritDoc}
*/
- public override unowned Node? insert_before (Node new_child, Node? ref_child) {
+ public override unowned Node? insert_before (Node new_child,
+ Node? ref_child) {
return this.child_nodes.insert_before (new_child, ref_child);
}
/**
* { inheritDoc}
*/
- public override unowned Node? replace_child (Node new_child, Node old_child) {
+ public override unowned Node? replace_child (Node new_child,
+ Node old_child) {
return this.child_nodes.replace_child (new_child, old_child);
}
/**
diff --git a/gxml/BackedNode.vala b/gxml/BackedNode.vala
index eb75926..05e9e79 100644
--- a/gxml/BackedNode.vala
+++ b/gxml/BackedNode.vala
@@ -38,7 +38,8 @@ namespace GXml {
internal Xml.Node *node;
/** Constructors */
- internal BackedNode (Xml.Node *node, Document owner) {
+ internal BackedNode (Xml.Node *node,
+ Document owner) {
base ((NodeType)node->type, owner);
// Considered using node->doc instead, but some subclasses don't have corresponding
Xml.Nodes
this.node = node;
@@ -250,13 +251,15 @@ namespace GXml {
/**
* { inheritDoc}
*/
- public override unowned Node? insert_before (Node new_child, Node? ref_child) {
+ public override unowned Node? insert_before (Node new_child,
+ Node? ref_child) {
return this.child_nodes.insert_before (new_child, ref_child);
}
/**
* { inheritDoc}
*/
- public override unowned Node? replace_child (Node new_child, Node old_child) {
+ public override unowned Node? replace_child (Node new_child,
+ Node old_child) {
return this.child_nodes.replace_child (new_child, old_child);
}
/**
@@ -295,7 +298,8 @@ namespace GXml {
// TODO: add a better test, as we weren't realising this was just a stub; test for
memory usage too
}
- public override string to_string (bool format = false, int level = 0) {
+ public override string to_string (bool format = false,
+ int level = 0) {
/* TODO: change from xmlNodeDump and xmlBuffer
* to xmlBuf and xmlBufNodeDump; the former
* are 'somehow deprecated' (see xmlNodeDump
diff --git a/gxml/CDATASection.vala b/gxml/CDATASection.vala
index 906b9e2..d2cee36 100644
--- a/gxml/CDATASection.vala
+++ b/gxml/CDATASection.vala
@@ -38,9 +38,11 @@ namespace GXml {
* It is a type of Text node. For more, see:
[[http://www.w3.org/TR/DOM-Level-1/level-one-core.html#ID-667469212]]
*/
public class CDATASection : Text {
- internal CDATASection (Xml.Node *cdata_node, Document doc) {
+ internal CDATASection (Xml.Node *cdata_node,
+ Document doc) {
base (cdata_node, doc);
}
+
/**
* { inheritDoc}
*/
diff --git a/gxml/CharacterData.vala b/gxml/CharacterData.vala
index 6534677..ec33315 100644
--- a/gxml/CharacterData.vala
+++ b/gxml/CharacterData.vala
@@ -65,12 +65,16 @@ namespace GXml {
}
}
- internal CharacterData (Xml.Node *char_node, Document doc) {
+ internal CharacterData (Xml.Node *char_node,
+ Document doc) {
base (char_node, doc);
// TODO: if this was this (), it would recurse infinitely, maybe valac could detect
that
}
- protected bool check_index_size (string method, int length, ulong offset, ulong? count) {
+ protected bool check_index_size (string method,
+ int length,
+ ulong offset,
+ ulong? count) {
if (offset < 0) {
GXml.warning (DomException.INDEX_SIZE, "%s called with offset '%lu' for data
of length '%lu'".printf (method, offset, length));
return false;
@@ -102,7 +106,8 @@ namespace GXml {
* Version: DOM Level 1 Core
* URL: [[http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#ID-6531BCCF]]
*/
- public string substring_data (ulong offset, ulong count) {
+ public string substring_data (ulong offset,
+ ulong count) {
if (! check_index_size ("substring_data", this.data.length, offset, count)) {
return "";
}
@@ -125,7 +130,8 @@ namespace GXml {
* Version: DOM Level 1 Core
* URL: [[http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#ID-3EDB695F]]
*/
- public void insert_data (ulong offset, string arg) {
+ public void insert_data (ulong offset,
+ string arg) {
/* length == 5
0 1 2 3 4
f a n c y */
@@ -142,7 +148,8 @@ namespace GXml {
* Version: DOM Level 1 Core
* URL: [[http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#ID-7C603781]]
*/
- public void delete_data (ulong offset, ulong count) {
+ public void delete_data (ulong offset,
+ ulong count) {
if (! check_index_size ("delete_data", this.data.length, offset, count)) {
return;
}
@@ -157,7 +164,9 @@ namespace GXml {
* Version: DOM Level 1 Core
* URL: [[http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#ID-E5CBA7FB]]
*/
- public void replace_data (ulong offset, ulong count, string arg) {
+ public void replace_data (ulong offset,
+ ulong count,
+ string arg) {
if (! check_index_size ("replace_data", this.data.length, offset, count)) {
return;
}
diff --git a/gxml/Comment.vala b/gxml/Comment.vala
index f972026..4fd4dc5 100644
--- a/gxml/Comment.vala
+++ b/gxml/Comment.vala
@@ -39,7 +39,8 @@
*/
public class GXml.Comment : GXml.CharacterData {
// TODO: Can I make this only accessible from within the GXml.Dom namespace (e.g. from
GXml.Dom.Document?)
- internal Comment (Xml.Node *comment_node, Document doc) {
+ internal Comment (Xml.Node *comment_node,
+ Document doc) {
base (comment_node, doc);
}
public override string node_name {
diff --git a/gxml/Document.vala b/gxml/Document.vala
index 55e1e47..ea27559 100644
--- a/gxml/Document.vala
+++ b/gxml/Document.vala
@@ -260,7 +260,10 @@ namespace GXml {
*
* @return The new document.
*/
- internal Document.with_implementation (Implementation impl, string? namespace_uri, string?
qualified_name, DocumentType? doctype) {
+ internal Document.with_implementation (Implementation impl,
+ string? namespace_uri,
+ string? qualified_name,
+ DocumentType? doctype) {
this ();
this.implementation = impl;
@@ -277,7 +280,8 @@ namespace GXml {
/**
* Creates a Document based on a libxml2 Xml.Doc* object.
*/
- public Document.from_libxml2 (Xml.Doc *doc, bool require_root = true) {
+ public Document.from_libxml2 (Xml.Doc *doc,
+ bool require_root = true) {
/* All other constructors should call this one,
passing it a Xml.Doc* object */
@@ -317,7 +321,9 @@ namespace GXml {
}
// TODO: can we make this private?
- internal static int _iowrite (void *ctx, char[] buf, int len) {
+ internal static int _iowrite (void *ctx,
+ char[] buf,
+ int len) {
OutputStreamBox *box = (OutputStreamBox*)ctx;
OutputStream outstream = box->str;
int bytes_writ = -1;
@@ -353,7 +359,9 @@ namespace GXml {
return success;
}
// TODO: can we make this private?
- internal static int _ioread (void *ctx, char[] buf, int len) {
+ internal static int _ioread (void *ctx,
+ char[] buf,
+ int len) {
InputStreamBox *box = (InputStreamBox*)ctx;
InputStream instream = box->str;
int bytes_read = -1;
@@ -391,7 +399,8 @@ namespace GXml {
/**
* Creates a Document from the File fin.
*/
- public Document.from_gfile (File fin, Cancellable? can = null) {
+ public Document.from_gfile (File fin,
+ Cancellable? can = null) {
// TODO: accept cancellable
InputStream instream;
@@ -406,7 +415,8 @@ namespace GXml {
/**
* Creates a Document from data provided through the InputStream instream.
*/
- public Document.from_stream (InputStream instream, Cancellable? can = null) {
+ public Document.from_stream (InputStream instream,
+ Cancellable? can = null) {
// TODO: accept Cancellable
// Cancellable can = new Cancellable ();
InputStreamBox box = { instream, can };
@@ -484,7 +494,8 @@ namespace GXml {
/**
* Saves a Document to the OutputStream outstream.
*/
- public void save_to_stream (OutputStream outstream, Cancellable? can = null) {
+ public void save_to_stream (OutputStream outstream,
+ Cancellable? can = null) {
OutputStreamBox box = { outstream, can };
sync_dirty_elements ();
@@ -611,7 +622,8 @@ namespace GXml {
*/
/* TODO: this is not backed by a libxml2 structure, and is not stored in the NodeDict, so we
don't know
when it will be freed :( Figure it out */
- public ProcessingInstruction create_processing_instruction (string target, string data) {
+ public ProcessingInstruction create_processing_instruction (string target,
+ string data) {
check_not_supported_html ("processing instructions");
check_invalid_characters (target, "processing instruction");
@@ -681,7 +693,8 @@ namespace GXml {
/**
* Subject should be something like "element" or "processing instruction"
*/
- internal static bool check_invalid_characters (string name, string subject) {
+ internal static bool check_invalid_characters (string name,
+ string subject) {
/* TODO: use Xml.validate_name instead */
if (Xml.validate_name (name, 0) != 0) { // TODO: define validity
GXml.warning (DomException.INVALID_CHARACTER, "Provided name '%s' for '%s' is
not a valid XML name".printf (name, subject));
@@ -694,7 +707,8 @@ namespace GXml {
/**
* { inheritDoc}
*/
- public override string to_string (bool format = false, int level = 0) {
+ public override string to_string (bool format = false,
+ int level = 0) {
string str;
int len;
@@ -740,7 +754,8 @@ namespace GXml {
return null;
}
- internal Node copy_node (Node foreign_node, bool deep = true) {
+ internal Node copy_node (Node foreign_node,
+ bool deep = true) {
foreign_node.owner_document.sync_dirty_elements ();
Xml.Node *our_copy_xml = ((BackedNode)foreign_node).node->doc_copy (this.xmldoc, deep
? 1 : 0);
// TODO: do we need to append this to this.new_nodes? Do we need to append the
result to this.nodes_to_free? Test memory implications
diff --git a/gxml/DocumentFragment.vala b/gxml/DocumentFragment.vala
index c97ba58..57cc851 100644
--- a/gxml/DocumentFragment.vala
+++ b/gxml/DocumentFragment.vala
@@ -53,7 +53,8 @@ namespace GXml {
* URL: [[http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#ID-B63ED1A3]]
*/
public class DocumentFragment : BackedNode {
- internal DocumentFragment (Xml.Node *fragment_node, Document doc) {
+ internal DocumentFragment (Xml.Node *fragment_node,
+ Document doc) {
base (fragment_node, doc);
}
}
diff --git a/gxml/DocumentType.vala b/gxml/DocumentType.vala
index a7d56ba..b1674ab 100644
--- a/gxml/DocumentType.vala
+++ b/gxml/DocumentType.vala
@@ -34,7 +34,9 @@ namespace GXml {
private Xml.Dtd *ext_subset;
/** Constructor */
- internal DocumentType (Xml.Dtd *int_subset, Xml.Dtd *ext_subset, Document doc) {
+ internal DocumentType (Xml.Dtd *int_subset,
+ Xml.Dtd *ext_subset,
+ Document doc) {
// TODO: for name, we want a real name of the doc type
base (NodeType.DOCUMENT_TYPE, doc);
@@ -65,7 +67,11 @@ namespace GXml {
}
/* TODO: make more static methods internal instead of public, if possible */
- internal static void myScannerFull (void *payload, void *userdata, string name1, string
name2, string name3) {
+ internal static void myScannerFull (void *payload,
+ void *userdata,
+ string name1,
+ string name2,
+ string name3) {
GLib.message ("scanner found [%s,%s,%s]", name1, name2, name3);
}
diff --git a/gxml/Element.vala b/gxml/Element.vala
index b475783..930c1da 100644
--- a/gxml/Element.vala
+++ b/gxml/Element.vala
@@ -200,7 +200,8 @@ namespace GXml {
/* Constructors */
- internal Element (Xml.Node *node, Document doc) {
+ internal Element (Xml.Node *node,
+ Document doc) {
base (node, doc);
// TODO: consider string ownership, libxml2 memory
// TODO: do memory testing
@@ -243,7 +244,8 @@ namespace GXml {
* @param name Name of the attribute whose value to set.
* @param value The value to set.
*/
- public void set_attribute (string name, string value) {
+ public void set_attribute (string name,
+ string value) {
// don't need to use insert
Attr attr = this.attributes.lookup (name);
if (attr == null) {
@@ -338,7 +340,8 @@ namespace GXml {
}
// TODO: consider making the life of TagNameNodeLists optional, and dead by default, at the
Document level
- private void check_add_tag_name (Element basenode, Node child) {
+ private void check_add_tag_name (Element basenode,
+ Node child) {
// TODO: make sure there aren't any other NodeTypes that could have elements as
children
if (child.node_type == NodeType.ELEMENT || child.node_type ==
NodeType.DOCUMENT_FRAGMENT) {
// the one we're examining is an element, and might need to be added
@@ -357,7 +360,8 @@ namespace GXml {
* are elements. If they are, we check the basenode and its ancestors to see
* whether they're keeping that node in a TagNameNodeList, so we can remove it.
*/
- private void check_remove_tag_name (Element basenode, Node child) {
+ private void check_remove_tag_name (Element basenode,
+ Node child) {
// TODO: make sure there aren't any other NodeTypes that could have elements as
children
if (child.node_type == NodeType.ELEMENT) {
// the one we're examining is an element, and might need to be removed from a
tag name node list
@@ -371,12 +375,14 @@ namespace GXml {
}
/* ** Node methods ** */
- public override unowned Node? insert_before (Node new_child, Node? ref_child) {
+ public override unowned Node? insert_before (Node new_child,
+ Node? ref_child) {
unowned Node ret = base.insert_before (new_child, ref_child);
check_add_tag_name (this, new_child);
return ret;
}
- public override unowned Node? replace_child (Node new_child, Node old_child) {
+ public override unowned Node? replace_child (Node new_child,
+ Node old_child) {
check_remove_tag_name (this, old_child);
unowned Node ret = base.replace_child (new_child, old_child);
check_add_tag_name (this, new_child);
diff --git a/gxml/Entity.vala b/gxml/Entity.vala
index 22260b9..7fc78b5 100644
--- a/gxml/Entity.vala
+++ b/gxml/Entity.vala
@@ -109,10 +109,12 @@ namespace GXml {
}
/* Public methods (Node-specific) */
- public override unowned Node? insert_before (Node new_child, Node? ref_child) {
+ public override unowned Node? insert_before (Node new_child,
+ Node? ref_child) {
return this.child_nodes.insert_before (new_child, ref_child);
}
- public override unowned Node? replace_child (Node new_child, Node old_child) {
+ public override unowned Node? replace_child (Node new_child,
+ Node old_child) {
return this.child_nodes.replace_child (new_child, old_child);
}
public override unowned Node? remove_child (Node old_child) {
diff --git a/gxml/EntityReference.vala b/gxml/EntityReference.vala
index 5284323..fb4c2bd 100644
--- a/gxml/EntityReference.vala
+++ b/gxml/EntityReference.vala
@@ -39,7 +39,8 @@ namespace GXml {
*/
// TODO: make sure that character entity references (like the one used in the example above, are valid
public class EntityReference : Node {
- internal EntityReference (string refname, Document doc) {
+ internal EntityReference (string refname,
+ Document doc) {
// TODO: may want to handle refname differently
base (NodeType.ENTITY_REFERENCE, doc); // TODO: what should we pass up?
this.node_name = refname;
diff --git a/gxml/Implementation.vala b/gxml/Implementation.vala
index 58323d0..764d574 100644
--- a/gxml/Implementation.vala
+++ b/gxml/Implementation.vala
@@ -39,7 +39,8 @@ namespace GXml {
internal Implementation () {
}
- private void check_namespace (string? namespace_uri, string? qualified_name) {
+ private void check_namespace (string? namespace_uri,
+ string? qualified_name) {
if (qualified_name == null && namespace_uri != null) {
GXml.warning (DomException.NAMESPACE, "qualified_name is null but
namespace_uri [%s] is not. Both should either be null or not null.".printf (namespace_uri));
}
@@ -111,7 +112,8 @@ namespace GXml {
*
* @return true if we support the specified feature, false otherwise.
*/
- public bool has_feature (string feature, string? version = null) {
+ public bool has_feature (string feature,
+ string? version = null) {
/* Level 1 is limited to "xml" and "html" (icase) */
switch (feature) {
case "xml": // TODO find better way to handle case insensitivity
diff --git a/gxml/NamespaceAttr.vala b/gxml/NamespaceAttr.vala
index 79b9f5a..f0f671c 100644
--- a/gxml/NamespaceAttr.vala
+++ b/gxml/NamespaceAttr.vala
@@ -35,7 +35,8 @@ namespace GXml {
private Xml.Ns *node;
/** Constructors */
- internal NamespaceAttr (Xml.Ns *node, Document doc) {
+ internal NamespaceAttr (Xml.Ns *node,
+ Document doc) {
// TODO: wish valac would warn against using this. before calling base()
base (NodeType.ATTRIBUTE, doc); // TODO: want something other than ATTRIBUTE?
this.node = node;
diff --git a/gxml/Node.vala b/gxml/Node.vala
index 687f9dc..cc37974 100644
--- a/gxml/Node.vala
+++ b/gxml/Node.vala
@@ -37,7 +37,8 @@ namespace GXml {
*/
public class Node : GLib.Object {
/* Constructors */
- internal Node (NodeType type, Document owner) {
+ internal Node (NodeType type,
+ Document owner) {
this.node_type = type;
this.owner_document = owner;
}
@@ -326,7 +327,8 @@ namespace GXml {
*
* @return `new_child`, the node that has been inserted
*/
- public virtual unowned Node? insert_before (Node new_child, Node? ref_child) {
+ public virtual unowned Node? insert_before (Node new_child,
+ Node? ref_child) {
return null;
}
/**
@@ -337,7 +339,8 @@ namespace GXml {
*
* @return The removed node `old_child`.
*/
- public virtual unowned Node? replace_child (Node new_child, Node old_child) {
+ public virtual unowned Node? replace_child (Node new_child,
+ Node old_child) {
return null;
}
/**
@@ -403,7 +406,8 @@ namespace GXml {
* @return XML string for node, which must be freed.
*/
// TODO: ask Colin Walters about storing docs in GIR files (might have not been him)
- public virtual string to_string (bool format = false, int level = 0) {
+ public virtual string to_string (bool format = false,
+ int level = 0) {
return "Node(%d:%s)".printf (this.node_type, this.node_name);
}
}
diff --git a/gxml/NodeList.vala b/gxml/NodeList.vala
index 8e1e4f7..2e4ff8a 100644
--- a/gxml/NodeList.vala
+++ b/gxml/NodeList.vala
@@ -125,7 +125,8 @@ namespace GXml {
*
* @return The node that is `n` nodes before `pivot` in the list
*/
- public abstract Node? nth_prev (Node pivot, ulong n);
+ public abstract Node? nth_prev (Node pivot,
+ ulong n);
/**
* Obtain index for node `target` in the list. Like { link GLib.List.find}.
@@ -145,7 +146,8 @@ namespace GXml {
*
* @return The index of the first node in the list matching `target` according to `cmp`
*/
- public abstract int find_custom (Node target, CompareFunc<Node> cmp);
+ public abstract int find_custom (Node target,
+ CompareFunc<Node> cmp);
/**
* Obtain index for node `target` in the list. Like
@@ -163,8 +165,10 @@ namespace GXml {
public abstract int index (Node target);
/* These exist to support management of a node's children */
- internal abstract unowned Node? insert_before (Node new_child, Node? ref_child);
- internal abstract unowned Node? replace_child (Node new_child, Node old_child);
+ internal abstract unowned Node? insert_before (Node new_child,
+ Node? ref_child);
+ internal abstract unowned Node? replace_child (Node new_child,
+ Node old_child);
internal abstract unowned Node? remove_child (Node old_child);
internal abstract unowned Node? append_child (Node new_child);
@@ -248,7 +252,8 @@ namespace GXml {
/**
* { inheritDoc}
*/
- public Node? nth_prev (Node pivot, ulong n) {
+ public Node? nth_prev (Node pivot,
+ ulong n) {
unowned GLib.List<Node> list_pivot = this.nodes.find (pivot);
return list_pivot.nth_prev ((uint)n).data;
}
@@ -261,7 +266,8 @@ namespace GXml {
/**
* { inheritDoc}
*/
- public int find_custom (Node target, CompareFunc<Node> cmp) {
+ public int find_custom (Node target,
+ CompareFunc<Node> cmp) {
unowned GLib.List<Node> list_pt = this.nodes.find_custom (target, cmp);
return this.index (list_pt.data);
}
@@ -278,11 +284,13 @@ namespace GXml {
return this.nodes.index (target);
}
- internal unowned Node? insert_before (Node new_child, Node? ref_child) {
+ internal unowned Node? insert_before (Node new_child,
+ Node? ref_child) {
this.nodes.insert_before (this.nodes.find (ref_child), new_child);
return new_child;
}
- internal unowned Node? replace_child (Node new_child, Node old_child) {
+ internal unowned Node? replace_child (Node new_child,
+ Node old_child) {
int pos = this.index (old_child);
this.remove_child (old_child);
this.nodes.insert (new_child, pos);
@@ -363,7 +371,9 @@ namespace GXml {
* out as new elements are added, and get reconstructed each
* time, or get reconstructed-on-the-go?
*/
- internal class TagNameNodeList : GListNodeList { internal string tag_name;
+ internal class TagNameNodeList : GListNodeList {
+ internal string tag_name;
+
internal TagNameNodeList (string tag_name, Node root, Document owner) {
base (root);
this.tag_name = tag_name;
@@ -373,14 +383,16 @@ namespace GXml {
/* TODO: warning: this list should NOT be edited :(
we need a new, better live AttrNodeList :| */
internal class AttrNodeList : GListNodeList {
- internal AttrNodeList (Node root, Document owner) {
+ internal AttrNodeList (Node root,
+ Document owner) {
base (root);
base.nodes = root.attributes.get_values ();
}
}
internal class NamespaceAttrNodeList : GListNodeList {
- internal NamespaceAttrNodeList (BackedNode root, Document owner) {
+ internal NamespaceAttrNodeList (BackedNode root,
+ Document owner) {
base (root);
for (Xml.Ns *cur = root.node->ns_def; cur != null; cur = cur->next) {
this.append_child (new NamespaceAttr (cur, owner));
@@ -400,7 +412,8 @@ namespace GXml {
}
}
- internal NodeChildNodeList (Xml.Node *parent, Document owner) {
+ internal NodeChildNodeList (Xml.Node *parent,
+ Document owner) {
this.parent = parent;
this.owner = owner;
}
@@ -440,7 +453,8 @@ namespace GXml {
}
}
- internal AttrChildNodeList (Xml.Attr* parent, Document owner) {
+ internal AttrChildNodeList (Xml.Attr* parent,
+ Document owner) {
this.parent = parent;
this.owner = owner;
}
@@ -470,7 +484,8 @@ namespace GXml {
}
}
- internal EntityChildNodeList (Xml.Entity* parent, Document owner) {
+ internal EntityChildNodeList (Xml.Entity* parent,
+ Document owner) {
this.parent = parent;
this.owner = owner;
}
@@ -547,7 +562,8 @@ namespace GXml {
public Node? nth_data (ulong n) {
return nth (n);
}
- public Node? nth_prev (Node pivot, ulong n) {
+ public Node? nth_prev (Node pivot,
+ ulong n) {
Xml.Node *cur;
for (cur = head; cur != null && this.owner.lookup_node (cur) != pivot; cur =
cur->next) {
}
@@ -571,7 +587,8 @@ namespace GXml {
return pos;
}
}
- public int find_custom (Node target, CompareFunc<Node> cmp) {
+ public int find_custom (Node target,
+ CompareFunc<Node> cmp) {
int pos = 0;
Xml.Node *cur;
for (cur = head; cur != null && cmp (this.owner.lookup_node (cur), target) != 0; cur
= cur->next) {
@@ -591,7 +608,8 @@ namespace GXml {
}
/** Node's child methods, implemented here **/
- internal new unowned Node? insert_before (Node new_child, Node? ref_child) {
+ internal new unowned Node? insert_before (Node new_child,
+ Node? ref_child) {
Xml.Node *child = head;
if (ref_child == null) {
@@ -617,7 +635,8 @@ namespace GXml {
return new_child;
}
- internal new unowned Node? replace_child (Node new_child, Node old_child) {
+ internal new unowned Node? replace_child (Node new_child,
+ Node old_child) {
// TODO: verify that libxml2 already removes
// new_child first if it is found elsewhere in
// the tree.
diff --git a/gxml/ProcessingInstruction.vala b/gxml/ProcessingInstruction.vala
index 46588f3..4077849 100644
--- a/gxml/ProcessingInstruction.vala
+++ b/gxml/ProcessingInstruction.vala
@@ -41,7 +41,9 @@ namespace GXml {
* For more, see: [[http://www.w3.org/TR/DOM-Level-1/level-one-core.html#ID-1004215813]]
*/
public class ProcessingInstruction : Node {
- internal ProcessingInstruction (string target, string data, Document doc) {
+ internal ProcessingInstruction (string target,
+ string data,
+ Document doc) {
base (NodeType.PROCESSING_INSTRUCTION, doc); // TODO: want to pass a real Xml.Node* ?
this.target = target;
this.data = data;
diff --git a/gxml/Serializable.vala b/gxml/Serializable.vala
index 53ac7fc..775eb7e 100644
--- a/gxml/Serializable.vala
+++ b/gxml/Serializable.vala
@@ -100,7 +100,9 @@ namespace GXml {
* letting them get name from spec
* @todo: consider returning { link GLib.Value} as out param
*/
- public virtual bool deserialize_property (string property_name, /* out GLib.Value value,*/
GLib.ParamSpec spec, GXml.Node property_node) {
+ public virtual bool deserialize_property (string property_name,
+ GLib.ParamSpec spec,
+ GXml.Node property_node) {
return false; // default deserialize_property gets used
}
@@ -129,7 +131,9 @@ namespace GXml {
/*
* @todo: consider not giving property_name, let them get name from spec?
*/
- public virtual GXml.Node? serialize_property (string property_name, /*GLib.Value value, */
GLib.ParamSpec spec, GXml.Document doc) {
+ public virtual GXml.Node? serialize_property (string property_name,
+ GLib.ParamSpec spec,
+ GXml.Document doc) {
return null; // default serialize_property gets used
}
@@ -228,7 +232,8 @@ namespace GXml {
* @todo: why not just return a string? :D Who cares
* how analogous it is to { link GLib.Object.get_property}? :D
*/
- public virtual void get_property (GLib.ParamSpec spec, ref GLib.Value str_value) {
+ public virtual void get_property (GLib.ParamSpec spec,
+ ref GLib.Value str_value) {
((GLib.Object)this).get_property (spec.name, ref str_value);
}
/*
@@ -253,7 +258,8 @@ namespace GXml {
* handle this case as a virtual property, supported
* by the other { link GXml.Serializable} functions.
*/
- public virtual void set_property (GLib.ParamSpec spec, GLib.Value value) {
+ public virtual void set_property (GLib.ParamSpec spec,
+ GLib.Value value) {
((GLib.Object)this).set_property (spec.name, value);
}
}
diff --git a/gxml/Serialization.vala b/gxml/Serialization.vala
index e166a03..6687f90 100644
--- a/gxml/Serialization.vala
+++ b/gxml/Serialization.vala
@@ -72,7 +72,8 @@ namespace GXml {
* data types not automatically supported by { link GXml.Serialization}.
*/
public class Serialization : GLib.Object {
- private static void print_debug (GXml.Document doc, GLib.Object object) {
+ private static void print_debug (GXml.Document doc,
+ GLib.Object object) {
stdout.printf ("Object XML\n---\n%s\n", doc.to_string ());
stdout.printf ("object\n---\n");
@@ -87,7 +88,10 @@ namespace GXml {
* { link GLib.Value} can transform into a string, and
* operates recursively.
*/
- private static GXml.Node serialize_property (GLib.Object object, ParamSpec prop_spec,
GXml.Document doc) throws SerializationError {
+ private static GXml.Node serialize_property (GLib.Object object,
+ ParamSpec prop_spec,
+ GXml.Document doc)
+ throws SerializationError {
Type type;
Value value;
Node value_node;
@@ -205,7 +209,8 @@ namespace GXml {
* @param object A { link GLib.Object} to serialize
* @return a { link GXml.Document} representing the serialized `object`
*/
- public static GXml.Document serialize_object (GLib.Object object) throws SerializationError {
+ public static GXml.Document serialize_object (GLib.Object object)
+ throws SerializationError {
Document doc;
Element root;
ParamSpec[] prop_specs;
@@ -298,7 +303,10 @@ namespace GXml {
* strings back to other types, we use our own function to do
* that.
*/
- private static void deserialize_property (ParamSpec spec, Element prop_elem, out Value val)
throws SerializationError {
+ private static void deserialize_property (ParamSpec spec,
+ Element prop_elem,
+ out Value val)
+ throws SerializationError {
Type type;
type = spec.value_type;
@@ -516,7 +524,8 @@ namespace GXml {
* @todo: what do functions written in Vala return in C when
* they throw an exception? NULL/0/FALSE?
*/
- public static bool string_to_gvalue (string str, ref GLib.Value dest) throws
SerializationError {
+ public static bool string_to_gvalue (string str,
+ ref GLib.Value dest) throws SerializationError {
Type t = dest.type ();
GLib.Value dest2 = Value (t);
bool ret = false;
diff --git a/gxml/Text.vala b/gxml/Text.vala
index edc885e..2f411ad 100644
--- a/gxml/Text.vala
+++ b/gxml/Text.vala
@@ -42,7 +42,8 @@ namespace GXml {
* URL: [[http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#ID-1312295772]]
*/
public class Text : CharacterData {
- internal Text (Xml.Node *text_node, Document doc) {
+ internal Text (Xml.Node *text_node,
+ Document doc) {
base (text_node, doc);
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]