[vala] gobject-2.0: Add GBinding bindings
- From: Evan Nemerson <evann src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala] gobject-2.0: Add GBinding bindings
- Date: Mon, 4 Oct 2010 00:36:35 +0000 (UTC)
commit 5086c67266c431ca30a3ff7f73799873726d122d
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 d9cd08b..08ddc5c 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)]
@@ -476,7 +498,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]