[vala/0.10] gobject-2.0: Add GBinding bindings



commit 2ec8dac1852b430856c3af3c4ceff04131075b57
Author: Evan Nemerson <evan coeus-group com>
Date:   Sun Oct 3 17:32:37 2010 -0700

    gobject-2.0: Add GBinding bindings
    
    Based on patch by Gregor Burger, fixes bug 629791.

 vapi/gobject-2.0.vapi |   24 +++++++++++++++++++++++-
 1 files changed, 23 insertions(+), 1 deletions(-)
---
diff --git a/vapi/gobject-2.0.vapi b/vapi/gobject-2.0.vapi
index 873e2d5..a44bbec 100644
--- a/vapi/gobject-2.0.vapi
+++ b/vapi/gobject-2.0.vapi
@@ -287,6 +287,25 @@ namespace GLib {
 	public struct ObjectConstructParam {
 	}
 
+	[Flags]
+	[CCode (cprefix = "G_BINDING_")]
+	public enum BindingFlags {
+		DEFAULT,
+		BIDIRECTIONAL,
+		SYNC_CREATE,
+		INVERT_BOOLEAN
+	}
+
+	public delegate bool BindingTransformFunc (GLib.Binding binding, GLib.Value source_value, GLib.Value target_value);
+
+	public class Binding : GLib.Object {
+		public weak GLib.Object source { get; }
+		public string source_property { get; }
+		public weak GLib.Object target { get; }
+		public string target_property { get; }
+		public GLib.BindingFlags flags { get; }
+	}
+
 	[CCode (has_target = false)]
 	public delegate void ObjectGetPropertyFunc (Object object, uint property_id, Value value, ParamSpec pspec);
 	[CCode (has_target = false)]
@@ -349,6 +368,9 @@ namespace GLib {
 
 		public void add_toggle_ref (ToggleNotify notify);
 		public void remove_toggle_ref (ToggleNotify notify);
+
+		[CCode (cname = "g_object_bind_property_with_closures")]
+		public unowned GLib.Binding bind_property (string source_property, GLib.Object target, string target_property, GLib.BindingFlags flags, [CCode (type = "GClosure*")] owned GLib.BindingTransformFunc? transform_to = null, [CCode (type = "GClosure*")] owned GLib.BindingTransformFunc? transform_from = null);
 	}
 
 	[CCode (instance_pos = 0)]
@@ -481,7 +503,7 @@ namespace GLib {
 		public void take_param(out ParamSpec param);
 		public void param_take_ownership(out ParamSpec param);
 	}
-	
+
 	public struct SignalInvocationHint {
 		public uint signal_id;
 		public Quark detail;



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