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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
// This file was generated by gir (4b09025) from gir-files (71d73f0)
// DO NOT EDIT

use Orientation;
use ReliefStyle;
use SizeGroup;
use ToolbarStyle;
use Widget;
use ffi;
use glib::object::IsA;
use glib::translate::*;
use gobject_ffi;
use pango;

glib_wrapper! {
    pub struct ToolShell(Object<ffi::GtkToolShell>): Widget;

    match fn {
        get_type => || ffi::gtk_tool_shell_get_type(),
    }
}

pub trait ToolShellExt {
    fn get_ellipsize_mode(&self) -> pango::EllipsizeMode;

    fn get_icon_size(&self) -> i32;

    fn get_orientation(&self) -> Orientation;

    fn get_relief_style(&self) -> ReliefStyle;

    fn get_style(&self) -> ToolbarStyle;

    fn get_text_alignment(&self) -> f32;

    fn get_text_orientation(&self) -> Orientation;

    fn get_text_size_group(&self) -> Option<SizeGroup>;

    fn rebuild_menu(&self);
}

impl<O: IsA<ToolShell>> ToolShellExt for O {
    fn get_ellipsize_mode(&self) -> pango::EllipsizeMode {
        unsafe {
            from_glib(ffi::gtk_tool_shell_get_ellipsize_mode(self.to_glib_none().0))
        }
    }

    fn get_icon_size(&self) -> i32 {
        unsafe {
            ffi::gtk_tool_shell_get_icon_size(self.to_glib_none().0)
        }
    }

    fn get_orientation(&self) -> Orientation {
        unsafe {
            from_glib(ffi::gtk_tool_shell_get_orientation(self.to_glib_none().0))
        }
    }

    fn get_relief_style(&self) -> ReliefStyle {
        unsafe {
            from_glib(ffi::gtk_tool_shell_get_relief_style(self.to_glib_none().0))
        }
    }

    fn get_style(&self) -> ToolbarStyle {
        unsafe {
            from_glib(ffi::gtk_tool_shell_get_style(self.to_glib_none().0))
        }
    }

    fn get_text_alignment(&self) -> f32 {
        unsafe {
            ffi::gtk_tool_shell_get_text_alignment(self.to_glib_none().0)
        }
    }

    fn get_text_orientation(&self) -> Orientation {
        unsafe {
            from_glib(ffi::gtk_tool_shell_get_text_orientation(self.to_glib_none().0))
        }
    }

    fn get_text_size_group(&self) -> Option<SizeGroup> {
        unsafe {
            from_glib_none(ffi::gtk_tool_shell_get_text_size_group(self.to_glib_none().0))
        }
    }

    fn rebuild_menu(&self) {
        unsafe {
            ffi::gtk_tool_shell_rebuild_menu(self.to_glib_none().0);
        }
    }
}