gdk/event_setting.rs
1// Copyright 2016, 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 glib::GString;
8
9#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
10pub struct EventSetting(::Event);
11
12event_wrapper!(EventSetting, GdkEventSetting);
13event_subtype!(EventSetting, gdk_sys::GDK_SETTING);
14
15impl EventSetting {
16 pub fn get_name(&self) -> Option<GString> {
17 unsafe { from_glib_none(self.as_ref().name) }
18 }
19
20 pub fn get_action(&self) -> ::SettingAction {
21 from_glib(self.as_ref().action)
22 }
23}