1use crate::ffi;
4use glib::translate::*;
5
6#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
8pub struct EventConfigure(crate::Event);
9
10event_wrapper!(EventConfigure, GdkEventConfigure);
11event_subtype!(EventConfigure, ffi::GDK_CONFIGURE);
12
13impl EventConfigure {
14 #[doc(alias = "get_position")]
15 pub fn position(&self) -> (i32, i32) {
16 (self.as_ref().x, self.as_ref().y)
17 }
18
19 #[doc(alias = "get_size")]
20 pub fn size(&self) -> (u32, u32) {
21 let width = self.as_ref().width;
22 let height = self.as_ref().height;
23 assert!(width >= 0 && height >= 0, "Unexpected negative value");
24 (width as u32, height as u32)
25 }
26}