gdk/
device.rs

1// Copyright 2013-2015, The Gtk-rs Project Developers.
2// See the COPYRIGHT file at the top-level directory of this distribution.
3// Licensed under the MIT license, see the LICENSE file or <http://opensource.org/licenses/MIT>
4
5use gdk_sys;
6use glib::translate::*;
7use AxisUse;
8use Device;
9
10impl Device {
11    pub fn get_axis(&self, axes: &mut [f64], use_: AxisUse, value: &mut f64) -> bool {
12        unsafe {
13            from_glib(gdk_sys::gdk_device_get_axis(
14                self.to_glib_none().0,
15                axes.as_mut_ptr(),
16                use_.to_glib(),
17                value,
18            ))
19        }
20    }
21}