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