1 // Take a look at the license at the top of the repository in the LICENSE file. 2 3 use glib::translate::*; 4 5 #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] 6 pub struct EventOwnerChange(crate::Event); 7 8 event_wrapper!(EventOwnerChange, GdkEventOwnerChange); 9 event_subtype!(EventOwnerChange, ffi::GDK_OWNER_CHANGE); 10 11 impl EventOwnerChange { 12 #[doc(alias = "get_owner")] owner(&self) -> Option<crate::Window>13 pub fn owner(&self) -> Option<crate::Window> { 14 unsafe { from_glib_none(self.as_ref().owner) } 15 } 16 17 #[doc(alias = "get_reason")] reason(&self) -> crate::OwnerChange18 pub fn reason(&self) -> crate::OwnerChange { 19 unsafe { from_glib(self.as_ref().reason) } 20 } 21 22 #[doc(alias = "get_selection")] selection(&self) -> crate::Atom23 pub fn selection(&self) -> crate::Atom { 24 unsafe { from_glib_none(self.as_ref().selection as *mut _) } 25 } 26 27 #[doc(alias = "get_time")] time(&self) -> u3228 pub fn time(&self) -> u32 { 29 self.as_ref().time 30 } 31 32 #[doc(alias = "get_selection_time")] selection_time(&self) -> u3233 pub fn selection_time(&self) -> u32 { 34 self.as_ref().selection_time 35 } 36 } 37