gdk/event_expose.rs
1// Take a look at the license at the top of the repository in the LICENSE file.
2
3use crate::Rectangle;
4use glib::translate::*;
5
6#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
7pub struct EventExpose(crate::Event);
8
9event_wrapper!(EventExpose, GdkEventExpose);
10event_subtype!(EventExpose, ffi::GDK_EXPOSE | ffi::GDK_DAMAGE);
11
12impl EventExpose {
13 #[doc(alias = "get_region")]
14 pub fn region(&self) -> Option<cairo::Region> {
15 unsafe { from_glib_none(self.as_ref().region) }
16 }
17
18 #[doc(alias = "get_count")]
19 pub fn count(&self) -> u32 {
20 self.as_ref().count as u32
21 }
22
23 #[doc(alias = "get_area")]
24 pub fn area(&self) -> Rectangle {
25 unsafe { from_glib_none(&self.as_ref().area as *const _) }
26 }
27}