gstreamer_editing_services/auto/
marker.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, MetaContainer};
7use glib::{
8    prelude::*,
9    signal::{connect_raw, SignalHandlerId},
10    translate::*,
11};
12use std::boxed::Box as Box_;
13
14glib::wrapper! {
15    #[doc(alias = "GESMarker")]
16    pub struct Marker(Object<ffi::GESMarker, ffi::GESMarkerClass>) @implements MetaContainer;
17
18    match fn {
19        type_ => || ffi::ges_marker_get_type(),
20    }
21}
22
23impl Marker {
24    #[cfg(feature = "v1_18")]
25    #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
26    pub fn position(&self) -> u64 {
27        ObjectExt::property(self, "position")
28    }
29
30    #[cfg(feature = "v1_18")]
31    #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
32    #[doc(alias = "position")]
33    pub fn connect_position_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
34        unsafe extern "C" fn notify_position_trampoline<F: Fn(&Marker) + 'static>(
35            this: *mut ffi::GESMarker,
36            _param_spec: glib::ffi::gpointer,
37            f: glib::ffi::gpointer,
38        ) {
39            let f: &F = &*(f as *const F);
40            f(&from_glib_borrow(this))
41        }
42        unsafe {
43            let f: Box_<F> = Box_::new(f);
44            connect_raw(
45                self.as_ptr() as *mut _,
46                c"notify::position".as_ptr() as *const _,
47                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
48                    notify_position_trampoline::<F> as *const (),
49                )),
50                Box_::into_raw(f),
51            )
52        }
53    }
54}