[vala] gio-2.0: fix Settings.bind_with_mapping



commit 67200696ee5b4abcb388046270aa1d864f9ea367
Author: Evan Nemerson <evan coeus-group com>
Date:   Tue Jun 26 01:38:31 2012 -0700

    gio-2.0: fix Settings.bind_with_mapping
    
    This method is skipped in the GIR because of the shared user_data
    parameter.  Vala doesn't support this, either, so to get around it
    we have to set has_target = false on the delegates and pass the void*
    manually.  This also changes the names of the relevant delegates so
    there is no collision if/when the issue is resolved in GIO.

 vapi/gio-2.0.vapi                 |    6 +++++-
 vapi/metadata/Gio-2.0-custom.vala |    6 ++++++
 vapi/metadata/Gio-2.0.metadata    |    1 -
 3 files changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/vapi/gio-2.0.vapi b/vapi/gio-2.0.vapi
index 26345cd..15f477f 100644
--- a/vapi/gio-2.0.vapi
+++ b/vapi/gio-2.0.vapi
@@ -1607,7 +1607,7 @@ namespace GLib {
 		public Settings (string schema_id);
 		public void apply ();
 		public void bind (string key, GLib.Object object, string property, GLib.SettingsBindFlags flags);
-		public void bind_with_mapping (string key, GLib.Object object, string property, GLib.SettingsBindFlags flags, GLib.SettingsBindGetMapping get_mapping, owned GLib.SettingsBindSetMapping set_mapping);
+		public void bind_with_mapping (string key, GLib.Object object, string property, GLib.SettingsBindFlags flags, GLib.SettingsBindGetMappingShared get_mapping, GLib.SettingsBindSetMappingShared set_mapping, void* user_data, GLib.DestroyNotify? notify);
 		public void bind_writable (string key, GLib.Object object, string property, bool inverted);
 		public GLib.Action create_action (string key);
 		public void delay ();
@@ -3352,8 +3352,12 @@ namespace GLib {
 	public delegate void* ReallocFunc (void* data, size_t size);
 	[CCode (cheader_filename = "gio/gio.h", instance_pos = 2.9)]
 	public delegate bool SettingsBindGetMapping (GLib.Value value, GLib.Variant variant);
+	[CCode (cheader_filename = "gio/gio.h", cname = "GSettingsBindGetMapping", has_target = false)]
+	public delegate bool SettingsBindGetMappingShared (GLib.Value value, GLib.Variant variant, void* user_data);
 	[CCode (cheader_filename = "gio/gio.h", instance_pos = 2.9)]
 	public delegate GLib.Variant SettingsBindSetMapping (GLib.Value value, GLib.VariantType expected_type);
+	[CCode (cheader_filename = "gio/gio.h", cname = "GSettingsBindSetMapping", has_target = false)]
+	public delegate GLib.Variant SettingsBindSetMappingShared (GLib.Value value, GLib.VariantType expected_type, void* user_data);
 	[CCode (cheader_filename = "gio/gio.h", instance_pos = 2.9)]
 	public delegate bool SettingsGetMapping (GLib.Variant value, out void* result);
 	[CCode (cheader_filename = "gio/gio.h")]
diff --git a/vapi/metadata/Gio-2.0-custom.vala b/vapi/metadata/Gio-2.0-custom.vala
index 6384058..143ce68 100644
--- a/vapi/metadata/Gio-2.0-custom.vala
+++ b/vapi/metadata/Gio-2.0-custom.vala
@@ -116,6 +116,7 @@ namespace GLib {
 		[NoAccessorMethod]
 		public GLib.SettingsBackend backend { owned get; construct; }
 		public virtual signal bool change_event (GLib.Quark[]? keys);
+		public void bind_with_mapping (string key, GLib.Object object, string property, GLib.SettingsBindFlags flags, GLib.SettingsBindGetMappingShared get_mapping, GLib.SettingsBindSetMappingShared set_mapping, void* user_data, GLib.DestroyNotify? notify);
 	}
 
 	public class SettingsBackend : GLib.Object {
@@ -589,4 +590,9 @@ namespace GLib {
 	[Compact]
 	public class Resource {
 	}
+
+	[CCode (cheader_filename = "gio/gio.h", has_target = false, cname = "GSettingsBindGetMapping")]
+	public delegate bool SettingsBindGetMappingShared (GLib.Value value, GLib.Variant variant, void* user_data);
+	[CCode (cheader_filename = "gio/gio.h", has_target = false, cname = "GSettingsBindSetMapping")]
+	public delegate GLib.Variant SettingsBindSetMappingShared (GLib.Value value, GLib.VariantType expected_type, void* user_data);
 }
\ No newline at end of file
diff --git a/vapi/metadata/Gio-2.0.metadata b/vapi/metadata/Gio-2.0.metadata
index 8d9fddb..a5d591c 100644
--- a/vapi/metadata/Gio-2.0.metadata
+++ b/vapi/metadata/Gio-2.0.metadata
@@ -158,7 +158,6 @@ Resolver
   .lookup_service_finish skip
 Settings
   .change_event skip
-  .bind_with_mapping skip=false
   .get skip=false sentinel=""
   .set skip=false sentinel=""
 SimpleAction



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