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::Align;
6 use crate::Application;
7 use crate::Bin;
8 use crate::Buildable;
9 use crate::ButtonsType;
10 use crate::Container;
11 use crate::Dialog;
12 use crate::MessageType;
13 use crate::ResizeMode;
14 use crate::Widget;
15 use crate::Window;
16 use crate::WindowPosition;
17 use crate::WindowType;
18 use glib::object::Cast;
19 use glib::object::IsA;
20 use glib::signal::connect_raw;
21 use glib::signal::SignalHandlerId;
22 use glib::translate::*;
23 use glib::StaticType;
24 use glib::ToValue;
25 use std::boxed::Box as Box_;
26 use std::fmt;
27 use std::mem::transmute;
28 
29 glib::wrapper! {
30     #[doc(alias = "GtkMessageDialog")]
31     pub struct MessageDialog(Object<ffi::GtkMessageDialog, ffi::GtkMessageDialogClass>) @extends Dialog, Window, Bin, Container, Widget, @implements Buildable;
32 
33     match fn {
34         type_ => || ffi::gtk_message_dialog_get_type(),
35     }
36 }
37 
38 impl MessageDialog {
39     //#[doc(alias = "gtk_message_dialog_new")]
40     //pub fn new<P: IsA<Window>>(parent: Option<&P>, flags: DialogFlags, type_: MessageType, buttons: ButtonsType, message_format: Option<&str>, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs) -> MessageDialog {
41     //    unsafe { TODO: call ffi:gtk_message_dialog_new() }
42     //}
43 
44     //#[doc(alias = "gtk_message_dialog_new_with_markup")]
45     //#[doc(alias = "new_with_markup")]
46     //pub fn with_markup<P: IsA<Window>>(parent: Option<&P>, flags: DialogFlags, type_: MessageType, buttons: ButtonsType, message_format: Option<&str>, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs) -> MessageDialog {
47     //    unsafe { TODO: call ffi:gtk_message_dialog_new_with_markup() }
48     //}
49 
50     // rustdoc-stripper-ignore-next
51     /// Creates a new builder-pattern struct instance to construct [`MessageDialog`] objects.
52     ///
53     /// This method returns an instance of [`MessageDialogBuilder`] which can be used to create [`MessageDialog`] objects.
builder() -> MessageDialogBuilder54     pub fn builder() -> MessageDialogBuilder {
55         MessageDialogBuilder::default()
56     }
57 }
58 
59 #[derive(Clone, Default)]
60 // rustdoc-stripper-ignore-next
61 /// A [builder-pattern] type to construct [`MessageDialog`] objects.
62 ///
63 /// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html
64 pub struct MessageDialogBuilder {
65     buttons: Option<ButtonsType>,
66     message_type: Option<MessageType>,
67     secondary_text: Option<String>,
68     secondary_use_markup: Option<bool>,
69     text: Option<String>,
70     use_markup: Option<bool>,
71     use_header_bar: Option<i32>,
72     accept_focus: Option<bool>,
73     application: Option<Application>,
74     attached_to: Option<Widget>,
75     decorated: Option<bool>,
76     default_height: Option<i32>,
77     default_width: Option<i32>,
78     deletable: Option<bool>,
79     destroy_with_parent: Option<bool>,
80     focus_on_map: Option<bool>,
81     focus_visible: Option<bool>,
82     gravity: Option<gdk::Gravity>,
83     hide_titlebar_when_maximized: Option<bool>,
84     icon: Option<gdk_pixbuf::Pixbuf>,
85     icon_name: Option<String>,
86     mnemonics_visible: Option<bool>,
87     modal: Option<bool>,
88     resizable: Option<bool>,
89     role: Option<String>,
90     screen: Option<gdk::Screen>,
91     skip_pager_hint: Option<bool>,
92     skip_taskbar_hint: Option<bool>,
93     startup_id: Option<String>,
94     title: Option<String>,
95     transient_for: Option<Window>,
96     type_: Option<WindowType>,
97     type_hint: Option<gdk::WindowTypeHint>,
98     urgency_hint: Option<bool>,
99     window_position: Option<WindowPosition>,
100     border_width: Option<u32>,
101     child: Option<Widget>,
102     resize_mode: Option<ResizeMode>,
103     app_paintable: Option<bool>,
104     can_default: Option<bool>,
105     can_focus: Option<bool>,
106     events: Option<gdk::EventMask>,
107     expand: Option<bool>,
108     #[cfg(any(feature = "v3_20", feature = "dox"))]
109     #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))]
110     focus_on_click: Option<bool>,
111     halign: Option<Align>,
112     has_default: Option<bool>,
113     has_focus: Option<bool>,
114     has_tooltip: Option<bool>,
115     height_request: Option<i32>,
116     hexpand: Option<bool>,
117     hexpand_set: Option<bool>,
118     is_focus: Option<bool>,
119     margin: Option<i32>,
120     margin_bottom: Option<i32>,
121     margin_end: Option<i32>,
122     margin_start: Option<i32>,
123     margin_top: Option<i32>,
124     name: Option<String>,
125     no_show_all: Option<bool>,
126     opacity: Option<f64>,
127     parent: Option<Container>,
128     receives_default: Option<bool>,
129     sensitive: Option<bool>,
130     tooltip_markup: Option<String>,
131     tooltip_text: Option<String>,
132     valign: Option<Align>,
133     vexpand: Option<bool>,
134     vexpand_set: Option<bool>,
135     visible: Option<bool>,
136     width_request: Option<i32>,
137 }
138 
139 impl MessageDialogBuilder {
140     // rustdoc-stripper-ignore-next
141     /// Create a new [`MessageDialogBuilder`].
new() -> Self142     pub fn new() -> Self {
143         Self::default()
144     }
145 
146     // rustdoc-stripper-ignore-next
147     /// Build the [`MessageDialog`].
build(self) -> MessageDialog148     pub fn build(self) -> MessageDialog {
149         let mut properties: Vec<(&str, &dyn ToValue)> = vec![];
150         if let Some(ref buttons) = self.buttons {
151             properties.push(("buttons", buttons));
152         }
153         if let Some(ref message_type) = self.message_type {
154             properties.push(("message-type", message_type));
155         }
156         if let Some(ref secondary_text) = self.secondary_text {
157             properties.push(("secondary-text", secondary_text));
158         }
159         if let Some(ref secondary_use_markup) = self.secondary_use_markup {
160             properties.push(("secondary-use-markup", secondary_use_markup));
161         }
162         if let Some(ref text) = self.text {
163             properties.push(("text", text));
164         }
165         if let Some(ref use_markup) = self.use_markup {
166             properties.push(("use-markup", use_markup));
167         }
168         if let Some(ref use_header_bar) = self.use_header_bar {
169             properties.push(("use-header-bar", use_header_bar));
170         }
171         if let Some(ref accept_focus) = self.accept_focus {
172             properties.push(("accept-focus", accept_focus));
173         }
174         if let Some(ref application) = self.application {
175             properties.push(("application", application));
176         }
177         if let Some(ref attached_to) = self.attached_to {
178             properties.push(("attached-to", attached_to));
179         }
180         if let Some(ref decorated) = self.decorated {
181             properties.push(("decorated", decorated));
182         }
183         if let Some(ref default_height) = self.default_height {
184             properties.push(("default-height", default_height));
185         }
186         if let Some(ref default_width) = self.default_width {
187             properties.push(("default-width", default_width));
188         }
189         if let Some(ref deletable) = self.deletable {
190             properties.push(("deletable", deletable));
191         }
192         if let Some(ref destroy_with_parent) = self.destroy_with_parent {
193             properties.push(("destroy-with-parent", destroy_with_parent));
194         }
195         if let Some(ref focus_on_map) = self.focus_on_map {
196             properties.push(("focus-on-map", focus_on_map));
197         }
198         if let Some(ref focus_visible) = self.focus_visible {
199             properties.push(("focus-visible", focus_visible));
200         }
201         if let Some(ref gravity) = self.gravity {
202             properties.push(("gravity", gravity));
203         }
204         if let Some(ref hide_titlebar_when_maximized) = self.hide_titlebar_when_maximized {
205             properties.push(("hide-titlebar-when-maximized", hide_titlebar_when_maximized));
206         }
207         if let Some(ref icon) = self.icon {
208             properties.push(("icon", icon));
209         }
210         if let Some(ref icon_name) = self.icon_name {
211             properties.push(("icon-name", icon_name));
212         }
213         if let Some(ref mnemonics_visible) = self.mnemonics_visible {
214             properties.push(("mnemonics-visible", mnemonics_visible));
215         }
216         if let Some(ref modal) = self.modal {
217             properties.push(("modal", modal));
218         }
219         if let Some(ref resizable) = self.resizable {
220             properties.push(("resizable", resizable));
221         }
222         if let Some(ref role) = self.role {
223             properties.push(("role", role));
224         }
225         if let Some(ref screen) = self.screen {
226             properties.push(("screen", screen));
227         }
228         if let Some(ref skip_pager_hint) = self.skip_pager_hint {
229             properties.push(("skip-pager-hint", skip_pager_hint));
230         }
231         if let Some(ref skip_taskbar_hint) = self.skip_taskbar_hint {
232             properties.push(("skip-taskbar-hint", skip_taskbar_hint));
233         }
234         if let Some(ref startup_id) = self.startup_id {
235             properties.push(("startup-id", startup_id));
236         }
237         if let Some(ref title) = self.title {
238             properties.push(("title", title));
239         }
240         if let Some(ref transient_for) = self.transient_for {
241             properties.push(("transient-for", transient_for));
242         }
243         if let Some(ref type_) = self.type_ {
244             properties.push(("type", type_));
245         }
246         if let Some(ref type_hint) = self.type_hint {
247             properties.push(("type-hint", type_hint));
248         }
249         if let Some(ref urgency_hint) = self.urgency_hint {
250             properties.push(("urgency-hint", urgency_hint));
251         }
252         if let Some(ref window_position) = self.window_position {
253             properties.push(("window-position", window_position));
254         }
255         if let Some(ref border_width) = self.border_width {
256             properties.push(("border-width", border_width));
257         }
258         if let Some(ref child) = self.child {
259             properties.push(("child", child));
260         }
261         if let Some(ref resize_mode) = self.resize_mode {
262             properties.push(("resize-mode", resize_mode));
263         }
264         if let Some(ref app_paintable) = self.app_paintable {
265             properties.push(("app-paintable", app_paintable));
266         }
267         if let Some(ref can_default) = self.can_default {
268             properties.push(("can-default", can_default));
269         }
270         if let Some(ref can_focus) = self.can_focus {
271             properties.push(("can-focus", can_focus));
272         }
273         if let Some(ref events) = self.events {
274             properties.push(("events", events));
275         }
276         if let Some(ref expand) = self.expand {
277             properties.push(("expand", expand));
278         }
279         #[cfg(any(feature = "v3_20", feature = "dox"))]
280         if let Some(ref focus_on_click) = self.focus_on_click {
281             properties.push(("focus-on-click", focus_on_click));
282         }
283         if let Some(ref halign) = self.halign {
284             properties.push(("halign", halign));
285         }
286         if let Some(ref has_default) = self.has_default {
287             properties.push(("has-default", has_default));
288         }
289         if let Some(ref has_focus) = self.has_focus {
290             properties.push(("has-focus", has_focus));
291         }
292         if let Some(ref has_tooltip) = self.has_tooltip {
293             properties.push(("has-tooltip", has_tooltip));
294         }
295         if let Some(ref height_request) = self.height_request {
296             properties.push(("height-request", height_request));
297         }
298         if let Some(ref hexpand) = self.hexpand {
299             properties.push(("hexpand", hexpand));
300         }
301         if let Some(ref hexpand_set) = self.hexpand_set {
302             properties.push(("hexpand-set", hexpand_set));
303         }
304         if let Some(ref is_focus) = self.is_focus {
305             properties.push(("is-focus", is_focus));
306         }
307         if let Some(ref margin) = self.margin {
308             properties.push(("margin", margin));
309         }
310         if let Some(ref margin_bottom) = self.margin_bottom {
311             properties.push(("margin-bottom", margin_bottom));
312         }
313         if let Some(ref margin_end) = self.margin_end {
314             properties.push(("margin-end", margin_end));
315         }
316         if let Some(ref margin_start) = self.margin_start {
317             properties.push(("margin-start", margin_start));
318         }
319         if let Some(ref margin_top) = self.margin_top {
320             properties.push(("margin-top", margin_top));
321         }
322         if let Some(ref name) = self.name {
323             properties.push(("name", name));
324         }
325         if let Some(ref no_show_all) = self.no_show_all {
326             properties.push(("no-show-all", no_show_all));
327         }
328         if let Some(ref opacity) = self.opacity {
329             properties.push(("opacity", opacity));
330         }
331         if let Some(ref parent) = self.parent {
332             properties.push(("parent", parent));
333         }
334         if let Some(ref receives_default) = self.receives_default {
335             properties.push(("receives-default", receives_default));
336         }
337         if let Some(ref sensitive) = self.sensitive {
338             properties.push(("sensitive", sensitive));
339         }
340         if let Some(ref tooltip_markup) = self.tooltip_markup {
341             properties.push(("tooltip-markup", tooltip_markup));
342         }
343         if let Some(ref tooltip_text) = self.tooltip_text {
344             properties.push(("tooltip-text", tooltip_text));
345         }
346         if let Some(ref valign) = self.valign {
347             properties.push(("valign", valign));
348         }
349         if let Some(ref vexpand) = self.vexpand {
350             properties.push(("vexpand", vexpand));
351         }
352         if let Some(ref vexpand_set) = self.vexpand_set {
353             properties.push(("vexpand-set", vexpand_set));
354         }
355         if let Some(ref visible) = self.visible {
356             properties.push(("visible", visible));
357         }
358         if let Some(ref width_request) = self.width_request {
359             properties.push(("width-request", width_request));
360         }
361         glib::Object::new::<MessageDialog>(&properties)
362             .expect("Failed to create an instance of MessageDialog")
363     }
364 
buttons(mut self, buttons: ButtonsType) -> Self365     pub fn buttons(mut self, buttons: ButtonsType) -> Self {
366         self.buttons = Some(buttons);
367         self
368     }
369 
message_type(mut self, message_type: MessageType) -> Self370     pub fn message_type(mut self, message_type: MessageType) -> Self {
371         self.message_type = Some(message_type);
372         self
373     }
374 
secondary_text(mut self, secondary_text: &str) -> Self375     pub fn secondary_text(mut self, secondary_text: &str) -> Self {
376         self.secondary_text = Some(secondary_text.to_string());
377         self
378     }
379 
secondary_use_markup(mut self, secondary_use_markup: bool) -> Self380     pub fn secondary_use_markup(mut self, secondary_use_markup: bool) -> Self {
381         self.secondary_use_markup = Some(secondary_use_markup);
382         self
383     }
384 
text(mut self, text: &str) -> Self385     pub fn text(mut self, text: &str) -> Self {
386         self.text = Some(text.to_string());
387         self
388     }
389 
use_markup(mut self, use_markup: bool) -> Self390     pub fn use_markup(mut self, use_markup: bool) -> Self {
391         self.use_markup = Some(use_markup);
392         self
393     }
394 
use_header_bar(mut self, use_header_bar: i32) -> Self395     pub fn use_header_bar(mut self, use_header_bar: i32) -> Self {
396         self.use_header_bar = Some(use_header_bar);
397         self
398     }
399 
accept_focus(mut self, accept_focus: bool) -> Self400     pub fn accept_focus(mut self, accept_focus: bool) -> Self {
401         self.accept_focus = Some(accept_focus);
402         self
403     }
404 
application<P: IsA<Application>>(mut self, application: &P) -> Self405     pub fn application<P: IsA<Application>>(mut self, application: &P) -> Self {
406         self.application = Some(application.clone().upcast());
407         self
408     }
409 
attached_to<P: IsA<Widget>>(mut self, attached_to: &P) -> Self410     pub fn attached_to<P: IsA<Widget>>(mut self, attached_to: &P) -> Self {
411         self.attached_to = Some(attached_to.clone().upcast());
412         self
413     }
414 
decorated(mut self, decorated: bool) -> Self415     pub fn decorated(mut self, decorated: bool) -> Self {
416         self.decorated = Some(decorated);
417         self
418     }
419 
default_height(mut self, default_height: i32) -> Self420     pub fn default_height(mut self, default_height: i32) -> Self {
421         self.default_height = Some(default_height);
422         self
423     }
424 
default_width(mut self, default_width: i32) -> Self425     pub fn default_width(mut self, default_width: i32) -> Self {
426         self.default_width = Some(default_width);
427         self
428     }
429 
deletable(mut self, deletable: bool) -> Self430     pub fn deletable(mut self, deletable: bool) -> Self {
431         self.deletable = Some(deletable);
432         self
433     }
434 
destroy_with_parent(mut self, destroy_with_parent: bool) -> Self435     pub fn destroy_with_parent(mut self, destroy_with_parent: bool) -> Self {
436         self.destroy_with_parent = Some(destroy_with_parent);
437         self
438     }
439 
focus_on_map(mut self, focus_on_map: bool) -> Self440     pub fn focus_on_map(mut self, focus_on_map: bool) -> Self {
441         self.focus_on_map = Some(focus_on_map);
442         self
443     }
444 
focus_visible(mut self, focus_visible: bool) -> Self445     pub fn focus_visible(mut self, focus_visible: bool) -> Self {
446         self.focus_visible = Some(focus_visible);
447         self
448     }
449 
gravity(mut self, gravity: gdk::Gravity) -> Self450     pub fn gravity(mut self, gravity: gdk::Gravity) -> Self {
451         self.gravity = Some(gravity);
452         self
453     }
454 
hide_titlebar_when_maximized(mut self, hide_titlebar_when_maximized: bool) -> Self455     pub fn hide_titlebar_when_maximized(mut self, hide_titlebar_when_maximized: bool) -> Self {
456         self.hide_titlebar_when_maximized = Some(hide_titlebar_when_maximized);
457         self
458     }
459 
icon(mut self, icon: &gdk_pixbuf::Pixbuf) -> Self460     pub fn icon(mut self, icon: &gdk_pixbuf::Pixbuf) -> Self {
461         self.icon = Some(icon.clone());
462         self
463     }
464 
icon_name(mut self, icon_name: &str) -> Self465     pub fn icon_name(mut self, icon_name: &str) -> Self {
466         self.icon_name = Some(icon_name.to_string());
467         self
468     }
469 
mnemonics_visible(mut self, mnemonics_visible: bool) -> Self470     pub fn mnemonics_visible(mut self, mnemonics_visible: bool) -> Self {
471         self.mnemonics_visible = Some(mnemonics_visible);
472         self
473     }
474 
modal(mut self, modal: bool) -> Self475     pub fn modal(mut self, modal: bool) -> Self {
476         self.modal = Some(modal);
477         self
478     }
479 
resizable(mut self, resizable: bool) -> Self480     pub fn resizable(mut self, resizable: bool) -> Self {
481         self.resizable = Some(resizable);
482         self
483     }
484 
role(mut self, role: &str) -> Self485     pub fn role(mut self, role: &str) -> Self {
486         self.role = Some(role.to_string());
487         self
488     }
489 
screen(mut self, screen: &gdk::Screen) -> Self490     pub fn screen(mut self, screen: &gdk::Screen) -> Self {
491         self.screen = Some(screen.clone());
492         self
493     }
494 
skip_pager_hint(mut self, skip_pager_hint: bool) -> Self495     pub fn skip_pager_hint(mut self, skip_pager_hint: bool) -> Self {
496         self.skip_pager_hint = Some(skip_pager_hint);
497         self
498     }
499 
skip_taskbar_hint(mut self, skip_taskbar_hint: bool) -> Self500     pub fn skip_taskbar_hint(mut self, skip_taskbar_hint: bool) -> Self {
501         self.skip_taskbar_hint = Some(skip_taskbar_hint);
502         self
503     }
504 
startup_id(mut self, startup_id: &str) -> Self505     pub fn startup_id(mut self, startup_id: &str) -> Self {
506         self.startup_id = Some(startup_id.to_string());
507         self
508     }
509 
title(mut self, title: &str) -> Self510     pub fn title(mut self, title: &str) -> Self {
511         self.title = Some(title.to_string());
512         self
513     }
514 
transient_for<P: IsA<Window>>(mut self, transient_for: &P) -> Self515     pub fn transient_for<P: IsA<Window>>(mut self, transient_for: &P) -> Self {
516         self.transient_for = Some(transient_for.clone().upcast());
517         self
518     }
519 
type_(mut self, type_: WindowType) -> Self520     pub fn type_(mut self, type_: WindowType) -> Self {
521         self.type_ = Some(type_);
522         self
523     }
524 
type_hint(mut self, type_hint: gdk::WindowTypeHint) -> Self525     pub fn type_hint(mut self, type_hint: gdk::WindowTypeHint) -> Self {
526         self.type_hint = Some(type_hint);
527         self
528     }
529 
urgency_hint(mut self, urgency_hint: bool) -> Self530     pub fn urgency_hint(mut self, urgency_hint: bool) -> Self {
531         self.urgency_hint = Some(urgency_hint);
532         self
533     }
534 
window_position(mut self, window_position: WindowPosition) -> Self535     pub fn window_position(mut self, window_position: WindowPosition) -> Self {
536         self.window_position = Some(window_position);
537         self
538     }
539 
border_width(mut self, border_width: u32) -> Self540     pub fn border_width(mut self, border_width: u32) -> Self {
541         self.border_width = Some(border_width);
542         self
543     }
544 
child<P: IsA<Widget>>(mut self, child: &P) -> Self545     pub fn child<P: IsA<Widget>>(mut self, child: &P) -> Self {
546         self.child = Some(child.clone().upcast());
547         self
548     }
549 
resize_mode(mut self, resize_mode: ResizeMode) -> Self550     pub fn resize_mode(mut self, resize_mode: ResizeMode) -> Self {
551         self.resize_mode = Some(resize_mode);
552         self
553     }
554 
app_paintable(mut self, app_paintable: bool) -> Self555     pub fn app_paintable(mut self, app_paintable: bool) -> Self {
556         self.app_paintable = Some(app_paintable);
557         self
558     }
559 
can_default(mut self, can_default: bool) -> Self560     pub fn can_default(mut self, can_default: bool) -> Self {
561         self.can_default = Some(can_default);
562         self
563     }
564 
can_focus(mut self, can_focus: bool) -> Self565     pub fn can_focus(mut self, can_focus: bool) -> Self {
566         self.can_focus = Some(can_focus);
567         self
568     }
569 
events(mut self, events: gdk::EventMask) -> Self570     pub fn events(mut self, events: gdk::EventMask) -> Self {
571         self.events = Some(events);
572         self
573     }
574 
expand(mut self, expand: bool) -> Self575     pub fn expand(mut self, expand: bool) -> Self {
576         self.expand = Some(expand);
577         self
578     }
579 
580     #[cfg(any(feature = "v3_20", feature = "dox"))]
581     #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))]
focus_on_click(mut self, focus_on_click: bool) -> Self582     pub fn focus_on_click(mut self, focus_on_click: bool) -> Self {
583         self.focus_on_click = Some(focus_on_click);
584         self
585     }
586 
halign(mut self, halign: Align) -> Self587     pub fn halign(mut self, halign: Align) -> Self {
588         self.halign = Some(halign);
589         self
590     }
591 
has_default(mut self, has_default: bool) -> Self592     pub fn has_default(mut self, has_default: bool) -> Self {
593         self.has_default = Some(has_default);
594         self
595     }
596 
has_focus(mut self, has_focus: bool) -> Self597     pub fn has_focus(mut self, has_focus: bool) -> Self {
598         self.has_focus = Some(has_focus);
599         self
600     }
601 
has_tooltip(mut self, has_tooltip: bool) -> Self602     pub fn has_tooltip(mut self, has_tooltip: bool) -> Self {
603         self.has_tooltip = Some(has_tooltip);
604         self
605     }
606 
height_request(mut self, height_request: i32) -> Self607     pub fn height_request(mut self, height_request: i32) -> Self {
608         self.height_request = Some(height_request);
609         self
610     }
611 
hexpand(mut self, hexpand: bool) -> Self612     pub fn hexpand(mut self, hexpand: bool) -> Self {
613         self.hexpand = Some(hexpand);
614         self
615     }
616 
hexpand_set(mut self, hexpand_set: bool) -> Self617     pub fn hexpand_set(mut self, hexpand_set: bool) -> Self {
618         self.hexpand_set = Some(hexpand_set);
619         self
620     }
621 
is_focus(mut self, is_focus: bool) -> Self622     pub fn is_focus(mut self, is_focus: bool) -> Self {
623         self.is_focus = Some(is_focus);
624         self
625     }
626 
margin(mut self, margin: i32) -> Self627     pub fn margin(mut self, margin: i32) -> Self {
628         self.margin = Some(margin);
629         self
630     }
631 
margin_bottom(mut self, margin_bottom: i32) -> Self632     pub fn margin_bottom(mut self, margin_bottom: i32) -> Self {
633         self.margin_bottom = Some(margin_bottom);
634         self
635     }
636 
margin_end(mut self, margin_end: i32) -> Self637     pub fn margin_end(mut self, margin_end: i32) -> Self {
638         self.margin_end = Some(margin_end);
639         self
640     }
641 
margin_start(mut self, margin_start: i32) -> Self642     pub fn margin_start(mut self, margin_start: i32) -> Self {
643         self.margin_start = Some(margin_start);
644         self
645     }
646 
margin_top(mut self, margin_top: i32) -> Self647     pub fn margin_top(mut self, margin_top: i32) -> Self {
648         self.margin_top = Some(margin_top);
649         self
650     }
651 
name(mut self, name: &str) -> Self652     pub fn name(mut self, name: &str) -> Self {
653         self.name = Some(name.to_string());
654         self
655     }
656 
no_show_all(mut self, no_show_all: bool) -> Self657     pub fn no_show_all(mut self, no_show_all: bool) -> Self {
658         self.no_show_all = Some(no_show_all);
659         self
660     }
661 
opacity(mut self, opacity: f64) -> Self662     pub fn opacity(mut self, opacity: f64) -> Self {
663         self.opacity = Some(opacity);
664         self
665     }
666 
parent<P: IsA<Container>>(mut self, parent: &P) -> Self667     pub fn parent<P: IsA<Container>>(mut self, parent: &P) -> Self {
668         self.parent = Some(parent.clone().upcast());
669         self
670     }
671 
receives_default(mut self, receives_default: bool) -> Self672     pub fn receives_default(mut self, receives_default: bool) -> Self {
673         self.receives_default = Some(receives_default);
674         self
675     }
676 
sensitive(mut self, sensitive: bool) -> Self677     pub fn sensitive(mut self, sensitive: bool) -> Self {
678         self.sensitive = Some(sensitive);
679         self
680     }
681 
tooltip_markup(mut self, tooltip_markup: &str) -> Self682     pub fn tooltip_markup(mut self, tooltip_markup: &str) -> Self {
683         self.tooltip_markup = Some(tooltip_markup.to_string());
684         self
685     }
686 
tooltip_text(mut self, tooltip_text: &str) -> Self687     pub fn tooltip_text(mut self, tooltip_text: &str) -> Self {
688         self.tooltip_text = Some(tooltip_text.to_string());
689         self
690     }
691 
valign(mut self, valign: Align) -> Self692     pub fn valign(mut self, valign: Align) -> Self {
693         self.valign = Some(valign);
694         self
695     }
696 
vexpand(mut self, vexpand: bool) -> Self697     pub fn vexpand(mut self, vexpand: bool) -> Self {
698         self.vexpand = Some(vexpand);
699         self
700     }
701 
vexpand_set(mut self, vexpand_set: bool) -> Self702     pub fn vexpand_set(mut self, vexpand_set: bool) -> Self {
703         self.vexpand_set = Some(vexpand_set);
704         self
705     }
706 
visible(mut self, visible: bool) -> Self707     pub fn visible(mut self, visible: bool) -> Self {
708         self.visible = Some(visible);
709         self
710     }
711 
width_request(mut self, width_request: i32) -> Self712     pub fn width_request(mut self, width_request: i32) -> Self {
713         self.width_request = Some(width_request);
714         self
715     }
716 }
717 
718 pub const NONE_MESSAGE_DIALOG: Option<&MessageDialog> = None;
719 
720 pub trait MessageDialogExt: 'static {
721     //#[doc(alias = "gtk_message_dialog_format_secondary_markup")]
722     //fn format_secondary_markup(&self, message_format: &str, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs);
723 
724     //#[doc(alias = "gtk_message_dialog_format_secondary_text")]
725     //fn format_secondary_text(&self, message_format: Option<&str>, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs);
726 
727     #[doc(alias = "gtk_message_dialog_get_message_area")]
728     #[doc(alias = "get_message_area")]
message_area(&self) -> Widget729     fn message_area(&self) -> Widget;
730 
731     #[doc(alias = "gtk_message_dialog_set_markup")]
set_markup(&self, str: &str)732     fn set_markup(&self, str: &str);
733 
734     #[doc(alias = "message-type")]
message_type(&self) -> MessageType735     fn message_type(&self) -> MessageType;
736 
737     #[doc(alias = "message-type")]
set_message_type(&self, message_type: MessageType)738     fn set_message_type(&self, message_type: MessageType);
739 
740     #[doc(alias = "secondary-text")]
secondary_text(&self) -> Option<glib::GString>741     fn secondary_text(&self) -> Option<glib::GString>;
742 
743     #[doc(alias = "secondary-text")]
set_secondary_text(&self, secondary_text: Option<&str>)744     fn set_secondary_text(&self, secondary_text: Option<&str>);
745 
746     #[doc(alias = "secondary-use-markup")]
is_secondary_use_markup(&self) -> bool747     fn is_secondary_use_markup(&self) -> bool;
748 
749     #[doc(alias = "secondary-use-markup")]
set_secondary_use_markup(&self, secondary_use_markup: bool)750     fn set_secondary_use_markup(&self, secondary_use_markup: bool);
751 
text(&self) -> Option<glib::GString>752     fn text(&self) -> Option<glib::GString>;
753 
set_text(&self, text: Option<&str>)754     fn set_text(&self, text: Option<&str>);
755 
756     #[doc(alias = "use-markup")]
uses_markup(&self) -> bool757     fn uses_markup(&self) -> bool;
758 
759     #[doc(alias = "use-markup")]
set_use_markup(&self, use_markup: bool)760     fn set_use_markup(&self, use_markup: bool);
761 
762     #[doc(alias = "message-area")]
connect_message_area_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId763     fn connect_message_area_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
764 
765     #[doc(alias = "message-type")]
connect_message_type_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId766     fn connect_message_type_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
767 
768     #[doc(alias = "secondary-text")]
connect_secondary_text_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId769     fn connect_secondary_text_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
770 
771     #[doc(alias = "secondary-use-markup")]
connect_secondary_use_markup_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId772     fn connect_secondary_use_markup_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
773 
774     #[doc(alias = "text")]
connect_text_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId775     fn connect_text_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
776 
777     #[doc(alias = "use-markup")]
connect_use_markup_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId778     fn connect_use_markup_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
779 }
780 
781 impl<O: IsA<MessageDialog>> MessageDialogExt for O {
782     //fn format_secondary_markup(&self, message_format: &str, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs) {
783     //    unsafe { TODO: call ffi:gtk_message_dialog_format_secondary_markup() }
784     //}
785 
786     //fn format_secondary_text(&self, message_format: Option<&str>, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs) {
787     //    unsafe { TODO: call ffi:gtk_message_dialog_format_secondary_text() }
788     //}
789 
message_area(&self) -> Widget790     fn message_area(&self) -> Widget {
791         unsafe {
792             from_glib_none(ffi::gtk_message_dialog_get_message_area(
793                 self.as_ref().to_glib_none().0,
794             ))
795         }
796     }
797 
set_markup(&self, str: &str)798     fn set_markup(&self, str: &str) {
799         unsafe {
800             ffi::gtk_message_dialog_set_markup(
801                 self.as_ref().to_glib_none().0,
802                 str.to_glib_none().0,
803             );
804         }
805     }
806 
message_type(&self) -> MessageType807     fn message_type(&self) -> MessageType {
808         unsafe {
809             let mut value = glib::Value::from_type(<MessageType as StaticType>::static_type());
810             glib::gobject_ffi::g_object_get_property(
811                 self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
812                 b"message-type\0".as_ptr() as *const _,
813                 value.to_glib_none_mut().0,
814             );
815             value
816                 .get()
817                 .expect("Return Value for property `message-type` getter")
818         }
819     }
820 
set_message_type(&self, message_type: MessageType)821     fn set_message_type(&self, message_type: MessageType) {
822         unsafe {
823             glib::gobject_ffi::g_object_set_property(
824                 self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
825                 b"message-type\0".as_ptr() as *const _,
826                 message_type.to_value().to_glib_none().0,
827             );
828         }
829     }
830 
secondary_text(&self) -> Option<glib::GString>831     fn secondary_text(&self) -> Option<glib::GString> {
832         unsafe {
833             let mut value = glib::Value::from_type(<glib::GString as StaticType>::static_type());
834             glib::gobject_ffi::g_object_get_property(
835                 self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
836                 b"secondary-text\0".as_ptr() as *const _,
837                 value.to_glib_none_mut().0,
838             );
839             value
840                 .get()
841                 .expect("Return Value for property `secondary-text` getter")
842         }
843     }
844 
set_secondary_text(&self, secondary_text: Option<&str>)845     fn set_secondary_text(&self, secondary_text: Option<&str>) {
846         unsafe {
847             glib::gobject_ffi::g_object_set_property(
848                 self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
849                 b"secondary-text\0".as_ptr() as *const _,
850                 secondary_text.to_value().to_glib_none().0,
851             );
852         }
853     }
854 
is_secondary_use_markup(&self) -> bool855     fn is_secondary_use_markup(&self) -> bool {
856         unsafe {
857             let mut value = glib::Value::from_type(<bool as StaticType>::static_type());
858             glib::gobject_ffi::g_object_get_property(
859                 self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
860                 b"secondary-use-markup\0".as_ptr() as *const _,
861                 value.to_glib_none_mut().0,
862             );
863             value
864                 .get()
865                 .expect("Return Value for property `secondary-use-markup` getter")
866         }
867     }
868 
set_secondary_use_markup(&self, secondary_use_markup: bool)869     fn set_secondary_use_markup(&self, secondary_use_markup: bool) {
870         unsafe {
871             glib::gobject_ffi::g_object_set_property(
872                 self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
873                 b"secondary-use-markup\0".as_ptr() as *const _,
874                 secondary_use_markup.to_value().to_glib_none().0,
875             );
876         }
877     }
878 
text(&self) -> Option<glib::GString>879     fn text(&self) -> Option<glib::GString> {
880         unsafe {
881             let mut value = glib::Value::from_type(<glib::GString as StaticType>::static_type());
882             glib::gobject_ffi::g_object_get_property(
883                 self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
884                 b"text\0".as_ptr() as *const _,
885                 value.to_glib_none_mut().0,
886             );
887             value
888                 .get()
889                 .expect("Return Value for property `text` getter")
890         }
891     }
892 
set_text(&self, text: Option<&str>)893     fn set_text(&self, text: Option<&str>) {
894         unsafe {
895             glib::gobject_ffi::g_object_set_property(
896                 self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
897                 b"text\0".as_ptr() as *const _,
898                 text.to_value().to_glib_none().0,
899             );
900         }
901     }
902 
uses_markup(&self) -> bool903     fn uses_markup(&self) -> bool {
904         unsafe {
905             let mut value = glib::Value::from_type(<bool as StaticType>::static_type());
906             glib::gobject_ffi::g_object_get_property(
907                 self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
908                 b"use-markup\0".as_ptr() as *const _,
909                 value.to_glib_none_mut().0,
910             );
911             value
912                 .get()
913                 .expect("Return Value for property `use-markup` getter")
914         }
915     }
916 
set_use_markup(&self, use_markup: bool)917     fn set_use_markup(&self, use_markup: bool) {
918         unsafe {
919             glib::gobject_ffi::g_object_set_property(
920                 self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
921                 b"use-markup\0".as_ptr() as *const _,
922                 use_markup.to_value().to_glib_none().0,
923             );
924         }
925     }
926 
connect_message_area_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId927     fn connect_message_area_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
928         unsafe extern "C" fn notify_message_area_trampoline<
929             P: IsA<MessageDialog>,
930             F: Fn(&P) + 'static,
931         >(
932             this: *mut ffi::GtkMessageDialog,
933             _param_spec: glib::ffi::gpointer,
934             f: glib::ffi::gpointer,
935         ) {
936             let f: &F = &*(f as *const F);
937             f(MessageDialog::from_glib_borrow(this).unsafe_cast_ref())
938         }
939         unsafe {
940             let f: Box_<F> = Box_::new(f);
941             connect_raw(
942                 self.as_ptr() as *mut _,
943                 b"notify::message-area\0".as_ptr() as *const _,
944                 Some(transmute::<_, unsafe extern "C" fn()>(
945                     notify_message_area_trampoline::<Self, F> as *const (),
946                 )),
947                 Box_::into_raw(f),
948             )
949         }
950     }
951 
connect_message_type_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId952     fn connect_message_type_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
953         unsafe extern "C" fn notify_message_type_trampoline<
954             P: IsA<MessageDialog>,
955             F: Fn(&P) + 'static,
956         >(
957             this: *mut ffi::GtkMessageDialog,
958             _param_spec: glib::ffi::gpointer,
959             f: glib::ffi::gpointer,
960         ) {
961             let f: &F = &*(f as *const F);
962             f(MessageDialog::from_glib_borrow(this).unsafe_cast_ref())
963         }
964         unsafe {
965             let f: Box_<F> = Box_::new(f);
966             connect_raw(
967                 self.as_ptr() as *mut _,
968                 b"notify::message-type\0".as_ptr() as *const _,
969                 Some(transmute::<_, unsafe extern "C" fn()>(
970                     notify_message_type_trampoline::<Self, F> as *const (),
971                 )),
972                 Box_::into_raw(f),
973             )
974         }
975     }
976 
connect_secondary_text_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId977     fn connect_secondary_text_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
978         unsafe extern "C" fn notify_secondary_text_trampoline<
979             P: IsA<MessageDialog>,
980             F: Fn(&P) + 'static,
981         >(
982             this: *mut ffi::GtkMessageDialog,
983             _param_spec: glib::ffi::gpointer,
984             f: glib::ffi::gpointer,
985         ) {
986             let f: &F = &*(f as *const F);
987             f(MessageDialog::from_glib_borrow(this).unsafe_cast_ref())
988         }
989         unsafe {
990             let f: Box_<F> = Box_::new(f);
991             connect_raw(
992                 self.as_ptr() as *mut _,
993                 b"notify::secondary-text\0".as_ptr() as *const _,
994                 Some(transmute::<_, unsafe extern "C" fn()>(
995                     notify_secondary_text_trampoline::<Self, F> as *const (),
996                 )),
997                 Box_::into_raw(f),
998             )
999         }
1000     }
1001 
connect_secondary_use_markup_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1002     fn connect_secondary_use_markup_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1003         unsafe extern "C" fn notify_secondary_use_markup_trampoline<
1004             P: IsA<MessageDialog>,
1005             F: Fn(&P) + 'static,
1006         >(
1007             this: *mut ffi::GtkMessageDialog,
1008             _param_spec: glib::ffi::gpointer,
1009             f: glib::ffi::gpointer,
1010         ) {
1011             let f: &F = &*(f as *const F);
1012             f(MessageDialog::from_glib_borrow(this).unsafe_cast_ref())
1013         }
1014         unsafe {
1015             let f: Box_<F> = Box_::new(f);
1016             connect_raw(
1017                 self.as_ptr() as *mut _,
1018                 b"notify::secondary-use-markup\0".as_ptr() as *const _,
1019                 Some(transmute::<_, unsafe extern "C" fn()>(
1020                     notify_secondary_use_markup_trampoline::<Self, F> as *const (),
1021                 )),
1022                 Box_::into_raw(f),
1023             )
1024         }
1025     }
1026 
connect_text_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1027     fn connect_text_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1028         unsafe extern "C" fn notify_text_trampoline<P: IsA<MessageDialog>, F: Fn(&P) + 'static>(
1029             this: *mut ffi::GtkMessageDialog,
1030             _param_spec: glib::ffi::gpointer,
1031             f: glib::ffi::gpointer,
1032         ) {
1033             let f: &F = &*(f as *const F);
1034             f(MessageDialog::from_glib_borrow(this).unsafe_cast_ref())
1035         }
1036         unsafe {
1037             let f: Box_<F> = Box_::new(f);
1038             connect_raw(
1039                 self.as_ptr() as *mut _,
1040                 b"notify::text\0".as_ptr() as *const _,
1041                 Some(transmute::<_, unsafe extern "C" fn()>(
1042                     notify_text_trampoline::<Self, F> as *const (),
1043                 )),
1044                 Box_::into_raw(f),
1045             )
1046         }
1047     }
1048 
connect_use_markup_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1049     fn connect_use_markup_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1050         unsafe extern "C" fn notify_use_markup_trampoline<
1051             P: IsA<MessageDialog>,
1052             F: Fn(&P) + 'static,
1053         >(
1054             this: *mut ffi::GtkMessageDialog,
1055             _param_spec: glib::ffi::gpointer,
1056             f: glib::ffi::gpointer,
1057         ) {
1058             let f: &F = &*(f as *const F);
1059             f(MessageDialog::from_glib_borrow(this).unsafe_cast_ref())
1060         }
1061         unsafe {
1062             let f: Box_<F> = Box_::new(f);
1063             connect_raw(
1064                 self.as_ptr() as *mut _,
1065                 b"notify::use-markup\0".as_ptr() as *const _,
1066                 Some(transmute::<_, unsafe extern "C" fn()>(
1067                     notify_use_markup_trampoline::<Self, F> as *const (),
1068                 )),
1069                 Box_::into_raw(f),
1070             )
1071         }
1072     }
1073 }
1074 
1075 impl fmt::Display for MessageDialog {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result1076     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1077         f.write_str("MessageDialog")
1078     }
1079 }
1080