glib/gobject/auto/
binding.rs1use gobject_sys;
6use std::fmt;
7use translate::*;
8use BindingFlags;
9use GString;
10use Object;
11
12glib_wrapper! {
13 pub struct Binding(Object<gobject_sys::GBinding, BindingClass>);
14
15 match fn {
16 get_type => || gobject_sys::g_binding_get_type(),
17 }
18}
19
20impl Binding {
21 pub fn get_flags(&self) -> BindingFlags {
22 unsafe { from_glib(gobject_sys::g_binding_get_flags(self.to_glib_none().0)) }
23 }
24
25 pub fn get_source(&self) -> Option<Object> {
26 unsafe { from_glib_none(gobject_sys::g_binding_get_source(self.to_glib_none().0)) }
27 }
28
29 pub fn get_source_property(&self) -> Option<GString> {
30 unsafe {
31 from_glib_none(gobject_sys::g_binding_get_source_property(
32 self.to_glib_none().0,
33 ))
34 }
35 }
36
37 pub fn get_target(&self) -> Option<Object> {
38 unsafe { from_glib_none(gobject_sys::g_binding_get_target(self.to_glib_none().0)) }
39 }
40
41 pub fn get_target_property(&self) -> Option<GString> {
42 unsafe {
43 from_glib_none(gobject_sys::g_binding_get_target_property(
44 self.to_glib_none().0,
45 ))
46 }
47 }
48
49 pub fn unbind(&self) {
50 unsafe {
51 gobject_sys::g_binding_unbind(self.to_glib_full());
52 }
53 }
54}
55
56unsafe impl Send for Binding {}
57unsafe impl Sync for Binding {}
58
59impl fmt::Display for Binding {
60 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
61 write!(f, "Binding")
62 }
63}