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