1use cairo;
6use gdk_sys;
7use glib::translate::*;
8use Rectangle;
9
10#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
11pub struct EventExpose(::Event);
12
13event_wrapper!(EventExpose, GdkEventExpose);
14event_subtype!(EventExpose, gdk_sys::GDK_EXPOSE | gdk_sys::GDK_DAMAGE);
15
16impl EventExpose {
17 pub fn get_region(&self) -> Option<cairo::Region> {
18 unsafe { from_glib_none(self.as_ref().region) }
19 }
20
21 pub fn get_count(&self) -> u32 {
22 self.as_ref().count as u32
23 }
24
25 pub fn get_area(&self) -> Rectangle {
26 unsafe { from_glib_none(&self.as_ref().area as *const _) }
27 }
28}