[glibmm/glibmm-2-36] ByteArray: Add a Glib::Value<> template specialization for it.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glibmm/glibmm-2-36] ByteArray: Add a Glib::Value<> template specialization for it.
- Date: Tue, 16 Apr 2013 11:24:47 +0000 (UTC)
commit c1f7818d46075ef2c51e73558ca255523ce454de
Author: José Alburquerque <jaalburqu svn gnome org>
Date: Tue Apr 2 00:37:49 2013 -0400
ByteArray: Add a Glib::Value<> template specialization for it.
* glib/src/bytearray.{ccg,hg}: Add the specialization for ByteArray so
that getting/setting properties of that type work. Also added a
Glib::ByteArray::get_type() method required for the specialization to
compile.
ChangeLog | 11 +++++++++++
glib/src/bytearray.ccg | 5 +++++
glib/src/bytearray.hg | 16 ++++++++++++++++
3 files changed, 32 insertions(+)
---
diff --git a/ChangeLog b/ChangeLog
index 24f03a6..3b1d803 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2013-04-02 José Alburquerque <jaalburquerque gmail com>
+
+ ByteArray: Add a Glib::Value<> template specialization for it.
+
+ * glib/src/bytearray.{ccg,hg}: Add the specialization for ByteArray so
+ that getting/setting properties of that type work. Also added a
+ Glib::ByteArray::get_type() method required for the specialization to
+ compile.
+
+This is the master branch for glibmm 2.37/8.
+
2013-04-01 Murray Cumming <murrayc murrayc com>
Remove Tls* classes from git.
diff --git a/glib/src/bytearray.ccg b/glib/src/bytearray.ccg
index 71a0d5f..db3585f 100644
--- a/glib/src/bytearray.ccg
+++ b/glib/src/bytearray.ccg
@@ -43,4 +43,9 @@ Glib::RefPtr<Glib::ByteArray> ByteArray::create()
return Glib::wrap(array);
}
+GType ByteArray::get_type()
+{
+ return g_byte_array_get_type();
+}
+
} // namespace Glib
diff --git a/glib/src/bytearray.hg b/glib/src/bytearray.hg
index 8cd6555..a9e2312 100644
--- a/glib/src/bytearray.hg
+++ b/glib/src/bytearray.hg
@@ -39,6 +39,7 @@ class ByteArray
{
_CLASS_OPAQUE_REFCOUNTED(ByteArray, GByteArray, NONE, g_byte_array_ref, g_byte_array_unref)
_IGNORE(g_byte_array_ref, g_byte_array_unref)
+
public:
/** A Slot type to compare two elements in the array. The slot should return
* -1 if the first value is less than the second, 0 if they are equal and 1
@@ -65,6 +66,21 @@ public:
_IGNORE(g_byte_array_sort)
_WRAP_METHOD(Glib::RefPtr<ByteArray> set_size(guint length), g_byte_array_set_size)
+
+#ifndef DOXYGEN_SHOULD_SKIP_THIS
+ static GType get_type() G_GNUC_CONST;
+#endif
+};
+
+#ifndef DOXYGEN_SHOULD_SKIP_THIS
+template <>
+class Value< Glib::RefPtr<Glib::ByteArray> > : public ValueBase_Boxed
+{
+public:
+ static GType value_type() { return Glib::ByteArray::get_type(); }
+ void set(const Glib::RefPtr<Glib::ByteArray>& array) { set_boxed(Glib::unwrap(array)); }
+ Glib::RefPtr<Glib::ByteArray> get() { return
Glib::RefPtr<Glib::ByteArray>(reinterpret_cast<Glib::ByteArray*>(get_boxed())); }
};
+#endif /* DOXYGEN_SHOULD_SKIP_THIS */
} // namespace Glib
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]