1 // This file was generated by gir (https://github.com/gtk-rs/gir) 2 // from gir-files (https://github.com/gtk-rs/gir-files) 3 // DO NOT EDIT 4 5 use crate::translate::*; 6 use crate::BindingFlags; 7 use std::fmt; 8 9 crate::wrapper! { 10 #[doc(alias = "GBinding")] 11 pub struct Binding(Object<gobject_ffi::GBinding>); 12 13 match fn { 14 type_ => || gobject_ffi::g_binding_get_type(), 15 } 16 } 17 18 impl Binding { 19 #[doc(alias = "g_binding_get_flags")] 20 #[doc(alias = "get_flags")] flags(&self) -> BindingFlags21 pub fn flags(&self) -> BindingFlags { 22 unsafe { from_glib(gobject_ffi::g_binding_get_flags(self.to_glib_none().0)) } 23 } 24 25 #[doc(alias = "g_binding_get_source_property")] 26 #[doc(alias = "get_source_property")] source_property(&self) -> crate::GString27 pub fn source_property(&self) -> crate::GString { 28 unsafe { 29 from_glib_none(gobject_ffi::g_binding_get_source_property( 30 self.to_glib_none().0, 31 )) 32 } 33 } 34 35 #[doc(alias = "g_binding_get_target_property")] 36 #[doc(alias = "get_target_property")] target_property(&self) -> crate::GString37 pub fn target_property(&self) -> crate::GString { 38 unsafe { 39 from_glib_none(gobject_ffi::g_binding_get_target_property( 40 self.to_glib_none().0, 41 )) 42 } 43 } 44 45 #[doc(alias = "g_binding_unbind")] unbind(&self)46 pub fn unbind(&self) { 47 unsafe { 48 gobject_ffi::g_binding_unbind(self.to_glib_none().0); 49 } 50 } 51 } 52 53 unsafe impl Send for Binding {} 54 unsafe impl Sync for Binding {} 55 56 impl fmt::Display for Binding { fmt(&self, f: &mut fmt::Formatter) -> fmt::Result57 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { 58 f.write_str("Binding") 59 } 60 } 61