[glib/gvariant] Add G_TYPE_VARIANT boxed type to libgobject
- From: Ryan Lortie <ryanl src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [glib/gvariant] Add G_TYPE_VARIANT boxed type to libgobject
- Date: Tue, 24 Nov 2009 22:44:35 +0000 (UTC)
commit 59ef9bc1aff2d815d4687ee8279101f2b763365f
Author: Ryan Lortie <desrt desrt ca>
Date: Sat Nov 21 12:57:57 2009 -0600
Add G_TYPE_VARIANT boxed type to libgobject
Conflicts:
docs/reference/gobject/gobject-sections.txt
gobject/gboxed.c
gobject/gboxed.h
docs/reference/gobject/gobject-sections.txt | 2 ++
gobject/gboxed.c | 12 ++++++++++++
gobject/gboxed.h | 9 +++++++++
gobject/gobject.symbols | 1 +
4 files changed, 24 insertions(+), 0 deletions(-)
---
diff --git a/docs/reference/gobject/gobject-sections.txt b/docs/reference/gobject/gobject-sections.txt
index b970c28..15e4075 100644
--- a/docs/reference/gobject/gobject-sections.txt
+++ b/docs/reference/gobject/gobject-sections.txt
@@ -344,6 +344,7 @@ G_TYPE_REGEX
G_TYPE_ARRAY
G_TYPE_BYTE_ARRAY
G_TYPE_PTR_ARRAY
+G_TYPE_VARIANT
GStrv
<SUBSECTION Standard>
@@ -358,6 +359,7 @@ g_regex_get_type
g_array_get_type
g_byte_array_get_type
g_ptr_array_get_type
+g_variant_get_gtype
</SECTION>
<SECTION>
diff --git a/gobject/gboxed.c b/gobject/gboxed.c
index e3a6170..426cf9f 100644
--- a/gobject/gboxed.c
+++ b/gobject/gboxed.c
@@ -304,6 +304,18 @@ g_byte_array_get_type (void)
type_id = g_boxed_type_register_static (g_intern_static_string ("GByteArray"),
(GBoxedCopyFunc) g_byte_array_ref,
(GBoxedFreeFunc) g_byte_array_unref);
+}
+
+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;
}
diff --git a/gobject/gboxed.h b/gobject/gboxed.h
index 82e2722..963d7a4 100644
--- a/gobject/gboxed.h
+++ b/gobject/gboxed.h
@@ -186,6 +186,14 @@ GType g_boxed_type_register_static (const gchar *name,
* Since: 2.22
*/
#define G_TYPE_PTR_ARRAY (g_ptr_array_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,
@@ -204,6 +212,7 @@ GType g_hash_table_get_type (void) G_GNUC_CONST;
GType g_array_get_type (void) G_GNUC_CONST;
GType g_byte_array_get_type (void) G_GNUC_CONST;
GType g_ptr_array_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 a43dd08..3e0e162 100644
--- a/gobject/gobject.symbols
+++ b/gobject/gobject.symbols
@@ -24,6 +24,7 @@ g_array_get_type G_GNUC_CONST
g_byte_array_get_type G_GNUC_CONST
g_ptr_array_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]