animate/legacy/
bin_layout.rs1use crate::{BinAlignment, LayoutManager};
2use glib::{object as gobject, object::Cast, translate::*};
3use std::fmt;
4
5glib_wrapper! {
6 pub struct BinLayout(Object<ffi::ClutterBinLayout, ffi::ClutterBinLayoutClass, BinLayoutClass>) @extends LayoutManager, gobject::InitiallyUnowned;
7
8 match fn {
9 get_type => || ffi::clutter_bin_layout_get_type(),
10 }
11}
12
13impl BinLayout {
14 pub fn new(x_align: BinAlignment, y_align: BinAlignment) -> BinLayout {
26 unsafe {
27 LayoutManager::from_glib_none(ffi::clutter_bin_layout_new(
28 x_align.to_glib(),
29 y_align.to_glib(),
30 ))
31 .unsafe_cast()
32 }
33 }
34}
35
36impl fmt::Display for BinLayout {
37 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
38 write!(f, "BinLayout")
39 }
40}