[glib/gvariant] Add G_TYPE_VARIANT boxed type to libgobject
- From: Ryan Lortie <ryanl src gnome org>
- To: svn-commits-list gnome org
- Subject: [glib/gvariant] Add G_TYPE_VARIANT boxed type to libgobject
- Date: Wed, 8 Apr 2009 10:25:50 -0400 (EDT)
commit d64beb46376a62f3ee98eecb4d6599900a0562dc
Author: Ryan Lortie <desrt desrt ca>
Date: Wed Apr 8 10:25:14 2009 -0400
Add G_TYPE_VARIANT boxed type to libgobject
---
docs/reference/gobject/gobject-sections.txt | 2 ++
gobject/gboxed.c | 13 +++++++++++++
gobject/gboxed.h | 9 +++++++++
gobject/gobject.symbols | 1 +
4 files changed, 25 insertions(+), 0 deletions(-)
diff --git a/docs/reference/gobject/gobject-sections.txt b/docs/reference/gobject/gobject-sections.txt
index f0307dd..c4cc2b1 100644
--- a/docs/reference/gobject/gobject-sections.txt
+++ b/docs/reference/gobject/gobject-sections.txt
@@ -341,6 +341,7 @@ G_TYPE_DATE
G_TYPE_GSTRING
G_TYPE_STRV
G_TYPE_REGEX
+G_TYPE_VARIANT
GStrv
<SUBSECTION Standard>
@@ -352,6 +353,7 @@ g_strv_get_type
g_date_get_type
g_hash_table_get_type
g_regex_get_type
+g_variant_get_gtype
</SECTION>
<SECTION>
diff --git a/gobject/gboxed.c b/gobject/gboxed.c
index 8cdcd1e..f2ba73c 100644
--- a/gobject/gboxed.c
+++ b/gobject/gboxed.c
@@ -274,6 +274,19 @@ g_regex_get_type (void)
return type_id;
}
+GType
+g_variant_get_gtype (void)
+{
+ static GType type_id = 0;
+
+ if (!type_id)
+ type_id = g_boxed_type_register_static (g_intern_static_string ("GVariant"),
+ (GBoxedCopyFunc) g_variant_ref,
+ (GBoxedFreeFunc) g_variant_unref);
+
+ return type_id;
+}
+
static void
boxed_proxy_value_init (GValue *value)
{
diff --git a/gobject/gboxed.h b/gobject/gboxed.h
index 75a5193..3c9a23f 100644
--- a/gobject/gboxed.h
+++ b/gobject/gboxed.h
@@ -162,6 +162,14 @@ GType g_boxed_type_register_static (const gchar *name,
* Since: 2.14
*/
#define G_TYPE_REGEX (g_regex_get_type ())
+/**
+ * G_TYPE_VARIANT:
+ *
+ * The #GType for a boxed type holding a #GVariant reference.
+ *
+ * Since: 2.14
+ */
+#define G_TYPE_VARIANT (g_variant_get_gtype ())
void g_value_take_boxed (GValue *value,
@@ -177,6 +185,7 @@ GType g_date_get_type (void) G_GNUC_CONST;
GType g_strv_get_type (void) G_GNUC_CONST;
GType g_gstring_get_type (void) G_GNUC_CONST;
GType g_hash_table_get_type (void) G_GNUC_CONST;
+GType g_variant_get_gtype (void) G_GNUC_CONST;
GType g_regex_get_type (void) G_GNUC_CONST;
/**
diff --git a/gobject/gobject.symbols b/gobject/gobject.symbols
index 7a98dc3..4a2aa99 100644
--- a/gobject/gobject.symbols
+++ b/gobject/gobject.symbols
@@ -21,6 +21,7 @@ g_gstring_get_type G_GNUC_CONST
g_strv_get_type G_GNUC_CONST
g_hash_table_get_type G_GNUC_CONST
g_regex_get_type G_GNUC_CONST
+g_variant_get_gtype G_GNUC_CONST
g_closure_get_type G_GNUC_CONST
g_value_get_type G_GNUC_CONST
g_value_array_get_type G_GNUC_CONST
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]