// 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 crate::Container; use crate::Extractable; use crate::TimelineElement; use glib::object::Cast; use glib::object::IsA; use glib::signal::connect_raw; use glib::signal::SignalHandlerId; use glib::translate::*; use glib::StaticType; use glib::ToValue; use std::boxed::Box as Box_; use std::mem::transmute; glib::wrapper! { #[doc(alias = "GESGroup")] pub struct Group(Object) @extends Container, TimelineElement, @implements Extractable; match fn { type_ => || ffi::ges_group_get_type(), } } impl Group { #[doc(alias = "ges_group_new")] pub fn new() -> Group { assert_initialized_main_thread!(); unsafe { from_glib_none(ffi::ges_group_new()) } } } impl Default for Group { fn default() -> Self { Self::new() } } pub const NONE_GROUP: Option<&Group> = None; pub trait GroupExt: 'static { fn duration(&self) -> u64; fn set_duration(&self, duration: u64); #[doc(alias = "in-point")] fn in_point(&self) -> u64; #[doc(alias = "in-point")] fn set_in_point(&self, in_point: u64); #[doc(alias = "max-duration")] fn max_duration(&self) -> u64; #[doc(alias = "max-duration")] fn set_max_duration(&self, max_duration: u64); fn priority(&self) -> u32; fn set_priority(&self, priority: u32); fn start(&self) -> u64; fn set_start(&self, start: u64); #[doc(alias = "duration")] fn connect_duration_notify(&self, f: F) -> SignalHandlerId; #[doc(alias = "in-point")] fn connect_in_point_notify(&self, f: F) -> SignalHandlerId; #[doc(alias = "max-duration")] fn connect_max_duration_notify(&self, f: F) -> SignalHandlerId; #[doc(alias = "priority")] fn connect_priority_notify(&self, f: F) -> SignalHandlerId; #[doc(alias = "start")] fn connect_start_notify(&self, f: F) -> SignalHandlerId; } impl> GroupExt for O { fn duration(&self) -> u64 { 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"duration\0".as_ptr() as *const _, value.to_glib_none_mut().0, ); value .get() .expect("Return Value for property `duration` getter") } } fn set_duration(&self, duration: u64) { unsafe { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"duration\0".as_ptr() as *const _, duration.to_value().to_glib_none().0, ); } } fn in_point(&self) -> u64 { 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"in-point\0".as_ptr() as *const _, value.to_glib_none_mut().0, ); value .get() .expect("Return Value for property `in-point` getter") } } fn set_in_point(&self, in_point: u64) { unsafe { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"in-point\0".as_ptr() as *const _, in_point.to_value().to_glib_none().0, ); } } fn max_duration(&self) -> u64 { 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"max-duration\0".as_ptr() as *const _, value.to_glib_none_mut().0, ); value .get() .expect("Return Value for property `max-duration` getter") } } fn set_max_duration(&self, max_duration: u64) { unsafe { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"max-duration\0".as_ptr() as *const _, max_duration.to_value().to_glib_none().0, ); } } fn priority(&self) -> u32 { 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"priority\0".as_ptr() as *const _, value.to_glib_none_mut().0, ); value .get() .expect("Return Value for property `priority` getter") } } fn set_priority(&self, priority: u32) { unsafe { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"priority\0".as_ptr() as *const _, priority.to_value().to_glib_none().0, ); } } fn start(&self) -> u64 { 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"start\0".as_ptr() as *const _, value.to_glib_none_mut().0, ); value .get() .expect("Return Value for property `start` getter") } } fn set_start(&self, start: u64) { unsafe { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"start\0".as_ptr() as *const _, start.to_value().to_glib_none().0, ); } } fn connect_duration_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_duration_trampoline, F: Fn(&P) + 'static>( this: *mut ffi::GESGroup, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&Group::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::duration\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_duration_trampoline:: as *const (), )), Box_::into_raw(f), ) } } fn connect_in_point_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_in_point_trampoline, F: Fn(&P) + 'static>( this: *mut ffi::GESGroup, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&Group::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::in-point\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_in_point_trampoline:: as *const (), )), Box_::into_raw(f), ) } } fn connect_max_duration_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_max_duration_trampoline, F: Fn(&P) + 'static>( this: *mut ffi::GESGroup, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&Group::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::max-duration\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_max_duration_trampoline:: as *const (), )), Box_::into_raw(f), ) } } fn connect_priority_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_priority_trampoline, F: Fn(&P) + 'static>( this: *mut ffi::GESGroup, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&Group::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::priority\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_priority_trampoline:: as *const (), )), Box_::into_raw(f), ) } } fn connect_start_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_start_trampoline, F: Fn(&P) + 'static>( this: *mut ffi::GESGroup, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&Group::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::start\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_start_trampoline:: as *const (), )), Box_::into_raw(f), ) } } }