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