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 5 use gdk_sys; 6 use glib::translate::*; 7 8 #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] 9 pub struct EventOwnerChange(::Event); 10 11 event_wrapper!(EventOwnerChange, GdkEventOwnerChange); 12 event_subtype!(EventOwnerChange, gdk_sys::GDK_OWNER_CHANGE); 13 14 impl EventOwnerChange { get_owner(&self) -> Option<::Window>15 pub fn get_owner(&self) -> Option<::Window> { 16 unsafe { from_glib_none(self.as_ref().owner) } 17 } 18 get_reason(&self) -> ::OwnerChange19 pub fn get_reason(&self) -> ::OwnerChange { 20 from_glib(self.as_ref().reason) 21 } 22 get_selection(&self) -> ::Atom23 pub fn get_selection(&self) -> ::Atom { 24 unsafe { from_glib_none(self.as_ref().selection as *mut _) } 25 } 26 get_time(&self) -> u3227 pub fn get_time(&self) -> u32 { 28 self.as_ref().time 29 } 30 get_selection_time(&self) -> u3231 pub fn get_selection_time(&self) -> u32 { 32 self.as_ref().selection_time 33 } 34 } 35