Skip to main content

clutter/auto/
layout_meta.rs

1use crate::{ChildMeta, LayoutManager};
2use glib::{object::IsA, translate::*};
3use std::fmt;
4
5glib_wrapper! {
6    pub struct LayoutMeta(Object<ffi::ClutterLayoutMeta, ffi::ClutterLayoutMetaClass, LayoutMetaClass>) @extends ChildMeta;
7
8    match fn {
9        get_type => || ffi::clutter_layout_meta_get_type(),
10    }
11}
12
13pub const NONE_LAYOUT_META: Option<&LayoutMeta> = None;
14
15/// Trait containing all `LayoutMeta` methods.
16///
17/// # Implementors
18///
19/// [`LayoutMeta`](struct.LayoutMeta.html)
20pub trait LayoutMetaExt: 'static {
21    /// Retrieves the actor wrapped by `self`
22    ///
23    /// # Returns
24    ///
25    /// a `LayoutManager`
26    fn get_manager(&self) -> Option<LayoutManager>;
27}
28
29impl<O: IsA<LayoutMeta>> LayoutMetaExt for O {
30    fn get_manager(&self) -> Option<LayoutManager> {
31        unsafe {
32            from_glib_none(ffi::clutter_layout_meta_get_manager(
33                self.as_ref().to_glib_none().0,
34            ))
35        }
36    }
37}
38
39impl fmt::Display for LayoutMeta {
40    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
41        write!(f, "LayoutMeta")
42    }
43}