[glibmm] VariantType: Capitalize the standard types.



commit 9fc6b1931a5bf9fd8548f14fde7cd74b2214417b
Author: Murray Cumming <murrayc murrayc com>
Date:   Mon Mar 28 15:14:27 2011 +0200

    VariantType: Capitalize the standard types.
    
    * glib/src/varianttype.[hg|ccg]: Use, for instance VARIANT_TYPE_STRING instead
    of VariantTypeString. This seems more appropriate for a constant and is the
    style used by gtkmm's STOCK_* items, which this is based on.
    * glib/src/variant.ccg: Adapt.

 ChangeLog                |    9 ++++++++
 glib/src/variant.ccg     |   14 ++++++------
 glib/src/varianttype.ccg |   50 +++++++++++++++++++++++-----------------------
 glib/src/varianttype.hg  |   50 +++++++++++++++++++++++-----------------------
 4 files changed, 66 insertions(+), 57 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 8963d7f..5791a48 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2011-03-28  Murray Cumming  <murrayc murrayc com>
 
+	VariantType: Capitalize the standard types.
+
+	* glib/src/varianttype.[hg|ccg]: Use, for instance VARIANT_TYPE_STRING instead 
+	of VariantTypeString. This seems more appropriate for a constant and is the 
+	style used by gtkmm's STOCK_* items, which this is based on.
+	* glib/src/variant.ccg: Adapt.
+	
+2011-03-28  Murray Cumming  <murrayc murrayc com>
+
 	Variant: Add cast_dynamic<> specializations for strings.
 
 	* glib/src/variant.[hg|ccg]: Add cast_dynamic() specializations for 
diff --git a/glib/src/variant.ccg b/glib/src/variant.ccg
index c41bfb5..b4a100c 100644
--- a/glib/src/variant.ccg
+++ b/glib/src/variant.ccg
@@ -194,9 +194,9 @@ throw(std::bad_cast)
   }
 
   const VariantType vtype = v.get_type();
-  if( vtype.equal(VariantTypeString) ||
-      vtype.equal(VariantTypeObjectPath) ||
-      vtype.equal(VariantTypeSignature) )
+  if( vtype.equal(VARIANT_TYPE_STRING) ||
+      vtype.equal(VARIANT_TYPE_OBJECT_PATH) ||
+      vtype.equal(VARIANT_TYPE_SIGNATURE) )
   {
     return Variant<Glib::ustring>(const_cast<GVariant*>(v.gobj()), true);
   }
@@ -237,10 +237,10 @@ throw(std::bad_cast)
   }
 
   const VariantType vtype = v.get_type();
-  if( vtype.equal(VariantTypeString) ||
-      vtype.equal(VariantTypeByteString) ||  
-      vtype.equal(VariantTypeObjectPath) ||
-      vtype.equal(VariantTypeSignature) )
+  if( vtype.equal(VARIANT_TYPE_STRING) ||
+      vtype.equal(VARIANT_TYPE_BYTE_STRING) ||  
+      vtype.equal(VARIANT_TYPE_OBJECT_PATH) ||
+      vtype.equal(VARIANT_TYPE_SIGNATURE) )
   {
     return Variant<std::string>(const_cast<GVariant*>(v.gobj()), true);
   }
diff --git a/glib/src/varianttype.ccg b/glib/src/varianttype.ccg
index 904b907..5abf71e 100644
--- a/glib/src/varianttype.ccg
+++ b/glib/src/varianttype.ccg
@@ -51,54 +51,54 @@ VariantType& VariantType::operator=(const GVariantType* castitem)
 }
 
 
-const VariantType VariantTypeBool(G_VARIANT_TYPE_BOOLEAN);
+const VariantType VARIANT_TYPE_BOOL(G_VARIANT_TYPE_BOOLEAN);
 
-const VariantType VariantTypeByte(G_VARIANT_TYPE_BYTE);
+const VariantType VARIANT_TYPE_BYTE(G_VARIANT_TYPE_BYTE);
 
-const VariantType VariantTypeInt16(G_VARIANT_TYPE_INT16);
+const VariantType VARIANT_TYPE_INT16(G_VARIANT_TYPE_INT16);
 
-const VariantType VariantTypeUint16(G_VARIANT_TYPE_UINT16);
+const VariantType VARIANT_TYPE_UINT16(G_VARIANT_TYPE_UINT16);
 
-const VariantType VariantTypeInt32(G_VARIANT_TYPE_INT32);
+const VariantType VARIANT_TYPE_INT32(G_VARIANT_TYPE_INT32);
 
-const VariantType VariantTypeUint32(G_VARIANT_TYPE_UINT32);
+const VariantType VARIANT_TYPE_UINT32(G_VARIANT_TYPE_UINT32);
 
-const VariantType VariantTypeInt64(G_VARIANT_TYPE_INT64);
+const VariantType VARIANT_TYPE_INT64(G_VARIANT_TYPE_INT64);
 
-const VariantType VariantTypeUint64(G_VARIANT_TYPE_UINT64);
+const VariantType VARIANT_TYPE_UINT64(G_VARIANT_TYPE_UINT64);
 
-const VariantType VariantTypeDouble(G_VARIANT_TYPE_DOUBLE);
+const VariantType VARIANT_TYPE_DOUBLE(G_VARIANT_TYPE_DOUBLE);
 
-const VariantType VariantTypeString(G_VARIANT_TYPE_STRING);
+const VariantType VARIANT_TYPE_STRING(G_VARIANT_TYPE_STRING);
 
-const VariantType VariantTypeObjectPath(G_VARIANT_TYPE_OBJECT_PATH);
+const VariantType VARIANT_TYPE_OBJECT_PATH(G_VARIANT_TYPE_OBJECT_PATH);
 
-const VariantType VariantTypeSignature(G_VARIANT_TYPE_SIGNATURE);
+const VariantType VARIANT_TYPE_SIGNATURE(G_VARIANT_TYPE_SIGNATURE);
 
-const VariantType VariantTypeVariant(G_VARIANT_TYPE_VARIANT);
+const VariantType VARIANT_TYPE_VARIANT(G_VARIANT_TYPE_VARIANT);
 
-const VariantType VariantTypeHandle(G_VARIANT_TYPE_HANDLE);
+const VariantType VARIANT_TYPE_HANDLE(G_VARIANT_TYPE_HANDLE);
 
-const VariantType VariantTypeUnit(G_VARIANT_TYPE_UNIT);
+const VariantType VARIANT_TYPE_UNIT(G_VARIANT_TYPE_UNIT);
 
-const VariantType VariantTypeAny(G_VARIANT_TYPE_ANY);
+const VariantType VARIANT_TYPE_ANY(G_VARIANT_TYPE_ANY);
 
-const VariantType VariantTypeBasic(G_VARIANT_TYPE_BASIC);
+const VariantType VARIANT_TYPE_BASIC(G_VARIANT_TYPE_BASIC);
 
-const VariantType VariantTypeMaybe(G_VARIANT_TYPE_MAYBE);
+const VariantType VARIANT_TYPE_MAYBE(G_VARIANT_TYPE_MAYBE);
 
-const VariantType VariantTypeArray(G_VARIANT_TYPE_ARRAY);
+const VariantType VARIANT_TYPE_ARRAY(G_VARIANT_TYPE_ARRAY);
 
-const VariantType VariantTypeTuple(G_VARIANT_TYPE_TUPLE);
+const VariantType VARIANT_TYPE_TUPLE(G_VARIANT_TYPE_TUPLE);
 
-const VariantType VariantTypeDictEntry(G_VARIANT_TYPE_DICT_ENTRY);
+const VariantType VARIANT_TYPE_DICTENTRY(G_VARIANT_TYPE_DICT_ENTRY);
 
-const VariantType VariantTypeDictionary(G_VARIANT_TYPE_DICTIONARY);
+const VariantType VARIANT_TYPE_DICTIONARY(G_VARIANT_TYPE_DICTIONARY);
 
-const VariantType VariantTypeStringArray(G_VARIANT_TYPE_STRING_ARRAY);
+const VariantType VARIANT_TYPE_STRING_ARRAY(G_VARIANT_TYPE_STRING_ARRAY);
 
-const VariantType VariantTypeByteString(G_VARIANT_TYPE_BYTESTRING);
+const VariantType VARIANT_TYPE_BYTE_STRING(G_VARIANT_TYPE_BYTESTRING);
 
-const VariantType VariantTypeByteStringArray(G_VARIANT_TYPE_STRING_ARRAY);
+const VariantType VARIANT_TYPE_BYTE_STRING_ARRAY(G_VARIANT_TYPE_STRING_ARRAY);
 
 }
diff --git a/glib/src/varianttype.hg b/glib/src/varianttype.hg
index bac4f23..a954c27 100644
--- a/glib/src/varianttype.hg
+++ b/glib/src/varianttype.hg
@@ -146,55 +146,55 @@ public:
   _WRAP_METHOD(VariantType value() const, g_variant_type_value)
 };
 
-extern const VariantType VariantTypeBool;
+extern const VariantType VARIANT_TYPE_BOOL;
 
-extern const VariantType VariantTypeByte;
+extern const VariantType VARIANT_TYPE_BYTE;
 
-extern const VariantType VariantTypeInt16;
+extern const VariantType VARIANT_TYPE_INT16;
 
-extern const VariantType VariantTypeUint16;
+extern const VariantType VARIANT_TYPE_UINT16;
 
-extern const VariantType VariantTypeInt32;
+extern const VariantType VARIANT_TYPE_INT32;
 
-extern const VariantType VariantTypeUint32;
+extern const VariantType VARIANT_TYPE_UINT32;
 
-extern const VariantType VariantTypeInt64;
+extern const VariantType VARIANT_TYPE_INT64;
 
-extern const VariantType VariantTypeUint64;
+extern const VariantType VARIANT_TYPE_UINT64;
 
-extern const VariantType VariantTypeDouble;
+extern const VariantType VARIANT_TYPE_DOUBLE;
 
-extern const VariantType VariantTypeString;
+extern const VariantType VARIANT_TYPE_STRING;
 
-extern const VariantType VariantTypeObjectPath;
+extern const VariantType VARIANT_TYPE_OBJECT_PATH;
 
-extern const VariantType VariantTypeSignature;
+extern const VariantType VARIANT_TYPE_SIGNATURE;
 
-extern const VariantType VariantTypeVariant;
+extern const VariantType VARIANT_TYPE_VARIANT;
 
-extern const VariantType VariantTypeHandle;
+extern const VariantType VARIANT_TYPE_HANDLE;
 
-extern const VariantType VariantTypeUnit;
+extern const VariantType VARIANT_TYPE_UNIT;
 
-extern const VariantType VariantTypeAny;
+extern const VariantType VARIANT_TYPE_ANY;
 
-extern const VariantType VariantTypeBasic;
+extern const VariantType VARIANT_TYPE_BASIC;
 
-extern const VariantType VariantTypeMaybe;
+extern const VariantType VARIANT_TYPE_MAYBE;
 
-extern const VariantType VariantTypeArray;
+extern const VariantType VARIANT_TYPE_ARRAY;
 
-extern const VariantType VariantTypeTuple;
+extern const VariantType VARIANT_TYPE_TUPLE;
 
-extern const VariantType VariantTypeDictEntry;
+extern const VariantType VARIANT_TYPE_DICT_ENTRY;
 
-extern const VariantType VariantTypeDictionary;
+extern const VariantType VARIANT_TYPE_DICTIONARY;
 
-extern const VariantType VariantTypeStringArray;
+extern const VariantType VARIANT_TYPE_STRING_ARRAY;
 
-extern const VariantType VariantTypeByteString;
+extern const VariantType VARIANT_TYPE_BYTE_STRING;
 
-extern const VariantType VariantTypeByteStringArray;
+extern const VariantType VARIANT_TYPE_BYTE_STRING_ARRAY;
 
 
 



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