[go: up one dir, main page]

gdk4/
draw_context.rs

1// Take a look at the license at the top of the repository in the LICENSE file.
2
3use glib::translate::*;
4
5use crate::{prelude::*, DrawContext};
6
7// rustdoc-stripper-ignore-next
8/// Trait containing manually implemented methods of
9/// [`DrawContext`](crate::DrawContext).
10pub trait DrawContextExtManual: IsA<DrawContext> + 'static {
11    #[doc(alias = "gdk_draw_context_get_frame_region")]
12    #[doc(alias = "get_frame_region")]
13    fn frame_region(&self) -> Option<cairo::Region> {
14        unsafe {
15            from_glib_none(crate::ffi::gdk_draw_context_get_frame_region(
16                self.as_ref().to_glib_none().0,
17            ) as *mut cairo::ffi::cairo_region_t)
18        }
19    }
20}
21
22impl<O: IsA<DrawContext>> DrawContextExtManual for O {}