1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/gtk-rs/gir-files)
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
// DO NOT EDIT

use crate::{ffi, NavigationCommand};
use glib::{prelude::*, translate::*};

glib::wrapper! {
    #[doc(alias = "GstNavigation")]
    pub struct Navigation(Interface<ffi::GstNavigation, ffi::GstNavigationInterface>);

    match fn {
        type_ => || ffi::gst_navigation_get_type(),
    }
}

impl Navigation {
    pub const NONE: Option<&'static Navigation> = None;

    //#[doc(alias = "gst_navigation_query_set_commands")]
    //pub fn query_set_commands(query: &gst::Query, n_cmds: i32, : /*Unknown conversion*//*Unimplemented*/Basic: VarArgs) {
    //    unsafe { TODO: call ffi:gst_navigation_query_set_commands() }
    //}

    //#[doc(alias = "gst_navigation_query_set_commandsv")]
    //pub fn query_set_commandsv(query: &gst::Query, cmds: /*Unimplemented*/&CArray TypeId { ns_id: 1, id: 8 }) {
    //    unsafe { TODO: call ffi:gst_navigation_query_set_commandsv() }
    //}
}

unsafe impl Send for Navigation {}
unsafe impl Sync for Navigation {}

mod sealed {
    pub trait Sealed {}
    impl<T: super::IsA<super::Navigation>> Sealed for T {}
}

pub trait NavigationExt: IsA<Navigation> + sealed::Sealed + 'static {
    #[doc(alias = "gst_navigation_send_command")]
    fn send_command(&self, command: NavigationCommand) {
        unsafe {
            ffi::gst_navigation_send_command(self.as_ref().to_glib_none().0, command.into_glib());
        }
    }

    #[doc(alias = "gst_navigation_send_event")]
    fn send_event(&self, structure: gst::Structure) {
        unsafe {
            ffi::gst_navigation_send_event(
                self.as_ref().to_glib_none().0,
                structure.into_glib_ptr(),
            );
        }
    }

    #[cfg(feature = "v1_22")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
    #[doc(alias = "gst_navigation_send_event_simple")]
    fn send_event_simple(&self, event: gst::Event) {
        unsafe {
            ffi::gst_navigation_send_event_simple(
                self.as_ref().to_glib_none().0,
                event.into_glib_ptr(),
            );
        }
    }

    #[doc(alias = "gst_navigation_send_key_event")]
    fn send_key_event(&self, event: &str, key: &str) {
        unsafe {
            ffi::gst_navigation_send_key_event(
                self.as_ref().to_glib_none().0,
                event.to_glib_none().0,
                key.to_glib_none().0,
            );
        }
    }

    #[doc(alias = "gst_navigation_send_mouse_event")]
    fn send_mouse_event(&self, event: &str, button: i32, x: f64, y: f64) {
        unsafe {
            ffi::gst_navigation_send_mouse_event(
                self.as_ref().to_glib_none().0,
                event.to_glib_none().0,
                button,
                x,
                y,
            );
        }
    }

    #[cfg(feature = "v1_18")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
    #[doc(alias = "gst_navigation_send_mouse_scroll_event")]
    fn send_mouse_scroll_event(&self, x: f64, y: f64, delta_x: f64, delta_y: f64) {
        unsafe {
            ffi::gst_navigation_send_mouse_scroll_event(
                self.as_ref().to_glib_none().0,
                x,
                y,
                delta_x,
                delta_y,
            );
        }
    }
}

impl<O: IsA<Navigation>> NavigationExt for O {}