[gconf] Add boxed types for GConfEntry and GConfValue



commit 82c7342531d4f991d436c220825a68c9e5868eef
Author: Florian Müllner <fmuellner src gnome org>
Date:   Wed Mar 10 07:56:23 2010 +0100

    Add boxed types for GConfEntry and GConfValue
    
    Without a GType, these are unavailable to gobject-introspection.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=613247

 gconf/gconf-value.c |   24 ++++++++++++++++++++++++
 gconf/gconf-value.h |    3 +++
 2 files changed, 27 insertions(+), 0 deletions(-)
---
diff --git a/gconf/gconf-value.c b/gconf/gconf-value.c
index e941eb4..499403d 100644
--- a/gconf/gconf-value.c
+++ b/gconf/gconf-value.c
@@ -710,6 +710,18 @@ copy_value_list(GSList* list)
   return copy;
 }
 
+GType
+gconf_value_get_type ()
+{
+  static GType type = 0;
+
+  if (type == 0)
+    type = g_boxed_type_register_static (g_intern_static_string ("GConfValue"),
+                                         (GBoxedCopyFunc) gconf_value_copy,
+                                         (GBoxedFreeFunc) gconf_value_free);
+  return type;
+}
+
 GConfValue* 
 gconf_value_copy (const GConfValue* src)
 {
@@ -1439,6 +1451,18 @@ typedef struct {
 
 #define REAL_ENTRY(x) ((GConfRealEntry*)(x))
 
+GType
+gconf_entry_get_type ()
+{
+  static GType type = 0;
+
+  if (type == 0)
+    type = g_boxed_type_register_static (g_intern_static_string ("GConfEntry"),
+                                         (GBoxedCopyFunc) gconf_entry_ref,
+                                         (GBoxedFreeFunc) gconf_entry_unref);
+  return type;
+}
+
 GConfEntry*
 gconf_entry_new (const char *key,
                  const GConfValue  *val)
diff --git a/gconf/gconf-value.h b/gconf/gconf-value.h
index f8d2f22..1f57510 100644
--- a/gconf/gconf-value.h
+++ b/gconf/gconf-value.h
@@ -22,6 +22,7 @@
 #define GCONF_GCONF_VALUE_H
 
 #include <glib.h>
+#include <glib-object.h>
 #include "gconf-error.h"
 
 G_BEGIN_DECLS
@@ -76,6 +77,7 @@ GConfValue* gconf_value_new_from_string      (GConfValueType type,
                                               const gchar* str,
                                               GError** err);
 
+GType       gconf_value_get_type             (void) G_GNUC_CONST;
 GConfValue* gconf_value_copy                 (const GConfValue* src);
 void        gconf_value_free                 (GConfValue* value);
 
@@ -163,6 +165,7 @@ struct _GConfEntry {
   GConfValue *value;
 };
 
+GType       gconf_entry_get_type        (void) G_GNUC_CONST;
 const char* gconf_entry_get_key         (const GConfEntry *entry);
 GConfValue* gconf_entry_get_value       (const GConfEntry *entry);
 const char* gconf_entry_get_schema_name (const GConfEntry *entry);



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