gstreamer_video/auto/
color_balance_channel.rs

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// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
4// DO NOT EDIT
5
6use crate::ffi;
7use glib::{
8    object::ObjectType as _,
9    prelude::*,
10    signal::{connect_raw, SignalHandlerId},
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            let f: &F = &*(f as *const F);
46            f(
47                ColorBalanceChannel::from_glib_borrow(this).unsafe_cast_ref(),
48                value,
49            )
50        }
51        unsafe {
52            let f: Box_<F> = Box_::new(f);
53            connect_raw(
54                self.as_ptr() as *mut _,
55                c"value-changed".as_ptr() as *const _,
56                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
57                    value_changed_trampoline::<Self, F> as *const (),
58                )),
59                Box_::into_raw(f),
60            )
61        }
62    }
63}
64
65impl<O: IsA<ColorBalanceChannel>> ColorBalanceChannelExt for O {}