Skip to main content

gdk/
event_window_state.rs

1// Take a look at the license at the top of the repository in the LICENSE file.
2
3use crate::ffi;
4use glib::translate::*;
5
6/// Generated when the state of a toplevel window changes.
7#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
8pub struct EventWindowState(crate::Event);
9
10event_wrapper!(EventWindowState, GdkEventWindowState);
11event_subtype!(EventWindowState, ffi::GDK_WINDOW_STATE);
12
13impl EventWindowState {
14    #[doc(alias = "get_changed_mask")]
15    pub fn changed_mask(&self) -> crate::WindowState {
16        unsafe { from_glib(self.as_ref().changed_mask) }
17    }
18
19    #[doc(alias = "get_new_window_state")]
20    pub fn new_window_state(&self) -> crate::WindowState {
21        unsafe { from_glib(self.as_ref().new_window_state) }
22    }
23}