gtk/auto/misc.rs
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
5use crate::{Buildable, Widget};
6use std::fmt;
7
8glib::wrapper! {
9 /// The [`Misc`][crate::Misc] widget is an abstract widget which is not useful itself, but
10 /// is used to derive subclasses which have alignment and padding attributes.
11 ///
12 /// The horizontal and vertical padding attributes allows extra space to be
13 /// added around the widget.
14 ///
15 /// The horizontal and vertical alignment attributes enable the widget to be
16 /// positioned within its allocated area. Note that if the widget is added to
17 /// a container in such a way that it expands automatically to fill its
18 /// allocated area, the alignment settings will not alter the widget's position.
19 ///
20 /// Note that the desired effect can in most cases be achieved by using the
21 /// [`halign`][struct@crate::Widget#halign], [`valign`][struct@crate::Widget#valign] and [`margin`][struct@crate::Widget#margin] properties
22 /// on the child widget, so GtkMisc should not be used in new code. To reflect
23 /// this fact, all [`Misc`][crate::Misc] API has been deprecated.
24 ///
25 /// This is an Abstract Base Class, you cannot instantiate it.
26 ///
27 /// ## Properties
28 ///
29 ///
30 /// #### `xalign`
31 /// The horizontal alignment. A value of 0.0 means left alignment (or right
32 /// on RTL locales); a value of 1.0 means right alignment (or left on RTL
33 /// locales).
34 ///
35 /// Readable | Writeable
36 ///
37 ///
38 /// #### `xpad`
39 /// The amount of space to add on the left and right of the widget, in
40 /// pixels.
41 ///
42 /// Readable | Writeable
43 ///
44 ///
45 /// #### `yalign`
46 /// The vertical alignment. A value of 0.0 means top alignment;
47 /// a value of 1.0 means bottom alignment.
48 ///
49 /// Readable | Writeable
50 ///
51 ///
52 /// #### `ypad`
53 /// The amount of space to add on the top and bottom of the widget, in
54 /// pixels.
55 ///
56 /// Readable | Writeable
57 /// <details><summary><h4>Widget</h4></summary>
58 ///
59 ///
60 /// #### `app-paintable`
61 /// Readable | Writeable
62 ///
63 ///
64 /// #### `can-default`
65 /// Readable | Writeable
66 ///
67 ///
68 /// #### `can-focus`
69 /// Readable | Writeable
70 ///
71 ///
72 /// #### `composite-child`
73 /// Readable
74 ///
75 ///
76 /// #### `double-buffered`
77 /// Whether the widget is double buffered.
78 ///
79 /// Readable | Writeable
80 ///
81 ///
82 /// #### `events`
83 /// Readable | Writeable
84 ///
85 ///
86 /// #### `expand`
87 /// Whether to expand in both directions. Setting this sets both [`hexpand`][struct@crate::Widget#hexpand] and [`vexpand`][struct@crate::Widget#vexpand]
88 ///
89 /// Readable | Writeable
90 ///
91 ///
92 /// #### `focus-on-click`
93 /// Whether the widget should grab focus when it is clicked with the mouse.
94 ///
95 /// This property is only relevant for widgets that can take focus.
96 ///
97 /// Before 3.20, several widgets (GtkButton, GtkFileChooserButton,
98 /// GtkComboBox) implemented this property individually.
99 ///
100 /// Readable | Writeable
101 ///
102 ///
103 /// #### `halign`
104 /// How to distribute horizontal space if widget gets extra space, see [`Align`][crate::Align]
105 ///
106 /// Readable | Writeable
107 ///
108 ///
109 /// #### `has-default`
110 /// Readable | Writeable
111 ///
112 ///
113 /// #### `has-focus`
114 /// Readable | Writeable
115 ///
116 ///
117 /// #### `has-tooltip`
118 /// Enables or disables the emission of [`query-tooltip`][struct@crate::Widget#query-tooltip] on `widget`.
119 /// A value of [`true`] indicates that `widget` can have a tooltip, in this case
120 /// the widget will be queried using [`query-tooltip`][struct@crate::Widget#query-tooltip] to determine
121 /// whether it will provide a tooltip or not.
122 ///
123 /// Note that setting this property to [`true`] for the first time will change
124 /// the event masks of the GdkWindows of this widget to include leave-notify
125 /// and motion-notify events. This cannot and will not be undone when the
126 /// property is set to [`false`] again.
127 ///
128 /// Readable | Writeable
129 ///
130 ///
131 /// #### `height-request`
132 /// Readable | Writeable
133 ///
134 ///
135 /// #### `hexpand`
136 /// Whether to expand horizontally. See [`WidgetExt::set_hexpand()`][crate::prelude::WidgetExt::set_hexpand()].
137 ///
138 /// Readable | Writeable
139 ///
140 ///
141 /// #### `hexpand-set`
142 /// Whether to use the [`hexpand`][struct@crate::Widget#hexpand] property. See [`WidgetExt::is_hexpand_set()`][crate::prelude::WidgetExt::is_hexpand_set()].
143 ///
144 /// Readable | Writeable
145 ///
146 ///
147 /// #### `is-focus`
148 /// Readable | Writeable
149 ///
150 ///
151 /// #### `margin`
152 /// Sets all four sides' margin at once. If read, returns max
153 /// margin on any side.
154 ///
155 /// Readable | Writeable
156 ///
157 ///
158 /// #### `margin-bottom`
159 /// Margin on bottom side of widget.
160 ///
161 /// This property adds margin outside of the widget's normal size
162 /// request, the margin will be added in addition to the size from
163 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
164 ///
165 /// Readable | Writeable
166 ///
167 ///
168 /// #### `margin-end`
169 /// Margin on end of widget, horizontally. This property supports
170 /// left-to-right and right-to-left text directions.
171 ///
172 /// This property adds margin outside of the widget's normal size
173 /// request, the margin will be added in addition to the size from
174 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
175 ///
176 /// Readable | Writeable
177 ///
178 ///
179 /// #### `margin-left`
180 /// Margin on left side of widget.
181 ///
182 /// This property adds margin outside of the widget's normal size
183 /// request, the margin will be added in addition to the size from
184 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
185 ///
186 /// Readable | Writeable
187 ///
188 ///
189 /// #### `margin-right`
190 /// Margin on right side of widget.
191 ///
192 /// This property adds margin outside of the widget's normal size
193 /// request, the margin will be added in addition to the size from
194 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
195 ///
196 /// Readable | Writeable
197 ///
198 ///
199 /// #### `margin-start`
200 /// Margin on start of widget, horizontally. This property supports
201 /// left-to-right and right-to-left text directions.
202 ///
203 /// This property adds margin outside of the widget's normal size
204 /// request, the margin will be added in addition to the size from
205 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
206 ///
207 /// Readable | Writeable
208 ///
209 ///
210 /// #### `margin-top`
211 /// Margin on top side of widget.
212 ///
213 /// This property adds margin outside of the widget's normal size
214 /// request, the margin will be added in addition to the size from
215 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
216 ///
217 /// Readable | Writeable
218 ///
219 ///
220 /// #### `name`
221 /// Readable | Writeable
222 ///
223 ///
224 /// #### `no-show-all`
225 /// Readable | Writeable
226 ///
227 ///
228 /// #### `opacity`
229 /// The requested opacity of the widget. See [`WidgetExt::set_opacity()`][crate::prelude::WidgetExt::set_opacity()] for
230 /// more details about window opacity.
231 ///
232 /// Before 3.8 this was only available in GtkWindow
233 ///
234 /// Readable | Writeable
235 ///
236 ///
237 /// #### `parent`
238 /// Readable | Writeable
239 ///
240 ///
241 /// #### `receives-default`
242 /// Readable | Writeable
243 ///
244 ///
245 /// #### `scale-factor`
246 /// The scale factor of the widget. See [`WidgetExt::scale_factor()`][crate::prelude::WidgetExt::scale_factor()] for
247 /// more details about widget scaling.
248 ///
249 /// Readable
250 ///
251 ///
252 /// #### `sensitive`
253 /// Readable | Writeable
254 ///
255 ///
256 /// #### `style`
257 /// The style of the widget, which contains information about how it will look (colors, etc).
258 ///
259 /// Readable | Writeable
260 ///
261 ///
262 /// #### `tooltip-markup`
263 /// Sets the text of tooltip to be the given string, which is marked up
264 /// with the [Pango text markup language][PangoMarkupFormat].
265 /// Also see [`Tooltip::set_markup()`][crate::Tooltip::set_markup()].
266 ///
267 /// This is a convenience property which will take care of getting the
268 /// tooltip shown if the given string is not [`None`]: [`has-tooltip`][struct@crate::Widget#has-tooltip]
269 /// will automatically be set to [`true`] and there will be taken care of
270 /// [`query-tooltip`][struct@crate::Widget#query-tooltip] in the default signal handler.
271 ///
272 /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and [`tooltip-markup`][struct@crate::Widget#tooltip-markup]
273 /// are set, the last one wins.
274 ///
275 /// Readable | Writeable
276 ///
277 ///
278 /// #### `tooltip-text`
279 /// Sets the text of tooltip to be the given string.
280 ///
281 /// Also see [`Tooltip::set_text()`][crate::Tooltip::set_text()].
282 ///
283 /// This is a convenience property which will take care of getting the
284 /// tooltip shown if the given string is not [`None`]: [`has-tooltip`][struct@crate::Widget#has-tooltip]
285 /// will automatically be set to [`true`] and there will be taken care of
286 /// [`query-tooltip`][struct@crate::Widget#query-tooltip] in the default signal handler.
287 ///
288 /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and [`tooltip-markup`][struct@crate::Widget#tooltip-markup]
289 /// are set, the last one wins.
290 ///
291 /// Readable | Writeable
292 ///
293 ///
294 /// #### `valign`
295 /// How to distribute vertical space if widget gets extra space, see [`Align`][crate::Align]
296 ///
297 /// Readable | Writeable
298 ///
299 ///
300 /// #### `vexpand`
301 /// Whether to expand vertically. See [`WidgetExt::set_vexpand()`][crate::prelude::WidgetExt::set_vexpand()].
302 ///
303 /// Readable | Writeable
304 ///
305 ///
306 /// #### `vexpand-set`
307 /// Whether to use the [`vexpand`][struct@crate::Widget#vexpand] property. See [`WidgetExt::is_vexpand_set()`][crate::prelude::WidgetExt::is_vexpand_set()].
308 ///
309 /// Readable | Writeable
310 ///
311 ///
312 /// #### `visible`
313 /// Readable | Writeable
314 ///
315 ///
316 /// #### `width-request`
317 /// Readable | Writeable
318 ///
319 ///
320 /// #### `window`
321 /// The widget's window if it is realized, [`None`] otherwise.
322 ///
323 /// Readable
324 /// </details>
325 ///
326 /// # Implements
327 ///
328 /// [`WidgetExt`][trait@crate::prelude::WidgetExt], [`trait@glib::ObjectExt`], [`BuildableExt`][trait@crate::prelude::BuildableExt], [`WidgetExtManual`][trait@crate::prelude::WidgetExtManual], [`BuildableExtManual`][trait@crate::prelude::BuildableExtManual]
329 #[doc(alias = "GtkMisc")]
330 pub struct Misc(Object<ffi::GtkMisc, ffi::GtkMiscClass>) @extends Widget, @implements Buildable;
331
332 match fn {
333 type_ => || ffi::gtk_misc_get_type(),
334 }
335}
336
337impl Misc {
338 pub const NONE: Option<&'static Misc> = None;
339}
340
341impl fmt::Display for Misc {
342 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
343 f.write_str("Misc")
344 }
345}