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