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
// This file was generated by gir (4b09025) from gir-files (71d73f0)
// DO NOT EDIT

use EventController;
use Gesture;
use ffi;
use glib::object::IsA;
use glib::translate::*;
use gobject_ffi;

glib_wrapper! {
    pub struct GestureSingle(Object<ffi::GtkGestureSingle>): Gesture, EventController;

    match fn {
        get_type => || ffi::gtk_gesture_single_get_type(),
    }
}

pub trait GestureSingleExt {
    #[cfg(feature = "v3_14")]
    fn get_button(&self) -> u32;

    #[cfg(feature = "v3_14")]
    fn get_current_button(&self) -> u32;

    //#[cfg(feature = "v3_14")]
    //fn get_current_sequence(&self) -> /*Ignored*/Option<gdk::EventSequence>;

    #[cfg(feature = "v3_14")]
    fn get_exclusive(&self) -> bool;

    #[cfg(feature = "v3_14")]
    fn get_touch_only(&self) -> bool;

    #[cfg(feature = "v3_14")]
    fn set_button(&self, button: u32);

    #[cfg(feature = "v3_14")]
    fn set_exclusive(&self, exclusive: bool);

    #[cfg(feature = "v3_14")]
    fn set_touch_only(&self, touch_only: bool);
}

impl<O: IsA<GestureSingle>> GestureSingleExt for O {
    #[cfg(feature = "v3_14")]
    fn get_button(&self) -> u32 {
        unsafe {
            ffi::gtk_gesture_single_get_button(self.to_glib_none().0)
        }
    }

    #[cfg(feature = "v3_14")]
    fn get_current_button(&self) -> u32 {
        unsafe {
            ffi::gtk_gesture_single_get_current_button(self.to_glib_none().0)
        }
    }

    //#[cfg(feature = "v3_14")]
    //fn get_current_sequence(&self) -> /*Ignored*/Option<gdk::EventSequence> {
    //    unsafe { TODO: call ffi::gtk_gesture_single_get_current_sequence() }
    //}

    #[cfg(feature = "v3_14")]
    fn get_exclusive(&self) -> bool {
        unsafe {
            from_glib(ffi::gtk_gesture_single_get_exclusive(self.to_glib_none().0))
        }
    }

    #[cfg(feature = "v3_14")]
    fn get_touch_only(&self) -> bool {
        unsafe {
            from_glib(ffi::gtk_gesture_single_get_touch_only(self.to_glib_none().0))
        }
    }

    #[cfg(feature = "v3_14")]
    fn set_button(&self, button: u32) {
        unsafe {
            ffi::gtk_gesture_single_set_button(self.to_glib_none().0, button);
        }
    }

    #[cfg(feature = "v3_14")]
    fn set_exclusive(&self, exclusive: bool) {
        unsafe {
            ffi::gtk_gesture_single_set_exclusive(self.to_glib_none().0, exclusive.to_glib());
        }
    }

    #[cfg(feature = "v3_14")]
    fn set_touch_only(&self, touch_only: bool) {
        unsafe {
            ffi::gtk_gesture_single_set_touch_only(self.to_glib_none().0, touch_only.to_glib());
        }
    }
}