gstreamer_video/auto/
navigation.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, NavigationCommand};
7use glib::{prelude::*, translate::*};
8
9glib::wrapper! {
10    #[doc(alias = "GstNavigation")]
11    pub struct Navigation(Interface<ffi::GstNavigation, ffi::GstNavigationInterface>);
12
13    match fn {
14        type_ => || ffi::gst_navigation_get_type(),
15    }
16}
17
18impl Navigation {
19    pub const NONE: Option<&'static Navigation> = None;
20
21    //#[doc(alias = "gst_navigation_query_set_commands")]
22    //pub fn query_set_commands(query: &gst::Query, n_cmds: i32, : /*Unknown conversion*//*Unimplemented*/Basic: VarArgs) {
23    //    unsafe { TODO: call ffi:gst_navigation_query_set_commands() }
24    //}
25
26    //#[doc(alias = "gst_navigation_query_set_commandsv")]
27    //pub fn query_set_commandsv(query: &gst::Query, cmds: /*Unimplemented*/&CArray TypeId { ns_id: 1, id: 8 }) {
28    //    unsafe { TODO: call ffi:gst_navigation_query_set_commandsv() }
29    //}
30}
31
32unsafe impl Send for Navigation {}
33unsafe impl Sync for Navigation {}
34
35mod sealed {
36    pub trait Sealed {}
37    impl<T: super::IsA<super::Navigation>> Sealed for T {}
38}
39
40pub trait NavigationExt: IsA<Navigation> + sealed::Sealed + 'static {
41    #[doc(alias = "gst_navigation_send_command")]
42    fn send_command(&self, command: NavigationCommand) {
43        unsafe {
44            ffi::gst_navigation_send_command(self.as_ref().to_glib_none().0, command.into_glib());
45        }
46    }
47
48    #[doc(alias = "gst_navigation_send_event")]
49    fn send_event(&self, structure: gst::Structure) {
50        unsafe {
51            ffi::gst_navigation_send_event(
52                self.as_ref().to_glib_none().0,
53                structure.into_glib_ptr(),
54            );
55        }
56    }
57
58    #[cfg(feature = "v1_22")]
59    #[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
60    #[doc(alias = "gst_navigation_send_event_simple")]
61    fn send_event_simple(&self, event: gst::Event) {
62        unsafe {
63            ffi::gst_navigation_send_event_simple(
64                self.as_ref().to_glib_none().0,
65                event.into_glib_ptr(),
66            );
67        }
68    }
69
70    #[doc(alias = "gst_navigation_send_key_event")]
71    fn send_key_event(&self, event: &str, key: &str) {
72        unsafe {
73            ffi::gst_navigation_send_key_event(
74                self.as_ref().to_glib_none().0,
75                event.to_glib_none().0,
76                key.to_glib_none().0,
77            );
78        }
79    }
80
81    #[doc(alias = "gst_navigation_send_mouse_event")]
82    fn send_mouse_event(&self, event: &str, button: i32, x: f64, y: f64) {
83        unsafe {
84            ffi::gst_navigation_send_mouse_event(
85                self.as_ref().to_glib_none().0,
86                event.to_glib_none().0,
87                button,
88                x,
89                y,
90            );
91        }
92    }
93
94    #[cfg(feature = "v1_18")]
95    #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
96    #[doc(alias = "gst_navigation_send_mouse_scroll_event")]
97    fn send_mouse_scroll_event(&self, x: f64, y: f64, delta_x: f64, delta_y: f64) {
98        unsafe {
99            ffi::gst_navigation_send_mouse_scroll_event(
100                self.as_ref().to_glib_none().0,
101                x,
102                y,
103                delta_x,
104                delta_y,
105            );
106        }
107    }
108}
109
110impl<O: IsA<Navigation>> NavigationExt for O {}