summaryrefslogtreecommitdiff
path: root/glib/src
diff options
context:
space:
mode:
Diffstat (limited to 'glib/src')
-rw-r--r--glib/src/bytes.ccg15
-rw-r--r--glib/src/bytes.hg16
2 files changed, 31 insertions, 0 deletions
diff --git a/glib/src/bytes.ccg b/glib/src/bytes.ccg
index bc43f2d9..2dafaaff 100644
--- a/glib/src/bytes.ccg
+++ b/glib/src/bytes.ccg
@@ -24,4 +24,19 @@ Bytes::create(gconstpointer data, gsize size)
return Glib::wrap(bytes);
}
+GType Value<RefPtr<Glib::Bytes> >::value_type()
+{
+ return g_bytes_get_type();
+}
+
+void Value<RefPtr<Glib::Bytes> >::set(const CppType& data)
+{
+ set_boxed(Glib::unwrap(data));
+}
+
+Value<RefPtr<Glib::Bytes>>::CppType Value<RefPtr<Glib::Bytes>>::get() const
+{
+ return Glib::wrap(static_cast<CType>(get_boxed()), true);
+}
+
} // namespace Glib
diff --git a/glib/src/bytes.hg b/glib/src/bytes.hg
index db0a23f7..e01c89c1 100644
--- a/glib/src/bytes.hg
+++ b/glib/src/bytes.hg
@@ -20,6 +20,7 @@ _DEFS(glibmm,glib)
#include <glibmm/refptr.h>
#include <glibmm/ustring.h>
#include <glibmm/error.h>
+#include <glibmm/value.h>
#include <glib.h>
#ifndef DOXYGEN_SHOULD_SKIP_THIS
@@ -66,4 +67,19 @@ public:
_WRAP_METHOD(static gint compare(gconstpointer bytes1, gconstpointer bytes2), g_bytes_compare)
};
+// This is needed so Glib::RefPtr<Glib::Bytes> can be used with
+// Glib::Value and _WRAP_PROPERTY in Gio::BytesIcon.
+template <>
+class GLIBMM_API Value<Glib::RefPtr<Glib::Bytes>> : public ValueBase_Boxed
+{
+public:
+ using CppType = Glib::RefPtr<Glib::Bytes>;
+ using CType = GBytes*;
+
+ static GType value_type();
+
+ void set(const CppType& data);
+ CppType get() const;
+};
+
} // namespace Glib