1 // This file was generated by gir (https://github.com/gtk-rs/gir)
2 // from gir-files (https://github.com/gtk-rs/gir-files)
3 // DO NOT EDIT
4 
5 use crate::Buildable;
6 use crate::IconSize;
7 use crate::Orientation;
8 use crate::ReliefStyle;
9 use crate::SizeGroup;
10 use crate::ToolbarStyle;
11 use crate::Widget;
12 use glib::object::IsA;
13 use glib::translate::*;
14 use std::fmt;
15 
16 glib::wrapper! {
17     #[doc(alias = "GtkToolShell")]
18     pub struct ToolShell(Interface<ffi::GtkToolShell, ffi::GtkToolShellIface>) @requires Widget, Buildable;
19 
20     match fn {
21         type_ => || ffi::gtk_tool_shell_get_type(),
22     }
23 }
24 
25 pub const NONE_TOOL_SHELL: Option<&ToolShell> = None;
26 
27 pub trait ToolShellExt: 'static {
28     #[doc(alias = "gtk_tool_shell_get_ellipsize_mode")]
29     #[doc(alias = "get_ellipsize_mode")]
ellipsize_mode(&self) -> pango::EllipsizeMode30     fn ellipsize_mode(&self) -> pango::EllipsizeMode;
31 
32     #[doc(alias = "gtk_tool_shell_get_icon_size")]
33     #[doc(alias = "get_icon_size")]
icon_size(&self) -> IconSize34     fn icon_size(&self) -> IconSize;
35 
36     #[doc(alias = "gtk_tool_shell_get_orientation")]
37     #[doc(alias = "get_orientation")]
orientation(&self) -> Orientation38     fn orientation(&self) -> Orientation;
39 
40     #[doc(alias = "gtk_tool_shell_get_relief_style")]
41     #[doc(alias = "get_relief_style")]
relief_style(&self) -> ReliefStyle42     fn relief_style(&self) -> ReliefStyle;
43 
44     #[doc(alias = "gtk_tool_shell_get_style")]
45     #[doc(alias = "get_style")]
style(&self) -> ToolbarStyle46     fn style(&self) -> ToolbarStyle;
47 
48     #[doc(alias = "gtk_tool_shell_get_text_alignment")]
49     #[doc(alias = "get_text_alignment")]
text_alignment(&self) -> f3250     fn text_alignment(&self) -> f32;
51 
52     #[doc(alias = "gtk_tool_shell_get_text_orientation")]
53     #[doc(alias = "get_text_orientation")]
text_orientation(&self) -> Orientation54     fn text_orientation(&self) -> Orientation;
55 
56     #[doc(alias = "gtk_tool_shell_get_text_size_group")]
57     #[doc(alias = "get_text_size_group")]
text_size_group(&self) -> Option<SizeGroup>58     fn text_size_group(&self) -> Option<SizeGroup>;
59 
60     #[doc(alias = "gtk_tool_shell_rebuild_menu")]
rebuild_menu(&self)61     fn rebuild_menu(&self);
62 }
63 
64 impl<O: IsA<ToolShell>> ToolShellExt for O {
ellipsize_mode(&self) -> pango::EllipsizeMode65     fn ellipsize_mode(&self) -> pango::EllipsizeMode {
66         unsafe {
67             from_glib(ffi::gtk_tool_shell_get_ellipsize_mode(
68                 self.as_ref().to_glib_none().0,
69             ))
70         }
71     }
72 
icon_size(&self) -> IconSize73     fn icon_size(&self) -> IconSize {
74         unsafe {
75             from_glib(ffi::gtk_tool_shell_get_icon_size(
76                 self.as_ref().to_glib_none().0,
77             ))
78         }
79     }
80 
orientation(&self) -> Orientation81     fn orientation(&self) -> Orientation {
82         unsafe {
83             from_glib(ffi::gtk_tool_shell_get_orientation(
84                 self.as_ref().to_glib_none().0,
85             ))
86         }
87     }
88 
relief_style(&self) -> ReliefStyle89     fn relief_style(&self) -> ReliefStyle {
90         unsafe {
91             from_glib(ffi::gtk_tool_shell_get_relief_style(
92                 self.as_ref().to_glib_none().0,
93             ))
94         }
95     }
96 
style(&self) -> ToolbarStyle97     fn style(&self) -> ToolbarStyle {
98         unsafe {
99             from_glib(ffi::gtk_tool_shell_get_style(
100                 self.as_ref().to_glib_none().0,
101             ))
102         }
103     }
104 
text_alignment(&self) -> f32105     fn text_alignment(&self) -> f32 {
106         unsafe { ffi::gtk_tool_shell_get_text_alignment(self.as_ref().to_glib_none().0) }
107     }
108 
text_orientation(&self) -> Orientation109     fn text_orientation(&self) -> Orientation {
110         unsafe {
111             from_glib(ffi::gtk_tool_shell_get_text_orientation(
112                 self.as_ref().to_glib_none().0,
113             ))
114         }
115     }
116 
text_size_group(&self) -> Option<SizeGroup>117     fn text_size_group(&self) -> Option<SizeGroup> {
118         unsafe {
119             from_glib_none(ffi::gtk_tool_shell_get_text_size_group(
120                 self.as_ref().to_glib_none().0,
121             ))
122         }
123     }
124 
rebuild_menu(&self)125     fn rebuild_menu(&self) {
126         unsafe {
127             ffi::gtk_tool_shell_rebuild_menu(self.as_ref().to_glib_none().0);
128         }
129     }
130 }
131 
132 impl fmt::Display for ToolShell {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result133     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
134         f.write_str("ToolShell")
135     }
136 }
137