gstreamer_video/auto/
navigation.rs1use 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 }
31
32unsafe impl Send for Navigation {}
33unsafe impl Sync for Navigation {}
34
35pub trait NavigationExt: IsA<Navigation> + 'static {
36 #[doc(alias = "gst_navigation_send_command")]
37 fn send_command(&self, command: NavigationCommand) {
38 unsafe {
39 ffi::gst_navigation_send_command(self.as_ref().to_glib_none().0, command.into_glib());
40 }
41 }
42
43 #[doc(alias = "gst_navigation_send_event")]
44 fn send_event(&self, structure: gst::Structure) {
45 unsafe {
46 ffi::gst_navigation_send_event(
47 self.as_ref().to_glib_none().0,
48 structure.into_glib_ptr(),
49 );
50 }
51 }
52
53 #[cfg(feature = "v1_22")]
54 #[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
55 #[doc(alias = "gst_navigation_send_event_simple")]
56 fn send_event_simple(&self, event: gst::Event) {
57 unsafe {
58 ffi::gst_navigation_send_event_simple(
59 self.as_ref().to_glib_none().0,
60 event.into_glib_ptr(),
61 );
62 }
63 }
64
65 #[doc(alias = "gst_navigation_send_key_event")]
66 fn send_key_event(&self, event: &str, key: &str) {
67 unsafe {
68 ffi::gst_navigation_send_key_event(
69 self.as_ref().to_glib_none().0,
70 event.to_glib_none().0,
71 key.to_glib_none().0,
72 );
73 }
74 }
75
76 #[doc(alias = "gst_navigation_send_mouse_event")]
77 fn send_mouse_event(&self, event: &str, button: i32, x: f64, y: f64) {
78 unsafe {
79 ffi::gst_navigation_send_mouse_event(
80 self.as_ref().to_glib_none().0,
81 event.to_glib_none().0,
82 button,
83 x,
84 y,
85 );
86 }
87 }
88
89 #[cfg(feature = "v1_18")]
90 #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
91 #[doc(alias = "gst_navigation_send_mouse_scroll_event")]
92 fn send_mouse_scroll_event(&self, x: f64, y: f64, delta_x: f64, delta_y: f64) {
93 unsafe {
94 ffi::gst_navigation_send_mouse_scroll_event(
95 self.as_ref().to_glib_none().0,
96 x,
97 y,
98 delta_x,
99 delta_y,
100 );
101 }
102 }
103}
104
105impl<O: IsA<Navigation>> NavigationExt for O {}