[gom] gom: Fix introspection of gom_resource_class_set_property_transform()



commit aa9a38cb80c1c4e6827f841925d0ba20146de18b
Author: Bastien Nocera <hadess hadess net>
Date:   Fri Apr 25 16:14:51 2014 +0200

    gom: Fix introspection of gom_resource_class_set_property_transform()
    
    By skipping this function for introspection, and adding two new
    functions for the bindings to use.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=728504

 gom/gom-resource.c |   39 +++++++++++++++++++++++++++++++++++++++
 gom/gom-resource.h |    8 ++++++++
 2 files changed, 47 insertions(+), 0 deletions(-)
---
diff --git a/gom/gom-resource.c b/gom/gom-resource.c
index b4bcacb..2b3743b 100644
--- a/gom/gom-resource.c
+++ b/gom/gom-resource.c
@@ -90,6 +90,9 @@ gom_resource_class_set_property_set_mapped (GomResourceClass *resource_class,
    g_param_spec_set_qdata(pspec, GOM_RESOURCE_NOT_MAPPED, GINT_TO_POINTER(!is_mapped));
 }
 
+/**
+ * gom_resource_class_set_property_transform: (skip)
+ */
 void
 gom_resource_class_set_property_transform (GomResourceClass         *resource_class,
                                            const gchar              *property_name,
@@ -111,6 +114,42 @@ gom_resource_class_set_property_transform (GomResourceClass         *resource_cl
 }
 
 void
+gom_resource_class_set_property_to_bytes (GomResourceClass         *resource_class,
+                                          const gchar              *property_name,
+                                          GomResourceToBytesFunc    to_bytes_func,
+                                          GDestroyNotify            notify)
+{
+   GParamSpec *pspec;
+
+   g_return_if_fail(GOM_IS_RESOURCE_CLASS(resource_class));
+   g_return_if_fail(property_name != NULL);
+   g_return_if_fail(to_bytes_func != NULL);
+
+   pspec = g_object_class_find_property(G_OBJECT_CLASS(resource_class), property_name);
+   g_assert(pspec);
+
+   g_param_spec_set_qdata(pspec, GOM_RESOURCE_TO_BYTES_FUNC, to_bytes_func);
+}
+
+void
+gom_resource_class_set_property_from_bytes (GomResourceClass         *resource_class,
+                                            const gchar              *property_name,
+                                            GomResourceFromBytesFunc  from_bytes_func,
+                                            GDestroyNotify            notify)
+{
+   GParamSpec *pspec;
+
+   g_return_if_fail(GOM_IS_RESOURCE_CLASS(resource_class));
+   g_return_if_fail(property_name != NULL);
+   g_return_if_fail(from_bytes_func != NULL);
+
+   pspec = g_object_class_find_property(G_OBJECT_CLASS(resource_class), property_name);
+   g_assert(pspec);
+
+   g_param_spec_set_qdata(pspec, GOM_RESOURCE_FROM_BYTES_FUNC, from_bytes_func);
+}
+
+void
 gom_resource_class_set_reference (GomResourceClass     *resource_class,
                                   const gchar          *property_name,
                                   const gchar          *ref_table_name,
diff --git a/gom/gom-resource.h b/gom/gom-resource.h
index 2abcd7e..2e4228a 100644
--- a/gom/gom-resource.h
+++ b/gom/gom-resource.h
@@ -78,6 +78,14 @@ void              gom_resource_class_set_property_transform      (GomResourceCla
                                                                   const gchar              *property_name,
                                                                   GomResourceToBytesFunc    to_bytes_func,
                                                                   GomResourceFromBytesFunc  from_bytes_func);
+void              gom_resource_class_set_property_to_bytes       (GomResourceClass         *resource_class,
+                                                                  const gchar              *property_name,
+                                                                  GomResourceToBytesFunc    to_bytes_func,
+                                                                  GDestroyNotify            notify);
+void              gom_resource_class_set_property_from_bytes     (GomResourceClass         *resource_class,
+                                                                  const gchar              *property_name,
+                                                                  GomResourceFromBytesFunc  from_bytes_func,
+                                                                  GDestroyNotify            notify);
 void              gom_resource_class_set_reference               (GomResourceClass         *resource_class,
                                                                   const gchar              *property_name,
                                                                   const gchar              *ref_table_name,


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