libspnav_bindings/
bindings.rs

1/* automatically generated by rust-bindgen 0.59.1 */
2
3pub const SPNAV_EVENT_ANY: ::std::os::raw::c_uint = 0;
4pub const SPNAV_EVENT_MOTION: ::std::os::raw::c_uint = 1;
5pub const SPNAV_EVENT_BUTTON: ::std::os::raw::c_uint = 2;
6pub type _bindgen_ty_1 = ::std::os::raw::c_uint;
7#[repr(C)]
8#[derive(Debug, Copy, Clone)]
9pub struct spnav_event_motion {
10    pub type_: ::std::os::raw::c_int,
11    pub x: ::std::os::raw::c_int,
12    pub y: ::std::os::raw::c_int,
13    pub z: ::std::os::raw::c_int,
14    pub rx: ::std::os::raw::c_int,
15    pub ry: ::std::os::raw::c_int,
16    pub rz: ::std::os::raw::c_int,
17    pub period: ::std::os::raw::c_uint,
18    pub data: *mut ::std::os::raw::c_int,
19}
20#[test]
21fn bindgen_test_layout_spnav_event_motion() {
22    assert_eq!(
23        ::std::mem::size_of::<spnav_event_motion>(),
24        40usize,
25        concat!("Size of: ", stringify!(spnav_event_motion))
26    );
27    assert_eq!(
28        ::std::mem::align_of::<spnav_event_motion>(),
29        8usize,
30        concat!("Alignment of ", stringify!(spnav_event_motion))
31    );
32    assert_eq!(
33        unsafe { &(*(::std::ptr::null::<spnav_event_motion>())).type_ as *const _ as usize },
34        0usize,
35        concat!(
36            "Offset of field: ",
37            stringify!(spnav_event_motion),
38            "::",
39            stringify!(type_)
40        )
41    );
42    assert_eq!(
43        unsafe { &(*(::std::ptr::null::<spnav_event_motion>())).x as *const _ as usize },
44        4usize,
45        concat!(
46            "Offset of field: ",
47            stringify!(spnav_event_motion),
48            "::",
49            stringify!(x)
50        )
51    );
52    assert_eq!(
53        unsafe { &(*(::std::ptr::null::<spnav_event_motion>())).y as *const _ as usize },
54        8usize,
55        concat!(
56            "Offset of field: ",
57            stringify!(spnav_event_motion),
58            "::",
59            stringify!(y)
60        )
61    );
62    assert_eq!(
63        unsafe { &(*(::std::ptr::null::<spnav_event_motion>())).z as *const _ as usize },
64        12usize,
65        concat!(
66            "Offset of field: ",
67            stringify!(spnav_event_motion),
68            "::",
69            stringify!(z)
70        )
71    );
72    assert_eq!(
73        unsafe { &(*(::std::ptr::null::<spnav_event_motion>())).rx as *const _ as usize },
74        16usize,
75        concat!(
76            "Offset of field: ",
77            stringify!(spnav_event_motion),
78            "::",
79            stringify!(rx)
80        )
81    );
82    assert_eq!(
83        unsafe { &(*(::std::ptr::null::<spnav_event_motion>())).ry as *const _ as usize },
84        20usize,
85        concat!(
86            "Offset of field: ",
87            stringify!(spnav_event_motion),
88            "::",
89            stringify!(ry)
90        )
91    );
92    assert_eq!(
93        unsafe { &(*(::std::ptr::null::<spnav_event_motion>())).rz as *const _ as usize },
94        24usize,
95        concat!(
96            "Offset of field: ",
97            stringify!(spnav_event_motion),
98            "::",
99            stringify!(rz)
100        )
101    );
102    assert_eq!(
103        unsafe { &(*(::std::ptr::null::<spnav_event_motion>())).period as *const _ as usize },
104        28usize,
105        concat!(
106            "Offset of field: ",
107            stringify!(spnav_event_motion),
108            "::",
109            stringify!(period)
110        )
111    );
112    assert_eq!(
113        unsafe { &(*(::std::ptr::null::<spnav_event_motion>())).data as *const _ as usize },
114        32usize,
115        concat!(
116            "Offset of field: ",
117            stringify!(spnav_event_motion),
118            "::",
119            stringify!(data)
120        )
121    );
122}
123#[repr(C)]
124#[derive(Debug, Copy, Clone)]
125pub struct spnav_event_button {
126    pub type_: ::std::os::raw::c_int,
127    pub press: ::std::os::raw::c_int,
128    pub bnum: ::std::os::raw::c_int,
129}
130#[test]
131fn bindgen_test_layout_spnav_event_button() {
132    assert_eq!(
133        ::std::mem::size_of::<spnav_event_button>(),
134        12usize,
135        concat!("Size of: ", stringify!(spnav_event_button))
136    );
137    assert_eq!(
138        ::std::mem::align_of::<spnav_event_button>(),
139        4usize,
140        concat!("Alignment of ", stringify!(spnav_event_button))
141    );
142    assert_eq!(
143        unsafe { &(*(::std::ptr::null::<spnav_event_button>())).type_ as *const _ as usize },
144        0usize,
145        concat!(
146            "Offset of field: ",
147            stringify!(spnav_event_button),
148            "::",
149            stringify!(type_)
150        )
151    );
152    assert_eq!(
153        unsafe { &(*(::std::ptr::null::<spnav_event_button>())).press as *const _ as usize },
154        4usize,
155        concat!(
156            "Offset of field: ",
157            stringify!(spnav_event_button),
158            "::",
159            stringify!(press)
160        )
161    );
162    assert_eq!(
163        unsafe { &(*(::std::ptr::null::<spnav_event_button>())).bnum as *const _ as usize },
164        8usize,
165        concat!(
166            "Offset of field: ",
167            stringify!(spnav_event_button),
168            "::",
169            stringify!(bnum)
170        )
171    );
172}
173#[repr(C)]
174#[derive(Copy, Clone)]
175pub union spnav_event {
176    pub type_: ::std::os::raw::c_int,
177    pub motion: spnav_event_motion,
178    pub button: spnav_event_button,
179}
180#[test]
181fn bindgen_test_layout_spnav_event() {
182    assert_eq!(
183        ::std::mem::size_of::<spnav_event>(),
184        40usize,
185        concat!("Size of: ", stringify!(spnav_event))
186    );
187    assert_eq!(
188        ::std::mem::align_of::<spnav_event>(),
189        8usize,
190        concat!("Alignment of ", stringify!(spnav_event))
191    );
192    assert_eq!(
193        unsafe { &(*(::std::ptr::null::<spnav_event>())).type_ as *const _ as usize },
194        0usize,
195        concat!(
196            "Offset of field: ",
197            stringify!(spnav_event),
198            "::",
199            stringify!(type_)
200        )
201    );
202    assert_eq!(
203        unsafe { &(*(::std::ptr::null::<spnav_event>())).motion as *const _ as usize },
204        0usize,
205        concat!(
206            "Offset of field: ",
207            stringify!(spnav_event),
208            "::",
209            stringify!(motion)
210        )
211    );
212    assert_eq!(
213        unsafe { &(*(::std::ptr::null::<spnav_event>())).button as *const _ as usize },
214        0usize,
215        concat!(
216            "Offset of field: ",
217            stringify!(spnav_event),
218            "::",
219            stringify!(button)
220        )
221    );
222}
223extern "C" {
224    pub fn spnav_open() -> ::std::os::raw::c_int;
225}
226extern "C" {
227    pub fn spnav_close() -> ::std::os::raw::c_int;
228}
229extern "C" {
230    pub fn spnav_fd() -> ::std::os::raw::c_int;
231}
232extern "C" {
233    pub fn spnav_sensitivity(sens: f64) -> ::std::os::raw::c_int;
234}
235extern "C" {
236    pub fn spnav_wait_event(event: *mut spnav_event) -> ::std::os::raw::c_int;
237}
238extern "C" {
239    pub fn spnav_poll_event(event: *mut spnav_event) -> ::std::os::raw::c_int;
240}
241extern "C" {
242    pub fn spnav_remove_events(type_: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
243}
244extern "C" {
245    pub fn spnav_x11_open(
246        dpy: *mut ::std::os::raw::c_void,
247        win: ::std::os::raw::c_ulong,
248    ) -> ::std::os::raw::c_int;
249}
250extern "C" {
251    pub fn spnav_x11_window(win: ::std::os::raw::c_ulong) -> ::std::os::raw::c_int;
252}
253extern "C" {
254    pub fn spnav_x11_event(
255        xev: *const ::std::os::raw::c_void,
256        event: *mut ::std::os::raw::c_void,
257    ) -> ::std::os::raw::c_int;
258}