gtk/
requisition.rs

1// Take a look at the license at the top of the repository in the LICENSE file.
2
3use glib::translate::*;
4use std::mem;
5
6#[repr(C)]
7pub struct Requisition {
8    pub width: i32,
9    pub height: i32,
10}
11
12#[doc(hidden)]
13impl Uninitialized for Requisition {
14    #[inline]
15    unsafe fn uninitialized() -> Self {
16        mem::zeroed()
17    }
18}
19
20#[doc(hidden)]
21impl<'a> ToGlibPtr<'a, *const ffi::GtkRequisition> for Requisition {
22    type Storage = &'a Self;
23
24    #[inline]
25    fn to_glib_none(&'a self) -> Stash<'a, *const ffi::GtkRequisition, Self> {
26        let ptr: *const Requisition = self;
27        Stash(ptr as *const ffi::GtkRequisition, self)
28    }
29}
30
31#[doc(hidden)]
32impl<'a> ToGlibPtrMut<'a, *mut ffi::GtkRequisition> for Requisition {
33    type Storage = &'a mut Self;
34
35    #[inline]
36    fn to_glib_none_mut(&'a mut self) -> StashMut<'a, *mut ffi::GtkRequisition, Self> {
37        let ptr: *mut Requisition = &mut *self;
38        StashMut(ptr as *mut ffi::GtkRequisition, self)
39    }
40}