animate/legacy/
margin.rs

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