1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
use Orientation;
use ffi;
use glib::object::IsA;
use glib::translate::*;
use gobject_ffi;
glib_wrapper! {
pub struct Orientable(Object<ffi::GtkOrientable>);
match fn {
get_type => || ffi::gtk_orientable_get_type(),
}
}
pub trait OrientableExt {
fn get_orientation(&self) -> Orientation;
fn set_orientation(&self, orientation: Orientation);
}
impl<O: IsA<Orientable>> OrientableExt for O {
fn get_orientation(&self) -> Orientation {
unsafe {
from_glib(ffi::gtk_orientable_get_orientation(self.to_glib_none().0))
}
}
fn set_orientation(&self, orientation: Orientation) {
unsafe {
ffi::gtk_orientable_set_orientation(self.to_glib_none().0, orientation.to_glib());
}
}
}