clutter/auto/
margin.rs

1use glib::translate::*;
2
3glib_wrapper! {
4    #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
5    pub struct Margin(Boxed<ffi::ClutterMargin>);
6
7    match fn {
8        copy => |ptr| ffi::clutter_margin_copy(mut_override(ptr)),
9        free => |ptr| ffi::clutter_margin_free(ptr),
10        get_type => || ffi::clutter_margin_get_type(),
11    }
12}
13
14impl Margin {
15    /// Creates a new `Margin`.
16    ///
17    /// # Returns
18    ///
19    /// a newly allocated `Margin`. Use
20    ///  `Margin::free` to free the resources associated with it when
21    ///  done.
22    pub fn new() -> Margin {
23        unsafe { from_glib_full(ffi::clutter_margin_new()) }
24    }
25}
26
27#[doc(hidden)]
28impl Uninitialized for Margin {
29    #[inline]
30    unsafe fn uninitialized() -> Self {
31        Self::new()
32    }
33}
34
35impl Default for Margin {
36    fn default() -> Self {
37        Self::new()
38    }
39}