// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git) // DO NOT EDIT use glib::object::Cast; use glib::object::IsA; use glib::signal::connect_raw; use glib::signal::SignalHandlerId; use glib::translate::*; use glib::StaticType; use std::boxed::Box as Box_; use std::mem::transmute; glib::wrapper! { pub struct ARGBControlBinding(Object) @extends gst::ControlBinding, gst::Object; match fn { type_ => || ffi::gst_argb_control_binding_get_type(), } } impl ARGBControlBinding { #[doc(alias = "gst_argb_control_binding_new")] pub fn new< P: IsA, Q: IsA, R: IsA, S: IsA, T: IsA, >( object: &P, property_name: &str, cs_a: &Q, cs_r: &R, cs_g: &S, cs_b: &T, ) -> ARGBControlBinding { assert_initialized_main_thread!(); unsafe { gst::ControlBinding::from_glib_none(ffi::gst_argb_control_binding_new( object.as_ref().to_glib_none().0, property_name.to_glib_none().0, cs_a.as_ref().to_glib_none().0, cs_r.as_ref().to_glib_none().0, cs_g.as_ref().to_glib_none().0, cs_b.as_ref().to_glib_none().0, )) .unsafe_cast() } } } unsafe impl Send for ARGBControlBinding {} unsafe impl Sync for ARGBControlBinding {} pub const NONE_ARGB_CONTROL_BINDING: Option<&ARGBControlBinding> = None; pub trait ARGBControlBindingExt: 'static { #[doc(alias = "get_property_control_source_a")] fn control_source_a(&self) -> Option; #[doc(alias = "set_property_control_source_a")] fn set_control_source_a>(&self, control_source_a: Option<&P>); #[doc(alias = "get_property_control_source_b")] fn control_source_b(&self) -> Option; #[doc(alias = "set_property_control_source_b")] fn set_control_source_b>(&self, control_source_b: Option<&P>); #[doc(alias = "get_property_control_source_g")] fn control_source_g(&self) -> Option; #[doc(alias = "set_property_control_source_g")] fn set_control_source_g>(&self, control_source_g: Option<&P>); #[doc(alias = "get_property_control_source_r")] fn control_source_r(&self) -> Option; #[doc(alias = "set_property_control_source_r")] fn set_control_source_r>(&self, control_source_r: Option<&P>); fn connect_property_control_source_a_notify( &self, f: F, ) -> SignalHandlerId; fn connect_property_control_source_b_notify( &self, f: F, ) -> SignalHandlerId; fn connect_property_control_source_g_notify( &self, f: F, ) -> SignalHandlerId; fn connect_property_control_source_r_notify( &self, f: F, ) -> SignalHandlerId; } impl> ARGBControlBindingExt for O { fn control_source_a(&self) -> Option { unsafe { let mut value = glib::Value::from_type(::static_type()); glib::gobject_ffi::g_object_get_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"control-source-a\0".as_ptr() as *const _, value.to_glib_none_mut().0, ); value .get() .expect("Return Value for property `control-source-a` getter") } } fn set_control_source_a>(&self, control_source_a: Option<&P>) { unsafe { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"control-source-a\0".as_ptr() as *const _, glib::Value::from(control_source_a).to_glib_none().0, ); } } fn control_source_b(&self) -> Option { unsafe { let mut value = glib::Value::from_type(::static_type()); glib::gobject_ffi::g_object_get_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"control-source-b\0".as_ptr() as *const _, value.to_glib_none_mut().0, ); value .get() .expect("Return Value for property `control-source-b` getter") } } fn set_control_source_b>(&self, control_source_b: Option<&P>) { unsafe { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"control-source-b\0".as_ptr() as *const _, glib::Value::from(control_source_b).to_glib_none().0, ); } } fn control_source_g(&self) -> Option { unsafe { let mut value = glib::Value::from_type(::static_type()); glib::gobject_ffi::g_object_get_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"control-source-g\0".as_ptr() as *const _, value.to_glib_none_mut().0, ); value .get() .expect("Return Value for property `control-source-g` getter") } } fn set_control_source_g>(&self, control_source_g: Option<&P>) { unsafe { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"control-source-g\0".as_ptr() as *const _, glib::Value::from(control_source_g).to_glib_none().0, ); } } fn control_source_r(&self) -> Option { unsafe { let mut value = glib::Value::from_type(::static_type()); glib::gobject_ffi::g_object_get_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"control-source-r\0".as_ptr() as *const _, value.to_glib_none_mut().0, ); value .get() .expect("Return Value for property `control-source-r` getter") } } fn set_control_source_r>(&self, control_source_r: Option<&P>) { unsafe { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"control-source-r\0".as_ptr() as *const _, glib::Value::from(control_source_r).to_glib_none().0, ); } } fn connect_property_control_source_a_notify( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_control_source_a_trampoline< P, F: Fn(&P) + Send + Sync + 'static, >( this: *mut ffi::GstARGBControlBinding, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) where P: IsA, { let f: &F = &*(f as *const F); f(&ARGBControlBinding::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::control-source-a\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_control_source_a_trampoline:: as *const (), )), Box_::into_raw(f), ) } } fn connect_property_control_source_b_notify( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_control_source_b_trampoline< P, F: Fn(&P) + Send + Sync + 'static, >( this: *mut ffi::GstARGBControlBinding, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) where P: IsA, { let f: &F = &*(f as *const F); f(&ARGBControlBinding::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::control-source-b\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_control_source_b_trampoline:: as *const (), )), Box_::into_raw(f), ) } } fn connect_property_control_source_g_notify( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_control_source_g_trampoline< P, F: Fn(&P) + Send + Sync + 'static, >( this: *mut ffi::GstARGBControlBinding, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) where P: IsA, { let f: &F = &*(f as *const F); f(&ARGBControlBinding::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::control-source-g\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_control_source_g_trampoline:: as *const (), )), Box_::into_raw(f), ) } } fn connect_property_control_source_r_notify( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_control_source_r_trampoline< P, F: Fn(&P) + Send + Sync + 'static, >( this: *mut ffi::GstARGBControlBinding, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) where P: IsA, { let f: &F = &*(f as *const F); f(&ARGBControlBinding::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::control-source-r\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_control_source_r_trampoline:: as *const (), )), Box_::into_raw(f), ) } } }