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