gstreamer_video/auto/
color_balance_channel.rs1use crate::ffi;
7use glib::{
8 object::ObjectType as _,
9 prelude::*,
10 signal::{SignalHandlerId, connect_raw},
11 translate::*,
12};
13use std::boxed::Box as Box_;
14
15glib::wrapper! {
16 #[doc(alias = "GstColorBalanceChannel")]
17 pub struct ColorBalanceChannel(Object<ffi::GstColorBalanceChannel, ffi::GstColorBalanceChannelClass>);
18
19 match fn {
20 type_ => || ffi::gst_color_balance_channel_get_type(),
21 }
22}
23
24impl ColorBalanceChannel {
25 pub const NONE: Option<&'static ColorBalanceChannel> = None;
26}
27
28unsafe impl Send for ColorBalanceChannel {}
29unsafe impl Sync for ColorBalanceChannel {}
30
31pub trait ColorBalanceChannelExt: IsA<ColorBalanceChannel> + 'static {
32 #[doc(alias = "value-changed")]
33 fn connect_value_changed<F: Fn(&Self, i32) + Send + Sync + 'static>(
34 &self,
35 f: F,
36 ) -> SignalHandlerId {
37 unsafe extern "C" fn value_changed_trampoline<
38 P: IsA<ColorBalanceChannel>,
39 F: Fn(&P, i32) + Send + Sync + 'static,
40 >(
41 this: *mut ffi::GstColorBalanceChannel,
42 value: std::ffi::c_int,
43 f: glib::ffi::gpointer,
44 ) {
45 unsafe {
46 let f: &F = &*(f as *const F);
47 f(
48 ColorBalanceChannel::from_glib_borrow(this).unsafe_cast_ref(),
49 value,
50 )
51 }
52 }
53 unsafe {
54 let f: Box_<F> = Box_::new(f);
55 connect_raw(
56 self.as_ptr() as *mut _,
57 c"value-changed".as_ptr(),
58 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
59 value_changed_trampoline::<Self, F> as *const (),
60 )),
61 Box_::into_raw(f),
62 )
63 }
64 }
65}
66
67impl<O: IsA<ColorBalanceChannel>> ColorBalanceChannelExt for O {}