[gxml] GomProperty: renamed to Property
- From: Daniel Espinosa Ortiz <despinosa src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gxml] GomProperty: renamed to Property
- Date: Sat, 6 Jul 2019 04:53:29 +0000 (UTC)
commit 691076f4a13405006f3816bd3393868c4b449420
Author: Daniel Espinosa <esodan gmail com>
Date: Fri Jul 5 22:05:34 2019 -0500
GomProperty: renamed to Property
gxml/Attr.vala | 2 +-
gxml/Element.vala | 2 +-
gxml/GomObject.vala | 32 ++++++++++++++++----------------
gxml/{GomProperty.vala => Property.vala} | 20 ++++++++++----------
gxml/StringRef.vala | 2 +-
gxml/XParser.vala | 8 ++++----
gxml/meson.build | 2 +-
test/DocumentTest.vala | 2 +-
test/ElementTest.vala | 4 ++--
test/SerializationTest.vala | 2 +-
10 files changed, 38 insertions(+), 38 deletions(-)
---
diff --git a/gxml/Attr.vala b/gxml/Attr.vala
index 4620d06..c6500f7 100644
--- a/gxml/Attr.vala
+++ b/gxml/Attr.vala
@@ -28,7 +28,7 @@ using Gee;
*/
public class GXml.Attr : GXml.Node, GXml.DomAttr {
protected string _namespace_uri;
- protected GomProperty prop = null;
+ protected GXml.Property prop = null;
public string local_name { owned get { return _local_name; } }
public string name {
owned get {
diff --git a/gxml/Element.vala b/gxml/Element.vala
index 974add2..50776ae 100644
--- a/gxml/Element.vala
+++ b/gxml/Element.vala
@@ -314,7 +314,7 @@ public class GXml.Element : GXml.Node,
string name = pspec.get_nick ().replace ("::", "");
var p = _attributes.get (name.down ());
if (p == null) {
- GomProperty prop = new StringRef (this, name);
+ GXml.Property prop = new StringRef (this, name);
_attributes.add_reference (name);
}
}
diff --git a/gxml/GomObject.vala b/gxml/GomObject.vala
index 7348199..95b5386 100644
--- a/gxml/GomObject.vala
+++ b/gxml/GomObject.vala
@@ -124,25 +124,25 @@ public interface GXml.GomObject : GLib.Object,
public virtual string? get_property_string (ParamSpec prop) {
var v = Value(prop.value_type);
get_property (prop.name, ref v);
- if (prop.value_type.is_a (typeof(GomProperty))) {
+ if (prop.value_type.is_a (typeof(GXml.Property))) {
#if DEBUG
- GLib.message ("Getting GomProperty attribute: "+prop.name);
+ GLib.message ("Getting GXml.Property attribute: "+prop.name);
#endif
var so = v.get_object ();
if (so == null) {
#if DEBUG
- GLib.message ("GomProperty is Null");
+ GLib.message ("GXml.Property is Null");
#endif
return null;
}
#if DEBUG
- if ((so as GomProperty).value != null) {
- message ("GomProperty Value: "+(so as GomProperty).value);
+ if ((so as GXml.Property).value != null) {
+ message ("GXml.Property Value: "+(so as GXml.Property).value);
} else {
- message ("GomProperty Value Is Null");
+ message ("GXml.Property Value Is Null");
}
#endif
- return (so as GomProperty).value;
+ return (so as GXml.Property).value;
}
if (prop.value_type.is_a (typeof (string))) {
return (string) v;
@@ -178,7 +178,7 @@ public interface GXml.GomObject : GLib.Object,
* property with given name its value is returned
* as string representation.
*
- * If property is a {@link GomProperty}
+ * If property is a {@link GXml.Property}
* returned value is a string representation according
* with object implementation.
*
@@ -194,22 +194,22 @@ public interface GXml.GomObject : GLib.Object,
return get_property_string (prop);
}
/**
- * Search for a property of type {@link GomProperty}
+ * Search for a property of type {@link GXml.Property}
* and returns it as object
*/
- public virtual GomProperty? find_property (string name) {
+ public virtual GXml.Property? find_property (string name) {
var prop = find_property_name (name);
if (prop != null) {
var v = Value (prop.value_type);
- if (prop.value_type.is_a (typeof(GomProperty))
+ if (prop.value_type.is_a (typeof(GXml.Property))
&& prop.value_type.is_instantiatable ()) {
get_property (prop.name, ref v);
- GomProperty so = (Object) v as GomProperty;
+ GXml.Property so = (Object) v as GXml.Property;
if (so == null) {
var obj = Object.new (prop.value_type);
v.set_object (obj);
set_property (prop.name, v);
- so = obj as GomProperty;
+ so = obj as GXml.Property;
}
return so;
}
@@ -229,15 +229,15 @@ public interface GXml.GomObject : GLib.Object,
var prop = find_property_name (name);
if (prop != null) {
var v = Value (prop.value_type);
- if (prop.value_type.is_a (typeof(GomProperty))
+ if (prop.value_type.is_a (typeof(GXml.Property))
&& prop.value_type.is_instantiatable ()) {
get_property (prop.name, ref v);
- GomProperty so = (Object) v as GomProperty;
+ GXml.Property so = (Object) v as GXml.Property;
if (so == null) {
var obj = Object.new (prop.value_type);
v.set_object (obj);
set_property (prop.name, v);
- so = obj as GomProperty;
+ so = obj as GXml.Property;
}
so.value = val;
return true;
diff --git a/gxml/GomProperty.vala b/gxml/Property.vala
similarity index 95%
rename from gxml/GomProperty.vala
rename to gxml/Property.vala
index 3b53dd5..b20ee34 100644
--- a/gxml/GomProperty.vala
+++ b/gxml/Property.vala
@@ -26,7 +26,7 @@
* {@link DomElement} attributes. If object is instantiated it is
* written, if not is just ingnored.
*/
-public interface GXml.GomProperty : Object
+public interface GXml.Property : Object
{
/**
* Attribute's value in the parent {@link DomElement} using a string.
@@ -44,7 +44,7 @@ public interface GXml.GomProperty : Object
/**
* Base class for properties implementing {@link GomProperty} interface.
*/
-public abstract class GXml.GomBaseProperty : Object, GXml.GomProperty {
+public abstract class GXml.BaseProperty : Object, GXml.Property {
/**
* {@inheritDoc}
*/
@@ -59,7 +59,7 @@ public abstract class GXml.GomBaseProperty : Object, GXml.GomProperty {
* Convenient class to handle {@link GomElement}'s attributes
* using validated string using Regular Expressions.
*/
-public class GXml.GomString : GomBaseProperty {
+public class GXml.GomString : GXml.BaseProperty {
protected string _value = "";
public override string? value {
owned get {
@@ -79,7 +79,7 @@ public class GXml.GomString : GomBaseProperty {
* Convenient class to handle a {@link GomElement}'s attribute
* using a list of pre-defined and unmutable values.
*/
-public class GXml.GomArrayString : GomBaseProperty {
+public class GXml.GomArrayString : GXml.BaseProperty {
protected string _value = "";
protected string[] _values = null;
public unowned string[] get_values () {
@@ -221,7 +221,7 @@ public class GXml.GomXsdArrayString : GomArrayString {
*
* Property is represented as a string.
*/
-public class GXml.GomDouble : GomBaseProperty {
+public class GXml.GomDouble : GXml.BaseProperty {
protected double _value = 0.0;
public override string? value {
owned get {
@@ -271,7 +271,7 @@ public class GXml.GomFloat : GomDouble {
*
* Property is represented as a string.
*/
-public class GXml.GomInt : GomBaseProperty {
+public class GXml.GomInt : GXml.BaseProperty {
protected int _value = 0;
public override string? value {
owned get {
@@ -297,7 +297,7 @@ public class GXml.GomInt : GomBaseProperty {
*
* Property is represented as a string, using 'true' or 'false'.
*/
-public class GXml.GomBoolean : GomBaseProperty {
+public class GXml.GomBoolean : GXml.BaseProperty {
protected bool _value = false;
public override string? value {
owned get {
@@ -324,7 +324,7 @@ public class GXml.GomBoolean : GomBaseProperty {
* Enumeration is represented as a string, using its name, independent of
* value possition in enumeration.
*/
-public class GXml.GomEnum : GomBaseProperty {
+public class GXml.GomEnum : GXml.BaseProperty {
protected int _value = 0;
protected Type _enum_type;
public override string? value {
@@ -374,7 +374,7 @@ public class GXml.GomEnum : GomBaseProperty {
*
* Property is represented as a string using a %Y-%m-%d format
*/
-public class GXml.GomDate : GomBaseProperty {
+public class GXml.GomDate : GXml.BaseProperty {
protected Date _value = Date ();
public override string? value {
owned get {
@@ -423,7 +423,7 @@ public class GXml.GomDate : GomBaseProperty {
* and {@link GLib.DateTime.format} method. If {@link GomDateTime.format}
* is not set '%FT%T' format is used by default.
*/
-public class GXml.GomDateTime : GomBaseProperty {
+public class GXml.GomDateTime : GXml.BaseProperty {
protected DateTime _value = null;
public string format { get; set; }
public override string? value {
diff --git a/gxml/StringRef.vala b/gxml/StringRef.vala
index e2355e7..939e671 100644
--- a/gxml/StringRef.vala
+++ b/gxml/StringRef.vala
@@ -20,7 +20,7 @@
* Authors:
* Daniel Espinosa <esodan gmail com>
*/
-public class GXml.StringRef : Object, GomProperty {
+public class GXml.StringRef : Object, GXml.Property {
GomObject object;
string name;
public string? value {
diff --git a/gxml/XParser.vala b/gxml/XParser.vala
index b4a7d3d..213e0db 100644
--- a/gxml/XParser.vala
+++ b/gxml/XParser.vala
@@ -495,10 +495,10 @@ public class GXml.XParser : Object, GXml.Parser {
foreach (ParamSpec pspec in lp) {
string attname = pspec.get_nick ().replace ("::","");
string val = null;
- if (pspec.value_type.is_a (typeof (GomProperty))) {
+ if (pspec.value_type.is_a (typeof (GXml.Property))) {
Value v = Value (pspec.value_type);
node.get_property (pspec.name, ref v);
- GomProperty gp = v.get_object () as GomProperty;
+ GXml.Property gp = v.get_object () as GXml.Property;
if (gp == null) continue;
val = gp.value;
} else {
@@ -603,10 +603,10 @@ public class GXml.XParser : Object, GXml.Parser {
yield;
string attname = pspec.get_nick ().replace ("::","");
string val = null;
- if (pspec.value_type.is_a (typeof (GomProperty))) {
+ if (pspec.value_type.is_a (typeof (GXml.Property))) {
Value v = Value (pspec.value_type);
node.get_property (pspec.name, ref v);
- GomProperty gp = v.get_object () as GomProperty;
+ GXml.Property gp = v.get_object () as GXml.Property;
if (gp == null) continue;
val = gp.value;
} else {
diff --git a/gxml/meson.build b/gxml/meson.build
index 64591c6..c7cb867 100644
--- a/gxml/meson.build
+++ b/gxml/meson.build
@@ -56,7 +56,6 @@ valasources = files ([
'Enumeration.vala',
'Event.vala',
'GomObject.vala',
- 'GomProperty.vala',
'gxml-init.vala',
'HashMap.vala',
'HashPairedMap.vala',
@@ -67,6 +66,7 @@ valasources = files ([
'Node.vala',
'NodeType.vala',
'Parser.vala',
+ 'Property.vala',
'Range.vala',
'SettableTokenList.vala',
'StringRef.vala',
diff --git a/test/DocumentTest.vala b/test/DocumentTest.vala
index a0ce58b..a658391 100644
--- a/test/DocumentTest.vala
+++ b/test/DocumentTest.vala
@@ -40,7 +40,7 @@ class GXml.DocumentTest : GXmlTest {
public string text { get; set; }
[Description (nick="::prop")]
public ObjectProperty prop { get; set; }
- public class ObjectProperty : Object, GomProperty {
+ public class ObjectProperty : Object, GXml.Property {
public string? value { owned get; set; }
public bool validate_value (string? val) {
return true;
diff --git a/test/ElementTest.vala b/test/ElementTest.vala
index 8de24ce..f0f2d14 100644
--- a/test/ElementTest.vala
+++ b/test/ElementTest.vala
@@ -25,7 +25,7 @@ using GXml;
public interface NoInstantiatable : Object, GomObject {
public abstract string name { get; set; }
}
-public interface Property : Object, GomProperty {}
+public interface Property : Object, GXml.Property {}
class ObjectParent : GXml.Element {
construct {
@@ -42,7 +42,7 @@ class ObjectParent : GXml.Element {
public ObjectProperty prop2 { get; set; }
[Description (nick="::prop3")]
public ObjectProperty prop3 { get; set; }
- public class ObjectProperty : Object, GomProperty {
+ public class ObjectProperty : Object, GXml.Property {
public string? value { owned get; set; }
public bool validate_value (string? val) {
return true;
diff --git a/test/SerializationTest.vala b/test/SerializationTest.vala
index 998abc9..08985e9 100644
--- a/test/SerializationTest.vala
+++ b/test/SerializationTest.vala
@@ -914,7 +914,7 @@ class SerializationTest : GXmlTest {
assert ("<Motor On=\"false\" Torque=\"0.0000\" Speed=\"1.0000\"/>" in s);
assert (m.speed != null);
assert (m is GomObject);
- assert (m.speed is GomProperty);
+ assert (m.speed is GXml.Property);
assert (m.speed.get_double () == 1.0);
assert (m.speed.value != null);
assert (m.speed.value == "1.0000");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]