Skip to main content

clutter/auto/
event_touch.rs

1use glib::translate::*;
2
3#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
4pub struct TouchEvent(crate::Event);
5
6event_wrapper!(TouchEvent, ClutterTouchEvent);
7event_subtype!(
8    TouchEvent,
9    ffi::CLUTTER_TOUCH_BEGIN
10        | ffi::CLUTTER_TOUCH_UPDATE
11        | ffi::CLUTTER_TOUCH_END
12        | ffi::CLUTTER_TOUCH_CANCEL
13);
14
15impl TouchEvent {
16    //     pub fn get_time(&self) -> u32 {
17    //         self.as_ref().time
18    //     }
19
20    //     pub fn get_position(&self) -> (f64, f64) {
21    //         let x = self.as_ref().x;
22    //         let y = self.as_ref().y;
23    //         (x, y)
24    //     }
25
26    //     pub fn get_state(&self) -> ::ModifierType {
27    //         from_glib(self.as_ref().state)
28    //     }
29
30    //     pub fn is_emulating_pointer(&self) -> bool {
31    //         from_glib(self.as_ref().emulating_pointer)
32    //     }
33
34    //     pub fn get_device(&self) -> Option<::Device> {
35    //         unsafe { from_glib_none(self.as_ref().device) }
36    //     }
37
38    //     pub fn get_axes(&self) -> Option<(f64, f64)> {
39    //         let axes = self.as_ref().axes;
40
41    //         if axes.is_null() {
42    //             None
43    //         } else {
44    //             unsafe { Some((*axes, *axes.offset(1))) }
45    //         }
46    //     }
47
48    //     pub fn get_root(&self) -> (f64, f64) {
49    //         let x_root = self.as_ref().x_root;
50    //         let y_root = self.as_ref().y_root;
51    //         (x_root, y_root)
52    //     }
53
54    //     pub fn get_event_sequence(&self) -> Option<::EventSequence> {
55    //         unsafe { from_glib_none(self.as_ref().sequence) }
56    //     }
57}