1 /* 2 * Distributed under the Boost Software License, Version 1.0. 3 * (See accompanying file LICENSE_1_0.txt or copy at 4 * http://www.boost.org/LICENSE_1_0.txt) 5 */ 6 module gobject.gbinding; 7 8 import gobject.gobject; 9 import gobject.gvalue; 10 import gobject.gtype; 11 import gobject.gclosure; 12 13 import glib; 14 15 // #define G_TYPE_BINDING_FLAGS (g_binding_flags_get_type ()) 16 // 17 // #define G_TYPE_BINDING (g_binding_get_type ()) 18 // #define G_BINDING(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G_TYPE_BINDING, GBinding)) 19 // #define G_IS_BINDING(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G_TYPE_BINDING)) 20 21 extern(C): 22 23 struct GBinding; 24 25 alias GBindingTransformFunc = gboolean function (GBinding *binding, 26 const(GValue) *from_value, 27 GValue *to_value, 28 gpointer user_data); 29 30 enum GBindingFlags { /*< prefix=G_BINDING >*/ 31 G_BINDING_DEFAULT = 0, 32 33 G_BINDING_BIDIRECTIONAL = 1 << 0, 34 G_BINDING_SYNC_CREATE = 1 << 1, 35 G_BINDING_INVERT_BOOLEAN = 1 << 2 36 } 37 38 39 pure GType g_binding_flags_get_type (); 40 41 pure GType g_binding_get_type (); 42 43 44 GBindingFlags g_binding_get_flags (GBinding *binding); 45 46 GObject * g_binding_get_source (GBinding *binding); 47 48 GObject * g_binding_get_target (GBinding *binding); 49 50 const(gchar) * g_binding_get_source_property (GBinding *binding); 51 52 const(gchar) * g_binding_get_target_property (GBinding *binding); 53 54 void g_binding_unbind (GBinding *binding); 55 56 57 GBinding *g_object_bind_property (gpointer source, 58 const(gchar) *source_property, 59 gpointer target, 60 const(gchar) *target_property, 61 GBindingFlags flags); 62 63 GBinding *g_object_bind_property_full (gpointer source, 64 const(gchar) *source_property, 65 gpointer target, 66 const(gchar) *target_property, 67 GBindingFlags flags, 68 GBindingTransformFunc transform_to, 69 GBindingTransformFunc transform_from, 70 gpointer user_data, 71 GDestroyNotify notify); 72 73 GBinding *g_object_bind_property_with_closures (gpointer source, 74 const(gchar) *source_property, 75 gpointer target, 76 const(gchar) *target_property, 77 GBindingFlags flags, 78 GClosure *transform_to, 79 GClosure *transform_from); 80