graphene/auto/
quad.rs

1// This file was generated by gir (https://github.com/gtk-rs/gir)
2// from gir-files (https://github.com/gtk-rs/gir-files)
3// DO NOT EDIT
4
5use crate::{ffi, Point, Rect};
6use glib::translate::*;
7
8glib::wrapper! {
9    pub struct Quad(BoxedInline<ffi::graphene_quad_t>);
10
11    match fn {
12        copy => |ptr| glib::gobject_ffi::g_boxed_copy(ffi::graphene_quad_get_type(), ptr as *mut _) as *mut ffi::graphene_quad_t,
13        free => |ptr| glib::gobject_ffi::g_boxed_free(ffi::graphene_quad_get_type(), ptr as *mut _),
14        type_ => || ffi::graphene_quad_get_type(),
15    }
16}
17
18impl Quad {
19    #[doc(alias = "graphene_quad_bounds")]
20    pub fn bounds(&self) -> Rect {
21        unsafe {
22            let mut r = Rect::uninitialized();
23            ffi::graphene_quad_bounds(self.to_glib_none().0, r.to_glib_none_mut().0);
24            r
25        }
26    }
27
28    #[doc(alias = "graphene_quad_contains")]
29    pub fn contains(&self, p: &Point) -> bool {
30        unsafe { ffi::graphene_quad_contains(self.to_glib_none().0, p.to_glib_none().0) }
31    }
32}